Home Reference Source Repository
import Integration from 'awv3-next/plugin/integration.js'
public class | source

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

Construct a new Integration layer

Member Summary

Public Members
public

canvas: *

public

data: *

public

handler: *

public

options: *

public

plugins: *

public
public
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

removeSelection(plugin: *, keep: boolean)

public

resolve(plugin: *): *

Resolves a plugin by name, reference of data reference (plugin.data)

public

show(plugin: *)

public

toggle(plugin: *)

Toggles a plugin

public

toggleSelection(element: *, flag: *)

public

use(plugins: ...*)

Tells Integration to register a plugin

Public Constructors

public constructor(options: Object): Object source

Construct a new Integration layer

Params:

NameTypeAttributeDescription
options Object
  • optional
  • default: {}

Options to initialize the Canvas with

options.view Object
  • optional

The view

options.socket Object
  • optional

A socket, if existent

options.hover function
  • optional

function(object, selected) defining a hovered event

options.unhover function
  • optional

function(object, selected) defining a unhovered event

options.select function
  • optional

function(object) object has been selected

options.deselect function
  • optional

function(object) object has been deselected

Return:

Object

The constructed Integration

Public Members

public canvas: * source

public data: * source

public handler: * source

public options: * source

public plugins: * source

public selectedElement: * source

public selection: * source

public socket: * source

public view: * source

Public Methods

public clear() source

Delete all plugins by calling this.destroy on them.

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:

NameTypeAttributeDescription
plugin *

public disable(plugin: *) source

Disables a plugin. Invokes the plugins Plugin.Events.Disabled event and calls its onDisabled prototype function.

Params:

NameTypeAttributeDescription
plugin *

public enable(plugin: *) source

Enables a plugin. Invokes the plugins Plugin.Events.Enabled event and calls its onEnabled prototype function.

Params:

NameTypeAttributeDescription
plugin *

public removeSelection(plugin: *, keep: boolean) source

Params:

NameTypeAttributeDescription
plugin *
keep boolean
  • optional
  • default: false

public resolve(plugin: *): * source

Resolves a plugin by name, reference of data reference (plugin.data)

Params:

NameTypeAttributeDescription
plugin *

Return:

*

public show(plugin: *) source

Params:

NameTypeAttributeDescription
plugin *

public toggle(plugin: *) source

Toggles a plugin

Params:

NameTypeAttributeDescription
plugin *

public toggleSelection(element: *, flag: *) source

Params:

NameTypeAttributeDescription
element *
flag *

public use(plugins: ...*) source

Tells Integration to register a plugin

Params:

NameTypeAttributeDescription
plugins ...*