GraphLinksModel$Typings extension

on

Properties

archetypeNodeData Object?
Gets or sets a data object that will be copied and added to the model as a new node data each time there is a link reference (either the "to" or the "from" of a link data) to a node key that does not yet exist in the model.
getter/setter pair
copyLinkDataFunction Object Function(Object, GraphLinksModel)?
Gets or sets a function that makes a copy of a link data object.
getter/setter pair
linkCategoryProperty Object
Gets or sets the name of the data property that returns a string naming that data's category, The value may also be a function taking two arguments, where the first argument will be a link data object. If the second argument is not supplied, the function should return the category name; if the second argument is supplied, the function should modify the link data object so that it has that new category name. The default value is the name 'category', meaning that it expects the data to have a property named 'category' if it cares to name the category for the Link. This is used by the diagram to distinguish between different kinds of links. The name must not be null. If the value is an empty string, #getCategoryForLinkData will return an empty string for all link data objects.
getter/setter pair
linkDataArray Array<Object>
Gets or sets the array of link data objects that correspond to Links in the Diagram. The initial value is an empty Array.
getter/setter pair
linkFromKeyProperty Object
Gets or sets the name of the data property that returns the key of the node data that the link data is coming from. The value may also be a function taking two arguments, where the first argument will be a link data object. If the second argument is not supplied, the function should return the key of the link's source node; if the second argument is supplied, the function should modify the link data object so that it has that new key (which may be undefined to refer to no node) as the identifier to the "from" node. The default value is the name 'from', meaning that it expects the data to have a property named 'from' to refer to the link's source node. The name must not be null. If the value is an empty string, #getFromKeyForLinkData will return undefined for all link data objects.
getter/setter pair
linkFromPortIdProperty Object
Gets or sets the name of the data property that returns the optional parameter naming a "port" element on the node that the link data is connected from. The value may also be a function taking two arguments, where the first argument will be a link data object. If the second argument is not supplied, the function should return the string identifier of the link's source port; if the second argument is supplied, the function should modify the link data object so that it has that string as the identifier to the "from" port. The default value is the empty string indicating that one cannot distinguish different logical connection points for any links. The name must not be null nor the value of #linkFromKeyProperty or #linkToKeyProperty. If the value is an empty string, #getFromPortIdForLinkData will return an empty string for all link data objects.
getter/setter pair
linkKeyProperty Object
Gets or sets the name of the data property that returns a unique id number or string for each link data object. The value may also be a function taking two arguments, where the first argument will be a link data object. If the second argument is not supplied, the function should return the unique string or number key for that link data object; if the second argument is supplied, the function should modify the link data object so that it has that string or number as the unique key for that link. The default value is the empty string, which means the model will not maintain a key property value on link data objects. The name must not be null.
getter/setter pair
linkLabelKeysProperty Object
Gets or sets the name of the data property that returns an array of keys of node data that are labels on that link data. The value may also be a function taking two arguments, where the first argument will be a link data object. If the second argument is not supplied, the function should return the array of label node keys for the link; if the second argument is supplied, the function should modify the link data object so that it holds that Array of node keys as references to label nodes. The default value is the empty string: '', meaning that the model does not support links owning label nodes.
getter/setter pair
linkToKeyProperty Object
Gets or sets the name of the data property that returns the key of the node data that the link data is going to, The value may also be a function taking two arguments, where the first argument will be a link data object. If the second argument is not supplied, the function should return the key of the link's destination node; if the second argument is supplied, the function should modify the link data object so that it has that new key (which may be undefined to refer to no node) as the identifier to the "to" node. The default value is the name 'to', meaning that it expects the data to have a property named 'to' to refer to the link's destination node. The name must not be null. If the value is an empty string, #getToKeyForLinkData will return undefined for all link data objects.
getter/setter pair
linkToPortIdProperty Object
Gets or sets the name of the data property that returns the optional parameter naming a "port" element on the node that the link data is connected to. The value may also be a function taking two arguments, where the first argument will be a link data object. If the second argument is not supplied, the function should return the string identifier of the link's destination port; if the second argument is supplied, the function should modify the link data object so that it has that string as the identifier to the "to" port. The default value is the empty string indicating that one cannot distinguish different logical connection points for any links. The name must not be null nor the value of #linkFromKeyProperty or #linkToKeyProperty. If the value is an empty string, #getToPortIdForLinkData will return an empty string for all link data objects.
getter/setter pair
makeUniqueLinkKeyFunction ↔ dynamic Function(GraphLinksModel, Object)?
Gets or sets a function that returns a unique id number or string for a link data object. This function is called by #makeLinkDataKeyUnique when a link data object is added to the model, either as part of a new #linkDataArray or by a call to #addLinkData, to make sure the value of #getKeyForLinkData is unique within the model. However it will not be called when #linkKeyProperty is the default value, an empty string.
getter/setter pair
nodeGroupKeyProperty Object
Gets or sets the name of the property on node data that specifies the string or number key of the group data that "owns" that node data. The value may also be a function taking two arguments, where the first argument will be a node data object. If the second argument is not supplied, the function should return the string or number key for the group data object of which the given data object is a member; if the second argument is supplied, the function should modify the node data object so that it has that new key (which may be undefined to refer to no node) as the containing group key for that node. The default value is the name 'group', meaning that it expects the data to have a property named 'group' to refer to any containing group.
getter/setter pair
nodeIsGroupProperty Object
Gets or sets the name of the boolean property on node data that indicates whether the data should be represented as a group of nodes and links or as a simple node. The value may also be a function taking two arguments, where the first argument will be a node data object. If the second argument is not supplied, the function should return true if the node data object should be represented by a Group and false otherwise. At the current time the function will not be called to change whether the node is a group or not. The default value is the name 'isGroup', meaning that it expects the data to have a property named 'isGroup' on those node data objects that should be represented by Groups.
getter/setter pair

Methods

addLabelKeyForLinkData(Object linkdata, dynamic key) → void
Adds a node key value that identifies a node data acting as a new label node on the given link data.
addLinkData(Object linkdata) → void
When you want to add a link to the diagram, call this method with a new data object. This will add that data to the #linkDataArray and notify all listeners that a new link data object has been inserted into the collection.
addLinkDataCollection(Object coll) → void
Add to this model all of the link data held in an Array or in an Iterable of link data objects. @param {Iterable.
assignAllDataProperties(Object data, Object props) → void
This override is similar to Object.assign, but safely calls #setDataProperty for each property other than a key property. @param data a data object @param props an Object holding various properties whose values are to be assigned to the DATA object
containsLinkData(Object linkdata) bool
Decide if a given link data object is in this model, using reference equality.
copyLinkData(Object linkdata) Object
Make a copy of a link data object. This uses the value of #copyLinkDataFunction to actually perform the copy, unless it is null, in which case this method just makes a shallow copy of the JavaScript Object.
copyNodeData(Object nodedata) Object?
This override also makes sure any copied node data does not have a reference to the containing group. @expose @param {ObjectData} nodedata a JavaScript object represented by a node, group, or non-link. @return {ObjectData} @see Model#copyNodeData
findLinkDataForKey(dynamic key) Object?
Given a number or string, find the link data object in this model that uses the given value as its unique key.
getCategoryForLinkData(Object linkdata) String
Find the category of a given link data, a string naming the link template that the Diagram should use to represent the link data. @param {ObjectData} linkdata a JavaScript object represented by a link. @return {string} @see #linkCategoryProperty @see #setCategoryForLinkData
getFromKeyForLinkData(Object linkdata) → dynamic
From a link data retrieve a value uniquely identifying the node data from which this link is connected. @param {ObjectData} linkdata a JavaScript object represented by a link. @return {string|number|undefined} This may return undefined if the link is not coming from any node. @see #linkFromKeyProperty @see #setFromKeyForLinkData
getFromPortIdForLinkData(Object linkdata) String
From a link data retrieve a value identifying the port object of the node from which this link is connected. @param {ObjectData} linkdata a JavaScript object represented by a link. @return {string} This may return the empty string if there is no particular port parameter information. @see #linkFromPortIdProperty @see #setFromPortIdForLinkData
getGroupKeyForNodeData(Object nodedata) → dynamic
If there is a container group for the given node data, return the group's key. @param {ObjectData} nodedata a JavaScript object represented by a node, group, or non-link. @return {string|number|undefined} This returns undefined if there is no containing group data. @see #nodeGroupKeyProperty @see #setGroupKeyForNodeData
getKeyForLinkData(Object linkdata) → dynamic
Given a link data object return its unique key: a number or a string. This returns undefined if there is no key value. Unless #linkKeyProperty is set to a non-empty string, this model will not automatically assign unique key values for link data objects.
getLabelKeysForLinkData(Object linkdata) Array
Gets an Array of node key values that identify node data acting as labels on the given link data.
getToKeyForLinkData(Object linkdata) → dynamic
From a link data retrieve a value uniquely identifying the node data to which this link is connected. @param {ObjectData} linkdata a JavaScript object represented by a link. @return {string|number|undefined} This may return undefined if the link is not going to any node. @see #linkToKeyProperty @see #setToKeyForLinkData
getToPortIdForLinkData(Object linkdata) String
From a link data retrieve a value identifying the port object of the node to which this link is connected. @param {ObjectData} linkdata a JavaScript object represented by a link. @return {string} This may return the empty string if there is no particular port parameter information. @see #linkToPortIdProperty @see #setToPortIdForLinkData
isGroupForNodeData(Object nodedata) bool
See if the given node data should be represented as a group or as a simple node.
makeLinkDataKeyUnique(Object linkdata) → void
This method is called when a link data object is added to the model to make sure that #getKeyForLinkData returns a unique key value.
mergeLinkDataArray(Array<Object> arr) → void
Take an Array of link data objects and update #linkDataArray without replacing the Array and without replacing any existing link data objects that are identified by key. This depends on #linkKeyProperty being a non-empty string.
removeLabelKeyForLinkData(Object linkdata, dynamic key) → void
Removes a node key value that identifies a node data acting as a former label node on the given link data.
removeLinkData(Object linkdata) → void
When you want to remove a link from the diagram, call this method with an existing link data object. This will remove that data object from the #linkDataArray and notify all listeners that a link data object has been removed from the collection.
removeLinkDataCollection(Object coll) → void
Remove from this model all of the link data held in an Array or in an Iterable of link data objects. @param {Iterable.
setCategoryForLinkData(Object linkdata, String cat) → void
Change the category of a given link data, a string naming the link template that the Diagram should use to represent the link data.
setDataProperty(Object data, String propname, [dynamic val]) → void
This override changes the value of some property of a node data, a link data, or an item data, given a string naming the property and the new value, in a manner that can be undone/redone and that automatically updates any bindings. This override handles link data as well as node data.
setFromKeyForLinkData(Object linkdata, dynamic key) → void
Change the node key that the given link data references as the source of the link. @param {ObjectData} linkdata a JavaScript object represented by a link. @param {string|number|undefined} key This may be undefined if the link should no longer come from any node. @see #linkFromKeyProperty @see #getFromKeyForLinkData
setFromPortIdForLinkData(Object linkdata, String portname) → void
Change the information that the given link data uses to identify the particular "port" that the link is coming from. @param {ObjectData} linkdata a JavaScript object represented by a link. @param {string} portname This may be the empty string if the link should no longer be associated with any particular "port". @see #linkFromPortIdProperty @see #getFromPortIdForLinkData
setGroupKeyForNodeData(Object nodedata, dynamic key) → void
Change the container group for the given node data, given a key for the new group. @param {ObjectData} nodedata a JavaScript object represented by a node, group, or non-link. @param {string|number|undefined} key This may be undefined if there should be no containing group data. @see #nodeGroupKeyProperty @see #getGroupKeyForNodeData
setKeyForLinkData(Object linkdata, dynamic key) → void
Change the unique key of a given link data that is already in this model. The new key value must be unique -- i.e. not in use by another link data object. You can call #findLinkDataForKey to check if a proposed new key is already in use.
setLabelKeysForLinkData(Object linkdata, Array arr) → void
Replaces an Array of node key values that identify node data acting as labels on the given link data.
setToKeyForLinkData(Object linkdata, dynamic key) → void
Change the node key that the given link data references as the destination of the link. @param {ObjectData} linkdata a JavaScript object represented by a link. @param {string|number|undefined} key This may be undefined if the link should no longer go to any node. @see #linkToKeyProperty @see #getToKeyForLinkData
setToPortIdForLinkData(Object linkdata, String portname) → void
Change the information that the given link data uses to identify the particular "port" that the link is going to. @param {ObjectData} linkdata a JavaScript object represented by a link. @param {string} portname This may be the empty string if the link should no longer be associated with any particular "port". @see #linkToPortIdProperty @see #getToPortIdForLinkData