qtype_ddmarker/shapes

Library of classes for handling simple shapes.

These classes can represent shapes, let you alter them, can go to and from a string representation, and can give you an SVG representation.

Source:
License:
  • http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Classes

Circle
NullShape
Point
Polygon
Rectangle
Shape

Members

(inner) createSvgElement

Source:

Make a new SVG DOM element as a child of svg.

Methods

(inner) getSimilar(shapeType, shape) → {Shape}

Source:

Make a shape of the given type that is similar to the shape of the original type.

Parameters:
Name Type Description
shapeType String

the new type of shape to make

shape Shape

the shape to copy

Returns:

the similar shape of a different type.

Type
Shape

(inner) make(shapeType, label) → {Shape}

Source:

Make a shape of the given type.

Parameters:
Name Type Description
shapeType String
label String
Returns:

the requested shape.

Type
Shape