axidio-styleguide-library1-v2 0.7.50 → 0.7.51

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.
@@ -8611,7 +8611,8 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
8611
8611
  prepareBarData(d, subgroups) {
8612
8612
  const newList = [];
8613
8613
  subgroups.forEach((key) => {
8614
- newList.push({ key: key, value: d[key], name: d.name });
8614
+ const value = d[key] !== undefined ? d[key] : 0;
8615
+ newList.push({ key: key, value: value, name: d.name });
8615
8616
  });
8616
8617
  return newList;
8617
8618
  }
@@ -8644,59 +8645,22 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
8644
8645
  // });
8645
8646
  // return tempScale(d.key) || 0;
8646
8647
  // }
8647
- // private calculateDrilldownBarX(d, data, x, self, tempScale) {
8648
- // let calculatedScale = tempScale;
8649
- // data.forEach((indiv: any) => {
8650
- // if (indiv.name === d.name) {
8651
- // const keys = Object.keys(indiv).filter((temp, i) => i !== 0);
8652
- // calculatedScale = d3.scaleBand().domain(keys).range([0, x.bandwidth()]);
8653
- // if (x.bandwidth() > 100) {
8654
- // const reducedBarWidth = self.isZoomedOut ? 60 : 100;
8655
- // const offset = (x.bandwidth() - reducedBarWidth) / 2;
8656
- // calculatedScale.range([offset, x.bandwidth() - offset]);
8657
- // }
8658
- // }
8659
- // });
8660
- // // Return position relative to the group (since bars are inside a translated group element)
8661
- // return calculatedScale(d.key) || 0;
8662
- // }
8663
8648
  calculateDrilldownBarX(d, data, x, self, tempScale) {
8664
- // Always use global subgroup list
8665
- const subgroups = self.chartData.metaData.keyList;
8666
- const calculatedScale = d3.scaleBand()
8667
- .domain(subgroups)
8668
- .range([0, x.bandwidth()]);
8669
- // ✅ Visual centering only (no logic change)
8670
- if (x.bandwidth() > 100) {
8671
- const reducedBarWidth = self.isZoomedOut ? 60 : 100;
8672
- const offset = (x.bandwidth() - reducedBarWidth) / 2;
8673
- calculatedScale.range([offset, x.bandwidth() - offset]);
8674
- }
8675
- const position = calculatedScale(d.key);
8676
- return position !== undefined ? position : 0;
8649
+ let calculatedScale = tempScale;
8650
+ data.forEach((indiv) => {
8651
+ if (indiv.name === d.name) {
8652
+ const keys = Object.keys(indiv).filter((temp, i) => i !== 0);
8653
+ calculatedScale = d3.scaleBand().domain(keys).range([0, x.bandwidth()]);
8654
+ if (x.bandwidth() > 100) {
8655
+ const reducedBarWidth = self.isZoomedOut ? 60 : 100;
8656
+ const offset = (x.bandwidth() - reducedBarWidth) / 2;
8657
+ calculatedScale.range([offset, x.bandwidth() - offset]);
8658
+ }
8659
+ }
8660
+ });
8661
+ // Return position relative to the group (since bars are inside a translated group element)
8662
+ return calculatedScale(d.key) || 0;
8677
8663
  }
8678
- // private calculateDrilldownBarX(d, data, x, self, tempScale) {
8679
- // // ✅ FIX: Use the actual subgroups from metaData, not Object.keys
8680
- // const subgroups = self.chartData.metaData.keyList;
8681
- // // Create scale using the full subgroups list
8682
- // const calculatedScale = d3.scaleBand()
8683
- // .domain(subgroups) // ✅ Use consistent domain across all groups
8684
- // .range([0, x.bandwidth()]);
8685
- // if (x.bandwidth() > 100) {
8686
- // const reducedBarWidth = self.isZoomedOut ? 60 : 100;
8687
- // const offset = (x.bandwidth() - reducedBarWidth) / 2;
8688
- // calculatedScale.range([offset, x.bandwidth() - offset]);
8689
- // }
8690
- // const position = calculatedScale(d.key);
8691
- // // ✅ Debug logging
8692
- // if (position === undefined) {
8693
- // console.error(`❌ Position undefined for key "${d.key}" in group "${d.name}"`);
8694
- // console.error('Available subgroups:', subgroups);
8695
- // console.error('Scale domain:', calculatedScale.domain());
8696
- // return 0;
8697
- // }
8698
- // return position;
8699
- // }
8700
8664
  calculateBarY(d, y, height, self) {
8701
8665
  if (d.value === -1) {
8702
8666
  return y(0);
@@ -8751,6 +8715,9 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
8751
8715
  if (d.value === -1) {
8752
8716
  return height - y(0);
8753
8717
  }
8718
+ if (d.value === undefined || d.value === null) {
8719
+ return 0;
8720
+ }
8754
8721
  if (d.value >= 0) {
8755
8722
  const barHeight = height - y(d.value);
8756
8723
  const minHeight = self.chartConfiguration.defaultBarHeight || 2;