axidio-styleguide-library1-v2 0.2.72 → 0.2.74

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.
@@ -7726,11 +7726,13 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
7726
7726
  .domain(data.map((d) => d.name.toLowerCase()));
7727
7727
  }
7728
7728
  else {
7729
- // Increase padding for mobile view to add space after every bar group
7730
- const barGroupPadding = isMobile ? 1 : 0.3;
7729
+ // Use consistent padding but adjust spacing for mobile
7730
+ const barGroupPadding = 0.3;
7731
+ const mobileSpacing = isMobile ? LEFT_AND_RIGHT_SPACES * 1.5 : LEFT_AND_RIGHT_SPACES;
7732
+ // Adjust the range to create more space between bars on mobile
7731
7733
  x = d3.scaleBand()
7732
7734
  .domain(groups)
7733
- .range([LEFT_AND_RIGHT_SPACES, width - RIGHT_SVG_WIDTH - LEFT_AND_RIGHT_SPACES])
7735
+ .range([mobileSpacing, width - RIGHT_SVG_WIDTH - mobileSpacing])
7734
7736
  .padding([barGroupPadding]);
7735
7737
  }
7736
7738
  const xScaleFromOrigin = d3.scaleBand()
@@ -8064,17 +8066,21 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
8064
8066
  }
8065
8067
  setupXSubgroupScale(subgroups, x, self) {
8066
8068
  const xSubgroup = d3.scaleBand().domain(subgroups);
8069
+ const isMobile = window.innerWidth < 576;
8070
+ // Add more spacing between bars within groups on mobile
8071
+ const subgroupPadding = isMobile ? 0.3 : 0.1;
8067
8072
  if (subgroups.length > 1 && !this.isZoomedOut) {
8068
- xSubgroup.range([0, x.bandwidth()]);
8073
+ // For multiple bars, add padding between them
8074
+ xSubgroup.range([0, x.bandwidth()]).padding(subgroupPadding);
8069
8075
  }
8070
8076
  else if (subgroups.length === 1 && !this.isZoomedOut) {
8071
8077
  xSubgroup.range([0, 100]);
8072
8078
  }
8073
8079
  else if (this.chartConfiguration.isMultiChartGridLine === undefined) {
8074
- xSubgroup.range([0, x.bandwidth()]);
8080
+ xSubgroup.range([0, x.bandwidth()]).padding(subgroupPadding);
8075
8081
  }
8076
8082
  else {
8077
- xSubgroup.range([0, x.bandwidth()]);
8083
+ xSubgroup.range([0, x.bandwidth()]).padding(subgroupPadding);
8078
8084
  }
8079
8085
  return xSubgroup;
8080
8086
  }