A collection of frequently used commands that will be added around the selector
<div id='diagram'></div>
let nodes: NodeModel[] = [{
id: 'node1', width: 100, height: 100, offsetX: 100, offsetY: 100,
annotations: [{ content: 'Default Shape' }]
},
{
id: 'node2', width: 100, height: 100, offsetX: 300, offsetY: 100,
shape: {
type: 'Basic', shape: 'Ellipse'
},
annotations: [{ content: 'Path Element' }]
}
];
let connectors: ConnectorModel[] = [{
id: 'connector1',
type: 'Straight',
sourcePoint: { x: 100, y: 300 },
targetPoint: { x: 200, y: 400 },
}];
let handle: UserHandleModel[] = [
{ name: 'handle', margin: { top: 0, bottom: 0, left: 0, right: 0 }, offset: 0,
pathData: 'M 376.892,225.284L 371.279,211.95L 376.892,198.617L 350.225,211.95L 376.892,225.284 Z',
side: 'Top', horizontalAlignment: 'Center', verticalAlignment: 'Center',
pathColor: 'yellow' }];
let diagram: Diagram = new Diagram({
...
connectors: connectors, nodes: nodes,
selectedItems: { constraints: SelectorConstraints.All, userHandles: handle },
...
});
diagram.appendTo('#diagram');
string
Defines the background color of user Handle
Defaults to ‘black’
string
Defines the borderColor of user Handle
Defaults to ”
number
Defines the borderWidth of user Handle
Defaults to 0.5
string
Defines the custom content of the user handle
Defaults to ”
boolean
Defines the visible of user Handle
Defaults to false
boolean
Defines the visible of user Handle
Defaults to false
number
Defines the displacement of user Handle
Defaults to 10
string
Defines the horizontal alignment of the user handle
Defaults to ‘Center’
Defines the margin of the user handle
Defaults to new Margin(0,0,0,0)
string
Defines the name of user Handle
Defaults to ”
number
Defines the offset of user Handle
Defaults to 0
string
Defines the path color of user Handle
Defaults to ‘white’
string
Defines the path data of user Handle
Defaults to ”
string
Defines the position of user Handle
Defaults to ‘Top’
number
Defines the size of user Handle
Defaults to 25
string
Defines the image source of the user handle
Defaults to ”
Used to show tooltip for user handle on mouse over.
Defaults to {}
string
Defines the vertical alignment of the user handle
Defaults to ‘Center’
boolean
Defines the visible of user Handle
Defaults to true