mirror of
https://github.com/PeWu/topola-viewer.git
synced 2026-07-30 15:41:47 +00:00
Added freeze URL parameter to disable animations
This commit is contained in:
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user