ShapeType
Defines a shape type. If you wish to supply custom shape types you should extend this interface.
Properties
collapsedSize?
optionalcollapsedSize:Size
Size for this shape when it is collapsed - only relevant when objectType is Group.
collapsedTemplate?
optionalcollapsedTemplate:string
Template representing the shape when it is collapsed - only relevant when objectType is Group
defaultTarget?
optionaldefaultTarget:boolean
Defaults to true, meaning this will by default be treated as an edge target for drag/drop edges. In some cases you may not want the entire shape to be a target, for instance if its connectivity is to various ports (as an example, consider a logic gate with input pins and an output pin).
description?
optionaldescription:string
Can be shown in a palette to give a user more information about a shape
font?
optionalfont:FontSpec
Optional shape-specific settings for font. This will override library wide font settings.
group?
optionalgroup:string
Optional name of the group to which the shape belongs. This is not the same concept as a "group" inside the data model: this is a grouping of shape types, used to organise them in the UI.
icon?
optionalicon:string
Optional icon to use in the shape palette instead of rendering the template.
initialSize?
optionalinitialSize:Size
Initial size for this specific shape. If not provided defaults will be used.
label?
optionallabel:string
Label to use for the shape type when displayed in a palette
labelPadding?
optionallabelPadding:number
Optional label padding when labels are top/bottom to use for this shape type. The shape library will default to any labelPadding set on the shape set, or the system default.
labelPosition?
optionallabelPosition:LabelPosition
Where to place the label for this type. Most shapes default to center but sometimes you might want to specify where a particular shape's label should be.
locked?
optionallocked:boolean
For groups, indicates that the group is locked and no edits can occur to the child vertices. This is intended for use with the members option, for groups that gather a set of elements together to form a more complex building block. As an example in the real world, consider a Binary Adder: it is a group of logic gates whose relationships are fixed.
members?
optionalmembers:GroupTemplate
Optional blueprint for child vertices and edges to be created when this group is added. Only relevant when objectType is Group.
mergeProperties?
optionalmergeProperties:boolean
If true, instructs the inspector to merge this ShapeType's properties onto any defined by its ShapeSet.
objectType?
optionalobjectType:string
Defaults to Node.objectType. Indicates the object type - Node or Group - to create in the UI when a shape of this type is dragged.
payload?
optionalpayload:ObjectData
Optional initial payload to set on model objects that are dragged from a palette onto the canvas.
previewData?
optionalpreviewData:ObjectData
Optional data to use when showing a preview of this shape - some shapes, such as Labels, will not display anything unless provided with a dataset. This config lets you provide the data that will be used when rendering a preview of the shape, for instance in a palette, or when drawing via the vertex drawing plugin.
properties?
optionalproperties:ShapePropertyDefinition[]
A list of configurable properties exposed by this shape's template. An inspector can read this array to automatically generate an editing UI.
template
template:
string
Template representing the shape
type
type:
string
The shape's type.