MCPcopy
hub / github.com/opentrace/opentrace / updateLinkColors

Method updateLinkColors

ui/src/components/pixi/PixiRenderer.ts:1186–1203  ·  view source on GitHub ↗

Update link colors and re-group for batched rendering.

(linkColors: Map<string, string>)

Source from the content-addressed store, hash-verified

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 {

Callers 1

Calls 3

redrawAllEdgesMethod · 0.95
pushMethod · 0.80
getMethod · 0.65

Tested by

no test coverage detected