API Docs for:
Show:

GraphView Class

Defined in: view\GraphView.js:10
Module: modules

GraphView provides the SVG graph. Template: graph.html

Methods

activateTouch

()

This method activates touch gestures on the graph preventing the propagation of them on the whole page.

allConcurrentAnimationsCompleted

()

This method will be called at the end of all the concurrent animation on the graph. Use this method if you want to make some changes to the entire graph. Do not use this method to make changes to a particular vertex or edge, use instead dedicated event-triggered method in the relative views.

computeSubTrees

()

The objective of this method is to identify a set of trees composed of static paths that can be collapsed together and coloured with the same colour without introducing ambiguity. An ambiguity is generated when there is a cycle between two paths.

createAllNodes

()

This method initializes all the NodeView needed to represent the nodes of the model layer.

createAllPaths

()

This method initializes a PathView object for each source-target pair of the model layer. Hence a PathView represents the transition between a set of path objects of the model layer involving the same source-target pair. PathView uses events to update itself.

getPathColor

(
  • An
)
String

This method returns a unique color for a given PathView. The objective of this method is to provide unambiguous colours for the paths of the graph. As a first approach, the returned colours are taken from an array declared in config.js. The default array is generated using the CMC(l:c) colour algorithm. As a second approach, when the array of colours ends, a random generation is used. This second approach does not guarantee that the generated colours are distinguishable. Therefore, tune the array of colours to prevent as much as possible the second approach.

Parameters:

  • An Object

    instance of PathView

Returns:

String: An hexadecimal color

initialize

(
  • A
)

The initialization method of this object.

Parameters:

  • A Map

    map of parameters

render

()

This method draws this module (eg. inject the DOM and elements).

thereIsCycle

(
  • An
  • An
)
Boolean

This method checks if there is a cycle between two paths in order to understand if they can be collapsed together.

Parameters:

  • An Object

    instance of Path

  • An Object

    instance of Path

Returns:

Boolean: True if there is a cycle

update

()

This method is called during an animation. Use this method if you want to make some changes to the entire graph. Do not use this method to make changes to a particular vertex or edge, use instead dedicated event-triggered methods in the relative views.