use()

Produces an SVG "use" element.

Syntax

use(
   name STRING,
   x STRING,
   y STRING )
  RETURNS om.DomNode
  1. name is the xlink:href reference (without #).
  2. x defines the X coordinate to place the shape.
  3. y defines the Y coordinate to place the shape.

Usage

This function creates a "use" SVG DOM element from the parameters.

The "use" element can reuse an SVG shape from elsewhere in the SVG document, for example to make several copies of shapes defined in the "defs" element.

Example

DEFINE n1, n2 om.DomNode
LET n1 = fglsvgcanvas.use( "myshape1", 100, 100 )
LET n2 = fglsvgcanvas.use( "myshape1", 110, 110 )