Add LGraphNode.strokeStyles API (#868)

This should allow frontend drop the stroke logic in hijack of
`drawNodeShape`. Example usage:

```ts
node.strokeStyles["executionError"] = (this: LGraphNode) => 
  app.lastNodeErrors?.[this.id] ? { colour: 'red', thickness: 2 } : undefined
```
This commit is contained in:
Chenlei Hu
2025-03-30 11:29:37 -04:00
committed by GitHub
parent 27a2b785ac
commit 854ac4350f
6 changed files with 80 additions and 29 deletions

View File

@@ -94,6 +94,10 @@ LGraph {
"selected": undefined,
"serialize_widgets": undefined,
"showAdvanced": undefined,
"strokeStyles": {
"error": [Function],
"selected": [Function],
},
"title": undefined,
"type": "",
"widgets": undefined,
@@ -160,6 +164,10 @@ LGraph {
"selected": undefined,
"serialize_widgets": undefined,
"showAdvanced": undefined,
"strokeStyles": {
"error": [Function],
"selected": [Function],
},
"title": undefined,
"type": "",
"widgets": undefined,
@@ -227,6 +235,10 @@ LGraph {
"selected": undefined,
"serialize_widgets": undefined,
"showAdvanced": undefined,
"strokeStyles": {
"error": [Function],
"selected": [Function],
},
"title": undefined,
"type": "",
"widgets": undefined,