Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
private createAxes(props: TreeMapProps) {
this.xScale = new Scales.Linear();
this.yScale = new Scales.Linear();
this.resetDomain(props);
}
} else if (this.xScale instanceof Scales.Time && typeof xConfigs.tickingStep !== 'number') {
if (xConfigs.axisMin) {
this.xScale.domainMin(parseAxisMinMaxToDate(xConfigs.axisMin));
}
if (xConfigs.axisMax) {
this.xScale.domainMax(parseAxisMinMaxToDate(xConfigs.axisMax));
}
}
}
if (this.xAxis instanceof Axes.Time && xConfigs.timeFormat) {
const tickingStep = typeof xConfigs.tickingStep !== 'number' ? xConfigs.tickingStep : {};
this.xAxis.axisConfigurations([ setTimeAxisTickingFormat(xConfigs.timeFormat, tickingStep || {}) ]);
}
}
this.yScale = new Scales.Linear();
this.yAxis = getAxis(yConfigs, this.yScale) as Axes.Numeric;
if (yConfigs.show) {
chartTable.add(this.yAxis, 1, 1);
this.yAxis.margin(yConfigs.margin);
if (typeof yConfigs.tickingStep === 'number') {
const yScaleTickGenerator = Scales.TickGenerators.intervalTickGenerator(yConfigs.tickingStep);
this.yScale.tickGenerator(yScaleTickGenerator);
}
}
}
} else if (this.xScale instanceof Scales.Time && typeof xConfigs.tickingStep !== 'number') {
if (xConfigs.axisMin) {
this.xScale.domainMin(parseAxisMinMaxToDate(xConfigs.axisMin));
}
if (xConfigs.axisMax) {
this.xScale.domainMax(parseAxisMinMaxToDate(xConfigs.axisMax));
}
}
}
if (this.xAxis instanceof Axes.Time && xConfigs.timeFormat) {
const tickingStep = typeof xConfigs.tickingStep !== 'number' ? xConfigs.tickingStep : {};
this.xAxis.axisConfigurations([ setTimeAxisTickingFormat(xConfigs.timeFormat, tickingStep || {}) ]);
}
}
this.yScale = new Scales.Linear();
this.yAxis = getAxis(yConfigs, this.yScale) as Axes.Numeric;
if (yConfigs.show) {
chartTable.add(this.yAxis, 1, 1);
this.yAxis.margin(yConfigs.margin);
if (typeof yConfigs.tickingStep === 'number') {
const yScaleTickGenerator = Scales.TickGenerators.intervalTickGenerator(yConfigs.tickingStep);
this.yScale.tickGenerator(yScaleTickGenerator);
}
}
}
private createAxes(props: TreeMapProps) {
this.xScale = new Scales.Linear();
this.yScale = new Scales.Linear();
this.resetDomain(props);
}