tracking-code-which-will-go-to-the-HEAD DefaultDrawer

Class

DefaultDrawer

DefaultDrawer(pluginData)

Class that draws a component in a graphical representation.
Constructor

# new DefaultDrawer(pluginData)

Default constructor
Parameters:
Name Type Description
pluginData DefaultData Plugin data storage.

View Source draw/DefaultDrawer.js, line 19

Members

object

# actions

Object to store all instances of actions.

View Source draw/DefaultDrawer.js, line 69

# componentRenderer

Component renderer.

View Source draw/DefaultDrawer.js, line 34

object

# d3

D3 library.

View Source draw/DefaultDrawer.js, line 63

DefaultLayout

# layout

Plugin layout system.

View Source draw/DefaultDrawer.js, line 45

# linkRenderer

Link renderer.

View Source draw/DefaultDrawer.js, line 39

DefaultData

# pluginData

Plugin data storage.

View Source draw/DefaultDrawer.js, line 29

Selection

# scene

D3 selection of the main scene.

View Source draw/DefaultDrawer.js, line 57

object

# states

Object to store all states of the scene.

View Source draw/DefaultDrawer.js, line 86

Selection

# viewport

D3 selection of the view port.

View Source draw/DefaultDrawer.js, line 51

Methods

# arrangeComponentsPosition(id, keepPosition)

Reorganize position and size of all components. This method does not refresh the view. You have to await it and trigger a redraw.
Parameters:
Name Type Description
id string The container within which we need to organize the children, and if not specified, all components will be reorganized.
keepPosition boolean If true only component without position will be reorganized.

View Source draw/DefaultDrawer.js, line 414

# clearActions()

Remove all instances of actions and remove all set events.

View Source draw/DefaultDrawer.js, line 146

# draw()

Components driven drawing.

View Source draw/DefaultDrawer.js, line 381

# dropComponent(component, event)

Drop component on scene.
Parameters:
Name Type Description
component Component Component to drop.
event object Mouse event.

View Source draw/DefaultDrawer.js, line 458

# exportSvg(id) → {string}

Export viewport as svg.
Parameters:
Name Type Description
id string Viewport id.

View Source draw/DefaultDrawer.js, line 492

Svg content.
string

# getScene() → {object}

Get scene width data.

View Source draw/DefaultDrawer.js, line 341

D3 selection of scene.
object

# getSceneData() → {object}

Format component dataset to d3 hierarchy.

View Source draw/DefaultDrawer.js, line 430

- Formated component dataset.
object

# init(id, readOnly)

Initialize drawing context.
Parameters:
Name Type Default Description
id string Html id of div that will be the drawing container.
readOnly boolean false Indicate if user can make action or modify the scene.

View Source draw/DefaultDrawer.js, line 101

# initActions()

Initialize actions and set event on viewport and other.

View Source draw/DefaultDrawer.js, line 167

# initComponentRenderer(readOnly) → {ComponentRenderer}

Initialize component renderer and return instance of it.
Parameters:
Name Type Description
readOnly boolean Indicate if user can make action or modify the scene.

View Source draw/DefaultDrawer.js, line 130

New instance of ComponentRenderer.

# initLinkRenderer(readOnly) → {LinkRenderer}

Initialize link renderer and return instance of it.
Parameters:
Name Type Description
readOnly boolean Indicate if user can make action or modify the scene.

View Source draw/DefaultDrawer.js, line 139

New instance of LinkRenderer.
LinkRenderer

# initScene()

Initialize the scene, set all markers component and link groups.

View Source draw/DefaultDrawer.js, line 354

# resize(id)

Resize the container to its minimum size.
Parameters:
Name Type Description
id string Container id.

View Source draw/DefaultDrawer.js, line 422