Update link colors and re-group for batched rendering.
(linkColors: Map<string, string>)
| 1184 | |
| 1185 | /** Update link colors and re-group for batched rendering. */ |
| 1186 | updateLinkColors(linkColors: Map<string, string>): void { |
| 1187 | if (!this.app) return; |
| 1188 | for (const edge of this.edges) { |
| 1189 | edge.color = linkColors.get(edge.label) ?? '#3b4048'; |
| 1190 | } |
| 1191 | // Re-group edges by color for batched rendering |
| 1192 | this.edgeColorGroups.clear(); |
| 1193 | for (let i = 0; i < this.edges.length; i++) { |
| 1194 | const color = this.edges[i].color; |
| 1195 | let group = this.edgeColorGroups.get(color); |
| 1196 | if (!group) { |
| 1197 | group = []; |
| 1198 | this.edgeColorGroups.set(color, group); |
| 1199 | } |
| 1200 | group.push(i); |
| 1201 | } |
| 1202 | this.redrawAllEdges(); |
| 1203 | } |
| 1204 | |
| 1205 | /** Re-read graph CSS variables and update canvas background + label styles. */ |
| 1206 | setThemeColors(): void { |
no test coverage detected