axidio-styleguide-library1-v2 0.4.91 → 0.4.93

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.
@@ -7983,10 +7983,10 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
7983
7983
  svg.selectAll('g.x1.axis1 g.tick text')
7984
7984
  .attr('x', -20);
7985
7985
  }
7986
- if (!isria && self.chartData.data.length > 11 && !self.isZoomedOut && (x.bandwidth < 100)) {
7987
- svg.selectAll('g.x1.axis1 g.tick text')
7988
- .attr('x', -20);
7989
- }
7986
+ // if (!isria && self.chartData.data.length > 11 && !self.isZoomedOut && (x.bandwidth< 100)) {
7987
+ // svg.selectAll('g.x1.axis1 g.tick text')
7988
+ // .attr('x', -20);
7989
+ // }
7990
7990
  // ✅ Tablet View — Rotate if text > 10 characters
7991
7991
  if (isTablet) {
7992
7992
  const textNodes = svg.selectAll('g.x1.axis1 g.tick text');
@@ -8048,6 +8048,16 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
8048
8048
  textNodes.classed('mobile-xaxis-override', true);
8049
8049
  }
8050
8050
  }
8051
+ if (!isria && !self.isZoomedOut && subgroups.length > 1 && data.length > 8 && x.bandwidth() > 100) {
8052
+ const reducedBarWidth = 100;
8053
+ const offset = (x.bandwidth() - reducedBarWidth) / 2;
8054
+ const centerOffset = offset + (reducedBarWidth / 2);
8055
+ svg.selectAll('g.x1.axis1 g.tick')
8056
+ .attr('transform', function (d) {
8057
+ const adjustedX = x(d) + centerOffset;
8058
+ return `translate(${adjustedX},0)`;
8059
+ });
8060
+ }
8051
8061
  }
8052
8062
  applyXLabelsOnSameLine(svg, subgroups, data, metaData, self, shortTickLengthBg, isMobile, isria) {
8053
8063
  const xAxisLabels = svg.selectAll('g.x1.axis1 g.tick text')
@@ -8341,7 +8351,7 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
8341
8351
  const keys = Object.keys(indiv).filter((temp, i) => i !== 0);
8342
8352
  calculatedScale = d3.scaleBand().domain(keys).range([0, x.bandwidth()]);
8343
8353
  if (x.bandwidth() > 100) {
8344
- const reducedBarWidth = self.isZoomedOut ? 60 : 60;
8354
+ const reducedBarWidth = self.isZoomedOut ? 60 : 100;
8345
8355
  const offset = (x.bandwidth() - reducedBarWidth) / 2;
8346
8356
  calculatedScale.range([offset, x.bandwidth() - offset]);
8347
8357
  }