Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
d151c5f
init pivot click filter
djbarnwal Jan 11, 2026
32a8db8
Merge branch 'main' into feat/pivot-click-filter
djbarnwal Feb 27, 2026
ee819cc
init pivot click to filter
djbarnwal Mar 2, 2026
9046c8b
Merge branch 'main' into feat/pivot-click-filter
djbarnwal Mar 2, 2026
a42b938
add pivot filter state
djbarnwal Mar 3, 2026
a6e5fa9
add column filtering
djbarnwal Mar 5, 2026
e69f0ec
Merge branch 'main' into feat/pivot-click-filter
djbarnwal Mar 9, 2026
56864b2
fix highlighting on hover
djbarnwal Mar 9, 2026
79e944b
flat table: add only left cells to filter
djbarnwal Mar 11, 2026
ba3a7f4
Merge branch 'main' into feat/pivot-click-filter
djbarnwal Mar 13, 2026
152ae94
remove gray bg from totals row in nested
djbarnwal Mar 13, 2026
3c4190a
init active component state
djbarnwal Mar 14, 2026
2207f5e
upadate flat table styling
djbarnwal Mar 14, 2026
80ab2c4
fix clearing of active component from global filters interaction
djbarnwal Mar 16, 2026
3390b8e
Merge branch 'main' into feat/pivot-click-filter
djbarnwal Mar 23, 2026
598a7d9
add row header and column header highlighting on cell click
djbarnwal Mar 23, 2026
341d193
preserve hover when col header already has bg primary from cell
djbarnwal Mar 23, 2026
4473fb0
clear active component properly on global filter change
djbarnwal Mar 23, 2026
b6d883b
fix hilighting on flat table selection
djbarnwal Mar 23, 2026
fd4e209
click to filter state management recommended fixes
djbarnwal Mar 23, 2026
ad368ec
fix flat table bug when clicked and scrolled
djbarnwal Mar 23, 2026
30a0a4f
merge main
djbarnwal Mar 25, 2026
790242a
merge main
djbarnwal Mar 30, 2026
939a0a6
cursor-default for totals row
djbarnwal Mar 30, 2026
88cab91
single selection in a row in flat table
djbarnwal Mar 30, 2026
0b1a087
preserve cell selection by value
djbarnwal Mar 30, 2026
7db22d3
use existing util for test
djbarnwal Mar 30, 2026
7bc0096
show null dimension values in flat table
djbarnwal Mar 30, 2026
af3c1b3
support filtering from null cell
djbarnwal Mar 30, 2026
975b7b5
collapse selected cells border
djbarnwal Mar 30, 2026
ce26a6c
clear active component when changing table type in canvas
djbarnwal Mar 30, 2026
a75eb23
fix selected cell styling adjacent to row header
djbarnwal Mar 30, 2026
e0f1cb0
higlight parent header for row and column dimension selected header cell
djbarnwal Mar 30, 2026
e06b427
highlight parent row header on child row cell click
djbarnwal Mar 30, 2026
97d39d6
fix tests
djbarnwal Mar 30, 2026
4373ff8
exclusive selection of column headers based on depth
djbarnwal Mar 30, 2026
505985f
highlight crossection cells as muted
djbarnwal Mar 30, 2026
cf8382d
abstract away css computation
djbarnwal Mar 31, 2026
9cf2a62
review
djbarnwal Mar 31, 2026
932377b
add border to header cells
djbarnwal Mar 31, 2026
c499540
fix border for row header
djbarnwal Mar 31, 2026
579ed71
fix overlapping text on scroll
djbarnwal Mar 31, 2026
76e05da
fix border bottom styling
djbarnwal Mar 31, 2026
21079ae
fix bug when selecting child dimensions
djbarnwal Apr 2, 2026
0f8c289
Merge branch 'main' into feat/pivot-click-filter
djbarnwal Apr 16, 2026
610c58b
redo nested table rules
djbarnwal Apr 21, 2026
fa48335
exclusive selection of measure cell and parent row header
djbarnwal Apr 21, 2026
c5d4097
improve tests, remove redudant setup
djbarnwal Apr 21, 2026
46b2d4b
fix null selection bug in flat tables
djbarnwal Apr 21, 2026
9ba211e
fix row header parent deselection bug
djbarnwal Apr 23, 2026
ba45f71
fix grey totals row bug
djbarnwal Apr 23, 2026
0eb7bce
fix stale column filter
djbarnwal Apr 23, 2026
586e105
fix null visual state
djbarnwal Apr 23, 2026
01015df
Merge branch 'main' into feat/pivot-click-filter
djbarnwal Apr 30, 2026
0efd49c
fix child null selection bug
djbarnwal Apr 30, 2026
6a828b7
fix measure cell child header eviction
djbarnwal May 4, 2026
4508ae6
higlight measure cells from selected cell row
djbarnwal May 4, 2026
72a482e
cross higlighting for same set column dimension headers
djbarnwal May 5, 2026
2a23f95
merge main
djbarnwal May 11, 2026
7f6534d
prettier fix
djbarnwal May 11, 2026
8ea64eb
fix row visual highlighting regression
djbarnwal May 12, 2026
9fb48e3
add hover box on expand caret icon
djbarnwal May 12, 2026
9540750
update pivot test to include null strings
djbarnwal May 13, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions web-common/src/components/table/tanstack-table-column-meta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ declare module "tanstack-table-8-svelte-5" {
widthPercent?: number;
marginLeft?: string;
icon?: ComponentType<SvelteComponent>;
/** Full path of dimension name/value pairs from root to this header */
dimensionPath?: Record<string, string>;
tooltipFormatter?: (value: unknown) => string | null | undefined;
}
}
8 changes: 8 additions & 0 deletions web-common/src/features/canvas/CanvasComponent.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
}
}
export let selected = false;
export let active = false;
export let ghost = false;
export let allowPointerEvents = true;
export let editable = false;
Expand All @@ -66,6 +67,7 @@
role="presentation"
id={componentName}
class:selected
class:active
class:editable
class:opacity-20={ghost}
style:pointer-events={!allowPointerEvents ? "none" : "auto"}
Expand Down Expand Up @@ -111,4 +113,10 @@

outline-style: solid !important;
}

.active {
@apply shadow-md outline-primary-400 outline-[1.5px];

outline-style: solid !important;
}
</style>
3 changes: 3 additions & 0 deletions web-common/src/features/canvas/CanvasDashboardEmbed.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,12 @@
_maxWidth,
filtersEnabledStore,
themeName,
activeComponent: activeComponentStore,
},
} = getCanvasStore(canvasName, instanceId));

$: components = $componentsStore;
$: activeComponentId = $activeComponentStore;

$: filtersEnabled = $filtersEnabledStore;
$: maxWidth = $_maxWidth;
Expand All @@ -56,6 +58,7 @@
{components}
{maxWidth}
{navigationEnabled}
{activeComponentId}
/>
{:else}
<div class="size-full flex items-center justify-center">
Expand Down
7 changes: 6 additions & 1 deletion web-common/src/features/canvas/StaticCanvasRow.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
export let components: Map<string, BaseCanvasComponent>;
export let heightUnit: string = "px";
export let navigationEnabled: boolean = true;
export let activeComponentId: string | null = null;

$: ({ height, items: _itemIds, widths: itemWidths } = row);

Expand All @@ -36,7 +37,11 @@
{@const component = components.get(id)}
<ItemWrapper type={component?.type} zIndex={4 - columnIndex}>
{#if component}
<CanvasComponent {component} {navigationEnabled} />
<CanvasComponent
{component}
{navigationEnabled}
active={activeComponentId === id}
/>
{:else}
<ComponentError error="No valid component {id} in project" />
{/if}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,5 +79,6 @@
{pivotDataStore}
pivotConfig={config}
{pivotState}
{component}
{widthScopeKey}
/>
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,19 @@
import PivotEmpty from "@rilldata/web-common/features/dashboards/pivot/PivotEmpty.svelte";
import PivotError from "@rilldata/web-common/features/dashboards/pivot/PivotError.svelte";
import PivotTable from "@rilldata/web-common/features/dashboards/pivot/PivotTable.svelte";
import {
type PivotDataStore,
type PivotDataStoreConfig,
type PivotState,
import type {
PivotDataStore,
PivotDataStoreConfig,
PivotState,
} from "@rilldata/web-common/features/dashboards/pivot/types";
import type { PivotCanvasComponent } from "./index";
import {
createPivotClickToFilter,
type PivotClickToFilterResult,
} from "./pivot-click-to-filter";

import type { Readable, Writable } from "svelte/store";
import { onDestroy } from "svelte";
import { derived, get, type Readable, type Writable } from "svelte/store";

export let schema: {
isValid: boolean;
Expand All @@ -21,11 +27,62 @@
export let pivotState: Writable<PivotState>;
export let widthScopeKey: string;
export let hasHeader = false;
export let component: PivotCanvasComponent;

$: pivotColumns = splitPivotChips($pivotState.columns);

$: hasColumnAndNoMeasure =
pivotColumns.dimension.length > 0 && pivotColumns.measure.length === 0;

// FilterManager and metrics view for filter application
$: canvasEntity = component.parent;
$: filterManager = canvasEntity.filterManager;
$: spec = component.specStore;
$: metricsViewName = $spec?.metrics_view;
$: selfFilteredDimensions = component.selfFilteredDimensions;

$: whereFilterStore = derived(filterManager.filterMapStore, (filterMap) => {
return metricsViewName ? filterMap.get(metricsViewName) : undefined;
});

// Create click-to-filter orchestration; recreated when inputs become available
let clickToFilter: PivotClickToFilterResult | undefined;

$: {
clickToFilter?.destroy();
clickToFilter = undefined;

if (pivotDataStore && pivotConfig && metricsViewName) {
const componentId = component.id;
clickToFilter = createPivotClickToFilter({
pivotConfig,
pivotDataStore,
filterManager,
metricsViewName,
componentId,
activeComponent: canvasEntity.activeComponent,
selfFilteredDimensions,
whereFilterStore,
onBecomeActive: () => canvasEntity.setActiveComponent(componentId),
onBecomeInactive: () => {
if (get(canvasEntity.activeComponent) === componentId) {
canvasEntity.clearActiveComponent();
}
},
});
}
}

onDestroy(() => clickToFilter?.destroy());

// Unwrap stores from the factory result for template use
$: clickSelectionStore = clickToFilter?.clickSelection;
$: clickSelection = clickSelectionStore ? $clickSelectionStore : undefined;

$: rowSelectionStateStore = clickToFilter?.rowSelectionState;
$: rowSelectionState = rowSelectionStateStore
? $rowSelectionStateStore
: undefined;
</script>

<div
Expand Down Expand Up @@ -53,6 +110,9 @@
{pivotDataStore}
config={pivotConfig}
{pivotState}
{rowSelectionState}
{clickSelection}
enableClickToFilter
setPivotExpanded={(expanded) => {
pivotState.update((state) => ({
...state,
Expand All @@ -73,6 +133,8 @@
rowPage: page,
}));
}}
onCellClickToFilter={clickToFilter?.handleCellClickToFilter}
onColumnHeaderClick={clickToFilter?.handleColumnHeaderClick}
/>
{/if}
{/if}
Expand Down
11 changes: 11 additions & 0 deletions web-common/src/features/canvas/components/pivot/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ export class PivotCanvasComponent extends BaseCanvasComponent<
config: Readable<PivotDataStoreConfig>;
pivotDataStore: ReturnType<typeof usePivotForCanvas>;
pivotState: Writable<PivotState>;
/** Dimensions the pivot itself has filtered via click-to-filter.
* These are excluded from the pivot's own data query so all rows remain visible. */
selfFilteredDimensions: Writable<Set<string>>;

constructor(resource: V1Resource, parent: CanvasEntity, path: ComponentPath) {
const type = (resource.component?.state?.validSpec?.renderer ??
Expand Down Expand Up @@ -89,12 +92,14 @@ export class PivotCanvasComponent extends BaseCanvasComponent<
this.type = type;

this.pivotState = writable(this.getInitPivotState(type));
this.selfFilteredDimensions = writable(new Set<string>());

this.config = createPivotConfig(
this.parent,
this.specStore,
this.pivotState,
this.timeAndFilterStore,
this.selfFilteredDimensions,
);

this.pivotDataStore = usePivotForCanvas(
Expand Down Expand Up @@ -191,6 +196,12 @@ export class PivotCanvasComponent extends BaseCanvasComponent<
updateTableType(newTableType: "pivot" | "table") {
if (!this.parent.fileArtifact) return;

// Clear active component if this pivot was the active one
if (get(this.parent.activeComponent) === this.id) {
this.parent.clearActiveComponent();
}
this.selfFilteredDimensions.set(new Set());

this.type = newTableType;

this.pivotState.set(this.getInitPivotState(newTableType));
Expand Down
Loading
Loading