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

Function applyStrength

assets/main.js:631–641  ·  view source on GitHub ↗
(rawValue)

Source from the content-addressed store, hash-verified

629 strengthValue.textContent = formatStrength(value);
630 };
631 const applyStrength = (rawValue) => {
632 let parsed = Number.parseFloat(rawValue);
633 if (!Number.isFinite(parsed)) {
634 parsed = brush.drawStrength;
635 }
636 const clamped = clamp(parsed, min, max);
637 syncStrengthUi(clamped);
638 digitCanvas.updateBrushSettings({ drawStrength: clamped });
639 VISUALIZER_CONFIG.brush.drawStrength = clamped;
640 brush.drawStrength = clamped;
641 };
642 applyStrength(brush.drawStrength);
643 strengthSlider.addEventListener("input", (event) => {
644 applyStrength(event.target.value);

Callers 1

Calls 3

clampFunction · 0.85
syncStrengthUiFunction · 0.85
updateBrushSettingsMethod · 0.80

Tested by

no test coverage detected