DiagramOptions
Options for a diagram.
| Name | Type | Description |
|---|---|---|
| allowMultipleSelections? | boolean | Defaults to true - whether or not to allow multiple objects to be selected at the same time via shift+click. |
| allowRotation? | boolean | Whether or not to allow rotation of elements being dragged from the palette. Defaults to true. |
| autoPan? | boolean | Defaults to true, meaning the canvas will pan automatically to track elements that have been dragged out of the visible area. |
| beforeConnect? | BeforeConnectInterceptor | Definition of a function to use as a beforeConnect interceptor. |
| beforeStartConnect? | EdgeDataGenerator | This method is invoked when a user begins to drag a new edge. It is given the vertex the drag is starting from, and any derived type for the edge being dragged. This method can be used for two purposes: firstly, if you return false, the drag will be aborted. Secondly, if you return a data object from this method, that object will be used as the edge's backing data. So a common usage is to use this method to set properties that will define an edge's initial appearance. |
| cells? | {
clonable:boolean, defaultHeight:number, defaultWidth:number, deletable:boolean, draggable:boolean, editable:boolean, events:NodeEventOptions<any>, font:FontSpec, getCollapsedGroupSize:(g:Group, currentSize:Size) => Size, groups:DiagramGroupMapping, heightProperty:string, labelBackground:boolean | LabelBackgroundOptions, labelFillRatio:number, labelPosition:LabelPosition, labelProperty:string, leftProperty:string, linkable:boolean, magnetizer:MagnetizeOptions, multilineLabels:boolean, nodes:DiagramNodeMapping, outlineWidth:number, resizable:boolean, resize:{ bordersVisible:boolean, handlerFactory:ResizingToolsHandlerFactory, handleShape:"circle" | "rectangle", handleSize:number, ignoreGrid:boolean, method:ResizingToolsResizeMethod, modelUpdater:ResizingToolsModelUpdater, resizeX:boolean, resizeY:boolean }, rotatable:boolean, rotationProperty:string, rotationStops:number, shouldDeleteGroupMembers:(g:Group, el:BrowserElement) => boolean, showLabels:boolean, templateEvents:DiagramCellTemplateEvents, topProperty:string, widthProperty:string } | Options for cells. |
| defaultColor? | string | Defaults to #000000 |
| defaultFillColor? | string | Defaults to #FFFFFF |
| defaultOutlineColor? | string | Defaults to #000000 |
| defaultOutlineWidth? | number | Defaults to 2px |
| defaults? | UICoreDefaults | Defaults for connector/anchors etc |
| deselectOnCanvasTap? | boolean | Defaults to true - deselect any currently selected shapes when the user taps on canvas whitespace. |
| dragGroups? | DragGroupsPluginOptions | Options for drag groups. |
| editable? | boolean | Defaults to true, meaning the user can edit the diagram. |
| graphPropagation? | GraphPropagationEnginePluginOptions<any> | If provided, a graph propagation engine will be used to propagate changes to the graph. |
| grid? | DiagramGridOptions | Options for a grid for the diagram. |
| lasso? | boolean | LassoPluginOptions | Options for lasso, or just a boolean instructing the diagram to attach a lasso with default options, if true. If no value is set for this, the diagram will not have a lasso attached. |
| lineCrossings? | boolean | LineCrossingsPluginOptions | Controls whether line crossings are shown by a visual cue. Defaults to false. You can either supply a boolean and have the panbuttons plugin initialize with its default settings, or supply your own settings. |
| mediator? | DiagramActionMediator | Defines an object that can decide at runtime whether a given shape should offer various actions in its shape editing tools. Defaults to null. |
| miniview? | MiniviewPluginOptions | Options for a miniview |
| pan? | PanOptions | Options to control how a user pans the canvas. |
| panButtons? | boolean | PanButtonsPluginOptions | Controls whether pan buttons are displayed at the edges of the canvas, defaults to false. You can either supply a boolean and have the panbuttons plugin initialize with its default settings, or supply your own settings. |
| rotationSpeed? | number | The number of milliseconds required to complete a full rotation of an element when the trigger key is held down. Defaults to 2000. |
| selectShapeOnTap? | boolean | Defaults to true - select a shape/edge if the user taps on it. This is valid also when the diagram is read only. |
| shapes? | ShapeSet | Array<ShapeSet> | Which shape sets to make available to this diagram. |
| snapLines? | boolean | SnaplinesPluginOptions | Controls whether snaplines are displayed, defaults to false. You can either supply a boolean and have the snaplines plugin initialize with its default settings, or supply your own settings. |
| wheel? | WheelOptions | Options for the behaviour of the mousewheel (which also covers two finger scrolling on a mac trackpad) |
| zoom? | ZoomOptions | Options to control how a user manages zoom on the canvas. |
| zoomToFit? | boolean | If true, zoom the display so that the dataset is entirely visible after initialisation. |
| zoomToFitIfNecessary? | boolean | If true, zoom the display so that the dataset is entirely visible after initialisation, but only adjust the zoom level if the dataset is not already visible at the default zoom level. |