interface RVG · Factories
RvgViewportFactory
interface RvgViewportFactory
Creates viewports: a box or circle that shows a part of a larger drawing, optionally panned and zoomed by the user.
A viewport is a visual whose boundary clips what is in it and which owns a content group. Content
in content is drawn in world coordinates: the viewport's origin places them in the viewport
(pan, zoom, rotation). Pass { panning: true, zooming: true } to let the user drag and
wheel-zoom it; without options, neither is on.
Methods
box
box(interactivity?: ViewportInteractivityOptions | null): RvgBoxViewportCreates a box-shaped viewport initialized at the origin with specified interactivity options.
interactivityoptional- The interactivity options for the viewport.
Returns A box viewport instance.
box(p1: Point | VectorLike, p2: Point | VectorLike, interactivity?: ViewportInteractivityOptions | null): RvgBoxViewportCreates a box-shaped viewport spanned by two points with specified interactivity options.
p1- The first corner.
p2- The opposite corner.
interactivityoptional- The interactivity options for the viewport.
Returns A box viewport instance.
circle
circle(interactivity?: ViewportInteractivityOptions | null): RvgCircleViewportCreates a circle-shaped viewport with 3 points initialized at the origin with specified interactivity options.
interactivityoptional- The interactivity options for the viewport.
Returns A circle viewport instance.
circle(p1: Point | VectorLike, p2: Point | VectorLike, p3: Point | VectorLike, interactivity?: ViewportInteractivityOptions | null): RvgCircleViewportCreates a circle-shaped viewport passing through exactly 3 specified points with specified interactivity options.
p1- The first point.
p2- The second point.
p3- The third point.
interactivityoptional- The interactivity options for the viewport.
Returns A circle viewport instance.
circleAt
circleAt(center: Point | VectorLike, radius: Real | NumberLike, interactivity?: ViewportInteractivityOptions | null): RvgCircleViewportCreates a circle-shaped viewport at a specified center with a specified radius and interactivity options.
center- The center of the circle viewport.
radius- The radius of the circle viewport.
interactivityoptional- The interactivity options for the viewport.
Returns A circle viewport instance.
