forked from GrapesJS/grapesjs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
138 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
<!-- Generated by documentation.js. Update this documentation by updating the source code. --> | ||
|
||
## 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][1] | ||
|
||
[Component]: component.html | ||
|
||
### Properties | ||
|
||
* `id` **[String][2]** Spot ID. | ||
* `type` **[String][2]** Spot type. | ||
* `component` **[Component]?** Component to which the spot will be attached. | ||
* `componentView` **ComponentView?** ComponentView to which the spot will be attached. | ||
* `boxRect` **[Object][3]?** 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][3]** (optional, default `{}`) | ||
|
||
#### Examples | ||
|
||
```javascript | ||
canvasSpot.getBoxRect(); | ||
// { width: 100, height: 50, x: 0, y: 0 } | ||
``` | ||
|
||
Returns **[Object][3]** The box rect object | ||
|
||
### getStyle | ||
|
||
Get the style object of the spot. | ||
|
||
#### Parameters | ||
|
||
* `opts` **[Object][3]** (optional, default `{}`) | ||
|
||
#### Examples | ||
|
||
```javascript | ||
canvasSpot.getStyle(); | ||
// { width: '100px', height: '...', ... } | ||
``` | ||
|
||
Returns **CSSStyleDeclaration** \[opts] | ||
|
||
### isType | ||
|
||
Check the spot type. | ||
|
||
#### Parameters | ||
|
||
* `type` **[String][2]** | ||
|
||
#### Examples | ||
|
||
```javascript | ||
canvasSpot.isType('select'); | ||
``` | ||
|
||
Returns **[Boolean][4]** | ||
|
||
[1]: https://github.com/GrapesJS/grapesjs/blob/dev/docs/modules/Canvas.md#canvas-spots | ||
|
||
[2]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String | ||
|
||
[3]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object | ||
|
||
[4]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters