Free and Open source Web Builder Framework. Next generation tool for building templates without coding
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

1.8 KiB

CanvasSpot

Canvas spots are elements drawn on top of the canvas. They can be used to represent anything you might need but the most common use case of canvas spots is rendering information and managing components rendered in the canvas. Read here for more information about Canvas Spots

Properties

  • id String Spot ID.
  • type String Spot type.
  • component Component? Component to which the spot will be attached.
  • componentView ComponentView? ComponentView to which the spot will be attached.
  • boxRect Object? Fixed box rect of the spot, eg. { width: 100, height: 100, x: 0, y: 0 }.

getBoxRect

Get the box rect of the spot.

Parameters

  • opts Object (optional, default {})

Examples

canvasSpot.getBoxRect();
// { width: 100, height: 50, x: 0, y: 0 }

Returns Object The box rect object

getStyle

Get the style object of the spot.

Parameters

  • opts Object (optional, default {})

Examples

canvasSpot.getStyle();
// { width: '100px', height: '...', ... }

Returns CSSStyleDeclaration [opts]

isType

Check the spot type.

Parameters

Examples

canvasSpot.isType('select');

Returns Boolean