axidio-styleguide-library1-v2 0.7.47 → 0.7.49

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.
@@ -8644,44 +8644,47 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
8644
8644
  // });
8645
8645
  // return tempScale(d.key) || 0;
8646
8646
  // }
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
8647
  calculateDrilldownBarX(d, data, x, self, tempScale) {
8664
- // FIX: Use the actual subgroups from metaData, not Object.keys
8665
- const subgroups = self.chartData.metaData.keyList;
8666
- // Create scale using the full subgroups list
8667
- const calculatedScale = d3.scaleBand()
8668
- .domain(subgroups) // Use consistent domain across all groups
8669
- .range([0, x.bandwidth()]);
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
- }
8648
+ let calculatedScale = tempScale;
8649
+ data.forEach((indiv) => {
8650
+ if (indiv.name === d.name) {
8651
+ // const keys = Object.keys(indiv).filter((temp, i) => i !== 0);
8652
+ const keys = Object.keys(indiv).filter(key => key !== 'name');
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;
8675
8663
  const position = calculatedScale(d.key);
8676
- // Debug logging
8677
- if (position === undefined) {
8678
- console.error(`❌ Position undefined for key "${d.key}" in group "${d.name}"`);
8679
- console.error('Available subgroups:', subgroups);
8680
- console.error('Scale domain:', calculatedScale.domain());
8681
- return 0;
8682
- }
8683
- return position;
8664
+ return position !== undefined ? position : 0;
8684
8665
  }
8666
+ // private calculateDrilldownBarX(d, data, x, self, tempScale) {
8667
+ // // ✅ FIX: Use the actual subgroups from metaData, not Object.keys
8668
+ // const subgroups = self.chartData.metaData.keyList;
8669
+ // // Create scale using the full subgroups list
8670
+ // const calculatedScale = d3.scaleBand()
8671
+ // .domain(subgroups) // ✅ Use consistent domain across all groups
8672
+ // .range([0, x.bandwidth()]);
8673
+ // if (x.bandwidth() > 100) {
8674
+ // const reducedBarWidth = self.isZoomedOut ? 60 : 100;
8675
+ // const offset = (x.bandwidth() - reducedBarWidth) / 2;
8676
+ // calculatedScale.range([offset, x.bandwidth() - offset]);
8677
+ // }
8678
+ // const position = calculatedScale(d.key);
8679
+ // // ✅ Debug logging
8680
+ // if (position === undefined) {
8681
+ // console.error(`❌ Position undefined for key "${d.key}" in group "${d.name}"`);
8682
+ // console.error('Available subgroups:', subgroups);
8683
+ // console.error('Scale domain:', calculatedScale.domain());
8684
+ // return 0;
8685
+ // }
8686
+ // return position;
8687
+ // }
8685
8688
  calculateBarY(d, y, height, self) {
8686
8689
  if (d.value === -1) {
8687
8690
  return y(0);