axidio-styleguide-library1-v2 0.4.82 → 0.4.84

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.
@@ -7917,7 +7917,18 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
7917
7917
  }
7918
7918
  });
7919
7919
  svg.selectAll('g.x1.axis1 g.tick line').remove();
7920
- const yOffset = subgroups.length > 1 && !metaData.xLabel ? 32 : 0;
7920
+ // const yOffset = subgroups.length > 1 && !metaData.xLabel ? 32 : 0;
7921
+ const yOffset = (() => {
7922
+ // Single bar in zoom-in view
7923
+ if (subgroups.length === 1 && !self.isZoomedOut) {
7924
+ return 15;
7925
+ }
7926
+ // Multiple bars without xLabel
7927
+ if (subgroups.length > 1 && !metaData.xLabel) {
7928
+ return 32;
7929
+ }
7930
+ return 0;
7931
+ })();
7921
7932
  svg.selectAll('g.x1.axis1 g.tick text')
7922
7933
  // .attr('class', 'lib-xaxis-labels-texts-drilldown')
7923
7934
  .attr('class', isria
@@ -8316,19 +8327,35 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
8316
8327
  }
8317
8328
  return xSubgroup(d.key);
8318
8329
  }
8330
+ // private calculateDrilldownBarX(d, data, x, self, tempScale) {
8331
+ // data.forEach((indiv: any) => {
8332
+ // if (indiv.name === d.name) {
8333
+ // const keys = Object.keys(indiv).filter((temp, i) => i !== 0);
8334
+ // tempScale = d3.scaleBand().domain(keys).range([0, x.bandwidth()]);
8335
+ // if (x.bandwidth() > 100) {
8336
+ // const reducedBarWidth = self.isZoomedOut ? 60 : 30;
8337
+ // const offset = (x.bandwidth() - reducedBarWidth) / 2;
8338
+ // tempScale.range([offset, x.bandwidth() - offset]);
8339
+ // }
8340
+ // }
8341
+ // });
8342
+ // return tempScale(d.key) || 0;
8343
+ // }
8319
8344
  calculateDrilldownBarX(d, data, x, self, tempScale) {
8345
+ let calculatedScale = tempScale;
8320
8346
  data.forEach((indiv) => {
8321
8347
  if (indiv.name === d.name) {
8322
8348
  const keys = Object.keys(indiv).filter((temp, i) => i !== 0);
8323
- tempScale = d3.scaleBand().domain(keys).range([0, x.bandwidth()]);
8349
+ calculatedScale = d3.scaleBand().domain(keys).range([0, x.bandwidth()]);
8324
8350
  if (x.bandwidth() > 100) {
8325
- const reducedBarWidth = self.isZoomedOut ? 60 : 30;
8351
+ const reducedBarWidth = self.isZoomedOut ? 60 : 100;
8326
8352
  const offset = (x.bandwidth() - reducedBarWidth) / 2;
8327
- tempScale.range([offset, x.bandwidth() - offset]);
8353
+ calculatedScale.range([offset, x.bandwidth() - offset]);
8328
8354
  }
8329
8355
  }
8330
8356
  });
8331
- return tempScale(d.key);
8357
+ // Return position relative to the group (since bars are inside a translated group element)
8358
+ return calculatedScale(d.key) || 0;
8332
8359
  }
8333
8360
  calculateBarY(d, y, height, self) {
8334
8361
  if (d.value === -1) {