Skip to content

Add spline interpolation methods and redraw() API#107

Merged
koaning merged 6 commits intomainfrom
koaning/spline-methods
Jan 26, 2026
Merged

Add spline interpolation methods and redraw() API#107
koaning merged 6 commits intomainfrom
koaning/spline-methods

Conversation

@koaning
Copy link
Owner

@koaning koaning commented Jan 26, 2026

Summary

  • Added 4 new interpolation methods to spline demo: Step (zero-order), Nearest, Quadratic, and Barycentric
  • Changed from_callback API to draw_fn(ax, widget) for better multi-puck support
  • Added redraw() method to ChartPuck for manual chart updates
  • Refactored Dynamic Chart Updates and K-Means demos to use new pattern

Test plan

  • Run uv run marimo edit demos/chartpuck.py and test:
    • Drag pucks in Spline Curve Editor, change interpolation method dropdown - pucks stay in place
    • Drag pucks in Dynamic Chart Updates - chart updates
    • Drag pucks in K-Means demo - boundaries update

🤖 Generated with Claude Code

koaning and others added 6 commits January 26, 2026 12:44
Simplifies the K-Means clustering demo by using ChartPuck.from_callback with the new draw_fn(ax, widget) API. Eliminates manual observer setup and figure management, making the code cleaner and more consistent with the spline editor.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Update test_from_callback_creates_widget_and_updates to use the new
draw_fn(ax, widget) signature instead of the old draw_fn(ax, x, y).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Keep wigglystuff pinned to 0.2.17 but remove version pins from
matplotlib, numpy, scikit-learn, and scipy so WASM can load them.
Also fix Python version requirement to >=3.10.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@koaning koaning merged commit 98277d7 into main Jan 26, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant