axidio-styleguide-library1-v2 0.3.36 → 0.3.38
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.
|
@@ -7861,13 +7861,17 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
7861
7861
|
if (isTablet) {
|
|
7862
7862
|
const textNodes = svg.selectAll('g.x1.axis1 g.tick text');
|
|
7863
7863
|
textNodes.each(function (d) {
|
|
7864
|
-
const text = d ? d.toString() : '';
|
|
7865
|
-
|
|
7864
|
+
const text = d ? d.toString().trim() : '';
|
|
7865
|
+
// Detect date formats (to skip them)
|
|
7866
|
+
const isDateString = /^\d{1,4}[-\/]\d{1,2}[-\/]\d{1,4}$/.test(text) || // e.g. 2025-10-29 or 10/29/2025
|
|
7867
|
+
/^(\d{1,4}[-\/]\d{1,2}[-\/]\d{1,4})\s*[-–]\s*(\d{1,4}[-\/]\d{1,2}[-\/]\d{1,4})$/.test(text);
|
|
7868
|
+
if (!isDateString && text.length > 10) {
|
|
7869
|
+
const trimmed = text.slice(0, 10) + '…';
|
|
7866
7870
|
textNodes
|
|
7867
|
-
.style('writing-mode', 'sideways-lr') // Vertical text
|
|
7868
7871
|
.attr('text-anchor', 'middle')
|
|
7869
7872
|
.attr('y', 25)
|
|
7870
|
-
.attr('x', 0)
|
|
7873
|
+
.attr('x', 0)
|
|
7874
|
+
.text(trimmed);
|
|
7871
7875
|
}
|
|
7872
7876
|
});
|
|
7873
7877
|
}
|