axidio-styleguide-library1-v2 0.0.802 → 0.0.803
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 +20 -5
- package/esm2022/lib/horizontal-grouped-bar-with-scroll-zoom/horizontal-grouped-bar-with-scroll-zoom.component.mjs +30 -4
- package/fesm2022/axidio-styleguide-library1-v2.mjs +48 -7
- package/fesm2022/axidio-styleguide-library1-v2.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -8150,11 +8150,8 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
8150
8150
|
.style('stroke-width', '1px');
|
|
8151
8151
|
}
|
|
8152
8152
|
styleAxisDomain();
|
|
8153
|
-
// Always render y-axis label after axis/grid so it is visible
|
|
8154
8153
|
if (metaData.yLabel) {
|
|
8155
|
-
// Remove any previous y-axis label to avoid duplicates
|
|
8156
8154
|
svgYAxisLeft.selectAll('.lib-axis-group-label, .lib-ylabel-drilldowncharts, .lib-ylabel-weeklyCharts').remove();
|
|
8157
|
-
// Helper to check if label is an acronym (all uppercase or <=4 chars and all letters)
|
|
8158
8155
|
function isAcronym(label) {
|
|
8159
8156
|
return (label.length <= 4 && /^[A-Z]+$/.test(label)) || (label === label.toUpperCase() && /[A-Z]/.test(label));
|
|
8160
8157
|
}
|
|
@@ -8240,9 +8237,27 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
8240
8237
|
.text(metaData.lineyLabel);
|
|
8241
8238
|
}
|
|
8242
8239
|
if (metaData.xLabel) {
|
|
8240
|
+
function isAcronym(label) {
|
|
8241
|
+
return (label.length <= 4 && /^[A-Z]+$/.test(label)) || (label === label.toUpperCase() && /[A-Z]/.test(label));
|
|
8242
|
+
}
|
|
8243
|
+
const xLabelText = metaData.xLabel;
|
|
8244
|
+
const isAcr = isAcronym(xLabelText.replace(/[^A-Za-z]/g, ''));
|
|
8243
8245
|
svg
|
|
8244
8246
|
.append('text')
|
|
8245
|
-
.attr('class',
|
|
8247
|
+
.attr('class', function () {
|
|
8248
|
+
if (self.chartConfiguration.isDrilldownChart)
|
|
8249
|
+
return 'lib-xlabel-drilldowncharts';
|
|
8250
|
+
if (self.chartConfiguration.isMultiChartGridLine != undefined)
|
|
8251
|
+
return 'lib-xlabel-weeklyCharts';
|
|
8252
|
+
return 'lib-axis-waterfall-label lib-axis-group-label font-size-1';
|
|
8253
|
+
})
|
|
8254
|
+
.attr('style', self.chartConfiguration.xAxisCustomlabelStyles)
|
|
8255
|
+
.attr('transform', 'translate(' + width / 2 + ' ,' + (height + margin.top + 40) + ')')
|
|
8256
|
+
.style('text-anchor', 'middle')
|
|
8257
|
+
.style('fill', 'var(--chart-text-color)')
|
|
8258
|
+
.style('color', 'var(--chart-text-color)')
|
|
8259
|
+
.text(isAcr ? xLabelText.toUpperCase() : xLabelText.toLowerCase())
|
|
8260
|
+
.style('text-transform', isAcr ? 'none' : 'capitalize');
|
|
8246
8261
|
}
|
|
8247
8262
|
if (lineData && colors) {
|
|
8248
8263
|
var dataGroup = d3
|
|
@@ -9028,7 +9043,7 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
9028
9043
|
});
|
|
9029
9044
|
return tempScale.bandwidth();
|
|
9030
9045
|
}
|
|
9031
|
-
return
|
|
9046
|
+
return xSubgroup.bandwidth();
|
|
9032
9047
|
})
|
|
9033
9048
|
.attr('height', function (d) {
|
|
9034
9049
|
if (d.value == -1) {
|
|
@@ -9307,7 +9322,7 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
9307
9322
|
.on('mouseout', function (d) {
|
|
9308
9323
|
state.selectAll('.barstext').remove();
|
|
9309
9324
|
})
|
|
9310
|
-
.on('mouseover',
|
|
9325
|
+
.on('mouseover', (d1) => {
|
|
9311
9326
|
state
|
|
9312
9327
|
.selectAll('text')
|
|
9313
9328
|
.data(function (d) {
|
|
@@ -9337,7 +9352,10 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
9337
9352
|
.style('fill', function (d) {
|
|
9338
9353
|
return metaData.colors[d.key];
|
|
9339
9354
|
})
|
|
9340
|
-
.attr('width',
|
|
9355
|
+
// .attr('width', xSubgroup.bandwidth())
|
|
9356
|
+
// .attr('width', this.isZoomedOut ? xSubgroup.bandwidth() : xSubgroup.bandwidth() * 0.6)
|
|
9357
|
+
.attr('x', (d) => xSubgroup(d.key) +
|
|
9358
|
+
(this.isZoomedOut ? 0 : (xSubgroup.bandwidth() * 0.4) / 2))
|
|
9341
9359
|
.text(function (d) {
|
|
9342
9360
|
return d.value;
|
|
9343
9361
|
});
|
|
@@ -9569,6 +9587,29 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
9569
9587
|
.style('font-size', 'smaller')
|
|
9570
9588
|
.text(metaData.lineyLabel);
|
|
9571
9589
|
}
|
|
9590
|
+
if (metaData.xLabel) {
|
|
9591
|
+
function isAcronym(label) {
|
|
9592
|
+
return (label.length <= 4 && /^[A-Z]+$/.test(label)) || (label === label.toUpperCase() && /[A-Z]/.test(label));
|
|
9593
|
+
}
|
|
9594
|
+
const xLabelText = metaData.xLabel;
|
|
9595
|
+
const isAcr = isAcronym(xLabelText.replace(/[^A-Za-z]/g, ''));
|
|
9596
|
+
svg
|
|
9597
|
+
.append('text')
|
|
9598
|
+
.attr('class', function () {
|
|
9599
|
+
if (self.chartConfiguration.isDrilldownChart)
|
|
9600
|
+
return 'lib-xlabel-drilldowncharts';
|
|
9601
|
+
if (self.chartConfiguration.isMultiChartGridLine != undefined)
|
|
9602
|
+
return 'lib-xlabel-weeklyCharts';
|
|
9603
|
+
return 'lib-axis-waterfall-label lib-axis-group-label font-size-1';
|
|
9604
|
+
})
|
|
9605
|
+
.attr('style', self.chartConfiguration.xAxisCustomlabelStyles)
|
|
9606
|
+
.attr('transform', 'translate(' + width / 2 + ' ,' + (height + margin.top + 40) + ')')
|
|
9607
|
+
.style('text-anchor', 'middle')
|
|
9608
|
+
.style('fill', 'var(--chart-text-color)')
|
|
9609
|
+
.style('color', 'var(--chart-text-color)')
|
|
9610
|
+
.text(isAcr ? xLabelText.toUpperCase() : xLabelText.toLowerCase())
|
|
9611
|
+
.style('text-transform', isAcr ? 'none' : 'capitalize');
|
|
9612
|
+
}
|
|
9572
9613
|
if (lineData) {
|
|
9573
9614
|
svg
|
|
9574
9615
|
.append('path')
|