-
Notifications
You must be signed in to change notification settings - Fork 860
Add support for reactive line charts for plotly #7735
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request adds support for reactive line charts in Plotly, extending the existing reactive plot functionality that already supported scatter plots, heatmaps, treemaps, and sunburst charts. The implementation follows Altair's behavior by extracting all points within the x-range of a box selection, regardless of y-values.
Key Changes
- Added scatter/line point extraction functions (
_extract_scatter_points_numpyand_extract_scatter_points_fallback) that filter points by x-range only - Integrated scatter point extraction into the selection workflow via
_append_scatter_points_to_selection - Added comprehensive test coverage for line charts, including tests for pure lines, lines with markers, multiple traces, and edge cases
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| marimo/_plugins/ui/_impl/plotly.py | Added scatter/line point extraction functions and integrated them into the selection workflow, updated documentation to mention line chart support |
| tests/_plugins/ui/_impl/test_plotly.py | Added comprehensive test coverage for line chart functionality, updated existing tests to reflect new behavior where scatter selections extract all points in x-range |
| examples/third_party/plotly/line_chart.py | Added example demonstrating reactive line charts with simple lines, lines with markers, and multiple line traces |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
1b2e692 to
1642e74
Compare
📝 Summary
Similar to #7546, we also want Plotly line charts to be reactive.
(Also see #7733)
🔍 Description of Changes
📋 Checklist