Toggle showing IDs (#131)

This commit is contained in:
Kent Grigo
2023-01-08 14:26:23 +01:00
committed by GitHub
parent 73ae7b6867
commit 1fac47f78b
3 changed files with 87 additions and 6 deletions

View File

@@ -1,4 +1,4 @@
import {ChartColors} from './config';
import {ChartColors, Ids} from './config';
import {interpolateNumber} from 'd3-interpolate';
import {IntlShape, useIntl} from 'react-intl';
import {max, min} from 'd3-array';
@@ -257,6 +257,7 @@ export interface ChartProps {
onSelection: (indiInfo: IndiInfo) => void;
freezeAnimation?: boolean;
colors?: ChartColors;
hideIds?: Ids;
}
class ChartWrapper {
@@ -418,7 +419,8 @@ export function Chart(props: ChartProps) {
if (prevProps) {
const initialRender =
props.chartType !== prevProps?.chartType ||
props.colors !== prevProps?.colors;
props.colors !== prevProps?.colors ||
props.hideIds !== prevProps?.hideIds;
const resetPosition =
props.chartType !== prevProps?.chartType ||
props.data !== prevProps.data ||