axidio-styleguide-library1-v2 0.1.28 → 0.1.29
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/group-chart/group-chart.component.mjs +22 -21
- 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 +22 -60
- package/fesm2022/axidio-styleguide-library1-v2.mjs +44 -81
- package/fesm2022/axidio-styleguide-library1-v2.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -3939,8 +3939,8 @@ class GroupChartComponent extends ComponentUniqueId {
|
|
|
3939
3939
|
else {
|
|
3940
3940
|
x = d3
|
|
3941
3941
|
.scaleBand()
|
|
3942
|
-
.domain(groups)
|
|
3943
3942
|
.range([leftAndRightSpaces, width - rightSvgWidth - leftAndRightSpaces])
|
|
3943
|
+
.domain(groups).reverse()
|
|
3944
3944
|
.padding([0.3]);
|
|
3945
3945
|
}
|
|
3946
3946
|
// x.bandwidth(96);
|
|
@@ -4557,29 +4557,30 @@ class GroupChartComponent extends ComponentUniqueId {
|
|
|
4557
4557
|
.attr('class', 'title')
|
|
4558
4558
|
.style('z-index', 99)
|
|
4559
4559
|
.html(function () {
|
|
4560
|
-
|
|
4561
|
-
|
|
4562
|
-
|
|
4563
|
-
|
|
4564
|
-
|
|
4565
|
-
|
|
4566
|
-
|
|
4560
|
+
if (!isNaN(d[1] - d[0])) {
|
|
4561
|
+
if (d[1] - d[0] === 0) {
|
|
4562
|
+
return '<span class="title-top-text">0</span>';
|
|
4563
|
+
}
|
|
4564
|
+
var dataType = metaData.dataType ? metaData.dataType : '';
|
|
4565
|
+
var desiredText = '';
|
|
4566
|
+
desiredText =
|
|
4567
|
+
'<span class="title-bar-name">' +
|
|
4568
|
+
(d.data.name ? d.data.name : '') +
|
|
4569
|
+
'</span>';
|
|
4570
|
+
desiredText += metaData.unit
|
|
4571
|
+
? '<span class="title-top-text">' +
|
|
4572
|
+
metaData.unit +
|
|
4573
|
+
(d[1] - d[0]) +
|
|
4574
|
+
dataType +
|
|
4575
|
+
'</span>'
|
|
4576
|
+
: '<span class="title-top-text">' +
|
|
4577
|
+
(d[1] - d[0]) +
|
|
4567
4578
|
dataType +
|
|
4568
4579
|
'</span>';
|
|
4569
4580
|
return desiredText;
|
|
4570
4581
|
}
|
|
4571
|
-
else
|
|
4572
|
-
|
|
4573
|
-
let desiredText = '<span class="title-bar-name">' +
|
|
4574
|
-
tempKey +
|
|
4575
|
-
':' +
|
|
4576
|
-
d.Value +
|
|
4577
|
-
dataType +
|
|
4578
|
-
'</span>';
|
|
4579
|
-
desiredText +=
|
|
4580
|
-
'<span class="title-bar-value">' + d.name + '</span>';
|
|
4581
|
-
return desiredText;
|
|
4582
|
-
}
|
|
4582
|
+
else
|
|
4583
|
+
return;
|
|
4583
4584
|
});
|
|
4584
4585
|
}
|
|
4585
4586
|
function handleMouseOut(d, i) {
|
|
@@ -7392,14 +7393,14 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
7392
7393
|
])
|
|
7393
7394
|
.domain(data.map(function (d) {
|
|
7394
7395
|
return d.name;
|
|
7395
|
-
}))
|
|
7396
|
+
}).reverse())
|
|
7396
7397
|
.padding(isMobile ? 0.2 : 0.5);
|
|
7397
7398
|
var xScaleFromOrigin = d3
|
|
7398
7399
|
.scaleBand()
|
|
7399
7400
|
.rangeRound([width - rightSvgWidth, 0])
|
|
7400
7401
|
.domain(data.map(function (d) {
|
|
7401
7402
|
return d.name;
|
|
7402
|
-
}));
|
|
7403
|
+
}).reverse());
|
|
7403
7404
|
// ...existing code...
|
|
7404
7405
|
/**
|
|
7405
7406
|
* draw second x axis on top
|
|
@@ -8551,7 +8552,7 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
8551
8552
|
var height = parseInt(verticalstackedcontainer.style('height')) *
|
|
8552
8553
|
(self.chartConfiguration.svgHeight / 100) -
|
|
8553
8554
|
margin.top -
|
|
8554
|
-
margin.bottom;
|
|
8555
|
+
margin.bottom + 30;
|
|
8555
8556
|
/**
|
|
8556
8557
|
* entire height used in weekly charts as x axis needed to be displayed at the bottom of the chart
|
|
8557
8558
|
*/
|
|
@@ -8642,7 +8643,7 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
8642
8643
|
.append('svg')
|
|
8643
8644
|
// .attr('id', self.uniqueId)
|
|
8644
8645
|
.attr('width', width - rightSvgWidth)
|
|
8645
|
-
.attr('height', height + margin.top + margin.bottom +
|
|
8646
|
+
.attr('height', height + margin.top + margin.bottom + 30)
|
|
8646
8647
|
// .call(ChartHelper.responsivefy)
|
|
8647
8648
|
.append('g')
|
|
8648
8649
|
.attr('transform', 'translate(' + 0 + ',' + margin.top + ')');
|
|
@@ -8778,19 +8779,18 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
8778
8779
|
});
|
|
8779
8780
|
}
|
|
8780
8781
|
if (self.chartConfiguration.xLabelsOnSameLine) {
|
|
8781
|
-
|
|
8782
|
+
svg
|
|
8782
8783
|
.selectAll('g.x1.axis1 g.tick text')
|
|
8783
8784
|
.attr('class', 'lib-xaxis-labels-texts-drilldown')
|
|
8784
8785
|
.style('font-size', this.isHeaderVisible ? '18px' : '14px')
|
|
8785
|
-
.attr('text-anchor', 'middle')
|
|
8786
8786
|
.attr('y', function (d) {
|
|
8787
|
-
// For grouped bar charts with many bars and xLabel present,
|
|
8787
|
+
// For grouped bar charts with many bars and xLabel present, do NOT add extra space (avoid overlap)
|
|
8788
8788
|
if (subgroups.length > 1 && data.length > 8 && metaData.xLabel) {
|
|
8789
|
-
|
|
8789
|
+
// In maximized (fullscreen) view, keep the gap minimal
|
|
8790
8790
|
if (self.chartConfiguration.isFullScreen) {
|
|
8791
|
-
return
|
|
8791
|
+
return short_tick_length_bg;
|
|
8792
8792
|
}
|
|
8793
|
-
return
|
|
8793
|
+
return short_tick_length_bg;
|
|
8794
8794
|
}
|
|
8795
8795
|
// For grouped bar charts with many bars and NO xLabel, add space as before, but reduce in fullscreen
|
|
8796
8796
|
if (subgroups.length > 1 && data.length > 8 && !metaData.xLabel) {
|
|
@@ -8839,37 +8839,8 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
8839
8839
|
if (isValueToBeIgnored) {
|
|
8840
8840
|
return '';
|
|
8841
8841
|
}
|
|
8842
|
-
// Always add space before and after hyphen for date range labels, even when header is visible and label is single line
|
|
8843
|
-
// Apply for grouped bar charts and single bar charts, header visible, single line
|
|
8844
|
-
const dateRangeRegex = /(\d{2,4}[-\/]\d{2}[-\/]\d{2,4})\s*-\s*(\d{2,4}[-\/]\d{2}[-\/]\d{2,4})/;
|
|
8845
|
-
if (dateRangeRegex.test(d.trim())) {
|
|
8846
|
-
return d.trim().replace(dateRangeRegex, (m, d1, d2) => `${d1} - ${d2}`);
|
|
8847
|
-
}
|
|
8848
|
-
// Split date and week labels into two lines in grouped bar zoom-in view (and minimized view)
|
|
8849
|
-
const isDateLabel = /\d{2,4}[-\/]/.test(d);
|
|
8850
|
-
const isWeekLabel = /week|wk|w\d+/i.test(d);
|
|
8851
|
-
if (subgroups.length > 1 && !self.isZoomedOut && data.length > 8 && d.indexOf(' ') > -1 && (isDateLabel || isWeekLabel)) {
|
|
8852
|
-
var first = d.substring(0, d.indexOf(' '));
|
|
8853
|
-
var second = d.substring(d.indexOf(' ') + 1).trim();
|
|
8854
|
-
return first + '\n' + second;
|
|
8855
|
-
}
|
|
8856
|
-
// Also keep previous logic for minimized view
|
|
8857
|
-
if (isDateLabel) {
|
|
8858
|
-
if (!self.isHeaderVisible && data.length > 8 && d.indexOf(' ') > -1) {
|
|
8859
|
-
var first = d.substring(0, d.indexOf(' '));
|
|
8860
|
-
var second = d.substring(d.indexOf(' ') + 1).trim();
|
|
8861
|
-
return first + '\n' + second;
|
|
8862
|
-
}
|
|
8863
|
-
else {
|
|
8864
|
-
return d;
|
|
8865
|
-
}
|
|
8866
|
-
}
|
|
8867
|
-
if (d.trim().indexOf(' ') > -1) {
|
|
8868
|
-
return d.trim().substring(0, d.indexOf(' ')).toLowerCase();
|
|
8869
|
-
}
|
|
8870
|
-
return d.toLowerCase();
|
|
8871
8842
|
// If label looks like a date (contains digits and - or /)
|
|
8872
|
-
const
|
|
8843
|
+
const isDateLabel = /\d{2,4}[-\/]/.test(d);
|
|
8873
8844
|
// Only split date/week labels if there are many grouped bars and header is not visible
|
|
8874
8845
|
if (isDateLabel) {
|
|
8875
8846
|
if (!self.isHeaderVisible && data.length > 8 && d.indexOf(' ') > -1) {
|
|
@@ -8886,15 +8857,6 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
8886
8857
|
}
|
|
8887
8858
|
return d.toLowerCase();
|
|
8888
8859
|
});
|
|
8889
|
-
// Now apply writing-mode: sideways-lr for grouped charts with date labels in zoomed-out view and many bars
|
|
8890
|
-
xAxisLabels.each(function (d) {
|
|
8891
|
-
// Only apply writing-mode for exact date labels, not those containing 'week' or similar
|
|
8892
|
-
const isDateLabel = /^(\d{2,4}[-\/])?\d{2,4}[-\/]\d{2,4}$/.test(d.trim());
|
|
8893
|
-
const isWeekLabel = /week|wk|w\d+/i.test(d);
|
|
8894
|
-
if (subgroups.length > 1 && self.isZoomedOut && data.length > 8 && isDateLabel && !isWeekLabel) {
|
|
8895
|
-
d3.select(this).style('writing-mode', 'sideways-lr');
|
|
8896
|
-
}
|
|
8897
|
-
});
|
|
8898
8860
|
if (!isMobile) {
|
|
8899
8861
|
svg
|
|
8900
8862
|
.selectAll('g.x1.axis1 g.tick')
|
|
@@ -9047,19 +9009,20 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
9047
9009
|
});
|
|
9048
9010
|
}
|
|
9049
9011
|
var xSubgroup = d3.scaleBand().domain(subgroups);
|
|
9050
|
-
|
|
9012
|
+
// Weekly shipped/planned daily grouped chart: increase bar width for both zoom-in and zoom-out views
|
|
9013
|
+
if (subgroups.length > 1 && this.chartConfiguration.isMultiChartGridLine) {
|
|
9014
|
+
xSubgroup.range([0, x.bandwidth() * 1.2]).padding(0.05);
|
|
9015
|
+
}
|
|
9016
|
+
else if (subgroups.length > 1 && !this.isZoomedOut) {
|
|
9051
9017
|
// For grouped bar charts in zoom-in view, reduce padding between bars
|
|
9052
|
-
xSubgroup.range([0, x.bandwidth()]);
|
|
9018
|
+
xSubgroup.range([0, x.bandwidth()]).padding(0.05);
|
|
9053
9019
|
}
|
|
9054
9020
|
else if (subgroups.length === 1 && !this.isZoomedOut) {
|
|
9055
|
-
// For single-bar (non-grouped) charts in zoom-in view, set bar width to
|
|
9056
|
-
xSubgroup.range([0,
|
|
9057
|
-
}
|
|
9058
|
-
else if (this.chartConfiguration.isMultiChartGridLine == undefined) {
|
|
9059
|
-
xSubgroup.range([0, x.bandwidth()]);
|
|
9021
|
+
// For single-bar (non-grouped) charts in zoom-in view, set bar width to 80
|
|
9022
|
+
xSubgroup.range([0, 80]);
|
|
9060
9023
|
}
|
|
9061
9024
|
else {
|
|
9062
|
-
//
|
|
9025
|
+
// All other cases (including zoomed-out), use full bandwidth
|
|
9063
9026
|
xSubgroup.range([0, x.bandwidth()]);
|
|
9064
9027
|
}
|
|
9065
9028
|
// if (this.chartConfiguration.isDrilldownChart) {
|
|
@@ -9116,7 +9079,7 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
9116
9079
|
// Increase bar width a bit in zoom-in view
|
|
9117
9080
|
let reducedBarWidth = 60;
|
|
9118
9081
|
if (!self.isZoomedOut) {
|
|
9119
|
-
reducedBarWidth =
|
|
9082
|
+
reducedBarWidth = 80;
|
|
9120
9083
|
}
|
|
9121
9084
|
if (self.chartData.data.length == 1) {
|
|
9122
9085
|
if (Object.keys(self.chartData.data[0]).length == 2) {
|
|
@@ -9157,7 +9120,7 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
9157
9120
|
.attr('width', function (d) {
|
|
9158
9121
|
// For grouped bar charts in zoom-in view, slightly increase bar width for both bars (shipped and planned)
|
|
9159
9122
|
if (subgroups.length > 1 && !self.isZoomedOut) {
|
|
9160
|
-
return xSubgroup.bandwidth() * 0.
|
|
9123
|
+
return xSubgroup.bandwidth() * 0.5;
|
|
9161
9124
|
}
|
|
9162
9125
|
// For single-bar (non-grouped) charts in zoom-in view, set bar width to 80
|
|
9163
9126
|
if (subgroups.length === 1 && !self.isZoomedOut) {
|
|
@@ -9173,7 +9136,7 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
9173
9136
|
// Increase bar width a bit in zoom-in view
|
|
9174
9137
|
let reducedBarWidth = 60;
|
|
9175
9138
|
if (!self.isZoomedOut) {
|
|
9176
|
-
reducedBarWidth =
|
|
9139
|
+
reducedBarWidth = 80;
|
|
9177
9140
|
}
|
|
9178
9141
|
if (self.chartData.data.length == 1) {
|
|
9179
9142
|
if (Object.keys(self.chartData.data[0]).length == 2) {
|
|
@@ -9694,7 +9657,7 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
9694
9657
|
}
|
|
9695
9658
|
const xLabelText = metaData.xLabel;
|
|
9696
9659
|
const isAcr = isAcronym(xLabelText.replace(/[^A-Za-z]/g, ''));
|
|
9697
|
-
const xPosition = isria ? (height + margin.top + margin.bottom) : (height + margin.top + margin.bottom +
|
|
9660
|
+
const xPosition = isria ? (height + margin.top + margin.bottom) : (height + margin.top + margin.bottom + 10);
|
|
9698
9661
|
svg
|
|
9699
9662
|
.append('text')
|
|
9700
9663
|
.attr('class', function () {
|