axidio-styleguide-library1-v2 0.2.81 → 0.2.82
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.
|
@@ -6652,6 +6652,7 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
6652
6652
|
.style('padding-left', `${margin.left}px`)
|
|
6653
6653
|
.style('margin-left', '10px')
|
|
6654
6654
|
.style('padding-right', `${this.CONSTANTS.RIGHT_SVG_WIDTH}px`);
|
|
6655
|
+
// Fixed left Y-axis
|
|
6655
6656
|
const svgYAxisLeft = outerContainer
|
|
6656
6657
|
.append('svg')
|
|
6657
6658
|
.attr('width', '80')
|
|
@@ -6663,6 +6664,7 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
6663
6664
|
.style('pointer-events', 'none')
|
|
6664
6665
|
.append('g')
|
|
6665
6666
|
.attr('transform', `translate(${margin.left + 10},${margin.top})`);
|
|
6667
|
+
// Fixed right Y-axis (for target line labels)
|
|
6666
6668
|
const svgYAxisRight = outerContainer
|
|
6667
6669
|
.append('svg')
|
|
6668
6670
|
.attr('width', this.CONSTANTS.RIGHT_SVG_WIDTH)
|
|
@@ -6674,17 +6676,20 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
6674
6676
|
.style('pointer-events', 'none')
|
|
6675
6677
|
.append('g')
|
|
6676
6678
|
.attr('transform', `translate(0,${margin.top})`);
|
|
6679
|
+
// Fixed grid overlay (non-scrolling)
|
|
6680
|
+
// This SVG needs to start where the chart content starts (after left padding/margin)
|
|
6677
6681
|
const svgGridOverlay = outerContainer
|
|
6678
6682
|
.append('svg')
|
|
6679
|
-
.attr('width', `calc(100% - ${margin.left + this.CONSTANTS.RIGHT_SVG_WIDTH}px)`)
|
|
6683
|
+
.attr('width', `calc(100% - ${margin.left + this.CONSTANTS.RIGHT_SVG_WIDTH + 10}px)`)
|
|
6680
6684
|
.attr('height', dimensions.height + margin.top + margin.bottom)
|
|
6681
6685
|
.style('position', 'absolute')
|
|
6682
|
-
.style('left', `${margin.left}px`)
|
|
6686
|
+
.style('left', `${margin.left + 10}px`) // Match the outerContainer's margin-left
|
|
6683
6687
|
.style('top', '0')
|
|
6684
6688
|
.style('z-index', 1)
|
|
6685
6689
|
.style('pointer-events', 'none')
|
|
6686
6690
|
.append('g')
|
|
6687
6691
|
.attr('transform', `translate(0,${margin.top})`);
|
|
6692
|
+
// Scrollable container for bars and X-axis
|
|
6688
6693
|
const innerContainer = outerContainer
|
|
6689
6694
|
.append('div')
|
|
6690
6695
|
.attr('class', 'inner-container')
|
|
@@ -7029,15 +7034,18 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
7029
7034
|
data.sort((a, b) => b.total - a.total);
|
|
7030
7035
|
const scales = this.createScales(data, layers, lineData, dimensions);
|
|
7031
7036
|
const axes = this.createAxes(scales);
|
|
7032
|
-
|
|
7037
|
+
// Pass svgGridOverlay and margin to renderGrids
|
|
7038
|
+
this.renderGrids(svg, svgGridOverlay, scales, dimensions, margin);
|
|
7033
7039
|
const rect = this.renderBars(svg, layers, scales, metaData, dimensions);
|
|
7034
7040
|
this.renderAxes(svg, svgYAxisLeft, svgYAxisRight, axes, scales, dimensions, data);
|
|
7035
7041
|
this.renderAxisLabels(svg, svgYAxisLeft, metaData, dimensions, margin);
|
|
7042
|
+
// Render target line on fixed overlay
|
|
7036
7043
|
this.renderTargetLine(svgGridOverlay, svgYAxisRight, scales, dimensions, metaData);
|
|
7037
7044
|
this.renderDataLabels(rect, scales, metaData, dimensions);
|
|
7038
7045
|
this.renderLineChart(svg, lineData, scales, colors, metaData);
|
|
7039
7046
|
}
|
|
7040
|
-
renderGrids(svg, svgGridOverlay, scales, dimensions) {
|
|
7047
|
+
renderGrids(svg, svgGridOverlay, scales, dimensions, margin) {
|
|
7048
|
+
// X-axis grid (between bars) - render on scrollable svg if needed
|
|
7041
7049
|
if (this.chartConfiguration.isXgridBetweenLabels) {
|
|
7042
7050
|
svg
|
|
7043
7051
|
.append('g')
|
|
@@ -7048,8 +7056,11 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
7048
7056
|
.style('color', '#999999')
|
|
7049
7057
|
.call((g) => g.select('.domain').remove());
|
|
7050
7058
|
}
|
|
7059
|
+
// Y-axis grid (horizontal lines) - render on FIXED overlay
|
|
7051
7060
|
if (this.chartConfiguration.yAxisGrid) {
|
|
7052
|
-
|
|
7061
|
+
// Calculate the actual visible width for grid lines
|
|
7062
|
+
// Account for the padding and margins already applied to outerContainer
|
|
7063
|
+
const containerWidth = dimensions.width - this.CONSTANTS.RIGHT_SVG_WIDTH - margin.left - 10;
|
|
7053
7064
|
svgGridOverlay
|
|
7054
7065
|
.append('g')
|
|
7055
7066
|
.attr('class', 'grid grid-fixed')
|
|
@@ -7059,10 +7070,12 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
7059
7070
|
.tickSize(-containerWidth)
|
|
7060
7071
|
.tickFormat(''))
|
|
7061
7072
|
.style('color', 'var(--chart-grid-color)')
|
|
7062
|
-
.style('opacity', '1')
|
|
7073
|
+
.style('opacity', '1')
|
|
7074
|
+
.call((g) => g.select('.domain').remove());
|
|
7063
7075
|
}
|
|
7076
|
+
// Custom X-axis grid lines
|
|
7064
7077
|
if (this.chartConfiguration.xAxisGrid) {
|
|
7065
|
-
const containerWidth = dimensions.width - this.CONSTANTS.RIGHT_SVG_WIDTH -
|
|
7078
|
+
const containerWidth = dimensions.width - this.CONSTANTS.RIGHT_SVG_WIDTH - margin.left - 10;
|
|
7066
7079
|
for (let j = 0; j < this.chartConfiguration.xAxisGrid.length; j++) {
|
|
7067
7080
|
svgGridOverlay
|
|
7068
7081
|
.append('line')
|
|
@@ -7364,7 +7377,8 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
7364
7377
|
return;
|
|
7365
7378
|
const parsedTarget = this.parseTargetValue(this.chartData.targetLineData.target);
|
|
7366
7379
|
const yZero = scales.yScale(parsedTarget);
|
|
7367
|
-
const containerWidth = dimensions.width - this.CONSTANTS.RIGHT_SVG_WIDTH -
|
|
7380
|
+
const containerWidth = dimensions.width - this.CONSTANTS.RIGHT_SVG_WIDTH - this.chartConfiguration.margin.left - 10;
|
|
7381
|
+
// Render line on fixed overlay
|
|
7368
7382
|
svgGridOverlay
|
|
7369
7383
|
.append('line')
|
|
7370
7384
|
.attr('x1', 0)
|