Sha256: 8079ccb3112d3fab3dbe48afe77992fdc335a28c969db90b6cbc5ee886ff2acc

Contents?: true

Size: 969 Bytes

Versions: 4

Compression:

Stored size: 969 Bytes

Contents

$:.unshift( "../lib" );
require "graphviz"

g = GraphViz::new( "structs" )

g.node["shape"] = "plaintext"

g.add_node( "HTML" )

g.add_node( "struct1", "html" => '
<TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0">
  <TR>
    <TD>left</TD>
    <TD PORT="f1">mid dle</TD>
    <TD PORT="f2">right</TD>
  </TR>
</TABLE>' )

g.add_node( "struct2", "html" => '<TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0">  <TR><TD PORT="f0">one</TD><TD>two</TD></TR> </TABLE>' )
g.add_node( "struct3", "html" => '<TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0" CELLPADDING="4">  <TR>  <TD ROWSPAN="3">hello<BR/>world</TD>  <TD COLSPAN="3">b</TD>  <TD ROWSPAN="3">g</TD>  <TD ROWSPAN="3">h</TD>  </TR>  <TR>  <TD>c</TD><TD PORT="here">d</TD><TD>e</TD>  </TR>  <TR>  <TD COLSPAN="3">f</TD>  </TR> </TABLE>' )

g.add_edge( "struct1:f1", "struct2:f0" )
g.add_edge( "struct1:f2", "struct3:here" )

g.add_edge( "HTML", "struct1" )

g.output( :path => '/usr/local/bin/', :png => "#{$0}.png" )

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ruby-graphviz-0.9.11 examples/HTML-Labels.rb
ruby-graphviz-0.9.10 examples/HTML-Labels.rb
ruby-graphviz-0.9.9 examples/HTML-Labels.rb
ruby-graphviz-0.9.8 examples/HTML-Labels.rb