Fix critical graph bugs and coordinate system drag bounds - #11
Merged
Merged
Conversation
- ConfigurableGraph: add Number.isFinite() guard so NaN values from null kinematics don't corrupt graph rendering and axis ranges - GraphInteractionHandler: negate Y-axis touch-pan delta so dragging down pans values downward (matching X-axis behaviour) - GraphInteractionHandler: pass setManualFlag=true in zoomIn/zoomOut so explicit zoom isn't overridden by auto-rescaling on new data - CoordinateSystemNode: clamp coordOriginProperty to video bounds so the coordinate system cannot be dragged completely off-screen - SimModel: export VIDEO_CENTER_X / VIDEO_CENTER_Y for use in view https://claude.ai/code/session_01DtpSnHGs128wFfuLfRPN7d
- CalibrationToolNode: show red endpoint highlight and warning text when calibration endpoints are within 10 px of each other, giving clear visual feedback instead of silently falling back to identity transform - AutoTrackerNode: add initVersion counter so if a new drag starts while the previous initFromVideo is still awaiting WASM load, the stale result is discarded rather than overwriting the newer selection https://claude.ai/code/session_01DtpSnHGs128wFfuLfRPN7d
The comprehensive implementation (KeyboardShorcutsNode.ts, 72 lines) was dead code due to a filename typo — main.ts imported the 22-line stub that only showed generic SceneryStack shortcuts. Delete the stub and rename the comprehensive version (simulation controls + graph interactions) to the correct filename so it is actually used. https://claude.ai/code/session_01DtpSnHGs128wFfuLfRPN7d
- SimModel: replace localeCompare() with charCodeAt() for deterministic ASCII ordering of single-letter track symbols (A–Z) - DataTableNode: align CSV and on-screen display to 4 decimal places so exported data matches what users see in the table - DataTableNode: remove document.body.appendChild/removeChild around the CSV download link — modern browsers don't require DOM insertion - AutoTrackerNode: compute frame index via time × frameRate instead of time / frameDuration to reduce floating-point error at 29.97 fps - TrackLabColors: expand TRACK_COLORS from 8 to 26 distinct colours so every track A–Z has a unique hue without wrapping https://claude.ai/code/session_01DtpSnHGs128wFfuLfRPN7d
Security: - OpenCVTracker: extract captureFrame() helper that wraps getImageData() in a try/catch, converting SecurityError from cross-origin videos into a descriptive Error (initFromVideo) or a silent null return (track()) Performance: - GraphDataManager: pool trail Circle nodes and update their properties instead of destroying and recreating nodes on every updateTrail() call (called on pan, zoom, resize, and every new data point) - DigitizingOverlayNode: cache rendered video bounds (aspect ratio) and only recompute on loadedmetadata; invalidate the cache listener is removed in dispose() to avoid leaks - DigitizingOverlayNode: use time × frameRate for frame index calculation (same fix as AutoTrackerNode) to reduce floating-point error at 29.97 fps https://claude.ai/code/session_01DtpSnHGs128wFfuLfRPN7d
- CoordinateSystemNode: replace non-existent Vector2.withXY() with copy().setXY()
- OpenCVTracker: work around ES2020 Error constructor not accepting {cause}
- GraphDataManager: replace indexed loop + non-null assertion with for...of entries()
- DataTableNode: replace Map.get()! after has() with explicit undefined check
https://claude.ai/code/session_01DtpSnHGs128wFfuLfRPN7d
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
null kinematics don't corrupt graph rendering and axis ranges
down pans values downward (matching X-axis behaviour)
so explicit zoom isn't overridden by auto-rescaling on new data
the coordinate system cannot be dragged completely off-screen
https://claude.ai/code/session_01DtpSnHGs128wFfuLfRPN7d