@tetacom/svg-charts 1.7.21 → 1.7.23
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.
|
@@ -489,7 +489,10 @@ class ExtremesBuilder {
|
|
|
489
489
|
if (!hasMin || !hasMax) {
|
|
490
490
|
const linkedSeries = settings.linkedSeries();
|
|
491
491
|
const data = linkedSeries.reduce((acc, current) => {
|
|
492
|
-
|
|
492
|
+
if (current.visible && current.enabled) {
|
|
493
|
+
return acc.concat(current.data);
|
|
494
|
+
}
|
|
495
|
+
return acc;
|
|
493
496
|
}, []);
|
|
494
497
|
const accessor = this.extentAccessorMap.get(settings.orientation);
|
|
495
498
|
if (settings.options.scaleType.type === ScaleType.band) {
|
|
@@ -511,7 +514,6 @@ class ExtremesBuilder {
|
|
|
511
514
|
extremes[1] = extremes[1] * 2;
|
|
512
515
|
}
|
|
513
516
|
else {
|
|
514
|
-
extremes[0] = extremes[0] - 1;
|
|
515
517
|
extremes[1] = extremes[1] + 1;
|
|
516
518
|
}
|
|
517
519
|
}
|
|
@@ -750,29 +752,33 @@ class ScaleService {
|
|
|
750
752
|
.set(ScaleType.pow, d3.scalePow)
|
|
751
753
|
.set(ScaleType.sqrt, d3.scaleSqrt)
|
|
752
754
|
.set(ScaleType.band, d3.scaleBand);
|
|
753
|
-
this.scales = combineLatest([this.chartService.size, this.chartService.config, this.zoomService.zoomed]).pipe(map((
|
|
754
|
-
|
|
755
|
+
this.scales = combineLatest([this.chartService.size, this.chartService.config, this.zoomService.zoomed]).pipe(map(([size, config, zoom]) => {
|
|
756
|
+
config = { ...config };
|
|
757
|
+
config.xAxis = config.xAxis.map((_) => ({ ..._ }));
|
|
758
|
+
config.yAxis = config.yAxis.map((_) => ({ ..._ }));
|
|
755
759
|
const xAxisMap = new Map();
|
|
756
760
|
const yAxisMap = new Map();
|
|
757
|
-
config.yAxis.
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
+
config.yAxis.forEach((axis, index) => {
|
|
762
|
+
const newAxis = Axis.createAxis(AxisOrientation.y, config, index);
|
|
763
|
+
if (newAxis.options.visible &&
|
|
764
|
+
config.series.some((serie) => serie.yAxisIndex === index && serie.visible && serie.enabled && serie.data?.length > 0)) {
|
|
765
|
+
newAxis.options.visible = true;
|
|
761
766
|
}
|
|
762
767
|
else {
|
|
763
|
-
|
|
768
|
+
newAxis.options.visible = false;
|
|
764
769
|
}
|
|
765
|
-
yAxisMap.set(index,
|
|
770
|
+
yAxisMap.set(index, newAxis);
|
|
766
771
|
});
|
|
767
|
-
config.xAxis.
|
|
768
|
-
|
|
772
|
+
config.xAxis.forEach((axis, index) => {
|
|
773
|
+
const newAxis = Axis.createAxis(AxisOrientation.x, config, index);
|
|
774
|
+
if (newAxis.options.visible &&
|
|
769
775
|
config.series.some((serie) => serie.xAxisIndex === index && serie.enabled && serie.data?.length > 0)) {
|
|
770
|
-
|
|
776
|
+
newAxis.options.visible = true;
|
|
771
777
|
}
|
|
772
778
|
else {
|
|
773
|
-
|
|
779
|
+
newAxis.options.visible = false;
|
|
774
780
|
}
|
|
775
|
-
xAxisMap.set(index,
|
|
781
|
+
xAxisMap.set(index, newAxis);
|
|
776
782
|
});
|
|
777
783
|
// Generate x scales
|
|
778
784
|
const left = Array.from(yAxisMap.values())
|