feat(plotly): add reactive funnel, funnelarea and strip selection support#9044
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Pull request overview
Adds reactive selection support for Plotly funnel and funnelarea traces in mo.ui.plotly, extending both frontend click-payload extraction and backend selection conversion so these chart types behave like other reactive Plotly traces.
Changes:
- Frontend: Treat
funnel/funnelareaas click-selectable trace types and extract trace-specific fields from click payloads. - Backend: Convert selections for
funnel(range + click cleanup) andfunnelarea(click cleanup + index resync). - Tests/docs/examples: Add coverage, update docs, and introduce a new funnel selection example.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
tests/_plugins/ui/_impl/test_plotly.py |
Adds backend tests for funnel/funnelarea click and range selection behavior. |
marimo/_plugins/ui/_impl/plotly.py |
Implements funnel range extraction + click cleanup; adds funnelarea click cleanup. |
frontend/src/plugins/impl/plotly/selection.ts |
Adds click selection handling and key extraction for funnel/funnelarea click payloads. |
frontend/src/plugins/impl/plotly/__tests__/selection.test.ts |
Adds frontend unit tests for funnel/funnelarea click handling + extracted fields. |
examples/third_party/plotly/funnel_chart.py |
New example demonstrating reactive funnel and funnelarea selections. |
docs/api/plotting.md |
Updates docs to list funnel charts as supported for reactive selection. |
4ca30aa to
328a547
Compare
|
@axsseldz sorry looks like there are some merge conflicts again. if there are more, feel free to group some of these PRs together and branch them on top of each other |
yeap, i'll take a look, ill let you know once its done, tyy! |
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>
hey @mscolnick i think this PR and (#9012) had similar merge conflicts so i just updated both of them, either way if i keep getting these merge conflicts ill stack them, but for now both should be fine 👍 |
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>
4e19bcb to
de60f47
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
|
|
There's some merge conflicts. |
📝 Summary
Adds click-based selection support for
funnelandfunnelareaPlotly trace types, making them fully reactive inmo.ui.plotly.🔍 Description of Changes
shouldHandleClickSelectionnow handles"funnel"and"funnelarea"clicks;extractPointsreturns trace-appropriate fields (x,y,label,value, percentages for funnel;label,value, percentages for funnelarea — no x/y)_convert_valuedispatches to_append_funnel_points_to_selectionand_append_funnelarea_points_to_selection; range selections extract stages by value overlap; click selections pass through with index resyncexamples/third_party/plotly/funnel_chart.pywithpx.funnel, multi-trace regional funnel, andgo.FunnelareaSelection
📋 Pre-Review Checklist
✅ Merge Checklist
@mscolnick @nojaf