axidio-styleguide-library1-v2 0.0.918 → 0.0.919

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.
@@ -9030,17 +9030,30 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
9030
9030
  let keys = Object.keys(indiv).filter((temp, i) => i != 0);
9031
9031
  tempScale = d3.scaleBand().domain(keys).range([0, x.bandwidth()]);
9032
9032
  if (x.bandwidth() > 100) {
9033
- // Increase bar width a bit in zoom-in view
9034
- let reducedBarWidth = 60;
9035
- if (!self.isZoomedOut) {
9036
- reducedBarWidth = 80;
9033
+ // Grouped chart: increase bar width to 90% of slot
9034
+ if (subgroups.length > 1) {
9035
+ const groupedBarWidth = x.bandwidth() * 0.9;
9036
+ const offset = (x.bandwidth() - groupedBarWidth) / 2;
9037
+ tempScale.range([offset, x.bandwidth() - offset]);
9037
9038
  }
9038
- if (self.chartData.data.length == 1) {
9039
- if (Object.keys(self.chartData.data[0]).length == 2) {
9040
- tempScale.range([
9041
- 0 + (x.bandwidth() - reducedBarWidth) / 2,
9042
- x.bandwidth() - (x.bandwidth() - reducedBarWidth) / 2,
9043
- ]);
9039
+ else {
9040
+ // Normal/zoomed drilldown logic
9041
+ let reducedBarWidth = 60;
9042
+ if (!self.isZoomedOut) {
9043
+ reducedBarWidth = 80;
9044
+ }
9045
+ if (self.chartData.data.length == 1) {
9046
+ if (Object.keys(self.chartData.data[0]).length == 2) {
9047
+ tempScale.range([
9048
+ 0 + (x.bandwidth() - reducedBarWidth) / 2,
9049
+ x.bandwidth() - (x.bandwidth() - reducedBarWidth) / 2,
9050
+ ]);
9051
+ }
9052
+ else
9053
+ tempScale.range([
9054
+ 0 + (x.bandwidth() - reducedBarWidth) / 2,
9055
+ x.bandwidth() - (x.bandwidth() - reducedBarWidth) / 2,
9056
+ ]);
9044
9057
  }
9045
9058
  else
9046
9059
  tempScale.range([
@@ -9048,11 +9061,6 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
9048
9061
  x.bandwidth() - (x.bandwidth() - reducedBarWidth) / 2,
9049
9062
  ]);
9050
9063
  }
9051
- else
9052
- tempScale.range([
9053
- 0 + (x.bandwidth() - reducedBarWidth) / 2,
9054
- x.bandwidth() - (x.bandwidth() - reducedBarWidth) / 2,
9055
- ]);
9056
9064
  }
9057
9065
  }
9058
9066
  });
@@ -9078,17 +9086,30 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
9078
9086
  let keys = Object.keys(indiv).filter((temp, i) => i != 0);
9079
9087
  tempScale = d3.scaleBand().domain(keys).range([0, x.bandwidth()]);
9080
9088
  if (x.bandwidth() > 100) {
9081
- // Increase bar width a bit in zoom-in view
9082
- let reducedBarWidth = 60;
9083
- if (!self.isZoomedOut) {
9084
- reducedBarWidth = 80;
9089
+ // Grouped chart: increase bar width to 90% of slot
9090
+ if (subgroups.length > 1) {
9091
+ const groupedBarWidth = x.bandwidth() * 0.9;
9092
+ const offset = (x.bandwidth() - groupedBarWidth) / 2;
9093
+ tempScale.range([offset, x.bandwidth() - offset]);
9085
9094
  }
9086
- if (self.chartData.data.length == 1) {
9087
- if (Object.keys(self.chartData.data[0]).length == 2) {
9088
- tempScale.range([
9089
- 0 + (x.bandwidth() - reducedBarWidth) / 2,
9090
- x.bandwidth() - (x.bandwidth() - reducedBarWidth) / 2,
9091
- ]);
9095
+ else {
9096
+ // Normal/zoomed drilldown logic
9097
+ let reducedBarWidth = 60;
9098
+ if (!self.isZoomedOut) {
9099
+ reducedBarWidth = 80;
9100
+ }
9101
+ if (self.chartData.data.length == 1) {
9102
+ if (Object.keys(self.chartData.data[0]).length == 2) {
9103
+ tempScale.range([
9104
+ 0 + (x.bandwidth() - reducedBarWidth) / 2,
9105
+ x.bandwidth() - (x.bandwidth() - reducedBarWidth) / 2,
9106
+ ]);
9107
+ }
9108
+ else
9109
+ tempScale.range([
9110
+ 0 + (x.bandwidth() - reducedBarWidth) / 2,
9111
+ x.bandwidth() - (x.bandwidth() - reducedBarWidth) / 2,
9112
+ ]);
9092
9113
  }
9093
9114
  else
9094
9115
  tempScale.range([
@@ -9096,11 +9117,6 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
9096
9117
  x.bandwidth() - (x.bandwidth() - reducedBarWidth) / 2,
9097
9118
  ]);
9098
9119
  }
9099
- else
9100
- tempScale.range([
9101
- 0 + (x.bandwidth() - reducedBarWidth) / 2,
9102
- x.bandwidth() - (x.bandwidth() - reducedBarWidth) / 2,
9103
- ]);
9104
9120
  }
9105
9121
  }
9106
9122
  });