Skip to main content
ShapesOptions
Options for a shape library, for use with a Surface or Paper component.
NameTypeDescription
categoryParameter?stringThe property to use to map an object's category (ie which shape set to use). Defaults to "category".
defaultColor?stringOptional default for text color. If not provided, text is set to #000000.
defaultFillColor?stringOptional default for fill color. If not provided, fill is set to #FFFFFF.
defaultOutlineColor?stringOptional default for outline color. If not provided, outline is set to #000000.
font?FontSpecOptional spec for font size/style to apply to all shapes. Shapes that have their own font spec will override this.
labelAttribute?stringThe attribute containing each vertex's label. Defaults to 'label'
labelBackground?boolean | LabelBackgroundOptionsOptions for label background. Use true for defaults, or supply your own values (which will be merged on top of the defaults)
labelFillRatio?numberHow 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?LabelPositionPosition for labels. Defaults to "center".
library?ShapeLibrary<ObjectData>The shape library to use. You must provide either this or sets.
multilineLabels?booleanDefaults 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?ShapeSet | Array<ShapeSet>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?booleanWhether or not to show labels. Defaults to true.
strokeWidth?numberStroke width to use when drawing svg shapes.
tagName?stringThe 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.
typeParameter?stringThe property to use to map an object's type. Defaults to "type".