Toggle showing sex (#141)

Fixes #138
This commit is contained in:
Kent Grigo
2023-02-01 15:58:18 +01:00
committed by GitHub
parent 3490cb7928
commit 05443954f6
5 changed files with 78 additions and 13 deletions

View File

@@ -1,4 +1,4 @@
import {ChartColors, Ids} from './config';
import {ChartColors, Ids, Sex} from './config';
import {interpolateNumber} from 'd3-interpolate';
import {IntlShape, useIntl} from 'react-intl';
import {max, min} from 'd3-array';
@@ -258,6 +258,7 @@ export interface ChartProps {
freezeAnimation?: boolean;
colors?: ChartColors;
hideIds?: Ids;
hideSex?: Sex;
}
class ChartWrapper {
@@ -420,7 +421,8 @@ export function Chart(props: ChartProps) {
const initialRender =
props.chartType !== prevProps?.chartType ||
props.colors !== prevProps?.colors ||
props.hideIds !== prevProps?.hideIds;
props.hideIds !== prevProps?.hideIds ||
props.hideSex !== prevProps?.hideSex;
const resetPosition =
props.chartType !== prevProps?.chartType ||
props.data !== prevProps.data ||