Skip to content

Commit

Permalink
fix: remove treemap when no module is selected
Browse files Browse the repository at this point in the history
  • Loading branch information
manfredsteyer committed Oct 15, 2024
1 parent 3a663aa commit 6593a8b
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions apps/frontend/src/app/ui/treemap/treemap.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ export class TreeMapComponent implements OnChanges, OnDestroy {
const ctx = canvas.getContext('2d');
const config = this.chartConfig();

this.chart?.destroy();

if (config.data.datasets[0].data.length === 0) {
return;
}
Expand All @@ -79,10 +81,6 @@ export class TreeMapComponent implements OnChanges, OnDestroy {
throw new Error('2d context not found');
}

console.log('config', config);

this.chart?.destroy();

config.options = config.options ?? {};
config.options.onClick = (
_event: ChartEvent,
Expand Down

0 comments on commit 6593a8b

Please sign in to comment.