Skip to content

Commit f4dafc8

Browse files
committed
Disable motion on all chart tooltips and LineChart highlights (improves performance for large datasets)
1 parent 1e9ea42 commit f4dafc8

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

frontend/src/lib/components/charts/common.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ export const colors = [
2424
export const tooltipProps = {
2525
root: {
2626
variant: 'none',
27-
class: 'text-small bg-neutral-200 border border-neutral-400 rounded-md shadow-lg'
28-
// motion: false,
27+
class: 'text-small bg-neutral-200 border border-neutral-400 rounded-md shadow-lg',
28+
motion: false
2929
},
3030
header: {
3131
class: 'text-neutral-700 bg-neutral-300 px-3 py-1'
@@ -41,6 +41,10 @@ export const tooltipProps = {
4141
}
4242
} satisfies NonNullable<ComponentProps<typeof LineChart>['props']>['tooltip'];
4343

44+
export const highlightProps = {
45+
motion: false
46+
} satisfies NonNullable<ComponentProps<typeof LineChart>['props']>['highlight'];
47+
4448
export const barChartProps = {
4549
props: {
4650
tooltip: tooltipProps
@@ -54,8 +58,8 @@ export const lineChartProps = {
5458
},
5559
props: {
5660
spline: { class: 'stroke-1' },
57-
tooltip: tooltipProps
58-
// highlight: { motion: false }
61+
tooltip: tooltipProps,
62+
highlight: highlightProps
5963
}
6064
} satisfies NonNullable<ComponentProps<typeof LineChart>>;
6165

0 commit comments

Comments
 (0)