Repository navigation
Open
Labels
enhancementNew feature or request
Description
Need
A user compares about 100 process runs (#88). Several charts show one line per run, for example pressure and temperature. The user wants to double-click one run in a legend and then see only that run in every chart, not only in the chart that they clicked.
Current state
- Each figure is its own Plotly graph with Plotly's default legend. A click hides or shows one trace, and a double-click isolates one trace, inside that figure only.
legendVisibilityByUid(flexviz/adapters/js/plotly/traces.js) keeps the visibility of each trace across re-renders, keyed by logical uid. A grouped child's uid derives from its parent uid and its group value (_child_uid_for_group,flexviz/trace/base.py), so the same run has a different uid in each figure.- Colors already agree across figures. Grouped traces with the same source and
group_byshareparams.group_domain_key("{source}::{group_by}",flexviz/trace/base.py).ensureGroupColor(flexviz/adapters/js/runtime/delta.js) stores one color per group value in the client-ownedstate.group_domains. Each grouped child result carries itsgroup_value_key.
What is needed
- Identity. A legend item is the pair (
group_domain_key,group_value_key). Items with the same pair in other figures are the same group. - Shared runtime. Keep the linked visibility on the client, keyed by that pair, like
legendVisibilityByUid. It is interaction state, so the server does not need it. - Plotly adapter. Handle
plotly_legenddoubleclickinflexviz/adapters/js/plotly/init.js. Apply the visibility to every figure that has the pair, behind the programmatic-update guard, and returnfalseto stop Plotly's own per-figure toggle. Ungrouped traces keep Plotly's default behavior. - Decisions.
- Link a single click (hide one run) too, or only the double-click (isolate one run)?
- Always on for grouped traces that share a
group_domain_key, or opt-in onDashboard, likelink_axes? - A second double-click shows all groups again, in every figure.
- Readback. Decide whether
window.flexvizState()reports the hidden groups, so that an agent sees which run the user isolated. - Tests. A browser test with two figures grouped by the same column: a double-click on one legend item leaves only that group in both figures, and a second double-click shows all groups again. A zoom or a selection after the double-click keeps the isolation.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or request
Activity
richjli commentedon Oct 14, 2026
Is it feasible to implement a shared legend across multiple stacked Plotly figures such that there's one legend instead of a legend for each separate plot? I would like to approximate Plotly faceting feature, which looks something like this: