Added freeze URL parameter to disable animations

This commit is contained in:
Przemek Wiech
2020-04-20 23:44:22 +02:00
parent b35bad4008
commit 392548e3a1
2 changed files with 12 additions and 0 deletions

View File

@@ -133,6 +133,7 @@ export interface ChartProps {
selection: IndiInfo;
chartType: ChartType;
onSelection: (indiInfo: IndiInfo) => void;
freezeAnimation?: boolean;
}
/** Component showing the genealogy chart and handling transition animations. */
@@ -191,6 +192,11 @@ export class Chart extends React.PureComponent<ChartProps, {}> {
return;
}
// Freeze changing selection after initial rendering.
if (!args.initialRender && this.props.freezeAnimation) {
return;
}
if (args.initialRender) {
(d3.select('#chart').node() as HTMLElement).innerHTML = '';
this.chart = createChart({