axidio-styleguide-library1-v2 0.2.90 → 0.2.91

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.
@@ -7857,8 +7857,8 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
7857
7857
  .attr('x', 5)
7858
7858
  .style('text-anchor', 'middle');
7859
7859
  }
7860
- // Mobile/tablet override - check for single-group date charts first
7861
- if (isMobile) {
7860
+ // Mobile/tablet override - check for date labels and apply appropriate rotation
7861
+ if (isMobile || isTablet) {
7862
7862
  const textNodes = svg.selectAll('g.x1.axis1 g.tick text');
7863
7863
  const groupsCount = data.length || 0;
7864
7864
  // Check if we have dates in x-axis and single group
@@ -7871,19 +7871,30 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
7871
7871
  hasDateValues = true;
7872
7872
  }
7873
7873
  });
7874
- if (hasDateValues && subgroups && subgroups.length < 3) {
7875
- // For single chart with dates, ensure horizontal display
7876
- textNodes
7877
- .style('writing-mode', 'horizontal-tb') // Explicitly set horizontal
7878
- .classed('mobile-xaxis-override', false) // Remove vertical class
7879
- .attr('transform', 'rotate(0)') // Remove any rotation
7880
- .attr('text-anchor', 'middle') // Center align
7881
- .attr('y', 20) // Push down a bit
7882
- .attr('dx', '0') // Reset any x offset
7883
- .attr('dy', '0'); // Reset any y offset
7874
+ if (hasDateValues) {
7875
+ if (isTablet) {
7876
+ // For tablet view with dates, rotate vertically
7877
+ textNodes
7878
+ .style('writing-mode', 'sideways-lr')
7879
+ .style('text-anchor', 'middle')
7880
+ .attr('y', 0)
7881
+ .attr('dx', '0')
7882
+ .attr('dy', '0');
7883
+ }
7884
+ else if (isMobile && subgroups && subgroups.length < 3) {
7885
+ // For mobile single chart with dates, keep horizontal
7886
+ textNodes
7887
+ .style('writing-mode', 'horizontal-tb')
7888
+ .classed('mobile-xaxis-override', false)
7889
+ .attr('transform', 'rotate(0)')
7890
+ .attr('text-anchor', 'middle')
7891
+ .attr('y', 20)
7892
+ .attr('dx', '0')
7893
+ .attr('dy', '0');
7894
+ }
7884
7895
  }
7885
7896
  else if (!this.isHeaderVisible) {
7886
- // Default mobile behavior for non-date or multi-group
7897
+ // Default mobile/tablet behavior for non-date labels
7887
7898
  textNodes.classed('mobile-xaxis-override', true);
7888
7899
  }
7889
7900
  }
@@ -7953,19 +7964,6 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
7953
7964
  // Check if we're on mobile or tablet
7954
7965
  const isSmallScreen = window.innerWidth < 992; // Less than 992px (mobile or tablet)
7955
7966
  // Check if label contains both date and week information
7956
- const formatDatePart = (dateStr) => {
7957
- // Match different date formats: MM/DD/YYYY, YYYY/MM/DD, etc.
7958
- const match = dateStr.match(/(\d{1,4})[-\/](\d{1,2})[-\/](\d{1,4})/);
7959
- if (!match)
7960
- return dateStr;
7961
- const [_, part1, part2, part3] = match;
7962
- // Check if year is first (YYYY/MM/DD)
7963
- if (part1.length === 4) {
7964
- return `${part2}/${part3}`; // Return MM/DD
7965
- }
7966
- // For MM/DD/YYYY format
7967
- return `${part1}/${part2}`; // Return MM/DD
7968
- };
7969
7967
  const hasDateAndTime = (text) => {
7970
7968
  const dateMatch = /\d{2,4}[-\/]\d{1,2}[-\/]\d{1,4}/.test(text) || !isNaN(Date.parse(text));
7971
7969
  const weekMatch = /week|wk|w\d+/i.test(text);
@@ -7975,10 +7973,7 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
7975
7973
  // Apply date-week trimming only for mobile and tablet screens
7976
7974
  if (isSmallScreen && labelInfo.isDate && labelInfo.isWeek) {
7977
7975
  const datePart = d.match(/\d{2,4}[-\/]\d{1,2}[-\/]\d{1,4}/);
7978
- if (datePart) {
7979
- return formatDatePart(datePart[0]);
7980
- }
7981
- return d;
7976
+ return datePart ? datePart[0] : d;
7982
7977
  }
7983
7978
  // Mobile handling: keep date labels intact for single-series charts (do not trim)
7984
7979
  if (isMobile) {