polygon()

Produces a SVG "polygon" element.

Syntax

polygon(
   points STRING )
  RETURNS om.DomNode
  1. points is a STRING defining the points of the polygon.

Usage

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

The points is a string containing a list of X,Y coordinates to draw the shape, in the form "x1,y1 x2,y2 ...".

Example

DEFINE n om.DomNode
LET n = fglsvgcanvas.polygon("10,10 10,20 20,20")
CALL n.setAttribute(SVGATT_STYLE, "stroke:#660000; fill:#cc3333;")