From 8dd40ff8bd4ebca9252095b0d09b8a4de9683c6f Mon Sep 17 00:00:00 2001 From: William Yang Date: Tue, 9 Jul 2024 17:29:37 -0500 Subject: [PATCH] Filter gap states. If a state is filtered out, don't create a new state for it. Filtered states are represented by a tags = 4, and filtered and dimmed are represented by tags = 5. Signed-off-by: William Yang --- timeline-chart/src/layer/time-graph-chart.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/timeline-chart/src/layer/time-graph-chart.ts b/timeline-chart/src/layer/time-graph-chart.ts index 5b9411f..49a5d7b 100644 --- a/timeline-chart/src/layer/time-graph-chart.ts +++ b/timeline-chart/src/layer/time-graph-chart.ts @@ -719,7 +719,13 @@ export class TimeGraphChart extends TimeGraphChartLayer { protected updateGap(state: TimelineChart.TimeGraphState, rowComponent: TimeGraphRow, gapStyle: any, x: number, lastX?: number, lastTime?: bigint, lastBlank?: boolean) { /* add gap if there is visible space between states or if there is a time gap between two blank states */ - if (lastX && lastTime && (x > lastX || (lastBlank && !state.data?.style && state.range.start > lastTime))) { + const isFilteredOut = state.data?.tags >= 4; + if ( + lastX && + lastTime && + (x > lastX || (lastBlank && !state.data?.style && state.range.start > lastTime)) && + !isFilteredOut + ) { const gap = state.data?.gap; if (gap) { const width = Math.max(1, x - lastX);