Skip to content

Commit b95d26d

Browse files
axsseldzclaude
andauthored
feat(plotly): add reactive funnel and funnelarea selection support (#9044)
## 📝 Summary Adds click-based selection support for `funnel` and `funnelarea` Plotly trace types, making them fully reactive in `mo.ui.plotly`. ## 🔍 Description of Changes - **Frontend**: `shouldHandleClickSelection` now handles `"funnel"` and `"funnelarea"` clicks; `extractPoints` returns trace-appropriate fields (`x`, `y`, `label`, `value`, percentages for funnel; `label`, `value`, percentages for funnelarea — no x/y) - **Backend**: `_convert_value` dispatches to `_append_funnel_points_to_selection` and `_append_funnelarea_points_to_selection`; range selections extract stages by value overlap; click selections pass through with index resync - **Example**: `examples/third_party/plotly/funnel_chart.py` with `px.funnel`, multi-trace regional funnel, and `go.Funnelarea` ## Selection <img width="946" height="661" alt="funnel" src="https://github.com/user-attachments/assets/48b8a48f-c4c9-4943-a873-756f62ef2be4" /> ## 📋 Pre-Review Checklist <!-- These checks need to be completed before a PR is reviewed --> - [ ] For large changes, or changes that affect the public API: this change was discussed or approved through an issue, on [Discord](https://marimo.io/discord?ref=pr), or the community [discussions](https://github.com/marimo-team/marimo/discussions) (Please provide a link if applicable). - [x] Any AI generated code has been reviewed line-by-line by the human PR author, who stands by it. - [x] Video or media evidence is provided for any visual changes (optional). <!-- PR is more likely to be merged if evidence is provided for changes made --> ## ✅ Merge Checklist - [x] I have read the [contributor guidelines](https://github.com/marimo-team/marimo/blob/main/CONTRIBUTING.md). - [x] Documentation has been updated where applicable, including docstrings for API changes. - [x] Tests have been added for the changes made. @mscolnick @nojaf --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 861512a commit b95d26d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

examples/third_party/plotly/funnel_chart.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
# requires-python = ">=3.10"
33
# dependencies = [
44
# "marimo",
5-
# "pandas==2.3.0",
6-
# "plotly==6.0.1",
5+
# "pandas==2.3.3",
6+
# "plotly==6.5.1",
77
# ]
88
# ///
99

0 commit comments

Comments
 (0)