I

IRenderContext

An interface that describes the current context for rendering routines.
ImplementsInheritance Hierarchy

Members

Show:

Properties

Gets the Canvas that is associated with this context.
readonlyabstract
Gets the clipping rectangle in world coordinates.

Rendering outside of this clip may be skipped altogether.

Usually this is the viewport rectangle of the canvasComponent, but may also be a sub-region of it. For image export or printing, this is the rectangle that's exported or printed on a page.

readonlyabstract
Provides access to the defs element in the SVG DOM that is managed by this instance.
readonlyabstract

See Also

API
svgDefsManager
Gets the radius for hit tests and marquee selection tests in world coordinates.

In the default implementations, this property automatically distinguishes between different radii depending on the last interaction event type.

This value already takes the zoom level into account.

readonlyabstract

See Also

Developer's Guide
Gets a transform that can be added to the transform list of a visual to be displayed in the intermediate coordinate system (which still has the same axes directions as the world coordinate system, but doesn't include the projection).
In contrast to the world coordinate system where the logical coordinates of the elements that are managed by a CanvasComponent (for example, graph elements like node and edges), the intermediate coordinate system is used to display visualizations that are independent of scale (zoom) or translation transformations (like handles or selection indicators).
readonlyabstract

Property Value

The transform to display elements in the intermediate coordinate system.
Gets a transform that is applied to the contents of the clip rectangle.
Provides access to the SvgDefsManager that manages this instance.
Gets a transform that can be added to the transform list of a visual to be displayed in the view coordinate system.
The view coordinate system includes the projection and may change directions of axes when using, e.g. an isometric transform. To display elements that are only invariant to the zoom factor, the intermediate coordinate system may be a better choice.
readonlyabstract

Property Value

The transform to display elements in the view coordinate system.

See Also

Developer's Guide
Provides access to the WebGLSupport that provides convenience methods for WebGL rendering.
Gets the current zoom level that is the ratio of world coordinates to screen pixels.
readonlyabstract

Methods

Notifies the context that the visual has been removed from the visual tree.

This has to be done in a IVisualCreator's updateVisual method if a IVisualCreator's createVisual is called or a previously added visual will be removed or replaced. Calling this method will call a previously registered dispose visual callback that the visual has been removed and needs to free its resources.

If the visual has not been registered previously this method will do nothing.

Parameters

visual: Visual
The visual which has been removed.

See Also

API
setDisposeCallback, IVisualCreator, updateVisual
Adds an element to the defs section of the document, if it has not been added yet.
abstract

Parameters

defsSupport: ISvgDefsCreator
The instance that is used to create and update the element and to query if the element is still referenced

Return Value

string
The id of the element with which it can be referenced using an url reference.
Converts the given set of intermediate coordinates to a coordinate pair that can be used to render within the viewTransform.
If projection is IDENTITY, this method has no effect
abstract

Parameters

intermediatePoint: Point
The coordinates in the intermediate coordinate system.

Return Value

Point
The coordinates in the view coordinate system.
Returns an instance that implements the given type or null.
Typically, this method will be called to obtain a different view or aspect of the current instance. This is quite similar to casting or using a super type or interface of this instance, but is not limited to inheritance or compile-time constraints. An instance implementing this method is not required to return non-null implementations for the types, nor does it have to return the same instance any time. Also, it depends on the type and context whether the instance returned stays up to date or needs to be re-obtained for further use.
abstract

Parameters

type: Constructor<T>
the type for which an instance shall be returned

Return Value

T
an instance that is assignable to the type or null

See Also

Developer's Guide

Defined in

ILookup.lookup
Registers a visual if children have registered themselves for disposal.

This is necessary for visual creators which delegate to another visual creator to create one or more child visuals, like style decorators.

Implementors have to add a call to this method at the end of their createVisual and updateVisual methods.

The registered callback has to call childVisualRemoved on all child visuals of the visual.

Parameters

visual: TVisual
The visual to be registered. This is the visual which is returned by the createVisual or updateVisual method which calls this method.
callback: function(IRenderContext, TVisual, boolean): TVisual
A dispose visual callback which calls childVisualRemoved on all child visuals of the registered visual.
Registers a callback which will be called when the visual will be removed from the visual tree.

This applies to a IVisualCreator's createVisual method if the created visual allocates resources which should be freed after the visual is no longer used. In this case, the visual has to be registered together with a dispose visual callback which can free the allocated resources. The callback will be called by the framework when the visual is removed from the visual tree.

The callback can also be used to support caching for temporarily removed visuals. See dispose visual callback.

Parameters

visual: TVisual
The visual which needs to be disposed after removal.
callback: function(IRenderContext, TVisual, boolean): TVisual
A callback which will dispose the visual.

See Also

API
IVisualCreator, createVisual
Converts the given set of world coordinates to a coordinate pair that can be used to render within the intermediateTransform.
If projection is IDENTITY, this method returns the same value as worldToViewCoordinates.
abstract

Parameters

worldPoint: Point
The coordinates in the world coordinate system.

Return Value

Point
The coordinates in the intermediate coordinate system.
Converts the given set of world coordinates to a coordinate pair that can be used to render within the viewTransform.
abstract

Parameters

worldPoint: Point
The coordinates in the world coordinate system.

Return Value

Point
The coordinates in the view coordinate system.

See Also

API
viewTransform