axidio-styleguide-library1-v2 0.1.2 → 0.1.4

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.
@@ -9095,13 +9095,50 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
9095
9095
  }
9096
9096
  })
9097
9097
  .attr('x', function (d) {
9098
+ // Always decrease x value by 10 for the first subgroup of the first group in grouped charts, zoom-in view
9099
+ if (subgroups.length > 1 && !self.isZoomedOut && self.chartData.data.length > 1 && d.name === self.chartData.data[0].name && d.key === subgroups[0]) {
9100
+ if (self.chartConfiguration.isDrilldownChart) {
9101
+ data.map((indiv, idx) => {
9102
+ if (indiv.name == d.name) {
9103
+ let keys = Object.keys(indiv).filter((temp, i) => i != 0);
9104
+ tempScale = d3.scaleBand().domain(keys).range([0, x.bandwidth()]);
9105
+ if (x.bandwidth() > 100) {
9106
+ let reducedBarWidth = 60;
9107
+ if (!self.isZoomedOut) {
9108
+ reducedBarWidth = 30;
9109
+ }
9110
+ if (self.chartData.data.length == 1) {
9111
+ if (Object.keys(self.chartData.data[0]).length == 2) {
9112
+ tempScale.range([
9113
+ 0 + (x.bandwidth() - reducedBarWidth) / 2,
9114
+ x.bandwidth() - (x.bandwidth() - reducedBarWidth) / 2,
9115
+ ]);
9116
+ }
9117
+ else
9118
+ tempScale.range([
9119
+ 0 + (x.bandwidth() - reducedBarWidth) / 2,
9120
+ x.bandwidth() - (x.bandwidth() - reducedBarWidth) / 2,
9121
+ ]);
9122
+ }
9123
+ else
9124
+ tempScale.range([
9125
+ 0 + (x.bandwidth() - reducedBarWidth) / 2,
9126
+ x.bandwidth() - (x.bandwidth() - reducedBarWidth) / 2,
9127
+ ]);
9128
+ }
9129
+ }
9130
+ });
9131
+ return tempScale(d.key) - 10;
9132
+ }
9133
+ return xSubgroup(d.key) - 10;
9134
+ }
9135
+ // Otherwise, use normal logic
9098
9136
  if (self.chartConfiguration.isDrilldownChart) {
9099
- data.map((indiv) => {
9137
+ data.map((indiv, idx) => {
9100
9138
  if (indiv.name == d.name) {
9101
9139
  let keys = Object.keys(indiv).filter((temp, i) => i != 0);
9102
9140
  tempScale = d3.scaleBand().domain(keys).range([0, x.bandwidth()]);
9103
9141
  if (x.bandwidth() > 100) {
9104
- // Increase bar width a bit in zoom-in view
9105
9142
  let reducedBarWidth = 60;
9106
9143
  if (!self.isZoomedOut) {
9107
9144
  reducedBarWidth = 30;