An alternative GraphModelManager implementation that supports WebGL2 for rendering and animating the graph's nodes, edges, and labels.
Remarks
This implementation offers a limited range of visualization customizations but allows for rendering very large graph instances at high frame rates. While we do recommend the standard rendering approach and the default GraphModelManager implementation for the majority of cases, if you must display several thousands or millions of elements on the screen, this implementation will help you keep the performance at highest levels.
To use this feature, create an instance of this class and set it to the graphModelManager property. Note that not all features of IGraph are supported by this implementation. Most notably, IPortStyles will not be considered and thus ports will not be rendered, and graphs with edges at edges cannot be used.
This implementation uses a single canvas object for the rendering of the graph items. Nevertheless, the rendering order (z-ordering) of the graph item types is defined by the ordering of their corresponding canvas object groups, and can be changed by reordering these groups (groupNodeGroup, edgeGroup, nodeGroup, edgeLabelGroup, and nodeLabelGroup). The values of the HierarchicalNestingPolicy and LabelLayerPolicy properties have no effect.
While the default renderMode is WEBGL, it may be switched to SVG. As soon as this property is set the first time, this WebGLGraphModelManager is prepared for SVG as well as WebGL rendering. This allows to switch fast and mostly seamless between both rendering modes.
Type Details
- yFiles module
- view
See Also
Constructors
Creates a new instance of the WebGLGraphModelManager class.
Remarks
In contrast to the base class, this constructor does not have any parameters. The instance will be configured when it is set to a graphModelManager property. This will trigger configuration automatically via the install method. If you are not using this class via the property, call the life-cycle methods, manually.
When the RenderMode option argument is used, this WebGLGraphModelManager is prepared for Svg as well as WebGL rendering, so switching between those modes will be smoother.
Parameters
A map of options to pass to the method.
- renderMode - WebGLGraphModelManagerRenderMode
- The technology used to render the graph elements. This option sets the renderMode property on the created object.
See Also
Properties
Gets the currently installed in CanvasComponent.
Remarks
null
when not currently installed.See Also
Defined in
Gets the IRenderTreeGroup instance that will be used for installing edge styles.
Remarks
If the field has not yet been initialized upon first access, the factory method createEdgeGroup will be called.
Note that in the case of hierarchically nested graphs, the main render tree elements of edges will only be put directly in this IRenderTreeGroup, if the property is not set to NODES_AND_EDGES. Otherwise, they will actually be nested in the subtree of the nodeGroup according to the node nesting.
See Also
Defined in
Gets the IRenderTreeGroup instance that will be used for installing edge label styles.
Remarks
See Also
Defined in
Gets or sets the policy to determine at which visual layer edge labels shall be inserted.
Provides access to the ItemModelManager<T> which handles the ILabels at edges.
Gets or sets the IObjectRenderer<ILabel> instance used for installing an ILabel of an IEdge into the canvas.
Defined in
Provides access to the ItemModelManager<T> which handles the IEdges.
Gets or sets the IObjectRenderer<IEdge> instance used for installing an IEdge into the canvas.
Defined in
Gets or sets the graph this manager manages.
Gets the IRenderTreeGroup instance that will be used for installing node styles of group nodes.
Remarks
See Also
Defined in
Gets or sets the policy whether and how this instance should nest the nodes and edges if the graph is grouped.
Gets a IHitTester that can be used to enumerate hits on the canvas at a given world coordinate position.
Remarks
Defined in
Gets the IRenderTreeGroup instance that will be used for installing node styles.
Remarks
If the field has not yet been initialized upon first access, the factory method createNodeGroup will be called.
Note that the content of this group depends on the hierarchicalNestingPolicy:
- NONE – Contains the main render tree elements of all nodes top-level.
- NODES – Contains the main render tree elements of all nodes in a more complicated nesting of dynamically created IRenderTreeGroups.
- NODES_AND_EDGES – Contains the main render tree elements of all nodes and edges in a more complicated nesting of dynamically created IRenderTreeGroup s.
- GROUP_NODES – Contains the main render tree elements of all leaf nodes. Group nodes having the same hierarchical depth are in one child IRenderTreeGroup of the groupNodeGroup instead.
See Also
Defined in
Gets the IRenderTreeGroup instance that will be used for installing node label styles.
Remarks
See Also
Defined in
Gets or sets the policy to determine at which visual layer node labels shall be inserted.
Provides access to the ItemModelManager<T> which handles the ILabels at nodes.
Gets or sets the IObjectRenderer<ILabel> instance used for installing an ILabel of an INode into the canvas.
Defined in
Provides access to the ItemModelManager<T> which handles the INodes.
Gets or sets the IObjectRenderer<INode> instance used for installing an INode into the canvas.
Defined in
Gets the IRenderTreeGroup instance that will be used for installing port styles.
Remarks
See Also
Defined in
Gets the IRenderTreeGroup instance that will be used for installing port label styles.
Remarks
See Also
Defined in
Gets or sets the policy to determine at which visual layer port labels shall be inserted.
Provides access to the ItemModelManager<T> which handles the ILabels at ports.
Gets or sets the IObjectRenderer<ILabel> instance used for installing an ILabel of an IPort into the canvas.
Defined in
Gets or sets the policy to determine at which visual layer node and edge ports shall be inserted.
Provides access to the ItemModelManager<T> which handles the IPorts.
Gets or sets the IObjectRenderer<IPort> instance used for installing an IPort into the canvas.
Defined in
Gets or sets if the tag should be provided by its main render tree element.
Remarks
The tag is already provided by the render tree element visualizing the model item. As this render tree element may differ from the main render tree element, this property determines only if the tag is provided by its main render tree element if it differs from getRenderTreeElement.
The default value is false
.
Defined in
Gets or sets the technology used to render the graph elements.
Remarks
As soon as this property is set the first time, this WebGLGraphModelManager is prepared for SVG as well as WebGL rendering, so switching between those modes will be smoother.
The default value is WEBGL.
Gets an comparison instance that can be used to compare two model items with respect to their visual display order.
Remarks
Signature Details
function(x: IModelItem, y: IModelItem) : number
Parameters
- x - IModelItem
- The first object to compare.
- y - IModelItem
- The second object to compare.
Returns
- number
- An integer value which is
<0
ifx
is less thany
,0
ifx
is equal toy
, or>0
ifx
is greater thany
Defined in
Methods
Compares two items with respect to their rendering order.
Parameters
A map of options to pass to the method.
- item1 - IModelItem
- the first item to compare
- item2 - IModelItem
- the second item to compare
Returns
- ↪number
- 0 if item1 == item2, > 0 if item1 is rendered behind item2, < 0 if item1 is rendered in front of item2. Items that are not part of the visualization are always considered to be rendered first.
See Also
Defined in
Creates an animation that animates the height of a WebGLArcEdgeStyle and WebGLBridgeEdgeStyle.
Remarks
The default height animation starts each iteration with a straight line and then increases the height of the arc or bridge until the original height is reached.
Animations should be shared and un-assigned when not in use as the maximum number of assigned animations is limited to 15 per type of element. There can be only 8 animations assigned to one element at the same time and only 31 different combinations of animations may be assigned to the items.
Parameters
A map of options to pass to the method.
- timing - WebGLAnimationTiming
- Specifies the timing function to use for the animation. Defaults to "1s linear 1 normal". The animation will loop once for one second with a linear progress in normal direction.
Returns
- ↪WebGLAnimation
- An animation to assign to edges.
See Also
createBeaconAnimation
(type?: WebGLBeaconAnimationType, color?: Color, pulseWidth?: number, pulseCount?: number, pulseDistance?: number, magnitude?: number, smooth?: boolean, useViewCoordinates?: boolean, timing?: WebGLAnimationTiming) : WebGLAnimationCreates a beacon effect around nodes and edges.
Remarks
Concentric rings around the outline of the node will move outwards away from the node to a given distance. Both the color, the size, the number, the distance between rings, and the duration, as well the number of iterations can be specified. Also whether rings should fade can be determined and in which direction the animation should be played.
Only one beacon or halo animation per element is shown at the same time.
Animations should be shared and un-assigned when not in use as the maximum number of assigned animations is limited to 15 per type of element. There can be only 8 animations assigned to one element at the same time and only 31 different combinations of animations may be assigned to the items.
Parameters
A map of options to pass to the method.
- type - WebGLBeaconAnimationType
- The type of beacon to apply. Defaults to FADE.
- color - Color
- The color of the beacon. Defaults to black if not specified.
- pulseWidth - number
- The thickness of a single beacon pulse. Defaults to 4 pixels.
- pulseCount - number
- How many beacon pulses should be simultaneously visible. Defaults to 1.
- pulseDistance - number
- The distance between multiple beacon pulses. Defaults to 20 pixels.
- magnitude - number
- The distance the beacon extends to. Defaults to 50.
- smooth - boolean
- Whether to draw each pulse smoothly or with hard edges. Defaults to
true
. - useViewCoordinates - boolean
- Whether to render the effect in view coordinates, invariant of the zoom level. Defaults to
false
. - timing - WebGLAnimationTiming
- Specifies the timing function to use for the animation. Defaults to "1s linear 1 normal". The animation will loop once for one second with a linear progress in normal direction.
Returns
- ↪WebGLAnimation
- An animation to assign to nodes
See Also
Creates an animation that animates the dash pattern of a WebGLPolylineEdgeStyle, WebGLArcEdgeStyle, and WebGLBridgeEdgeStyle.
Remarks
Parameters
A map of options to pass to the method.
- extent - number
- The extent of the animation in dash lengths. Defaults to 1.
- timing - WebGLAnimationTiming
- Specifies the timing function to use for the animation. Defaults to "1s linear 1 normal". The animation will loop once for one second with a linear progress in normal direction.
Returns
- ↪WebGLAnimation
- An animation to assign to edges.
See Also
Factory method for the edgeGroup property.
Remarks
Returns
- ↪IRenderTreeGroup
- a new group that has been added to the contentGroup
Defined in
Factory method for the edgeLabelGroup property.
Remarks
Returns
- ↪IRenderTreeGroup
- a new group that has been added to the contentGroup
Defined in
createEdgeLabelModelManager
(renderer: IObjectRenderer<ILabel>, callback: function(ILabel):IRenderTreeGroup) : ItemModelManager<ILabel>Factory method for creating the ItemModelManager<T> that handles the visual representation of edge labels.
Parameters
A map of options to pass to the method.
- renderer - IObjectRenderer<ILabel>
- An IObjectRenderer<ILabel> for edge labels.
- callback - function(ILabel):IRenderTreeGroup
- A callback to get the IRenderTreeGroup containing the render tree element of a given edge label.
Signature Details
function(arg: ILabel) : IRenderTreeGroup
Encapsulates a method that has one parameters and returns a value of the type specified by theTResult
parameter.Parameters
- arg - ILabel
- The parameter of the method that this delegate encapsulates.
Returns
- IRenderTreeGroup
- The return value of the method that this delegate encapsulates.
Returns
- ↪ItemModelManager<ILabel>
- a new instance of ItemModelManager<T> for edge labels
Defined in
createEdgeModelManager
(renderer: IObjectRenderer<IEdge>, callback: function(IEdge):IRenderTreeGroup) : ItemModelManager<IEdge>Factory method for creating the ItemModelManager<T> that handles the visual representation of edges.
Parameters
A map of options to pass to the method.
- renderer - IObjectRenderer<IEdge>
- An IObjectRenderer<IEdge> for IEdges.
- callback - function(IEdge):IRenderTreeGroup
- A callback to get the IRenderTreeGroup containing the render tree element of a given edge.
Signature Details
function(arg: IEdge) : IRenderTreeGroup
Encapsulates a method that has one parameters and returns a value of the type specified by theTResult
parameter.Parameters
- arg - IEdge
- The parameter of the method that this delegate encapsulates.
Returns
- IRenderTreeGroup
- The return value of the method that this delegate encapsulates.
Returns
- ↪ItemModelManager<IEdge>
- a new instance of ItemModelManager<T> for edges
Defined in
createEffectFadeAnimation
(type: WebGLFadeAnimationType, color1?: Color, color2?: Color, timing?: WebGLAnimationTiming) : WebGLAnimationCreates an animation that fades the colors of item effects like AMBIENT_FILL_COLOR.
Remarks
Parameters
A map of options to pass to the method.
- type - WebGLFadeAnimationType
- The type of fading to apply.
- color1 - Color
- The first color to fade to when choosing mode FADE_TO_COLOR. This color will be applied to the white regions of a grayscale representation of the node effect.
- color2 - Color
- The second color to fade to when choosing mode FADE_TO_COLOR. This color will be applied to the black regions of a grayscale representation of the node effect.
- timing - WebGLAnimationTiming
- Specifies the timing function to use for the animation. Defaults to "1s linear 1 normal". The animation will loop once for one second with a linear progress in normal direction.
Returns
- ↪WebGLAnimation
- An animation to assign to nodes, edges, or labels
See Also
createEffectPulseAnimation
(type?: WebGLPulseAnimationType, amount?: number, useViewCoordinates?: boolean, timing?: WebGLAnimationTiming) : WebGLAnimationCreates an animation that applies a pulsating effect to item effects like AMBIENT_FILL_COLOR .
Remarks
Parameters
A map of options to pass to the method.
- type - WebGLPulseAnimationType
- The type of the pulse to apply. Defaults to GROW.
- amount - number
- The extent of the pulses. Defaults to 2. Note that the amount has to be compatible with the type. For example, negative numbers have no effect when used on GROW_RELATIVE
- useViewCoordinates - boolean
- Whether the extent of the animation is zoom-invariant for zoom values below 1.
- timing - WebGLAnimationTiming
- Specifies the timing function to use for the animation. Defaults to "1s linear 1 normal". The animation will loop once for one second with a linear progress in normal direction. EASE, EASE_IN, EASE_OUT, and EASE_IN_OUT are interpreted the same and have the effect that the wave form is eased at its extremes (creating a sine-like wave form). STEP creates a rectangular wave form.
Returns
- ↪WebGLAnimation
- An animation to assign to node effects.
See Also
createEffectScaleAnimation
(type?: WebGLScaleAnimationType, amount?: number, useViewCoordinates?: boolean, timing?: WebGLAnimationTiming) : WebGLAnimationCreates an animation that applies a scaling effect to item effects.
Remarks
Parameters
A map of options to pass to the method.
- type - WebGLScaleAnimationType
- The type of the scale to apply. Defaults to GROW.
- amount - number
- The extent of the scale. Defaults to 5. For relative WebGLScaleAnimationTypes this is the scaling factor.
- useViewCoordinates - boolean
- Whether the extent of the animation is zoom-invariant for zoom values below 1.
- timing - WebGLAnimationTiming
- Specifies the timing function to use for the animation. Defaults to "1s linear 1 normal". The animation will loop once for one second with a linear progress in normal direction. Defaults to NORMAL.
Returns
- ↪WebGLAnimation
- An animation to assign to nodes effects
See Also
createFadeAnimation
(type: WebGLFadeAnimationType, color1?: Color, color2?: Color, timing?: WebGLAnimationTiming) : WebGLAnimationCreates an animation that fades the colors of nodes, edges, or labels.
Remarks
Parameters
A map of options to pass to the method.
- type - WebGLFadeAnimationType
- The type of fading to apply.
- color1 - Color
- The first color to fade to when choosing mode FADE_TO_COLOR. This color will be applied to the white regions of a grayscale representation of an item.
- color2 - Color
- The second color to fade to when choosing mode FADE_TO_COLOR. This color will be applied to the black regions of a grayscale representation of an item.
- timing - WebGLAnimationTiming
- Specifies the timing function to use for the animation. Defaults to "1s linear 1 normal". The animation will loop once for one second with a linear progress in normal direction.
Returns
- ↪WebGLAnimation
- An animation to assign to nodes, edges, or labels
See Also
Factory method for the groupNodeGroup property.
Remarks
Returns
- ↪IRenderTreeGroup
- a new group that has been added to the contentGroup
Defined in
createHaloAnimation
(color?: Color, magnitude?: number, useViewCoordinates?: boolean, timing?: WebGLAnimationTiming) : WebGLAnimationCreates a solid halo effect around nodes.
Remarks
A solid ring around the outline of the node will grow away from the node to a given maximum magnitude. Both the color and magnitude, as well the timing function may be specified.
Only one halo or beacon animation per element is shown at the same time.
Animations should be shared and un-assigned when not in use as the maximum number of assigned animations is limited to 15 per type of element. There can be only 8 animations assigned to one element at the same time and only 31 different combinations of animations may be assigned to the items.
Parameters
A map of options to pass to the method.
- color - Color
- The color of the halo. Defaults to semi-transparent 50% gray if not specified.
- magnitude - number
- The distance the halo extends away from the shape. Defaults to 50.
- useViewCoordinates - boolean
- Whether to render the effect in view coordinates, invariant of the zoom level. Defaults to
false
. - timing - WebGLAnimationTiming
- Specifies the timing function to use for the animation. Defaults to "1s linear 1 normal". The animation will loop once for one second with a linear progress in normal direction.
Returns
- ↪WebGLAnimation
- An animation to assign to nodes
See Also
Factory method for the nodeGroup property.
Remarks
Returns
- ↪IRenderTreeGroup
- a new group that has been added to the contentGroup
Defined in
Factory method for the nodeLabelGroup property.
Remarks
Returns
- ↪IRenderTreeGroup
- a new group that has been added to the contentGroup
Defined in
createNodeLabelModelManager
(renderer: IObjectRenderer<ILabel>, callback: function(ILabel):IRenderTreeGroup) : ItemModelManager<ILabel>Factory method for creating the ItemModelManager<T> that handles the visual representation of node labels.
Parameters
A map of options to pass to the method.
- renderer - IObjectRenderer<ILabel>
- An IObjectRenderer<ILabel> for node labels.
- callback - function(ILabel):IRenderTreeGroup
- A callback to get the IRenderTreeGroup containing the render tree element of a given node label.
Signature Details
function(arg: ILabel) : IRenderTreeGroup
Encapsulates a method that has one parameters and returns a value of the type specified by theTResult
parameter.Parameters
- arg - ILabel
- The parameter of the method that this delegate encapsulates.
Returns
- IRenderTreeGroup
- The return value of the method that this delegate encapsulates.
Returns
- ↪ItemModelManager<ILabel>
- a new instance of ItemModelManager<T> for node labels
Defined in
createNodeModelManager
(renderer: IObjectRenderer<INode>, callback: function(INode):IRenderTreeGroup) : ItemModelManager<INode>Factory method for creating the ItemModelManager<T> that handles the visual representation of nodes.
Parameters
A map of options to pass to the method.
- renderer - IObjectRenderer<INode>
- An IObjectRenderer<INode> for INodes.
- callback - function(INode):IRenderTreeGroup
- A callback to get the IRenderTreeGroup containing the render tree element of a given node.
Signature Details
function(arg: INode) : IRenderTreeGroup
Encapsulates a method that has one parameters and returns a value of the type specified by theTResult
parameter.Parameters
- arg - INode
- The parameter of the method that this delegate encapsulates.
Returns
- IRenderTreeGroup
- The return value of the method that this delegate encapsulates.
Returns
- ↪ItemModelManager<INode>
- a new instance of ItemModelManager<T> for nodes
Defined in
Factory method for the portGroup property.
Remarks
Returns
- ↪IRenderTreeGroup
- a new group that has been added to the contentGroup
Defined in
Factory method for the portLabelGroup property.
Remarks
Returns
- ↪IRenderTreeGroup
- a new group that has been added to the contentGroup
Defined in
createPortLabelModelManager
(renderer: IObjectRenderer<ILabel>, callback: function(ILabel):IRenderTreeGroup) : ItemModelManager<ILabel>Factory method for creating the ItemModelManager<T> that handles the visual representation of port labels.
Parameters
A map of options to pass to the method.
- renderer - IObjectRenderer<ILabel>
- An IObjectRenderer<ILabel> for port labels.
- callback - function(ILabel):IRenderTreeGroup
- A callback to get the IRenderTreeGroup containing the render tree element of a given port label.
Signature Details
function(arg: ILabel) : IRenderTreeGroup
Encapsulates a method that has one parameters and returns a value of the type specified by theTResult
parameter.Parameters
- arg - ILabel
- The parameter of the method that this delegate encapsulates.
Returns
- IRenderTreeGroup
- The return value of the method that this delegate encapsulates.
Returns
- ↪ItemModelManager<ILabel>
- a new instance of ItemModelManager<T> for port labels
Defined in
createPortModelManager
(renderer: IObjectRenderer<IPort>, callback: function(IPort):IRenderTreeGroup) : ItemModelManager<IPort>Factory method for creating the ItemModelManager<T> that handles the visual representation of ports.
Parameters
A map of options to pass to the method.
- renderer - IObjectRenderer<IPort>
- An IObjectRenderer<IPort> for IPorts.
- callback - function(IPort):IRenderTreeGroup
- A callback to get the IRenderTreeGroup containing the render tree element of a given port.
Signature Details
function(arg: IPort) : IRenderTreeGroup
Encapsulates a method that has one parameters and returns a value of the type specified by theTResult
parameter.Parameters
- arg - IPort
- The parameter of the method that this delegate encapsulates.
Returns
- IRenderTreeGroup
- The return value of the method that this delegate encapsulates.
Returns
- ↪ItemModelManager<IPort>
- a new instance of ItemModelManager<T> for ports
Defined in
createPulseAnimation
(type?: WebGLPulseAnimationType, amount?: number, useViewCoordinates?: boolean, timing?: WebGLAnimationTiming) : WebGLAnimationCreates an animation that applies a pulsating effect to nodes, labels, or edges.
Remarks
Parameters
A map of options to pass to the method.
- type - WebGLPulseAnimationType
- The type of the pulse to apply. Defaults to GROW.
- amount - number
- The extent of the pulses. Defaults to 2. Note that the amount has to be compatible with the type. For example, negative numbers have no effect when used on GROW_RELATIVE
- useViewCoordinates - boolean
- Whether the extent of the animation is zoom-invariant for zoom values below 1.
- timing - WebGLAnimationTiming
- Specifies the timing function to use for the animation. Defaults to "1s linear 1 normal". The animation will loop once for one second with a linear progress in normal direction.
Returns
- ↪WebGLAnimation
- An animation to assign to nodes, edges, or labels
See Also
createScaleAnimation
(type?: WebGLScaleAnimationType, amount?: number, useViewCoordinates?: boolean, timing?: WebGLAnimationTiming) : WebGLAnimationCreates an animation that applies a scaling effect to nodes, edges, or labels.
Remarks
Parameters
A map of options to pass to the method.
- type - WebGLScaleAnimationType
- The type of the scale to apply. Defaults to GROW.
- amount - number
- The extent of the scale. Defaults to 5. For relative WebGLScaleAnimationTypes this is the scaling factor.
- useViewCoordinates - boolean
- Whether the extent of the animation is zoom-invariant for zoom values below 1.
- timing - WebGLAnimationTiming
- Specifies the timing function to use for the animation. Defaults to "1s linear 1 normal". The animation will loop once for one second with a linear progress in normal direction.
Returns
- ↪WebGLAnimation
- An animation to assign to nodes, edges, or labels
See Also
createShakeAnimation
(type: WebGLShakeAnimationType, magnitude?: number, useViewCoordinates?: boolean, timing?: WebGLAnimationTiming) : WebGLAnimationCreates an animation that applies a shake effect to nodes, edges, or labels.
Remarks
Parameters
A map of options to pass to the method.
- type - WebGLShakeAnimationType
- The type of shake to apply.
- magnitude - number
- The distance the shake moves an item. Defaults to 2.
- useViewCoordinates - boolean
- Whether the extent of the animation is zoom-invariant for zoom values below 1.
- timing - WebGLAnimationTiming
- Specifies the timing function to use for the animation. Defaults to "1s linear 1 normal". The animation will loop once for one second with a linear progress in normal direction. EASE, EASE_IN, EASE_OUT, and EASE_IN_OUT are interpreted the same and have the effect that the wave form is eased at its extremes (creating a sine-like wave form). STEP creates a rectangular wave form.
Returns
- ↪WebGLAnimation
- An animation to assign to nodes, edges, or labels
See Also
Returns the currently associated animations for the given item.
Parameters
A map of options to pass to the method.
- item - IModelItem
- This should be a node, edge, or label, currently managed and rendered by this instance.
Returns
- ↪WebGLAnimation[]
- A copy of a possibly empty array of all the animations currently in effect for the provided item.
Throws
- Exception({ name: 'NotSupportedError' })
- If this instance is not associated with a graph via a component.
Retrieves the IRenderTreeGroup containing the render tree element of a given edge.
Remarks
Parameters
A map of options to pass to the method.
- edge - IEdge
- The edge that will be installed in the canvas.
Returns
- ↪IRenderTreeGroup
- The group to use.
Defined in
Retrieves the IRenderTreeGroup containing the render tree element of a given label.
Remarks
Parameters
A map of options to pass to the method.
- label - ILabel
- The label that will be installed in the canvas.
Returns
- ↪IRenderTreeGroup
- The group to use.
Defined in
Retrieves the IRenderTreeElement for a given model item that can be used for z-order or visibility operations.
Remarks
The z-order can be changed on the returned IRenderTreeElement via raise, lower, toFront, toBack, above or below.
The visibility can be changed via the visible property.
Note that these z-order or visibility changes will also affect model items whose z-order directly depends on item
like labels if AT_OWNER is chosen.
Parameters
A map of options to pass to the method.
- item - IModelItem
- the item
Returns
- ↪IRenderTreeElement?
- The main render tree element for the given item or
null
See Also
Defined in
Retrieves the corresponding IModelItem for the given render tree element.
Parameters
A map of options to pass to the method.
- renderTreeElement - IRenderTreeElement
- The instance to use for the query
Returns
- ↪IModelItem?
- The item that is associated with the render tree element or
null
.
Defined in
Retrieves the IRenderTreeGroup containing the render tree element of a given node.
Remarks
Parameters
A map of options to pass to the method.
- node - INode
- The node that will be installed in the canvas.
Returns
- ↪IRenderTreeGroup
- The group to use.
See Also
Defined in
Retrieves the IRenderTreeGroup containing the render tree element of a given port.
Remarks
Parameters
A map of options to pass to the method.
- port - IPort
- The port that will be installed in the canvas.
Returns
- ↪IRenderTreeGroup
- The group to use.
Defined in
Retrieves the IRenderTreeElement visualizing a given model item managed by this instance.
Remarks
Parameters
A map of options to pass to the method.
- item - IModelItem
- the item
Returns
- ↪IRenderTreeElement?
- the render tree element for the given item or
null
See Also
Defined in
Returns the currently associated style to use for the edge when rendered in WebGL mode.
Remarks
Parameters
A map of options to pass to the method.
- edge - IEdge
- The edge to return the style for.
Returns
- ↪WebGLPolylineEdgeStyle | WebGLArcEdgeStyle | WebGLBridgeEdgeStyle
- The style that is used for rendering the item.
Throws
Returns the currently associated style to use for the node when rendered in WebGL mode.
Remarks
Parameters
A map of options to pass to the method.
- node - INode
- The node to return the style for.
Returns
- ↪WebGLShapeNodeStyle | WebGLImageNodeStyle | WebGLGroupNodeStyle
- The style that is used for rendering the item.
Throws
Returns the currently associated style to use for the label when rendered in WebGL mode.
Remarks
Parameters
A map of options to pass to the method.
- label - ILabel
- The label to return the style for.
Returns
- ↪WebGLLabelStyle | WebGLIconLabelStyle
- The style that is used for rendering the item.
Throws
getWebGLEdgeStyle
(edge: IEdge) : WebGLPolylineEdgeStyle | WebGLArcEdgeStyle | WebGLBridgeEdgeStyle | nullGets a WebGL2 edge style that is similar to the IEdgeStyle of the given edge
.
Remarks
The WebGLGraphModelManager can only render WebGL2-specific edge style instances. This method is used as a callback when an IEdge is added to the graph of this instance. The associated style will be translated to a style that can be rendered by this instance and looks similar.
Note that specifically custom style implementations can benefit from a custom implementation that directly translates style instances to a corresponding WebGL2-based style.
Alternatively to overriding this method, calling getStyle can be used. It is slightly slower, because the initial translation via this method will be performed, either way.
Parameters
A map of options to pass to the method.
Returns
- ↪WebGLPolylineEdgeStyle | WebGLArcEdgeStyle | WebGLBridgeEdgeStyle | null?
- A (possibly shared) instance of either a WebGLPolylineEdgeStyles, WebGLArcEdgeStyle, or WebGLBridgeEdgeStyle. Returning
null
will apply a default style instead.
Gets a WebGL2 label style that is similar to the ILabelStyle of the given label
.
Remarks
The WebGLGraphModelManager can only render WebGL2-specific label style instances. This method is used as a callback when an ILabel is added to the graph of this instance. The associated style will be translated to a style that can be rendered by this instance and looks similar.
Note that specifically custom style implementations and template-based styles can benefit from a custom implementation that directly translates style instances to a corresponding WebGL2-based style.
Alternatively to overriding this method, calling getStyle can be used. It is slightly slower, because the initial translation via this method will be performed, either way. Also note that an IconLabelStyle is not automatically converted to a corresponding WebGLIconLabelStyle since its icon cannot be converted in synchronous code.
Parameters
A map of options to pass to the method.
Returns
- ↪WebGLLabelStyle | WebGLIconLabelStyle?
- A (possibly shared) instance of either a WebGLLabelStyle or WebGLIconLabelStyle. Returning
null
will apply a default style instead.
See Also
getWebGLNodeStyle
(node: INode) : WebGLShapeNodeStyle | WebGLImageNodeStyle | WebGLGroupNodeStyle | nullGets a WebGL2 node style that is similar to the INodeStyle of the given node
.
Remarks
The WebGLGraphModelManager can only render WebGL2-specific node style instances. This method is used as a callback when an INode is added to the graph of this instance. The associated style will be translated to a style that can be rendered by this instance and looks similar.
Note that specifically custom style implementations and template-based styles can benefit from a custom implementation that directly translates style instances to a corresponding WebGL2-based style. Also note that an ImageNodeStyle is not automatically converted to a corresponding WebGLImageNodeStyle since its image cannot be converted in synchronous code.
Alternatively to overriding this method, calling getStyle can be used. It is slightly slower, because the initial translation via this method will be performed, either way.
Parameters
A map of options to pass to the method.
Returns
- ↪WebGLShapeNodeStyle | WebGLImageNodeStyle | WebGLGroupNodeStyle | null?
- A (possibly shared) instance of either a WebGLShapeNodeStyle, WebGLImageNodeStyle, or WebGLGroupNodeStyle. Returning
null
will apply a default style instead.
See Also
hitElementsAt
(location: Point, context?: IInputModeContext, root?: IRenderTreeGroup, typeFilter?: GraphItemTypes) : IEnumerable<IModelItem>Enumerates hits in the render tree of the canvas at a given world coordinate position for a given context and IRenderTreeGroup.
Remarks
The instance returned will enumerate hits in the order so that the topmost visual element will be reported first. The enumeration is performed lazily.
Note that if you do not specify the root
parameter, only the members of the contentGroup will be hit tested.
Parameters
A map of options to pass to the method.
- location - Point
- the world coordinates to perform the hit test at
- context - IInputModeContext
- The context to provide to isHit
- root - IRenderTreeGroup
- The group to search the subtree of. contentGroup if not specified.
- typeFilter - GraphItemTypes
- An optional filter that preselects a subset of types that will be tested and reported. This can result in improved performance when testing does not need to be performed.
Returns
- ↪IEnumerable<IModelItem>
- a live enumerable that will enumerate the hits at the given coordinates
Overrides
Installs this instance for the specified CanvasComponent.
Remarks
Parameters
A map of options to pass to the method.
- canvasComponent - CanvasComponent
- The CanvasComponent.
- graph - IGraph
- The graph.
- contentGroup - IRenderTreeGroup
- The group to add the graph's visual content to. If omitted, the contentGroup of the renderTree of the
canvasComponent
is used.
Overrides
Lowers the visual representation of the item
below its current predecessor.
Remarks
item
below its current predecessor in its containing parent.Parameters
A map of options to pass to the method.
- item - IModelItem
- The model item to lower.
See Also
Defined in
Lowers the visual representations of all IModelItems in items
below their current predecessors.
Remarks
items
below their current predecessors in their containing parent.Parameters
A map of options to pass to the method.
- items - IEnumerable<IModelItem>
- The IModelItems to lower.
See Also
Defined in
Called when the graph property changes.
Remarks
Parameters
A map of options to pass to the method.
Overrides
Raises the visual representation of the item
above its current successor.
Remarks
item
above its current successor in the containing parent.Parameters
A map of options to pass to the method.
- item - IModelItem
- The model item to raise.
See Also
Defined in
Raises the visual representations of all IModelItems in items
above their current successors.
Remarks
items
above their current successors in their containing parent.Parameters
A map of options to pass to the method.
- items - IEnumerable<IModelItem>
- The IModelItems to raise.
See Also
Defined in
Sets the animations to apply to the node.
Parameters
A map of options to pass to the method.
- node - INode
- The node instance to specify the animations for. The node must belong to the displayed graph.
- animations - WebGLAnimation[]
- The animations to apply. Animations may and should be shared among items. Provide
null
or an empty array in order to clear existing animations.
Throws
- Exception({ name: 'NotSupportedError' })
- If this instance is not associated with a graph via a component.
See Also
Sets the animations to apply to the edge.
Parameters
A map of options to pass to the method.
- edge - IEdge
- The edge instance to specify the animations for. The edge must belong to the displayed graph.
- animations - WebGLAnimation[]
- The animations to apply. Animations may and should be shared among items. Provide
null
or an empty array in order to clear existing animations.
Throws
- Exception({ name: 'NotSupportedError' })
- If this instance is not associated with a graph via a component.
See Also
Sets the animations to apply to the label.
Parameters
A map of options to pass to the method.
- label - ILabel
- The label instance to specify the animations for. The label must belong to the displayed graph.
- animations - WebGLAnimation[]
- The animations to apply. Animations may and should be shared among items. Provide
null
or an empty array in order to clear existing animations.
Throws
- Exception({ name: 'NotSupportedError' })
- If this instance is not associated with a graph via a component.
See Also
Lowers the visual representation of the item
to the back.
Remarks
Parameters
A map of options to pass to the method.
- item - IModelItem
- The model item to lower to the back.
See Also
Defined in
Lowers the visual representation of all IModelItems in items
to the back.
Remarks
items
to the back in their containing parent.Parameters
A map of options to pass to the method.
- items - IEnumerable<IModelItem>
- The IModelItems to move to the back.
See Also
Defined in
Raises the visual representation of the item
to the front.
Remarks
Parameters
A map of options to pass to the method.
- item - IModelItem
- The model item to raise to the front.
See Also
Defined in
Raises the visual representations of all IModelItems in items
to the front.
Remarks
items
to the front in their containing parent.Parameters
A map of options to pass to the method.
- items - IEnumerable<IModelItem>
- The IModelItems to move to the front.
See Also
Defined in
Reverts the install method.
Remarks
Parameters
A map of options to pass to the method.
- canvas - CanvasComponent
- The CanvasComponent.
Overrides
Updates the visual representation of the given item.
Parameters
A map of options to pass to the method.
- item - IModelItem
- The item to update the visual representation of
See Also
Defined in
Updates the location of the WebGL2 visualization of the given label
.
Remarks
Parameters
A map of options to pass to the method.
- label - ILabel
- The label for which the rendering location should be updated.
Explicitly updates the WebGL2 style of a node
Remarks
Parameters
A map of options to pass to the method.
- node - INode
- The node for which the WebGL2 style should be updated.
Throws
- Exception({ name: 'NotSupportedError' })
- If this instance is not associated with a graph via a component.
Explicitly updates the WebGL2 style of an edge
Remarks
Parameters
A map of options to pass to the method.
- edge - IEdge
- The edge for which the WebGL2 style should be updated.
Throws
- Exception({ name: 'NotSupportedError' })
- If this instance is not associated with a graph via a component.
Explicitly updates the WebGL2 style of a label
Remarks
Parameters
A map of options to pass to the method.
- label - ILabel
- The label for which the WebGL2 style should be updated.
Throws
- Exception({ name: 'NotSupportedError' })
- If this instance is not associated with a graph via a component.
Events
Occurs when the asynchronous compilation of WebGL2 shaders has finished.
Remarks
Occurs when the asynchronous compilation of WebGL2 shaders has started.