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

Method updateCellVisual

assets/main.js:1200–1214  ·  view source on GitHub ↗
(index)

Source from the content-addressed store, hash-verified

1198 }
1199
1200 updateCellVisual(index) {
1201 const cell = this.cells[index];
1202 if (!cell) return;
1203 const value = this.values[index];
1204 if (value <= 0) {
1205 cell.style.background = "rgba(255, 255, 255, 0.05)";
1206 cell.classList.remove("active");
1207 return;
1208 }
1209 const hue = 180 - value * 70;
1210 const saturation = 70 + value * 25;
1211 const lightness = 25 + value * 40;
1212 cell.style.background = `hsl(${hue.toFixed(0)}, ${saturation.toFixed(0)}%, ${lightness.toFixed(0)}%)`;
1213 cell.classList.add("active");
1214 }
1215
1216 scheduleChange() {
1217 if (this.pendingChange) return;

Callers 3

applyBrushMethod · 0.95
setPixelsMethod · 0.95
clearMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected