documentationfor yFiles for HTML 2.6

CanvasComponent

The CanvasComponent can be used to efficiently display all kinds of data.

Inheritance Hierarchy
Implemented Interfaces

Remarks

The control supports high performance zooming and panning of visual content and provides a high level view of the visual tree. The control uses double precision world-coordinates to render items that are composed using a visual tree. In its most simple form the scene graph is a tree-like structure of elements that will be rendered in depth-first-search order.

The scene graph tree is made up of ICanvasObject elements. Multiple elements are grouped in ICanvasObjectGroup elements. An ICanvasObject consists of a user object and an ICanvasObjectDescriptor that is used by the rendering engine to query interfaces that perform the actual creation of the Visuals, hit testing, and bounds calculation.

A projection that is applied to the whole scene graph can be set to simulate different parallel projections of the CanvasComponent's content (e.g. isometric).

This component handles the following commands by default:

The handlers for INCREASE_ZOOM and DECREASE_ZOOM use the specified command parameter as the factor by which the zoom value is multiplied or divided, respectively. The parameter is not required. If it is not present a default value is used. The handler for the ZOOM command needs a parameter. The parameter can either be a number which is interpreted as the new zoom level, or it can be a suitable object. Supported objects are Rect, Point and ILookup. If a rectangle is specified as the parameter for the ZOOM command, the handler adjusts the viewport such that the rectangle tightly fits into it. If a point is specified, the handler sets the center to that point. If the parameter implements ILookup, then the handler tries to get a IBoundsProvider from the lookup and uses the bounds obtained from the bounds provider as the rectangle to zoom to.

Related Reading in the Developer's Guide

CanvasComponent is discussed in detail in the section The Component for Displaying Graphs.

Type Details

yfiles module
view-component
yfiles-umd modules
All view modules
Legacy UMD name
yfiles.view.CanvasComponent

See Also

Constructors

Properties

Methods

Events

Default Properties

Static Methods