Ember.Vertex Class packages/ember-application/lib/system/dag.js:43

DAG Vertex

Show:

Methods

Show:

add

(name) private

Adds a vertex entry to the graph unless it is already added.

Parameters:

name String
The name of the vertex to add

addEdge

(fromName, toName) private

Connects the vertices with the given names, adding them to the graph if necessary, only if this does not produce is any circular dependency.

Parameters:

fromName String
The name the vertex where the edge starts.
toName String
The name the vertex where the edge ends.

addEdges

(name, value, before, after)

Adds a vertex with the given name and value to the graph and joins it with the vertices referenced in before and after. If there isn't vertices with those names, they are added too.

If either before or after are falsy/empty, the added vertex will not have an incoming/outgoing edge.

Parameters:

name String
The name of the vertex to be added.
value
The value of that vertex.
before
An string or array of strings with the names of the vertices before which this vertex must be visited.
after
An string or array of strings with the names of the vertex after which this vertex must be visited.

map

(name, value) private

Adds a vertex to the graph and sets its value.

Parameters:

name String
The name of the vertex.
value
The value to put in the vertex.

topsort

(fn)

Visits all the vertex of the graph calling the given function with each one, ensuring that the vertices are visited respecting their precedence.

Parameters:

fn Function
The function to be invoked on each vertex.