- I
- I
Members
Constructors
Creates a new instance using the specified path.
Parameters
- path?: GeneralPath
- The path that defines the boundary of this style. The path must be defined in such a way that the point (0,0) represents the top left of a node's layout and the point (1,1) the lower right. The path will be scaled accordingly to the node's size. If not specified, a simple rectangular path is used.
Properties
If this value is positive and finite, the path will be scaled to the largest rectangle that a) has a width-to-height ratio that matches this value and b) fits into the node's size. Otherwise, the path is scaled to the node's size (and aspect ratio) without further restrictions.
The default value is 0. That is, path is scaled to the node's size (and aspect ratio).
See Also
Developer's Guide
The default value is an empty string, in which case no class is set for the visualization.
Multiple classes can be set by separating them with spaces, just like with the SVG class attribute.
Get or sets the path that defines the boundary of the shape.
The path must be defined in such a way that the point (0,0) represents the top left of a node's layout and the point (1,1) the lower right. The path will be scaled accordingly to the node's size.
The default is a rectangular path.
See Also
Developer's Guide
Gets the renderer implementation that can be queried for implementations that provide details about the visual appearance and visual behavior for a given node and this style instance.
const creator = style.renderer.getVisualCreator(node, style)
const visual = creator.createVisual(context)Implements
INodeStyle.rendererMethods
Create a clone of this object.
Static Methods
Creates a new GeneralPathNodeStyle instance for a copy of the given path.
Parameters
- path: GeneralPath
- The path that defines the outline of a node's visualization. The width and height of its bounds have to be positive and finite.
Return Value
- GeneralPathNodeStyle
- A GeneralPathNodeStyle instance using the path and its aspect ratio.
Throws
- Exception ({ name: 'ArgumentError' })
- If the width or height of the given path's bounds is not positive and finite.
createPolygonPath
(pointCount: numberrotationAngle?: numberstretchToHeight?: booleanstretchToWidth?: boolean): GeneralPathstaticCreates a GeneralPath in the form of a polygon.
createPolygonPath
(Parameters
- pointCount: number
- The number of corners of the polygon. For odd numbers, the first corner points to the top.
- rotationAngle?: number
- The rotation angle of the polygon. The angle is specified in radians, measured clockwise.
- stretchToHeight?: boolean
- Whether to stretch the path to the full bounding box height.
- stretchToWidth?: boolean
- Whether to stretch the path to the full bounding box width.
Return Value
- GeneralPath
- The polygonal GeneralPath.
createStarPath
(pointCount: numberratio: numberrotationAngle?: numberstretchToHeight?: booleanstretchToWidth?: boolean): GeneralPathstaticCreates a GeneralPath in the form of a star.
createStarPath
(Parameters
- pointCount: number
- The number of points of the star. For odd numbers, the first corner points to the top.
- ratio: number
- The ratio between the inner and outer points radius. The ratio should be a positive number smaller or equal to 1. For values > 1, the reciprocal is used.
- rotationAngle?: number
- The rotation angle of the star. The angle is specified in radians, measured clockwise.
- stretchToHeight?: boolean
- Whether to stretch the path to the full bounding box height.
- stretchToWidth?: boolean
- Whether to stretch the path to the full bounding box width.
Return Value
- GeneralPath
- A star-shaped GeneralPath.