Remarks
In consequence, all nodes need to be placed inside a specific restricted area.
This class cannot be instantiated
See Also
Developer's Guide
API
- shapeConstraint, shapeConstraint
Members
Constants
This ShapeConstraint does not restrict the output by any means.
See Also
Static Methods
Creates a ShapeConstraint that confines the layout result to a rectangular area which roughly complies with the given aspect ratio.
The aspect ratio is defined as the ratio between the width and the height of a layout.
- aspect ratio 1: width and height of the layout should be equal
- aspect ratio between 0 and 1: the height of a layout should be greater than its width
- aspect ratio larger than 1: the width of a layout should be greater than its height
The aspect ratio needs to be strictly positive.
Parameters
- ratio: number
- the preferred aspect ratio of the output
Return Value
- ShapeConstraint
- a ShapeConstraint imposing the given aspect ratio on the layout
Throws
- Exception ({ name: 'ArgumentError' })
- if the given aspect ratio is
0or negative
Sample Graphs
5See Also
Creates a ShapeConstraint that confines the layout result to a circle.
The actual restriction circle is defined by the given coordinates and radius.
The radius of the restriction circle needs to be greater than zero.
Parameters
- x: number
- the x-coordinate of the restriction circle's center
- y: number
- the y-coordinate of the restriction circle's center
- radius: number
- the radius of the restriction circle
Return Value
- ShapeConstraint
- the ShapeConstraint confining the layout to a circular area
Throws
- Exception ({ name: 'ArgumentError' })
- if the given radius is less than or equal to zero
Sample Graphs
See Also
Creates a ShapeConstraint that confines the layout result to an elliptical area.
The restriction ellipse is defined by its bounds specified by the given coordinates and size values.
The main axes of the ellipse are parallel to the coordinate axes.
The values for height and width of the ellipse's bounds need to be greater than zero.
Parameters
- x: number
- the x-coordinate of the bounds' upper left corner
- y: number
- the y-coordinate of the bounds' upper left corner
- w: number
- the width of the bounds
- h: number
- the height of the bounds
Return Value
- ShapeConstraint
- the ShapeConstraint confining the layout to an elliptical area
Throws
- Exception ({ name: 'ArgumentError' })
- if the given width or height is
0or negative
Sample Graphs
See Also
Creates a ShapeConstraint that confines the layout to a rectangular area.
This restriction rectangle is defined by the given coordinates and size values.
The values for height and width of the rectangle need to be greater than zero.
Parameters
- x: number
- the x-coordinate of the restriction rectangle's upper-left corner
- y: number
- the y-coordinate of the restriction rectangle's upper-left corner
- w: number
- width of the restriction rectangle
- h: number
- height of the restriction rectangle
Return Value
- ShapeConstraint
- the ShapeConstraint confining the layout to a rectangular area
Throws
- Exception ({ name: 'ArgumentError' })
- if the given width or height is less than or equal to zero