Skip to content

Conversation

@nojaf
Copy link
Contributor

@nojaf nojaf commented Jan 8, 2026

📝 Summary

Similar to #7546, we also want Plotly line charts to be reactive.

(Also see #7733)

🔍 Description of Changes

image

📋 Checklist

  • I have read the contributor guidelines.
  • For large changes, or changes that affect the public API: this change was discussed or approved through an issue, on Discord, or the community discussions (Please provide a link if applicable).
  • I have added tests for the changes made.
  • I have run the code and verified that it works as expected.

@nojaf nojaf requested a review from akshayka as a code owner January 8, 2026 14:18
@vercel
Copy link

vercel bot commented Jan 8, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
marimo-docs Ready Ready Preview, Comment Jan 8, 2026 3:31pm

Copy link
Contributor

Copilot AI left a 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_numpy and _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.

mscolnick
mscolnick previously approved these changes Jan 8, 2026
@mscolnick mscolnick merged commit 8aff126 into marimo-team:main Jan 8, 2026
32 of 41 checks passed
@nojaf nojaf mentioned this pull request Jan 9, 2026
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants