axidio-styleguide-library1-v2 0.0.908 → 0.0.910
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/esm2022/lib/horizontal-bars-with-scroll-zoom/horizontal-bars-with-scroll-zoom.component.mjs +3 -3
- package/esm2022/lib/horizontal-grouped-bar-with-scroll-zoom/horizontal-grouped-bar-with-scroll-zoom.component.mjs +28 -8
- package/fesm2022/axidio-styleguide-library1-v2.mjs +29 -9
- package/fesm2022/axidio-styleguide-library1-v2.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -7290,7 +7290,7 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
7290
7290
|
: this.chartData.data.length * (isMobile ? 15 : 25);
|
|
7291
7291
|
}
|
|
7292
7292
|
if (this.chartData.data.length > 8 && !this.isZoomedOut) {
|
|
7293
|
-
width = this.chartData.data.length * (isMobile ? 60 :
|
|
7293
|
+
width = this.chartData.data.length * (isMobile ? 60 : 130);
|
|
7294
7294
|
}
|
|
7295
7295
|
// Fullscreen and drilldown adjustments
|
|
7296
7296
|
if (this.chartConfiguration.isFullScreen != undefined && this.chartConfiguration.isFullScreen) {
|
|
@@ -7299,7 +7299,7 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
7299
7299
|
: containerHeight;
|
|
7300
7300
|
}
|
|
7301
7301
|
if (this.chartConfiguration.isDrilldownChart) {
|
|
7302
|
-
height = containerHeight - margin.top - margin.bottom - (isMobile ? 60 :
|
|
7302
|
+
height = containerHeight - margin.top - margin.bottom - (isMobile ? 60 : 130);
|
|
7303
7303
|
}
|
|
7304
7304
|
// ...existing code...
|
|
7305
7305
|
/**
|
|
@@ -9070,42 +9070,62 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
9070
9070
|
})
|
|
9071
9071
|
.attr('width', function (d) {
|
|
9072
9072
|
if (self.chartConfiguration.isDrilldownChart) {
|
|
9073
|
-
//
|
|
9073
|
+
// Reduce bar width for single-bar (non-grouped) charts only
|
|
9074
|
+
let isSingleBar = false;
|
|
9075
|
+
let singleBarWidth = x.bandwidth();
|
|
9074
9076
|
data.map((indiv) => {
|
|
9075
9077
|
if (indiv.name == d.name) {
|
|
9076
9078
|
let keys = Object.keys(indiv).filter((temp, i) => i != 0);
|
|
9077
|
-
var temp;
|
|
9078
9079
|
tempScale = d3.scaleBand().domain(keys).range([0, x.bandwidth()]);
|
|
9079
|
-
|
|
9080
|
+
// If only one key (besides name), treat as single bar
|
|
9081
|
+
if (keys.length === 1) {
|
|
9082
|
+
isSingleBar = true;
|
|
9083
|
+
// If isZoomedOut, reduce width by 30px
|
|
9084
|
+
if (self.isZoomedOut) {
|
|
9085
|
+
singleBarWidth = Math.max(10, x.bandwidth() - 30);
|
|
9086
|
+
}
|
|
9087
|
+
else {
|
|
9088
|
+
singleBarWidth = x.bandwidth();
|
|
9089
|
+
}
|
|
9090
|
+
tempScale.range([
|
|
9091
|
+
0 + (x.bandwidth() - singleBarWidth) / 2,
|
|
9092
|
+
x.bandwidth() - (x.bandwidth() - singleBarWidth) / 2,
|
|
9093
|
+
]);
|
|
9094
|
+
}
|
|
9095
|
+
else if (x.bandwidth() > 100) {
|
|
9080
9096
|
if (self.chartData.data.length == 1) {
|
|
9081
9097
|
if (Object.keys(self.chartData.data[0]).length == 2) {
|
|
9082
9098
|
tempScale.range([
|
|
9083
9099
|
0 + (x.bandwidth() - 125) / 2,
|
|
9084
9100
|
x.bandwidth() - (x.bandwidth() - 125) / 2,
|
|
9085
9101
|
]);
|
|
9086
|
-
// .padding(0.05);
|
|
9087
9102
|
}
|
|
9088
|
-
else
|
|
9103
|
+
else {
|
|
9089
9104
|
tempScale.range([
|
|
9090
9105
|
0 + (x.bandwidth() - 125) / 2,
|
|
9091
9106
|
x.bandwidth() - (x.bandwidth() - 125) / 2,
|
|
9092
9107
|
]);
|
|
9093
|
-
|
|
9108
|
+
}
|
|
9094
9109
|
}
|
|
9095
|
-
else
|
|
9110
|
+
else {
|
|
9096
9111
|
tempScale.range([
|
|
9097
9112
|
0 + (x.bandwidth() - 125) / 2,
|
|
9098
9113
|
x.bandwidth() - (x.bandwidth() - 125) / 2,
|
|
9099
9114
|
]);
|
|
9115
|
+
}
|
|
9100
9116
|
}
|
|
9101
9117
|
}
|
|
9102
9118
|
});
|
|
9119
|
+
if (isSingleBar) {
|
|
9120
|
+
return tempScale.bandwidth();
|
|
9121
|
+
}
|
|
9103
9122
|
return self.isZoomedOut
|
|
9104
9123
|
? tempScale.bandwidth()
|
|
9105
9124
|
: self.chartData.data.length && self.chartData.data.length > 8
|
|
9106
9125
|
? tempScale.bandwidth() * 0.5
|
|
9107
9126
|
: tempScale.bandwidth();
|
|
9108
9127
|
}
|
|
9128
|
+
// For non-drilldown charts
|
|
9109
9129
|
return self.isZoomedOut
|
|
9110
9130
|
? tempScale.bandwidth()
|
|
9111
9131
|
: self.chartData.data.length && self.chartData.data.length > 8
|