Repository navigation
Conversation
niivue zooms a 2D view on the wheel only when a drag mode pans; with the default modes (crosshair, contrast) the wheel steps slices, which does nothing on a 2D image. Make the right button pan, which turns on wheel zoom, and anchor the zoom at the pointer, since 2D images are drawn without a crosshair. The panel link already broadcasts pan and zoom, so all four panels follow, and "Reset view" restores them. Right-drag no longer adjusts contrast, and on 3D volumes the wheel now zooms the slice views instead of stepping slices. The viewer spec scrolls and right-drags over the inputs comparison and checks that every panel zooms and pans together. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Move from 1.0.0-rc.16 to the newest 1.0 pre-release (npm's next tag; latest still points at the 0.x line, whose API the demo does not use). The only breaking change in between, the removal of LUT.centroids, does not touch the demo. @niivue/cbor-loader is already at its latest, 1.2.1. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.
The demo app's niivue viewers now zoom with the mouse wheel. This PR also moves the demo to niivue 1.0.0-rc.21.
Mouse-wheel zoom
Before this change the wheel did nothing on 2D images. niivue zooms a 2D view on the wheel only when one of the drag modes is "pan". The demo used niivue's defaults: left button moves the crosshair, right button adjusts contrast. With those, the wheel steps through slices, and a 2D image has only one slice.
createViewerPanel(src/viewer/panel.ts) now passes two options to theNiiVueconstructor:secondaryDragMode: DRAG_MODE.pan: the right button pans, which turns on wheel zoom.wheelZoomAnchor: 'pointer': zoom centres on the mouse rather than the crosshair, because 2D images are drawn without a crosshair.The existing panel link already sends pan and zoom to the other panels, so all four panels zoom and pan together. "Reset view" already restores them.
Behavior changes:
niivue 1.0.0-rc.16 → 1.0.0-rc.21
This moves to the newest 1.0 pre-release, published under npm's
nexttag. npm'slatesttag still points to the 0.x line, whose API the demo doesn't use.The only breaking change between the two versions is the removal of
LUT.centroids, which the demo doesn't use. niivue's own dependencies resolve to the same versions as before.@niivue/cbor-loaderis already at its latest, 1.2.1.Tests
test/viewer.spec.tsgains two steps:Both check that all four panels still agree. Both steps fail with the old drag modes.
🤖 Generated with Claude Code