axidio-styleguide-library1-v2 0.0.921 → 0.0.923

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.
@@ -8728,10 +8728,20 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
8728
8728
  .call(d3.axisBottom(x))
8729
8729
  .call((g) => g.select('.domain').remove());
8730
8730
  svg.selectAll('g.x1.axis1 g.tick line').remove();
8731
- svg
8732
- .selectAll('g.x1.axis1 g.tick text')
8733
- .attr('class', 'lib-xaxis-labels-texts-drilldown')
8734
- .style('fill', 'var(--chart-text-color)');
8731
+ // Only move x-axis labels further down for grouped charts if there is no xLabel
8732
+ if (subgroups.length > 1 && !metaData.xLabel) {
8733
+ svg
8734
+ .selectAll('g.x1.axis1 g.tick text')
8735
+ .attr('class', 'lib-xaxis-labels-texts-drilldown')
8736
+ .style('fill', 'var(--chart-text-color)')
8737
+ .attr('y', 32); // Increase distance from bars (default is ~9)
8738
+ }
8739
+ else {
8740
+ svg
8741
+ .selectAll('g.x1.axis1 g.tick text')
8742
+ .attr('class', 'lib-xaxis-labels-texts-drilldown')
8743
+ .style('fill', 'var(--chart-text-color)');
8744
+ }
8735
8745
  // .attr('y', function () {
8736
8746
  // if (alternate_text) {
8737
8747
  // alternate_text = false;
@@ -9030,30 +9040,17 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
9030
9040
  let keys = Object.keys(indiv).filter((temp, i) => i != 0);
9031
9041
  tempScale = d3.scaleBand().domain(keys).range([0, x.bandwidth()]);
9032
9042
  if (x.bandwidth() > 100) {
9033
- // Grouped chart: decrease bar width to 70% of slot
9034
- if (subgroups.length > 1) {
9035
- const groupedBarWidth = x.bandwidth() * 0.5;
9036
- const offset = (x.bandwidth() - groupedBarWidth) / 2;
9037
- tempScale.range([offset, x.bandwidth() - offset]);
9043
+ // Increase bar width a bit in zoom-in view
9044
+ let reducedBarWidth = 60;
9045
+ if (!self.isZoomedOut) {
9046
+ reducedBarWidth = 80;
9038
9047
  }
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
- ]);
9048
+ if (self.chartData.data.length == 1) {
9049
+ if (Object.keys(self.chartData.data[0]).length == 2) {
9050
+ tempScale.range([
9051
+ 0 + (x.bandwidth() - reducedBarWidth) / 2,
9052
+ x.bandwidth() - (x.bandwidth() - reducedBarWidth) / 2,
9053
+ ]);
9057
9054
  }
9058
9055
  else
9059
9056
  tempScale.range([
@@ -9061,6 +9058,11 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
9061
9058
  x.bandwidth() - (x.bandwidth() - reducedBarWidth) / 2,
9062
9059
  ]);
9063
9060
  }
9061
+ else
9062
+ tempScale.range([
9063
+ 0 + (x.bandwidth() - reducedBarWidth) / 2,
9064
+ x.bandwidth() - (x.bandwidth() - reducedBarWidth) / 2,
9065
+ ]);
9064
9066
  }
9065
9067
  }
9066
9068
  });
@@ -9086,30 +9088,17 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
9086
9088
  let keys = Object.keys(indiv).filter((temp, i) => i != 0);
9087
9089
  tempScale = d3.scaleBand().domain(keys).range([0, x.bandwidth()]);
9088
9090
  if (x.bandwidth() > 100) {
9089
- // Grouped chart: decrease bar width to 70% of slot
9090
- if (subgroups.length > 1) {
9091
- const groupedBarWidth = x.bandwidth() * 0.5;
9092
- const offset = (x.bandwidth() - groupedBarWidth) / 2;
9093
- tempScale.range([offset, x.bandwidth() - offset]);
9091
+ // Increase bar width a bit in zoom-in view
9092
+ let reducedBarWidth = 60;
9093
+ if (!self.isZoomedOut) {
9094
+ reducedBarWidth = 80;
9094
9095
  }
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
- ]);
9096
+ if (self.chartData.data.length == 1) {
9097
+ if (Object.keys(self.chartData.data[0]).length == 2) {
9098
+ tempScale.range([
9099
+ 0 + (x.bandwidth() - reducedBarWidth) / 2,
9100
+ x.bandwidth() - (x.bandwidth() - reducedBarWidth) / 2,
9101
+ ]);
9113
9102
  }
9114
9103
  else
9115
9104
  tempScale.range([
@@ -9117,6 +9106,11 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
9117
9106
  x.bandwidth() - (x.bandwidth() - reducedBarWidth) / 2,
9118
9107
  ]);
9119
9108
  }
9109
+ else
9110
+ tempScale.range([
9111
+ 0 + (x.bandwidth() - reducedBarWidth) / 2,
9112
+ x.bandwidth() - (x.bandwidth() - reducedBarWidth) / 2,
9113
+ ]);
9120
9114
  }
9121
9115
  }
9122
9116
  });