API Docs for:
Show:

Topology Class

Topology models and renders the SVG of the envionment topology with its associated behaviors.

The line of where to put code (in the Topology vs a Module) is not 100% clear. The rule of thumb to follow is that shared state, policy and configuration belong here. If the only shared requirement on shared state is watch/event like behavior, fire an event and place the logic in a module.

Emitted events:

  • zoom: When the zoom level of the canvas changes a 'zoom' event is fired. Analogous to d3's zoom event.

Methods

attachContainer

() chainable

Called by render, conditionally attach container to the DOM if it isn't already. The framework calls this before module rendering so that d3 Events will have attached DOM elements. If your application doesn't need this behavior feel free to override.

In this case we currently rely on app.showView to do all the container management, this only works on a preserved view.

detachContainer

()

Remove container from DOM returning container. This is explicitly not chainable.

Properties

db

models.Database

env

store.Environment

size!~YUIDOC_LINE~!A [width, height] tuple representing canvas size.

Array