axidio-styleguide-library1-v2 0.0.917 → 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,14 +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
- // Reduce bar width for normal drill down (not zoomed/grouped)
9034
- const reducedBarWidth = 60;
9035
- if (self.chartData.data.length == 1) {
9036
- if (Object.keys(self.chartData.data[0]).length == 2) {
9037
- tempScale.range([
9038
- 0 + (x.bandwidth() - reducedBarWidth) / 2,
9039
- x.bandwidth() - (x.bandwidth() - reducedBarWidth) / 2,
9040
- ]);
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]);
9038
+ }
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
+ ]);
9041
9057
  }
9042
9058
  else
9043
9059
  tempScale.range([
@@ -9045,11 +9061,6 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
9045
9061
  x.bandwidth() - (x.bandwidth() - reducedBarWidth) / 2,
9046
9062
  ]);
9047
9063
  }
9048
- else
9049
- tempScale.range([
9050
- 0 + (x.bandwidth() - reducedBarWidth) / 2,
9051
- x.bandwidth() - (x.bandwidth() - reducedBarWidth) / 2,
9052
- ]);
9053
9064
  }
9054
9065
  }
9055
9066
  });
@@ -9075,14 +9086,30 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
9075
9086
  let keys = Object.keys(indiv).filter((temp, i) => i != 0);
9076
9087
  tempScale = d3.scaleBand().domain(keys).range([0, x.bandwidth()]);
9077
9088
  if (x.bandwidth() > 100) {
9078
- // Reduce bar width for normal drill down (not zoomed/grouped)
9079
- const reducedBarWidth = 60;
9080
- if (self.chartData.data.length == 1) {
9081
- if (Object.keys(self.chartData.data[0]).length == 2) {
9082
- tempScale.range([
9083
- 0 + (x.bandwidth() - reducedBarWidth) / 2,
9084
- x.bandwidth() - (x.bandwidth() - reducedBarWidth) / 2,
9085
- ]);
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]);
9094
+ }
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
+ ]);
9086
9113
  }
9087
9114
  else
9088
9115
  tempScale.range([
@@ -9090,11 +9117,6 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
9090
9117
  x.bandwidth() - (x.bandwidth() - reducedBarWidth) / 2,
9091
9118
  ]);
9092
9119
  }
9093
- else
9094
- tempScale.range([
9095
- 0 + (x.bandwidth() - reducedBarWidth) / 2,
9096
- x.bandwidth() - (x.bandwidth() - reducedBarWidth) / 2,
9097
- ]);
9098
9120
  }
9099
9121
  }
9100
9122
  });