From 2a5539c148e398a20096865badcde8c5851634b6 Mon Sep 17 00:00:00 2001 From: antv Date: Fri, 9 Aug 2024 17:23:51 +0800 Subject: [PATCH] chore: adapt g devtool --- packages/g6/__tests__/main.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/g6/__tests__/main.ts b/packages/g6/__tests__/main.ts index 99f7649a5d8..66340d7e670 100644 --- a/packages/g6/__tests__/main.ts +++ b/packages/g6/__tests__/main.ts @@ -68,9 +68,9 @@ async function render() { const testCase = demos[Demo as keyof typeof demos]; if (!testCase) return; - const result = await testCase({ container: canvas, animation: Animation, theme: Theme }); + const graph = await testCase({ container: canvas, animation: Animation, theme: Theme }); - Object.assign(window, { graph: result }); + Object.assign(window, { graph, __g_instances__: Object.values(graph.getCanvas().getLayers()) }); renderForm(panels.panel, testCase.form); }