Skip to content

Commit

Permalink
chartWidth
Browse files Browse the repository at this point in the history
  • Loading branch information
thompsongl committed May 26, 2021
1 parent b6150fb commit 3eb5f21
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,11 @@ export const EmbeddableAnomalyChartsContainer: FC<EmbeddableAnomalyChartsContain
);
const resizeHandler = useCallback(
throttle((e: { width: number; height: number }) => {
setChartWidth(e.width);
if (Math.abs(chartWidth - e.width) > 20) {
setChartWidth(e.width);
}
}, RESIZE_THROTTLE_TIME_MS),
[]
[chartWidth]
);

if (error) {
Expand Down

0 comments on commit 3eb5f21

Please sign in to comment.