Developers
VisQuill GDK API reference
Every class, interface and type of @visquill/visquill-gdk 1.1.0, with signatures, parameters and descriptions. For the ideas behind them, start with the developer guide.
Geometry
Computations
ArcsclassComputations on circular arcs: creating them (from three points, a pin, a sagitta, a circle), points, pins and directions along them, length, area and sweep angle.BarsclassCreates bars (rectangles) standing on a segment or at a pin.BoxesclassComputations on boxes (axis-parallel rectangles): their sides and corners, size and area, containment and intersection, and boxes made by growing, padding, merging or fitting.CirclesclassComputations on circles: creating them (center and radius, two or three points, enclosing points), points, pins and directions on them, area, circumference and containment.ConvexHullsclassSections of the convex hull of a point set: the upper, lower, left and right chain, or the part between two start points.CurvesclassCreates curves along a polyline, polygon or circle whose distance from it follows given values (offset curves), and the filled areas between such a curve and its baseline.DeclutterclassDecides which shapes to show at which zoom so that the shown ones don't overlap, e.g. labels on a timeline: for each shape the smallest scale at which it is shown.DeclutterBoxesAlongAxisOptionsclassOptions for Declutter.boxesAlongAxis.DeclutterBoxesOptionsclassOptions for Declutter.boxes.DeclutterCirclesAlongAxisOptionsclassOptions for Declutter.circlesAlongAxis.DeclutterCirclesOptionsclassOptions for Declutter.circles.DistributeclassPlaces points evenly along a segment, arc, circle, polygon or polyline.ExtremesclassFinds the extreme point of a point set: the leftmost, rightmost, topmost, bottommost, closest to or farthest from a point.FitsclassComputes the pin that fits one shape into another (a box or circle into a box or circle).GridsclassComputations on grids: creating grids (equal cells, from weights or from size wishes), finding the cell of a point, binning and counting points, the cells and lines as shapes, focus + context, and carrying points and shapes from one grid to another.GridTrackclassThe size wish of one column or row for Grids.fit.MatchclassMatches the points of one set with the points of another.OffsetsclassCreates offset shapes: contours around shapes, routes beside a polyline, and points beside a segment.PackclassPacks circles tightly, e.g. as packed bubbles, or places them along a curve around a map (necklace maps).PackCirclesAlongCurveOptionsclassOptions for Pack.circlesAlongCircle, circlesAlongArc, circlesAlongPolygon and circlesAlongPolyline (necklace maps: circles placed on a curve around a map, all scaled by one factor).PackCirclesAroundOptionsclassOptions for Pack.circlesAround (circles packed tightly around a point; the radii stay).PackCirclesInCircleOptionsclassOptions for Pack.circlesInCircle (circles packed, then scaled so that the whole packing fits into a circle).PinsclassComputations on pins: moving, turning and scaling them, placing them on or beside shapes, and reading their position, direction and length.PointsclassComputations on points: distances, closest points on lines, segments, arcs and polylines, moving, rotating and placing points, and points of a set (centroid, bounding box, nearest).PolygonsclassComputations on polygons: area, perimeter and orientation, containment, points and pins along the outline, and new polygons (regular, simplified, smoothed, parallel, slices).PolylinesclassComputations on polylines: length, points and pins along them, slices and extensions, closest points, and new polylines (simplified, smoothed, parallel, clipped, joined).RectanglesclassCreates rectangles (along a segment, anchored at or centered on a pin) and computes their corners, sides, size and diagonal.SegmentsclassComputations on segments: length, direction and midpoint, points on them, and segments made from a point and a direction.SeparateclassMoves shapes apart so that they don't overlap, with as little movement as possible.SeparateBoxesAlongAxisOptionsclassOptions for Separate.boxesAlongAxis.SeparateBoxesOptionsclassOptions for Separate.boxes (boxes that move in x and y).SeparateCirclesAlongAxisOptionsclassOptions for Separate.circlesAlongAxis.SeparateCirclesOptionsclassOptions for Separate.circles (circles that move in any direction).SeparatePreviousclassThe previous layout for Separate.circlesAlongAxis (SeparateCirclesAlongAxisOptions.previous).ShapesclassTransforms any shape: copy, reverse, flip, mirror, move, rotate, scale, cycle the start point, and bounding box and centroid.SimplifyclassReduces a line to fewer points, e.g. a long time series or an elevation profile drawn at screen resolution.SimplifyEnvelopeOptionsclassOptions for Simplify.envelope.SymbolsclassCreates symbol shapes centered on a point: circle, square, rectangle, diamond and triangle.TrianglesclassComputations on triangles: area, right angle and equilateral tests, containment, the outer circle, and triangles made from a pin.ViewportsclassComputes the origin of a viewport: pan, zoom and rotation, fitting and focusing, and the conversion between world and viewport coordinates.WithinclassAn area: a polygon, a circle, or both (then the area is where they overlap).
Shapes
ArcinterfaceA circular arc through three points: start, middle and end.BoxinterfaceA box: a rectangle with sides parallel to the axes, stored as two opposite corners.CastclassGives a shape a more specific shape type, so that the computations for that type accept it.CircleinterfaceA circle through three points.CircularShapeinterfaceA shape on a circle: the base of Circle and Arc.GridclassA grid given by its lines: the x positions of the vertical lines and the y positions of the horizontal lines, both sorted.GridCellclassA cell of a Grid: its row and column, counted from 0.PolygoninterfaceA closed shape: straight lines join its points, and the last point to the first.PolygonalShapeinterfaceA shape whose points are joined by straight lines: the base of Polyline, Polygon, Segment, Triangle, Rectangle and Box.PolylineinterfaceAn open line through its points: the last point is not joined to the first.RectangleinterfaceA polygon with four corners and right angles, which may be turned.SegmentinterfaceA straight line between two points.ShapeinterfaceA shape stored as its points: the base of polygons, polylines, segments, circles and the other shape types.ShapeLiketypePoints written as an array: [[x, y], …] or [{ x, y }, …].TriangleinterfaceA polygon with three points.
Primitives
Collections
CollectioninterfaceA group of entries that can be iterated; the base of Sequence.ReadOnlyCollectioninterfaceEntries that can be iterated; the base of Collection.SequenceinterfaceA reactive list with entries by index: the base of every shape, and the type of values.realArray.
Computations
ValuesclassArithmetic on reactive numbers: add, subtract, multiply, divide, modulus, round, clamp, interpolate and remap.VectorsclassComputations on vectors: arithmetic, length, angles, rotation, projection and normalization.
Values
BoolinterfaceA reactive true/false value: code that depends on it runs again when its value changes.BoolLiketypeA plain true or false, accepted where a Bool is.IntegerinterfaceA reactive whole number, for example the zIndex of a visual.IteminterfaceA reactive value of any type, created with values.item(…): code that depends on it runs again when value is set.NumberLiketypeA plain number, accepted where a Real is.NumbersLiketypeNumbers in any iterable form: an array, a typed array, a set, a generator, ….ReadOnlyIntegerinterfaceThe read side of Integer: a reactive whole number that can be read but not set.ReadOnlyRealinterfaceThe read side of Real: a reactive number that can be read but not set.RealinterfaceA reactive number: code that depends on it runs again when its value changes.StringValueinterfaceA reactive text: code that depends on it runs again when the text changes.
Vectors
PininterfaceA position with a direction: x, y and the direction dx, dy.PinLiketypeA pin written as an object or array: { x, y }, { x, y, dx, dy }, [x, y] or [x, y, dx, dy].PointinterfaceA position.VectorinterfaceTwo numbers, x and y: a direction or a displacement, and the base of Point and Pin.VectorLiketypeA position or direction written as { x, y } or [x, y].VectorsLiketypeSeveral positions: an array or other iterable of VectorLike values, an array of vectors, or a shape.
Reactive
Animation
AnimateclassCentral animation controller for all reactive value types.EasingFunctionsclassCurves for the easing option of animations: each maps the time from 0 to 1 to the progress from 0 to 1.RvgAlongOptionsclassOptions for Animate.pin.along: where on the route the pin starts and ends.RvgAnimationclassA running animation: returned by every animator call (eased, follow, morph, set, morphAll, …) to stop it or to wait for it.RvgBoolAnimatorclassAnimator for reactive boolean values.RvgEasedOptionsclassOptions for eased (tween) animations.RvgFollowOptionsclassOptions for follow (spring/damped) animations.RvgIntegerAnimatorclassAnimator for reactive integer values.RvgNumberAnimatorclassAnimator for reactive real-number values.RvgPinAnimatorclassAnimator for reactive Pin values.RvgPointAnimatorclassAnimator for reactive Point values.RvgProgressAnimatorclassAnimator for animations of your own: it runs a progress from 0 to 1 over time and calls your function with it each frame; the function decides what to change.RvgRealArrayAnimatorclassAnimator for reactive number arrays (values.realArray): all numbers at once, one update per frame.RvgRepeatOptionsclassOptions for Animate.progress.repeat.RvgSetOptionsclassOptions for deferred set animations.RvgShapeAnimatorclassAnimator for reactive Shape values.RvgStringAnimatorclassAnimator for reactive string values.RvgTextDurationModeenumControls how the duration parameter of a text animation is interpreted.RvgTextOptionsclassOptions for string (text) animations.RvgTraceOptionsclassOptions for Animate.shape.trace: which part of the route is visible at the start and at the end.
Core
RVG
Core
MeasureTextFunctiontypeMeasures a text in a font (a CSS font shorthand): its advance width and the font box above and below the alphabetic baseline.RvgClockinterfaceThe animation clock shared by all graphics, available as VisQuill.clock.RvgGraphicinterfaceThe graphic returned by VisQuill.create: its canvas group, frame and center, and ready for the fonts.RvgGroupinterfaceA layer of a graphic: it creates shapes, visuals, texts, values and handles, and moves, turns and scales them together through its anchor.RvgMaskinterfaceThe mask of a group: shapes that decide where the group's content is shown.SvgclassSVG-specific access: the underlying SVG DOM element of a graphic, a group, or a visual (get), and icons drawn from SVG path data (icon).SvgBoxElementtypeType alias for the underlying SVG element used to render box visuals.SvgCircleElementtypeType alias for the underlying SVG element used to render circle visuals.SvgPolygonElementtypeType alias for the underlying SVG element used to render polygon visuals.SvgPolylineElementtypeType alias for the underlying SVG element used to render polyline visuals.SvgSegmentElementtypeType alias for the underlying SVG element used to render segment visuals.SvgTextElementtypeType alias for the underlying SVG element used to render text visuals.VisQuillclassEntry point for creating reactive vector graphics.VisQuillOptionstypeConfiguration options for creating a VisQuill graphics context.
Factories
RvgHandleFactoryinterfaceCreates handles, points the user can drag (see RvgHandle).RvgLabelOptionsclassOptions for labels: label, labelAt and the labelAlong… functions of RvgTextFactory.RvgShapeFactoryinterfaceCreates shapes of a group that are not drawn: the input of computations, or points and outlines to compute with.RvgTextFactoryinterfaceFactory for creating text visual elements that can be positioned along polyline paths or anchored at specific points with customizable styling and orientation.RvgTextSizeclassThe size of a text in a style, from text.measure: its width and how far its font box reaches above and below the anchor.RvgValueFactoryinterfaceFactory for creating observable value containers that automatically propagate changes to dependent computations and visual elements.RvgViewportFactoryinterfaceCreates viewports: a box or circle that shows a part of a larger drawing, optionally panned and zoomed by the user.RvgVisualFactoryinterfaceCreates the drawn shapes of a group: points, polygons, polylines, segments, boxes, circles, arcs, rectangles and triangles.
Viewports
RvgBoxViewportinterfaceA viewport clipped to a box.RvgCircleViewportinterfaceA viewport clipped to a circle.RvgViewportinterfaceA box or circle that shows a part of a larger drawing: content in world coordinates, placed by origin, clipped to the boundary.RvgViewportControllerinterfaceSwitches user panning and zooming of a viewport.ViewportInteractivityOptionsclassThe interactivity of a new viewport; each option left out stays off (zoomFactor: 1.1).
Visuals
RvgAnchoredTextinterfaceA text at a pin: its position and direction place the text, its value is the text.RvgArcinterfaceA drawn arc: created with visuals.arc(…), and a Arc itself.RvgBoxinterfaceA drawn box: created with visuals.box(…), and a Box itself.RvgCircleinterfaceA drawn circle: created with visuals.circle(…), and a Circle itself.RvgHandleinterfaceA point the user can drag with the pointer.RvgPininterfaceA drawn pin: a point with a direction, the base of RvgHandle.RvgPointinterfaceA drawn point, created with visuals.point(…); it is a position (Vector) itself.RvgPolygoninterfaceA drawn polygon: created with visuals.polygon(…), and a Polygon itself.RvgPolygonalVisualinterfaceA drawn shape whose points are joined by straight lines.RvgPolylineinterfaceA drawn polyline: created with visuals.polyline(…), and a Polyline itself.RvgRectangleinterfaceA drawn rectangle: created with visuals.rectangle(…), and a Rectangle itself.RvgSegmentinterfaceA drawn segment: created with visuals.segment(…), and a Segment itself.RvgShapeVisualinterfaceA drawn shape: a visual that is also a Shape, so computations accept it.RvgTextPathinterfaceA text along a polyline.RvgTriangleinterfaceA drawn triangle: created with visuals.triangle(…), and a Triangle itself.RvgVisualinterfaceSomething drawn in a group: a shape visual, a text, a point, a viewport or a group itself.
