axidio-styleguide-library1-v2 0.2.63 → 0.2.64
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.
|
@@ -9136,12 +9136,21 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
9136
9136
|
.attr('y', (d) => this.calculateXLabelYPosition(d, subgroups, data, metaData, self, shortTickLengthBg))
|
|
9137
9137
|
.attr('x', (d) => (self.chartData.data.length > 8 && !self.isZoomedOut) ? 1 : 0)
|
|
9138
9138
|
.text((d) => this.formatXLabelText(d, data, metaData, subgroups, self, isMobile));
|
|
9139
|
-
// Apply writing-mode for
|
|
9139
|
+
// Apply writing-mode only for mobile in zoom-out view
|
|
9140
9140
|
xAxisLabels.each(function (d) {
|
|
9141
9141
|
const isDateLabel = /^(\d{2,4}[-\/])?\d{2,4}[-\/]\d{2,4}$/.test(d.trim());
|
|
9142
9142
|
const isWeekLabel = /week|wk|w\d+/i.test(d);
|
|
9143
|
-
|
|
9144
|
-
|
|
9143
|
+
const element = d3.select(this);
|
|
9144
|
+
// Only apply rotation and increased dy for mobile in zoom-out view
|
|
9145
|
+
if (isMobile && subgroups.length > 1 && self.isZoomedOut && data.length > 8 && isDateLabel && !isWeekLabel) {
|
|
9146
|
+
element
|
|
9147
|
+
.style('writing-mode', 'sideways-lr')
|
|
9148
|
+
.attr('y', 30); // Increase dy to 30 for better alignment in mobile zoom-out view
|
|
9149
|
+
}
|
|
9150
|
+
else {
|
|
9151
|
+
element
|
|
9152
|
+
.style('writing-mode', null)
|
|
9153
|
+
.attr('y', null); // Reset to default positioning when not in mobile zoom-out view
|
|
9145
9154
|
}
|
|
9146
9155
|
});
|
|
9147
9156
|
// Add second line for non-date labels on desktop
|