forked from ddrilling/asb_cloud_front
13 lines
484 B
TypeScript
13 lines
484 B
TypeScript
|
import * as d3 from 'd3'
|
||
|
|
||
|
import { ChartRegistry } from '../types'
|
||
|
|
||
|
export const appendTransition = <DataType, BaseType extends d3.BaseType, Datum, PElement extends d3.BaseType, PDatum>(
|
||
|
elms: d3.Selection<BaseType, Datum, PElement, PDatum>,
|
||
|
chart: ChartRegistry<DataType>
|
||
|
): d3.Selection<BaseType, Datum, PElement, PDatum> => {
|
||
|
if (chart.animDurationMs && chart.animDurationMs > 0)
|
||
|
return elms.transition().duration(chart.animDurationMs) as any
|
||
|
return elms
|
||
|
}
|