Integration
Integration manages plugins. It is the M(odel) in M(odel)VM(Viewmodel). This class can be reflected by any MVM framework such as React, Angular, Vue and others. Both Integration and Plugins keep critical data from leaking by relying on internals under this.* and modeldata under this.data.
Constructor Summary
| Public Constructor | ||
| public |
constructor(options: Object): Object Construct a new Integration layer |
|
Member Summary
| Public Members | ||
| public |
canvas: * |
|
| public |
data: * |
|
| public |
handler: * |
|
| public |
plugins: * |
|
| public |
selection: * |
|
| public |
socket: * |
|
| public |
view: * |
|
Method Summary
| Public Methods | ||
| public |
clear() Delete all plugins by calling this.destroy on them. |
|
| public |
destroy(plugin: *) Destroys a plugin. |
|
| public |
disable(plugin: *) Disables a plugin. |
|
| public |
enable(plugin: *) Enables a plugin. |
|
| public |
getActive(): * Returns active plugin |
|
| public |
resolve(plugin: *): * Resolves a plugin by name, reference of data reference (plugin.data) |
|
| public |
show(plugin: *) |
|
| public |
toggle(plugin: *) Toggles a plugin |
|
| public |
use(plugins: ...*) Tells Integration to register a plugin |
|
Public Constructors
public constructor(options: Object): Object source
Construct a new Integration layer
Params:
| Name | Type | Attribute | Description |
| options | Object |
|
Options to initialize the Canvas with |
| options.view | Object |
|
The view |
| options.socket | Object |
|
A socket, if existent |
| options.hover | function |
|
function(object, selected) defining a hovered event |
| options.unhover | function |
|
function(object, selected) defining a unhovered event |
| options.select | function |
|
function(object) object has been selected |
| options.unselect | function |
|
function(object) object has been unselected |
Public Members
public canvas: * source
public data: * source
public handler: * source
public plugins: * source
public selection: * source
public socket: * source
public view: * source
Public Methods
public destroy(plugin: *) source
Destroys a plugin. Calls this.disable on it, invokes the plugins Plugin.Events.Destroyed event and calls its onDestroyed prototype function.
Params:
| Name | Type | Attribute | Description |
| plugin | * |
public disable(plugin: *) source
Disables a plugin. Invokes the plugins Plugin.Events.Disabled event and calls its onDisabled prototype function.
Params:
| Name | Type | Attribute | Description |
| plugin | * |
public enable(plugin: *) source
Enables a plugin. Invokes the plugins Plugin.Events.Enabled event and calls its onEnabled prototype function.
Params:
| Name | Type | Attribute | Description |
| plugin | * |
public resolve(plugin: *): * source
Resolves a plugin by name, reference of data reference (plugin.data)
Params:
| Name | Type | Attribute | Description |
| plugin | * |
Return:
| * |
public show(plugin: *) source
Params:
| Name | Type | Attribute | Description |
| plugin | * |
public use(plugins: ...*) source
Tells Integration to register a plugin
Params:
| Name | Type | Attribute | Description |
| plugins | ...* |