axidio-styleguide-library1-v2 0.1.45 → 0.1.47
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.
|
@@ -6929,7 +6929,7 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
6929
6929
|
isTitleHidden: undefined,
|
|
6930
6930
|
};
|
|
6931
6931
|
this.isCC = false;
|
|
6932
|
-
this.isZoomedOut =
|
|
6932
|
+
this.isZoomedOut = true;
|
|
6933
6933
|
}
|
|
6934
6934
|
isZoomOutSelected(isZoomOut) {
|
|
6935
6935
|
this.isZoomedOut = isZoomOut;
|
|
@@ -7902,13 +7902,53 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
7902
7902
|
/**
|
|
7903
7903
|
* used to display y label
|
|
7904
7904
|
*/
|
|
7905
|
+
// if (!this.isZoomedOut) {
|
|
7906
|
+
// svg
|
|
7907
|
+
// .selectAll('.lib-xaxis-labels-texts-drilldown')
|
|
7908
|
+
// .attr('transform', 'rotate(-90)')
|
|
7909
|
+
// .attr('text-anchor', 'end')
|
|
7910
|
+
// .attr('x', '-5')
|
|
7911
|
+
// .attr('dy', null);
|
|
7912
|
+
// }
|
|
7905
7913
|
if (this.isZoomedOut) {
|
|
7914
|
+
// svg
|
|
7915
|
+
// .selectAll('.lib-xaxis-labels-texts-drilldown')
|
|
7916
|
+
// .attr('transform', 'rotate(-30)')
|
|
7917
|
+
// .attr('text-anchor', 'end')
|
|
7918
|
+
// .attr('x', '-5')
|
|
7919
|
+
// .attr('dy', null)
|
|
7920
|
+
// .style('fill', 'var(--chart-text-color)');
|
|
7906
7921
|
svg
|
|
7907
7922
|
.selectAll('.lib-xaxis-labels-texts-drilldown')
|
|
7908
|
-
.
|
|
7909
|
-
.
|
|
7910
|
-
.
|
|
7911
|
-
|
|
7923
|
+
.each((d, i, nodes) => {
|
|
7924
|
+
const text = d3.select(nodes[i]);
|
|
7925
|
+
const label = text.text();
|
|
7926
|
+
// If label contains \n, split and use tspan for each line
|
|
7927
|
+
if (label.indexOf('\n') > -1) {
|
|
7928
|
+
const lines = label.split('\n');
|
|
7929
|
+
text.text(null);
|
|
7930
|
+
lines.forEach((line, idx) => {
|
|
7931
|
+
text.append('tspan')
|
|
7932
|
+
.text(line)
|
|
7933
|
+
.attr('x', 0)
|
|
7934
|
+
.attr('dy', idx === 0 ? '1em' : '1.1em');
|
|
7935
|
+
});
|
|
7936
|
+
}
|
|
7937
|
+
else {
|
|
7938
|
+
// Fallback: split by space for other labels
|
|
7939
|
+
const words = label.split(' ');
|
|
7940
|
+
text.text(null);
|
|
7941
|
+
words.forEach((word, index) => {
|
|
7942
|
+
text.append('tspan').text(word);
|
|
7943
|
+
});
|
|
7944
|
+
}
|
|
7945
|
+
})
|
|
7946
|
+
.style('fill', 'var(--chart-text-color)')
|
|
7947
|
+
.attr('transform', null); // Remove rotate if using line breaks
|
|
7948
|
+
// Optional: Adjust bottom margin or chart layout
|
|
7949
|
+
svg
|
|
7950
|
+
.select('.x-axis')
|
|
7951
|
+
.attr('transform', `translate(0, ${height - margin.bottom + 10})`);
|
|
7912
7952
|
}
|
|
7913
7953
|
function styleAxisDomain() {
|
|
7914
7954
|
svg.selectAll('.domain')
|