axidio-styleguide-library1-v2 0.3.37 → 0.3.39
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.
|
@@ -7859,16 +7859,19 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
7859
7859
|
}
|
|
7860
7860
|
// ✅ Tablet View — Rotate if text > 10 characters
|
|
7861
7861
|
if (isTablet) {
|
|
7862
|
+
const self = this;
|
|
7862
7863
|
const textNodes = svg.selectAll('g.x1.axis1 g.tick text');
|
|
7863
7864
|
textNodes.each(function (d) {
|
|
7864
7865
|
const text = d ? d.toString().trim() : '';
|
|
7865
7866
|
// Detect date formats (to skip them)
|
|
7866
7867
|
const isDateString = /^\d{1,4}[-\/]\d{1,2}[-\/]\d{1,4}$/.test(text) || // e.g. 2025-10-29 or 10/29/2025
|
|
7867
7868
|
/^(\d{1,4}[-\/]\d{1,2}[-\/]\d{1,4})\s*[-–]\s*(\d{1,4}[-\/]\d{1,2}[-\/]\d{1,4})$/.test(text);
|
|
7869
|
+
const textSelection = d3.select(self);
|
|
7870
|
+
// 🧹 Clean up any previous tspans or text before setting new one
|
|
7871
|
+
textSelection.selectAll('tspan').remove();
|
|
7868
7872
|
if (!isDateString && text.length > 10) {
|
|
7869
7873
|
const trimmed = text.slice(0, 10) + '…';
|
|
7870
7874
|
textNodes
|
|
7871
|
-
.style('writing-mode', 'sideways-lr') // Vertical text
|
|
7872
7875
|
.attr('text-anchor', 'middle')
|
|
7873
7876
|
.attr('y', 25)
|
|
7874
7877
|
.attr('x', 0)
|