Class: Rubyvis::Layout::Network::Link
- Defined in:
- lib/rubyvis/layout/network.rb
Overview
Represents a link in a network layout. This class mostly serves to document the attributes that are used on links in network layouts. For hierarchical layouts, this class is used to represent the parent-child links.
Instance Attribute Summary collapse
-
#link_value ⇒ Object
Returns the value of attribute link_value.
-
#source ⇒ Object
Alias for
sourceNode
, as expressed by the index of the source node. -
#source_node ⇒ Object
The link’s source node.
-
#target ⇒ Object
Alias for
targetNode
, as expressed by the index of the target node. -
#target_node ⇒ Object
The link’s target node.
-
#value ⇒ Object
Alias for
linkValue
.
Instance Method Summary collapse
-
#initialize(opts) ⇒ Link
constructor
A new instance of Link.
Constructor Details
#initialize(opts) ⇒ Link
Returns a new instance of Link.
287 288 289 290 291 |
# File 'lib/rubyvis/layout/network.rb', line 287 def initialize(opts) @source_node=opts.delete :source_node @target_node=opts.delete :target_node @link_value=opts.delete :link_value end |
Instance Attribute Details
#link_value ⇒ Object
Returns the value of attribute link_value.
298 299 300 |
# File 'lib/rubyvis/layout/network.rb', line 298 def link_value @link_value end |
#source ⇒ Object
Alias for sourceNode
, as expressed by the index of the source node. This attribute is not populated automatically, but may be used as a more convenient identification of the link’s source, for example in a static JSON representation.
319 320 321 |
# File 'lib/rubyvis/layout/network.rb', line 319 def source @source end |
#source_node ⇒ Object
The link’s source node. If not set, this value will be derived from the source
attribute index.
305 306 307 |
# File 'lib/rubyvis/layout/network.rb', line 305 def source_node @source_node end |
#target ⇒ Object
Alias for targetNode
, as expressed by the index of the target node. This attribute is not populated automatically, but may be used as a more convenient identification of the link’s target, for example in a static JSON representation.
327 328 329 |
# File 'lib/rubyvis/layout/network.rb', line 327 def target @target end |
#target_node ⇒ Object
The link’s target node. If not set, this value will be derived from the target
attribute index.
311 312 313 |
# File 'lib/rubyvis/layout/network.rb', line 311 def target_node @target_node end |
#value ⇒ Object
Alias for linkValue
. This attribute is not populated automatically, but may be used instead of the linkValue
attribute when specifying links.
333 334 335 |
# File 'lib/rubyvis/layout/network.rb', line 333 def value @value end |