interface RVG · Viewports

RvgViewport

interface RvgViewport extends RvgVisual

A box or circle that shows a part of a larger drawing: content in world coordinates, placed by origin, clipped to the boundary.

A viewport is a group with three parts. content holds the drawing in world coordinates; its anchor is origin, so setting origin pans, zooms and turns it. frame is the viewport itself: what is created there (a border, a scale, a legend) is drawn above the content, does not move with origin, and is clipped to the boundary too. The boundary is in the viewport's own coordinates; anchor places these in the parent group.

Viewports computes new origins (pan, zoom, fit, focus) and converts between world and viewport coordinates. interactive switches user panning and zooming on and off.

Properties

anchorreadonly

anchor: Pin

Places the viewport in its parent group, as the anchor of any group does.

contentreadonly

content: RvgGroup

The group for the drawing; its coordinates are world coordinates.

framereadonly

frame: RvgGroup

The viewport itself as a group: visuals created here are drawn above the content and don't move with origin.

interactivereadonly

interactive: RvgViewportController

Switches user panning and zooming.

originreadonly

origin: Pin

Where the world is shown: its position is where world (0, 0) appears in viewport coordinates (the pan), its direction holds the zoom (length) and the rotation (angle).

The default, (0, 0) with direction (1, 0), shows the world unmoved. Set it directly, with a Viewports function and result, or animate it with Animate.pin.

Inherited

From RvgVisual applyStyleDirective, fromGraphic, getVisualBoundingBox, mounted, toGraphic, visible, zIndex