Skip to content
This repository was archived by the owner on Jul 30, 2025. It is now read-only.

Commit ae8d41b

Browse files
committed
fix(plugins/plugin-client-common): Histogram animation can still be laggy with a great many bars
Fixes #7205
1 parent a997e1e commit ae8d41b

File tree

1 file changed

+3
-2
lines changed
  • plugins/plugin-client-common/src/components/Content/Table

1 file changed

+3
-2
lines changed

plugins/plugin-client-common/src/components/Content/Table/Histogram.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ export default class Histogram extends React.PureComponent<Props, State> {
5757
private readonly barLabelFontSize = 0.65 * this.barHeight
5858
private readonly minBarLabelChars = 1
5959
private readonly maxBarLabelChars = 6
60+
private static readonly maxAnimatableRows = 50 // Victory doesn't seem to animate well when a great many rows; too much lag
6061

6162
public constructor(props: Props) {
6263
super(props)
@@ -93,9 +94,9 @@ export default class Histogram extends React.PureComponent<Props, State> {
9394
if (!useFancyColoring) {
9495
const filteredRows = filteredRowsPriorToSorting
9596
return {
96-
animate: true,
9797
rows: filteredRows,
9898
counts: filteredRows.map(countOf),
99+
animate: filteredRows.length < Histogram.maxAnimatableRows,
99100
scale: filteredRows.length === rows.length ? 'linear' : 'log',
100101
colors: undefined
101102
}
@@ -127,9 +128,9 @@ export default class Histogram extends React.PureComponent<Props, State> {
127128
const filteredRows = filteredRowsForSorting.map(_ => _.row)
128129

129130
return {
130-
animate: true,
131131
rows: filteredRows,
132132
counts: filteredRows.map(countOf),
133+
animate: filteredRows.length < Histogram.maxAnimatableRows,
133134
scale: filteredRows.length === rows.length ? 'linear' : 'log',
134135
colors: filteredRowsForSorting.map(_ => _.color.color)
135136
}

0 commit comments

Comments
 (0)