Skip to content
Look

Shared with the landing page. Theme is the select beside this menu.

CrossfilterProvider

Open .md
Live preview

Loading example…

Shares one dataset and its filters with every chart inside: each chart filters by brushing or clicking, and every other chart (and any table fed from useCrossfilter().filtered) follows.

import { CrossfilterProvider } from "@jcsoftdev/ui/charts";

Single-component entry points tree-shake to just this component: @jcsoftdev/ui/charts/crossfilter.

export const VentasCruzadas: Story = {
args: storyArgs,
render: () => <SalesCrossfilter columns="wide" />,
};

Source of the Storybook story.

Prop Type Default Description
data * readonly T[]
dimensions * Readonly<Record<string, Accessor<T>>> How to read each dimension from a record. Keep the object stable (module level or memoized).
initialFilters Readonly<Record<string, CrossfilterFilter>> NO_FILTERS Filters when the page loads.
children * ReactNode

* marks a required prop.

packages/ui/src/charts/crossfilter/crossfilter.tsx