Class: Rubyvis::Layout::Network::Node

Inherits:
Object
  • Object
show all
Defined in:
lib/rubyvis/layout/network.rb

Overview

Represents a node in a network layout. There is no explicit constructor; this class merely 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

Instance Attribute Details

#indexObject

The node index, zero-based. This attribute is populated automatically based on the index in the array returned by the nodes property.

/



238
239
240
# File 'lib/rubyvis/layout/network.rb', line 238

def index
  @index
end

The link degree; the sum of link values for all incoming and outgoing links. This attribute is populated automatically.



244
245
246
# File 'lib/rubyvis/layout/network.rb', line 244

def link_degree
  @link_degree
end

#node_nameObject

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 nodeValue attribute.



251
252
253
# File 'lib/rubyvis/layout/network.rb', line 251

def node_name
  @node_name
end

#node_valueObject

The node value; optional. If present, and no nodeName 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.



259
260
261
# File 'lib/rubyvis/layout/network.rb', line 259

def node_value
  @node_value
end