axidio-styleguide-library1-v2 0.3.50 → 0.3.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.
@@ -7008,36 +7008,30 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
7008
7008
  }
7009
7009
  return `${baseClass} lib-axis-waterfall-label`;
7010
7010
  }
7011
- // private renderGridsFromLeftAxis(
7012
- // svgYAxisLeft: any,
7013
- // scales: any,
7014
- // dimensions: Dimensions
7015
- // ) {
7016
- // if (this.chartConfiguration.yAxisGrid) {
7017
- // // Calculate how far the grid lines need to extend
7018
- // // They start from the left Y-axis (at x=80) and go to the full width
7019
- // const gridWidth = dimensions.requiredSvgWidth + 80 + this.CONSTANTS.RIGHT_SVG_WIDTH;
7020
- // svgYAxisLeft
7021
- // .append('g')
7022
- // .attr('class', 'grid horizontal-grid-from-left')
7023
- // .attr('transform', 'translate(0,0)')
7024
- // .call(
7025
- // d3
7026
- // .axisLeft(scales.yScale)
7027
- // .ticks(this.chartConfiguration.numberOfYTicks)
7028
- // .tickSize(-gridWidth) // Negative to extend right
7029
- // .tickFormat('')
7030
- // )
7031
- // .style('color', 'var(--chart-grid-color)')
7032
- // .style('opacity', '1')
7033
- // .call((g: any) => {
7034
- // g.select('.domain').remove();
7035
- // g.selectAll('.tick line')
7036
- // .style('stroke', 'var(--chart-grid-color)')
7037
- // .style('stroke-width', '1px');
7038
- // });
7039
- // }
7040
- // }
7011
+ renderGridsFromLeftAxis(svgYAxisLeft, scales, dimensions) {
7012
+ if (this.chartConfiguration.yAxisGrid) {
7013
+ // Calculate how far the grid lines need to extend
7014
+ // They start from the left Y-axis (at x=80) and go to the full width
7015
+ const gridWidth = dimensions.requiredSvgWidth + 80 + this.CONSTANTS.RIGHT_SVG_WIDTH;
7016
+ svgYAxisLeft
7017
+ .append('g')
7018
+ .attr('class', 'grid horizontal-grid-from-left')
7019
+ .attr('transform', 'translate(0,0)')
7020
+ .call(d3
7021
+ .axisLeft(scales.yScale)
7022
+ .ticks(this.chartConfiguration.numberOfYTicks)
7023
+ .tickSize(-gridWidth) // Negative to extend right
7024
+ .tickFormat(''))
7025
+ .style('color', 'var(--chart-grid-color)')
7026
+ .style('opacity', '1')
7027
+ .call((g) => {
7028
+ g.select('.domain').remove();
7029
+ g.selectAll('.tick line')
7030
+ .style('stroke', 'var(--chart-grid-color)')
7031
+ .style('stroke-width', '1px');
7032
+ });
7033
+ }
7034
+ }
7041
7035
  applyConfigurationFlags() {
7042
7036
  if (this.chartConfiguration.isHeaderVisible !== undefined) {
7043
7037
  this.isHeaderVisible = this.chartConfiguration.isHeaderVisible;
@@ -7082,14 +7076,15 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
7082
7076
  this.renderLineChart(svg, lineData, scales, colors, metaData);
7083
7077
  }
7084
7078
  renderGrids(svg, scales, dimensions) {
7079
+ // Add horizontal grid lines from the main SVG
7085
7080
  if (this.chartConfiguration.yAxisGrid) {
7086
7081
  svg
7087
- .insert('g', ':first-child')
7082
+ .insert('g', ':first-child') // Insert at beginning so grids are behind bars
7088
7083
  .attr('class', 'grid horizontal-grid')
7089
7084
  .call(d3
7090
7085
  .axisLeft(scales.yScale)
7091
7086
  .ticks(this.chartConfiguration.numberOfYTicks)
7092
- .tickSize(-dimensions.requiredSvgWidth)
7087
+ .tickSize(-dimensions.requiredSvgWidth) // Full width of scrollable area
7093
7088
  .tickFormat(''))
7094
7089
  .style('color', 'var(--chart-grid-color)')
7095
7090
  .style('opacity', '1')
@@ -7101,6 +7096,7 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
7101
7096
  .style('shape-rendering', 'crispEdges');
7102
7097
  });
7103
7098
  }
7099
+ // Vertical grids (existing code)
7104
7100
  if (this.chartConfiguration.isXgridBetweenLabels) {
7105
7101
  svg
7106
7102
  .append('g')
@@ -7166,13 +7162,18 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
7166
7162
  textElement.text(text.substring(0, 10) + '...');
7167
7163
  }
7168
7164
  });
7169
- // Ensure X-axis line starts exactly at x=0
7170
- xAxisGroup
7171
- .select('.domain')
7172
- .style('stroke', 'var(--chart-axis-color)')
7173
- .style('stroke-width', '1px')
7174
- .attr('d', `M0,0.5H${dimensions.requiredSvgWidth}`);
7175
- // Y-axis
7165
+ // Hide X-axis domain if yAxisGrid is enabled, otherwise show it
7166
+ if (this.chartConfiguration.yAxisGrid) {
7167
+ xAxisGroup.select('.domain').remove();
7168
+ }
7169
+ else {
7170
+ xAxisGroup
7171
+ .select('.domain')
7172
+ .style('stroke', 'var(--chart-axis-color)')
7173
+ .style('stroke-width', '1px')
7174
+ .attr('d', `M0,0.5H${dimensions.requiredSvgWidth}`);
7175
+ }
7176
+ // Y-axis (no changes needed)
7176
7177
  svg
7177
7178
  .append('g')
7178
7179
  .attr('class', 'lib-stacked-y-axis-text')