Constructor
new Labels(options)
Parameters
-
options
Object
Properties
-
dom
String
<optional>
window.documentDOM reference, required for testing
-
container
String
<optional>
HTML identifier used by d3.js
-
dom
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
hideUnrelated(node)
Visually hides elements unrelated to node parameter.
CSS styling is based on data-hidden
attribute set on the DOM element.
Parameters
-
node
Node
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
render(data)
Renders labels based on node data.
Parameters
-
data
Object
Overrides
Source
resetStyles()
Reset all styles, e.g. colors and visibility
Overrides
Source
setRelationships(node)
Classifies elements based on relationship to node parameter.
CSS styling is based on data-rel
attribute set on the DOM element.
Parameters
-
node
Node
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