(rawValue, { emit = true } = {})
| 512 | connectionThresholdValue.textContent = formatThreshold(value); |
| 513 | }; |
| 514 | const applyConnectionThreshold = (rawValue, { emit = true } = {}) => { |
| 515 | const max = updateThresholdSliderBounds(); |
| 516 | let parsed = Number.parseFloat(rawValue); |
| 517 | if (!Number.isFinite(parsed)) { |
| 518 | parsed = neuralScene.options.connectionWeightThreshold ?? 0; |
| 519 | } |
| 520 | const clamped = clamp(parsed, min, max); |
| 521 | syncThresholdUi(clamped); |
| 522 | if (!emit) return; |
| 523 | const changed = neuralScene.setConnectionWeightThreshold(clamped); |
| 524 | if (changed) { |
| 525 | VISUALIZER_CONFIG.connectionWeightThreshold = clamped; |
| 526 | if (typeof onConnectionsSettingsChange === "function") { |
| 527 | onConnectionsSettingsChange(clamped); |
| 528 | } |
| 529 | } |
| 530 | }; |
| 531 | const initialThreshold = Number.isFinite(neuralScene.options.connectionWeightThreshold) |
| 532 | ? Math.max(min, neuralScene.options.connectionWeightThreshold) |
| 533 | : Math.max(min, VISUALIZER_CONFIG.connectionWeightThreshold); |
no test coverage detected