Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • graphpolaris/frontend-v2
  • rijkheere/frontend-v-2-reordering-paoh
2 results
Show changes
......@@ -63,6 +63,7 @@ export const NLPixi = forwardRef((props: Props, refExternal) => {
let edgeBundling: Point[][];
const ref = useRef<HTMLDivElement>(null);
const canvas = useRef<HTMLCanvasElement>(null);
const appRef = useRef<Application | null>(null);
const app = useAsyncMemo(async () => {
if (canvas.current == null) return null;
const app = new Application();
......@@ -75,6 +76,7 @@ export const NLPixi = forwardRef((props: Props, refExternal) => {
resolution: window.devicePixelRatio || 2,
canvas: canvas.current as HTMLCanvasElement,
});
appRef.current = app;
return app;
}, [canvas]);
......@@ -961,7 +963,14 @@ export const NLPixi = forwardRef((props: Props, refExternal) => {
nodeMap.current.clear();
edgeLabelMap.current.clear();
app?.destroy();
nodeLabelMap.current.clear();
appRef.current?.ticker.stop();
appRef.current?.destroy(true, {
children: true,
texture: true,
textureSource: true,
});
const layout = layoutAlgorithm.current as GraphologyForceAtlas2Webworker;
if (layout?.cleanup != null) layout.cleanup();
......