qtype_ddmarker/shapes

Description:
  • 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

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.

Classes

Circle
NullShape
Point
Polygon
Rectangle
Shape

Members

(inner) createSvgElement

Description:
  • Make a new SVG DOM element as a child of svg.

Source:

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

Methods

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

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

Source:
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}

Description:
  • Make a shape of the given type.

Source:
Parameters:
Name Type Description
shapeType String
label String
Returns:

the requested shape.

Type
Shape