BasicShape API in JavaScript (ES5) Diagram API control
Defines the behavior of the basic shape
Properties
cornerRadius
number
Sets the corner of the node
Defaults to 0
points
PointModel[]
Defines the collection of points to draw a polygon
Defaults to undefined
shape
BasicShapes
Defines the type of the basic shape
- Rectangle - Sets the type of the basic shape as Rectangle
- Ellipse - Sets the type of the basic shape as Ellipse
- Hexagon - Sets the type of the basic shape as Hexagon
- Parallelogram - Sets the type of the basic shape as Parallelogram
- Triangle - Sets the type of the basic shape as Triangle
- Plus - Sets the type of the basic shape as Plus
- Star - Sets the type of the basic shape as Star
- Pentagon - Sets the type of the basic shape as Pentagon
- Heptagon - Sets the type of the basic shape as Heptagon
- Octagon - Sets the type of the basic shape as Octagon
- Trapezoid - Sets the type of the basic shape as Trapezoid
- Decagon - Sets the type of the basic shape as Decagon
- RightTriangle - Sets the type of the basic shape as RightTriangle
- Cylinder - Sets the type of the basic shape as Cylinder
- Diamond - Sets the type of the basic shape as Diamond
Defaults to ‘Rectangle’
type
Shapes
Defines the type of node shape
let shape: BasicShapeModel = { type: 'Basic', shape: 'Rectangle' };
let nodes: NodeModel[] = [{
id: 'node', width: 100, height: 100, offsetX: 100, offsetY: 100, shape: shape
}];
let diagram: Diagram = new Diagram({
...
nodes : nodes,
...
});
diagram.appendTo('#diagram');
Defaults to ‘Basic’