Newton Graph Library

Newton Graph Library

Class

Labels

Extends

Encapsulates what is needed to draw <text> to represent labels of nodes of the network graph.

Constructor

new Labels(options)

Parameters

  • options Object

    Properties

    • dom String <optional>
      window.document

      DOM reference, required for testing

    • container String <optional>

      HTML identifier used by d3.js

Source

Methods

bindGraph(graph)

Binds this view to a graph so we can react to changes and re-render and adjust the graph as necessary.

Parameters

  • graph Graph

    graph to listen to for changes

Overrides

Source

position()

Re-calculates and repositions elements using current data. This is used by the webcola layout adapter for "less noisy" network visualizations.

Overrides

Source

Events

enter

An Array of entering Labels, i.e. labels to be added per d3.js general update pattern.

Type

  • Array

exit

An Array of exiting labels, i.e. labels to be added per d3.js general update pattern.

Type

  • Array

update

An Array of combined existing and new Labels, per d3.js general update pattern.

Type

  • Array