axidio-styleguide-library1-v2 0.1.15 → 0.1.17

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.
@@ -3934,13 +3934,13 @@ class GroupChartComponent extends ComponentUniqueId {
3934
3934
  .padding([0.5])
3935
3935
  .domain(data.map(function (d) {
3936
3936
  return d.name.toLowerCase();
3937
- }));
3937
+ }).reverse());
3938
3938
  }
3939
3939
  else {
3940
3940
  x = d3
3941
3941
  .scaleBand()
3942
- .domain(groups)
3943
3942
  .range([leftAndRightSpaces, width - rightSvgWidth - leftAndRightSpaces])
3943
+ .domain(groups).reverse()
3944
3944
  .padding([0.3]);
3945
3945
  }
3946
3946
  // x.bandwidth(96);
@@ -7392,14 +7392,14 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
7392
7392
  ])
7393
7393
  .domain(data.map(function (d) {
7394
7394
  return d.name;
7395
- }))
7395
+ }).reverse())
7396
7396
  .padding(isMobile ? 0.2 : 0.5);
7397
7397
  var xScaleFromOrigin = d3
7398
7398
  .scaleBand()
7399
7399
  .rangeRound([width - rightSvgWidth, 0])
7400
7400
  .domain(data.map(function (d) {
7401
7401
  return d.name;
7402
- }));
7402
+ }).reverse());
7403
7403
  // ...existing code...
7404
7404
  /**
7405
7405
  * draw second x axis on top
@@ -8551,7 +8551,7 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
8551
8551
  var height = parseInt(verticalstackedcontainer.style('height')) *
8552
8552
  (self.chartConfiguration.svgHeight / 100) -
8553
8553
  margin.top -
8554
- margin.bottom;
8554
+ margin.bottom + 30;
8555
8555
  /**
8556
8556
  * entire height used in weekly charts as x axis needed to be displayed at the bottom of the chart
8557
8557
  */
@@ -8642,7 +8642,7 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
8642
8642
  .append('svg')
8643
8643
  // .attr('id', self.uniqueId)
8644
8644
  .attr('width', width - rightSvgWidth)
8645
- .attr('height', height + margin.top + margin.bottom + 60)
8645
+ .attr('height', height + margin.top + margin.bottom + 30)
8646
8646
  // .call(ChartHelper.responsivefy)
8647
8647
  .append('g')
8648
8648
  .attr('transform', 'translate(' + 0 + ',' + margin.top + ')');
@@ -8778,18 +8778,18 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
8778
8778
  });
8779
8779
  }
8780
8780
  if (self.chartConfiguration.xLabelsOnSameLine) {
8781
- const xAxisLabels = svg
8781
+ svg
8782
8782
  .selectAll('g.x1.axis1 g.tick text')
8783
8783
  .attr('class', 'lib-xaxis-labels-texts-drilldown')
8784
8784
  .style('font-size', this.isHeaderVisible ? '18px' : '14px')
8785
8785
  .attr('y', function (d) {
8786
- // For grouped bar charts with many bars and xLabel present, only add 5 if the label is a date
8786
+ // For grouped bar charts with many bars and xLabel present, do NOT add extra space (avoid overlap)
8787
8787
  if (subgroups.length > 1 && data.length > 8 && metaData.xLabel) {
8788
- const isDateLabel = /\d{2,4}[-\/]/.test(d);
8788
+ // In maximized (fullscreen) view, keep the gap minimal
8789
8789
  if (self.chartConfiguration.isFullScreen) {
8790
- return isDateLabel ? short_tick_length_bg + 5 : short_tick_length_bg;
8790
+ return short_tick_length_bg;
8791
8791
  }
8792
- return isDateLabel ? short_tick_length_bg + 5 : short_tick_length_bg;
8792
+ return short_tick_length_bg;
8793
8793
  }
8794
8794
  // For grouped bar charts with many bars and NO xLabel, add space as before, but reduce in fullscreen
8795
8795
  if (subgroups.length > 1 && data.length > 8 && !metaData.xLabel) {
@@ -8838,13 +8838,6 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
8838
8838
  if (isValueToBeIgnored) {
8839
8839
  return '';
8840
8840
  }
8841
- // Always add space before and after hyphen for date range labels, even when header is visible and label is single line
8842
- // Apply for grouped bar charts and single bar charts, header visible, single line
8843
- const dateRangeRegex = /(\d{2,4}[-\/]\d{2}[-\/]\d{2,4})\s*-\s*(\d{2,4}[-\/]\d{2}[-\/]\d{2,4})/;
8844
- if (dateRangeRegex.test(d.trim())) {
8845
- return d.trim().replace(dateRangeRegex, (m, d1, d2) => `${d1} - ${d2}`);
8846
- }
8847
- // Show the date label as it is, do not trim or hide the year
8848
8841
  // If label looks like a date (contains digits and - or /)
8849
8842
  const isDateLabel = /\d{2,4}[-\/]/.test(d);
8850
8843
  // Only split date/week labels if there are many grouped bars and header is not visible
@@ -8862,32 +8855,6 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
8862
8855
  return d.trim().substring(0, d.indexOf(' ')).toLowerCase();
8863
8856
  }
8864
8857
  return d.toLowerCase();
8865
- // If label looks like a date (contains digits and - or /)
8866
- const isDateLabel2 = /\d{2,4}[-\/]/.test(d);
8867
- // Only split date/week labels if there are many grouped bars and header is not visible
8868
- if (isDateLabel) {
8869
- if (!self.isHeaderVisible && data.length > 8 && d.indexOf(' ') > -1) {
8870
- var first = d.substring(0, d.indexOf(' '));
8871
- var second = d.substring(d.indexOf(' ') + 1).trim();
8872
- return first + '\n' + second;
8873
- }
8874
- else {
8875
- return d;
8876
- }
8877
- }
8878
- if (d.trim().indexOf(' ') > -1) {
8879
- return d.trim().substring(0, d.indexOf(' ')).toLowerCase();
8880
- }
8881
- return d.toLowerCase();
8882
- });
8883
- // Now apply writing-mode: sideways-lr for grouped charts with date labels in zoomed-out view and many bars
8884
- xAxisLabels.each(function (d) {
8885
- // Only apply writing-mode for exact date labels, not those containing 'week' or similar
8886
- const isDateLabel = /^(\d{2,4}[-\/])?\d{2,4}[-\/]\d{2,4}$/.test(d.trim());
8887
- const isWeekLabel = /week|wk|w\d+/i.test(d);
8888
- if (subgroups.length > 1 && self.isZoomedOut && data.length > 8 && isDateLabel && !isWeekLabel) {
8889
- d3.select(this).style('writing-mode', 'sideways-lr');
8890
- }
8891
8858
  });
8892
8859
  if (!isMobile) {
8893
8860
  svg
@@ -9041,19 +9008,20 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
9041
9008
  });
9042
9009
  }
9043
9010
  var xSubgroup = d3.scaleBand().domain(subgroups);
9044
- if (subgroups.length > 1 && !this.isZoomedOut) {
9011
+ // Weekly shipped/planned daily grouped chart: increase bar width for both zoom-in and zoom-out views
9012
+ if (subgroups.length > 1 && this.chartConfiguration.isMultiChartGridLine) {
9013
+ xSubgroup.range([0, x.bandwidth() * 1.2]).padding(0.05);
9014
+ }
9015
+ else if (subgroups.length > 1 && !this.isZoomedOut) {
9045
9016
  // For grouped bar charts in zoom-in view, reduce padding between bars
9046
- xSubgroup.range([0, x.bandwidth()]);
9017
+ xSubgroup.range([0, x.bandwidth()]).padding(0.05);
9047
9018
  }
9048
9019
  else if (subgroups.length === 1 && !this.isZoomedOut) {
9049
- // For single-bar (non-grouped) charts in zoom-in view, set bar width to 100 (increased from 80)
9050
- xSubgroup.range([0, 100]);
9051
- }
9052
- else if (this.chartConfiguration.isMultiChartGridLine == undefined) {
9053
- xSubgroup.range([0, x.bandwidth()]);
9020
+ // For single-bar (non-grouped) charts in zoom-in view, set bar width to 80
9021
+ xSubgroup.range([0, 80]);
9054
9022
  }
9055
9023
  else {
9056
- // used to make grouped bars with lesser width as we are not using padding for width
9024
+ // All other cases (including zoomed-out), use full bandwidth
9057
9025
  xSubgroup.range([0, x.bandwidth()]);
9058
9026
  }
9059
9027
  // if (this.chartConfiguration.isDrilldownChart) {
@@ -9110,7 +9078,7 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
9110
9078
  // Increase bar width a bit in zoom-in view
9111
9079
  let reducedBarWidth = 60;
9112
9080
  if (!self.isZoomedOut) {
9113
- reducedBarWidth = 30;
9081
+ reducedBarWidth = 80;
9114
9082
  }
9115
9083
  if (self.chartData.data.length == 1) {
9116
9084
  if (Object.keys(self.chartData.data[0]).length == 2) {
@@ -9151,7 +9119,7 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
9151
9119
  .attr('width', function (d) {
9152
9120
  // For grouped bar charts in zoom-in view, slightly increase bar width for both bars (shipped and planned)
9153
9121
  if (subgroups.length > 1 && !self.isZoomedOut) {
9154
- return xSubgroup.bandwidth() * 0.2;
9122
+ return xSubgroup.bandwidth() * 0.5;
9155
9123
  }
9156
9124
  // For single-bar (non-grouped) charts in zoom-in view, set bar width to 80
9157
9125
  if (subgroups.length === 1 && !self.isZoomedOut) {
@@ -9167,7 +9135,7 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
9167
9135
  // Increase bar width a bit in zoom-in view
9168
9136
  let reducedBarWidth = 60;
9169
9137
  if (!self.isZoomedOut) {
9170
- reducedBarWidth = 500;
9138
+ reducedBarWidth = 80;
9171
9139
  }
9172
9140
  if (self.chartData.data.length == 1) {
9173
9141
  if (Object.keys(self.chartData.data[0]).length == 2) {
@@ -9688,7 +9656,7 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
9688
9656
  }
9689
9657
  const xLabelText = metaData.xLabel;
9690
9658
  const isAcr = isAcronym(xLabelText.replace(/[^A-Za-z]/g, ''));
9691
- const xPosition = isria ? (height + margin.top + margin.bottom) : (height + margin.top + margin.bottom + 40);
9659
+ const xPosition = isria ? (height + margin.top + margin.bottom) : (height + margin.top + margin.bottom + 10);
9692
9660
  svg
9693
9661
  .append('text')
9694
9662
  .attr('class', function () {