Skip to content

feat(core): support interactive cross-filtering on charts (#1111) - #3324

Closed
FrancescoCastaldi wants to merge 1 commit into
evidence-dev:nextfrom
FrancescoCastaldi:feat/cross-filtering
Closed

FrancescoCastaldi wants to merge 1 commit into
evidence-dev:nextfrom
FrancescoCastaldi:feat/cross-filtering

Conversation

@FrancescoCastaldi

Copy link
Copy Markdown

Closes #1111

Description

This PR introduces native Cross-Filtering support across Evidence chart components (bar_chart, line_chart, area_chart, scatter_chart, bubble_chart, horizontal_bar_chart, pie_chart, funnel_chart, treemap, and combo_chart).

Cross-filtering allows users to click on a bar, slice, stage, or data point in one chart to immediately filter all other charts, tables, and KPI metrics on the page, persisting the filter state in the URL.

Features

  1. Interactive Click Filtering:
    • cross_filter=true: Enables cross-filtering on the primary dimension column (x or category).
    • cross_filter="my_filter": Binds the clicked value to a specific filter name.
    • cross_filter_column="col": Explicitly specifies the filtered database column.
    • cross_filter_multiple=true: Allows multi-selection across multiple clicks.
  2. Toggle & Deselection:
    • Clicking an already-selected value deselects it and clears the filter.
  3. Self-filtering Prevention:
    • The chart generating the cross-filter excludes its own filter from its own query, ensuring the chart retains its full context (with the active item selected) while all other charts on the page filter down.
  4. URL & Reactive Filter Integration:
    • Seamlessly connects to Evidence's Filters state and updates URL search parameters for shareable URLs.
  5. Unit Tests:
    • Added cross-filter.test.ts covering single-select toggles, multi-select arrays, value extraction, and schema definitions.

…ev#1111)

- add CROSS_FILTER_ATTRIBUTES schema definition (cross_filter, cross_filter_column, cross_filter_multiple)
- add setupCrossFilter utility for click-to-filter interaction with single-select and multi-select support
- support cross-filtering in combo_chart (bar, line, area, scatter, bubble), horizontal_bar_chart, pie_chart, funnel_chart, and treemap
- exclude active cross-filter ID from chart's own query to prevent self-filtering
- add unit tests for cross-filtering logic and schema validation
@vercel

vercel Bot commented Aug 27, 2026

Copy link
Copy Markdown

Someone is attempting to deploy a commit to the Evidence Team on Vercel.

A member of the Team first needs to authorize it.

@FrancescoCastaldi

Copy link
Copy Markdown
Author

Hi @archiewood @hughess! 👋 This implements cross-filtering across Evidence charts (#1111). Whenever you have a moment, could you please take a look and approve the CI workflow? Thanks!

@hughess

hughess commented Sep 29, 2026

Copy link
Copy Markdown
Member

@FrancescoCastaldi thanks for this PR! We actually have cross-filtering coming out in the next few weeks, so I am going to close this one. Stay tuned for the cross-filtering release!

@hughess hughess closed this Sep 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants