Keep the camera of scatterplot inside its home view while
bounds.bounded() is true (see boundView): zooming out stops at
the home view, a pan stops at its edges, and zooming in stops at
MIN_VIEW_SHARE of its range.
The camera's scale bounds stop the zoom at the wheel, about the pointer,
on each axis at its own scale. Its translation bounds are kept but not
applied by dom-2d-camera, and the room a pan has depends on the zoom, so
each frame's view is bounded as the camera applies its pan and zoom,
before the frame is drawn: the view never leaves the bounds, so it does
not jump back, and no view event fires for a view the plot did not draw.
Turning the view (alt and a drag) is off while bounded.
Call update() once the scatterplot is made, and again when bounded()
or the home view changes. A scatterplot with no camera to read is left
as it is.
Keep the camera of
scatterplotinside its home view whilebounds.bounded()is true (see boundView): zooming out stops at the home view, a pan stops at its edges, and zooming in stops at MIN_VIEW_SHARE of its range.The camera's scale bounds stop the zoom at the wheel, about the pointer, on each axis at its own scale. Its translation bounds are kept but not applied by dom-2d-camera, and the room a pan has depends on the zoom, so each frame's view is bounded as the camera applies its pan and zoom, before the frame is drawn: the view never leaves the bounds, so it does not jump back, and no view event fires for a view the plot did not draw. Turning the view (alt and a drag) is off while bounded.
Call
update()once the scatterplot is made, and again whenbounded()or the home view changes. A scatterplot with no camera to read is left as it is.