Sha256: cd5f6adb44150bb42e23b9b0cb8c6341255236eb54be50380bb080470f6660a3

Contents?: true

Size: 596 Bytes

Versions: 8

Compression:

Stored size: 596 Bytes

Contents

require 'graphviz'

def entity_node(label)
  ent = @g.add_nodes(label)
  ent.color = "#F3F781"
  ent.style = "filled"
  ent
end

def agent_node(label)
  ag = @g.add_nodes(label)
  ag.color = "#FE9A2E"
  ag.style = "filled"
	ag.shape = "box"
	ag
end

def activity_node(label)
  act = @g.add_nodes(label)
  act.color = "#5858FA"
  act.style = "filled"
  act.shape = "box"
  act
end

@g = GraphViz.new(:G, type: :digraph)
g = @g

ent_n = entity_node("entity") #g.add_nodes("entity")
ag_n = activity_node("activity")

g.add_edges(ent_n,ag_n).label="attributed"

g.output(png: "out.png")
`eog out.png`

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
publisci-0.1.6 examples/visualization/viz.rb
publisci-0.1.5 examples/visualization/viz.rb
publisci-0.1.4 examples/visualization/viz.rb
publisci-0.1.3 examples/visualization/viz.rb
publisci-0.1.2 examples/visualization/viz.rb
bio-publisci-0.1.0 examples/visualization/viz.rb
bio-publisci-0.0.8 examples/visualization/viz.rb
bio-publisci-0.0.7 examples/visualization/viz.rb