Skip to content

PivotViewer

The PivotViewer component provides an interactive, high-performance visualization for exploring large datasets with dynamic grouping, filtering, and zooming capabilities.

PivotViewer enables users to explore and analyze collections of data items through an intuitive, visual interface with pivot-style grouping and filtering.

  • High-performance rendering using Web Workers
  • Columnar data storage for efficient filtering
  • Dynamic grouping by configurable dimensions
  • Multiple filter types (categorical, range, search)
  • Smooth zoom and pan interactions
  • Responsive card-based layout
  • Collection and detail view modes
  • Custom card and detail renderers
import { PivotViewer } from '@cratis/components/PivotViewer';
interface Product {
id: string;
name: string;
category: string;
price: number;
}
function ProductViewer() {
const dimensions = [
{ key: 'category', label: 'Category', getValue: (item: Product) => item.category }
];
const filters = [
{ key: 'category', label: 'Category', type: 'string', getValue: (item: Product) => item.category }
];
return (
<PivotViewer
data={products}
dimensions={dimensions}
filters={filters}
defaultDimensionKey="category"
cardRenderer={(item) => ({ title: item.name, labels: ['Category'], values: [item.category] })}
detailRenderer={(item) => <ProductDetails product={item} />}
getItemId={(item) => item.id}
searchFields={[item => item.name, item => item.category]}
/>
);
}
  • Dimensions: Properties to group data by
  • Filters: Options to narrow down the dataset
  • Cards: Visual representation of items in collection view
  • Details: Full information shown when item is selected