New to Kendo UI for AngularStart a free 30-day trial

Surface

Class

An abstract class representing the top-level drawing surface. Cannot be directly instantiated.

Specific implementations are created through the static create method. The implementations for SVG and Canvas inherit from this base class.

Definition

Package:@progress/kendo-drawing

Methods

Binds to an event on the Surface.

Parameters:eventNameSurfaceEventName

The name of the event to bind to.

handler(e: any) => void

The event handler.

Returns:

Surface

  • The current Surface instance to allow chaining.

Clears the drawing surface.

Creates a drawing surface that matches the browser capabilities.

Parameters:elementHTMLElement

The DOM element that will host the surface.

options?SurfaceOptions

The configuration options for the surface.

Returns:

Surface

  • The newly created surface instance.

Releases the resources allocated by this instance.

The DOM elements will not be cleared.

Draws the element and its children on the surface. Existing elements are not affected.

Parameters:elementElement

The element to draw.

Returns the target drawing element of a DOM event.

Parameters:eany

The original DOM event object.

Returns:

Element

  • The target drawing element, if any.

Binds to an event once. The handler will be unbound after the first event fires.

Parameters:eventNameSurfaceEventName

The name of the event to bind to.

handler(e: any) => void

The event handler.

Returns:

Surface

  • The current Surface instance to allow chaining.

Resizes the surface to match the size of the container.

Parameters:force?boolean

Whether to proceed with resizing even if the container dimensions are not changed.

Unbinds an event handler.

Parameters:eventNameSurfaceEventName

The name of the event to bind to.

handler?(e: any) => void

The event handler.

Returns:

Surface

  • The current Surface instance to allow chaining.

Properties

Configuration options for the surface.