Palette extends the Diagram class to allow objects to be dragged and placed onto other Diagrams. Its Diagram#layout is a GridLayout. The Palette is Diagram#isReadOnly but to support drag-and-drop its Diagram#allowDragOut is true.
A reference to a DIV in the DOM.
A reference to a DIV by its ID as a string.
Gets or sets whether the user may copy to or paste parts from the internal clipboard.
Gets or sets whether the user may copy objects.
Gets or sets whether the user may delete objects from the Diagram.
Gets or sets whether the user may start a drag-and-drop in this Diagram, possibly dropping in a different element.
Gets or sets whether the user may end a drag-and-drop operation in this Diagram.
Gets or sets whether the user may group parts together.
Gets or sets whether the user is allowed to use the horizontal scrollbar.
Gets or sets whether the user may add parts to the Diagram.
Gets or sets whether the user may draw new links.
Gets or sets whether the user may move objects.
Gets or sets whether the user may reconnect existing links.
Gets or sets whether the user may reshape parts.
Gets or sets whether the user may resize parts.
Gets or sets whether the user may rotate parts.
Gets or sets whether the user may select objects.
Gets or sets whether the user may do in-place text editing.
Gets or sets whether the user may undo or redo any changes.
Gets or sets whether the user may ungroup existing groups.
Gets or sets whether the user is allowed to use the vertical scrollbar.
Gets or sets whether the user may zoom into or out of the Diagram.
Gets or sets the autoScale of the Diagram, controlling whether or not the Diagram's bounds automatically scale to fit the view.
Gets or sets the Margin (or number for a uniform Margin) that describes the Diagram's autoScrollRegion.
Gets or sets the function to execute when the user single-primary-clicks on the background of the Diagram.
Gets or sets the CommandHandler for this Diagram.
Gets or sets the content alignment Spot of this Diagram, to be used in determining how parts are positioned when the #viewportBounds width or height is smaller than the #documentBounds.
Gets or sets the function to execute when the user single-secondary-clicks on the background of the Diagram.
This Adornment is shown when the use context clicks in the background.
Gets or sets the current cursor for the Diagram, overriding the #defaultCursor.
Gets or sets the current tool for this Diagram that handles all input events.
Gets or sets the cursor to be used for the Diagram when no GraphObject specifies a different cursor.
Gets or sets the default tool for this Diagram that becomes the current tool when the current tool stops.
Gets or sets the Diagram's HTMLDivElement, via an HTML Element ID.
Gets the model-coordinate bounds of the Diagram.
Gets or sets the function to execute when the user double-primary-clicks on the background of the Diagram.
Gets or sets the most recent mouse-down InputEvent that occurred.
Gets or sets a fixed bounding rectangle to be returned by #documentBounds and #computeBounds.
Gets or sets a Panel of type Panel#Grid acting as the background grid extending across the whole viewport of this diagram.
Gets or sets the default selection Adornment template, used to adorn selected Groups.
Gets or sets the default Group template used as the archetype for group data that is added to the #model.
Gets or sets a Map mapping template names to Groups.
Gets or sets whether the Diagram has a horizontal Scrollbar.
Gets or sets whether the Diagram has a vertical Scrollbar.
Gets or sets the initialAutoScale of the Diagram.
Gets or sets the initial content alignment Spot of this Diagram, to be used in determining how parts are positioned initially relative to the viewport.
Gets or sets the spot in the document's area that should be coincident with the #initialViewportSpot of the viewport when the document is first initialized.
Gets or sets the initial coordinates of this Diagram in the viewport, eventually setting the #position.
Gets or sets the initial scale of this Diagram in the viewport, eventually setting the #scale.
Gets or sets the spot in the viewport that should be coincident with the #initialDocumentSpot of the document when the document is first initialized.
Gets or sets whether the user may interact with the Diagram.
Gets or sets whether the Diagram's Diagram#model is Model#isReadOnly.
Gets or sets whether this Diagram's state has been modified.
Gets or sets whether mouse events initiated within the Diagram will be captured.
Gets or sets whether the Diagram may be modified by the user, while still allowing the user to scroll, zoom, and select.
Gets or sets whether the Diagram tree structure is defined by links going from the parent node to their children, or vice-versa.
Gets or sets the last InputEvent that occurred.
Gets an iterator for this Diagram's Layers.
Gets or sets the Layout used to position all of the top-level nodes and links in this Diagram.
Gets or sets the default selection Adornment template, used to adorn selected Links.
Gets or sets the default Link template used as the archetype for link data that is added to the #model.
Gets or sets a Map mapping template names to Links.
Returns an iterator of all Links in the Diagram.
Gets or sets the largest value that #scale may take.
Gets or sets the maximum number of selected objects.
Gets or sets the smallest value greater than zero that #scale may take.
Gets or sets the Model holding data corresponding to the data-bound nodes and links of this Diagram.
Gets or sets the function to execute when the user is dragging the selection in the background of the Diagram during a DraggingTool drag-and-drop, not over any GraphObjects.
Gets or sets the function to execute when the user drops the selection in the background of the Diagram at the end of a DraggingTool drag-and-drop, not onto any GraphObjects.
Gets or sets the function to execute when the user holds the mouse stationary in the background of the Diagram while holding down a button, not over any GraphObjects.
Gets or sets the function to execute when the user holds the mouse stationary in the background of the Diagram without holding down any buttons, not over any GraphObjects.
Gets or sets the function to execute when the user moves the mouse in the background of the Diagram without holding down any buttons, not over any GraphObjects.
Gets or sets the default selection Adornment template, used to adorn selected Parts other than Groups or Links.
Gets or sets the default Node template used as the archetype for node data that is added to the #model.
Gets or sets a Map mapping template names to Parts.
Returns an iterator of all Nodes and Groups in the Diagram.
Gets or sets the Margin (or number for a uniform Margin) that describes the Diagram's padding, which controls how much extra space there is around the area occupied by the document.
Returns an iterator of all Parts in the Diagram that are not Nodes or Links or Adornments.
Gets or sets the coordinates of this Diagram in the viewport.
Gets or sets the scale transform of this Diagram.
Gets or sets the distance in screen pixels that the horizontal scrollbar will scroll when scrolling by a line.
Gets or sets the distance in screen pixels that the vertical scrollbar will scroll when scrolling by a line.
Gets the read-only collection of selected objects.
Gets or sets whether ChangedEvents are not recorded by the UndoManager.
Gets the UndoManager for this Diagram, which actually belongs to the #model.
This Adornment is shown when the mouse stays motionless in the background.
Gets the UndoManager for this Diagram, which actually belongs to the #model.
Gets or sets what kinds of graphs this diagram allows the user to draw.
Gets the bounds of the portion of the Diagram that is viewable from its HTML Canvas.
Gets or sets the point, in viewport coordinates, where changes to the #scale will keep the focus in the document.
Adds a Part to the Layer that matches the Part's Part#layerName, or else to the default layer, which is named with the empty string.
any
Register an event handler that is called when there is a ChangedEvent.
a function that takes a ChangedEvent as its argument.
any
Register an event handler that is called when there is a DiagramEvent of a given name.
the name is normally capitalized, but this method uses case-insensitive comparison.
a function that takes a DiagramEvent as its argument.
any
Adds a Layer to the list of layers.
The Layer to add.
any
Adds a layer to the list of layers after a specified layer.
any
Adds a layer to the list of layers before a specified layer.
any
Aligns the Diagram's #position based on a desired document Spot and viewport Spot.
any
Modifies the #position to show a given Rect of the Diagram by centering the viewport on that Rect.
any
Removes all Parts from the Diagram, including unbound Parts and the background grid, and also clears out the Model and UndoManager.
any
Deselect all selected Parts.
any
Commit the changes of the current transaction.
a descriptive name for the transaction.
boolean
This is called during a Diagram update to determine a new value for #documentBounds.
Find the union of the GraphObject#actualBounds of all of the Parts in the given collection.
a collection of Parts.
Updates the diagram immediately, then resets initialization flags so that actions taken in the argument function will be considered part of Diagram initialization, and will participate in initial layouts, #initialAutoScale, #initialContentAlignment, etc.
an optional function of actions to perform as part of another diagram initialization.
any
Finds a layer with a given name.
Look for a Link corresponding to a GraphLinksModel's link data object.
Look for a Node or Group corresponding to a model's node data object.
Look for a Node or Group corresponding to a model's node data object's unique key.
a string or number.
Find the front-most GraphObject at the given point in document coordinates.
A Point in document coordinates.
A function taking a GraphObject and returning a GraphObject, defaulting to the identity.
A function taking the GraphObject returned by navig and returning true if that object should be returned, defaulting to a predicate that always returns true.
Return a collection of the GraphObjects at the given point in document coordinates.
A Point in document coordinates.
A function taking a GraphObject and returning a GraphObject, defaulting to the identity. If this function returns null, the given GraphObject will not be included in the results.
A function taking the GraphObject returned by navig and returning true if that object should be returned, defaulting to a predicate that always returns true.
An optional collection (List or Set) to add the results to.
Returns a collection of all GraphObjects that are inside or that intersect a given Rect in document coordinates.
A Rect in document coordinates.
A function taking a GraphObject and returning a GraphObject, defaulting to the identity. If this function returns null, the given GraphObject will not be included in the results.
A function taking the GraphObject returned by navig and returning true if that object should be returned, defaulting to a predicate that always returns true.
Whether an object can match if it merely intersects the rectangular area (true) or if it must be entirely inside the rectangular area (false). The default value is false.
An optional collection (List or Set) to add the results to.
Returns a collection of all GraphObjects that are within a certain distance of a given point in document coordinates.
A Point in document coordinates.
The distance from the point.
A function taking a GraphObject and returning a GraphObject, defaulting to the identity. If this function returns null, the given GraphObject will not be included in the results.
A function taking the GraphObject returned by navig and returning true if that object should be returned, defaulting to a predicate that always returns true.
Whether an object can match if it merely intersects the circular area (true) or if it must be entirely inside the circular area (false). The default value is true. The default is true.
An optional collection (List or Set) to add the results to.
This convenience function finds the front-most Part that is at a given point and that might be selectable.
a Point in document coordinates.
Whether to only consider parts that are Part#selectable.
Look for a Part, Node, Group, or Link corresponding to a Model's data object.
Look for a Part or Node or Group corresponding to a model's data object's unique key.
a string or number.
Returns an iterator of all Groups that are at top-level, in other words that are not themselves inside other Groups.
Returns an iterator of all top-level Nodes that have no tree parents.
Explicitly bring focus to the Diagram's canvas.
any
Perform all invalid layouts.
If true, this will explicitly set Layout#isValidLayout to false on each Layout in the diagram.
any
Create an HTMLImageElement that contains a bitmap of the current Diagram.
For details see the argument description of #makeImageData.
HTMLImageElement
Create a bitmap of the current Diagram encoded as a base64 string.
string
any
Remove all of the Parts created from model data and then create them again.
any
Removes a Part from its Layer, provided the Layer is in this Diagram.
any
Unregister an event handler listener.
a function that takes a ChangedEvent as its argument.
any
Unregister a DiagramEvent handler.
the name is normally capitalized, but this method uses case-insensitive comparison.
a function that takes a DiagramEvent as its argument.
any
Removes the given layer from the list of layers.
any
any
Rollback the current transaction, undoing any recorded changes.
boolean
Scrolling function used by primarily by #commandHandler's CommandHandler#doKeyDown.
A string representing the unit of the scroll operation. Can be 'pixel', 'line', or 'page'.
The direction of the scroll operation. Can be 'up', 'down', 'left', or 'right'.
An optional distance multiplier, for multiple pixels, lines, or pages. Default is 1.
any
Modifies the #position to show a given Rect of the Diagram by centering the viewport on that Rect.
any
Make the given object the only selected object.
a GraphObject that is already in a layer of this Diagram. If the value is null, this does nothing.
any
Select all of the Parts supplied in the given collection.
a List or Set of Parts to be selected.
any
Begin a transaction, where the changes are held by a Transaction object in the UndoManager.
a descriptive name for the transaction.
boolean
Given a Point in document coordinates, return a new Point in viewport coordinates.
Given a point in viewport coordinates, return a new point in document coordinates.
Update all of the data-bound properties of Nodes and Links in this diagram.
any
Scales the Diagram to uniformly fit into the viewport.
any
Modifies the #scale and #position of the Diagram so that the viewport displays a given document-coordinates rectangle.
rectangular bounds in document coordinates.
an optional value of either #Uniform (the default) or #UniformToFill.
any