axidio-styleguide-library1-v2 0.4.4 → 0.4.5

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.
@@ -7878,42 +7878,22 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
7878
7878
  // }
7879
7879
  if (isria && self.chartData.data.length >= 2) {
7880
7880
  svg.selectAll('g.x1.axis1 g.tick text')
7881
- .classed('mobile-xaxis-override', true)
7882
7881
  .each((d) => {
7883
7882
  const textElement = d3.select(this);
7884
- textElement.text(null);
7885
- if (d.length > 5) {
7886
- // Try to split at natural boundaries (space, hyphen, slash)
7887
- let splitIndex = d.length > 8
7888
- ? Math.floor(d.length / 2)
7889
- : Math.ceil(d.length / 2);
7890
- // Look for space, hyphen, or slash near middle
7891
- for (let i = splitIndex - 1; i <= splitIndex + 1; i++) {
7892
- if (d[i] === ' ' || d[i] === '-' || d[i] === '/') {
7893
- splitIndex = i + 1;
7894
- break;
7895
- }
7896
- }
7897
- const line1 = d.substring(0, splitIndex).trim().toLowerCase();
7898
- const line2 = d.substring(splitIndex).trim().toLowerCase();
7899
- textElement.append('tspan')
7900
- .text(line1)
7901
- .attr('x', 5)
7902
- .attr('dy', '0em');
7903
- textElement.append('tspan')
7904
- .text(line2)
7905
- .attr('x', 5)
7906
- .attr('dy', '1.2em');
7907
- }
7908
- else {
7909
- // Single line for 5 chars or less
7910
- textElement.text(d.toLowerCase())
7911
- .attr('x', 5)
7912
- .attr('dy', '0.71em');
7913
- }
7883
+ const hasSpecialChars = /[\s\-_]/.test(d); // Check for space, hyphen, or underscore
7884
+ // Only apply class if it has special characters
7885
+ textElement.classed('mobile-xaxis-override', hasSpecialChars);
7886
+ // if (hasSpecialChars) {
7887
+ // // Apply truncation for text with special chars
7888
+ // textElement.text(d.substring(0, 4).toLowerCase());
7889
+ // } else {
7890
+ // // Keep full text for simple strings
7891
+ // textElement.text(d.toLowerCase());
7892
+ // }
7914
7893
  })
7915
- .style('font-size', '11px') // Slightly smaller for better fit
7894
+ .style('font-size', '12px')
7916
7895
  .attr('y', 5)
7896
+ .attr('x', 5)
7917
7897
  .attr('text-anchor', 'middle');
7918
7898
  }
7919
7899
  // ✅ Tablet View — Rotate if text > 10 characters