Constructor
new Links(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)
Hides all links unrelated to node parameter.
CSS styling is based on data-hidden
attribute set on the <line>
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 links, adding <line>
s to our <svg>
canvas.
Parameters
-
data
Object
Overrides
Source
resetStyles()
Reset all styles, e.g. colors and removes arrowheads.
Overrides
Source
setRelationships(node)
Classifies all links, based on relationship to node parameter.
CSS styling is based on data-rel
attribute set on the <line>
element.
Parameters
-
node
Node
Overrides
Source
showAll()
Shows all Links, resetting the data-hidden
attribute used for CSS styling.
Source
showArrows(node, optionsopt)
Adds directional arrows to indicate source-target relationship between nodes.
Parameters
-
node
Node
-
options
Object
<optional>
{}Properties
-
color
Boolean
<optional>
true -
showAll
Boolean
<optional>
trueIf set to
true
, this view will draw all arrows, even if link has no relationship tonode
.
-
color
Source
Events
enter
An Array
of entering links, i.e. links to be added per d3.js general update pattern.
Type
-
Array
Listeners of this event
exit
An Array
of exiting links, i.e. links to be removed per d3.js general update pattern.
Type
-
Array
Listeners of this event
update
An Array
of combined existing and new links, per d3.js general update pattern.
Type
-
Array