axidio-styleguide-library1-v2 0.0.945 → 0.0.946
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.
- package/esm2022/lib/group-chart/group-chart.component.mjs +43 -50
- package/esm2022/lib/horizontal-grouped-bar-with-scroll-zoom/horizontal-grouped-bar-with-scroll-zoom.component.mjs +57 -55
- package/fesm2022/axidio-styleguide-library1-v2.mjs +98 -103
- package/fesm2022/axidio-styleguide-library1-v2.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -4572,55 +4572,48 @@ class GroupChartComponent extends ComponentUniqueId {
|
|
|
4572
4572
|
* display data values on mouse over
|
|
4573
4573
|
* used by dashboard charts
|
|
4574
4574
|
*/
|
|
4575
|
-
|
|
4576
|
-
|
|
4577
|
-
|
|
4578
|
-
|
|
4579
|
-
|
|
4580
|
-
|
|
4581
|
-
|
|
4582
|
-
|
|
4583
|
-
|
|
4584
|
-
|
|
4585
|
-
|
|
4586
|
-
|
|
4587
|
-
|
|
4588
|
-
|
|
4589
|
-
|
|
4590
|
-
|
|
4591
|
-
|
|
4592
|
-
|
|
4593
|
-
|
|
4594
|
-
|
|
4595
|
-
|
|
4596
|
-
|
|
4597
|
-
|
|
4598
|
-
|
|
4599
|
-
|
|
4600
|
-
|
|
4601
|
-
|
|
4602
|
-
|
|
4603
|
-
|
|
4604
|
-
|
|
4605
|
-
|
|
4606
|
-
|
|
4607
|
-
|
|
4608
|
-
|
|
4609
|
-
|
|
4610
|
-
|
|
4611
|
-
|
|
4612
|
-
|
|
4613
|
-
|
|
4614
|
-
|
|
4615
|
-
|
|
4616
|
-
|
|
4617
|
-
// })
|
|
4618
|
-
// .attr('width', xSubgroup.bandwidth())
|
|
4619
|
-
// .text(function (d) {
|
|
4620
|
-
// return d.value;
|
|
4621
|
-
// });
|
|
4622
|
-
// });
|
|
4623
|
-
// }
|
|
4575
|
+
if (this.chartConfiguration.textsOnBar == undefined &&
|
|
4576
|
+
this.chartConfiguration.displayTitleOnTop == undefined) {
|
|
4577
|
+
state
|
|
4578
|
+
.selectAll('rect')
|
|
4579
|
+
.on('mouseout', function (d) {
|
|
4580
|
+
state.selectAll('.barstext').remove();
|
|
4581
|
+
})
|
|
4582
|
+
.on('mouseover', function (d1) {
|
|
4583
|
+
state
|
|
4584
|
+
.selectAll('text')
|
|
4585
|
+
.data(function (d) {
|
|
4586
|
+
let newList = [];
|
|
4587
|
+
subgroups.map(function (key) {
|
|
4588
|
+
if (key !== 'name' &&
|
|
4589
|
+
d1.key == key &&
|
|
4590
|
+
d1.value == d[key] &&
|
|
4591
|
+
d1.name == d.name) {
|
|
4592
|
+
let obj = { key: key, value: d[key], name: d.name };
|
|
4593
|
+
newList.push(obj);
|
|
4594
|
+
}
|
|
4595
|
+
});
|
|
4596
|
+
return newList;
|
|
4597
|
+
})
|
|
4598
|
+
.enter()
|
|
4599
|
+
.append('text')
|
|
4600
|
+
.attr('class', 'barstext')
|
|
4601
|
+
.attr('x', function (d) {
|
|
4602
|
+
return xSubgroup(d.key);
|
|
4603
|
+
})
|
|
4604
|
+
.attr('y', function (d) {
|
|
4605
|
+
return y(d.value);
|
|
4606
|
+
})
|
|
4607
|
+
.attr('style', 'font-size: ' + '.85em' + ';' + ' font-weight:' + 'bold' + ';')
|
|
4608
|
+
.style('fill', function (d) {
|
|
4609
|
+
return metaData.colors[d.key];
|
|
4610
|
+
})
|
|
4611
|
+
.attr('width', xSubgroup.bandwidth())
|
|
4612
|
+
.text(function (d) {
|
|
4613
|
+
return d.value;
|
|
4614
|
+
});
|
|
4615
|
+
});
|
|
4616
|
+
}
|
|
4624
4617
|
svg
|
|
4625
4618
|
.append('g')
|
|
4626
4619
|
.attr('class', 'x2 axis2')
|
|
@@ -8816,11 +8809,19 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
8816
8809
|
.attr('y', function (d) {
|
|
8817
8810
|
// For grouped bar charts with many bars and xLabel present, do NOT add extra space (avoid overlap)
|
|
8818
8811
|
if (subgroups.length > 1 && data.length > 8 && metaData.xLabel) {
|
|
8812
|
+
// In maximized (fullscreen) view, keep the gap minimal
|
|
8813
|
+
if (self.chartConfiguration.isFullScreen) {
|
|
8814
|
+
return short_tick_length_bg;
|
|
8815
|
+
}
|
|
8819
8816
|
return short_tick_length_bg;
|
|
8820
8817
|
}
|
|
8821
|
-
// For grouped bar charts with many bars and NO xLabel, add space as before
|
|
8818
|
+
// For grouped bar charts with many bars and NO xLabel, add space as before, but reduce in fullscreen
|
|
8822
8819
|
if (subgroups.length > 1 && data.length > 8 && !metaData.xLabel) {
|
|
8823
8820
|
const chartHasExtraBottom = (self.chartConfiguration.margin && self.chartConfiguration.margin.bottom >= 40);
|
|
8821
|
+
if (self.chartConfiguration.isFullScreen) {
|
|
8822
|
+
// Reduce extra gap in maximized view
|
|
8823
|
+
return short_tick_length_bg + 2;
|
|
8824
|
+
}
|
|
8824
8825
|
return chartHasExtraBottom ? short_tick_length_bg : short_tick_length_bg + 10;
|
|
8825
8826
|
}
|
|
8826
8827
|
// Default/fallback logic for other cases
|
|
@@ -8833,6 +8834,10 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
8833
8834
|
if (/\d{2,4}[-\/]\d{2,4}/.test(d) && d.indexOf(' ') > -1) {
|
|
8834
8835
|
baseY += 4;
|
|
8835
8836
|
}
|
|
8837
|
+
// In maximized view, reduce baseY slightly for grouped bars
|
|
8838
|
+
if (self.chartConfiguration.isFullScreen && subgroups.length > 1) {
|
|
8839
|
+
baseY = Math.max(short_tick_length_bg, baseY - 10);
|
|
8840
|
+
}
|
|
8836
8841
|
return baseY;
|
|
8837
8842
|
})
|
|
8838
8843
|
.attr('x', function (d) {
|
|
@@ -9426,59 +9431,49 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
9426
9431
|
* display data values on mouse over
|
|
9427
9432
|
* used by dashboard charts
|
|
9428
9433
|
*/
|
|
9429
|
-
|
|
9430
|
-
|
|
9431
|
-
|
|
9432
|
-
|
|
9433
|
-
|
|
9434
|
-
|
|
9435
|
-
|
|
9436
|
-
|
|
9437
|
-
|
|
9438
|
-
|
|
9439
|
-
|
|
9440
|
-
|
|
9441
|
-
|
|
9442
|
-
|
|
9443
|
-
|
|
9444
|
-
|
|
9445
|
-
|
|
9446
|
-
|
|
9447
|
-
|
|
9448
|
-
|
|
9449
|
-
|
|
9450
|
-
|
|
9451
|
-
|
|
9452
|
-
|
|
9453
|
-
|
|
9454
|
-
|
|
9455
|
-
|
|
9456
|
-
|
|
9457
|
-
|
|
9458
|
-
|
|
9459
|
-
|
|
9460
|
-
|
|
9461
|
-
|
|
9462
|
-
|
|
9463
|
-
|
|
9464
|
-
|
|
9465
|
-
|
|
9466
|
-
|
|
9467
|
-
|
|
9468
|
-
|
|
9469
|
-
|
|
9470
|
-
|
|
9471
|
-
|
|
9472
|
-
// })
|
|
9473
|
-
// .attr(
|
|
9474
|
-
// 'width',
|
|
9475
|
-
// self.isZoomedOut ? xSubgroup.bandwidth() : xSubgroup.bandwidth()
|
|
9476
|
-
// )
|
|
9477
|
-
// .text(function (d) {
|
|
9478
|
-
// return d.value;
|
|
9479
|
-
// });
|
|
9480
|
-
// });
|
|
9481
|
-
// }
|
|
9434
|
+
if (this.chartConfiguration.textsOnBar == undefined &&
|
|
9435
|
+
this.chartConfiguration.displayTitleOnTop == undefined) {
|
|
9436
|
+
state
|
|
9437
|
+
.selectAll('rect')
|
|
9438
|
+
.on('mouseout', function (d) {
|
|
9439
|
+
state.selectAll('.barstext').remove();
|
|
9440
|
+
})
|
|
9441
|
+
.on('mouseover', function (d1) {
|
|
9442
|
+
state
|
|
9443
|
+
.selectAll('text')
|
|
9444
|
+
.data(function (d) {
|
|
9445
|
+
let newList = [];
|
|
9446
|
+
subgroups.map(function (key) {
|
|
9447
|
+
if (key !== 'name' &&
|
|
9448
|
+
d1.key == key &&
|
|
9449
|
+
d1.value == d[key] &&
|
|
9450
|
+
d1.name == d.name) {
|
|
9451
|
+
let obj = { key: key, value: d[key], name: d.name };
|
|
9452
|
+
newList.push(obj);
|
|
9453
|
+
}
|
|
9454
|
+
});
|
|
9455
|
+
return newList;
|
|
9456
|
+
})
|
|
9457
|
+
.enter()
|
|
9458
|
+
.append('text')
|
|
9459
|
+
.attr('fill', 'var(--chart-text-color)')
|
|
9460
|
+
.attr('class', 'barstext')
|
|
9461
|
+
.attr('x', function (d) {
|
|
9462
|
+
return xSubgroup(d.key);
|
|
9463
|
+
})
|
|
9464
|
+
.attr('y', function (d) {
|
|
9465
|
+
return y(d.value);
|
|
9466
|
+
})
|
|
9467
|
+
.attr('style', 'font-size: ' + '.85em' + ';' + ' font-weight:' + 'bold' + ';')
|
|
9468
|
+
.style('fill', function (d) {
|
|
9469
|
+
return metaData.colors[d.key];
|
|
9470
|
+
})
|
|
9471
|
+
.attr('width', self.isZoomedOut ? xSubgroup.bandwidth() : xSubgroup.bandwidth())
|
|
9472
|
+
.text(function (d) {
|
|
9473
|
+
return d.value;
|
|
9474
|
+
});
|
|
9475
|
+
});
|
|
9476
|
+
}
|
|
9482
9477
|
svg
|
|
9483
9478
|
.append('g')
|
|
9484
9479
|
.attr('class', 'x2 axis2')
|