From a5a52230c83bc6466444edfbf1b8ce70978bb632 Mon Sep 17 00:00:00 2001 From: etowahadams Date: Mon, 6 May 2024 14:56:56 -0400 Subject: [PATCH 1/2] perf: memory --- src/tracks/gosling-track/gosling-track.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/tracks/gosling-track/gosling-track.ts b/src/tracks/gosling-track/gosling-track.ts index 66ca40549..959f93556 100644 --- a/src/tracks/gosling-track/gosling-track.ts +++ b/src/tracks/gosling-track/gosling-track.ts @@ -1,4 +1,4 @@ -import type * as PIXI from 'pixi.js'; +import * as PIXI from 'pixi.js'; import { isEqual, sampleSize, uniqBy } from 'lodash-es'; import type { ScaleLinear } from 'd3-scale'; import type { @@ -399,7 +399,8 @@ const factory: PluginTrackFactory = (HGC, context, op this.pBackground.clear(); this.pBackground.removeChildren(); this.pBorder.clear(); - this.pBorder.removeChildren(); + const children = this.pBorder.removeChildren(); + children.forEach(c => c.destroy()); this.displayedLegends = []; // Because a single tile contains one track or multiple tracks overlaid, we draw marks and embellishments From a0a4a01241c093d640111dd7f3ee8ec8cb376fc2 Mon Sep 17 00:00:00 2001 From: etowahadams Date: Mon, 6 May 2024 15:12:10 -0400 Subject: [PATCH 2/2] fix: add back type --- src/tracks/gosling-track/gosling-track.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tracks/gosling-track/gosling-track.ts b/src/tracks/gosling-track/gosling-track.ts index 959f93556..e761fc3fb 100644 --- a/src/tracks/gosling-track/gosling-track.ts +++ b/src/tracks/gosling-track/gosling-track.ts @@ -1,4 +1,4 @@ -import * as PIXI from 'pixi.js'; +import type * as PIXI from 'pixi.js'; import { isEqual, sampleSize, uniqBy } from 'lodash-es'; import type { ScaleLinear } from 'd3-scale'; import type {