axidio-styleguide-library1-v2 0.0.908 → 0.0.909

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.
@@ -7290,7 +7290,7 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
7290
7290
  : this.chartData.data.length * (isMobile ? 15 : 25);
7291
7291
  }
7292
7292
  if (this.chartData.data.length > 8 && !this.isZoomedOut) {
7293
- width = this.chartData.data.length * (isMobile ? 60 : 80);
7293
+ width = this.chartData.data.length * (isMobile ? 60 : 130);
7294
7294
  }
7295
7295
  // Fullscreen and drilldown adjustments
7296
7296
  if (this.chartConfiguration.isFullScreen != undefined && this.chartConfiguration.isFullScreen) {
@@ -7299,7 +7299,7 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
7299
7299
  : containerHeight;
7300
7300
  }
7301
7301
  if (this.chartConfiguration.isDrilldownChart) {
7302
- height = containerHeight - margin.top - margin.bottom - (isMobile ? 60 : 80);
7302
+ height = containerHeight - margin.top - margin.bottom - (isMobile ? 60 : 130);
7303
7303
  }
7304
7304
  // ...existing code...
7305
7305
  /**
@@ -9070,42 +9070,55 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
9070
9070
  })
9071
9071
  .attr('width', function (d) {
9072
9072
  if (self.chartConfiguration.isDrilldownChart) {
9073
- // var tempScale;
9073
+ // Reduce bar width for single-bar (non-grouped) charts only
9074
+ const reducedBarWidth = 60; // or any value you prefer
9075
+ let isSingleBar = false;
9074
9076
  data.map((indiv) => {
9075
9077
  if (indiv.name == d.name) {
9076
9078
  let keys = Object.keys(indiv).filter((temp, i) => i != 0);
9077
- var temp;
9078
9079
  tempScale = d3.scaleBand().domain(keys).range([0, x.bandwidth()]);
9079
- if (x.bandwidth() > 100) {
9080
+ // If only one key (besides name), treat as single bar
9081
+ if (keys.length === 1) {
9082
+ isSingleBar = true;
9083
+ tempScale.range([
9084
+ 0 + (x.bandwidth() - reducedBarWidth) / 2,
9085
+ x.bandwidth() - (x.bandwidth() - reducedBarWidth) / 2,
9086
+ ]);
9087
+ }
9088
+ else if (x.bandwidth() > 100) {
9080
9089
  if (self.chartData.data.length == 1) {
9081
9090
  if (Object.keys(self.chartData.data[0]).length == 2) {
9082
9091
  tempScale.range([
9083
9092
  0 + (x.bandwidth() - 125) / 2,
9084
9093
  x.bandwidth() - (x.bandwidth() - 125) / 2,
9085
9094
  ]);
9086
- // .padding(0.05);
9087
9095
  }
9088
- else
9096
+ else {
9089
9097
  tempScale.range([
9090
9098
  0 + (x.bandwidth() - 125) / 2,
9091
9099
  x.bandwidth() - (x.bandwidth() - 125) / 2,
9092
9100
  ]);
9093
- // .padding(0.05);
9101
+ }
9094
9102
  }
9095
- else
9103
+ else {
9096
9104
  tempScale.range([
9097
9105
  0 + (x.bandwidth() - 125) / 2,
9098
9106
  x.bandwidth() - (x.bandwidth() - 125) / 2,
9099
9107
  ]);
9108
+ }
9100
9109
  }
9101
9110
  }
9102
9111
  });
9112
+ if (isSingleBar) {
9113
+ return tempScale.bandwidth();
9114
+ }
9103
9115
  return self.isZoomedOut
9104
9116
  ? tempScale.bandwidth()
9105
9117
  : self.chartData.data.length && self.chartData.data.length > 8
9106
9118
  ? tempScale.bandwidth() * 0.5
9107
9119
  : tempScale.bandwidth();
9108
9120
  }
9121
+ // For non-drilldown charts
9109
9122
  return self.isZoomedOut
9110
9123
  ? tempScale.bandwidth()
9111
9124
  : self.chartData.data.length && self.chartData.data.length > 8