mirror of https://github.com/buster-so/buster.git
Merge pull request #630 from buster-so/big-nate/bus-1574-charts-are-not-reflecting-styling-changes-in-real-time
Memoized props should alwasy rerender
This commit is contained in:
commit
deb866b67e
|
@ -1,5 +1,6 @@
|
|||
'use client';
|
||||
|
||||
import type React from 'react';
|
||||
import { useMemo } from 'react';
|
||||
import { BusterChartJS } from './BusterChartJS';
|
||||
import { useDatasetOptions } from './chartHooks';
|
||||
import type {
|
||||
|
@ -46,32 +47,18 @@ export const BusterChartComponent: React.FC<BusterChartRenderComponentProps> = (
|
|||
columnMetadata
|
||||
});
|
||||
|
||||
// biome-ignore lint/correctness/useExhaustiveDependencies: we are content with the current dependencies
|
||||
const chartProps: BusterChartComponentProps = useMemo(
|
||||
() => ({
|
||||
...props,
|
||||
datasetOptions,
|
||||
pieMinimumSlicePercentage,
|
||||
y2AxisKeys,
|
||||
yAxisKeys,
|
||||
tooltipKeys,
|
||||
hasMismatchedTooltipsAndMeasures,
|
||||
isDownsampled,
|
||||
numberOfDataPoints,
|
||||
trendlines
|
||||
}),
|
||||
[
|
||||
props.selectedAxis,
|
||||
pieMinimumSlicePercentage,
|
||||
datasetOptions,
|
||||
y2AxisKeys,
|
||||
yAxisKeys,
|
||||
hasMismatchedTooltipsAndMeasures,
|
||||
tooltipKeys,
|
||||
isDownsampled,
|
||||
numberOfDataPoints
|
||||
]
|
||||
);
|
||||
const chartProps: BusterChartComponentProps = {
|
||||
...props,
|
||||
datasetOptions,
|
||||
pieMinimumSlicePercentage,
|
||||
y2AxisKeys,
|
||||
yAxisKeys,
|
||||
tooltipKeys,
|
||||
hasMismatchedTooltipsAndMeasures,
|
||||
isDownsampled,
|
||||
numberOfDataPoints,
|
||||
trendlines
|
||||
};
|
||||
|
||||
return <BusterChartJS {...chartProps} />;
|
||||
};
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
'use client';
|
||||
|
||||
import dynamic from 'next/dynamic';
|
||||
import { PreparingYourRequestLoader } from './LoadingComponents/ChartLoadingComponents';
|
||||
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
import React, { useMemo } from 'react';
|
||||
'use client';
|
||||
|
||||
import React from 'react';
|
||||
import type { BusterMetricData, BusterMetric } from '@/api/asset_interfaces/metric';
|
||||
import type { DataMetadata } from '@buster/server-shared/metrics';
|
||||
import { BusterChartDynamic } from '@/components/ui/charts/BusterChartDynamic';
|
||||
|
|
Loading…
Reference in New Issue