feat(plotly): add reactive strip chart selection support#9012
Open
axsseldz wants to merge 26 commits intomarimo-team:mainfrom
Open
feat(plotly): add reactive strip chart selection support#9012axsseldz wants to merge 26 commits intomarimo-team:mainfrom
axsseldz wants to merge 26 commits intomarimo-team:mainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
There was a problem hiding this comment.
Pull request overview
Enables selection reactivity for Plotly box/violin traces (and therefore px.strip, which renders as go.Box) in mo.ui.plotly, including click-selection support in the frontend and row-level expansion/extraction on the Python side.
Changes:
- Frontend: handle click selections for
type === "box"andtype === "violin". - Python: add box/violin selection expansion/extraction helpers and hook them into
_convert_value. - Add extensive tests plus a new strip-chart example and docs update.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
marimo/_plugins/ui/_impl/plotly.py |
Adds box/violin selection expansion (click pointNumbers) and range-based extraction logic. |
tests/_plugins/ui/_impl/test_plotly.py |
Adds unit tests covering box/violin/strip selection conversion and extraction helpers. |
frontend/src/plugins/impl/plotly/selection.ts |
Allows click-selection handling for box/violin traces. |
frontend/src/plugins/impl/plotly/__tests__/selection.test.ts |
Adds tests asserting click-selection eligibility for box/violin. |
examples/third_party/plotly/strip_chart.py |
New example demonstrating reactive strip-chart selection workflows. |
docs/api/plotting.md |
Updates documentation of which Plotly chart types support reactive selection. |
b2adcbe to
a9d7b60
Compare
a9d7b60 to
75c505f
Compare
75c505f to
0891779
Compare
Resolves conflicts between waterfall (merged to main) and strip/box/violin additions. Both feature sets are now present: waterfall handlers are inserted before the box/violin handlers in _convert_value, and all function definitions are included. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Resolves conflicts between waterfall (merged to main) and funnel additions. Both feature sets included: waterfall handlers inserted before funnel handlers in _convert_value, all function definitions and tests from both branches kept. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Fix unsafe np.asarray(val_data, dtype=np.float64) call: wrap in try/except and fall back to element-wise extraction when val_data contains None or non-numeric entries (comment 1) - Fix off-by-one in overlap check: use >= val_min (inclusive lower bound) in both the numpy fast path and the pure-Python fallback, consistent with bar selection behavior (comment 2) - Correct docstring: click path strips empty placeholders and re-syncs indices; it does not deduplicate (comment 3) - Update docs to mention funnelarea support explicitly (comment 4) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
6 tasks
Merges violin plot and area chart support from main while preserving box/strip plot additions. `hasAreaTrace` added to TS, both `_append_box_points_to_selection` and `_append_violin_points_to_selection` coexist in Python with their full helper function hierarchies. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Syncs strip chart support into box branch so both can merge into main independently without conflicts. Adds strip chart example, strip test section, and updated supported-charts documentation. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds funnel/funnelarea chart support from feat/reactive-plotly-funnel so that both branches can merge into main independently without conflicts. Includes funnel/funnelarea trace types, test cases, and docs updates. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
6 tasks
The cross-branch merge left two competing implementations of _append_box_points_to_selection and its helpers, plus duplicate _build_waterfall_point and _append_map_scatter_points_to_selection. Python silently used the last definition; pyright caught all six [no-redef] errors in CI. Removes the dead first copies. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
3c2b51d to
64bd761
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📝 Summary
Makes
px.stripfully selection-reactive inmo.ui.plotly. Strip charts arego.Boxtraces under the hood (boxpoints="all", transparent fill), so this PR combines the box and violin implementations from the sibling branches onto one branch.🔍 Description of Changes
type === "box"andtype === "violin"toshouldHandleClickSelection._append_*,_extract_*,_build_*helpers). Strip chart reactivity comes for free through the box path.examples/third_party/plotly/strip_chart.py—px.strip()grouped,go.Boxsingle-trace, and horizontal variants with live stats andmo.ui.table.Box Selection
Click Selection
📋 Pre-Review Checklist
✅ Merge Checklist
@mscolnick @nojaf