Altinity / Altinity/altinity-sql-browser
[SS] Add Dashboard cross-filtering from chart and table selections
Nessuno ha ancora preso questa issue.
- Lingua principale
- TypeScript
- Stelle
- 8
- Fork
- 2
- Merge medio
- 1h 34m
- PR unite (30g)
- 6
Descrizione
Summary
Add Superset-style cross-filtering so an analyst can click a chart mark or table value and use that exact underlying value as a Dashboard filter for other tiles.
This should extend the typed Dashboard filter/execution architecture already used by manual filters and synchronized time-range brushing. It must not introduce a second ad hoc filtering path or interpolate values into SQL.
User value
Analysts should be able to move from viewing a dashboard to asking a follow-up question without leaving the page:
- Click a bar, point, slice, legend value, or eligible table cell.
- See the corresponding Dashboard filter update immediately.
- Rerun only the affected tiles once.
- Click again, use the filter bar, or use an accessible action to change/clear the selection.
Authoring contract
Cross-filter behavior must be explicitly authored and portable. Do not infer targets from display labels.
Use saved-query/panel metadata that maps:
- an exact raw result-column name;
- to a query parameter name;
- with optional interaction behavior such as replace versus toggle.
The Dashboard resolves the parameter to exactly one compatible filter definition. Ambiguous, missing, or type-incompatible mappings must fail closed with a visible diagnostic and leave the visualization non-interactive.
The contract should remain portable between Dashboards; avoid persisting a Dashboard-specific filter id in the saved query unless a tile-local override is used.
Interaction semantics
- Use the raw result value, never the formatted label.
- Plain click applies/replaces a scalar selection.
- Array-compatible filters may support additive/toggle selection through an explicit modifier or authored mode.
- A click on empty plot/background does nothing.
- A sub-threshold click must not conflict with chart brushing.
- Command/Ctrl-drag remains tile movement and must not trigger cross-filtering.
- Cross-filter state is visible and editable in the existing filter bar.
- Provide a keyboard-accessible equivalent action for focused marks/rows where the rendering surface supports it.
- Announce successful application or validation failure through the existing live region.
Execution semantics
- Resolve and validate the proposed value through the existing typed parameter pipeline.
- Commit filter state only after validation succeeds.
- Reserve affected tile generations synchronously before asynchronous preflight/source work.
- Cancel/supersede the previous affected wave once.
- Rerun each dependent tile once, including non-chart executable panels.
- Prevent stale results from the previous selection replacing newer results.
- Do not mutate saved queries, Dashboard documents, layout, workspace revision, or exported presentation data.
Supported surfaces for v1
- vertical and horizontal bars;
- line/area points where a discrete raw dimension value is available;
- pie slices;
- table cells;
- legend values when they correspond to an authored raw field.
Unsupported shapes must remain ordinary visualizations rather than guessing.
Visual state
- Show the active selected mark/value without replacing normal hover/tooltip behavior.
- Keep selections synchronized with external changes from the filter bar.
- Clear stale selected styling when a chart rerenders, a tile changes query/config, or the Dashboard route is destroyed.
- Multiple independent filters and interaction groups may coexist.
Tests
Cover:
- raw value versus formatted label;
- scalar replacement and array toggle behavior;
- unresolved/ambiguous/incompatible mappings;
- chart, pie, table, and legend sources;
- cross-filter plus existing manual filters;
- no conflict with time-range brushing or Command/Ctrl tile movement;
- one affected execution wave and one execution per dependent tile;
- stale-wave protection during rapid consecutive clicks;
- validation failure performs no partial mutation;
- external filter-bar changes update selected styling;
- route/rerender/destruction cleanup;
- light/dark themes and Chromium/Firefox/WebKit.
Acceptance criteria
- Authors can explicitly map a raw visualization field to a Dashboard filter parameter.
- Clicking an eligible mark/value applies the typed filter without SQL interpolation.
- The existing filter bar reflects and can edit/clear the selection.
- Only affected tiles rerun, exactly once per committed selection.
- Rapid selections cannot publish stale results.
- Ambiguous or invalid mappings fail closed with diagnostics.
- Time-range brushing, tooltips, and tile movement retain their current behavior.
- Unit and real-browser tests pass.
Non-goals
- automatic semantic joins between unrelated queries;
- guessing filter mappings from labels;
- arbitrary SQL rewriting;
- lasso/multi-mark selection;
- persistent bookmark state beyond the existing Dashboard filter-state mechanism;
- a full semantic dataset layer.
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia tracciando l’architettura tipizzata esistente di filtraggio/esecuzione di Dashboard, i filtri manuali, il brushing sincronizzato dell’intervallo temporale, la barra dei filtri e le superfici di rendering supportate per grafici/tabelle. Definisci il completamento in base ai requisiti indicati di authoring, validazione, esecuzione, interazione, pulizia e test in un browser reale, includendo un’unica fase di esecuzione interessata e la protezione dai risultati obsoleti.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- typescript
- Ambito
- data-visualization, frontend, testing-qa
- Tipo di issue
- Funzionalità
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Stato di attività
- Tranquilla
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 28/100