ShapesOptions
Options for a shape library, for use with a Surface or Paper component.
Properties
categoryParameter?
optionalcategoryParameter:string
The property to use to map an object's category (ie which shape set to use). Defaults to "category".
defaultColor?
optionaldefaultColor:string
Optional default for text color. If not provided, text is set to #000000.
defaultFillColor?
optionaldefaultFillColor:string
Optional default for fill color. If not provided, fill is set to #FFFFFF.
defaultOutlineColor?
optionaldefaultOutlineColor:string
Optional default for outline color. If not provided, outline is set to #000000.
font?
optionalfont:FontSpec
Optional spec for font size/style to apply to all shapes. Shapes that have their own font spec will override this.
labelAttribute?
optionallabelAttribute:string
The attribute containing each vertex's label. Defaults to 'label'
labelBackground?
optionallabelBackground:boolean|LabelBackgroundOptions
Options for label background. Use true for defaults, or supply your own values (which will be merged on top of the defaults)
labelFillRatio?
optionallabelFillRatio:number
How much of the width of a shape a multiline label will take up before wrapping. Defaults to 0.8. You can set this to a number greater than 1, if you like, but that will allow the label to overflow.
labelPosition?
optionallabelPosition:LabelPosition
Position for labels. Defaults to "center".
library?
optionallibrary:ShapeLibrary<ObjectData>
The shape library to use. You must provide either this or sets.
multilineLabels?
optionalmultilineLabels:boolean
Defaults to true - labels are split across multiple lines to fit inside their shape. Set this to false if you want labels to always be a single line.
sets?
List of shape sets - or a single set - to support. Provide this or library. If you provide library and this, library will take precedence.
showLabels?
optionalshowLabels:boolean
Whether or not to show labels. Defaults to true.
strokeWidth?
optionalstrokeWidth:number
Stroke width to use when drawing svg shapes.
tagName?
optionaltagName:string
The name of the tag to make available to node/group renderers. Defaults to vjs-shape. Only used with certain advanced usages of Vanilla VisuallyJs. If you're using an integration there's a dedicated shape component you will use instead.
Advanced
typeParameter?
optionaltypeParameter:string
The property to use to map an object's type. Defaults to "type".