style

style.setNodeIcon

setNodeIcon(nodeId: string, iconName: string): Promise<void>

Assign or clear the icon for a single node.

Pass null to remove the icon. Recorded in history as "SetNodeIcon". Invalidates the store's transaction version so the render loop re-resolves icon UVs on the next frame. Does not emit "style:changed".

nodeIdstringId of the node to modify.
iconNamestringIcon identifier from the engine's icon atlas, or null to clear.

Returns: Promise<void>

Example

await api.style.setNodeIcon("s1", "person");
await api.style.setNodeIcon("s1", null); // clear icon