axidio-styleguide-library1-v2 0.0.913 → 0.0.915

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.
@@ -8694,11 +8694,18 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
8694
8694
  }));
8695
8695
  }
8696
8696
  else {
8697
+ // For normal drill down chart, increase padding to reduce bar width, but do not change x-axis label formatting
8698
+ let barPadding = 0.5; // Increased padding for thinner bars
8699
+ if (this.isZoomedOut || (this.chartData.data.length > 8 && !this.isZoomedOut) || this.chartConfiguration.isMultiChartGridLine !== undefined) {
8700
+ // Use default padding for zoomed in/out and other chart types
8701
+ barPadding = 0.3;
8702
+ }
8697
8703
  x = d3
8698
8704
  .scaleBand()
8699
8705
  .domain(groups)
8700
8706
  .range([leftAndRightSpaces, width - rightSvgWidth - leftAndRightSpaces])
8701
- .padding([0.3]);
8707
+ .padding([barPadding]);
8708
+ // No changes to x-axis label formatting below, keep original logic
8702
8709
  }
8703
8710
  // x.bandwidth(96);
8704
8711
  var xScaleFromOrigin = d3
@@ -8798,7 +8805,7 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
8798
8805
  .style('font-size', this.isHeaderVisible ? '18px' : '14px')
8799
8806
  .attr('y', this.isHeaderVisible
8800
8807
  ? short_tick_length_bg + 25
8801
- : short_tick_length_bg + 25)
8808
+ : short_tick_length_bg + 30)
8802
8809
  .attr('x', function (d) {
8803
8810
  if (self.chartData.data.length > 8 && !self.isZoomedOut) {
8804
8811
  return -25; // Move first line text slightly to the left too
@@ -9070,28 +9077,47 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
9070
9077
  })
9071
9078
  .attr('width', function (d) {
9072
9079
  if (self.chartConfiguration.isDrilldownChart) {
9073
- let isSingleBar = false;
9080
+ // var tempScale;
9074
9081
  data.map((indiv) => {
9075
9082
  if (indiv.name == d.name) {
9076
9083
  let keys = Object.keys(indiv).filter((temp, i) => i != 0);
9084
+ var temp;
9077
9085
  tempScale = d3.scaleBand().domain(keys).range([0, x.bandwidth()]);
9078
- if (keys.length === 1) {
9079
- isSingleBar = true;
9086
+ if (x.bandwidth() > 100) {
9087
+ if (self.chartData.data.length == 1) {
9088
+ if (Object.keys(self.chartData.data[0]).length == 2) {
9089
+ tempScale.range([
9090
+ 0 + (x.bandwidth() - 125) / 2,
9091
+ x.bandwidth() - (x.bandwidth() - 125) / 2,
9092
+ ]);
9093
+ // .padding(0.05);
9094
+ }
9095
+ else
9096
+ tempScale.range([
9097
+ 0 + (x.bandwidth() - 125) / 2,
9098
+ x.bandwidth() - (x.bandwidth() - 125) / 2,
9099
+ ]);
9100
+ // .padding(0.05);
9101
+ }
9102
+ else
9103
+ tempScale.range([
9104
+ 0 + (x.bandwidth() - 125) / 2,
9105
+ x.bandwidth() - (x.bandwidth() - 125) / 2,
9106
+ ]);
9080
9107
  }
9081
9108
  }
9082
9109
  });
9083
- if (isSingleBar) {
9084
- if (self.isZoomedOut) {
9085
- // Reduce width to 60% or min 25px in zoomed out view
9086
- return Math.max(tempScale.bandwidth() * 0.6, 25);
9087
- }
9088
- return tempScale.bandwidth();
9089
- }
9090
- // Grouped bars: keep as is
9091
- return tempScale.bandwidth();
9092
- }
9093
- // Non-drilldown: keep as is
9094
- return tempScale.bandwidth();
9110
+ return self.isZoomedOut
9111
+ ? tempScale.bandwidth()
9112
+ : self.chartData.data.length && self.chartData.data.length > 8
9113
+ ? tempScale.bandwidth() * 0.5
9114
+ : tempScale.bandwidth();
9115
+ }
9116
+ return self.isZoomedOut
9117
+ ? tempScale.bandwidth()
9118
+ : self.chartData.data.length && self.chartData.data.length > 8
9119
+ ? tempScale.bandwidth() * 0.5
9120
+ : tempScale.bandwidth();
9095
9121
  })
9096
9122
  .attr('height', function (d) {
9097
9123
  if (d.value == -1) {