axidio-styleguide-library1-v2 0.4.14 → 0.4.15
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.
|
@@ -3388,14 +3388,14 @@ class GroupChartComponent extends ComponentUniqueId {
|
|
|
3388
3388
|
this.objectKeys = Object.keys;
|
|
3389
3389
|
this.defaultConfiguration = {
|
|
3390
3390
|
margin: {
|
|
3391
|
-
top:
|
|
3392
|
-
right: 40,
|
|
3393
|
-
bottom:
|
|
3394
|
-
left:
|
|
3391
|
+
top: 20, // FIXED: Reduced top margin
|
|
3392
|
+
right: 40,
|
|
3393
|
+
bottom: 60, // FIXED: Reduced from 80 to 60 to fit in 300px
|
|
3394
|
+
left: 100 // FIXED: Increased to 100 for Y-axis label + values spacing
|
|
3395
3395
|
},
|
|
3396
3396
|
labelFormatter: ChartHelper.defaultFormatter,
|
|
3397
3397
|
svgHeight: 70,
|
|
3398
|
-
numberOfYTicks: 6,
|
|
3398
|
+
numberOfYTicks: 6,
|
|
3399
3399
|
legendJustified: true,
|
|
3400
3400
|
yLineAxisLabelFomatter: ChartHelper.defaultFormatter,
|
|
3401
3401
|
yAxisLabelFomatter: ChartHelper.defaultFormatter,
|
|
@@ -3403,7 +3403,7 @@ class GroupChartComponent extends ComponentUniqueId {
|
|
|
3403
3403
|
showLineChartAxis: true,
|
|
3404
3404
|
showValues: true,
|
|
3405
3405
|
headerMenuOptions: HeaderConfigHelper.headerConfig.headerMenuOptions,
|
|
3406
|
-
yAxisGrid: true,
|
|
3406
|
+
yAxisGrid: true,
|
|
3407
3407
|
legendVisible: true,
|
|
3408
3408
|
isYaxisLabelHidden: false,
|
|
3409
3409
|
backgroundColor: '#FFFFFF',
|
|
@@ -3520,26 +3520,29 @@ class GroupChartComponent extends ComponentUniqueId {
|
|
|
3520
3520
|
return width;
|
|
3521
3521
|
}
|
|
3522
3522
|
calculateHeight(verticalstackedcontainer, margin) {
|
|
3523
|
-
|
|
3523
|
+
// FIXED: Remove minimum height constraint to respect container size
|
|
3524
|
+
let containerHeight = parseInt(verticalstackedcontainer.style('height'));
|
|
3525
|
+
let height = containerHeight *
|
|
3524
3526
|
(this.chartConfiguration.svgHeight / 100) -
|
|
3525
3527
|
margin.top -
|
|
3526
3528
|
margin.bottom;
|
|
3527
|
-
// FIXED: Ensure minimum height for proper Y-axis spacing
|
|
3528
|
-
const minHeight = 350; // Minimum height for good spacing
|
|
3529
3529
|
if (this.chartConfiguration.isFullScreen && this.chartConfiguration.svgHeight !== 70) {
|
|
3530
|
-
height =
|
|
3530
|
+
height = this.chartConfiguration.svgHeight - margin.top - margin.bottom;
|
|
3531
3531
|
}
|
|
3532
3532
|
else if (this.chartConfiguration.isFullScreen) {
|
|
3533
|
-
height =
|
|
3533
|
+
height = containerHeight - margin.top - margin.bottom;
|
|
3534
3534
|
}
|
|
3535
3535
|
if (this.chartConfiguration.isDrilldownChart && !this.isHeaderVisible) {
|
|
3536
|
-
height =
|
|
3536
|
+
height = containerHeight - margin.top - margin.bottom - 130;
|
|
3537
3537
|
}
|
|
3538
3538
|
if (this.chartConfiguration.isHeaderVisible) {
|
|
3539
|
-
height =
|
|
3539
|
+
height = containerHeight - margin.top - margin.bottom - 100;
|
|
3540
3540
|
}
|
|
3541
|
-
// FIXED:
|
|
3542
|
-
|
|
3541
|
+
// FIXED: For fixed height containers (like 300px), ensure it fits
|
|
3542
|
+
if (!this.chartConfiguration.isFullScreen && !this.chartConfiguration.isDrilldownChart) {
|
|
3543
|
+
height = containerHeight - margin.top - margin.bottom;
|
|
3544
|
+
}
|
|
3545
|
+
return height;
|
|
3543
3546
|
}
|
|
3544
3547
|
createScales(chartContext, dimensions) {
|
|
3545
3548
|
const { data, metaData, lineData, keyList } = chartContext;
|
|
@@ -3619,24 +3622,26 @@ class GroupChartComponent extends ComponentUniqueId {
|
|
|
3619
3622
|
.attr('id', this.uniqueId)
|
|
3620
3623
|
.attr('class', 'outer-container')
|
|
3621
3624
|
.style('width', '100%')
|
|
3622
|
-
.style('height', height)
|
|
3625
|
+
.style('height', `${height + margin.top + margin.bottom}px`) // FIXED: Explicit height
|
|
3623
3626
|
.style('overflow-x', 'hidden')
|
|
3627
|
+
.style('overflow-y', 'hidden') // FIXED: Prevent vertical overflow
|
|
3624
3628
|
.style('padding-left', `${margin.left}px`)
|
|
3625
3629
|
.style('padding-right', `${rightSvgWidth}px`)
|
|
3626
3630
|
.style('margin-left', '15px');
|
|
3631
|
+
// FIXED: Increased width for Y-axis to prevent overlap
|
|
3627
3632
|
const svgYAxisLeft = outerContainer
|
|
3628
3633
|
.append('svg')
|
|
3629
|
-
.attr('width', 100)
|
|
3630
|
-
.attr('height', height + margin.top + margin.bottom
|
|
3634
|
+
.attr('width', 100) // Keep at 100
|
|
3635
|
+
.attr('height', height + margin.top + margin.bottom)
|
|
3631
3636
|
.style('position', 'absolute')
|
|
3632
3637
|
.style('left', '0')
|
|
3633
3638
|
.style('z-index', 1)
|
|
3634
3639
|
.append('g')
|
|
3635
|
-
.attr('transform', `translate(${margin.left
|
|
3640
|
+
.attr('transform', `translate(${margin.left - 5},${margin.top})`); // FIXED: Adjusted transform
|
|
3636
3641
|
const svgYAxisRight = outerContainer
|
|
3637
3642
|
.append('svg')
|
|
3638
3643
|
.attr('width', rightSvgWidth)
|
|
3639
|
-
.attr('height', height + margin.top + margin.bottom
|
|
3644
|
+
.attr('height', height + margin.top + margin.bottom)
|
|
3640
3645
|
.style('position', 'absolute')
|
|
3641
3646
|
.style('right', '12px')
|
|
3642
3647
|
.style('z-index', 1)
|
|
@@ -3646,11 +3651,13 @@ class GroupChartComponent extends ComponentUniqueId {
|
|
|
3646
3651
|
.append('div')
|
|
3647
3652
|
.attr('class', 'inner-container')
|
|
3648
3653
|
.style('width', '100%')
|
|
3649
|
-
.style('
|
|
3654
|
+
.style('height', '100%') // FIXED: Full height
|
|
3655
|
+
.style('overflow-x', 'auto')
|
|
3656
|
+
.style('overflow-y', 'hidden'); // FIXED: Prevent vertical scroll
|
|
3650
3657
|
const svg = innerContainer
|
|
3651
3658
|
.append('svg')
|
|
3652
3659
|
.attr('width', dimensions.width - rightSvgWidth)
|
|
3653
|
-
.attr('height', height + margin.top + margin.bottom
|
|
3660
|
+
.attr('height', height + margin.top + margin.bottom) // FIXED: Exact height
|
|
3654
3661
|
.append('g')
|
|
3655
3662
|
.attr('transform', `translate(0,${margin.top})`);
|
|
3656
3663
|
return { outerContainer, svgYAxisLeft, svgYAxisRight, svg };
|
|
@@ -3770,7 +3777,6 @@ class GroupChartComponent extends ComponentUniqueId {
|
|
|
3770
3777
|
});
|
|
3771
3778
|
}
|
|
3772
3779
|
renderYAxis(svg, svgYAxisLeft, svgYAxisRight, y, dimensions) {
|
|
3773
|
-
// Hide the main Y-axis in the chart area (to avoid overlapping lines)
|
|
3774
3780
|
svg
|
|
3775
3781
|
.append('g')
|
|
3776
3782
|
.attr('class', 'lib-stacked-y-axis-text yaxis-dashed')
|
|
@@ -3778,10 +3784,9 @@ class GroupChartComponent extends ComponentUniqueId {
|
|
|
3778
3784
|
.attr('transform', 'translate(0,0)')
|
|
3779
3785
|
.call(y)
|
|
3780
3786
|
.style('display', 'none');
|
|
3781
|
-
// FIXED: Render clean Y-axis on the left without domain line
|
|
3782
3787
|
const yAxisLeft = d3
|
|
3783
3788
|
.axisLeft(y)
|
|
3784
|
-
.tickSize(0)
|
|
3789
|
+
.tickSize(0)
|
|
3785
3790
|
.ticks(this.chartConfiguration.numberOfYTicks)
|
|
3786
3791
|
.tickFormat(this.chartConfiguration.yAxisLabelFomatter);
|
|
3787
3792
|
svgYAxisLeft
|
|
@@ -3791,13 +3796,14 @@ class GroupChartComponent extends ComponentUniqueId {
|
|
|
3791
3796
|
.attr('style', this.chartConfiguration.yAxisCustomTextStyles)
|
|
3792
3797
|
.attr('transform', 'translate(0,0)')
|
|
3793
3798
|
.call(yAxisLeft)
|
|
3794
|
-
.call((g) => g.select('.domain').remove())
|
|
3799
|
+
.call((g) => g.select('.domain').remove())
|
|
3795
3800
|
.selectAll('text')
|
|
3796
3801
|
.style('fill', 'var(--chart-text-color)')
|
|
3797
|
-
.style('font-size', '
|
|
3802
|
+
.style('font-size', '12px')
|
|
3803
|
+
.style('font-weight', '400')
|
|
3804
|
+
.attr('x', -10) // FIXED: Move Y-axis values slightly right to create gap
|
|
3798
3805
|
.attr('dy', '0.32em');
|
|
3799
|
-
|
|
3800
|
-
svgYAxisLeft.selectAll('.tick line').remove(); // FIXED: Remove all tick lines
|
|
3806
|
+
svgYAxisLeft.selectAll('.tick line').remove();
|
|
3801
3807
|
svgYAxisRight
|
|
3802
3808
|
.append('g')
|
|
3803
3809
|
.attr('class', 'lib-yaxis-labels-texts-drilldown yaxis-dashed')
|
|
@@ -3822,21 +3828,19 @@ class GroupChartComponent extends ComponentUniqueId {
|
|
|
3822
3828
|
}
|
|
3823
3829
|
}
|
|
3824
3830
|
renderYAxisGrid(svg, y, width) {
|
|
3825
|
-
// FIXED: Improved grid styling
|
|
3826
3831
|
svg
|
|
3827
3832
|
.append('g')
|
|
3828
3833
|
.attr('class', 'y-axis-grid')
|
|
3829
3834
|
.call(d3.axisLeft(y)
|
|
3830
3835
|
.ticks(this.chartConfiguration.numberOfYTicks)
|
|
3831
|
-
.tickSize(-width)
|
|
3832
|
-
.tickFormat('')
|
|
3833
|
-
|
|
3834
|
-
.style('
|
|
3835
|
-
.style('
|
|
3836
|
-
.
|
|
3837
|
-
.call((g) => g.select('.domain').remove()) // FIXED: Remove domain line
|
|
3836
|
+
.tickSize(-width)
|
|
3837
|
+
.tickFormat(''))
|
|
3838
|
+
.style('color', '#E8E8E8') // FIXED: Very light gray
|
|
3839
|
+
.style('opacity', '0.8')
|
|
3840
|
+
.style('stroke-dasharray', 'none')
|
|
3841
|
+
.call((g) => g.select('.domain').remove())
|
|
3838
3842
|
.selectAll('line')
|
|
3839
|
-
.style('stroke-width', '
|
|
3843
|
+
.style('stroke-width', '0.5px'); // FIXED: Thinner lines
|
|
3840
3844
|
}
|
|
3841
3845
|
renderXAxisGrid(svg, x, height) {
|
|
3842
3846
|
svg
|
|
@@ -4112,12 +4116,12 @@ class GroupChartComponent extends ComponentUniqueId {
|
|
|
4112
4116
|
.attr('class', 'lib-axis-group-label font-size-1')
|
|
4113
4117
|
.attr('style', this.chartConfiguration.yAxisCustomlabelStyles)
|
|
4114
4118
|
.attr('transform', 'rotate(-90)')
|
|
4115
|
-
// FIXED:
|
|
4116
|
-
.attr('y',
|
|
4119
|
+
// FIXED: Proper positioning with adequate spacing from Y-axis values
|
|
4120
|
+
.attr('y', -65) // FIXED: Moved further left to avoid overlap (was: -margin.left + 10)
|
|
4117
4121
|
.attr('x', 0 - height / 2)
|
|
4118
4122
|
.attr('dy', '1em')
|
|
4119
4123
|
.style('text-anchor', 'middle')
|
|
4120
|
-
.style('font-size', '
|
|
4124
|
+
.style('font-size', '13px')
|
|
4121
4125
|
.attr('fill', 'var(--chart-text-color)');
|
|
4122
4126
|
if (this.chartConfiguration.isMultiChartGridLine === undefined) {
|
|
4123
4127
|
svgYAxisLeft.selectAll('.lib-axis-group-label').text(yLabel);
|
|
@@ -4145,11 +4149,11 @@ class GroupChartComponent extends ComponentUniqueId {
|
|
|
4145
4149
|
.append('text')
|
|
4146
4150
|
.attr('class', baseClass)
|
|
4147
4151
|
.attr('style', this.chartConfiguration.xAxisCustomlabelStyles)
|
|
4148
|
-
// FIXED:
|
|
4149
|
-
.attr('transform', `translate(${width / 2},${height +
|
|
4152
|
+
// FIXED: Adjusted for smaller bottom margin
|
|
4153
|
+
.attr('transform', `translate(${width / 2},${height + 40})`)
|
|
4150
4154
|
.style('text-anchor', 'middle')
|
|
4151
4155
|
.style('fill', 'var(--chart-text-color)')
|
|
4152
|
-
.style('font-size', '
|
|
4156
|
+
.style('font-size', '13px')
|
|
4153
4157
|
.text(isAcronym ? xLabel.toUpperCase() : xLabel.toLowerCase())
|
|
4154
4158
|
.style('text-transform', isAcronym ? 'none' : 'capitalize');
|
|
4155
4159
|
}
|