Class: Rubyvis::Layout::Network::Link

Inherits:
Object
  • Object
show all
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.

See Also:

  • pvpv.Layoutpv.Layout.Network

Instance Attribute Summary collapse

Instance Method Summary collapse

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

Returns the value of attribute link_value.



298
299
300
# File 'lib/rubyvis/layout/network.rb', line 298

def link_value
  @link_value
end

#sourceObject

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_nodeObject

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

#targetObject

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_nodeObject

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

#valueObject

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