axidio-styleguide-library1-v2 0.3.49 → 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.
|
@@ -7010,20 +7010,26 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
7010
7010
|
}
|
|
7011
7011
|
renderGridsFromLeftAxis(svgYAxisLeft, scales, dimensions) {
|
|
7012
7012
|
if (this.chartConfiguration.yAxisGrid) {
|
|
7013
|
-
//
|
|
7014
|
-
|
|
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;
|
|
7015
7016
|
svgYAxisLeft
|
|
7016
7017
|
.append('g')
|
|
7017
7018
|
.attr('class', 'grid horizontal-grid-from-left')
|
|
7018
|
-
.attr('transform', 'translate(0,
|
|
7019
|
-
.call(d3
|
|
7019
|
+
.attr('transform', 'translate(0,0)')
|
|
7020
|
+
.call(d3
|
|
7021
|
+
.axisLeft(scales.yScale)
|
|
7020
7022
|
.ticks(this.chartConfiguration.numberOfYTicks)
|
|
7021
|
-
.tickSize(-gridWidth)
|
|
7022
|
-
.tickFormat(
|
|
7023
|
+
.tickSize(-gridWidth) // Negative to extend right
|
|
7024
|
+
.tickFormat(''))
|
|
7023
7025
|
.style('color', 'var(--chart-grid-color)')
|
|
7024
|
-
.style('opacity', 1)
|
|
7025
|
-
.call(g =>
|
|
7026
|
-
|
|
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
|
+
});
|
|
7027
7033
|
}
|
|
7028
7034
|
}
|
|
7029
7035
|
applyConfigurationFlags() {
|
|
@@ -7060,7 +7066,7 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
7060
7066
|
data.sort((a, b) => b.total - a.total);
|
|
7061
7067
|
const scales = this.createScales(data, layers, lineData, dimensions);
|
|
7062
7068
|
const axes = this.createAxes(scales);
|
|
7063
|
-
this.renderGridsFromLeftAxis(svgYAxisLeft, scales, dimensions);
|
|
7069
|
+
// this.renderGridsFromLeftAxis(svgYAxisLeft, scales, dimensions);
|
|
7064
7070
|
this.renderGrids(svg, scales, dimensions);
|
|
7065
7071
|
const rect = this.renderBars(svg, layers, scales, metaData, dimensions);
|
|
7066
7072
|
this.renderAxes(svg, svgYAxisLeft, svgYAxisRight, axes, scales, dimensions, data);
|
|
@@ -7070,6 +7076,27 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
7070
7076
|
this.renderLineChart(svg, lineData, scales, colors, metaData);
|
|
7071
7077
|
}
|
|
7072
7078
|
renderGrids(svg, scales, dimensions) {
|
|
7079
|
+
// Add horizontal grid lines from the main SVG
|
|
7080
|
+
if (this.chartConfiguration.yAxisGrid) {
|
|
7081
|
+
svg
|
|
7082
|
+
.insert('g', ':first-child') // Insert at beginning so grids are behind bars
|
|
7083
|
+
.attr('class', 'grid horizontal-grid')
|
|
7084
|
+
.call(d3
|
|
7085
|
+
.axisLeft(scales.yScale)
|
|
7086
|
+
.ticks(this.chartConfiguration.numberOfYTicks)
|
|
7087
|
+
.tickSize(-dimensions.requiredSvgWidth) // Full width of scrollable area
|
|
7088
|
+
.tickFormat(''))
|
|
7089
|
+
.style('color', 'var(--chart-grid-color)')
|
|
7090
|
+
.style('opacity', '1')
|
|
7091
|
+
.call((g) => {
|
|
7092
|
+
g.select('.domain').remove();
|
|
7093
|
+
g.selectAll('.tick line')
|
|
7094
|
+
.style('stroke', 'var(--chart-grid-color)')
|
|
7095
|
+
.style('stroke-width', '1px')
|
|
7096
|
+
.style('shape-rendering', 'crispEdges');
|
|
7097
|
+
});
|
|
7098
|
+
}
|
|
7099
|
+
// Vertical grids (existing code)
|
|
7073
7100
|
if (this.chartConfiguration.isXgridBetweenLabels) {
|
|
7074
7101
|
svg
|
|
7075
7102
|
.append('g')
|
|
@@ -7135,13 +7162,18 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
7135
7162
|
textElement.text(text.substring(0, 10) + '...');
|
|
7136
7163
|
}
|
|
7137
7164
|
});
|
|
7138
|
-
//
|
|
7139
|
-
|
|
7140
|
-
.select('.domain')
|
|
7141
|
-
|
|
7142
|
-
|
|
7143
|
-
|
|
7144
|
-
|
|
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)
|
|
7145
7177
|
svg
|
|
7146
7178
|
.append('g')
|
|
7147
7179
|
.attr('class', 'lib-stacked-y-axis-text')
|