axidio-styleguide-library1-v2 0.0.912 → 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 + 15)
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,47 +9076,36 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
9070
9076
  })
9071
9077
  .attr('width', function (d) {
9072
9078
  if (self.chartConfiguration.isDrilldownChart) {
9073
- let isSingleBar = false;
9074
- let reducedBarWidth = 60; // Set your desired reduced width here
9079
+ // var tempScale;
9075
9080
  data.map((indiv) => {
9076
9081
  if (indiv.name == d.name) {
9077
9082
  let keys = Object.keys(indiv).filter((temp, i) => i != 0);
9083
+ var temp;
9078
9084
  tempScale = d3.scaleBand().domain(keys).range([0, x.bandwidth()]);
9079
- // Only reduce width if single bar (not grouped)
9080
- if (keys.length === 1) {
9081
- isSingleBar = true;
9082
- tempScale.range([
9083
- 0 + (x.bandwidth() - reducedBarWidth) / 2,
9084
- x.bandwidth() - (x.bandwidth() - reducedBarWidth) / 2,
9085
- ]);
9086
- }
9087
- else if (x.bandwidth() > 100) {
9085
+ if (x.bandwidth() > 100) {
9088
9086
  if (self.chartData.data.length == 1) {
9089
9087
  if (Object.keys(self.chartData.data[0]).length == 2) {
9090
9088
  tempScale.range([
9091
9089
  0 + (x.bandwidth() - 125) / 2,
9092
9090
  x.bandwidth() - (x.bandwidth() - 125) / 2,
9093
9091
  ]);
9092
+ // .padding(0.05);
9094
9093
  }
9095
- else {
9094
+ else
9096
9095
  tempScale.range([
9097
9096
  0 + (x.bandwidth() - 125) / 2,
9098
9097
  x.bandwidth() - (x.bandwidth() - 125) / 2,
9099
9098
  ]);
9100
- }
9099
+ // .padding(0.05);
9101
9100
  }
9102
- else {
9101
+ else
9103
9102
  tempScale.range([
9104
9103
  0 + (x.bandwidth() - 125) / 2,
9105
9104
  x.bandwidth() - (x.bandwidth() - 125) / 2,
9106
9105
  ]);
9107
- }
9108
9106
  }
9109
9107
  }
9110
9108
  });
9111
- if (isSingleBar) {
9112
- return tempScale.bandwidth();
9113
- }
9114
9109
  return self.isZoomedOut
9115
9110
  ? tempScale.bandwidth()
9116
9111
  : self.chartData.data.length && self.chartData.data.length > 8