Crossfilter component

Crossfilter represents a multi-dimensional dataset and supports multivariate filtering. It is used for powering interactive coordinated views, including Histogram and List widgets. Its part of the family of components that includes also Dimension and Aggregation components.

https://kroki.io/svgbob/svg/eNpT0NPFBHpcCjUKIOBclF9cnJaZU5JaBOTVAIWxqK7h0s1XSEksSQRrUYAoL1bI1wWJwzUrFKUWl-aUgMWhpoNAoS6yuDoW49UBbv0nbw==

In-ports

data JSON - Any array of JSON objects or primitives.

filter JSON - Accepts a set of filters. Use Dimension component to specify filters for different dimensions and aggregations.

Out-ports

filters JSON - Outputs the current filter set across all dimensions. Event is triggered every-time any of the filters in the set is changed.

results JSON - Resulting data set after all filters are applied.

q-results <Queryable> - Queryable port with Crossfilter results. Its used by Dimension component to query aggregated results.

Overview

Crossfilter is the main component in the Crossfilter family of components. It represents a multi-dimensional dataset with multivariate filtering capability. You can use it to filter and aggregate large datasets and create interactive coordinated views with List widgets, Histograms, etc. Below is a typical configuration of Crossfilter that using a single dimension filter with aggregation.

https://cdn.sanity.io/images/n16unevp/production/d0283020e3800fbed8b441a7dd5c20077b008125-2184x1110.png?w=800&fit=max

Use Dimension component to generate filters for Crossfilter component or specify filters manually by providing the following structure as input on the filter port:

[
{
"field": "ocean",
"equal": ["Pacific", "Atlantic"],
"nameDimension": "<dimension_id>"
}
]

When filters are applied the Crossfilter producing the results on results port. Results include filtered data and metadata. Metadata field contains the total and filtered metrics, and the details about aggregations. Here is an example of the results with metadata.

{
"data": [...],
"meta": {
"total": 314,
"filtered": 23,
"aggregations": {...}
}
}

Kelp Crossfilter components are build on top of Crossfilter JavaScript library.

Settings

No additional configuration is required.

Related