feat(plotly): add reactive strip chart selection support#9012
feat(plotly): add reactive strip chart selection support#9012axsseldz wants to merge 28 commits intomarimo-team:mainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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>
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>
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
Bundle ReportChanges will increase total bundle size by 12.8kB (0.05%) ⬆️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: marimo-esmAssets Changed:
Files in
|
|
@axsseldz , im guessing the original PR implemented features that were in all 3 PRs. Is there anything left? We can close this PR. |
oh yeah my bad, these changes are already implemented, i'll close this PR and move on to the next changes i mentioned(: |
📝 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