axidio-styleguide-library1-v2 0.1.74 → 0.1.75
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/horizontal-bars-with-scroll-zoom/horizontal-bars-with-scroll-zoom.component.mjs +46 -10
- package/fesm2022/axidio-styleguide-library1-v2.mjs +45 -9
- package/fesm2022/axidio-styleguide-library1-v2.mjs.map +1 -1
- package/lib/horizontal-bars-with-scroll-zoom/horizontal-bars-with-scroll-zoom.component.d.ts +4 -3
- package/package.json +1 -1
|
@@ -7176,21 +7176,57 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
7176
7176
|
}
|
|
7177
7177
|
isZoomOutSelected(isZoomOut) {
|
|
7178
7178
|
this.isZoomedOut = isZoomOut;
|
|
7179
|
-
this.
|
|
7179
|
+
this.clearChart();
|
|
7180
|
+
setTimeout(() => {
|
|
7181
|
+
this.initializeStackedChart();
|
|
7182
|
+
}, 10);
|
|
7180
7183
|
}
|
|
7181
|
-
ngOnChanges() {
|
|
7182
|
-
|
|
7183
|
-
|
|
7184
|
-
|
|
7184
|
+
ngOnChanges(changes) {
|
|
7185
|
+
// Only reinitialize if chartData actually changed and it's not the first change
|
|
7186
|
+
if (changes.chartData && !changes.chartData.firstChange) {
|
|
7187
|
+
this.clearChart();
|
|
7188
|
+
// Small timeout to ensure DOM cleanup is complete
|
|
7189
|
+
setTimeout(() => {
|
|
7190
|
+
this.initializeStackedChart();
|
|
7191
|
+
}, 10);
|
|
7192
|
+
}
|
|
7193
|
+
// Handle configuration changes
|
|
7194
|
+
if (changes.customChartConfiguration && !changes.customChartConfiguration.firstChange) {
|
|
7195
|
+
this.clearChart();
|
|
7196
|
+
setTimeout(() => {
|
|
7197
|
+
this.initializeStackedChart();
|
|
7198
|
+
}, 10);
|
|
7199
|
+
}
|
|
7200
|
+
}
|
|
7201
|
+
clearChart() {
|
|
7202
|
+
try {
|
|
7203
|
+
// Remove all content from container
|
|
7204
|
+
const container = d3.select(this.containerElt.nativeElement);
|
|
7205
|
+
container.selectAll('*').remove();
|
|
7206
|
+
// Remove by unique ID as backup
|
|
7207
|
+
d3.select('#' + this.uniqueId).remove();
|
|
7208
|
+
// Clear any event listeners
|
|
7209
|
+
container.on('click', null);
|
|
7210
|
+
container.on('mouseenter', null);
|
|
7211
|
+
container.on('mouseout', null);
|
|
7212
|
+
}
|
|
7213
|
+
catch (error) {
|
|
7214
|
+
console.warn('Error clearing chart:', error);
|
|
7215
|
+
}
|
|
7185
7216
|
}
|
|
7186
7217
|
onResized(event) {
|
|
7187
7218
|
let self = this;
|
|
7188
|
-
|
|
7189
|
-
|
|
7219
|
+
this.clearChart();
|
|
7220
|
+
setTimeout(() => {
|
|
7190
7221
|
self.initializeStackedChart();
|
|
7191
|
-
}
|
|
7222
|
+
}, 20); // Slightly longer timeout for resize events
|
|
7223
|
+
}
|
|
7224
|
+
ngOnInit() {
|
|
7225
|
+
// Initialize chart on component init
|
|
7226
|
+
if (this.chartData && this.chartData.data) {
|
|
7227
|
+
this.initializeStackedChart();
|
|
7228
|
+
}
|
|
7192
7229
|
}
|
|
7193
|
-
ngOnInit() { }
|
|
7194
7230
|
initializeStackedChart() {
|
|
7195
7231
|
var self = this;
|
|
7196
7232
|
let data = [];
|