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 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 HierarchicNestingPolicy and LabelLayerPolicy properties have no effect.
While the default renderMode is WEB_GL, it may be switched to SVG. As soon as this property is set the first time, this WebGL2GraphModelManager 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-webgl
- yfiles-umd modules
- view-webgl, view
- Legacy UMD name
- yfiles.view.WebGL2GraphModelManager
See Also
Constructors
Creates a new instance of the WebGL2GraphModelManager 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 WebGL2GraphModelManager 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 - WebGL2GraphModelManagerRenderMode
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 an IComparer<T> instance that can be used to compare two model items with respect to their visual display order.
Remarks
Defined in
Gets or sets the content group this manager instance uses to add visual representation of the graph to.
Defined in
Gets or sets the ICanvasObjectDescriptor instance used for installing an IEdge into the canvas.
Defined in
Gets the ICanvasObjectGroup 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 canvas objects of edges will only be put directly in this ICanvasObjectGroup, 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 or sets the ICanvasObjectDescriptor instance used for installing an ILabel of an IEdge into the canvas.
Defined in
Gets the ICanvasObjectGroup instance that will be used for installing edge label styles.
Remarks
See Also
Defined in
Gets or sets the policy to determines at which visual layer edge labels shall be inserted.
Provides access to the ItemModelManager<T> which handles the ILabels at edges.
Provides access to the ItemModelManager<T> which handles the IEdges.
Gets or sets the graph this manager manages.
Gets the ICanvasObjectGroup 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<T> that can be used to enumerate hits on the canvas at a given world coordinate position.
Remarks
Defined in
Gets or sets the policy to determines at which visual layer node, edge and port labels shall be inserted.
Remarks
The default value is SEPARATE_LAYER.
Setting this property overrides the more specific nodeLabelLayerPolicy, edgeLabelLayerPolicy and portLabelLayerPolicy properties which supersede this property.
Deprecation warning
Use the more specific properties NodeLabelLayerPolicy, EdgeLabelLayerPolicy, and PortLabelLayerPolicy.Defined in
Gets or sets the ICanvasObjectDescriptor instance used for installing an INode into the canvas.
Defined in
Gets the ICanvasObjectGroup 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 hierarchicNestingPolicy:
- NONE – Contains the main canvas objects of all nodes top-level.
- NODES – Contains the main canvas objects of all nodes in a more complicated nesting of dynamically created ICanvasObjectGroups.
- NODES_AND_EDGES – Contains the main canvas objects of all nodes and edges in a more complicated nesting of dynamically created ICanvasObjectGroups.
- GROUP_NODES – Contains the main canvas objects of all leaf nodes. Group nodes having the same hierarchical depth are in one child ICanvasObjectGroup of the groupNodeGroup instead.
See Also
Defined in
Gets or sets the ICanvasObjectDescriptor instance used for installing an ILabel of an INode into the canvas.
Defined in
Gets the ICanvasObjectGroup instance that will be used for installing node label styles.
Remarks
See Also
Defined in
Gets or sets the policy to determines at which visual layer node labels shall be inserted.
Provides access to the ItemModelManager<T> which handles the ILabels at nodes.
Provides access to the ItemModelManager<T> which handles the INodes.
Gets or sets the ICanvasObjectDescriptor instance used for installing an IPort into the canvas.
Defined in
Gets the ICanvasObjectGroup instance that will be used for installing port styles.
Remarks
See Also
Defined in
Gets or sets the ICanvasObjectDescriptor instance used for installing an ILabel of an IPort into the canvas.
Defined in
Gets the ICanvasObjectGroup instance that will be used for installing port label styles.
Remarks
See Also
Defined in
Gets or sets the policy to determines 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 policy to determines at which visual layer node and edge ports shall be inserted.
Provides access to the ItemModelManager<T> which handles the IPorts.
Gets or sets if the userObject should be provided by its main canvas object.
Remarks
The userObject is already provided by the canvas object visualizing the model item. As this canvas object may differ from the main canvas object, this property determines only if the userObject is provided by its main canvas object if it differs from getCanvasObject.
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 WebGL2GraphModelManager is prepared for SVG as well as WebGL rendering, so switching between those modes will be smoother.
The default value is WEB_GL.
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 WebGL2ArcEdgeStyle and WebGL2BridgeEdgeStyle.
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 - WebGL2AnimationTiming
- 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
- ↪WebGL2Animation
- An animation to assign to edges.
See Also
createBeaconAnimation
(type?: WebGL2BeaconAnimationType, color?: Color, pulseWidth?: number, pulseCount?: number, pulseDistance?: number, magnitude?: number, smooth?: boolean, useViewCoordinates?: boolean, timing?: WebGL2AnimationTiming) : WebGL2AnimationCreates 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 - WebGL2BeaconAnimationType
- 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 - WebGL2AnimationTiming
- 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
- ↪WebGL2Animation
- An animation to assign to nodes
See Also
Gets the contentGroup when the canvasComponent property is set.
Remarks
null
.Returns
- ↪ICanvasObjectGroup
- The contentGroup of the canvasComponent.
Overrides
Creates an animation that animates the dash pattern of a WebGL2PolylineEdgeStyle, WebGL2ArcEdgeStyle, and WebGL2BridgeEdgeStyle.
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 - WebGL2AnimationTiming
- 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
- ↪WebGL2Animation
- An animation to assign to edges.
See Also
Factory method for the edgeGroup property.
Remarks
Returns
- ↪ICanvasObjectGroup
- a new group that has been added to the contentGroup
Defined in
Factory method for the edgeLabelGroup property.
Remarks
Returns
- ↪ICanvasObjectGroup
- a new group that has been added to the contentGroup
Defined in
createEdgeLabelModelManager
(descriptor: ICanvasObjectDescriptor, callback: function(ILabel):ICanvasObjectGroup) : 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.
- descriptor - ICanvasObjectDescriptor
- An ICanvasObjectDescriptor for edge labels.
- callback - function(ILabel):ICanvasObjectGroup
- A callback to get the ICanvasObjectGroup containing the canvas object of a given edge label.
Signature Details
function(arg: ILabel) : ICanvasObjectGroup
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
- ICanvasObjectGroup
- 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
(descriptor: ICanvasObjectDescriptor, callback: function(IEdge):ICanvasObjectGroup) : 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.
- descriptor - ICanvasObjectDescriptor
- An ICanvasObjectDescriptor for IEdges.
- callback - function(IEdge):ICanvasObjectGroup
- A callback to get the ICanvasObjectGroup containing the canvas object of a given edge.
Signature Details
function(arg: IEdge) : ICanvasObjectGroup
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
- ICanvasObjectGroup
- 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: WebGL2FadeAnimationType, color1?: Color, color2?: Color, timing?: WebGL2AnimationTiming) : WebGL2AnimationCreates 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 - WebGL2FadeAnimationType
- 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 - WebGL2AnimationTiming
- 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
- ↪WebGL2Animation
- An animation to assign to nodes, edges, or labels
See Also
createEffectPulseAnimation
(type?: WebGL2PulseAnimationType, amount?: number, useViewCoordinates?: boolean, timing?: WebGL2AnimationTiming) : WebGL2AnimationCreates 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 - WebGL2PulseAnimationType
- 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 - WebGL2AnimationTiming
- 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
- ↪WebGL2Animation
- An animation to assign to node effects.
See Also
createEffectScaleAnimation
(type?: WebGL2ScaleAnimationType, amount?: number, useViewCoordinates?: boolean, timing?: WebGL2AnimationTiming) : WebGL2AnimationCreates an animation that applies a scaling effect to item effects.
Remarks
Parameters
A map of options to pass to the method.
- type - WebGL2ScaleAnimationType
- The type of the scale to apply. Defaults to GROW.
- amount - number
- The extent of the scale. Defaults to 5. For relative WebGL2ScaleAnimationTypes this is the scaling factor.
- useViewCoordinates - boolean
- Whether the extent of the animation is zoom-invariant for zoom values below 1.
- timing - WebGL2AnimationTiming
- 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
- ↪WebGL2Animation
- An animation to assign to nodes effects
See Also
createFadeAnimation
(type: WebGL2FadeAnimationType, color1?: Color, color2?: Color, timing?: WebGL2AnimationTiming) : WebGL2AnimationCreates an animation that fades the colors of nodes, edges, or labels.
Remarks
Parameters
A map of options to pass to the method.
- type - WebGL2FadeAnimationType
- 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 - WebGL2AnimationTiming
- 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
- ↪WebGL2Animation
- An animation to assign to nodes, edges, or labels
See Also
Factory method for the groupNodeGroup property.
Remarks
Returns
- ↪ICanvasObjectGroup
- a new group that has been added to the contentGroup
Defined in
createHaloAnimation
(color?: Color, magnitude?: number, useViewCoordinates?: boolean, timing?: WebGL2AnimationTiming) : WebGL2AnimationCreates 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 - WebGL2AnimationTiming
- 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
- ↪WebGL2Animation
- An animation to assign to nodes
See Also
Gets a IHitTester<T> that can be used to enumerate hits on the canvas at a given world coordinate position.
Remarks
Type Parameters
- T: IModelItem
Overrides
Factory method for the nodeGroup property.
Remarks
Returns
- ↪ICanvasObjectGroup
- a new group that has been added to the contentGroup
Defined in
Factory method for the nodeLabelGroup property.
Remarks
Returns
- ↪ICanvasObjectGroup
- a new group that has been added to the contentGroup
Defined in
createNodeLabelModelManager
(descriptor: ICanvasObjectDescriptor, callback: function(ILabel):ICanvasObjectGroup) : 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.
- descriptor - ICanvasObjectDescriptor
- An ICanvasObjectDescriptor for node labels.
- callback - function(ILabel):ICanvasObjectGroup
- A callback to get the ICanvasObjectGroup containing the canvas object of a given node label.
Signature Details
function(arg: ILabel) : ICanvasObjectGroup
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
- ICanvasObjectGroup
- 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
(descriptor: ICanvasObjectDescriptor, callback: function(INode):ICanvasObjectGroup) : 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.
- descriptor - ICanvasObjectDescriptor
- An ICanvasObjectDescriptor for INodes.
- callback - function(INode):ICanvasObjectGroup
- A callback to get the ICanvasObjectGroup containing the canvas object of a given node.
Signature Details
function(arg: INode) : ICanvasObjectGroup
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
- ICanvasObjectGroup
- 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
- ↪ICanvasObjectGroup
- a new group that has been added to the contentGroup
Defined in
Factory method for the portLabelGroup property.
Remarks
Returns
- ↪ICanvasObjectGroup
- a new group that has been added to the contentGroup
Defined in
createPortLabelModelManager
(descriptor: ICanvasObjectDescriptor, callback: function(ILabel):ICanvasObjectGroup) : 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.
- descriptor - ICanvasObjectDescriptor
- An ICanvasObjectDescriptor for port labels.
- callback - function(ILabel):ICanvasObjectGroup
- A callback to get the ICanvasObjectGroup containing the canvas object of a given port label.
Signature Details
function(arg: ILabel) : ICanvasObjectGroup
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
- ICanvasObjectGroup
- 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
(descriptor: ICanvasObjectDescriptor, callback: function(IPort):ICanvasObjectGroup) : 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.
- descriptor - ICanvasObjectDescriptor
- An ICanvasObjectDescriptor for IPorts.
- callback - function(IPort):ICanvasObjectGroup
- A callback to get the ICanvasObjectGroup containing the canvas object of a given port.
Signature Details
function(arg: IPort) : ICanvasObjectGroup
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
- ICanvasObjectGroup
- 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?: WebGL2PulseAnimationType, amount?: number, useViewCoordinates?: boolean, timing?: WebGL2AnimationTiming) : WebGL2AnimationCreates an animation that applies a pulsating effect to nodes, labels, or edges.
Remarks
Parameters
A map of options to pass to the method.
- type - WebGL2PulseAnimationType
- 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 - WebGL2AnimationTiming
- 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
- ↪WebGL2Animation
- An animation to assign to nodes, edges, or labels
See Also
createScaleAnimation
(type?: WebGL2ScaleAnimationType, amount?: number, useViewCoordinates?: boolean, timing?: WebGL2AnimationTiming) : WebGL2AnimationCreates an animation that applies a scaling effect to nodes, edges, or labels.
Remarks
Parameters
A map of options to pass to the method.
- type - WebGL2ScaleAnimationType
- The type of the scale to apply. Defaults to GROW.
- amount - number
- The extent of the scale. Defaults to 5. For relative WebGL2ScaleAnimationTypes this is the scaling factor.
- useViewCoordinates - boolean
- Whether the extent of the animation is zoom-invariant for zoom values below 1.
- timing - WebGL2AnimationTiming
- 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
- ↪WebGL2Animation
- An animation to assign to nodes, edges, or labels
See Also
createShakeAnimation
(type: WebGL2ShakeAnimationType, magnitude?: number, useViewCoordinates?: boolean, timing?: WebGL2AnimationTiming) : WebGL2AnimationCreates an animation that applies a shake effect to nodes, edges, or labels.
Remarks
Parameters
A map of options to pass to the method.
- type - WebGL2ShakeAnimationType
- 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 - WebGL2AnimationTiming
- 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
- ↪WebGL2Animation
- 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
- ↪WebGL2Animation[]
- 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.
See Also
Retrieves the ICanvasObject 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
- ↪ICanvasObject
- the canvas object for the given item or
null
See Also
Defined in
Retrieves the ICanvasObjectGroup containing the canvas object 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
- ↪ICanvasObjectGroup
- The group to use.
Defined in
Retrieves the ICanvasObjectGroup containing the canvas object 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
- ↪ICanvasObjectGroup
- The group to use.
Defined in
Retrieves the ICanvasObject 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 ICanvasObject 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
- ↪ICanvasObject
- The main canvas object for the given item or
null
See Also
Defined in
Retrieves the corresponding IModelItem for the given canvas object.
Parameters
A map of options to pass to the method.
- canvasObject - ICanvasObject
- the instance to use for the query
Returns
- ↪IModelItem
- The item that is associated with the object or
null
.
Defined in
Retrieves the ICanvasObjectGroup containing the canvas object 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
- ↪ICanvasObjectGroup
- The group to use.
See Also
Defined in
Retrieves the ICanvasObjectGroup containing the canvas object 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
- ↪ICanvasObjectGroup
- The group to use.
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
- ↪WebGL2PolylineEdgeStyle | WebGL2ArcEdgeStyle | WebGL2BridgeEdgeStyle
- 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
- ↪WebGL2ShapeNodeStyle | WebGL2IconNodeStyle | WebGL2GroupNodeStyle
- 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
- ↪WebGL2DefaultLabelStyle | WebGL2IconLabelStyle
- The style that is used for rendering the item.
Throws
getWebGL2EdgeStyle
(edge: IEdge) : WebGL2PolylineEdgeStyle | WebGL2ArcEdgeStyle | WebGL2BridgeEdgeStyleGets a WebGL2 edge style that is similar to the IEdgeStyle of the given edge
.
Remarks
The WebGL2GraphModelManager 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 setStyle 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
- ↪WebGL2PolylineEdgeStyle | WebGL2ArcEdgeStyle | WebGL2BridgeEdgeStyle
- A (possibly shared) instance of either a WebGL2PolylineEdgeStyles, WebGL2ArcEdgeStyle, or WebGL2BridgeEdgeStyle. 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 WebGL2GraphModelManager 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 setStyle 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 WebGL2IconLabelStyle since its icon cannot be converted in synchronous code.
Parameters
A map of options to pass to the method.
Returns
- ↪WebGL2DefaultLabelStyle | WebGL2IconLabelStyle
- A (possibly shared) instance of either a WebGL2DefaultLabelStyle or WebGL2IconLabelStyle. Returning
null
will apply a default style instead.
See Also
Gets a WebGL2 node style that is similar to the INodeStyle of the given node
.
Remarks
The WebGL2GraphModelManager 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 WebGL2IconNodeStyle since its image cannot be converted in synchronous code.
Alternatively to overriding this method, calling setStyle 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
- ↪WebGL2ShapeNodeStyle | WebGL2IconNodeStyle | WebGL2GroupNodeStyle
- A (possibly shared) instance of either a WebGL2ShapeNodeStyle, WebGL2IconNodeStyle, or WebGL2GroupNodeStyle. Returning
null
will apply a default style instead.
See Also
hitElementsAt
(context: IInputModeContext, location: Point, root: ICanvasObjectGroup) : IEnumerable<IModelItem>Enumerates hits on the canvas at a given world coordinate position for a given context.
Remarks
Parameters
A map of options to pass to the method.
- context - IInputModeContext
- The context to provide to isHit
- location - Point
- the world coordinates to perform the hit test
- root - ICanvasObjectGroup
- The group to search the subtree of.
Returns
- ↪IEnumerable<IModelItem>
- an enumerable that will enumerate the hits at the given coordinates
Overrides
Enumerates hits on the canvas at a given world coordinate position.
Remarks
Parameters
A map of options to pass to the method.
- location - Point
- the world coordinates to perform the hit test
Returns
- ↪IEnumerable<IModelItem>
- an enumerable that will enumerate the hits at the given coordinates
Defined in
Installs this manager for the specified CanvasComponent.
Remarks
Parameters
A map of options to pass to the method.
- canvas - CanvasComponent
- The CanvasComponent.
- graph - IGraph
- The graph.
Overrides
Lowers the visual representation of the item
below its current predecessor.
Remarks
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 group.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
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 group.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 - WebGL2Animation[]
- 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 - WebGL2Animation[]
- 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 - WebGL2Animation[]
- 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 style to use for the node when rendered in WebGL2 mode.
Parameters
A map of options to pass to the method.
- node - INode
- The node instance to specify the style for. The node must belong to the displayed graph.
- style - WebGL2ShapeNodeStyle | WebGL2IconNodeStyle | WebGL2GroupNodeStyle
- The style to use. Style instances may be shared among items and graphs.
Throws
- Exception({ name: 'NotSupportedError' })
- If this instance is not associated with a graph via a component.
See Also
Sets the style to use for the edge when rendered in WebGL2 mode.
Remarks
Parameters
A map of options to pass to the method.
- edge - IEdge
- The edge instance to specify the style for. The edge must belong to the displayed graph.
- style - WebGL2PolylineEdgeStyle | WebGL2ArcEdgeStyle | WebGL2BridgeEdgeStyle
- The style to use. Style instances may be shared among items and graphs.
Throws
- Exception({ name: 'NotSupportedError' })
- If this instance is not associated with a graph via a component.
See Also
Sets the style to use for the label when rendered in WebGL2 mode.
Parameters
A map of options to pass to the method.
- label - ILabel
- The label instance to specify the style for. The label must belong to the displayed graph.
- style - WebGL2DefaultLabelStyle | WebGL2IconLabelStyle
- The style to use. Style instances may be shared among items and graphs.
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
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
See Also
Defined in
typedHitElementsAt
<Textends IModelItem>(modelItemType: Class, context: IInputModeContext, location: Point, root: ICanvasObjectGroup) : IEnumerable<T>Enumerates hits on the canvas at a given world coordinate position in a given context.
Remarks
Type Parameters
- T: IModelItem
Parameters
A map of options to pass to the method.
- modelItemType - Class
- context - IInputModeContext
- The context to provide to isHit
- location - Point
- the world coordinates to perform the hit test
- root - ICanvasObjectGroup
- The group to search the subtree of.
Returns
- ↪IEnumerable<T>
- an enumerable that will enumerate the hits at the given coordinates
Overrides
Enumerates hits on the canvas at a given world coordinate position.
Remarks
Type Parameters
- T: IModelItem
Parameters
A map of options to pass to the method.
Returns
- ↪IEnumerable<T>
- an enumerable that will enumerate the hits at the given coordinates
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
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.
Occurs when the asynchronous compilation of WebGL2 shaders has started.
Remarks
Event Registration
addShadersCompilingListener(function(this, EventArgs):void)
Event Deregistration
removeShadersCompilingListener(function(this, EventArgs):void)