Skip to content

Commit ce832d2

Browse files
committed
Allow turning off BaseChart animations
1 parent 6a14042 commit ce832d2

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

static/app/components/charts/baseChart.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,10 @@ export interface BaseChartProps {
135135
* This is to pass series to BaseChart bypassing the wrappers like LineChart, AreaChart etc.
136136
*/
137137
additionalSeries?: SeriesOption[];
138+
/**
139+
* Whether animations are enabled for the entire chart. If animations are enabled overall, this will cause ZRender to occasionally attempt to run animations and call `requestAnimationFrame` which might cause UI stutter.
140+
*/
141+
animation?: boolean;
138142
/**
139143
* If true, ignores height value and auto-scales chart to fit container height.
140144
*/
@@ -332,6 +336,7 @@ const DEFAULT_Y_AXIS = {};
332336
const DEFAULT_X_AXIS = {};
333337

334338
function BaseChart({
339+
animation,
335340
brush,
336341
colors,
337342
grid,
@@ -564,6 +569,7 @@ function BaseChart({
564569

565570
return {
566571
...options,
572+
animation,
567573
useUTC: utc,
568574
color: color as string[],
569575
grid: Array.isArray(grid) ? grid.map(Grid) : Grid(grid),
@@ -580,6 +586,7 @@ function BaseChart({
580586
brush,
581587
};
582588
}, [
589+
animation,
583590
chartId,
584591
color,
585592
resolvedSeries,

0 commit comments

Comments
 (0)