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

Method handleScenePointerUp

assets/main.js:1961–1971  ·  view source on GitHub ↗
(event)

Source from the content-addressed store, hash-verified

1959 }
1960
1961 handleScenePointerUp(event) {
1962 if (!event.isPrimary && event.isPrimary !== undefined) return;
1963 if (event.button !== 0) return;
1964 if (!this.pointerDown) return;
1965 const dx = event.clientX - this.pointerDown.x;
1966 const dy = event.clientY - this.pointerDown.y;
1967 this.pointerDown = null;
1968 const distance = Math.hypot(dx, dy);
1969 if (distance > 4) return;
1970 this.trySelectNeuron(event);
1971 }
1972
1973 trySelectNeuron(event) {
1974 if (!this.layerMeshes.length || !this.camera) return;

Callers 1

initThreeSceneMethod · 0.95

Calls 1

trySelectNeuronMethod · 0.95

Tested by

no test coverage detected