axidio-styleguide-library1-v2 0.3.39 → 0.3.41
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,18 +7859,14 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
7859
7859
|
}
|
|
7860
7860
|
// ✅ Tablet View — Rotate if text > 10 characters
|
|
7861
7861
|
if (isTablet) {
|
|
7862
|
-
const self = this;
|
|
7863
7862
|
const textNodes = svg.selectAll('g.x1.axis1 g.tick text');
|
|
7864
7863
|
textNodes.each(function (d) {
|
|
7865
7864
|
const text = d ? d.toString().trim() : '';
|
|
7866
7865
|
// Detect date formats (to skip them)
|
|
7867
7866
|
const isDateString = /^\d{1,4}[-\/]\d{1,2}[-\/]\d{1,4}$/.test(text) || // e.g. 2025-10-29 or 10/29/2025
|
|
7868
7867
|
/^(\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();
|
|
7872
7868
|
if (!isDateString && text.length > 10) {
|
|
7873
|
-
const trimmed = text.slice(0,
|
|
7869
|
+
const trimmed = text.slice(0, 9) + '…';
|
|
7874
7870
|
textNodes
|
|
7875
7871
|
.attr('text-anchor', 'middle')
|
|
7876
7872
|
.attr('y', 25)
|