style.applyStylesheet
applyStylesheet(rules: ApiStyleRule[]): Promise<void>Apply a batch of style rules (a "stylesheet") to the graph in one operation.
Each rule may target a category or a relationship and may include
color, size, and/or icon overrides. Rules are applied in order.
All resulting commands are wrapped in a single labeled transaction —
the entire stylesheet collapses into one undo step (commit f150a9fea).
The rules are cached in _stylesheetRules (not undoable).
Emits "style:changed".
rules | ApiStyleRule[] | Array of style rule descriptors. |
Returns: Promise<void>
Example
await api.style.applyStylesheet([
{ category: "Person", color: "#4363d8", size: 15, icon: "person" },
{ relationship: "KNOWS", color: "#3cb44b" },
]);