axidio-styleguide-library1-v2 0.0.984 → 0.0.986
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.
|
@@ -8858,8 +8858,10 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
8858
8858
|
});
|
|
8859
8859
|
// Now apply writing-mode: sideways-lr for grouped charts with date labels in zoomed-out view and many bars
|
|
8860
8860
|
xAxisLabels.each(function (d) {
|
|
8861
|
-
|
|
8862
|
-
|
|
8861
|
+
// Only apply writing-mode for exact date labels, not those containing 'week' or similar
|
|
8862
|
+
const isDateLabel = /^(\d{2,4}[-\/])?\d{2,4}[-\/]\d{2,4}$/.test(d.trim());
|
|
8863
|
+
const isWeekLabel = /week|wk|w\d+/i.test(d);
|
|
8864
|
+
if (subgroups.length > 1 && self.isZoomedOut && data.length > 8 && isDateLabel && !isWeekLabel) {
|
|
8863
8865
|
d3.select(this).style('writing-mode', 'sideways-lr');
|
|
8864
8866
|
}
|
|
8865
8867
|
});
|
|
@@ -9015,7 +9017,18 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
9015
9017
|
});
|
|
9016
9018
|
}
|
|
9017
9019
|
var xSubgroup = d3.scaleBand().domain(subgroups);
|
|
9018
|
-
if
|
|
9020
|
+
// Check if chart is grouped and labels are exact dates
|
|
9021
|
+
const isGroupedWithExactDateLabels = subgroups.length > 1 && data.some((datum) => {
|
|
9022
|
+
const label = datum.name;
|
|
9023
|
+
const isDateLabel = /^\d{2,4}[-\/]\d{2,4}([-\/]\d{2,4})?$/.test(label.trim());
|
|
9024
|
+
const isWeekLabel = /week|wk|w\d+/i.test(label);
|
|
9025
|
+
return isDateLabel && !isWeekLabel;
|
|
9026
|
+
});
|
|
9027
|
+
if (isGroupedWithExactDateLabels) {
|
|
9028
|
+
// Increase bar width for both zoom-in and zoom-out views
|
|
9029
|
+
xSubgroup.range([0, x.bandwidth() * 0.5]);
|
|
9030
|
+
}
|
|
9031
|
+
else if (subgroups.length > 1 && !this.isZoomedOut) {
|
|
9019
9032
|
// For grouped bar charts in zoom-in view, reduce padding between bars
|
|
9020
9033
|
xSubgroup.range([0, x.bandwidth()]);
|
|
9021
9034
|
}
|