Class: Rubyvis::Layout::Network::Node
- Defined in:
- lib/rubyvis/layout/network.rb
Overview
Represents a node in a network layout. This class mostly serves to document the attributes that are used on nodes in network layouts. (Note that hierarchical nodes place additional requirements on node representation, vis Rubyvis::Dom::Node.)
Instance Attribute Summary collapse
-
#index ⇒ Object
The node index, zero-based.
-
#link_degree ⇒ Object
The link degree; the sum of link values for all incoming and outgoing links.
-
#node_name ⇒ Object
The node name; optional.
-
#node_value ⇒ Object
The node value; optional.
Instance Attribute Details
#index ⇒ Object
The node index, zero-based. This attribute is populated automatically based on the index in the array returned by the nodes
property.
/
258 259 260 |
# File 'lib/rubyvis/layout/network.rb', line 258 def index @index end |
#link_degree ⇒ Object
The link degree; the sum of link values for all incoming and outgoing links. This attribute is populated automatically.
264 265 266 |
# File 'lib/rubyvis/layout/network.rb', line 264 def link_degree @link_degree end |
#node_name ⇒ Object
The node name; optional. If present, this attribute will be used to provide the text for node labels. If not present, the label text will fallback to the node_value
attribute.
271 272 273 |
# File 'lib/rubyvis/layout/network.rb', line 271 def node_name @node_name end |
#node_value ⇒ Object
The node value; optional. If present, and no node_name
attribute is present, the node value will be used as the label text. This attribute is also automatically populated if the nodes are specified as an array of ‘primitives’, such as strings or numbers.
275 276 277 |
# File 'lib/rubyvis/layout/network.rb', line 275 def node_value @node_value end |