LegendLayer.detach¶
Summary¶
LegendLayer.detach removes legend DOM nodes and unsubscribes from bound source visual-change signals. OverlaySystem calls this automatically during removal/clear operations.
Syntax¶
Parameters¶
This method does not take parameters.
Returns¶
void - No return value.
Type Details¶
Example¶
const canvas = document.querySelector("canvas");
const wgpu = await WasmGPU.create(canvas);
const overlay = wgpu.createOverlay.system();
const legend = wgpu.createOverlay.legend({
id: "legend-main",
source: { scaleTransform: { mode: "linear", domainMin: 0, domainMax: 1 }, colormap: "turbo" }
});
overlay.addLayer(legend);
overlay.removeLayer("legend-main"); // detach called internally