@axdspub/axiom-charts 0.0.44 → 0.0.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/library/Libraries/axiom/index.js +18 -3
- package/library/Libraries/axiom/index.js.map +1 -1
- package/library/axiom-charts.d.ts +2 -0
- package/library/browser.js +39 -15
- package/library/browser.js.map +1 -1
- package/library/cjs.js +39 -15
- package/library/cjs.js.map +1 -1
- package/library/index.js +39 -15
- package/library/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -199,6 +199,7 @@ class ChartRoot {
|
|
|
199
199
|
this.plots = props.plots.map(p => (Object.assign({}, p)));
|
|
200
200
|
this.settings = props.settings;
|
|
201
201
|
this.element = props.element;
|
|
202
|
+
this.onChartDrew = props.onChartDrew;
|
|
202
203
|
this.onPlotDataLoad = props.onPlotDataLoad;
|
|
203
204
|
this.onPlotLegendReady = props.onPlotLegendReady;
|
|
204
205
|
this.onPlotScrub = props.onPlotScrub;
|
|
@@ -427,6 +428,9 @@ class ChartRoot {
|
|
|
427
428
|
yield Promise.all(plotImplementations.map((p) => __awaiter(this, void 0, void 0, function* () {
|
|
428
429
|
yield p.draw();
|
|
429
430
|
})));
|
|
431
|
+
if (this.onChartDrew !== undefined) {
|
|
432
|
+
this.onChartDrew();
|
|
433
|
+
}
|
|
430
434
|
}
|
|
431
435
|
});
|
|
432
436
|
}
|
|
@@ -1225,8 +1229,9 @@ class AxiomChart extends ChartRoot {
|
|
|
1225
1229
|
}
|
|
1226
1230
|
const { svg } = chartElements;
|
|
1227
1231
|
axes.forEach((axis, index) => {
|
|
1228
|
-
|
|
1232
|
+
var _a;
|
|
1229
1233
|
if ((axis === null || axis === void 0 ? void 0 : axis.scale) !== undefined) {
|
|
1234
|
+
const axisSettings = this.settings.axes === undefined ? {} : (_a = this.settings.axes[axis.key]) !== null && _a !== void 0 ? _a : {};
|
|
1230
1235
|
const axisG = this.getXAxis(axis, axisSettings);
|
|
1231
1236
|
const axisSelection = svg.select('.x-axis').size() > 0 ? svg.select('.x-axis') : svg.append('g').attr('class', 'x-axis axis');
|
|
1232
1237
|
axisSelection.append('g').call(axisG);
|
|
@@ -1738,8 +1743,9 @@ class AxiomRadialRose extends AxiomPlotRoot {
|
|
|
1738
1743
|
const directionBinIndex = Math.floor(row.direction / degreesPerBin);
|
|
1739
1744
|
const stack = stacks[directionBinIndex];
|
|
1740
1745
|
const yValue = Number(yAccessor(row));
|
|
1741
|
-
const speedBin =
|
|
1742
|
-
|
|
1746
|
+
const speedBin = this.speedBins.find(bin => yValue < bin);
|
|
1747
|
+
if (speedBin !== undefined)
|
|
1748
|
+
stack[speedBin] += 1;
|
|
1743
1749
|
});
|
|
1744
1750
|
return stacks;
|
|
1745
1751
|
}
|
|
@@ -1793,6 +1799,15 @@ class AxiomRadialRose extends AxiomPlotRoot {
|
|
|
1793
1799
|
.scaleOrdinal()
|
|
1794
1800
|
.range(fillColors);
|
|
1795
1801
|
const data = d3.stack().keys(this.speedBins.map(bin => String(bin)))(this.stacks);
|
|
1802
|
+
data.forEach((bin, i) => {
|
|
1803
|
+
bin.forEach(direction => {
|
|
1804
|
+
// @ts-expect-error Append more data needed with each stack section
|
|
1805
|
+
direction.bin = {
|
|
1806
|
+
index: i,
|
|
1807
|
+
label: this.speedBins[i]
|
|
1808
|
+
};
|
|
1809
|
+
});
|
|
1810
|
+
});
|
|
1796
1811
|
const chartOffset = chart.getChartOffset();
|
|
1797
1812
|
const bandwidth = 2 * Math.PI / this.numBins;
|
|
1798
1813
|
const getStartAngle = (direction) => {
|