in packages/charts/src/chart_types/flame_chart/flame_chart.tsx [244:281]
constructor(props: Readonly<FlameProps>) {
super(props);
const columns = this.props.columnarViewModel;
// vector length checks
const datumCount = columns.position1.length / 2;
if (datumCount % 1) throw new Error('flame error: position1 vector must have even values (x/y pairs)');
if (datumCount * 2 !== columns.position0.length)
throw new Error('flame error: Mismatch between position0 (xy) and position1 (xy) length');
if (datumCount !== columns.size0.length)
throw new Error('flame error: Mismatch between position1 (xy) and size0 length');
if (datumCount !== columns.size1.length)
throw new Error('flame error: Mismatch between position1 (xy) and size1 length');
if (datumCount * 4 !== columns.color.length)
throw new Error('flame error: Mismatch between position1 (xy) and color (rgba) length');
if (datumCount !== columns.value.length)
throw new Error('flame error: Mismatch between position1 (xy) and value length');
if (datumCount !== columns.label.length)
throw new Error('flame error: Mismatch between position1 (xy) and label length');
this.targetFocus = this.getFocusOnRoot();
this.bindControls();
this.currentFocus = { ...this.targetFocus };
// Initialize nav queue with the root element
this.navigator = new NavButtonControlledZoomPanHistory({ ...this.getFocusOnRoot(), index: 0 });
// browser pinch zoom handling
this.setupViewportScaleChangeListener();
// search
this.currentColor = columns.color;
// node size/position tween time
this.prevNodeTweenTime =
columns.position0 === columns.position1 && columns.size0 === columns.size1 ? -Infinity : Infinity; // if nothing to tween, then skip it
}