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.
/
261 262 263 |
# File 'lib/rubyvis/layout/network.rb', line 261 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.
267 268 269 |
# File 'lib/rubyvis/layout/network.rb', line 267 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.
274 275 276 |
# File 'lib/rubyvis/layout/network.rb', line 274 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.
278 279 280 |
# File 'lib/rubyvis/layout/network.rb', line 278 def node_value @node_value end |