axidio-styleguide-library1-v2 0.1.19 → 0.1.21
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.
|
@@ -8787,9 +8787,9 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
8787
8787
|
if (subgroups.length > 1 && data.length > 8 && metaData.xLabel) {
|
|
8788
8788
|
const isDateLabel = /\d{2,4}[-\/]/.test(d);
|
|
8789
8789
|
if (self.chartConfiguration.isFullScreen) {
|
|
8790
|
-
return isDateLabel ? short_tick_length_bg +
|
|
8790
|
+
return isDateLabel ? short_tick_length_bg + 14 : short_tick_length_bg;
|
|
8791
8791
|
}
|
|
8792
|
-
return isDateLabel ? short_tick_length_bg +
|
|
8792
|
+
return isDateLabel ? short_tick_length_bg + 14 : short_tick_length_bg;
|
|
8793
8793
|
}
|
|
8794
8794
|
// For grouped bar charts with many bars and NO xLabel, add space as before, but reduce in fullscreen
|
|
8795
8795
|
if (subgroups.length > 1 && data.length > 8 && !metaData.xLabel) {
|
|
@@ -8844,10 +8844,15 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
8844
8844
|
if (dateRangeRegex.test(d.trim())) {
|
|
8845
8845
|
return d.trim().replace(dateRangeRegex, (m, d1, d2) => `${d1} - ${d2}`);
|
|
8846
8846
|
}
|
|
8847
|
-
//
|
|
8848
|
-
// If label looks like a date (contains digits and - or /)
|
|
8847
|
+
// Split date and week labels into two lines in grouped bar zoom-in view (and minimized view)
|
|
8849
8848
|
const isDateLabel = /\d{2,4}[-\/]/.test(d);
|
|
8850
|
-
|
|
8849
|
+
const isWeekLabel = /week|wk|w\d+/i.test(d);
|
|
8850
|
+
if (subgroups.length > 1 && !self.isZoomedOut && data.length > 8 && d.indexOf(' ') > -1 && (isDateLabel || isWeekLabel)) {
|
|
8851
|
+
var first = d.substring(0, d.indexOf(' '));
|
|
8852
|
+
var second = d.substring(d.indexOf(' ') + 1).trim();
|
|
8853
|
+
return first + '\n' + second;
|
|
8854
|
+
}
|
|
8855
|
+
// Also keep previous logic for minimized view
|
|
8851
8856
|
if (isDateLabel) {
|
|
8852
8857
|
if (!self.isHeaderVisible && data.length > 8 && d.indexOf(' ') > -1) {
|
|
8853
8858
|
var first = d.substring(0, d.indexOf(' '));
|
|
@@ -9151,11 +9156,11 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
9151
9156
|
.attr('width', function (d) {
|
|
9152
9157
|
// For grouped bar charts in zoom-in view, slightly increase bar width for both bars (shipped and planned)
|
|
9153
9158
|
if (subgroups.length > 1 && !self.isZoomedOut) {
|
|
9154
|
-
return xSubgroup.bandwidth() * 0.
|
|
9159
|
+
return xSubgroup.bandwidth() * 0.3;
|
|
9155
9160
|
}
|
|
9156
9161
|
// For single-bar (non-grouped) charts in zoom-in view, set bar width to 80
|
|
9157
9162
|
if (subgroups.length === 1 && !self.isZoomedOut) {
|
|
9158
|
-
return
|
|
9163
|
+
return 80;
|
|
9159
9164
|
}
|
|
9160
9165
|
// Default logic for other chart types
|
|
9161
9166
|
if (self.chartConfiguration.isDrilldownChart) {
|
|
@@ -9165,9 +9170,9 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
9165
9170
|
tempScale = d3.scaleBand().domain(keys).range([0, x.bandwidth()]);
|
|
9166
9171
|
if (x.bandwidth() > 100) {
|
|
9167
9172
|
// Increase bar width a bit in zoom-in view
|
|
9168
|
-
let reducedBarWidth =
|
|
9173
|
+
let reducedBarWidth = 60;
|
|
9169
9174
|
if (!self.isZoomedOut) {
|
|
9170
|
-
reducedBarWidth =
|
|
9175
|
+
reducedBarWidth = 100;
|
|
9171
9176
|
}
|
|
9172
9177
|
if (self.chartData.data.length == 1) {
|
|
9173
9178
|
if (Object.keys(self.chartData.data[0]).length == 2) {
|