axidio-styleguide-library1-v2 0.0.913 → 0.0.914

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,17 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
8694
8694
  }));
8695
8695
  }
8696
8696
  else {
8697
+ // For normal drill down chart, increase padding to reduce bar width
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]);
8702
8708
  }
8703
8709
  // x.bandwidth(96);
8704
8710
  var xScaleFromOrigin = d3
@@ -8798,7 +8804,7 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
8798
8804
  .style('font-size', this.isHeaderVisible ? '18px' : '14px')
8799
8805
  .attr('y', this.isHeaderVisible
8800
8806
  ? short_tick_length_bg + 25
8801
- : short_tick_length_bg + 25)
8807
+ : short_tick_length_bg + 30)
8802
8808
  .attr('x', function (d) {
8803
8809
  if (self.chartData.data.length > 8 && !self.isZoomedOut) {
8804
8810
  return -25; // Move first line text slightly to the left too
@@ -9070,28 +9076,47 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
9070
9076
  })
9071
9077
  .attr('width', function (d) {
9072
9078
  if (self.chartConfiguration.isDrilldownChart) {
9073
- let isSingleBar = false;
9079
+ // var tempScale;
9074
9080
  data.map((indiv) => {
9075
9081
  if (indiv.name == d.name) {
9076
9082
  let keys = Object.keys(indiv).filter((temp, i) => i != 0);
9083
+ var temp;
9077
9084
  tempScale = d3.scaleBand().domain(keys).range([0, x.bandwidth()]);
9078
- if (keys.length === 1) {
9079
- isSingleBar = true;
9085
+ if (x.bandwidth() > 100) {
9086
+ if (self.chartData.data.length == 1) {
9087
+ if (Object.keys(self.chartData.data[0]).length == 2) {
9088
+ tempScale.range([
9089
+ 0 + (x.bandwidth() - 125) / 2,
9090
+ x.bandwidth() - (x.bandwidth() - 125) / 2,
9091
+ ]);
9092
+ // .padding(0.05);
9093
+ }
9094
+ else
9095
+ tempScale.range([
9096
+ 0 + (x.bandwidth() - 125) / 2,
9097
+ x.bandwidth() - (x.bandwidth() - 125) / 2,
9098
+ ]);
9099
+ // .padding(0.05);
9100
+ }
9101
+ else
9102
+ tempScale.range([
9103
+ 0 + (x.bandwidth() - 125) / 2,
9104
+ x.bandwidth() - (x.bandwidth() - 125) / 2,
9105
+ ]);
9080
9106
  }
9081
9107
  }
9082
9108
  });
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();
9109
+ return self.isZoomedOut
9110
+ ? tempScale.bandwidth()
9111
+ : self.chartData.data.length && self.chartData.data.length > 8
9112
+ ? tempScale.bandwidth() * 0.5
9113
+ : tempScale.bandwidth();
9114
+ }
9115
+ return self.isZoomedOut
9116
+ ? tempScale.bandwidth()
9117
+ : self.chartData.data.length && self.chartData.data.length > 8
9118
+ ? tempScale.bandwidth() * 0.5
9119
+ : tempScale.bandwidth();
9095
9120
  })
9096
9121
  .attr('height', function (d) {
9097
9122
  if (d.value == -1) {