next | previous | forward | backward | up | top | index | toc | Macaulay2 website
VectorGraphics :: VectorGraphics

VectorGraphics -- A package to produce SVG graphics

Description

VectorGraphics is a package to produce SVG 2d and 3d graphics. All usable types are descendents of the type GraphicsObject, and are self-initializing. Coordinates can be entered as vectors in $\mathbb{R}^2$, $\mathbb{R}^3$ or $\mathbb{R}^4$ ($\mathbb{R}^4$ is projective coordinates); alternatively, one can enter them as arrays. With the default perspective matrix, the x axis points to the right, the y axis points up, and the z axis points towards the viewer. All types are option tables, i.e., their arguments are options. There are two types of options: VectorGraphics options, that are symbols (e.g., Radius for circles); and styling options, which are CSS style options, and which are strings (e.g., "fill" for fill color). VectorGraphics does not use units (coordinates are dimensionless). In Standard mode, the graphical objects are not directly visible; to export them to SVG in order to embed them into a web page, use html. In WebApp mode, the graphical objects are shown as output. There are two auxiliary files. VectorGraphics.css is a set of styling options that is not required, but its default options can be useful for consistency of style. For all dynamical effects (rotating and dragging in 3d, animations), both VectorGraphics.js and VectorGraphics.css are needed.

Author

Version

This documentation describes version 0.97 of VectorGraphics.

Source code

The source code from which this documentation is derived is in the file VectorGraphics.m2. The auxiliary files accompanying it are in the directory VectorGraphics/.

Exports

  • Types
  • Functions and commands
    • arrow -- A marker to add to paths
    • bisector -- Angle bisector of two lines
    • crossing -- Intersection of two lines
    • gList -- Group together VectorGraphics objects
    • gNode -- VectorGraphics object(s) with a preferred reference origin
    • linearGradient -- An SVG gradient
    • place -- Position a point relative to two other points
    • plot -- Draws a curve or surface
    • projection -- Orthogonal projection on a line
    • radialGradient -- An SVG gradient
    • rotation -- Computes a rotation matrix
    • showGraph -- Improved drawing of graphs
    • translation -- Computes a translation matrix
    • viewPort -- ViewPort of view port
  • Methods
    • "bisector(Vector,Vector,Vector)" -- see bisector -- Angle bisector of two lines
    • "crossing(Vector,Vector,Vector,Vector)" -- see crossing -- Intersection of two lines
    • "place(Vector,Vector,Number,Number)" -- see place -- Position a point relative to two other points
    • "projection(Vector,Vector,Vector)" -- see projection -- Orthogonal projection on a line
  • Symbols
    • AnimMatrix -- Create a rotation animation matrix
    • Axes -- An option to draw axes
    • Blur -- An option to blur a VectorGraphics object
    • Draggable -- An option to make a GraphicsObject draggable
    • Margin -- An option to specify the margin
    • OneSided
    • Perspective -- Set the amount of perspective
    • Size -- Set the size of a picture
    • Static -- An option to make a VectorGraphics object unmoving
    • TransformMatrix -- Create a rotation matrix
    • ViewPort -- Fix the view port

For the programmer

The object VectorGraphics is a package.