MCPcopy Create free account
hub / github.com/DFin/Neural-Network-Visualisation / updateSelectionGlow

Method updateSelectionGlow

assets/main.js:2258–2279  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2256 }
2257
2258 updateSelectionGlow() {
2259 if (!this.selectedNeuron) {
2260 this.hideSelectionGlow();
2261 return;
2262 }
2263 const { layerIndex, neuronIndex } = this.selectedNeuron;
2264 const layer = this.layerMeshes[layerIndex];
2265 const position = layer?.positions?.[neuronIndex];
2266 if (!layer || !position) {
2267 this.hideSelectionGlow();
2268 return;
2269 }
2270 const sprite = this.ensureSelectionGlowSprite();
2271 sprite.position.copy(position);
2272 const baseSize =
2273 layer.type === "input"
2274 ? this.options.inputNodeSize ?? 0.18
2275 : this.options.hiddenNodeRadius ?? 0.22;
2276 const scale = Math.max(baseSize * 3, 0.2);
2277 sprite.scale.set(scale, scale, 1);
2278 sprite.visible = true;
2279 }
2280
2281 hideSelectionGlow() {
2282 if (!this.selectionGlowSprite) return;

Callers 2

Calls 2

hideSelectionGlowMethod · 0.95

Tested by

no test coverage detected