API Docs for:
Show:

RelationModule Class

Module: topology.relation
Parent Module: topology

Manage relation rendering and events.

Emitted events:

  • clearState: clear all possible states that the environment view can be in as it pertains to actions (building a relation, viewing a service menu, etc.)
  • hideServiceMenu: hide the service menu after the 'Add Relation' item was clicked.
  • fade: fade services that are not valid endpoints for a pending relation.
  • show: show faded services at 100% opacity again.
  • resized: ensure that menus are positioned properly.

Methods

action Hides the dialog on click.

(
  • e
)
Undefined

Parameters:

  • e Object

    The click event.

Returns:

Undefined: nothing.

clearState

() Undefined

Clear any states such as building a relation or showing subordinate relations.

Returns:

Undefined: side effects only.

decorateRelations

(
  • relations
)
Array

Parameters:

  • relations Array

    The relations currently in effect.

Returns:

Array: Relation pairs.

events.scene.add-relation.click

()

The user clicked on the "Build Relation" menu item.

events.scene.dragline.click

()

The user clicked while the dragline was active.

hideSubordinateRelations

() Undefined

Hide subordinate relations.

Returns:

Undefined: nothing.

mousemove

(
  • d
  • self
)
Undefined

If the mouse moves and we are adding a relation, then the dragline needs to be updated.

Parameters:

  • d Object

    Unused.

  • self Object

    The environment view itself.

Returns:

Undefined: Side effects only.

mouseMoveHandler

(
  • evt
)
Undefined

Handler for when the mouse is moved over a service.

Parameters:

  • evt Object

    Event facade.

Returns:

Undefined: Side effects only.

showSubordinateRelations

(
  • subordinate
)
Undefined

Show subordinate relations for a service.

Parameters:

  • subordinate Object

    The sub-rel-block g element in the form of a DOM node.

Returns:

Undefined: nothing.

startRelation

(
  • service
)
Undefined

An "add relation" action has been initiated by the user.

Parameters:

  • service Object

    The service that is the source of the relation.

Returns:

Undefined: Side effects only.

subRelBlockClick

(
  • d
  • self
)

Toggle the visibility of subordinate relations for visibility or removal.

Parameters:

  • d Object

    The data-bound object (the subordinate).

  • self Object

    The view.

updateLinkEndpoints

(
  • evt
)

Update relation line endpoints for a given service.

Parameters:

  • evt Object

    The event facade that was fired. This should have a 'service' property mixed in when fired.

Events

addRelationDrag

Ensure the dragline follows the cursor when moved.

addRelationDragEnd

Complete adding a relation when dragging to create it.

Event Payload:

  • box Object

    The starting service's BoxModel.

addRelationDragStart

Begin the process of adding a relation when dragging to create it.

Event Payload:

  • box Object

    The ending service's BoxModel.

cancelRelationBuild

Cancel building a relation when dragging to create it.

Event Payload:

  • box Object

    The starting service's BoxModel.

clearState

Clear view state as pertaining to relations.

mouseMove

Ensure that mousemove events bubble to canvas when moving over a relation line/label.

rendered

Render relations at an appropriate time.

servicesRendered

Update relations after services are rendered.

Event Payload:

  • service Object

    The model for the service that was moved.

snapOutOfService

Ensure the dragline follows the cursor outside of services.

snapToService

Ensure the dragline snaps to service when the cursor is inside one.

Event Payload:

  • d Object

    The service model wrapped in a BoxModel object.

  • rect Object

    The SVG rect element for the service.

updateLinkEndpoints

Update the endpoints for relations when services are moved.

Event Payload:

  • service Object

    The service which has had its position updated.