ruby-graphviz-1.2.3/0000755000004100000410000000000013111037426014354 5ustar www-datawww-dataruby-graphviz-1.2.3/Rakefile0000644000004100000410000000332613111037426016025 0ustar www-datawww-data$:.unshift( "lib" ) require "graphviz/constants" require 'rubygems' require 'rake/clean' require 'bundler' require 'rubygems/package_task' require 'rdoc/task' require 'rake/testtask' require 'fileutils' require 'open-uri' include FileUtils CLEAN.include ['**/.*.sw?', '*.gem', '.config', 'test/test.log'] RDOC_OPTS = ['--quiet', '--title', "Ruby/GraphViz, the Documentation", "--opname", "index.html", "--line-numbers", "--main", "README.rdoc"] desc "Packages up Ruby/GraphViz." task :default => [:test, :package] task :package => [:clean] task :doc => :rdoc RDoc::Task.new do |rdoc| rdoc.rdoc_dir = 'doc/rdoc' rdoc.options += RDOC_OPTS rdoc.main = "README.rdoc" rdoc.title = "Ruby/GraphViz, the Documentation" rdoc.rdoc_files.add ['README.rdoc', 'CHANGELOG.rdoc', 'AUTHORS.rdoc', 'COPYING.rdoc', 'lib/graphviz.rb', 'lib/graphviz/node.rb', 'lib/graphviz/edge.rb', 'lib/graphviz/constants.rb', 'lib/graphviz/xml.rb', 'lib/graphviz/graphml.rb', 'lib/graphviz/family_tree.rb', 'lib/graphviz/family_tree/couple.rb', 'lib/graphviz/family_tree/generation.rb', 'lib/graphviz/family_tree/person.rb', 'lib/graphviz/family_tree/sibling.rb'] end Rake::TestTask.new(:test) do |t| t.libs << 'lib' << 'test' t.verbose = true require 'graphviz/utils' include GraphViz::Utils test_files = FileList['test/test_*.rb'] test_files.exclude("test/test_examples.rb") unless find_executable("dot", nil) p test_files t.test_files = test_files end desc "Generate man pages" task :man do unless RUBY_PLATFORM == 'java' require 'ronn' chdir 'man' do sh "ronn -r *.ronn" end else puts "Can't generate man pages with JRuby" end end Bundler::GemHelper.install_tasks ruby-graphviz-1.2.3/bin/0000755000004100000410000000000013111037426015124 5ustar www-datawww-dataruby-graphviz-1.2.3/bin/xml2gv0000755000004100000410000000632413111037426016276 0ustar www-datawww-data#!/usr/bin/env ruby # Copyright (C) 2005 - 2012 Gregoire Lejeune # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA require 'rubygems' require 'getoptlong' require 'graphviz/xml' def usage puts "usage: xml2gv [-Tformat] [-ofile] [-h] [-V] script" puts "-T, --output-format format Output format (default: PNG)" puts "-o, --output-file file Output file (default: STDOUT)" puts "-p, --path Graphviz path" puts "-u, --use PROGRAM Program to use (default: dot)" puts "-V, --version Show version" puts "-h, --help Show this usage message" end def version puts "XML2GraphViz v#{GraphViz::Constants::RGV_VERSION}, (c)2010 Gregoire Lejeune " puts "" puts "This program is free software; you can redistribute it and/or modify" puts "it under the terms of the GNU General Public License as published by" puts "the Free Software Foundation; either version 2 of the License, or" puts "(at your option) any later version." puts "" puts "This program is distributed in the hope that it will be useful," puts "but WITHOUT ANY WARRANTY; without even the implied warranty of" puts "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the" puts "GNU General Public License for more details." puts "" puts "You should have received a copy of the GNU General Public License" puts "along with this program; if not, write to the Free Software" puts "Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA" end xOutFormat = "png" xOutFile = nil xGVPath = "" xUse = "dot" oOpt = GetoptLong.new( ['--output-format', '-T', GetoptLong::REQUIRED_ARGUMENT], ['--output-file', '-o', GetoptLong::REQUIRED_ARGUMENT], ['--path', '-p', GetoptLong::REQUIRED_ARGUMENT], ['--use', '-u', GetoptLong::REQUIRED_ARGUMENT], ['--help', '-h', GetoptLong::NO_ARGUMENT], ['--version', '-V', GetoptLong::NO_ARGUMENT] ) begin oOpt.each_option do |xOpt, xValue| case xOpt when '--output-format' xOutFormat = xValue when '--output-file' xOutFile = xValue when '--path' xGVPath = xValue when '--use' xUse = xValue when '--help' usage( ) exit when '--version' version( ) exit end end rescue GetoptLong::InvalidOption usage( ) exit end xFile = ARGV[0] if xFile.nil? usage( ) exit end gvxml = GraphViz::XML::new( xFile, :text => true, :attrs => true ) gvxml.graph.output( xOutFormat => xOutFile, :path => xGVPath ) ruby-graphviz-1.2.3/bin/git2gv0000755000004100000410000001165013111037426016257 0ustar www-datawww-data#!/usr/bin/env ruby # Copyright (C) 2010 Gregoire Lejeune # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA require 'rubygems' require 'getoptlong' require 'graphviz' class Git2Gv def initialize( xGVPath, xOutFile, xOutFormat, bNothugly ) @xGVPath, @xOutFile, @xOutFormat, @bNothugly = xGVPath, xOutFile, xOutFormat.to_sym, bNothugly end def run git = GraphViz.new( :G, :path => @xGVPath ) git.node[:shape => "record"] branches.each do |branch| git.add_nodes( branch, :style => "filled", :fillcolor => :lightgrey ) end commits.each do |commit| git.add_nodes( commit[:short], :style => "filled", :fillcolor => :lightblue, :label => "{ #{commit[:long]} |{ #{commit[:comment].gsub(/\{/, "\\{").gsub(/\}/, "\\}").gsub(/\|/, "\\|").gsub(//, "\\>")}}| { #{commit[:commiter]} | #{commit[:date]} } }" ) end refs.each do |from, to| git.add_edges( from, to ) end relations.each do |from, to| git.add_edges( to, from, :dir => "back" ) end git.output( @xOutFormat => @xOutFile, :nothugly => @bNothugly ) end # private def cmd(c, &blk) `#{c}`.split($/).map(&blk || proc {|a| a }) end def commits @commits ||= begin data = [] cmd('git log --pretty=format:"%h - %H - %s - %cn - %cd" --date=short').each do |commit| x = commit.split( " - " ) data << { :short => x[0], :long => x[1], :comment => x[2], :commiter => x[3], :date => x[4] } end data end end def relations @rels ||= cmd("git log --pretty=format:\"%h %p\"") { |l| c, *parents = l.split parents.map {|p| [p, c] } }.flatten(1) end def branches @branches ||= cmd("git branch") {|b| b[2..-1] } end def refs branches.inject({}) {|h,b| h.tap { h[b] = `git log -1 #{b} --pretty=format:"%h"` } } end def current_branch cmd("git branch").select {|l| l =~ /^\*/ }.first.strip[2..-1] end end def usage puts "usage: git2gv [-Tformat] [-ofile] [-h] [-V]" puts "-T, --output-format format Output format (default: png)" puts " --nothugly Use nothugly if SVG output" puts "-o, --output-file file Output file (default: STDOUT)" puts "-p, --path Graphviz path" puts "-V, --version Show version" puts "-h, --help Show this usage message" end def version puts "Git2GraphViz v#{GraphViz::Constants::RGV_VERSION}, (c)2010 Gregoire Lejeune " puts "" puts "This program is free software; you can redistribute it and/or modify" puts "it under the terms of the GNU General Public License as published by" puts "the Free Software Foundation; either version 2 of the License, or" puts "(at your option) any later version." puts "" puts "This program is distributed in the hope that it will be useful," puts "but WITHOUT ANY WARRANTY; without even the implied warranty of" puts "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the" puts "GNU General Public License for more details." puts "" puts "You should have received a copy of the GNU General Public License" puts "along with this program; if not, write to the Free Software" puts "Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA" end oOpt = GetoptLong.new( ['--output-format', '-T', GetoptLong::REQUIRED_ARGUMENT], ['--output-file', '-o', GetoptLong::REQUIRED_ARGUMENT], ['--path', '-p', GetoptLong::REQUIRED_ARGUMENT], ['--nothugly', GetoptLong::NO_ARGUMENT], ['--help', '-h', GetoptLong::NO_ARGUMENT], ['--version', '-V', GetoptLong::NO_ARGUMENT] ) xOutFormat = "png" xOutFile = nil xGVPath = "" bNothugly = false begin oOpt.each_option do |xOpt, xValue| case xOpt when '--output-format' xOutFormat = xValue when '--output-file' xOutFile = xValue when '--path' xGVPath = xValue when '--nothugly' bNothugly = true when '--help' usage( ) exit when '--version' version( ) exit end end rescue GetoptLong::InvalidOption usage( ) exit end Git2Gv.new( xGVPath, xOutFile, xOutFormat, bNothugly ).run ruby-graphviz-1.2.3/bin/ruby2gv0000755000004100000410000001624413111037426016461 0ustar www-datawww-data#!/usr/bin/env ruby # Copyright (C) 2005 - 2012 Gregoire Lejeune # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA require 'rubygems' require 'getoptlong' require 'graphviz' require 'graphviz/constants' require 'rbconfig' require 'mkmf' DEBUG = false class Rb2Gv REQUIRE = /^\s*require\s*("|')([^\1\s]*)(\1)/ def initialize( xGVPath, xUse = "dot", xStops = [] ) @oGraph = GraphViz::new( "G", :path => xGVPath, :use => xUse ) # @oGraph['size'] = '10,10' @hxNodes = Hash::new( ) @hxEdge = Array::new( ) @lxStops = xStops end public def parse( xFile ) @hxNodes[xFile] = gv_newNode( xFile, "box", "forestgreen" ) puts "+ Node #{xFile}" if DEBUG parseFile( xFile, nil, xFile ) end def out( xFormat = "dot", xFile = nil ) if xFile.nil? @oGraph.output( xFormat => String ) else @oGraph.output( xFormat => xFile ) end end private def gv_newNode( xNode, xShape = "box", xColor = nil ) xNodeName = xNode.gsub( /[^a-zA-Z0-9]/, "_" ) if xColor.nil? @oGraph.add_nodes( xNodeName, "label" => xNode, "shape" => xShape ) else @oGraph.add_nodes( xNodeName, "label" => xNode, "shape" => xShape, "style" => "filled", "color" => xColor ) end end def getLibraryPath( xLib, xExt = ["rb"] ) xPath = [ "libexecdir", "libdir", "sitedir", "rubylibdir", "sitelibdir", "archdir", "sitedir", "sitearchdir" ] xRbLib = with_config( xLib+'lib', xLib) if /\.(rb|so|bundle|dll)$/.match( xRbLib ) match = /^(.*)\.([^\.]*)$/.match(xRbLib) xRbFile, xExt = match[1], [match[2]] else xRbFile = xRbLib end xExt.each do |e| xRbFileWithExt = xRbFile + "." + e # Search in "standard" paths xPath.each do |xDir| xCurrentPath = RbConfig::expand( RbConfig::CONFIG[xDir] ) xFileFound = File.join( xCurrentPath, xRbFileWithExt ) if File.exist?( xFileFound ) return xFileFound end end # Search in "rubygems" :: This is not utile but... Gem::Specification.find_all do |spec| if spec == xLib spec.require_paths.unshift spec.bindir if spec.bindir xPath = spec.require_paths.map do |path| File.join spec.full_gem_path, path end xPath.each do |xCurrentPath| xFileFound = File.join( xCurrentPath, xRbFileWithExt ) if File.exist?( xFileFound ) return xFileFound end end end end end return nil end def parseFile( xFile, xFromFile = nil, xLib = nil ) if xFromFile puts "Parse #{xFile} required in #{xFromFile} :" if DEBUG else puts "Parse #{xFile} :" if DEBUG end File.open(xFile, 'r').each_line do |xLine| if lxLineMatch = REQUIRE.match( xLine ) xRequiredLib = lxLineMatch[2].gsub( /\.(rb|so)$/, "" ) if not @hxNodes.has_key?( xRequiredLib ) puts " + Node #{xRequiredLib}" if DEBUG xRequiredFile = getLibraryPath( xRequiredLib ) if xRequiredFile unless @lxStops.include?(xRequiredLib) @hxNodes[xRequiredLib] = gv_newNode( xRequiredLib ) parseFile( xRequiredFile, xFile, xRequiredLib ) else @hxNodes[xRequiredLib] = gv_newNode( xRequiredLib, "invhouse", "deepskyblue" ) end else if getLibraryPath( xRequiredLib, ["so", "bundle", "dll"] ) == nil @hxNodes[xRequiredLib] = gv_newNode( xRequiredLib, "box", "red" ) else @hxNodes[xRequiredLib] = gv_newNode( xRequiredLib, "box", "grey" ) end end end puts " + Edge #{xLib} -> #{xRequiredLib}" if DEBUG unless @hxEdge.include?( "#{@hxNodes[xLib].id}-#{@hxNodes[xRequiredLib].id}" ) @oGraph.add_edges( @hxNodes[xLib], @hxNodes[xRequiredLib] ) @hxEdge << "#{@hxNodes[xLib].id}-#{@hxNodes[xRequiredLib].id}" end end end end end def usage puts "usage: ruby2gv [-Tformat] [-ofile] [-h] [-V] script" puts "-T, --output-format format Output format (default: PNG)" puts "-o, --output-file file Output file (default: STDOUT)" puts "-p, --path Graphviz path" puts "-u, --use PROGRAM Program to use (default: dot)" puts "-s, --stop LIB[,LIB, ...] Stop on libs" puts "-V, --version Show version" puts "-h, --help Show this usage message" end def version puts "Ruby2GraphViz v#{GraphViz::Constants::RGV_VERSION}, (c)2005, 2009, 2010 Gregoire Lejeune " puts "" puts "This program is free software; you can redistribute it and/or modify" puts "it under the terms of the GNU General Public License as published by" puts "the Free Software Foundation; either version 2 of the License, or" puts "(at your option) any later version." puts "" puts "This program is distributed in the hope that it will be useful," puts "but WITHOUT ANY WARRANTY; without even the implied warranty of" puts "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the" puts "GNU General Public License for more details." puts "" puts "You should have received a copy of the GNU General Public License" puts "along with this program; if not, write to the Free Software" puts "Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA" end xOutFormat = "png" xOutFile = nil xGVPath = "" xUse = "dot" xStops = [] oOpt = GetoptLong.new( ['--output-format', '-T', GetoptLong::REQUIRED_ARGUMENT], ['--output-file', '-o', GetoptLong::REQUIRED_ARGUMENT], ['--path', '-p', GetoptLong::REQUIRED_ARGUMENT], ['--use', '-u', GetoptLong::REQUIRED_ARGUMENT], ['--stop', '-s', GetoptLong::REQUIRED_ARGUMENT], ['--help', '-h', GetoptLong::NO_ARGUMENT], ['--version', '-V', GetoptLong::NO_ARGUMENT] ) begin oOpt.each_option do |xOpt, xValue| case xOpt when '--output-format' xOutFormat = xValue when '--output-file' xOutFile = xValue when '--path' xGVPath = xValue when '--use' xUse = xValue when '--stop' xStops = xValue.split( "," ).map{ |x| x.strip } when '--help' usage( ) exit when '--version' version( ) exit end end rescue GetoptLong::InvalidOption usage( ) exit end xFile = ARGV[0] if xFile.nil? usage( ) exit end o = Rb2Gv::new( xGVPath, xUse, xStops ) o.parse( xFile ) result = o.out( xOutFormat, xOutFile ) puts result unless result.nil? ruby-graphviz-1.2.3/bin/dot2ruby0000755000004100000410000000573613111037426016637 0ustar www-datawww-data#!/usr/bin/env ruby # Copyright (C) 2010 Gregoire Lejeune # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA require 'rubygems' require 'graphviz/constants' require 'graphviz/dot2ruby' require 'getoptlong' def usage puts "usage: dot2ruby [-ofile] [-Tformat] [-h] [-V] script" puts "-o, --output-file file Output file" puts "-T, --output-format format Output format (default: nil)" puts "-p, --path Graphviz path" puts "-V, --version Show version" puts "-h, --help Show this usage message" end def version puts "Dot2Ruby v#{GraphViz::Constants::RGV_VERSION}, (c) 2010 Gregoire Lejeune " puts "" puts "This program is free software; you can redistribute it and/or modify" puts "it under the terms of the GNU General Public License as published by" puts "the Free Software Foundation; either version 2 of the License, or" puts "(at your option) any later version." puts "" puts "This program is distributed in the hope that it will be useful," puts "but WITHOUT ANY WARRANTY; without even the implied warranty of" puts "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the" puts "GNU General Public License for more details." puts "" puts "You should have received a copy of the GNU General Public License" puts "along with this program; if not, write to the Free Software" puts "Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA" end xOutFile = nil xGVPath = nil xOutFormat = nil oOpt = GetoptLong.new( ['--output-file', '-o', GetoptLong::REQUIRED_ARGUMENT], ['--output-format', '-T', GetoptLong::REQUIRED_ARGUMENT], ['--path', '-p', GetoptLong::REQUIRED_ARGUMENT], ['--help', '-h', GetoptLong::NO_ARGUMENT], ['--version', '-V', GetoptLong::NO_ARGUMENT] ) begin oOpt.each_option do |xOpt, xValue| case xOpt when '--output-file' xOutFile = xValue when '--output-format' xOutFormat = xValue when '--path' xGVPath = xValue when '--help' usage( ) exit when '--version' version( ) exit end end rescue GetoptLong::InvalidOption usage( ) exit end xFile = ARGV[0] if xFile.nil? usage( ) exit end Dot2Ruby::new( xGVPath, xOutFile, xOutFormat ).run( xFile ) ruby-graphviz-1.2.3/bin/gem2gv0000755000004100000410000001170213111037426016242 0ustar www-datawww-data#!/usr/bin/env ruby # Copyright (C) 2010 Gregoire Lejeune # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA require 'rubygems' require 'graphviz' require 'getoptlong' class Gem2Gv def initialize( xGVPath, xUse ) @oGraph = GraphViz::new( :G, :path => xGVPath, :use => xUse ) @nodes = [] @name = 'gem2gv' end def out( xFormat = "dot", xFile = nil ) if xFile.nil? @oGraph.output( xFormat => String ) else @oGraph.output( xFormat => xFile ) end end def go( gemName, version = ">0" ) nodes = getDependency(gemName, version) createEdges( gemName, version, nodes ) nodes.each do |node| unless @nodes.include?(node) @nodes << node go( node[:name], node[:version] ) end end end def getDependency( gemName, version = ">0" ) nodes = [] dependency = Gem::Dependency.new( gemName, version ) fetcher = Gem::SpecFetcher.fetcher fetcher.find_matching(dependency).each do |spec_tuple, source_uri| spec = fetcher.fetch_spec spec_tuple, URI.parse(source_uri) spec.dependencies.each do |dep| #nodes << { :name => dep.name, :version => dep.version_requirements.to_s} unless nodes.include?({ :name => dep.name, :version => dep.version_requirements.to_s}) nodes << { :name => dep.name, :version => ">0" } unless nodes.include?({ :name => dep.name, :version => ">0" }) end end return nodes end def getNode( name, version ) #nodeName = "#{name}#{version}" #nodeLabel = "#{name}\n#{version}" nodeName = "#{name}" nodeLabel = "#{name}" return @oGraph.get_node(nodeName) || @oGraph.add_nodes( nodeName, "label" => nodeLabel ) end def createEdges( gemName, version, nodes ) nodeA = getNode( gemName, version ) nodes.each do |node| nodeB = getNode( node[:name], node[:version] ) @oGraph.add_edges( nodeA, nodeB ) end end end def usage puts "usage: gem2gv [-Tformat] [-ofile] [-h] [-V] gemname" puts "-T, --output-format format Output format (default: PNG)" puts "-o, --output-file file Output file (default: STDOUT)" puts "-p, --path Graphviz path" puts "-u, --use PROGRAM Program to use (default: dot)" puts "-s, --stop LIB[,LIB, ...] Stop on libs" puts "-V, --version Show version" puts "-h, --help Show this usage message" end def version puts "Gem2GraphViz v#{GraphViz::Constants::RGV_VERSION}, (c)2010 Gregoire Lejeune " puts "" puts "This program is free software; you can redistribute it and/or modify" puts "it under the terms of the GNU General Public License as published by" puts "the Free Software Foundation; either version 2 of the License, or" puts "(at your option) any later version." puts "" puts "This program is distributed in the hope that it will be useful," puts "but WITHOUT ANY WARRANTY; without even the implied warranty of" puts "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the" puts "GNU General Public License for more details." puts "" puts "You should have received a copy of the GNU General Public License" puts "along with this program; if not, write to the Free Software" puts "Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA" end xOutFormat = "png" xOutFile = nil xGVPath = "" xUse = "dot" oOpt = GetoptLong.new( ['--output-format', '-T', GetoptLong::REQUIRED_ARGUMENT], ['--output-file', '-o', GetoptLong::REQUIRED_ARGUMENT], ['--path', '-p', GetoptLong::REQUIRED_ARGUMENT], ['--use', '-u', GetoptLong::REQUIRED_ARGUMENT], ['--help', '-h', GetoptLong::NO_ARGUMENT], ['--version', '-V', GetoptLong::NO_ARGUMENT] ) begin oOpt.each_option do |xOpt, xValue| case xOpt when '--output-format' xOutFormat = xValue when '--output-file' xOutFile = xValue when '--path' xGVPath = xValue when '--use' xUse = xValue when '--help' usage( ) exit when '--version' version( ) exit end end rescue GetoptLong::InvalidOption usage( ) exit end xGem = ARGV[0] if xGem.nil? usage( ) exit end g = Gem2Gv.new( xGVPath, xUse ) g.go( xGem ) result = g.out( xOutFormat, xOutFile ) puts result unless result.nil? ruby-graphviz-1.2.3/Gemfile0000644000004100000410000000014013111037426015642 0ustar www-datawww-datasource "http://rubygems.org" # Specify your gem's dependencies in ruby-graphviz.gemspec gemspecruby-graphviz-1.2.3/examples/0000755000004100000410000000000013111037426016172 5ustar www-datawww-dataruby-graphviz-1.2.3/examples/sample66.rb0000644000004100000410000000015513111037426020155 0ustar www-datawww-data$:.unshift("../lib") require 'graphviz' GraphViz.generate(30, 44, true, (1..8)).output(:png => "#{$0}.png") ruby-graphviz-1.2.3/examples/sample08.rb0000644000004100000410000000246413111037426020156 0ustar www-datawww-data#!/usr/bin/ruby $:.unshift( "../lib" ); require "graphviz" g = nil if ARGV[0] g = GraphViz::new( "G" "nodesep" => ".05", "rankdir" => "LR", "path" => ARGV[0] ) else g = GraphViz::new( "G", "nodesep" => ".05", "rankdir" => "LR" ) end g.node["shape"] = "record" g.node["width"] = ".1" g.node["height"] = ".1" g.add_nodes( "node0", "label" => " | | | | | | | | ", "height" => "2.5" ) g.add_nodes( "node1", "label" => "{ n14 | 719 |

}", "width" => "1.5" ) g.add_nodes( "node2", "label" => "{ a1 | 805 |

}", "width" => "1.5" ) g.add_nodes( "node3", "label" => "{ i9 | 718 |

}", "width" => "1.5" ) g.add_nodes( "node4", "label" => "{ e5 | 989 |

}", "width" => "1.5" ) g.add_nodes( "node5", "label" => "{ t20 | 959 |

}", "width" => "1.5" ) g.add_nodes( "node6", "label" => "{ o15 | 794 |

}", "width" => "1.5" ) g.add_nodes( "node7", "label" => "{ s19 | 659 |

}", "width" => "1.5" ) g.add_edges( {"node0" => :f0}, {"node1" => :n} ) g.add_edges( {"node0" => :f1}, {"node2" => :n} ) g.add_edges( {"node0" => :f2}, {"node3" => :n} ) g.add_edges( {"node0" => :f5}, {"node4" => :n} ) g.add_edges( {"node0" => :f6}, {"node5" => :n} ) g.add_edges( {"node2" => :p}, {"node6" => :n} ) g.add_edges( {"node4" => :p}, {"node7" => :n} ) g.output( :png => "#{$0}.png" ) ruby-graphviz-1.2.3/examples/sample01.rb0000644000004100000410000000140613111037426020142 0ustar www-datawww-data#!/usr/bin/ruby $:.unshift( "../lib" ) require "graphviz" g = nil if ARGV[0] g = GraphViz::new( "G", :path => ARGV[0] ) else g = GraphViz::new( "G" ) end main = g.add_nodes( "main" ) parse = g.add_nodes( "parse" ) execute = g.add_nodes( "execute" ) init = g.add_nodes( "init" ) cleanup = g.add_nodes( "cleanup" ) make_string = g.add_nodes( "make_string" ) printf = g.add_nodes( "printf" ) compare = g.add_nodes( "compare" ) g.add_edges( main, parse ) g.add_edges( parse, execute ) g.add_edges( main, init ) g.add_edges( main, cleanup ) g.add_edges( execute, make_string ) g.add_edges( execute, printf ) g.add_edges( init, make_string ) g.add_edges( main, printf ) g.add_edges( execute, compare ) g.output( :png => "#{$0}.png" ) ruby-graphviz-1.2.3/examples/sample06.rb0000644000004100000410000000206713111037426020153 0ustar www-datawww-data$:.unshift( "../lib" ); require "graphviz" GraphViz::new( "G", :rankdir => "LR", :type => "graph" ) { |graph| graph.cluster0 { |cluster| cluster[:label] = "Back Office" cluster.fatman.set { |n| n.label = "FatMan" n.shape = "rect" } cluster.grobil.set { |n| n.label = "GroBil" n.shape = "rect" } } graph.cluster1 { |cluster| cluster[:label] = "DMZ" cluster.dupont.set { |n| n.label = "Dupont" n.shape = "rect" } cluster.dupond.set { |n| n.label = "Dupond" n.shape = "rect" } } graph.cluster2() { |cluster| cluster[:label] = "Front Office" cluster.door.set { |n| n.label = "Door" n.shape = "rect" } } graph.cluster0.fatman << graph.cluster1.dupont graph.cluster0.fatman << graph.cluster1.dupond graph.cluster0.grobil << graph.cluster1.dupont graph.cluster0.grobil << graph.cluster1.dupond graph.cluster1.dupont << graph.cluster2.door graph.cluster1.dupond << graph.cluster2.door }.output( :path => '/usr/local/bin/', :png => "#{$0}.png" )ruby-graphviz-1.2.3/examples/sample05.rb0000644000004100000410000000147213111037426020151 0ustar www-datawww-data#!/usr/bin/ruby $:.unshift( "../lib" ); require "graphviz" g = nil if ARGV[0] g = GraphViz::new( "structs", "type" => "graph", "path" => ARGV[0] ) else g = GraphViz::new( "structs", "type" => "graph" ) end main = g.add_nodes( "main" ) parse = g.add_nodes( "parse" ) execute = g.add_nodes( "execute" ) init = g.add_nodes( "init" ) cleanup = g.add_nodes( "cleanup" ) make_string = g.add_nodes( "make_string" ) printf = g.add_nodes( "printf" ) compare = g.add_nodes( "compare" ) g.add_edges( main, parse ) g.add_edges( parse, execute ) g.add_edges( main, init ) g.add_edges( main, cleanup ) g.add_edges( execute, make_string ) g.add_edges( execute, printf ) g.add_edges( init, make_string ) g.add_edges( main, printf ) g.add_edges( execute, compare ) g.output( :png => "#{$0}.png" ) ruby-graphviz-1.2.3/examples/sample20.rb0000644000004100000410000000331413111037426020143 0ustar www-datawww-data#!/usr/bin/ruby $:.unshift( "../lib" ); require "graphviz" GraphViz::options( :use => "dot" ) if ARGV[0] GraphViz::options( :path => ARGV[0] ) end GraphViz::new( "g", :rankdir => "LR", :type => "digraph" ) { |g| g.node[:fontsize] = "16" g.node[:shape] = "record" g.node0( :label => " 0x10ba8| " ) g.node1( :label => " 0xf7fc4380| | |-1" ) g.node2( :label => " 0xf7fc44b8| | |2" ) g.node3( :label => " 3.43322790286038071e-06|44.79998779296875|0" ) g.node4( :label => " 0xf7fc4380| | |2" ) g.node5( :label => " (nil)| | |-1" ) g.node6( :label => " 0xf7fc4380| | |1" ) g.node7( :label => " 0xf7fc4380| | |2" ) g.node8( :label => " (nil)| | |-1" ) g.node9( :label => " (nil)| | |-1" ) g.node10( :label => " (nil)| | |-1" ) g.node11( :label => " (nil)| | |-1" ) g.node12( :label => " 0xf7fc43e0| | |1" ) g.add_edges( g.node0(:f0), g.node1(:f0) ) g.add_edges( g.node0(:f1), g.node2(:f0) ) g.add_edges( g.node1(:f0), g.node3(:f0) ) g.add_edges( g.node1(:f1), g.node4(:f0) ) g.add_edges( g.node1(:f2), g.node5(:f0) ) g.add_edges( g.node4(:f0), g.node3(:f0) ) g.add_edges( g.node4(:f1), g.node6(:f0) ) g.add_edges( g.node4(:f2), g.node10(:f0) ) g.add_edges( g.node6(:f0), g.node3(:f0) ) g.add_edges( g.node6(:f1), g.node7(:f0) ) g.add_edges( g.node6(:f2), g.node9(:f0) ) g.add_edges( g.node7(:f0), g.node3(:f0) ) g.add_edges( g.node7(:f1), g.node1(:f0) ) g.add_edges( g.node7(:f2), g.node8(:f0) ) g.add_edges( g.node10(:f1), g.node11(:f0) ) g.add_edges( g.node10(:f2), g.node12(:f0) ) g.add_edges( g.node11(:f2), g.node1(:f0) ) }.output( :png => "#{$0}.png" ) ruby-graphviz-1.2.3/examples/sample09.rb0000644000004100000410000000254413111037426020156 0ustar www-datawww-data#!/usr/bin/ruby $:.unshift( "../lib" ); require "graphviz" g = nil if ARGV[0] g = GraphViz::new( "G", "path" => ARGV[0] ) else g = GraphViz::new( "G" ) end g.node["shape"] = "ellipse" g.node["color"] = "black" g["color"] = "black" c0 = g.add_graph( "cluster0" ) c0["label"] = "process #1" c0["style"] = "filled" c0["color"] = "lightgrey" a0 = c0.add_nodes( "a0", "style" => "filled", "color" => "white" ) a1 = c0.add_nodes( "a1", "style" => "filled", "color" => "white" ) a2 = c0.add_nodes( "a2", "style" => "filled", "color" => "white" ) a3 = c0.add_nodes( "a3", "style" => "filled", "color" => "white" ) c0.add_edges( a0, a1 ) c0.add_edges( a1, a2 ) c0.add_edges( a2, a3 ) c1 = g.add_graph( "cluster1", "label" => "process #2" ) b0 = c1.add_nodes( "b0", "style" => "filled", "color" => "blue" ) b1 = c1.add_nodes( "b1", "style" => "filled", "color" => "blue" ) b2 = c1.add_nodes( "b2", "style" => "filled", "color" => "blue" ) b3 = c1.add_nodes( "b3", "style" => "filled", "color" => "blue" ) c1.add_edges( b0, b1 ) c1.add_edges( b1, b2 ) c1.add_edges( b2, b3 ) start = g.add_nodes( "start", "shape" => "Mdiamond" ) endn = g.add_nodes( "end", "shape" => "Msquare" ) g.add_edges( start, a0 ) g.add_edges( start, b0 ) g.add_edges( a1, b3 ) g.add_edges( b2, a3 ) g.add_edges( a3, a0 ) g.add_edges( a3, endn ) g.add_edges( b3, endn ) g.output( :png => "#{$0}.png" ) ruby-graphviz-1.2.3/examples/sample68.rb0000644000004100000410000000113713111037426020160 0ustar www-datawww-data$:.unshift("../lib") require 'graphviz' require 'graphviz/theory' g = GraphViz.graph(:G) g.add_nodes(["A", "B", "C", "D", "E", "F", "G"]) g.add_edges("A", ["B", "C", "E"]) g.add_edges("B", ["D", "F"]) g.add_edges("C", "G") g.add_edges("F", "E") g.output(:png => "#{$0}000.png") t = GraphViz::Theory.new(g) i = 1 t.dfs("A") { |node| name = sprintf("%s%03d.png", $0, i) node[:color => :lightblue, :style => :filled] g.output(:png => name) i = i + 1 } t.bfs("A") { |node| name = sprintf("%s%03d.png", $0, i) node[:color => :red, :style => :filled] g.output(:png => name) i = i + 1 } ruby-graphviz-1.2.3/examples/sample39.rb0000644000004100000410000000041213111037426020151 0ustar www-datawww-data$:.unshift( "../lib" ); require "graphviz" g = GraphViz::new( "G", :type => "graph" ) n1 = g.add_nodes( "A" ) n2 = g.add_nodes( "B" ) n3 = g.add_nodes( "C" ) e1 = g.add_edges( n1, n2 ) e1[:dir] = 'forward' e2 = g.add_edges( n1, n3 ) g.output( :png => "#{$0}.png" ) ruby-graphviz-1.2.3/examples/sample38.rb0000644000004100000410000000045013111037426020152 0ustar www-datawww-data# coding: utf-8 $:.unshift( "../lib" ) require "graphviz" g = GraphViz::new( :G ) { |_g| _g.a[:label => "ε"] _g.add_nodes( "b", :label => "ε" ) _g.c[:label => 'ε'] _g.add_nodes( "d", :label => 'ε' ) } puts g.output( :none => String, :png => "#{$0}.png", :path => "/usr/local/bin" ) ruby-graphviz-1.2.3/examples/sample46.rb0000644000004100000410000000223513111037426020154 0ustar www-datawww-data#!/usr/bin/ruby $:.unshift( "../lib" ); require "graphviz" g = nil if ARGV[0] g = GraphViz::new( "G", "path" => ARGV[0] ) else g = GraphViz::new( "G" ) end g.node["color"] = "black" g.edge["color"] = "black" g.edge["weight"] = "1" g.edge["style"] = "filled" g.edge["label"] = "" g["size"] = "4,4" g.node["shape"] = "box" main = g.add_nodes( "main" ) g.node["shape"] = "ellipse" parse = g.add_nodes( "parse" ) execute = g.add_nodes( "execute" ) init = g.add_nodes( "init" ) cleanup = g.add_nodes( "cleanup" ) make_string = g.add_nodes( "make_string", "label" => 'make a\nstring' ) printf = g.add_nodes( "printf" ) compare = g.add_nodes( "compare", "shape" => "box", "style" => "filled", "color" => ".7 .3 1.0" ) g.add_edges( main, parse, "weight" => "8" ) g.add_edges( parse, execute ) g.add_edges( main, init, "style" => "dotted" ) g.add_edges( main, cleanup ) g.add_edges( execute, make_string ) g.add_edges( execute, printf ) g.add_edges( init, make_string ) g.add_edges( main, printf, "color" => "red", "style" => "bold", "label" => "100 times" ) g.add_edges( execute, compare, "color" => "red" ) g.output( :png => "#{$0}.png" ) ruby-graphviz-1.2.3/examples/sample63.rb0000644000004100000410000000112413111037426020147 0ustar www-datawww-data$:.unshift( "../lib" ) require 'graphviz/dsl' digraph :G do cluster_0 do graph[:style => :filled, :color => :lightgrey] node[:style => :filled, :color => :white] a0 << a1 << a2 << a3 graph[:label => "process #1"] end cluster_1 do node[:style => :filled] b0 << b1 << b2 << b3 graph[:label => "process #2", :color => :blue] end start << a0 start << b0 a1 << b3 b2 << a3 a3 << a0 a3 << _end b3 << _end start[:shape] = :Mdiamond _end[:label] = "end" _end[:shape] = :Mdiamond output(:png => "#{$0}.png") end ruby-graphviz-1.2.3/examples/sample45.rb0000644000004100000410000000122613111037426020152 0ustar www-datawww-data#!/usr/bin/ruby $:.unshift( "../lib" ); require "graphviz" g = nil if ARGV[0] g = GraphViz::new( "G", "path" => ARGV[0] ) else g = GraphViz::new( "G" ) end g.node["shape"] = "ellipse" [ "box", "polygon", "ellipse", "circle", "point", "egg", "triangle", "plaintext", "diamond", "trapezium", "parallelogram", "house", "pentagon", "hexagon", "septagon", "octagon", "doublecircle", "doubleoctagon", "tripleoctagon", "invtriangle", "invtrapezium", "invhouse", "Mdiamond", "Msquare", "Mcircle", "rect", "rectangle", "none", "note", "tab", "folder", "box3d", "component" ].each { |s| g.add_nodes( s, "shape" => s ) } g.output( :png => "#{$0}.png") ruby-graphviz-1.2.3/examples/sample13.rb0000644000004100000410000000255613111037426020154 0ustar www-datawww-data#!/usr/bin/ruby $:.unshift( "../lib" ); require "graphviz" GraphViz::new( "G" ) { |graph| graph.node[:shape] = "ellipse" graph.node[:color] = "black" graph[:color] = "black" graph.cluster0( ) do |cluster| cluster[:label] = "process #1" cluster[:style] = "filled" cluster[:color] = "lightgrey" cluster.a0 :style => "filled", :color => "white" cluster.a1 :style => "filled", :color => "white" cluster.a2 :style => "filled", :color => "white" cluster.a3 :style => "filled", :color => "white" cluster.a0 << cluster.a1 cluster.a1 << cluster.a2 cluster.a2 << cluster.a3 end graph.cluster1( :label => "process #2" ) do |cluster| cluster.b0 :style => "filled", :color => "blue" cluster.b1 :style => "filled", :color => "blue" cluster.b2 :style => "filled", :color => "blue" cluster.b3 :style => "filled", :color => "blue" cluster.b0 << cluster.b1 cluster.b1 << cluster.b2 cluster.b2 << cluster.b3 end graph.start :shape => "Mdiamond" graph.endn :shape => "Msquare", :label => "end" graph.start << graph.cluster0.a0 graph.start << graph.cluster1.b0 graph.cluster0.a1 << graph.cluster1.b3 graph.cluster1.b2 << graph.cluster0.a3 graph.cluster0.a3 << graph.cluster0.a0 graph.cluster0.a3 << graph.endn graph.cluster1.b3 << graph.endn }.output( :path => '/usr/local/bin/', :png => "#{$0}.png" )ruby-graphviz-1.2.3/examples/sample53.rb0000644000004100000410000000110413111037426020144 0ustar www-datawww-data$:.unshift( "../lib" ) require 'graphviz/family_tree' tree = GraphViz::FamilyTree.new do generation do benoist.is_a_man( "Benoist" ) nathalie.is_a_woman( "Nathalie" ) benoist.is_maried_with nathalie end generation do charlotte.is_a_woman( "Charlotte" ) amelie.is_a_woman( "Amelie" ) clement.is_a_man( "Clement" ) gregoire.is_a_man( "Gregoire" ) muriel.is_a_woman( "Muriel" ) gregoire.is_maried_with muriel end couple( benoist, nathalie ).kids( charlotte, amelie, clement, gregoire ) end tree.graph.save( :png => "#{$0}.png" )ruby-graphviz-1.2.3/examples/sample23.rb0000644000004100000410000000055413111037426020151 0ustar www-datawww-data#!/usr/bin/ruby $:.unshift( "../lib" ); require "graphviz" r = GraphViz::new( "mainmap" ) { |graph| graph[:URL] = "http://www.research.att.com/base.html" graph.command( :URL => "http://www.research.att.com/command.html" ) (graph.command << graph._output( :label => "output" ))[:URL] = "colors.html" } puts r.output( :cmapx => String, :png => "#{$0}.png" ) ruby-graphviz-1.2.3/examples/sample54.rb0000644000004100000410000000076013111037426020154 0ustar www-datawww-data$:.unshift( "../lib" ) require 'graphviz' class Array def rotate ## Solution #1 by greg # self.push(r = self.shift) # return r ## Solution #2 by madx # shift.tap {|e| push e } ## Solution #3 by greg push(shift)[-1] end end type = ["box", "point"] GraphViz.graph( :G, :use => :neato ) { |g| (1..5).each do |x| (1..5).each do |y| g.add_nodes( "n#{x}x#{y}", :pos => "#{x},#{y}!", :shape => type.rotate ) end end }.output( :png => "#{$0}.png" ) ruby-graphviz-1.2.3/examples/sample29.rb0000644000004100000410000000042413111037426020153 0ustar www-datawww-data#!/usr/bin/ruby $:.unshift( "../lib" ); require "graphviz" GraphViz.new(:G){ |g| g.add_nodes("\"Hello.\"\nHow are you ?", :href => "https://www.example.com/", :tooltip => "\"Hello.\"\nHow are you ?", :shape => "ellipse", :color => "#FF0000") }.save( :svg => "#{$0}.svg" ) ruby-graphviz-1.2.3/examples/sample27.rb0000644000004100000410000000026113111037426020150 0ustar www-datawww-data#!/usr/bin/ruby $:.unshift( "../lib" ); require "graphviz" puts GraphViz.new(:G){ |g| (g.hello - g.none) [:style => :bold, :label => " dburt says"] }.save( :none => String ) ruby-graphviz-1.2.3/examples/sample69.rb0000644000004100000410000000070213111037426020156 0ustar www-datawww-data#!/usr/bin/ruby $:.unshift( "../lib" ); require "graphviz" g = GraphViz::new( "G", :type => "graph" ) g[:compound] = true g[:rankdir] = "LR" c0 = g.add_graph( "cluster0", "label" => "cluster #1" ) a0 = c0.add_nodes( "a0" ) c1 = g.add_graph( "cluster1", "label" => "cluster #2" ) b0 = c1.add_nodes( "b0" ) e1 = g.add_edges(a0,b0) e1[:lhead] = c1.id e1[:ltail] = c0.id e2 = g.add_edges(a0,b0) e2[:lhead] = c1.id g.output( :png => "#{$0}.png" ) ruby-graphviz-1.2.3/examples/sample47.rb0000644000004100000410000000034613111037426020156 0ustar www-datawww-data#!/usr/bin/ruby $:.unshift( "../lib" ) require 'graphviz/xml' gvxml = GraphViz::XML::new( File.join( File.dirname(__FILE__), "test.xml" ), :text => true, :attrs => true ) gvxml.graph.output( :png => "#{$0}.png", :use => "dot" ) ruby-graphviz-1.2.3/examples/sample35.rb0000644000004100000410000000235113111037426020151 0ustar www-datawww-data#!/usr/bin/ruby $:.unshift( "../lib" ) require "graphviz" GraphViz.digraph( :G ) { |g| g[:truecolor => true, :bgcolor => "transparent", :rankdir => "LR"] g.node[:label => "\N"] c1 = g.subgraph { |c| c[:rank => "same"] c.mygraph[ :label => '# mygraph.dot\ldigraph G {\l Hello -> World\l}\l', :shape => "note", :fontname => "Courier", :fontsize => 10 ] c.image[ :label => "", :shape => "note", :image => "./hello.png"] } c2 = g.subgraph { |c| c[:rank => "same"] c.mysite[:label => "\nexample.com\n ", :shape => "component", :fontname => "Arial"] c.dotgraph[:label => "\ndotgraph.net\n ", :shape => "component", :fontname => "Arial"] } g.cluster_0 { |c| c[ :label => "my_page.html", :fontname => "Courier", :fontsize => 10, :color => "black" ] c.zeimage[:label => "", :shape => "note", :image => "./hello.png"] } (c1.mygraph << c2.mysite)[:color => "blue"] (c2.dotgraph << c1.image)[:color => "red"] (c2.dotgraph << c2.mysite)[:color => "red"] (c2.mysite << c2.dotgraph)[:color => "blue"] (c1.image << c2.dotgraph)[:color => "red"] (c2.mysite << g.cluster_0.zeimage)[:color => "red"] }.output( :png => "#{$0}.png", :none => "#{$0}.gv" ) ruby-graphviz-1.2.3/examples/sample52.rb0000644000004100000410000000401313111037426020145 0ustar www-datawww-data# http://www.graphviz.org/Gallery/directed/traffic_lights.gv.txt # # digraph TrafficLights { # node [shape=box]; gy2; yr2; rg2; gy1; yr1; rg1; # node [shape=circle,fixedsize=true,width=0.9]; green2; yellow2; red2; safe2; safe1; green1; yellow1; red1; # gy2->yellow2; # rg2->green2; # yr2->safe1; # yr2->red2; # safe2->rg2; # green2->gy2; # yellow2->yr2; # red2->rg2; # gy1->yellow1; # rg1->green1; # yr1->safe2; # yr1->red1; # safe1->rg1; # green1->gy1; # yellow1->yr1; # red1->rg1; # # overlap=false # label="PetriNet Model TrafficLights\nExtracted from ConceptBase and layed out by Graphviz" # fontsize=12; # } $:.unshift( "../../lib" ); require "graphviz" GraphViz::new( "TrafficLights", :type => :digraph ) { |g| g.gy2[:shape] = :box; g.yr2[:shape] = :box; g.rg2[:shape] = :box; g.gy1[:shape] = :box; g.yr1[:shape] = :box; g.rg1[:shape] = :box; g.green2.set { |n| n[:shape] = :circle; n[:fixedsize] = :true; n[:width] = 0.9 } g.yellow2.set { |n| n[:shape] = :circle; n[:fixedsize] = :true; n[:width] = 0.9 } g.red2.set { |n| n[:shape] = :circle; n[:fixedsize] = :true; n[:width] = 0.9 } g.safe2.set { |n| n[:shape] = :circle; n[:fixedsize] = :true; n[:width] = 0.9 } g.safe1.set { |n| n[:shape] = :circle; n[:fixedsize] = :true; n[:width] = 0.9 } g.green1.set { |n| n[:shape] = :circle; n[:fixedsize] = :true; n[:width] = 0.9 } g.yellow1.set { |n| n[:shape] = :circle; n[:fixedsize] = :true; n[:width] = 0.9 } g.red1.set { |n| n[:shape] = :circle; n[:fixedsize] = :true; n[:width] = 0.9 } g.gy2 << g.yellow2 g.rg2 << g.green2 g.yr2 << g.safe1 g.yr2 << g.red2 g.safe2 << g.rg2 g.green2 << g.gy2 g.yellow2 << g.yr2 g.red2 << g.rg2 g.gy1 << g.yellow1 g.rg1 << g.green1 g.yr1 << g.safe2 g.yr1 << g.red1 g.safe1 << g.rg1 g.green1 << g.gy1 g.yellow1 << g.yr1 g.red1 << g.rg1 g[:overlap] = :false g[:label] = 'PetriNet Model TrafficLights\nExtracted from ConceptBase and layed out by Graphviz' g[:fontsize] = 12; }.output( :errors => 1, :png => "#{$0}.png" )ruby-graphviz-1.2.3/examples/sample12.rb0000644000004100000410000000240413111037426020143 0ustar www-datawww-data#!/usr/bin/ruby $:.unshift( "../lib" ); require "graphviz" g = nil if ARGV[0] g = GraphViz::new( "G", "path" => ARGV[0] ) else g = GraphViz::new( "G" ) end g.node[:shape] = "ellipse" g.node[:color] = "black" g[:color] = "black" g.cluster0( ) do |cluster| cluster[:label] = "process #1" cluster[:style] = "filled" cluster[:color] = "lightgrey" cluster.a0 :style => "filled", :color => "white" cluster.a1 :style => "filled", :color => "white" cluster.a2 :style => "filled", :color => "white" cluster.a3 :style => "filled", :color => "white" cluster.a0 << cluster.a1 cluster.a1 << cluster.a2 cluster.a2 << cluster.a3 end g.cluster1( :label => "process #2" ) do |cluster| cluster.b0 :style => "filled", :color => "blue" cluster.b1 :style => "filled", :color => "blue" cluster.b2 :style => "filled", :color => "blue" cluster.b3 :style => "filled", :color => "blue" cluster.b0 << cluster.b1 cluster.b1 << cluster.b2 cluster.b2 << cluster.b3 end g.start :shape => "Mdiamond" g.endn :shape => "Msquare", :label => "end" g.start << g.cluster0.a0 g.start << g.cluster1.b0 g.cluster0.a1 << g.cluster1.b3 g.cluster1.b2 << g.cluster0.a3 g.cluster0.a3 << g.cluster0.a0 g.cluster0.a3 << g.endn g.cluster1.b3 << g.endn g.output( :png => "#{$0}.png" )ruby-graphviz-1.2.3/examples/test.xml0000644000004100000410000000167713111037426017706 0ustar www-datawww-data

Invisibility Cream 14.50 Makes you invisible Levitation Salve 23.99 Levitate yourself for up to 3 hours per application
Blork and Freen Instameal 4.95 A tasty meal in a tablet; just add water Grob winglets 3.56 Tender winglets of Grob. Just add water
ruby-graphviz-1.2.3/examples/sample17.rb0000644000004100000410000000557013111037426020157 0ustar www-datawww-data#!/usr/bin/ruby $:.unshift( "../lib" ); require "graphviz" GraphViz::new( "G", :type => "graph", :rankdir => "LR", :bgcolor => "#808080" ) { |graph| graph.edge[:dir] = "none" graph.node[:width] = "0.3" graph.node[:height] = "0.3" graph.node[:label] = "" _ = {} ("1".."8").each do |v| _[v] = graph.add_nodes( v, :shape => "circle", :style => "invis") end ["10","20","30","40","50","60","70","80"].each do |v| _[v] = graph.add_nodes( v, :shape => "circle", :style => "invis") end ("a".."x").each do |v| _[v] = graph.add_nodes( v, :shape => "circle") end ("A".."X").each do |v| _[v] = graph.add_nodes( v, :shape => "diamond") end (_["1"] << _["a"])[:color]="#0000ff" (_["a"] << _["A"])[:color]="#0000ff" (_["a"] << _["B"])[:color]="#0000ff" (_["2"] << _["b"])[:color]="#ff0000" (_["b"] << _["B"])[:color]="#ff0000" (_["b"] << _["A"])[:color]="#ff0000" (_["3"] << _["c"])[:color]="#ffff00" (_["c"] << _["C"])[:color]="#ffff00" (_["c"] << _["D"])[:color]="#ffff00" (_["4"] << _["d"])[:color]="#00ff00" (_["d"] << _["D"])[:color]="#00ff00" (_["d"] << _["C"])[:color]="#00ff00" (_["5"] << _["e"])[:color]="#000000" (_["e"] << _["E"])[:color]="#000000" (_["e"] << _["F"])[:color]="#000000" (_["6"] << _["f"])[:color]="#00ffff" (_["f"] << _["F"])[:color]="#00ffff" (_["f"] << _["E"])[:color]="#00ffff" (_["7"] << _["g"])[:color]="#ffffff" (_["g"] << _["G"])[:color]="#ffffff" (_["g"] << _["H"])[:color]="#ffffff" (_["8"] << _["h"])[:color]="#ff00ff" (_["h"] << _["H"])[:color]="#ff00ff" (_["h"] << _["G"])[:color]="#ff00ff" graph.edge[:color]="#ff0000:#0000ff" _["A"] << _["i"]; _["i"] << [_["I"], _["K"]] _["B"] << _["j"]; _["j"] << [_["J"], _["L"]] graph.edge[:color]="#00ff00:#ffff00" _["C"] << _["k"]; _["k"] << [_["K"], _["I"]] _["D"] << _["l"]; _["l"] << [_["L"], _["J"]] graph.edge[:color]="#00ffff:#000000" _["E"] << _["m"]; _["m"] << [_["M"], _["O"]] _["F"] << _["n"]; _["n"] << [_["N"], _["P"]] graph.edge[:color]="#ff00ff:#ffffff" _["G"] << _["o"]; _["o"] << [_["O"], _["M"]] _["H"] << _["p"]; _["p"] << [_["P"], _["N"]] graph.edge[:color]="#00ff00:#ffff00:#ff0000:#0000ff" _["I"] << _["q"]; _["q"] << [_["Q"], _["U"]] _["J"] << _["r"]; _["r"] << [_["R"], _["V"]] _["K"] << _["s"]; _["s"] << [_["S"], _["W"]] _["L"] << _["t"]; _["t"] << [_["T"], _["X"]] graph.edge[:color]="#ff00ff:#ffffff:#00ffff:#000000" _["M"] << _["u"]; _["u"] << [_["U"], _["Q"]] _["N"] << _["v"]; _["v"] << [_["V"], _["R"]] _["O"] << _["w"]; _["w"] << [_["W"], _["S"]] _["P"] << _["x"]; _["x"] << [_["X"], _["T"]] graph.edge[:color]="#ff00ff:#ffffff:#00ffff:#000000:#00ff00:#ffff00:#ff0000:#0000ff" _["Q"] << _["10"] _["R"] << _["20"] _["S"] << _["30"] _["T"] << _["40"] _["U"] << _["50"] _["V"] << _["60"] _["W"] << _["70"] _["X"] << _["80"] }.output( :path => '/usr/local/bin/', :png => "#{$0}.png" ) ruby-graphviz-1.2.3/examples/sample42.rb0000644000004100000410000000173613111037426020155 0ustar www-datawww-data#!/usr/bin/ruby $:.unshift( "../lib" ); require "graphviz" g = nil if ARGV[0] g = GraphViz::new( "G", "path" => ARGV[0], :use => "circo" ) else g = GraphViz::new( "G" ) end c0 = g.add_graph( "cluster0" ) c0["label"] = "Environnement de Brad !" c0["style"] = "filled" c0["color"] = "blue" ja = c0.add_nodes( "Jennifer_Aniston", :style => "filled", :color => "red" ) bp = c0.add_nodes( "Brad_Pitt", :style => "filled", :color => "white" ) aj = c0.add_nodes( "Angelina_Jolie", :style => "filled", :color => "green" ) c0.add_edges( ja, bp ) # On ete mariés c0.add_edges( bp, aj ) # Sont ensemble jv = g.add_nodes( "John_Voight", :label => "John Voight", :shape => "rectangle" ) md = g.add_nodes( "Madonna" ) gr = g.add_nodes( "Guy_Ritchie" ) g.add_edges( aj, jv ) # est la fille de g.add_edges( jv, aj ) # est le pere de g.add_edges( bp, jv, :color => "red", :label => "Est le beau fils de" ) # Beau fils g.add_edges( bp, gr ) g.add_edges( gr, md ) g.output( :png => "#{$0}.png" ) ruby-graphviz-1.2.3/examples/sample99.rb0000644000004100000410000000316513111037426020167 0ustar www-datawww-data$:.unshift( "../lib" ); require 'graphviz/family_tree' tree = GraphViz::FamilyTree.new do generation do chantale.is_a_woman( "Chantale" ) jacques.is_a_man( "Jacques" ) jacques.is_dead jacques.is_maried_with chantale rose.is_a_woman( "Rose Marie" ) andre.is_a_man( "Andre" ) andre.is_maried_with rose andre.is_dead end generation do benoist.is_a_man( "Benoist" ) nathalie.is_a_woman( "Nathalie" ) benoist.is_maried_with nathalie michel.is_a_man( "Michel" ) brigitte.is_a_woman( "Brigitte" ) michel.is_maried_with brigitte end couple( chantale, jacques ).kids( nathalie ) couple( rose, andre ).kids( benoist ) generation do charlotte.is_a_woman( "Charlotte" ) amelie.is_a_woman( "Amelie" ) clement.is_a_man( "Clement" ) gregoire.is_a_man( "Gregoire" ) muriel.is_a_woman( "Muriel" ) gilles.is_a_man( "Gilles" ) morgane.is_a_woman( "Morgane" ) gregoire.is_divorced_with morgane pascal.is_a_man( "Pascal" ) muriel.is_divorced_with pascal gregoire.is_maried_with muriel end couple( michel, brigitte ).kids( muriel, gilles ) couple( benoist, nathalie ).kids( charlotte, amelie, clement, gregoire ) generation do arthur.is_a_boy( "Arthur" ) colyne.is_a_girl( "Colyne" ) benedict.is_a_boy( "Benedict" ) maia.is_a_girl( "Maia" ) enaitz.is_a_boy( "Enaitz" ) milo.is_a_boy( "Milo" ) end couple( gregoire, morgane ).kids( arthur, colyne, benedict ) couple( gregoire, muriel ).kids( maia ) couple( muriel, pascal ).kids( milo ) muriel.kids( enaitz ) end tree.graph.save( :png => "#{$0}.png" ) ruby-graphviz-1.2.3/examples/sample50.rb0000644000004100000410000003542513111037426020156 0ustar www-datawww-data# http://www.graphviz.org/Gallery/directed/lion_share.html # # digraph Ped_Lion_Share { # # page = "8.2677165,11.692913" ; # ratio = "auto" ; # mincross = 2.0 ; # label = "Pedigree Lion_Share" ; # # "001" [shape=box , regular=1,style=filled,fillcolor=white ] ; # "002" [shape=box , regular=1,style=filled,fillcolor=white ] ; # "003" [shape=circle , regular=1,style=filled,fillcolor=white ] ; # "004" [shape=box , regular=1,style=filled,fillcolor=white ] ; # "005" [shape=box , regular=1,style=filled,fillcolor=white ] ; # "006" [shape=circle , regular=1,style=filled,fillcolor=white ] ; # "007" [shape=circle , regular=1,style=filled,fillcolor=white ] ; # "009" [shape=circle , regular=1,style=filled,fillcolor=white ] ; # "014" [shape=circle , regular=1,style=filled,fillcolor=white ] ; # "015" [shape=circle , regular=1,style=filled,fillcolor=white ] ; # "016" [shape=circle , regular=1,style=filled,fillcolor=white ] ; # "ZZ01" [shape=circle , regular=1,style=filled,fillcolor=white ] ; # "ZZ02" [shape=circle , regular=1,style=filled,fillcolor=white ] ; # "017" [shape=circle , regular=1,style=filled,fillcolor=white ] ; # "012" [shape=circle , regular=1,style=filled,fillcolor=white ] ; # "008" [shape=box , regular=1,style=filled,fillcolor=white ] ; # "011" [shape=box , regular=1,style=filled,fillcolor=white ] ; # "013" [shape=box , regular=1,style=filled,fillcolor=white ] ; # "010" [shape=box , regular=1,style=filled,fillcolor=white ] ; # "023" [shape=circle , regular=1,style=filled,fillcolor=white ] ; # "020" [shape=circle , regular=1,style=filled,fillcolor=white ] ; # "021" [shape=circle , regular=1,style=filled,fillcolor=white ] ; # "018" [shape=circle , regular=1,style=filled,fillcolor=white ] ; # "025" [shape=circle , regular=1,style=filled,fillcolor=white ] ; # "019" [shape=box , regular=1,style=filled,fillcolor=white ] ; # "022" [shape=box , regular=1,style=filled,fillcolor=white ] ; # "024" [shape=box , regular=1,style=filled,fillcolor=white ] ; # "027" [shape=circle , regular=1,style=filled,fillcolor=white ] ; # "026" [shape=box , regular=1,style=filled,fillcolor=white ] ; # "028" [shape=box , regular=1,style=filled,fillcolor=grey ] ; # "marr0001" [shape=diamond,style=filled,label="",height=.1,width=.1] ; # "001" -> "marr0001" [dir=none,weight=1] ; # "007" -> "marr0001" [dir=none,weight=1] ; # "marr0001" -> "017" [dir=none, weight=2] ; # "marr0002" [shape=diamond,style=filled,label="",height=.1,width=.1] ; # "001" -> "marr0002" [dir=none,weight=1] ; # "ZZ02" -> "marr0002" [dir=none,weight=1] ; # "marr0002" -> "012" [dir=none, weight=2] ; # "marr0003" [shape=diamond,style=filled,label="",height=.1,width=.1] ; # "002" -> "marr0003" [dir=none,weight=1] ; # "003" -> "marr0003" [dir=none,weight=1] ; # "marr0003" -> "008" [dir=none, weight=2] ; # "marr0004" [shape=diamond,style=filled,label="",height=.1,width=.1] ; # "002" -> "marr0004" [dir=none,weight=1] ; # "006" -> "marr0004" [dir=none,weight=1] ; # "marr0004" -> "011" [dir=none, weight=2] ; # "marr0005" [shape=diamond,style=filled,label="",height=.1,width=.1] ; # "002" -> "marr0005" [dir=none,weight=1] ; # "ZZ01" -> "marr0005" [dir=none,weight=1] ; # "marr0005" -> "013" [dir=none, weight=2] ; # "marr0006" [shape=diamond,style=filled,label="",height=.1,width=.1] ; # "004" -> "marr0006" [dir=none,weight=1] ; # "009" -> "marr0006" [dir=none,weight=1] ; # "marr0006" -> "010" [dir=none, weight=2] ; # "marr0007" [shape=diamond,style=filled,label="",height=.1,width=.1] ; # "005" -> "marr0007" [dir=none,weight=1] ; # "015" -> "marr0007" [dir=none,weight=1] ; # "marr0007" -> "023" [dir=none, weight=2] ; # "marr0008" [shape=diamond,style=filled,label="",height=.1,width=.1] ; # "005" -> "marr0008" [dir=none,weight=1] ; # "016" -> "marr0008" [dir=none,weight=1] ; # "marr0008" -> "020" [dir=none, weight=2] ; # "marr0009" [shape=diamond,style=filled,label="",height=.1,width=.1] ; # "005" -> "marr0009" [dir=none,weight=1] ; # "012" -> "marr0009" [dir=none,weight=1] ; # "marr0009" -> "021" [dir=none, weight=2] ; # "marr0010" [shape=diamond,style=filled,label="",height=.1,width=.1] ; # "008" -> "marr0010" [dir=none,weight=1] ; # "017" -> "marr0010" [dir=none,weight=1] ; # "marr0010" -> "018" [dir=none, weight=2] ; # "marr0011" [shape=diamond,style=filled,label="",height=.1,width=.1] ; # "011" -> "marr0011" [dir=none,weight=1] ; # "023" -> "marr0011" [dir=none,weight=1] ; # "marr0011" -> "025" [dir=none, weight=2] ; # "marr0012" [shape=diamond,style=filled,label="",height=.1,width=.1] ; # "013" -> "marr0012" [dir=none,weight=1] ; # "014" -> "marr0012" [dir=none,weight=1] ; # "marr0012" -> "019" [dir=none, weight=2] ; # "marr0013" [shape=diamond,style=filled,label="",height=.1,width=.1] ; # "010" -> "marr0013" [dir=none,weight=1] ; # "021" -> "marr0013" [dir=none,weight=1] ; # "marr0013" -> "022" [dir=none, weight=2] ; # "marr0014" [shape=diamond,style=filled,label="",height=.1,width=.1] ; # "019" -> "marr0014" [dir=none,weight=1] ; # "020" -> "marr0014" [dir=none,weight=1] ; # "marr0014" -> "024" [dir=none, weight=2] ; # "marr0015" [shape=diamond,style=filled,label="",height=.1,width=.1] ; # "022" -> "marr0015" [dir=none,weight=1] ; # "025" -> "marr0015" [dir=none,weight=1] ; # "marr0015" -> "027" [dir=none, weight=2] ; # "marr0016" [shape=diamond,style=filled,label="",height=.1,width=.1] ; # "024" -> "marr0016" [dir=none,weight=1] ; # "018" -> "marr0016" [dir=none,weight=1] ; # "marr0016" -> "026" [dir=none, weight=2] ; # "marr0017" [shape=diamond,style=filled,label="",height=.1,width=.1] ; # "026" -> "marr0017" [dir=none,weight=1] ; # "027" -> "marr0017" [dir=none,weight=1] ; # "marr0017" -> "028" [dir=none, weight=2] ; # } $:.unshift( "../../lib" ); require "graphviz" GraphViz::new( "Ped_Lion_Share", :type => :digraph ) { |g| g[:ratio] = :auto # g[:mincross] = 2.0 g[:label] = "Pedigree Lion_Share" g._001.set { |n| n[:shape] = :box; n[:regular] = 1; n[:style] = :filled; n[:fillcolor] = :white; n[:label] = "001" } g._002.set { |n| n[:shape] = :box; n[:regular] = 1; n[:style] = :filled; n[:fillcolor] = :white; n[:label] = "002" } g._003.set { |n| n[:shape] = :circle; n[:regular] = 1; n[:style] = :filled; n[:fillcolor] = :white; n[:label] = "003" } g._004.set { |n| n[:shape] = :box; n[:regular] = 1; n[:style] = :filled; n[:fillcolor] = :white; n[:label] = "004" } g._005.set { |n| n[:shape] = :box; n[:regular] = 1; n[:style] = :filled; n[:fillcolor] = :white; n[:label] = "005" } g._006.set { |n| n[:shape] = :circle; n[:regular] = 1; n[:style] = :filled; n[:fillcolor] = :white; n[:label] = "006" } g._007.set { |n| n[:shape] = :circle; n[:regular] = 1; n[:style] = :filled; n[:fillcolor] = :white; n[:label] = "007" } g._009.set { |n| n[:shape] = :circle; n[:regular] = 1; n[:style] = :filled; n[:fillcolor] = :white; n[:label] = "009" } g._014.set { |n| n[:shape] = :circle; n[:regular] = 1; n[:style] = :filled; n[:fillcolor] = :white; n[:label] = "014" } g._015.set { |n| n[:shape] = :circle; n[:regular] = 1; n[:style] = :filled; n[:fillcolor] = :white; n[:label] = "015" } g._016.set { |n| n[:shape] = :circle; n[:regular] = 1; n[:style] = :filled; n[:fillcolor] = :white; n[:label] = "016" } g.ZZ01.set { |n| n[:shape] = :circle; n[:regular] = 1; n[:style] = :filled; n[:fillcolor] = :white } g.ZZ02.set { |n| n[:shape] = :circle; n[:regular] = 1; n[:style] = :filled; n[:fillcolor] = :white } g._017.set { |n| n[:shape] = :circle; n[:regular] = 1; n[:style] = :filled; n[:fillcolor] = :white; n[:label] = "017" } g._012.set { |n| n[:shape] = :circle; n[:regular] = 1; n[:style] = :filled; n[:fillcolor] = :white; n[:label] = "012" } g._008.set { |n| n[:shape] = :box; n[:regular] = 1; n[:style] = :filled; n[:fillcolor] = :white; n[:label] = "008" } g._011.set { |n| n[:shape] = :box; n[:regular] = 1; n[:style] = :filled; n[:fillcolor] = :white; n[:label] = "011" } g._013.set { |n| n[:shape] = :box; n[:regular] = 1; n[:style] = :filled; n[:fillcolor] = :white; n[:label] = "013" } g._010.set { |n| n[:shape] = :box; n[:regular] = 1; n[:style] = :filled; n[:fillcolor] = :white; n[:label] = "010" } g._023.set { |n| n[:shape] = :circle; n[:regular] = 1; n[:style] = :filled; n[:fillcolor] = :white; n[:label] = "023" } g._020.set { |n| n[:shape] = :circle; n[:regular] = 1; n[:style] = :filled; n[:fillcolor] = :white; n[:label] = "020" } g._021.set { |n| n[:shape] = :circle; n[:regular] = 1; n[:style] = :filled; n[:fillcolor] = :white; n[:label] = "021" } g._018.set { |n| n[:shape] = :circle; n[:regular] = 1; n[:style] = :filled; n[:fillcolor] = :white; n[:label] = "018" } g._025.set { |n| n[:shape] = :circle; n[:regular] = 1; n[:style] = :filled; n[:fillcolor] = :white; n[:label] = "025" } g._019.set { |n| n[:shape] = :box; n[:regular] = 1; n[:style] = :filled; n[:fillcolor] = :white; n[:label] = "019" } g._022.set { |n| n[:shape] = :box; n[:regular] = 1; n[:style] = :filled; n[:fillcolor] = :white; n[:label] = "022" } g._024.set { |n| n[:shape] = :box; n[:regular] = 1; n[:style] = :filled; n[:fillcolor] = :white; n[:label] = "024" } g._027.set { |n| n[:shape] = :circle; n[:regular] = 1; n[:style] = :filled; n[:fillcolor] = :white; n[:label] = "027" } g._026.set { |n| n[:shape] = :box; n[:regular] = 1; n[:style] = :filled; n[:fillcolor] = :white; n[:label] = "026" } g._028.set { |n| n[:shape] = :box; n[:regular] = 1; n[:style] = :filled; n[:fillcolor] = :grey; n[:label] = "028" } g.marr0001.set { |n| n[:shape] = :diamond; n[:style] = :filled; n[:label] = ""; n[:height] = 0.1; n[:width] = 0.1 } (g._001 << g.marr0001).set { |e| e[:dir] = :none; e[:weight] = 1 } (g._007 << g.marr0001).set { |e| e[:dir] = :none; e[:weight] = 1 } (g.marr0001 << g._017).set { |e| e[:dir] = :none; e[:weight] = 2 } g.marr0002.set { |n| n[:shape] = :diamond; n[:style] = :filled; n[:label] = ""; n[:height] = 0.1; n[:width] = 0.1 } (g._001 << g.marr0002).set { |e| e[:dir] = :none; e[:weight] = 1 } (g.ZZ02 << g.marr0002).set { |e| e[:dir] = :none; e[:weight] = 1 } (g.marr0002 << g._012).set { |e| e[:dir] = :none; e[:weight] = 2 } g.marr0003.set { |n| n[:shape] = :diamond; n[:style] = :filled; n[:label] = ""; n[:height] = 0.1; n[:width] = 0.1 } (g._002 << g.marr0003).set { |e| e[:dir] = :none; e[:weight] = 1 } (g._003 << g.marr0003).set { |e| e[:dir] = :none; e[:weight] = 1 } (g.marr0003 << g._008).set { |e| e[:dir] = :none; e[:weight] = 2 } g.marr0004.set { |n| n[:shape] = :diamond; n[:style] = :filled; n[:label] = ""; n[:height] = 0.1; n[:width] = 0.1 } (g._002 << g.marr0004).set { |e| e[:dir] = :none; e[:weight] = 1 } (g._006 << g.marr0004).set { |e| e[:dir] = :none; e[:weight] = 1 } (g.marr0004 << g._011).set { |e| e[:dir] = :none; e[:weight] = 2 } g.marr0005.set { |n| n[:shape] = :diamond; n[:style] = :filled; n[:label] = ""; n[:height] = 0.1; n[:width] = 0.1 } (g._002 << g.marr0005).set { |e| e[:dir] = :none; e[:weight] = 1 } (g.ZZ01 << g.marr0005).set { |e| e[:dir] = :none; e[:weight] = 1 } (g.marr0005 << g._013).set { |e| e[:dir] = :none; e[:weight] = 2 } g.marr0006.set { |n| n[:shape] = :diamond; n[:style] = :filled; n[:label] = ""; n[:height] = 0.1; n[:width] = 0.1 } (g._004 << g.marr0006).set { |e| e[:dir] = :none; e[:weight] = 1 } (g._009 << g.marr0006).set { |e| e[:dir] = :none; e[:weight] = 1 } (g.marr0006 << g._010).set { |e| e[:dir] = :none; e[:weight] = 2 } g.marr0007.set { |n| n[:shape] = :diamond; n[:style] = :filled; n[:label] = ""; n[:height] = 0.1; n[:width] = 0.1 } (g._005 << g.marr0007).set { |e| e[:dir] = :none; e[:weight] = 1 } (g._015 << g.marr0007).set { |e| e[:dir] = :none; e[:weight] = 1 } (g.marr0007 << g._023).set { |e| e[:dir] = :none; e[:weight] = 2 } g.marr0008.set { |n| n[:shape] = :diamond; n[:style] = :filled; n[:label] = ""; n[:height] = 0.1; n[:width] = 0.1 } (g._005 << g.marr0008).set { |e| e[:dir] = :none; e[:weight] = 1 } (g._016 << g.marr0008).set { |e| e[:dir] = :none; e[:weight] = 1 } (g.marr0008 << g._020).set { |e| e[:dir] = :none; e[:weight] = 2 } g.marr0009.set { |n| n[:shape] = :diamond; n[:style] = :filled; n[:label] = ""; n[:height] = 0.1; n[:width] = 0.1 } (g._005 << g.marr0009).set { |e| e[:dir] = :none; e[:weight] = 1 } (g._012 << g.marr0009).set { |e| e[:dir] = :none; e[:weight] = 1 } (g.marr0009 << g._021).set { |e| e[:dir] = :none; e[:weight] = 2 } g.marr0010.set { |n| n[:shape] = :diamond; n[:style] = :filled; n[:label] = ""; n[:height] = 0.1; n[:width] = 0.1 } (g._008 << g.marr0010).set { |e| e[:dir] = :none; e[:weight] = 1 } (g._017 << g.marr0010).set { |e| e[:dir] = :none; e[:weight] = 1 } (g.marr0010 << g._018).set { |e| e[:dir] = :none; e[:weight] = 2 } g.marr0011.set { |n| n[:shape] = :diamond; n[:style] = :filled; n[:label] = ""; n[:height] = 0.1; n[:width] = 0.1 } (g._011 << g.marr0011).set { |e| e[:dir] = :none; e[:weight] = 1 } (g._023 << g.marr0011).set { |e| e[:dir] = :none; e[:weight] = 1 } (g.marr0011 << g._025).set { |e| e[:dir] = :none; e[:weight] = 2 } g.marr0012.set { |n| n[:shape] = :diamond; n[:style] = :filled; n[:label] = ""; n[:height] = 0.1; n[:width] = 0.1 } (g._013 << g.marr0012).set { |e| e[:dir] = :none; e[:weight] = 1 } (g._014 << g.marr0012).set { |e| e[:dir] = :none; e[:weight] = 1 } (g.marr0012 << g._019).set { |e| e[:dir] = :none; e[:weight] = 2 } g.marr0013.set { |n| n[:shape] = :diamond; n[:style] = :filled; n[:label] = ""; n[:height] = 0.1; n[:width] = 0.1 } (g._010 << g.marr0013).set { |e| e[:dir] = :none; e[:weight] = 1 } (g._021 << g.marr0013).set { |e| e[:dir] = :none; e[:weight] = 1 } (g.marr0013 << g._022).set { |e| e[:dir] = :none; e[:weight] = 2 } g.marr0014.set { |n| n[:shape] = :diamond; n[:style] = :filled; n[:label] = ""; n[:height] = 0.1; n[:width] = 0.1 } (g._019 << g.marr0014).set { |e| e[:dir] = :none; e[:weight] = 1 } (g._020 << g.marr0014).set { |e| e[:dir] = :none; e[:weight] = 1 } (g.marr0014 << g._024).set { |e| e[:dir] = :none; e[:weight] = 2 } g.marr0015.set { |n| n[:shape] = :diamond; n[:style] = :filled; n[:label] = ""; n[:height] = 0.1; n[:width] = 0.1 } (g._022 << g.marr0015).set { |e| e[:dir] = :none; e[:weight] = 1 } (g._025 << g.marr0015).set { |e| e[:dir] = :none; e[:weight] = 1 } (g.marr0015 << g._027).set { |e| e[:dir] = :none; e[:weight] = 2 } g.marr0016.set { |n| n[:shape] = :diamond; n[:style] = :filled; n[:label] = ""; n[:height] = 0.1; n[:width] = 0.1 } (g._024 << g.marr0016).set { |e| e[:dir] = :none; e[:weight] = 1 } (g._018 << g.marr0016).set { |e| e[:dir] = :none; e[:weight] = 1 } (g.marr0016 << g._026).set { |e| e[:dir] = :none; e[:weight] = 2 } g.marr0017.set { |n| n[:shape] = :diamond; n[:style] = :filled; n[:label] = ""; n[:height] = 0.1; n[:width] = 0.1 } (g._026 << g.marr0017).set { |e| e[:dir] = :none; e[:weight] = 1 } (g._027 << g.marr0017).set { |e| e[:dir] = :none; e[:weight] = 1 } (g.marr0017 << g._028).set { |e| e[:dir] = :none; e[:weight] = 2 } }.output( :png => "#{$0}.png" )ruby-graphviz-1.2.3/examples/sample74.rb0000644000004100000410000000062113111037426020152 0ustar www-datawww-data#!/usr/bin/ruby $:.unshift( "../lib" ) require "graphviz" g = nil if ARGV[0] g = GraphViz::new( "G", :path => ARGV[0] ) else g = GraphViz::new( "G" ) end g.add_nodes "english", label: 'hello' g.add_nodes "chinese", label: '你好' g.add_nodes "korean", label: '안녕하세요' g.add_nodes "arabic", label: 'مرحبا' g.add_nodes "russian", label: 'Алло' g.output( :png => "#{$0}.png" ) ruby-graphviz-1.2.3/examples/sample61.rb0000644000004100000410000000031013111037426020141 0ustar www-datawww-data#!/usr/bin/ruby $:.unshift( "../lib" ); require "graphviz" asm = GraphViz::new( "" ) my = asm.add_nodes("My") asmn = asm.add_nodes("ASM") asm.add_edges(my, asmn) asm.output( :png => "#{$0}.png" ) ruby-graphviz-1.2.3/examples/sample34.rb0000644000004100000410000000100213111037426020140 0ustar www-datawww-data#!/usr/bin/ruby $:.unshift( "../lib" ) require "graphviz" GraphViz.new(:G) { |g| g[:color] = "black" g.one :label => "1" # This is an anonymous graph c = g.add_graph( :rank => "same" ) { |c| c.two :label => "2" c.three :label => "3" c.two << c.three } # And this is not! k = g.add_graph( "Hello" ) { |k| k.four :label => "4" k.five :label => "5" k.four << k.five } g.one << c.two g.one << c.three c.two << k.four c.three << k.five }.output( :canon => String ) ruby-graphviz-1.2.3/examples/sample48.rb0000644000004100000410000000236413111037426020161 0ustar www-datawww-data# http://www.graphviz.org/Gallery/directed/cluster.html # # digraph G { # # subgraph cluster_0 { # style=filled; # color=lightgrey; # node [style=filled,color=white]; # a0 -> a1 -> a2 -> a3; # label = "process #1"; # } # # subgraph cluster_1 { # node [style=filled]; # b0 -> b1 -> b2 -> b3; # label = "process #2"; # color=blue # } # start -> a0; # start -> b0; # a1 -> b3; # b2 -> a3; # a3 -> a0; # a3 -> end; # b3 -> end; # # start [shape=Mdiamond]; # end [shape=Msquare]; # } $:.unshift( "../lib" ); require "graphviz" GraphViz.new( :G, :type => :digraph ) { |g| g.cluster_0 { |c| c[:style] = :filled c[:color] = :lightgrey c.node[:style] = :filled c.node[:color] = :white c.a0 << c.a1 << c.a2 << c.a3 c[:label] = "process #1" } g.cluster_1 { |c| c.node[:style] = :filled c.b0 << c.b1 << c.b2 << c.b3 c[:label] = "process #1" c[:color] = :blue } g.start << g.cluster_0.a0 g.start << g.cluster_1.b0 g.cluster_0.a1 << g.cluster_1.b3 g.cluster_1.b2 << g.cluster_0.a3 g.cluster_0.a3 << g.cluster_0.a0 g.cluster_0.a3 << g._end g.cluster_1.b3 << g._end g.start[:shape] = :Mdiamond g._end[:label] = "end" g._end[:shape] = :Mdiamond }.output( :png => "#{$0}.png" ) ruby-graphviz-1.2.3/examples/sample37.rb0000644000004100000410000000330513111037426020153 0ustar www-datawww-data$:.unshift( "../lib" ) require "graphviz" # The goal is to set each planet to its own orbit + set some (earth+moon) to the same orbit g = GraphViz::new( "Solarsys", :type => "digraph", :use => "twopi" ) # the star sun = g.add_nodes( 'Sun', :shape => "circle", :penwidth => 2, :fontsize => 12, :style => :filled, :fillcolor => "orange", :label => "Sun\n" ) planets = Hash.new # The Earth and the Moon - in the same subgraph\rank g.subgraph { |c| c[:rank => 'same'] planets['Moon'] = c.add_nodes( 'Moon', :shape => "circle", :penwidth => 2, :fontsize => 12, :style => :filled, :fillcolor => "red", :label => "Moon\n" ) planets['Earth'] = c.add_nodes( 'Earth', :shape => "circle", :penwidth => 2, :fontsize => 12, :style => :filled, :fillcolor => "blue", :label => "Earth\n" ) c.add_edges( planets['Moon'], planets['Earth'], :penwidth => 2, :labeltooltip => "distance", :color => "black" ) } g.add_edges( sun, planets['Earth'], :penwidth => 2, :labeltooltip => "distance", :color => "black" ) i = 0 # some more planets - each supposed having its own orbit - im trying to do it with rank ['Mercury','Venus','Mars','Jupiter','Saturn','Uranus','Neptune','Pluto'].each { |p| i = i + 1 # set each to its own orbit # that doesnt seem to work ... g.subgraph { |c| c[:rank => "same"] planets[p] = c.add_nodes( p, :shape => "circle", :penwidth => 2, :fontsize => 12, :fillcolor => "green", :style => :filled, :label => "#{p}\n" ) c.add_edges( sun, planets[p], :penwidth => 2, :label => "distance", :color => "black" ) } } g.output( :png => "#{$0}.png" ) g.output( :none => "#{$0}.dot" ) ruby-graphviz-1.2.3/examples/graphml/0000755000004100000410000000000013111037426017624 5ustar www-datawww-dataruby-graphviz-1.2.3/examples/graphml/cluster.graphml0000644000004100000410000000451413111037426022665 0ustar www-datawww-data lightgrey filled process #1 filled white filled white filled white filled white blue process #2 filled filled filled filled Mdiamond Mdiamond ruby-graphviz-1.2.3/examples/graphml/port.graphml0000644000004100000410000000200313111037426022157 0ustar www-datawww-data ruby-graphviz-1.2.3/examples/graphml/simple.graphml0000644000004100000410000000201713111037426022471 0ustar www-datawww-data ruby-graphviz-1.2.3/examples/graphml/failed_graph.graphml0000644000004100000410000006570713111037426023624 0ustar www-datawww-data K L J E I H G D F B C A ruby-graphviz-1.2.3/examples/graphml/hyper.graphml0000644000004100000410000000154113111037426022330 0ustar www-datawww-data ruby-graphviz-1.2.3/examples/graphml/attributes.graphml0000644000004100000410000000247113111037426023372 0ustar www-datawww-data yellow green blue red turquoise 1.0 1.0 2.0 1.1 ruby-graphviz-1.2.3/examples/graphml/attributes.ext.graphml0000644000004100000410000000100313111037426024157 0ustar www-datawww-data ruby-graphviz-1.2.3/examples/graphml/nested.graphml0000644000004100000410000000413313111037426022463 0ustar www-datawww-data black filled SUB n5 red filled SUB n6 SUB n6::n0 blue filled ruby-graphviz-1.2.3/examples/sample32.rb0000644000004100000410000000051613111037426020147 0ustar www-datawww-data#!/usr/bin/ruby $:.unshift( "../lib" ); require "graphviz" GraphViz.new(:G){ |g| g.edge[:arrowsize => 0.5] g.graph[:bb => "0,0,638,256"] g.person[:shape => :record]; g.driver[:shape => :ellipse]; g.owner[:shape => :ellipse]; g.passenger[:shape => :ellipse]; g.vehicle[:shape => :record]; }.save( :png => "#{$0}.png" ) ruby-graphviz-1.2.3/examples/sample31.rb0000644000004100000410000000033313111037426020143 0ustar www-datawww-data#!/usr/bin/ruby $:.unshift( "../lib" ); require "graphviz" GraphViz.new(:g){ |g| a = g.add_nodes( "A:B:C", :shape => :record ) b = g.add_nodes( "D:E:F", :shape => :ellipse ) a << b }.save( :png => "#{$0}.png" ) ruby-graphviz-1.2.3/examples/sample02.rb0000644000004100000410000000220413111037426020140 0ustar www-datawww-data#!/usr/bin/ruby $:.unshift( "../lib" ); require "graphviz" g = nil if ARGV[0] g = GraphViz::new( "G", :path => ARGV[0] ) else g = GraphViz::new( "G" ) end g.node[:shape] = "ellipse" g.node[:color] = "black" g.edge[:color] = "black" g.edge[:weight] = "1" g.edge[:style] = "filled" g.edge[:label] = "" g[:size] = "4,4" main = g.add_nodes( "main", :shape => "box" ) parse = g.add_nodes( "parse" ) execute = g.add_nodes( "execute" ) init = g.add_nodes( "init" ) cleanup = g.add_nodes( "cleanup" ) make_string = g.add_nodes( "make_string", :label => 'make a\nstring' ) printf = g.add_nodes( "printf" ) compare = g.add_nodes( "compare", :shape => "box", :style => "filled", :color => ".7 .3 1.0" ) g.add_edges( main, parse, :weight => "8" ) g.add_edges( parse, execute ) g.add_edges( main, init, :style => "dotted" ) g.add_edges( main, cleanup ) g.add_edges( execute, make_string ) g.add_edges( execute, printf ) g.add_edges( init, make_string ) g.add_edges( main, printf, :color => "red", :style => "bold", :label => "100 times" ) g.add_edges( execute, compare, :color => "red" ) g.output( :png => "#{$0}.png" ) ruby-graphviz-1.2.3/examples/sample18.rb0000644000004100000410000000173313111037426020155 0ustar www-datawww-data#!/usr/bin/ruby $:.unshift( "../lib" ); require "graphviz" GraphViz::new( "G", :rankdir => "LR", :size => "8,5" ) { |graph| graph.node[:shape] = "doublecircle" graph._LR_0; graph._LR_3; graph._LR_4; graph._LR_8 graph.node[:shape] = "circle" (graph._LR_0 << graph._LR_2)[:label] = "SS(B)" (graph._LR_0 << graph._LR_1)[:label] = "SS(S)" (graph._LR_1 << graph._LR_3)[:label] = "S($end)" (graph._LR_2 << graph._LR_6)[:label] = "SS(b)" (graph._LR_2 << graph._LR_5)[:label] = "SS(a)" (graph._LR_2 << graph._LR_4)[:label] = "S(A)" (graph._LR_5 << graph._LR_7)[:label] = "S(b)" (graph._LR_5 << graph._LR_5)[:label] = "S(a)" (graph._LR_6 << graph._LR_6)[:label] = "S(b)" (graph._LR_6 << graph._LR_5)[:label] = "S(a)" (graph._LR_7 << graph._LR_8)[:label] = "S(b)" (graph._LR_7 << graph._LR_5)[:label] = "S(a)" (graph._LR_8 << graph._LR_6)[:label] = "S(b)" (graph._LR_8 << graph._LR_5)[:label] = "S(a)" }.output( :path => '/usr/local/bin/', :png => "#{$0}.png" )ruby-graphviz-1.2.3/examples/sample10.rb0000644000004100000410000000254413111037426020146 0ustar www-datawww-data#!/usr/bin/ruby $:.unshift( "../lib" ); require "graphviz" g = nil if ARGV[0] g = GraphViz::new( "G", "path" => ARGV[0] ) else g = GraphViz::new( "G" ) end g.node["shape"] = "ellipse" g.node["color"] = "black" g["color"] = "black" c0 = g.add_graph( "cluster0" ) c0["label"] = "process #1" c0["style"] = "filled" c0["color"] = "lightgrey" a0 = c0.add_nodes( "a0", "style" => "filled", "color" => "white" ) a1 = c0.add_nodes( "a1", "style" => "filled", "color" => "white" ) a2 = c0.add_nodes( "a2", "style" => "filled", "color" => "white" ) a3 = c0.add_nodes( "a3", "style" => "filled", "color" => "white" ) c0.add_edges( a0, a1 ) c0.add_edges( a1, a2 ) c0.add_edges( a2, a3 ) c1 = g.add_graph( "cluster1", "label" => "process #2" ) b0 = c1.add_nodes( "b0", "style" => "filled", "color" => "blue" ) b1 = c1.add_nodes( "b1", "style" => "filled", "color" => "blue" ) b2 = c1.add_nodes( "b2", "style" => "filled", "color" => "blue" ) b3 = c1.add_nodes( "b3", "style" => "filled", "color" => "blue" ) c1.add_edges( b0, b1 ) c1.add_edges( b1, b2 ) c1.add_edges( b2, b3 ) start = g.add_nodes( "start", "shape" => "Mdiamond" ) endn = g.add_nodes( "end", "shape" => "Msquare" ) g.add_edges( start, a0 ) g.add_edges( start, b0 ) g.add_edges( a1, b3 ) g.add_edges( b2, a3 ) g.add_edges( a3, a0 ) g.add_edges( a3, endn ) g.add_edges( b3, endn ) g.output( :png => "#{$0}.png" ) ruby-graphviz-1.2.3/examples/sample65.rb0000644000004100000410000000025113111037426020151 0ustar www-datawww-data$:.unshift("../lib") require 'graphviz/dsl' digraph :G do world[:label => "World"] << hello[:label => "Hello"] #world << hello output :png => "#{$0}.png" end ruby-graphviz-1.2.3/examples/sample36.rb0000644000004100000410000000160613111037426020154 0ustar www-datawww-data#!/usr/bin/ruby $:.unshift( "../lib" ) require "graphviz" GraphViz.graph( :G ) { |g| last_line = [] node_number = 0 100.times do |j| # New_Line new_line = [] c = g.subgraph( :rank => "same" ) 100.times do |i| current_node = c.add_nodes( "N#{node_number}", :shape => "point", :label => "" ) last_node = new_line[-1] unless last_node.nil? c.add_edges( last_node, current_node ) end new_line << current_node top_first_node = last_line.shift unless top_first_node.nil? g.add_edges( top_first_node, current_node ) top_second_node = last_line.shift unless top_second_node.nil? g.add_edges( top_second_node, current_node ) last_line.unshift( top_second_node ) end end node_number = node_number + 1 end last_line = new_line end }.output( :png => "#{$0}.png" ) ruby-graphviz-1.2.3/examples/sample59.rb0000644000004100000410000000030613111037426020155 0ustar www-datawww-data$:.unshift( "../lib" ) require "graphviz" graph = { "a" => { "b" => "d", "c" => ["e", "f", "a"] }, "g" => "e", } g = GraphViz::new( "G" ) g.add(graph) g.output( :png => "#{$0}.png" )ruby-graphviz-1.2.3/examples/sample15.rb0000644000004100000410000000110113111037426020137 0ustar www-datawww-data#!/usr/bin/ruby # fdp example # see : http://www.graphviz.org/Gallery/undirected/fdpclust.html $:.unshift( "../lib" ); require "graphviz" g = GraphViz::new( "G", :type => "graph", :use => "fdp" ) { |graph| graph.e graph.clusterA { |cA| cA.a << cA.b cA.clusterC { |cC| cC._c( :label => "C" ) << cC._d( :label => "D" ) } } graph.clusterB { |cB| cB.d << cB.f } graph.clusterB.d << graph.clusterA.clusterC._d graph.e << graph.clusterB graph.clusterA.clusterC << graph.clusterB } g.output( :path => '/usr/local/bin/', :png => "#{$0}.png" ) ruby-graphviz-1.2.3/examples/sample21.rb0000644000004100000410000000052313111037426020143 0ustar www-datawww-data#!/usr/bin/ruby $:.unshift( "../lib" ); require "graphviz" {"png" => "#{$0}.png", "imap" => "#{$0}.html"}.each do |format, file| GraphViz::new( "G" ) { |g| g.command(:URL => "http://www.research.att.com/base.html") g._output(:label => "output", :URL => "colors.html") g.command << g._output }.output( format => file ) endruby-graphviz-1.2.3/examples/sample44.rb0000644000004100000410000000235513111037426020155 0ustar www-datawww-data#!/usr/bin/ruby $:.unshift( "../lib" ); require "graphviz" g = nil if ARGV[0] g = GraphViz::new( "G", "path" => ARGV[0] ) else g = GraphViz::new( "G" ) end g["rankdir"] = "LR" g.node["shape"] = "ellipse" g.edge["arrowhead"] = "normal" [ "box", "boxbox", "lbox", "lboxlbox", "rbox", "rboxrbox", "olbox", "olboxolbox", "orbox", "orboxorbox", "obox", "oboxobox", "crow", "crowcrow", "lcrow", "lcrowlcrow", "rcrow", "rcrowrcrow", "diamond", "diamonddiamond", "ldiamond", "ldiamondldiamond", "rdiamond", "rdiamondrdiamond", "oldiamond", "oldiamondoldiamond", "ordiamond", "ordiamondordiamond", "odiamond", "odiamondodiamond", "dot", "dotdot", "odot", "odotodot", "inv", "invinv", "linv", "linvlinv", "rinv", "rinvrinv", "olinv", "olinvolinv", "orinv", "orinvorinv", "oinv", "oinvoinv", "none", "nonenone", "normal", "normalnormal", "lnormal", "lnormallnormal", "rnormal", "rnormalrnormal", "olnormal", "olnormalolnormal", "ornormal", "ornormalornormal", "onormal", "onormalonormal", "tee", "teetee", "ltee", "lteeltee", "rtee", "rteertee", "vee", "veevee", "lvee", "lveelvee", "rvee", "rveervee" ].each { |s| p = "p_" << s g.add_nodes( p, "shape" => "point" ) g.add_nodes( s ) g.add_edges( p, s, "arrowhead" => s ) } g.output( :png => "#{$0}.png" ) ruby-graphviz-1.2.3/examples/sample24.rb0000644000004100000410000000034513111037426020150 0ustar www-datawww-data#!/usr/bin/ruby $:.unshift( "../lib" ); require "graphviz" GraphViz::new( "G" ) { |g| g.hello << g.world g.bonjour - g.monde g.hola > g.mundo g.holla >> g.welt }.output( :path => "/usr/local/bin", :png => "#{$0}.png" ) ruby-graphviz-1.2.3/examples/sample40.rb0000644000004100000410000000065713111037426020154 0ustar www-datawww-data$:.unshift( "../lib" ); require "graphviz" graph = GraphViz.new( :G, :type => :digraph ) node1 = graph.add_nodes("hello:world", "shape" => "record", "label" => "| 1|" ) node2 = graph.add_nodes("2", "shape" => "record", "label" => "| 2|" ) graph.add_edges( {node1 => :left}, node2 ) graph.add_edges( {node2 => :right}, node1 ) puts graph.output( :none => String, :png => "#{$0}.png" ) ruby-graphviz-1.2.3/examples/sample30.rb0000644000004100000410000000064513111037426020150 0ustar www-datawww-data#!/usr/bin/ruby $:.unshift( "../lib" ); require "graphviz" GraphViz.new(:g){ |g| g[:center] = true a = g.add_nodes("A", :shape => "sdl_procedure_start", :peripheries => 0 ) b = g.add_nodes("B", :shape => "sdl_save", :peripheries => 0) c = g.add_nodes("n", :shape => "box", :label => "\\G::\\N\\r") a << b << c }.save( :ps => "#{$0}.ps", :extlib => File.join( File.dirname(__FILE__), "sdlshapes", "sdl.ps" ) ) ruby-graphviz-1.2.3/examples/sample19.rb0000644000004100000410000000251213111037426020152 0ustar www-datawww-data#!/usr/bin/ruby $:.unshift( "../lib" ); require "graphviz" GraphViz::new( "ER", :type => "graph", :use => "neato" ) { |graph| graph.node[:shape] = "box" graph.course; graph.institute; graph.student graph.node[:shape] = "ellipse" graph.name0(:label => "name") graph.name1(:label => "name") graph.name2(:label => "name") graph.code; graph.grade; graph.number graph.node[:shape] = "diamond" graph.node[:style] = "filled" graph.node[:color] = "lightgrey" graph.ci( :label => "C-I" ) graph.sc( :label => "S-C" ) graph.si( :label => "S-I" ) graph.name0 << graph.course; graph.code << graph.course; (graph.course << graph.ci).set { |e| e.label = "n" e.len = "1.00" } e = (graph.ci << graph.institute) e.label = "1" e[:len] = "1.00" graph.institute << graph.name1; e = (graph.institute << graph.si) e[:label] = "1" e[:len] = "1.00" e = (graph.si << graph.student) e[:label] = "n" e[:len] = "1.00" graph.student << graph.grade graph.student << graph.name2 graph.student << graph.number e = (graph.student << graph.sc) e[:label] = "m" e[:len] = "1.00" e = (graph.sc << graph.course) e[:label] = "n" e[:len] = "1.00" graph[:label] = "\\n\\nEntity Relation Diagram\\ndrawn by NEATO"; graph[:fontsize] = "20"; }.output( :path => '/usr/local/bin/', :png => "#{$0}.png" )ruby-graphviz-1.2.3/examples/sample07.rb0000644000004100000410000000121113111037426020142 0ustar www-datawww-data#!/usr/bin/ruby $:.unshift( "../lib" ); require "graphviz" GraphViz::options( :use => "dot" ) if ARGV[0] GraphViz::options( :path => ARGV[0] ) end g = GraphViz::new( "structs" ) g.node["shape"] = "record" g.add_nodes( "struct1", "shape" => "record", "label" => " left| middle| right" ) g.add_nodes( "struct2", "shape" => "record", "label" => " one| two" ) g.add_nodes( "struct3", "shape" => "record", "label" => 'hello\nworld |{ b |{c| d|e}| f}| g | h' ) g.add_edges( { "struct1" => :f1}, {"struct2" => :f0} ) g.add_edges( {"struct1" => :f2}, {"struct3" => :here} ) g.output( :png => "#{$0}.png", :canon => nil ) ruby-graphviz-1.2.3/examples/dot/0000755000004100000410000000000013111037426016760 5ustar www-datawww-dataruby-graphviz-1.2.3/examples/dot/hello_test.rb0000644000004100000410000000104513111037426021447 0ustar www-datawww-data#!/usr/bin/ruby $:.unshift( "../../lib" ); require "graphviz" g = GraphViz.parse( "hello.dot", :path => "/usr/local/bin" ) { |g| g.graph[:color] = "blue" g.node[:color] = "red" g.edge[:color] = "yellow" g.get_node("Hello") { |n| n.label = "Bonjour" } g.get_node("World") { |n| n.label = "Le Monde" } } g.graph.each do |k, v| puts "graph : #{k} => #{v}" end g.node.each do |k, v| puts "node : #{k} => #{v}" end g.edge.each do |k, v| puts "edge : #{k} => #{v}" end puts "-----------" puts g.output(:none => String) ruby-graphviz-1.2.3/examples/dot/unix.dot0000644000004100000410000001270313111037426020456 0ustar www-datawww-datadigraph "unix" { graph [ fontname = "Helvetica-Oblique", fontsize = 36, label = "\n\n\n\nObject Oriented Graphs\nStephen North, 3/19/93", size = "6,6" ]; node [ shape = polygon, sides = 4, distortion = "0.0", orientation = "0.0", skew = "0.0", color = white, style = filled, fontname = "Helvetica-Outline" ]; "5th Edition" [sides=9, distortion="0.936354", orientation=28, skew="-0.126818", color=salmon2]; "6th Edition" [sides=5, distortion="0.238792", orientation=11, skew="0.995935", color=deepskyblue]; "PWB 1.0" [sides=8, distortion="0.019636", orientation=79, skew="-0.440424", color=goldenrod2]; LSX [sides=9, distortion="-0.698271", orientation=22, skew="-0.195492", color=burlywood2]; "1 BSD" [sides=7, distortion="0.265084", orientation=26, skew="0.403659", color=gold1]; "Mini Unix" [distortion="0.039386", orientation=2, skew="-0.461120", color=greenyellow]; Wollongong [sides=5, distortion="0.228564", orientation=63, skew="-0.062846", color=darkseagreen]; Interdata [distortion="0.624013", orientation=56, skew="0.101396", color=dodgerblue1]; "Unix/TS 3.0" [sides=8, distortion="0.731383", orientation=43, skew="-0.824612", color=thistle2]; "PWB 2.0" [sides=6, distortion="0.592100", orientation=34, skew="-0.719269", color=darkolivegreen3]; "7th Edition" [sides=10, distortion="0.298417", orientation=65, skew="0.310367", color=chocolate]; "8th Edition" [distortion="-0.997093", orientation=50, skew="-0.061117", color=turquoise3]; "32V" [sides=7, distortion="0.878516", orientation=19, skew="0.592905", color=steelblue3]; V7M [sides=10, distortion="-0.960249", orientation=32, skew="0.460424", color=navy]; "Ultrix-11" [sides=10, distortion="-0.633186", orientation=10, skew="0.333125", color=darkseagreen4]; Xenix [sides=8, distortion="-0.337997", orientation=52, skew="-0.760726", color=coral]; "UniPlus+" [sides=7, distortion="0.788483", orientation=39, skew="-0.526284", color=darkolivegreen3]; "9th Edition" [sides=7, distortion="0.138690", orientation=55, skew="0.554049", color=coral3]; "2 BSD" [sides=7, distortion="-0.010661", orientation=84, skew="0.179249", color=blanchedalmond]; "2.8 BSD" [distortion="-0.239422", orientation=44, skew="0.053841", color=lightskyblue1]; "2.9 BSD" [distortion="-0.843381", orientation=70, skew="-0.601395", color=aquamarine2]; "3 BSD" [sides=10, distortion="0.251820", orientation=18, skew="-0.530618", color=lemonchiffon]; "4 BSD" [sides=5, distortion="-0.772300", orientation=24, skew="-0.028475", color=darkorange1]; "4.1 BSD" [distortion="-0.226170", orientation=38, skew="0.504053", color=lightyellow1]; "4.2 BSD" [sides=10, distortion="-0.807349", orientation=50, skew="-0.908842", color=darkorchid4]; "4.3 BSD" [sides=10, distortion="-0.030619", orientation=76, skew="0.985021", color=lemonchiffon2]; "Ultrix-32" [distortion="-0.644209", orientation=21, skew="0.307836", color=goldenrod3]; "PWB 1.2" [sides=7, distortion="0.640971", orientation=84, skew="-0.768455", color=cyan]; "USG 1.0" [distortion="0.758942", orientation=42, skew="0.039886", color=blue]; "CB Unix 1" [sides=9, distortion="-0.348692", orientation=42, skew="0.767058", color=firebrick]; "USG 2.0" [distortion="0.748625", orientation=74, skew="-0.647656", color=chartreuse4]; "CB Unix 2" [sides=10, distortion="0.851818", orientation=32, skew="-0.020120", color=greenyellow]; "CB Unix 3" [sides=10, distortion="0.992237", orientation=29, skew="0.256102", color=bisque4]; "Unix/TS++" [sides=6, distortion="0.545461", orientation=16, skew="0.313589", color=mistyrose2]; "PDP-11 Sys V" [sides=9, distortion="-0.267769", orientation=40, skew="0.271226", color=cadetblue1]; "USG 3.0" [distortion="-0.848455", orientation=44, skew="0.267152", color=bisque2]; "Unix/TS 1.0" [distortion="0.305594", orientation=75, skew="0.070516", color=orangered]; "TS 4.0" [sides=10, distortion="-0.641701", orientation=50, skew="-0.952502", color=crimson]; "System V.0" [sides=9, distortion="0.021556", orientation=26, skew="-0.729938", color=darkorange1]; "System V.2" [sides=6, distortion="0.985153", orientation=33, skew="-0.399752", color=darkolivegreen4]; "System V.3" [sides=7, distortion="-0.687574", orientation=58, skew="-0.180116", color=lightsteelblue1]; "5th Edition" -> "6th Edition"; "5th Edition" -> "PWB 1.0"; "6th Edition" -> LSX; "6th Edition" -> "1 BSD"; "6th Edition" -> "Mini Unix"; "6th Edition" -> Wollongong; "6th Edition" -> Interdata; Interdata -> "Unix/TS 3.0"; Interdata -> "PWB 2.0"; Interdata -> "7th Edition"; "7th Edition" -> "8th Edition"; "7th Edition" -> "32V"; "7th Edition" -> V7M; "7th Edition" -> "Ultrix-11"; "7th Edition" -> Xenix; "7th Edition" -> "UniPlus+"; V7M -> "Ultrix-11"; "8th Edition" -> "9th Edition"; "1 BSD" -> "2 BSD"; "2 BSD" -> "2.8 BSD"; "2.8 BSD" -> "Ultrix-11"; "2.8 BSD" -> "2.9 BSD"; "32V" -> "3 BSD"; "3 BSD" -> "4 BSD"; "4 BSD" -> "4.1 BSD"; "4.1 BSD" -> "4.2 BSD"; "4.1 BSD" -> "2.8 BSD"; "4.1 BSD" -> "8th Edition"; "4.2 BSD" -> "4.3 BSD"; "4.2 BSD" -> "Ultrix-32"; "PWB 1.0" -> "PWB 1.2"; "PWB 1.0" -> "USG 1.0"; "PWB 1.2" -> "PWB 2.0"; "USG 1.0" -> "CB Unix 1"; "USG 1.0" -> "USG 2.0"; "CB Unix 1" -> "CB Unix 2"; "CB Unix 2" -> "CB Unix 3"; "CB Unix 3" -> "Unix/TS++"; "CB Unix 3" -> "PDP-11 Sys V"; "USG 2.0" -> "USG 3.0"; "USG 3.0" -> "Unix/TS 3.0"; "PWB 2.0" -> "Unix/TS 3.0"; "Unix/TS 1.0" -> "Unix/TS 3.0"; "Unix/TS 3.0" -> "TS 4.0"; "Unix/TS++" -> "TS 4.0"; "CB Unix 3" -> "TS 4.0"; "TS 4.0" -> "System V.0"; "System V.0" -> "System V.2"; "System V.2" -> "System V.3"; }ruby-graphviz-1.2.3/examples/dot/dotgraph.dot0000644000004100000410000000153213111037426021301 0ustar www-datawww-datadigraph G { graph [truecolor=true, bgcolor=transparent]; rankdir="LR"; subgraph { rank = same; mygraph [label = "# mygraph.dot\ldigraph G {\l Hello -> World;\l}\l", shape = note, fontname = "Courier", fontsize=10]; image [image = "./hello.png", label = "", shape = note]; } subgraph { rank = same; mysite [label = "\nexample.com\n ", shape = "component", fontname = "Arial"]; dotgraph [label = "\ndotgraph.net\n ", shape = "component", fontname = "Arial"]; } subgraph cluster_0 { label = "my_page.html"; fontname = "Courier"; fontsize = 10; color = black; zeimage [image = "./hello.png", label = "", shape = note] } mygraph -> mysite [color = blue]; dotgraph -> image [color = red]; dotgraph -> mysite [color = red]; mysite -> dotgraph [color = blue]; image -> dotgraph [color = red]; mysite -> zeimage [color = red]; }ruby-graphviz-1.2.3/examples/dot/hello.dot0000644000004100000410000000003113111037426020565 0ustar www-datawww-datadigraph G {Hello->World;}ruby-graphviz-1.2.3/examples/dot/cluster.dot0000644000004100000410000000065013111037426021152 0ustar www-datawww-datadigraph G { subgraph cluster_0 { style=filled; color=lightgrey; node [style=filled,color=white]; a0 -> a1; a1 -> a2; a2 -> a3; label = "process #1"; } subgraph cluster_1 { node [style=filled]; b0 -> b1; b1 -> b2; b2 -> b3; label = "process #2"; color=blue; } start -> a0; start -> b0; a1 -> b3; b2 -> a3; a3 -> a0; a3 -> end; b3 -> end; start [shape=Mdiamond]; end [shape=Msquare]; }ruby-graphviz-1.2.3/examples/dot/test.dot0000644000004100000410000000060213111037426020445 0ustar www-datawww-datadigraph G { fontsize=12; node [style=filled ,fontsize=10]; Hello; edge[style=dotted]; graph [ bgcolor = "#ABCDEF"]; monde [color=blue, style= filled]; node[color=white ] ; Hello ->World [color=red, style = filled]; Bonjour-> monde -> Chose; Coucou -> "Les Gens" [color=blue]; subgraph X { bgcolor = white; label="Sub Graph"; toto -> titi; } }ruby-graphviz-1.2.3/examples/dot/siblings.dot0000644000004100000410000007151213111037426021310 0ustar www-datawww-datadigraph sdsu { node [color=grey, style=filled]; node [fontname="Verdana", size="30,30"]; graph [ fontname = "Arial", fontsize = 36, style = "bold", label = "\nKappa Kappa Psi/Tau Beta Sigma\nSan Diego State University\nEta Mu and Zeta Xi Family Tree\n\nto date: November 30th, 2008\n" ]; "Lori Brede" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=10"]; "Michael Griffith" [color=lightblue, URL="http://sdsu.kkytbs.net/members/profile.html?who=24"]; "Amie Holston" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=30"]; "Michael Griffith" -> "Lori Brede"; "Amie Holston" -> "Lori Brede"; "Casey Carter" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=11"]; "Laura De'Armond" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=14"]; "Laura De'Armond" -> "Casey Carter"; "Japheth Cleaver" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=12"]; "Chuk Gawlik" [color=lightblue, URL="http://sdsu.kkytbs.net/members/profile.html?who=22"]; "Stacy Snyder" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=309"]; "Chuk Gawlik" -> "Japheth Cleaver"; "Stacy Snyder" -> "Japheth Cleaver"; "Jillian Clifton" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=13"]; "David Guthrie" [color=lightblue, URL="http://sdsu.kkytbs.net/members/profile.html?who=25"]; "David Guthrie" -> "Jillian Clifton"; "Japheth Cleaver" -> "Jillian Clifton"; "Tony Sacco" [color=lightblue, URL="http://sdsu.kkytbs.net/members/profile.html?who=55"]; "Heather Smith" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=59"]; "Tony Sacco" -> "Laura De'Armond"; "Heather Smith" -> "Laura De'Armond"; "Kevin Decker" [color=lightblue, URL="http://sdsu.kkytbs.net/members/profile.html?who=15"]; "Alex Hansen" [color=lightblue, URL="http://sdsu.kkytbs.net/members/profile.html?who=26"]; "Wanda Livelsberger" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=53"]; "Alex Hansen" -> "Kevin Decker"; "Wanda Livelsberger" -> "Kevin Decker"; "Patrick Doerr" [color=lightblue, URL="http://sdsu.kkytbs.net/members/profile.html?who=16"]; "Deanna Jagow" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=23"]; "Alex Hansen" -> "Patrick Doerr"; "Deanna Jagow" -> "Patrick Doerr"; "Lori Asaro" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=178"]; "Mark Pearson" [color=lightblue, URL="http://sdsu.kkytbs.net/members/profile.html?who=169"]; "Lori Ball" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=167"]; "Mark Pearson" -> "Lori Asaro"; "Lori Ball" -> "Lori Asaro"; "Ryan Farris" [color=lightblue, URL="http://sdsu.kkytbs.net/members/profile.html?who=18"]; "Rob Reiner" [color=lightblue, URL="http://sdsu.kkytbs.net/members/profile.html?who=51"]; "Cindy Teel" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=62"]; "Rob Reiner" -> "Ryan Farris"; "Cindy Teel" -> "Ryan Farris"; "Ginger Palmer" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=180"]; "Mark Newton-John" [color=lightblue, URL="http://sdsu.kkytbs.net/members/profile.html?who=46"]; "Mark Newton-John" -> "Ginger Palmer"; "Matthew FitzGerald" [color=lightblue, URL="http://sdsu.kkytbs.net/members/profile.html?who=19"]; "Mervin Maniago" [color=lightblue, URL="http://sdsu.kkytbs.net/members/profile.html?who=41"]; "Mervin Maniago" -> "Matthew FitzGerald"; "Amie Holston" -> "Matthew FitzGerald"; "Tani Miller" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=195"]; "Mark Pearson" -> "Tani Miller"; "Vienna McMurtry" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=196"]; "Robert Walwick" [color=lightblue, URL="http://sdsu.kkytbs.net/members/profile.html?who=153"]; "Robert Walwick" -> "Vienna McMurtry"; "Ginger Palmer" -> "Vienna McMurtry"; "Chuck Foster" [color=lightblue, URL="http://sdsu.kkytbs.net/members/profile.html?who=20"]; "Karen Saye" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=56"]; "Kevin Decker" -> "Chuck Foster"; "Karen Saye" -> "Chuck Foster"; "Gary Frampton" [color=lightblue, URL="http://sdsu.kkytbs.net/members/profile.html?who=201"]; "Ginger Palmer" -> "Gary Frampton"; "Pat Norris" [color=lightblue, URL="http://sdsu.kkytbs.net/members/profile.html?who=207"]; "Sean Tipps" [color=lightblue, URL="http://sdsu.kkytbs.net/members/profile.html?who=204"]; "Teresa Long" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=194"]; "Sean Tipps" -> "Pat Norris"; "Teresa Long" -> "Pat Norris"; "Marc Martin-ez" [color=lightblue, URL="http://sdsu.kkytbs.net/members/profile.html?who=208"]; "Mark Pearson" -> "Marc Martin-ez"; "Tani Miller" -> "Marc Martin-ez"; "Kristen Villone" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=209"]; "Kelly Erickson" [color=lightblue, URL="http://sdsu.kkytbs.net/members/profile.html?who=199"]; "Anna Pedroza" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=197"]; "Kelly Erickson" -> "Kristen Villone"; "Anna Pedroza" -> "Kristen Villone"; "Geoff Frank" [color=lightblue, URL="http://sdsu.kkytbs.net/members/profile.html?who=21"]; "Chris Livelsberger" [color=lightblue, URL="http://sdsu.kkytbs.net/members/profile.html?who=40"]; "Amy Price" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=57"]; "Chris Livelsberger" -> "Geoff Frank"; "Amy Price" -> "Geoff Frank"; "Tracy Murray" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=210"]; "John FitzGibbon" [color=lightblue, URL="http://sdsu.kkytbs.net/members/profile.html?who=92"]; "Judy Dulcich" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=177"]; "John FitzGibbon" -> "Tracy Murray"; "Judy Dulcich" -> "Tracy Murray"; "Ian McIntosh" [color=lightblue, URL="http://sdsu.kkytbs.net/members/profile.html?who=215"]; "Barbara Tollison" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=172"]; "Robert Walwick" -> "Ian McIntosh"; "Barbara Tollison" -> "Ian McIntosh"; "Jayson Smith" [color=lightblue, URL="http://sdsu.kkytbs.net/members/profile.html?who=58"]; "Jayson Smith" -> "Chuk Gawlik"; "Heather Smith" -> "Chuk Gawlik"; "Kelly McKinney" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=222"]; "Mark Nadeau" [color=lightblue, URL="http://sdsu.kkytbs.net/members/profile.html?who=183"]; "Mark Nadeau" -> "Kelly McKinney"; "Judy Dulcich" -> "Kelly McKinney"; "Chris Livelsberger" -> "Deanna Jagow"; "Amy Price" -> "Deanna Jagow"; "Renee Thompson" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=231"]; "J. Angeles" [color=lightblue, URL="http://sdsu.kkytbs.net/members/profile.html?who=3"]; "Kelley Smith" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=223"]; "J. Angeles" -> "Renee Thompson"; "Kelley Smith" -> "Renee Thompson"; "Steven Smith" [color=lightblue, URL="http://sdsu.kkytbs.net/members/profile.html?who=233"]; "John FitzGibbon" -> "Steven Smith"; "Charlene Andrews" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=234"]; "Diane Reoch" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=227"]; "Diane Reoch" -> "Charlene Andrews"; "Tonya Alexander" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=238"]; "Gail Vasquez" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=225"]; "Gail Vasquez" -> "Tonya Alexander"; "Spencer Caldwell" [color=lightblue, URL="http://sdsu.kkytbs.net/members/profile.html?who=239"]; "Becky Bernal" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=218"]; "Becky Bernal" -> "Spencer Caldwell"; "Chuk Gawlik" -> "Michael Griffith"; "Wanda Livelsberger" -> "Michael Griffith"; "Russell Grant" [color=lightblue, URL="http://sdsu.kkytbs.net/members/profile.html?who=242"]; "Steven Smith" -> "Russell Grant"; "Tiffany Worthington" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=66"]; "Chuck Foster" -> "David Guthrie"; "Tiffany Worthington" -> "David Guthrie"; "Jerry Maya" [color=lightblue, URL="http://sdsu.kkytbs.net/members/profile.html?who=250"]; "John FitzGibbon" -> "Jerry Maya"; "Melissa Schwartz" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=252"]; "Russell Grant" -> "Melissa Schwartz"; "Delphy Shaulis" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=255"]; "Renee Thompson" -> "Delphy Shaulis"; "Martin Naiman" [color=lightblue, URL="http://sdsu.kkytbs.net/members/profile.html?who=45"]; "Janean Angeles" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=86"]; "Martin Naiman" -> "Alex Hansen"; "Janean Angeles" -> "Alex Hansen"; "Leslie Harlow" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=265"]; "Dennis McColl" [color=lightblue, URL="http://sdsu.kkytbs.net/members/profile.html?who=251"]; "Denise Luna" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=236"]; "Dennis McColl" -> "Leslie Harlow"; "Denise Luna" -> "Leslie Harlow"; "Jonathan Yudman" [color=lightblue, URL="http://sdsu.kkytbs.net/members/profile.html?who=267"]; "April Ortiz-cloninger" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=258"]; "April Ortiz-cloninger" -> "Jonathan Yudman"; "Michael Elgo" [color=lightblue, URL="http://sdsu.kkytbs.net/members/profile.html?who=268"]; "Carol Kropp" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=254"]; "Spencer Caldwell" -> "Michael Elgo"; "Carol Kropp" -> "Michael Elgo"; "Denmark Vea" [color=lightblue, URL="http://sdsu.kkytbs.net/members/profile.html?who=269"]; "Marc Martin-ez" -> "Denmark Vea"; "Kelley Smith" -> "Denmark Vea"; "Kathleen Hansen" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=27"]; "Martin Naiman" -> "Kathleen Hansen"; "Heather Smith" -> "Kathleen Hansen"; "Laura Stegner" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=274"]; "April Ortiz-cloninger" -> "Laura Stegner"; "Kathy Jones" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=28"]; "J. Angeles" -> "Kathy Jones"; "Eric Gates" [color=lightblue, URL="http://sdsu.kkytbs.net/members/profile.html?who=282"]; "Erick Sugimura" [color=lightblue, URL="http://sdsu.kkytbs.net/members/profile.html?who=280"]; "Erick Sugimura" -> "Eric Gates"; "Laura Stegner" -> "Eric Gates"; "Jennifer Stoewe" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=288"]; "Eric Gates" -> "Jennifer Stoewe"; "Karen Helbling" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=29"]; "Regan Ashker" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=5"]; "Kevin Decker" -> "Karen Helbling"; "Regan Ashker" -> "Karen Helbling"; "Scott Wood" [color=lightblue, URL="http://sdsu.kkytbs.net/members/profile.html?who=295"]; "Eric Gates" -> "Scott Wood"; "Greg Flood" [color=lightblue, URL="http://sdsu.kkytbs.net/members/profile.html?who=200"]; "Greg Flood" -> "J. Angeles"; "Ginger Palmer" -> "J. Angeles"; "Lynn Reeves" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=48"]; "Chuk Gawlik" -> "Amie Holston"; "Lynn Reeves" -> "Amie Holston"; "Susan Colwell" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=302"]; "Michael Elgo" -> "Susan Colwell"; "Christopher Jouan" [color=lightblue, URL="http://sdsu.kkytbs.net/members/profile.html?who=306"]; "Kevin Owens" [color=lightblue, URL="http://sdsu.kkytbs.net/members/profile.html?who=245"]; "Kevin Owens" -> "Christopher Jouan"; "Kristianna Reynante" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=308"]; "Michael Elgo" -> "Kristianna Reynante"; "Janean Angeles" -> "Kristianna Reynante"; "Amy Berner" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=300"]; "Amy Berner" -> "Stacy Snyder"; "Deanna Johnson" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=31"]; "Alex Hansen" -> "Deanna Johnson"; "Laura De'Armond" -> "Deanna Johnson"; "Johnny Richardson" [color=lightblue, URL="http://sdsu.kkytbs.net/members/profile.html?who=310"]; "Russell Grant" -> "Johnny Richardson"; "Nathan Fellhauer" [color=lightblue, URL="http://sdsu.kkytbs.net/members/profile.html?who=313"]; "James Rowland" [color=thistle, URL="http://sdsu.kkytbs.net/members/profile.html?who=52"]; "James Rowland" -> "Nathan Fellhauer"; "Kristianna Reynante" -> "Nathan Fellhauer"; "Brian Raneses" [color=lightblue, URL="http://sdsu.kkytbs.net/members/profile.html?who=314"]; "Sean McHenry" [color=lightblue, URL="http://sdsu.kkytbs.net/members/profile.html?who=42"]; "Sean McHenry" -> "Brian Raneses"; "Penny Lewis" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=315"]; "Martin Naiman" -> "Penny Lewis"; "Becky Graham" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=316"]; "Kristen Elgo" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=7"]; "Kristen Elgo" -> "Becky Graham"; "Steven Gross" [color=lightblue, URL="http://sdsu.kkytbs.net/members/profile.html?who=318"]; "Rob Reiner" -> "Steven Gross"; "Stacy Snyder" -> "Steven Gross"; "Sedona Reynolds" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=32"]; "Mark Newton-John" -> "Sedona Reynolds"; "Cindy Teel" -> "Sedona Reynolds"; "Klair Mayerchak" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=320"]; "Nathan Fellhauer" -> "Klair Mayerchak"; "Becky Graham" -> "Klair Mayerchak"; "Shari VerBerkmoes" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=321"]; "Sean McHenry" -> "Shari VerBerkmoes"; "Janean Angeles" -> "Shari VerBerkmoes"; "Anson Summers" [color=lightblue, URL="http://sdsu.kkytbs.net/members/profile.html?who=326"]; "James Rowland" -> "Anson Summers"; "Dusty Jolliff" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=33"]; "Rob Reiner" -> "Dusty Jolliff"; "Stacy Snyder" -> "Dusty Jolliff"; "Jennifer Garman" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=331"]; "James Rowland" -> "Jennifer Garman"; "Kelly Greenhill" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=333"]; "Rob Reiner" -> "Kelly Greenhill"; "Kristen Elgo" -> "Kelly Greenhill"; "Lucinda Farless" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=334"]; "J. Angeles" -> "Lucinda Farless"; "Susan Colwell" -> "Lucinda Farless"; "Alfredo Cardenas" [color=lightblue, URL="http://sdsu.kkytbs.net/members/profile.html?who=335"]; "Chuk Gawlik" -> "Alfredo Cardenas"; "Kathleen Hansen" -> "Alfredo Cardenas"; "Jennifer Jouan" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=34"]; "Andrea Owens" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=276"]; "Andrea Owens" -> "Jennifer Jouan"; "Tamara Scrivner" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=345"]; "Joseph Butler" [color=lightblue, URL="http://sdsu.kkytbs.net/members/profile.html?who=69"]; "Sarah Maltese" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=83"]; "Joseph Butler" -> "Tamara Scrivner"; "Sarah Maltese" -> "Tamara Scrivner"; "Bradley Stouse" [color=lightblue, URL="http://sdsu.kkytbs.net/members/profile.html?who=346"]; "Ryan Underwood" [color=lightblue, URL="http://sdsu.kkytbs.net/members/profile.html?who=74"]; "Ryan Underwood" -> "Bradley Stouse"; "Cindy Teel" -> "Bradley Stouse"; "Casondra Brimmage" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=347"]; "Kristopher Lininger" [color=lightblue, URL="http://sdsu.kkytbs.net/members/profile.html?who=85"]; "Ilana Melcher" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=73"]; "Kristopher Lininger" -> "Casondra Brimmage"; "Ilana Melcher" -> "Casondra Brimmage"; "Cassiopeia Guthrie" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=348"]; "Jeremy Frazier" [color=lightblue, URL="http://sdsu.kkytbs.net/members/profile.html?who=79"]; "Christine Mount" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=76"]; "Jeremy Frazier" -> "Cassiopeia Guthrie"; "Christine Mount" -> "Cassiopeia Guthrie"; "Kathleen Moran" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=349"]; "Matthew FitzGerald" -> "Kathleen Moran"; "Lori Brede" -> "Kathleen Moran"; "Tiffany Kalland" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=35"]; "Tony Sacco" -> "Tiffany Kalland"; "Karen Helbling" -> "Tiffany Kalland"; "Kristen Anderson" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=350"]; "Jennie Bogart" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=78"]; "David Guthrie" -> "Kristen Anderson"; "Jennie Bogart" -> "Kristen Anderson"; "Laura Simonette" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=351"]; "Jon Weisel" [color=lightblue, URL="http://sdsu.kkytbs.net/members/profile.html?who=89"]; "Jon Weisel" -> "Laura Simonette"; "Japheth Cleaver" -> "Laura Simonette"; "Nathan Williams" [color=lightblue, URL="http://sdsu.kkytbs.net/members/profile.html?who=352"]; "David Guthrie" -> "Nathan Williams"; "Karen Helbling" -> "Nathan Williams"; "Rebecca Hippert" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=353"]; "Ryan Underwood" -> "Rebecca Hippert"; "Tiffany Kalland" -> "Rebecca Hippert"; "Samuel Wallace" [color=lightblue, URL="http://sdsu.kkytbs.net/members/profile.html?who=354"]; "Joseph Butler" -> "Samuel Wallace"; "Deanna Jagow" -> "Samuel Wallace"; "Scott Gardner" [color=lightblue, URL="http://sdsu.kkytbs.net/members/profile.html?who=355"]; "Jeremy Frazier" -> "Scott Gardner"; "Christine Mount" -> "Scott Gardner"; "Alberto Ayon" [color=lightblue, URL="http://sdsu.kkytbs.net/members/profile.html?who=356"]; "Bradley Stouse" -> "Alberto Ayon"; "Jennie Bogart" -> "Alberto Ayon"; "Susannah Clayton" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=357"]; "Nathan Williams" -> "Susannah Clayton"; "Karen Helbling" -> "Susannah Clayton"; "Lisa Gochnauer" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=358"]; "Scott Gardner" -> "Lisa Gochnauer"; "Casondra Brimmage" -> "Lisa Gochnauer"; "Jamie Jackson" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=359"]; "Samuel Wallace" -> "Jamie Jackson"; "Tamara Scrivner" -> "Jamie Jackson"; "Christina Kelly" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=36"]; "Matthew FitzGerald" -> "Christina Kelly"; "Lori Brede" -> "Christina Kelly"; "Gara Thornton" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=360"]; "Mark Newton-John" -> "Gara Thornton"; "Laura Simonette" -> "Gara Thornton"; "Robert Winebarger" [color=lightblue, URL="http://sdsu.kkytbs.net/members/profile.html?who=361"]; "Robin Ellison" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=90"]; "Scott Gardner" -> "Robert Winebarger"; "Robin Ellison" -> "Robert Winebarger"; "Jeremy Kirchner" [color=lightblue, URL="http://sdsu.kkytbs.net/members/profile.html?who=37"]; "Rob Reiner" -> "Jeremy Kirchner"; "Sandy Konar" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=38"]; "Jennifer Brandon" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=9"]; "Jennifer Brandon" -> "Sandy Konar"; "Dan Kuhlman" [color=lightblue, URL="http://sdsu.kkytbs.net/members/profile.html?who=39"]; "Rob Reiner" -> "Dan Kuhlman"; "Dusty Jolliff" -> "Dan Kuhlman"; "Lindsay Arehart" [color=lightblue, URL="http://sdsu.kkytbs.net/members/profile.html?who=4"]; "Martin Naiman" -> "Lindsay Arehart"; "Jennifer Brandon" -> "Lindsay Arehart"; "J. Angeles" -> "Mervin Maniago"; "Kathy Jones" -> "Mervin Maniago"; "Jarrod Monroe" [color=lightblue, URL="http://sdsu.kkytbs.net/members/profile.html?who=43"]; "Jamie Fratacci" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=44"]; "Mark Newton-John" -> "Jarrod Monroe"; "Jamie Fratacci" -> "Jarrod Monroe"; "Chuk Gawlik" -> "Jamie Fratacci"; "Tiffany Worthington" -> "Jamie Fratacci"; "Russell Grant" -> "Martin Naiman"; "Tonya Alexander" -> "Martin Naiman"; "Edward Givens" [color=lightblue, style=bold, URL="http://sdsu.kkytbs.net/members/profile.html?who=106"]; "Edward Givens" -> "Mark Newton-John"; "Veronica Nickel" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=47"]; "Regan Ashker" -> "Veronica Nickel"; "Wanda Livelsberger" -> "Lynn Reeves"; "Bryan Ransom" [color=thistle, URL="http://sdsu.kkytbs.net/members/profile.html?who=49"]; "Jayson Smith" -> "Bryan Ransom"; "Tony Sacco" -> "Regan Ashker"; "Dusty Jolliff" -> "Regan Ashker"; "Jennifer Stout" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=50"]; "Matthew FitzGerald" -> "Jennifer Stout"; "Deanna Jagow" -> "Jennifer Stout"; "Sean McHenry" -> "James Rowland"; "James Rowland" -> "Wanda Livelsberger"; "Janean Angeles" -> "Wanda Livelsberger"; "Melissa Roy" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=54"]; "Mervin Maniago" -> "Melissa Roy"; "Christina Kelly" -> "Melissa Roy"; "Dennis McColl" -> "Tony Sacco"; "April Ortiz-cloninger" -> "Tony Sacco"; "Tony Sacco" -> "Karen Saye"; "Tony Sacco" -> "Amy Price"; "Kathleen Hansen" -> "Amy Price"; "James Rowland" -> "Jayson Smith"; "Brian Raneses" -> "Heather Smith"; "Kristen Elgo" -> "Heather Smith"; "Josh Atwood" [color=lightblue, URL="http://sdsu.kkytbs.net/members/profile.html?who=6"]; "David Guthrie" -> "Josh Atwood"; "Lori Brede" -> "Josh Atwood"; "Katie Browne" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=60"]; "Patrick Doerr" -> "Katie Browne"; "Jamie Fratacci" -> "Katie Browne"; "Kristin Tang" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=61"]; "James Rowland" -> "Kristin Tang"; "Heather Smith" -> "Kristin Tang"; "Mervin Maniago" -> "Cindy Teel"; "Veronica Nickel" -> "Cindy Teel"; "Mike Tulumello" [color=lightblue, URL="http://sdsu.kkytbs.net/members/profile.html?who=63"]; "Matthew FitzGerald" -> "Mike Tulumello"; "Katie Browne" -> "Mike Tulumello"; "Veronica Villanueva" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=64"]; "Ryan Farris" -> "Veronica Villanueva"; "Sedona Reynolds" -> "Veronica Villanueva"; "Mervin Maniago" -> "Tiffany Worthington"; "Jennifer Jouan" -> "Tiffany Worthington"; "Scott Wright" [color=lightblue, URL="http://sdsu.kkytbs.net/members/profile.html?who=67"]; "James Rowland" -> "Scott Wright"; "Kristen Elgo" -> "Scott Wright"; "Jeremy Browne" [color=lightblue, URL="http://sdsu.kkytbs.net/members/profile.html?who=68"]; "Matthew FitzGerald" -> "Jeremy Browne"; "Japheth Cleaver" -> "Jeremy Browne"; "James Fogelman" [color=lightblue, URL="http://sdsu.kkytbs.net/members/profile.html?who=688"]; "Alberto Ayon" -> "James Fogelman"; "Susannah Clayton" -> "James Fogelman"; "Sandra Chase" [color=lightblue, URL="http://sdsu.kkytbs.net/members/profile.html?who=689"]; "David Guthrie" -> "Sandra Chase"; "Japheth Cleaver" -> "Sandra Chase"; "Patrick Doerr" -> "Joseph Butler"; "Deanna Jagow" -> "Joseph Butler"; "Laura Fisher" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=690"]; "Nathan Williams" -> "Laura Fisher"; "Casondra Brimmage" -> "Laura Fisher"; "Katie Kozma" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=691"]; "Scott Wright" -> "Katie Kozma"; "Robin Ellison" -> "Katie Kozma"; "Rachel Perkins" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=692"]; "Joseph Butler" -> "Rachel Perkins"; "Cassiopeia Guthrie" -> "Rachel Perkins"; "Sarah Titilah" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=693"]; "Robert Winebarger" -> "Sarah Titilah"; "Karen Helbling" -> "Sarah Titilah"; "Ashley Rehart" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=694"]; "Laura Fisher" -> "Ashley Rehart"; "Cara Yancey" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=695"]; "Katie Kozma" -> "Cara Yancey"; "Ashley Presley" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=698"]; "Cara Yancey" -> "Ashley Presley"; "Leila Wilhelm" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=699"]; "Robin Ellison" -> "Leila Wilhelm"; "Sean McHenry" -> "Kristen Elgo"; "Stacy Snyder" -> "Kristen Elgo"; "Greg Moody" [color=lightblue, URL="http://sdsu.kkytbs.net/members/profile.html?who=70"]; "Ryan Farris" -> "Greg Moody"; "Jennifer Stout" -> "Greg Moody"; "Lisa Fleck" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=700"]; "Rachel Perkins" -> "Lisa Fleck"; "Christine Coyne" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=701"]; "Rachel Perkins" -> "Christine Coyne"; "Jennifer Cooley" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=702"]; "Laura Fisher" -> "Jennifer Cooley"; "Elizabeth Larios" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=703"]; "Ashley Rehart" -> "Elizabeth Larios"; "Cate Threlkeld" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=707"]; "Katie Kozma" -> "Cate Threlkeld"; "Erika Tapia" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=71"]; "Patrick Doerr" -> "Erika Tapia"; "Melissa Roy" -> "Erika Tapia"; "Robbyn Rozelle" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=72"]; "Jarrod Monroe" -> "Robbyn Rozelle"; "Tiffany Kalland" -> "Robbyn Rozelle"; "Ryan Farris" -> "Ilana Melcher"; "Veronica Villanueva" -> "Ilana Melcher"; "Greg Moody" -> "Ryan Underwood"; "Katie Browne" -> "Ryan Underwood"; "Cameron Brown" [color=lightblue, URL="http://sdsu.kkytbs.net/members/profile.html?who=75"]; "Joseph Butler" -> "Cameron Brown"; "Tiffany Kalland" -> "Cameron Brown"; "Ryan Underwood" -> "Christine Mount"; "Lori Brede" -> "Christine Mount"; "Janay Rabe" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=77"]; "Greg Moody" -> "Janay Rabe"; "Cindy Teel" -> "Janay Rabe"; "Jeremy Browne" -> "Jennie Bogart"; "Tiffany Kalland" -> "Jennie Bogart"; "Ryan Farris" -> "Jeremy Frazier"; "Ilana Melcher" -> "Jeremy Frazier"; "Crystal Bozak" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=8"]; "Patrick Doerr" -> "Crystal Bozak"; "Katie Browne" -> "Crystal Bozak"; "Kameka Smith" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=80"]; "Matthew FitzGerald" -> "Kameka Smith"; "Ilana Melcher" -> "Kameka Smith"; "Kyra Sacco" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=81"]; "Joseph Butler" -> "Kyra Sacco"; "Robbyn Rozelle" -> "Kyra Sacco"; "Samuel Behar" [color=lightblue, URL="http://sdsu.kkytbs.net/members/profile.html?who=82"]; "Ryan Underwood" -> "Samuel Behar"; "Lori Brede" -> "Samuel Behar"; "Patrick Doerr" -> "Sarah Maltese"; "Deanna Jagow" -> "Sarah Maltese"; "David Bronson" [color=lightblue, URL="http://sdsu.kkytbs.net/members/profile.html?who=84"]; "Kristin Alongi-Hutchins" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=87"]; "Tony Sacco" -> "David Bronson"; "Kristin Alongi-Hutchins" -> "David Bronson"; "Cameron Brown" -> "Kristopher Lininger"; "Kameka Smith" -> "Kristopher Lininger"; "Rakan Abu-Rahma" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=852"]; "Christine Coyne" -> "Rakan Abu-Rahma"; "Jennifer Berry" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=270"]; "Jennifer Berry" -> "Janean Angeles"; "Penny Lewis" -> "Kristin Alongi-Hutchins"; "Melissa Bebak" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=88"]; "Greg Moody" -> "Melissa Bebak"; "Sarah Maltese" -> "Melissa Bebak"; "Scott Wright" -> "Jennifer Brandon"; "Japheth Cleaver" -> "Jennifer Brandon"; "Samuel Behar" -> "Robin Ellison"; "Kyra Sacco" -> "Robin Ellison"; "Teresa Simms" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=91"]; "Joseph Butler" -> "Teresa Simms"; "Janay Rabe" -> "Teresa Simms"; "Robert Schmidtke" [color=lightblue, URL="http://sdsu.kkytbs.net/members/profile.html?who=188"]; "Jean Newman" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=166"]; "Robert Schmidtke" -> "John FitzGibbon"; "Jean Newman" -> "John FitzGibbon"; "Brittany DePew" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=928"]; "Elizabeth Larios" -> "Brittany DePew"; "Kathleen Halberg" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=929"]; "Ashley Rehart" -> "Kathleen Halberg"; "Terrance Hirsch" [color=lightblue, URL="http://sdsu.kkytbs.net/members/profile.html?who=96"]; "J. Angeles" -> "Terrance Hirsch"; "Susan Colwell" -> "Terrance Hirsch"; "Monique Arellano" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=972"]; "Ashley Presley" -> "Monique Arellano"; "Anthony Henderson" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=973"]; "Jennifer Cooley" -> "Anthony Henderson"; "Amethyst Tagle" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=974"]; "Cate Threlkeld" -> "Amethyst Tagle"; "Mallory Williams" [color=lightpink, URL="http://sdsu.kkytbs.net/members/profile.html?who=975"]; "Lisa Fleck" -> "Mallory Williams"; }ruby-graphviz-1.2.3/examples/dot/so-sample003.gv0000644000004100000410000000171013111037426021440 0ustar www-datawww-data //{:category1 => // {:subcategory1 => // [ // {:article => "some article", :date => "2010-04-04"}, // ... // ], // :subc2 => [...] // }, // :category2 => {...}, // ... //} graph G { layout="fdp" category1[label=":category1", shape="box"] subgraph cluster_category1 { subcategory1[label=":subcategory1", shape="box"] subc2[label=":subc2", shape="box"] subgraph cluster_subcategory1 { subgraph cluster_subcategory1_Array0 { article0[label=":article", shape="box"] date0[label=":date", shape="box"] article0 -- "somme article" date0 -- "2010-04-04" } subgraph cluster_subcategory1_Array1 { article1[label=":article", shape="box"] date1[label=":date", shape="box"] article1 -- "an other article" date1 -- "2010-09-09" } } subcategory1 -- cluster_subcategory1 subc2 -- "..." } category1 -- cluster_category1 }ruby-graphviz-1.2.3/examples/dot/rank.dot0000644000004100000410000000021113111037426020415 0ustar www-datawww-datadigraph G { subgraph { rank = same; "node1"; "node2"; } subgraph { rank = same; "nodeA"; "nodeB"; } node1 -> nodeA; node2 -> nodeB; }ruby-graphviz-1.2.3/examples/dot/lion_share.dot0000644000004100000410000001254713111037426021624 0ustar www-datawww-datadigraph Ped_Lion_Share { ratio = "auto" ; label = "Pedigree Lion_Share" ; "001" [shape=box , regular=1,style=filled,fillcolor=white ] ; "002" [shape=box , regular=1,style=filled,fillcolor=white ] ; "003" [shape=circle , regular=1,style=filled,fillcolor=white ] ; "004" [shape=box , regular=1,style=filled,fillcolor=white ] ; "005" [shape=box , regular=1,style=filled,fillcolor=white ] ; "006" [shape=circle , regular=1,style=filled,fillcolor=white ] ; "007" [shape=circle , regular=1,style=filled,fillcolor=white ] ; "009" [shape=circle , regular=1,style=filled,fillcolor=white ] ; "014" [shape=circle , regular=1,style=filled,fillcolor=white ] ; "015" [shape=circle , regular=1,style=filled,fillcolor=white ] ; "016" [shape=circle , regular=1,style=filled,fillcolor=white ] ; "ZZ01" [shape=circle , regular=1,style=filled,fillcolor=white ] ; "ZZ02" [shape=circle , regular=1,style=filled,fillcolor=white ] ; "017" [shape=circle , regular=1,style=filled,fillcolor=white ] ; "012" [shape=circle , regular=1,style=filled,fillcolor=white ] ; "008" [shape=box , regular=1,style=filled,fillcolor=white ] ; "011" [shape=box , regular=1,style=filled,fillcolor=white ] ; "013" [shape=box , regular=1,style=filled,fillcolor=white ] ; "010" [shape=box , regular=1,style=filled,fillcolor=white ] ; "023" [shape=circle , regular=1,style=filled,fillcolor=white ] ; "020" [shape=circle , regular=1,style=filled,fillcolor=white ] ; "021" [shape=circle , regular=1,style=filled,fillcolor=white ] ; "018" [shape=circle , regular=1,style=filled,fillcolor=white ] ; "025" [shape=circle , regular=1,style=filled,fillcolor=white ] ; "019" [shape=box , regular=1,style=filled,fillcolor=white ] ; "022" [shape=box , regular=1,style=filled,fillcolor=white ] ; "024" [shape=box , regular=1,style=filled,fillcolor=white ] ; "027" [shape=circle , regular=1,style=filled,fillcolor=white ] ; "026" [shape=box , regular=1,style=filled,fillcolor=white ] ; "028" [shape=box , regular=1,style=filled,fillcolor=grey ] ; "marr0001" [shape=diamond,style=filled,label="",height=.1,width=.1] ; "001" -> "marr0001" [dir=none,weight=1] ; "007" -> "marr0001" [dir=none,weight=1] ; "marr0001" -> "017" [dir=none, weight=2] ; "marr0002" [shape=diamond,style=filled,label="",height=.1,width=.1] ; "001" -> "marr0002" [dir=none,weight=1] ; "ZZ02" -> "marr0002" [dir=none,weight=1] ; "marr0002" -> "012" [dir=none, weight=2] ; "marr0003" [shape=diamond,style=filled,label="",height=.1,width=.1] ; "002" -> "marr0003" [dir=none,weight=1] ; "003" -> "marr0003" [dir=none,weight=1] ; "marr0003" -> "008" [dir=none, weight=2] ; "marr0004" [shape=diamond,style=filled,label="",height=.1,width=.1] ; "002" -> "marr0004" [dir=none,weight=1] ; "006" -> "marr0004" [dir=none,weight=1] ; "marr0004" -> "011" [dir=none, weight=2] ; "marr0005" [shape=diamond,style=filled,label="",height=.1,width=.1] ; "002" -> "marr0005" [dir=none,weight=1] ; "ZZ01" -> "marr0005" [dir=none,weight=1] ; "marr0005" -> "013" [dir=none, weight=2] ; "marr0006" [shape=diamond,style=filled,label="",height=.1,width=.1] ; "004" -> "marr0006" [dir=none,weight=1] ; "009" -> "marr0006" [dir=none,weight=1] ; "marr0006" -> "010" [dir=none, weight=2] ; "marr0007" [shape=diamond,style=filled,label="",height=.1,width=.1] ; "005" -> "marr0007" [dir=none,weight=1] ; "015" -> "marr0007" [dir=none,weight=1] ; "marr0007" -> "023" [dir=none, weight=2] ; "marr0008" [shape=diamond,style=filled,label="",height=.1,width=.1] ; "005" -> "marr0008" [dir=none,weight=1] ; "016" -> "marr0008" [dir=none,weight=1] ; "marr0008" -> "020" [dir=none, weight=2] ; "marr0009" [shape=diamond,style=filled,label="",height=.1,width=.1] ; "005" -> "marr0009" [dir=none,weight=1] ; "012" -> "marr0009" [dir=none,weight=1] ; "marr0009" -> "021" [dir=none, weight=2] ; "marr0010" [shape=diamond,style=filled,label="",height=.1,width=.1] ; "008" -> "marr0010" [dir=none,weight=1] ; "017" -> "marr0010" [dir=none,weight=1] ; "marr0010" -> "018" [dir=none, weight=2] ; "marr0011" [shape=diamond,style=filled,label="",height=.1,width=.1] ; "011" -> "marr0011" [dir=none,weight=1] ; "023" -> "marr0011" [dir=none,weight=1] ; "marr0011" -> "025" [dir=none, weight=2] ; "marr0012" [shape=diamond,style=filled,label="",height=.1,width=.1] ; "013" -> "marr0012" [dir=none,weight=1] ; "014" -> "marr0012" [dir=none,weight=1] ; "marr0012" -> "019" [dir=none, weight=2] ; "marr0013" [shape=diamond,style=filled,label="",height=.1,width=.1] ; "010" -> "marr0013" [dir=none,weight=1] ; "021" -> "marr0013" [dir=none,weight=1] ; "marr0013" -> "022" [dir=none, weight=2] ; "marr0014" [shape=diamond,style=filled,label="",height=.1,width=.1] ; "019" -> "marr0014" [dir=none,weight=1] ; "020" -> "marr0014" [dir=none,weight=1] ; "marr0014" -> "024" [dir=none, weight=2] ; "marr0015" [shape=diamond,style=filled,label="",height=.1,width=.1] ; "022" -> "marr0015" [dir=none,weight=1] ; "025" -> "marr0015" [dir=none,weight=1] ; "marr0015" -> "027" [dir=none, weight=2] ; "marr0016" [shape=diamond,style=filled,label="",height=.1,width=.1] ; "024" -> "marr0016" [dir=none,weight=1] ; "018" -> "marr0016" [dir=none,weight=1] ; "marr0016" -> "026" [dir=none, weight=2] ; "marr0017" [shape=diamond,style=filled,label="",height=.1,width=.1] ; "026" -> "marr0017" [dir=none,weight=1] ; "027" -> "marr0017" [dir=none,weight=1] ; "marr0017" -> "028" [dir=none, weight=2] ; }ruby-graphviz-1.2.3/examples/dot/so-sample001.gv0000644000004100000410000000075413111037426021445 0ustar www-datawww-datadigraph G { layout="neato" // scale things down for example size="5,5" rankdir=TD ranksep=1 nodesep=1 node [shape=box] top[pos="5,10!", width=5, height=2] left1[pos="3.5,7!", width=2, height=2] left2[pos="3.5,4!", width=2, height=2] right[pos="6.5,5.5!", width=2, height=5] bottom[pos="5,1!", width=5, height=2] top->left1 top->right left1->left2 left1->right left2->right left2->bottom right->bottom }ruby-graphviz-1.2.3/examples/dot/so-sample002.gv0000644000004100000410000000072613111037426021445 0ustar www-datawww-data //{:category1 => // {:subcategory1 => // [ // {:article => "some article", :date => "2010-04-04"}, // ... // ], // :subc2 => [...] // }, // :category2 => {...}, // ... //} graph G { rankdir=LR category1 subgraph clusterC { node[shape="box"] subcategory1 subc2 subgraph clusterS { article -- "somme article" date -- "2010-04-04" } subcategory1 -- clusterS subc2 -- "..." } category1 -- clusterC }ruby-graphviz-1.2.3/examples/dot/genetic.dot0000644000004100000410000000467213111037426021117 0ustar www-datawww-datagraph "" { label="((+ (* (X) (- (- (X) (X)) (X))) (% (+ (X) (X)) (COS (- (X) (X))))) (EXP (* (X) (X))) (+ (% (EXP (SIN (+ (X) (X)))) (SIN (* (X) (EXP (* (X) (X)))))) (* (X) (X))) (% (EXP (% (X) (% (X) (X)))) (EXP (SIN (X)))))"; subgraph cluster01 { label="(+ (* (X) (- (- (X) (X)) (X))) (% (+ (X) (X)) (COS (- (X) (X)))))"; n002 ; n002 [label="+"] ; n002 -- n003 ; n003 [label="*"] ; n003 -- n004 ; n004 [label="X"] ; n003 -- n005 ; n005 [label="-"] ; n005 -- n006 ; n006 [label="-"] ; n006 -- n007 ; n007 [label="X"] ; n006 -- n008 ; n008 [label="X"] ; n005 -- n009 ; n009 [label="X"] ; n002 -- n010 ; n010 [label="%"] ; n010 -- n011 ; n011 [label="+"] ; n011 -- n012 ; n012 [label="X"] ; n011 -- n013 ; n013 [label="X"] ; n010 -- n014 ; n014 [label="COS"] ; n014 -- n015 ; n015 [label="-"] ; n015 -- n016 ; n016 [label="X"] ; n015 -- n017 ; n017 [label="X"] ; } subgraph cluster17 { label="(EXP (* (X) (X)))"; n018 ; n018 [label="EXP"] ; n018 -- n019 ; n019 [label="*"] ; n019 -- n020 ; n020 [label="X"] ; n019 -- n021 ; n021 [label="X"] ; } subgraph cluster21 { label="(+ (% (EXP (SIN (+ (X) (X)))) (SIN (* (X) (EXP (* (X) (X)))))) (* (X) (X)))"; n022 ; n022 [label="+"] ; n022 -- n023 ; n023 [label="%"] ; n023 -- n024 ; n024 [label="EXP"] ; n024 -- n025 ; n025 [label="SIN"] ; n025 -- n026 ; n026 [label="+"] ; n026 -- n027 ; n027 [label="X"] ; n026 -- n028 ; n028 [label="X"] ; n023 -- n029 ; n029 [label="SIN"] ; n029 -- n030 ; n030 [label="*"] ; n030 -- n031 ; n031 [label="X"] ; n030 -- n032 ; n032 [label="EXP"] ; n032 -- n033 ; n033 [label="*"] ; n033 -- n034 ; n034 [label="X"] ; n033 -- n035 ; n035 [label="X"] ; n022 -- n036 ; n036 [label="*"] ; n036 -- n037 ; n037 [label="X"] ; n036 -- n038 ; n038 [label="X"] ; } subgraph cluster38 { label="(% (EXP (% (X) (% (X) (X)))) (EXP (SIN (X))))"; n039 ; n039 [label="%"] ; n039 -- n040 ; n040 [label="EXP"] ; n040 -- n041 ; n041 [label="%"] ; n041 -- n042 ; n042 [label="X"] ; n041 -- n043 ; n043 [label="%"] ; n043 -- n044 ; n044 [label="X"] ; n043 -- n045 ; n045 [label="X"] ; n039 -- n046 ; n046 [label="EXP"] ; n046 -- n047 ; n047 [label="SIN"] ; n047 -- n048 ; n048 [label="X"] ; } }ruby-graphviz-1.2.3/examples/dot/balanced.dot0000644000004100000410000000141213111037426021217 0ustar www-datawww-datagraph G { n1 [label="+"]; n2 [label="/"]; n1 -- n2; n1b1 [label="", width=.1, style=invis] n1 -- n1b1 [style=invis] n1b2 [label="", width=.1, style=invis] n1 -- n1b2 [style=invis] n1b3 [label="", width=.1, style=invis] n1 -- n1b3 [style=invis] n7 [label="**"]; n1 -- n7; { rank=same n2 -- n1b1 -- n1b2 -- n1b3 -- n7 [style=invis] } n3 [label="*"]; n2 -- n3; n2b1 [label="", width=.1, style=invis] n2 -- n2b1 [style=invis] n6 [label="3"]; n2 -- n6; { rank=same n3 -- n2b1 -- n6 [style=invis] } n8 [label="4"]; n7 -- n8; n7b1 [label="", width=.1, style=invis] n7 -- n7b1 [style=invis] n9 [label="5"]; n7 -- n9; { rank=same n8 -- n7b1 -- n9 [style=invis] } n3 -- n4; n4 [label="1"]; n3 -- n5; n5 [label="2"]; }ruby-graphviz-1.2.3/examples/dot/fsm.dot0000644000004100000410000000115313111037426020255 0ustar www-datawww-datadigraph finite_state_machine { rankdir=LR; size="8,5"; node [shape = doublecircle]; LR_0; LR_3; LR_4; LR_8; node [shape = circle]; LR_0 -> LR_2 [ label = "SS(B)" ]; LR_0 -> LR_1 [ label = "SS(S)" ]; LR_1 -> LR_3 [ label = "S($end)" ]; LR_2 -> LR_6 [ label = "SS(b)" ]; LR_2 -> LR_5 [ label = "SS(a)" ]; LR_2 -> LR_4 [ label = "S(A)" ]; LR_5 -> LR_7 [ label = "S(b)" ]; LR_5 -> LR_5 [ label = "S(a)" ]; LR_6 -> LR_6 [ label = "S(b)" ]; LR_6 -> LR_5 [ label = "S(a)" ]; LR_7 -> LR_8 [ label = "S(b)" ]; LR_7 -> LR_5 [ label = "S(a)" ]; LR_8 -> LR_6 [ label = "S(b)" ]; LR_8 -> LR_5 [ label = "S(a)" ]; }ruby-graphviz-1.2.3/examples/dot/JSP.dot0000644000004100000410000000144513111037426020130 0ustar www-datawww-datadigraph fig7 { node [shape=rect] edge [dir=none] subgraph compound1 { a [label="LFILE"] b [label="*\rLREC"] c [label="o\rMATCHED LREC"] d [label="o\rUNMATCHED LREC"] a -> {b} b -> {c d} } subgraph compound2 { e [label="RFILE"] f [label="*\rRREC"] g [label="o\rMATCHED RREC"] h [label="o\rUNMATCHED RREC"] e -> {f} f -> {g h} } subgraph compound3 { i [label="REPORT"] j [label="*\rLINE"] k [label="o\rTYPE 1"] l [label="o\rTYPE 2"] m [label="o\rTYPE 3"] n [label="o\rTYPE 4"] i -> {j} j -> {k l m n} } {rank=same a e i} {rank=same b f j} {rank=same c d g h k l m n} subgraph correspondences { edge [dir=both] a -> e e -> i c -> g:s d -> l:s g -> k:s h -> m:s } }ruby-graphviz-1.2.3/examples/dot/test_parse.rb0000644000004100000410000000031613111037426021456 0ustar www-datawww-data#!/usr/bin/ruby $:.unshift( "../../lib" ); require "graphviz" Dir.glob( "*.dot" ) { |f| puts "#{f} : " begin puts GraphViz.parse(f) rescue SyntaxError => e puts "Error #{e.message}" end } ruby-graphviz-1.2.3/examples/dot/this_crach_with_dot_2.20.dot0000644000004100000410000000200413111037426024135 0ustar www-datawww-datagraph A { graph [nodesep="0.10", size="7,5", bb="0,0,737,832"]; node [fontsize="12.00", shape=circle, height = 0.4 width = 0.4 fixedsize="true"]; 779 -- 780 [label = 6.5 style = "bold" ]; 522 -- 523 [label = 6.2 style = "bold" ]; 527 -- 528 [label = 6.0 style = "bold" ]; 752 -- 753 [label = 5.1 style = "solid"]; 576 -- 577 [label = 5.1 style = "solid"]; 578 -- 579 [label = 4.8 style = "dashed"]; 757 -- 758 [label = 4.6 style = "dashed"]; 696 -- 697 [label = 4.5 style = "dashed"]; 542 -- 543 [label = 4.4 style = "dashed"]; 723 -- 724 [label = 4.4 style = "dashed"]; 495 -- 496 [label = 4.4 style = "dashed"]; 459 -- 460 [label = 4.3 style = "dashed"]; 784 -- 785 [label = 4.2 style = "dashed"]; 518 -- 519 [label = 4.2 style = "dashed"]; 894 -- 895 [label = 4.1 style = "dashed"]; 435 -- 436 [label = 4.1 style = "dashed"]; 322 -- 323 [label = 4.1 style = "dashed"]; 545 -- 546 [label = 4.1 style = "dashed"]; 513 -- 514 [label = 4.0 style = "dashed"]; }ruby-graphviz-1.2.3/examples/dot/prof.dot0000644000004100000410000001405413111037426020442 0ustar www-datawww-datadigraph prof { size="6,4"; ratio = fill; node [style=filled]; start -> main [color="0.002 0.999 0.999"]; start -> on_exit [color="0.649 0.701 0.701"]; main -> sort [color="0.348 0.839 0.839"]; main -> merge [color="0.515 0.762 0.762"]; main -> term [color="0.647 0.702 0.702"]; main -> signal [color="0.650 0.700 0.700"]; main -> sbrk [color="0.650 0.700 0.700"]; main -> unlink [color="0.650 0.700 0.700"]; main -> newfile [color="0.650 0.700 0.700"]; main -> fclose [color="0.650 0.700 0.700"]; main -> close [color="0.650 0.700 0.700"]; main -> brk [color="0.650 0.700 0.700"]; main -> setbuf [color="0.650 0.700 0.700"]; main -> copyproto [color="0.650 0.700 0.700"]; main -> initree [color="0.650 0.700 0.700"]; main -> safeoutfil [color="0.650 0.700 0.700"]; main -> getpid [color="0.650 0.700 0.700"]; main -> sprintf [color="0.650 0.700 0.700"]; main -> creat [color="0.650 0.700 0.700"]; main -> rem [color="0.650 0.700 0.700"]; main -> oldfile [color="0.650 0.700 0.700"]; sort -> msort [color="0.619 0.714 0.714"]; sort -> filbuf [color="0.650 0.700 0.700"]; sort -> newfile [color="0.650 0.700 0.700"]; sort -> fclose [color="0.650 0.700 0.700"]; sort -> setbuf [color="0.650 0.700 0.700"]; sort -> setfil [color="0.650 0.700 0.700"]; msort -> qsort [color="0.650 0.700 0.700"]; msort -> insert [color="0.650 0.700 0.700"]; msort -> wline [color="0.650 0.700 0.700"]; msort -> div [color="0.650 0.700 0.700"]; msort -> cmpsave [color="0.650 0.700 0.700"]; merge -> insert [color="0.650 0.700 0.700"]; merge -> rline [color="0.650 0.700 0.700"]; merge -> wline [color="0.650 0.700 0.700"]; merge -> unlink [color="0.650 0.700 0.700"]; merge -> fopen [color="0.650 0.700 0.700"]; merge -> fclose [color="0.650 0.700 0.700"]; merge -> setfil [color="0.650 0.700 0.700"]; merge -> mul [color="0.650 0.700 0.700"]; merge -> setbuf [color="0.650 0.700 0.700"]; merge -> cmpsave [color="0.650 0.700 0.700"]; insert -> cmpa [color="0.650 0.700 0.700"]; wline -> flsbuf [color="0.649 0.700 0.700"]; qsort -> cmpa [color="0.650 0.700 0.700"]; rline -> filbuf [color="0.649 0.700 0.700"]; xflsbuf -> write [color="0.650 0.700 0.700"]; flsbuf -> xflsbuf [color="0.649 0.700 0.700"]; filbuf -> read [color="0.650 0.700 0.700"]; term -> unlink [color="0.650 0.700 0.700"]; term -> signal [color="0.650 0.700 0.700"]; term -> setfil [color="0.650 0.700 0.700"]; term -> exit [color="0.650 0.700 0.700"]; endopen -> open [color="0.650 0.700 0.700"]; fopen -> endopen [color="0.639 0.705 0.705"]; fopen -> findiop [color="0.650 0.700 0.700"]; newfile -> fopen [color="0.634 0.707 0.707"]; newfile -> setfil [color="0.650 0.700 0.700"]; fclose -> fflush [color="0.642 0.704 0.704"]; fclose -> close [color="0.650 0.700 0.700"]; fflush -> xflsbuf [color="0.635 0.707 0.707"]; malloc -> morecore [color="0.325 0.850 0.850"]; malloc -> demote [color="0.650 0.700 0.700"]; morecore -> sbrk [color="0.650 0.700 0.700"]; morecore -> getfreehdr [color="0.650 0.700 0.700"]; morecore -> free [color="0.650 0.700 0.700"]; morecore -> getpagesize [color="0.650 0.700 0.700"]; morecore -> putfreehdr [color="0.650 0.700 0.700"]; morecore -> udiv [color="0.650 0.700 0.700"]; morecore -> umul [color="0.650 0.700 0.700"]; on_exit -> malloc [color="0.325 0.850 0.850"]; signal -> sigvec [color="0.650 0.700 0.700"]; moncontrol -> profil [color="0.650 0.700 0.700"]; getfreehdr -> sbrk [color="0.650 0.700 0.700"]; free -> insert [color="0.650 0.700 0.700"]; insert -> getfreehdr [color="0.650 0.700 0.700"]; setfil -> div [color="0.650 0.700 0.700"]; setfil -> rem [color="0.650 0.700 0.700"]; sigvec -> sigblock [color="0.650 0.700 0.700"]; sigvec -> sigsetmask [color="0.650 0.700 0.700"]; doprnt -> urem [color="0.650 0.700 0.700"]; doprnt -> udiv [color="0.650 0.700 0.700"]; doprnt -> strlen [color="0.650 0.700 0.700"]; doprnt -> localeconv [color="0.650 0.700 0.700"]; sprintf -> doprnt [color="0.650 0.700 0.700"]; cmpa [color="0.000 1.000 1.000"]; wline [color="0.201 0.753 1.000"]; insert [color="0.305 0.625 1.000"]; rline [color="0.355 0.563 1.000"]; sort [color="0.408 0.498 1.000"]; qsort [color="0.449 0.447 1.000"]; write [color="0.499 0.386 1.000"]; read [color="0.578 0.289 1.000"]; msort [color="0.590 0.273 1.000"]; merge [color="0.603 0.258 1.000"]; unlink [color="0.628 0.227 1.000"]; filbuf [color="0.641 0.212 1.000"]; open [color="0.641 0.212 1.000"]; sbrk [color="0.647 0.204 1.000"]; signal [color="0.647 0.204 1.000"]; moncontrol [color="0.647 0.204 1.000"]; xflsbuf [color="0.650 0.200 1.000"]; flsbuf [color="0.650 0.200 1.000"]; div [color="0.650 0.200 1.000"]; cmpsave [color="0.650 0.200 1.000"]; rem [color="0.650 0.200 1.000"]; setfil [color="0.650 0.200 1.000"]; close [color="0.650 0.200 1.000"]; fclose [color="0.650 0.200 1.000"]; fflush [color="0.650 0.200 1.000"]; setbuf [color="0.650 0.200 1.000"]; endopen [color="0.650 0.200 1.000"]; findiop [color="0.650 0.200 1.000"]; fopen [color="0.650 0.200 1.000"]; mul [color="0.650 0.200 1.000"]; newfile [color="0.650 0.200 1.000"]; sigblock [color="0.650 0.200 1.000"]; sigsetmask [color="0.650 0.200 1.000"]; sigvec [color="0.650 0.200 1.000"]; udiv [color="0.650 0.200 1.000"]; urem [color="0.650 0.200 1.000"]; brk [color="0.650 0.200 1.000"]; getfreehdr [color="0.650 0.200 1.000"]; strlen [color="0.650 0.200 1.000"]; umul [color="0.650 0.200 1.000"]; doprnt [color="0.650 0.200 1.000"]; copyproto [color="0.650 0.200 1.000"]; creat [color="0.650 0.200 1.000"]; demote [color="0.650 0.200 1.000"]; exit [color="0.650 0.200 1.000"]; free [color="0.650 0.200 1.000"]; getpagesize [color="0.650 0.200 1.000"]; getpid [color="0.650 0.200 1.000"]; initree [color="0.650 0.200 1.000"]; insert [color="0.650 0.200 1.000"]; localeconv [color="0.650 0.200 1.000"]; main [color="0.650 0.200 1.000"]; malloc [color="0.650 0.200 1.000"]; morecore [color="0.650 0.200 1.000"]; oldfile [color="0.650 0.200 1.000"]; on_exit [color="0.650 0.200 1.000"]; profil [color="0.650 0.200 1.000"]; putfreehdr [color="0.650 0.200 1.000"]; safeoutfil [color="0.650 0.200 1.000"]; sprintf [color="0.650 0.200 1.000"]; term [color="0.650 0.200 1.000"]; }ruby-graphviz-1.2.3/examples/dot/sdh.dot0000644000004100000410000001243613111037426020254 0ustar www-datawww-datadigraph G { graph [bgcolor=black]; edge [color=white]; graph[page="8.5,11",size="7.5,7",ratio=fill,center=1]; node[style=filled,label=""]; subgraph ds3CTP { rank = same; node[shape=box,color=green]; ds3CTP_1_1; ds3CTP_1_2; ds3CTP_5_1; ds3CTP_5_2; } subgraph t3TTP { rank = same; node[shape=invtriangle,color=red]; t3TTP_1_1; t3TTP_5_2; } subgraph vc3TTP { rank = same; node[shape=invtriangle,color=red]; vc3TTP_1_2; vc3TTP_5_1; } subgraph fabric { rank = same; node[shape=hexagon,color=blue]; fabric_1_2; fabric_4_1; fabric_5_1; } subgraph xp { rank = same; node[shape=diamond,color=blue]; xp_1_2; xp_4_1; xp_5_1; } subgraph au3CTP { rank = same; node[shape=box,color=green]; au3CTP_1_2; au3CTP_4_1; au3CTP_4_2; au3CTP_5_1; } subgraph aug { rank = same; node[shape=invtrapezium,color=pink]; aug_1_2; aug_4_1; aug_4_2; aug_5_1; } subgraph protectionTTP { rank = same; node[shape=invtriangle,color=red]; prTTP_1_2; prTTP_4_1; prTTP_4_2; prTTP_5_1; } subgraph protectionGroup { rank = same; node[shape=hexagon,color=blue]; pg_1_2; pg_4_1; pg_4_2; pg_5_1; } subgraph protectionUnit { rank = same; node[shape=diamond,color=blue]; pu_1_2; pu_4_1; pu_4_2; pu_5_1; } subgraph protectionCTP { node[shape=box,color=green]; prCTP_1_2; prCTP_4_1; prCTP_4_2; prCTP_5_1; } subgraph msTTP { rank = same; node[shape=invtriangle,color=red]; msTTP_1_2; msTTP_4_1; msTTP_4_2; msTTP_5_1; } subgraph msCTP { rank = same; node[shape=box,color=green]; msCTP_1_2; msCTP_3_1; msCTP_3_2; msCTP_4_1; msCTP_4_2; msCTP_5_1; } subgraph rsTTP { rank = same; node[shape=invtriangle,color=red]; rsTTP_1_2; rsTTP_3_1; rsTTP_3_2; rsTTP_4_1; rsTTP_4_2; rsTTP_5_1; } subgraph rsCTP { rank = same; node[shape=box,color=green]; rsCTP_1_2; rsCTP_2_1; rsCTP_2_2; rsCTP_3_1; rsCTP_3_2; rsCTP_4_1; rsCTP_4_2; rsCTP_5_1; } subgraph spiTTP { rank = same; node[shape=invtriangle,color=red]; spiTTP_1_2; spiTTP_2_1; spiTTP_2_2; spiTTP_3_1; spiTTP_3_2; spiTTP_4_1; spiTTP_4_2; spiTTP_5_1; } subgraph me { rank = same; node[shape=box,peripheries=2]; me_1; me_2; me_3; me_4; me_5; } subgraph client_server { edge[style=dotted,dir=none,weight=100]; ds3CTP_1_1->t3TTP_1_1; ds3CTP_1_2->vc3TTP_1_2; au3CTP_1_2->aug_1_2->prTTP_1_2; prCTP_1_2->msTTP_1_2; msCTP_1_2->rsTTP_1_2; rsCTP_1_2->spiTTP_1_2; rsCTP_2_1->spiTTP_2_1; rsCTP_2_2->spiTTP_2_2; msCTP_3_1->rsTTP_3_1; rsCTP_3_1->spiTTP_3_1; msCTP_3_2->rsTTP_3_2; rsCTP_3_2->spiTTP_3_2; au3CTP_4_1->aug_4_1->prTTP_4_1; prCTP_4_1->msTTP_4_1; msCTP_4_1->rsTTP_4_1; rsCTP_4_1->spiTTP_4_1; au3CTP_4_2->aug_4_2->prTTP_4_2; prCTP_4_2->msTTP_4_2; msCTP_4_2->rsTTP_4_2; rsCTP_4_2->spiTTP_4_2; ds3CTP_5_1->vc3TTP_5_1; au3CTP_5_1->aug_5_1->prTTP_5_1; prCTP_5_1->msTTP_5_1; msCTP_5_1->rsTTP_5_1; rsCTP_5_1->spiTTP_5_1; ds3CTP_5_2->t3TTP_5_2; } subgraph trail { edge[style=dashed,dir=none]; vc3TTP_1_2->vc3TTP_5_1; prTTP_1_2->prTTP_4_1; prTTP_4_2->prTTP_5_1; msTTP_1_2->msTTP_4_1; msTTP_4_2->msTTP_5_1; rsTTP_1_2->rsTTP_3_1; rsTTP_3_2->rsTTP_4_1; rsTTP_4_2->rsTTP_5_1; spiTTP_1_2->spiTTP_2_1; spiTTP_2_2->spiTTP_3_1; spiTTP_3_2->spiTTP_4_1; spiTTP_4_2->spiTTP_5_1; } subgraph contain { pu_1_2->pg_1_2; pu_4_1->pg_4_1; pu_4_2->pg_4_2; pu_5_1->pg_5_1; xp_1_2->fabric_1_2; xp_4_1->fabric_4_1; xp_5_1->fabric_5_1; fabric_1_2->me_1; fabric_4_1->me_4; fabric_5_1->me_5; pg_1_2->me_1; pg_4_1->me_4; pg_4_2->me_4; pg_5_1->me_5; t3TTP_1_1->me_1; t3TTP_5_2->me_5; vc3TTP_1_2->me_1; vc3TTP_5_1->me_5; prTTP_1_2->me_1; prTTP_4_1->me_4; prTTP_4_2->me_4; prTTP_5_1->me_5; msTTP_1_2->me_1; msTTP_4_1->me_4; msTTP_4_2->me_4; msTTP_5_1->me_5; rsTTP_1_2->me_1; rsTTP_3_1->me_3; rsTTP_3_2->me_3; rsTTP_4_1->me_4; rsTTP_4_2->me_4; rsTTP_5_1->me_5; spiTTP_1_2->me_1; spiTTP_2_1->me_2; spiTTP_2_2->me_2; spiTTP_3_1->me_3; spiTTP_3_2->me_3; spiTTP_4_1->me_4; spiTTP_4_2->me_4; spiTTP_5_1->me_5; } subgraph connectedBy { vc3TTP_1_2->fabric_1_2; au3CTP_1_2->fabric_1_2; au3CTP_4_1->fabric_4_1; au3CTP_4_2->fabric_4_1; vc3TTP_5_1->fabric_5_1; au3CTP_5_1->fabric_5_1; prTTP_1_2->pg_1_2; prTTP_4_1->pg_4_1; prTTP_4_2->pg_4_2; prTTP_5_1->pg_5_1; prCTP_1_2->pg_1_2; prCTP_4_1->pg_4_1; prCTP_4_2->pg_4_2; prCTP_5_1->pg_5_1; } subgraph crossConnection { edge[style=dotted,dir=none]; vc3TTP_1_2->xp_1_2->au3CTP_1_2; prTTP_1_2->pu_1_2->prCTP_1_2; prTTP_4_1->pu_4_1->prCTP_4_1; au3CTP_4_1->xp_4_1->au3CTP_4_2; prTTP_4_2->pu_4_2->prCTP_4_2; prTTP_5_1->pu_5_1->prCTP_5_1; vc3TTP_5_1->xp_5_1->au3CTP_5_1; } subgraph bindingConnection { edge[style=bold,dir=none,weight=100]; ds3CTP_1_1->ds3CTP_1_2; vc3TTP_1_2->au3CTP_1_2; prTTP_1_2->prCTP_1_2; msTTP_1_2->msCTP_1_2; rsTTP_1_2->rsCTP_1_2; rsCTP_2_1->rsCTP_2_2; rsTTP_3_1->rsCTP_3_1; msCTP_3_1->msCTP_3_2; rsTTP_3_2->rsCTP_3_2; prTTP_4_1->prCTP_4_1; msTTP_4_1->msCTP_4_1; rsTTP_4_1->rsCTP_4_1; au3CTP_4_1->au3CTP_4_2; prTTP_4_2->prCTP_4_2; msTTP_4_2->msCTP_4_2; rsTTP_4_2->rsCTP_4_2; prTTP_5_1->prCTP_5_1; msTTP_5_1->msCTP_5_1; rsTTP_5_1->rsCTP_5_1; ds3CTP_5_1->ds3CTP_5_2; vc3TTP_5_1->au3CTP_5_1; } }ruby-graphviz-1.2.3/examples/dot/psg.dot0000644000004100000410000001360713111037426020270 0ustar www-datawww-datadigraph g { graph [fontsize=30 labelloc="t" label="" splines=true overlap=false rankdir = "LR"]; ratio = auto; "state0" [ style = "filled, bold" penwidth = 5 fillcolor = "white" fontname = "Courier New" shape = "Mrecord" label =<
State #0
(0) s -> •e $
(1) e -> •l '=' r
(2) e -> •r
(3) l -> •'*' r
(4) l -> •'n'
(5) r -> •l
> ]; "state1" [ style = "filled" penwidth = 1 fillcolor = "white" fontname = "Courier New" shape = "Mrecord" label =<
State #1
(3) l -> •'*' r
(3) l -> '*' •r
(4) l -> •'n'
(5) r -> •l
> ]; "state2" [ style = "filled" penwidth = 1 fillcolor = "white" fontname = "Courier New" shape = "Mrecord" label =<
State #2
(4) l -> 'n' •=$
> ]; "state3" [ style = "filled" penwidth = 1 fillcolor = "white" fontname = "Courier New" shape = "Mrecord" label =<
State #3
(5) r -> l •=$
> ]; "state4" [ style = "filled" penwidth = 1 fillcolor = "white" fontname = "Courier New" shape = "Mrecord" label =<
State #4
(3) l -> '*' r •=$
> ]; "state5" [ style = "filled" penwidth = 1 fillcolor = "black" fontname = "Courier New" shape = "Mrecord" label =<
State #5
(0) s -> e •$
> ]; "state6" [ style = "filled" penwidth = 1 fillcolor = "white" fontname = "Courier New" shape = "Mrecord" label =<
State #6
(1) e -> l •'=' r
(5) r -> l •$
> ]; "state7" [ style = "filled" penwidth = 1 fillcolor = "white" fontname = "Courier New" shape = "Mrecord" label =<
State #7
(1) e -> l '=' •r
(3) l -> •'*' r
(4) l -> •'n'
(5) r -> •l
> ]; "state8" [ style = "filled" penwidth = 1 fillcolor = "white" fontname = "Courier New" shape = "Mrecord" label =<
State #8
(1) e -> l '=' r •$
> ]; "state9" [ style = "filled" penwidth = 1 fillcolor = "white" fontname = "Courier New" shape = "Mrecord" label =<
State #9
(2) e -> r •$
> ]; state0 -> state5 [ penwidth = 5 fontsize = 28 fontcolor = "black" label = "e" ]; state0 -> state6 [ penwidth = 5 fontsize = 28 fontcolor = "black" label = "l" ]; state0 -> state9 [ penwidth = 5 fontsize = 28 fontcolor = "black" label = "r" ]; state0 -> state1 [ penwidth = 1 fontsize = 14 fontcolor = "grey28" label = "'*'" ]; state0 -> state2 [ penwidth = 1 fontsize = 14 fontcolor = "grey28" label = "'n'" ]; state1 -> state1 [ penwidth = 1 fontsize = 14 fontcolor = "grey28" label = "'*'" ]; state1 -> state4 [ penwidth = 5 fontsize = 28 fontcolor = "black" label = "r" ]; state1 -> state2 [ penwidth = 1 fontsize = 14 fontcolor = "grey28" label = "'n'" ]; state1 -> state3 [ penwidth = 5 fontsize = 28 fontcolor = "black" label = "l" ]; state6 -> state7 [ penwidth = 1 fontsize = 14 fontcolor = "grey28" label = "'='" ]; state7 -> state8 [ penwidth = 5 fontsize = 28 fontcolor = "black" label = "r" ]; state7 -> state1 [ penwidth = 1 fontsize = 14 fontcolor = "grey28" label = "'*'" ]; state7 -> state2 [ penwidth = 1 fontsize = 14 fontcolor = "grey28" label = "'n'" ]; state7 -> state3 [ penwidth = 5 fontsize = 28 fontcolor = "black" label = "l" ]; }ruby-graphviz-1.2.3/examples/sample70.rb0000644000004100000410000000052213111037426020146 0ustar www-datawww-data$:.unshift( "../lib" ) require 'graphviz' puts GraphViz.graph( :G ) { |g| g[:label] = "<This is a test>" n1 = g.add_nodes( "N1", :label => '<node 1>') n2 = g.add_nodes( "N2", :label => '<node 2>') g.add_edges( n1, n2, :label => '<edge>') }.output( :svg => "#{$0}.svg", :none => String ) ruby-graphviz-1.2.3/examples/sample26.rb0000644000004100000410000000026013111037426020146 0ustar www-datawww-data#!/usr/bin/ruby $:.unshift( "../lib" ); require "graphviz" GraphViz.new(:G){ |g| (g.hello - g.world) [:style => :bold, :label => " axgle says"] }.save( :png => "#{$0}.png" )ruby-graphviz-1.2.3/examples/sample43.rb0000644000004100000410000000174613111037426020157 0ustar www-datawww-data$:.unshift( "../lib" ); require "graphviz" g = GraphViz::new( "structs" ) g.node["shape"] = "plaintext" g.add_nodes( "HTML" ) g.add_nodes( "struct1", "label" => '<
left mid dle right
>' ) g.add_nodes( "struct2", "label" => '<
onetwo
>' ) g.add_nodes( "struct3", "label" => '<
hello
world
b g h
cde
f
>' ) g.add_edges( {"struct1" => :f1}, {"struct2" => :f0} ) g.add_edges( {"struct1" => :f2}, {"struct3" => :here} ) g.add_edges( "HTML", "struct1" ) g.output( :path => ARGV[0], :png => "#{$0}.png" ) ruby-graphviz-1.2.3/examples/rgv/0000755000004100000410000000000013111037426016770 5ustar www-datawww-dataruby-graphviz-1.2.3/examples/rgv/rgv.ps0000644000004100000410000000554513111037426020143 0ustar www-datawww-data%! Greg shapes for GraphViz/DOT % input format : % [ 54 36 0 36 0 0 54 0 54 36 ] 4 false yourshape % or % [ 54 36 0 36 0 0 54 0 54 36 ] 4 true yourshape % [ 150 150 100 150 100 100 150 100 150 150 ] 4 true yourshape % % [upper right (y, x), lower right (y, x), lower left (y, x), upper left (y, x), upper right (y, x)] /xdef {exch def} bind def /rgv_box { 10 dict begin /fflag xdef /sides xdef 4 sides ne { stop } if aload pop newpath moveto lineto lineto lineto closepath pop pop fflag { fill } { stroke } ifelse end } bind def /rgv_cloud { 10 dict begin /fflag xdef /sides xdef % Check if we have 4 sides. Else stop 4 sides ne { stop } if % (aload) takes an array as its argument and places the individual elements % of that array, and then the array itself, on the stack. Then (pop) remove % the top element from the stack (the array) aload pop /ury xdef /urx xdef /lry xdef /lrx xdef /lly xdef /llx xdef /uly xdef /ulx xdef pop pop /mx lrx llx neg add 2 div def /my uly lly neg add 2 div def % empty the current path and declares we are starting a new path newpath urx ury my neg add my 270 90 arc ulx mx add uly mx 0 180 arc llx lly my add my 90 270 arc lrx lry lineto closepath % The stroke operator on line four causes the path we have constructed to be % painted onto the current page. % The fill operator fills the current path with ink. fflag { fill } { stroke } ifelse end } bind def /rgv_flower { 10 dict begin /fflag xdef /sides xdef % Check if we have 4 sides. Else stop 4 sides ne { stop } if % (aload) takes an array as its argument and places the individual elements % of that array, and then the array itself, on the stack. Then (pop) remove % the top element from the stack (the array) aload pop /ury xdef /urx xdef /lry xdef /lrx xdef /lly xdef /llx xdef /uly xdef /ulx xdef pop pop /mx lrx llx neg add 2 div def /my uly lly neg add 2 div def % empty the current path and declares we are starting a new path newpath % Arcs urx ury my neg add my 270 90 arc ulx mx add uly mx 0 180 arc llx lly my add my 90 270 arc lrx mx neg add lry mx 180 0 arc closepath % The stroke operator on line four causes the path we have constructed to be % painted onto the current page. % The fill operator fills the current path with ink. fflag { fill } { stroke } ifelse end } bind def %[ 150 150 50 150 50 100 150 100 150 150 ] 4 false rgv_box %[ 250 250 150 250 150 200 250 200 250 250 ] 4 false rgv_flower %[ 350 350 250 350 250 300 350 300 350 350 ] 4 false rgv_cloud % %.5 setgray %[ 150 450 50 450 50 400 150 400 150 450 ] 4 true rgv_box %.5 setgray %[ 250 550 150 550 150 500 250 500 250 550 ] 4 true rgv_flower %.5 setgray %[ 350 650 250 650 250 600 350 600 350 650 ] 4 true rgv_cloud % %showpage ruby-graphviz-1.2.3/examples/rgv/test_rgv.rb0000644000004100000410000000061313111037426021152 0ustar www-datawww-data#!/usr/bin/ruby $:.unshift( "../../lib" ); require "graphviz" GraphViz.new(:g){ |g| g[:center] = true a = g.add_nodes("A", :shape => "rgv_box", :peripheries => 0) b = g.add_nodes("Bonjour le monde\nComment va tu ?", :shape => "rgv_cloud", :peripheries => 0) c = g.add_nodes("C", :shape => "rgv_flower", :peripheries => 0) a << b << c }.save( :ps => "#{$0}.ps", :extlib => "rgv.ps" ) ruby-graphviz-1.2.3/examples/sample67.rb0000644000004100000410000000042613111037426020157 0ustar www-datawww-data$:.unshift("../lib") require 'graphviz' graph = GraphViz.graph(:G) graph.add_nodes(["A", "B", "C", "D", "E", "F", "G"]) graph.add_edges("A", ["B", "C", "E"]) graph.add_edges("B", ["D", "F"]) graph.add_edges("C", "G") graph.add_edges("F", "E") graph.output(:png => "#{$0}.png") ruby-graphviz-1.2.3/examples/sample57.rb0000644000004100000410000000040513111037426020153 0ustar www-datawww-data$:.unshift( "../lib" ) require 'graphviz/graphml' graphml = File.join( File.dirname( File.expand_path( __FILE__ ) ), "graphml", "port.graphml" ) g = GraphViz::GraphML.new( graphml ) g.graph.output( :png => "#{$0}.png" ) puts g.graph.output( :none => String ) ruby-graphviz-1.2.3/examples/sample56.rb0000644000004100000410000000041513111037426020153 0ustar www-datawww-data# http://www.graphviz.org/Gallery/directed/hello.html # # digraph G {Hello->World} $:.unshift( "../lib" ); require "graphviz" GraphViz::new( :G, :type => :digraph ) { |g| g.world( :label => " "Hello>" ) }.output( :svg => "#{$0}.svg" )ruby-graphviz-1.2.3/examples/sample11.rb0000644000004100000410000000160013111037426020137 0ustar www-datawww-data#!/usr/bin/ruby $:.unshift( "../lib" ); require "graphviz" graph = nil if ARGV[0] graph = GraphViz::new( "G", "path" => ARGV[0] ) else graph = GraphViz::new( "G" ) end graph["compound"] = "true" graph.edge["lhead"] = "" graph.edge["ltail"] = "" c0 = graph.add_graph( "cluster0" ) a = c0.add_nodes( "a" ) b = c0.add_nodes( "b" ) c = c0.add_nodes( "c" ) d = c0.add_nodes( "d" ) c0.add_edges( a, b ) c0.add_edges( a, c ) c0.add_edges( b, d ) c0.add_edges( c, d ) c1 = graph.add_graph( "cluster1" ) e = c1.add_nodes( "e" ) f = c1.add_nodes( "f" ) g = c1.add_nodes( "g" ) c1.add_edges( e, g ) c1.add_edges( e, f ) h = graph.add_nodes( "h" ) graph.add_edges( b, f, "lhead" => "cluster1" ) graph.add_edges( d, e ) graph.add_edges( c, g, "ltail" => "cluster0", "lhead" => "cluster1" ) graph.add_edges( c, e, "ltail" => "cluster0" ) graph.add_edges( d, h ) graph.output( :png => "#{$0}.png" ) ruby-graphviz-1.2.3/examples/sample41.rb0000644000004100000410000000037113111037426020146 0ustar www-datawww-data#!/usr/bin/ruby $:.unshift( "../lib" ) require "graphviz" GraphViz::new( "G" ) { |g| g.hello(:style => :filled, :fillcolor => :lightblue) << g.world(:style => :filled, :fillcolor => :lightgrey) }.output( :svg => "#{$0}.svg", :nothugly => true ) ruby-graphviz-1.2.3/examples/sample72.rb0000644000004100000410000000067613111037426020162 0ustar www-datawww-data#!/usr/bin/ruby $:.unshift( "../lib" ) require "graphviz" g = nil if ARGV[0] g = GraphViz::new( "G", :path => ARGV[0] ) else g = GraphViz::new( "G" ) end g.node[:color] = "#FF0000:#FFFFFF" g.add_edges("noDe", "graph") g.add_edges("node", "graph") g.add_edges("node", "Graph") g.add_edges("graph", "subgraph") g.add_edges("edge", "node") g.add_edges("subgraph", "digraph") g.add_edges("subgraph", "strict") g.output( :png => "#{$0}.png" ) ruby-graphviz-1.2.3/examples/sample22.rb0000644000004100000410000000056613111037426020153 0ustar www-datawww-data#!/usr/bin/ruby $:.unshift( "../lib" ); require "graphviz" GraphViz::new( "mainmap" ) { |graph| graph[:URL] = "http://www.research.att.com/base.html" graph.command( :URL => "http://www.research.att.com/command.html" ) (graph.command << graph._output( :label => "output" ))[:URL] = "colors.html" }.output( :canon => nil, :cmapx => "#{$0}.html", :png => "#{$0}.png" ) ruby-graphviz-1.2.3/examples/sample71.rb0000644000004100000410000000063313111037426020152 0ustar www-datawww-data#!/usr/bin/ruby $:.unshift( "../lib" ) require "graphviz" g = nil if ARGV[0] g = GraphViz::new( "G", :path => ARGV[0] ) else g = GraphViz::new( "G" ) end g.add_edges("noDe", "graph") g.add_edges("node", "graph") g.add_edges("node", "Graph") g.add_edges("graph", "subgraph") g.add_edges("edge", "node") g.add_edges("subgraph", "digraph") g.add_edges("subgraph", "strict") g.output( :png => "#{$0}.png" ) ruby-graphviz-1.2.3/examples/sample64.rb0000644000004100000410000000114313111037426020151 0ustar www-datawww-data$:.unshift( "../lib" ) require 'graphviz/dsl' digraph :G do node[:color => :lightblue, :style => :filled, :shape => :egg] edge[:color => :gray, :arrowhead => :vee] e "C/C++", "Java" java do n("Java") << n("Groovy") n("Java") << n("Clojure") n("Java") << n("JRuby") graph[:label => "Java", :color => :blue] end e "C/C++", "Perl" e "Perl", "PHP" e "Perl", "Ruby" e "Ruby", "Rubinius" e "Ruby", "MacRuby" e "Ruby", "JRuby" %w{ Ruby JRuby MacRuby Rubinius }.each do |ruby| n(ruby)[:color => :tomato] end output :png => "#{$0}.png" end ruby-graphviz-1.2.3/examples/sample16.rb0000644000004100000410000000041413111037426020146 0ustar www-datawww-data#!/usr/bin/ruby $:.unshift( "../lib" ); require "graphviz" GraphViz::new( "G", :type => "graph", :rankdir => "LR" ) { |graph| graph.add_edges( [graph.a, graph.b, graph.c], [ graph.d, graph.e, graph.f ] ) }.output( :path => '/usr/local/bin/', :png => "#{$0}.png" ) ruby-graphviz-1.2.3/examples/sample28.rb0000644000004100000410000000053413111037426020154 0ustar www-datawww-data#!/usr/bin/ruby $:.unshift( "../lib" ); require "graphviz" GraphViz.new(:G){ |g| g[:ratio => "auto", :label => "I love the world!"] g.hello( :label => "Hello", :color => "blue" ) # You can do this g.none[ :label => "World", :color => "green" ] # or that (g.hello - g.none)[:style => :bold, :label => " I say"] }.save( :png => "#{$0}.png" ) ruby-graphviz-1.2.3/examples/sample58.rb0000644000004100000410000000141013111037426020151 0ustar www-datawww-data#!/usr/bin/ruby # By Jonas Elfström - https://github.com/jonelf $:.unshift( "../lib" ) require 'graphviz' @min_level=1 @max_level=12 @max_depth=10 start_level=6 @g = GraphViz.new(:G, :type => "strict digraph") # or @g = GraphViz.new(:G, :type => "digraph", :strict => true) # or @g = GraphViz.digraph(:G, :strict => true) # or @g = GraphViz.strict_digraph(:G) def add_nodes(level, depth, parent) if depth<@max_depth current=[level, depth].join(",") sub=level<=>@min_level add=@max_level<=>level add_nodes(level-sub, depth+1, current) add_nodes(level+add, depth+1, current) @g.add_nodes(current).label=level.to_s @g.add_edges(parent, current) unless parent=="00" end end add_nodes(start_level, 0, "00") @g.output( :png => "#{$0}.png" ) ruby-graphviz-1.2.3/examples/sdlshapes/0000755000004100000410000000000013111037426020160 5ustar www-datawww-dataruby-graphviz-1.2.3/examples/sdlshapes/README0000644000004100000410000000017613111037426021044 0ustar www-datawww-dataPostScript library for SDL node shapes (http://www.sdl-forum.org/SDL/index.htm) by Mark Rison of Cambridge Silicon Radio Ltd. ruby-graphviz-1.2.3/examples/sdlshapes/sdl.ps0000644000004100000410000004352613111037426021320 0ustar www-datawww-data%! SDL shapes for Graphviz/dot in PostScript output mode % FILE % sdl.ps - SDL shapes for Graphviz/dot in PostScript output mode % % USE % All procedures expect to be passed a rectangular bounding box in the % order [upper right, lower right, lower left, upper left, upper right]. % All procedures expect to be used with "peripheries = 0". % % BUGS % The following shapes are currently not implemented: % - frame/system/block/process/procedure/service/procedure, and types thereof % - macro inlet/outlet/call % - exception handler/handle/raise % - decision (suggest use diamond) % - alternative (suggest use triangle) % - internal input/output (suggest stop using historical relics!) % % COPYRIGHT AND PERMISSION NOTICE % Copyright (C) 2005 Cambridge Silicon Radio Ltd.; all rights reserved. % % Permission is hereby granted, free of charge, to any person obtaining % a copy of this software and associated documentation files (the % "Software"), to deal in the Software without restriction, including % without limitation the rights to use, copy, modify, merge, publish, % distribute, sublicense, and/or sell copies of the Software, and to % permit persons to whom the Software is furnished to do so, subject to % the following conditions: % % The above copyright notice and this permission notice shall be % included in all copies or substantial portions of the Software. % % THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, % EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF % MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND % NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE % LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION % OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION % WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. % % Except as contained in this notice, the name of a copyright holder % shall not be used in advertising or otherwise to promote the sale, use % or other dealings in the Software without prior written authorization % of the copyright holder. % % REVISION % #4 /xdef {exch def} bind def % SDL task /sdl_task { 3 1 roll % put filled flag at end 4 ne { stop } if % sanity-check number of sides aload pop newpath moveto lineto lineto lineto pop pop closepath { fill } { stroke } ifelse } bind def % SDL input from right % The indent has lines at 45 degrees % There should be a few spaces at the end of this shape's label /sdl_input_from_right { 9 dict begin 3 1 roll % put filled flag at end 4 ne { stop } if % sanity-check number of sides aload pop /ury xdef /urx xdef /lry xdef /lrx xdef /lly xdef /llx xdef /uly xdef /ulx xdef /h2 ury lry sub 2 div def newpath moveto urx h2 sub ury h2 sub lineto lrx lry lineto llx lly lineto ulx uly lineto closepath { fill } { stroke } ifelse end } bind def % SDL input from left % Similar to SDL input from right % There should be a few spaces at the start of this shape's label /sdl_input_from_left { 9 dict begin 3 1 roll % put filled flag at end 4 ne { stop } if % sanity-check number of sides aload pop /ury xdef /urx xdef /lry xdef /lrx xdef /lly xdef /llx xdef /uly xdef /ulx xdef /h2 uly lly sub 2 div def newpath moveto lrx lry lineto llx lly lineto ulx h2 add ury h2 sub lineto ulx uly lineto closepath { fill } { stroke } ifelse end } bind def % SDL priority input from right % Similar to SDL input from right % The chevrons are displaced by an eighth of the shape height % The filled version is indistinguishable from a non-priority SDL input /sdl_priority_input_from_right { 9 dict begin 3 1 roll % put filled flag at end 4 ne { stop } if % sanity-check number of sides aload pop /ury xdef /urx xdef /lry xdef /lrx xdef /lly xdef /llx xdef /uly xdef /ulx xdef /h2 ury lry sub 2 div def newpath moveto urx h2 sub ury h2 sub lineto lrx lry lineto llx lly lineto ulx uly lineto closepath { fill } { stroke urx h2 4 div sub ury moveto urx h2 sub h2 4 div sub ury h2 sub lineto lrx h2 4 div sub lry lineto stroke } ifelse end } bind def % SDL priority input from left % Similar to SDL priority input from right /sdl_priority_input_from_left { 9 dict begin 3 1 roll % put filled flag at end 4 ne { stop } if % sanity-check number of sides aload pop /ury xdef /urx xdef /lry xdef /lrx xdef /lly xdef /llx xdef /uly xdef /ulx xdef /h2 uly lly sub 2 div def newpath moveto lrx lry lineto llx lly lineto ulx h2 add uly h2 sub lineto ulx uly lineto closepath { fill } { stroke llx h2 4 div add lly moveto ulx h2 add h2 4 div add uly h2 sub lineto ulx h2 4 div add uly lineto stroke } ifelse end } bind def % SDL start % The left and right sides are semicircles % This should be used with "label = " "" /sdl_start { 9 dict begin 3 1 roll % put filled flag at end 4 ne { stop } if % sanity-check number of sides aload pop /ury xdef /urx xdef /lry xdef /lrx xdef /lly xdef /llx xdef /uly xdef /ulx xdef pop pop /r ury lry sub 2 div def newpath urx r sub ury r sub r 90 -90 arcn ulx r add uly r sub r -90 90 arcn closepath { fill } { stroke } ifelse end } bind def % SDL procedure start % Similar to SDL start % The filled version is indistinguishable from an SDL start % This should be used with "label = " "" /sdl_procedure_start { 9 dict begin 3 1 roll % put filled flag at end 4 ne { stop } if % sanity-check number of sides aload pop /ury xdef /urx xdef /lry xdef /lrx xdef /lly xdef /llx xdef /uly xdef /ulx xdef pop pop /r ury lry sub 2 div def newpath urx r sub ury r sub r 90 -90 arcn ulx r add uly r sub r -90 90 arcn closepath { fill } { stroke lrx r sub lry moveto 0 r 2 mul rlineto llx r add lly moveto 0 r 2 mul rlineto stroke } ifelse end } bind def % SDL state/nextstate % The left and right sides are arcs /sdl_state { 12 dict begin 3 1 roll % put filled flag at end 4 ne { stop } if % sanity-check number of sides aload pop /ury xdef /urx xdef /lry xdef /lrx xdef /lly xdef /llx xdef /uly xdef /ulx xdef pop pop /h2 ury lry sub 2 div def /w2 h2 1.5 mul def % was urx ulx sub 2 div def but this made curvature width-dependent /r w2 def /th h2 r dup mul h2 dup mul sub sqrt atan def newpath urx w2 sub ury h2 sub r th th neg arcn ulx w2 add uly h2 sub r -180 th add -180 th sub arcn closepath { fill } { stroke } ifelse end } bind def % SDL output to right % The outdent has lines at 45 degrees % There should be a few spaces at the end of this shape's label /sdl_output_to_right { 9 dict begin 3 1 roll % put filled flag at end 4 ne { stop } if % sanity-check number of sides aload pop /ury xdef /urx xdef /lry xdef /lrx xdef /lly xdef /llx xdef /uly xdef /ulx xdef /h2 ury lry sub 2 div def newpath exch h2 sub exch moveto urx ury h2 sub lineto lrx h2 sub lry lineto llx lly lineto ulx uly lineto closepath { fill } { stroke } ifelse end } bind def % SDL output to left % Similar to SDL output to right % There should be a few spaces at the start of this shape's label /sdl_output_to_left { 9 dict begin 3 1 roll % put filled flag at end 4 ne { stop } if % sanity-check number of sides aload pop /ury xdef /urx xdef /lry xdef /lrx xdef /lly xdef /llx xdef /uly xdef /ulx xdef /h2 ury lry sub 2 div def newpath moveto lrx lry lineto llx h2 add lly lineto ulx ury h2 sub lineto ulx h2 add uly lineto closepath { fill } { stroke } ifelse end } bind def % SDL continuous signal/enabling condition % The chevrons have lines at 45 degrees % There should be a few spaces at the start and end of this shape's label /sdl_condition { 9 dict begin 3 1 roll % put filled flag at end 4 ne { stop } if % sanity-check number of sides aload pop /ury xdef /urx xdef /lry xdef /lrx xdef /lly xdef /llx xdef /uly xdef /ulx xdef /h2 ury lry sub 2 div def newpath exch h2 sub exch moveto urx ury h2 sub lineto lrx h2 sub lry lineto dup llx h2 add lly 3 -1 roll { lineto } { moveto } ifelse ulx uly h2 sub lineto ulx h2 add uly lineto { fill } { stroke } ifelse end } bind def % SDL save % The left and right edges are at about 60 degrees % There should be a few spaces at the start and end of this shape's label /sdl_save { 9 dict begin 3 1 roll % put filled flag at end 4 ne { stop } if % sanity-check number of sides aload pop /ury xdef /urx xdef /lry xdef /lrx xdef /lly xdef /llx xdef /uly xdef /ulx xdef /h3 ury lry sub 3 div def newpath moveto lrx h3 sub lry lineto llx lly lineto ulx h3 add uly lineto closepath { fill } { stroke } ifelse end } bind def % SDL stop % The width of the bounding box is ignored; the lines are set at 45 degrees % This shape cannot be filled % This should be used with "label = """ and "arrowhead = none, headclip = false" /sdl_stop { 7 dict begin { stop } if % make sure not asked to fill this 4 ne { stop } if % sanity-check number of sides aload pop pop pop /lry xdef /lrx xdef /lly xdef /llx xdef /uly xdef pop /h2 uly lly sub 2 div def /mx llx lrx add 2 div def newpath mx h2 add exch moveto pop mx h2 sub lly lineto mx h2 sub uly moveto mx h2 add lry lineto closepath stroke end } bind def % SDL return % The width of the bounding box is ignored; the lines are set at 45 degrees % The filled version is indistinguishable from an SDL connection /sdl_return { 9 dict begin 3 1 roll % put filled flag at end 4 ne { stop } if % sanity-check number of sides aload pop /ury xdef pop /lry xdef /lrx xdef /lly xdef /llx xdef /uly xdef pop pop pop /h2 uly lly sub 2 div 2 sqrt div def /mx llx lrx add 2 div def /my lry ury add 2 div def newpath mx my uly lly sub 2 div 0 360 arc { fill } { stroke mx h2 add my h2 add moveto mx h2 sub my h2 sub lineto mx h2 sub my h2 add moveto mx h2 add my h2 sub lineto stroke } ifelse end } bind def % SDL create % The extra lines are displaced by an eighth of the shape height % The filled version is indistinguishable from an SDL task /sdl_create { 9 dict begin 3 1 roll % put filled flag at end 4 ne { stop } if % sanity-check number of sides aload pop /ury xdef /urx xdef /lry xdef /lrx xdef /lly xdef /llx xdef /uly xdef /ulx xdef /h8 ury lry sub 8 div def newpath moveto lrx lry lineto llx lly lineto ulx uly lineto closepath { fill } { stroke ulx uly h8 sub moveto urx ury h8 sub lineto llx lly h8 add moveto lrx lry h8 add lineto stroke } ifelse end } bind def % SDL call % The extra lines are displaced by an eighth of the shape height % The filled version is indistinguishable from an SDL task % There should be a few spaces at the start and end of this shape's label /sdl_call { 9 dict begin 3 1 roll % put filled flag at end 4 ne { stop } if % sanity-check number of sides aload pop /ury xdef /urx xdef /lry xdef /lrx xdef /lly xdef /llx xdef /uly xdef /ulx xdef /h8 ury lry sub 8 div def newpath moveto lrx lry lineto llx lly lineto ulx uly lineto closepath { fill } { stroke urx h8 sub ury moveto lrx h8 sub lry lineto llx h8 add lly moveto ulx h8 add uly lineto stroke } ifelse end } bind def % SDL text symbol % The corner has a size of twice the H height /sdl_text { 10 dict begin 3 1 roll % put filled flag at end 4 ne { stop } if % sanity-check number of sides aload pop /ury xdef /urx xdef /lry xdef /lrx xdef /lly xdef /llx xdef /uly xdef /ulx xdef /h8 ury lry sub 8 div def newpath moveto /d (H) true charpath flattenpath pathbbox exch pop exch sub exch pop 2 mul def newpath urx ury d sub moveto lrx lry lineto llx lly lineto ulx uly lineto urx d sub ury lineto closepath { fill } { stroke } ifelse urx ury d sub moveto d neg 0 rlineto 0 d rlineto stroke end } bind def % SDL text extension from left % This should be used with "rank = same" /sdl_text_extension_from_left { 3 1 roll % put filled flag at end 4 ne { stop } if % sanity-check number of sides aload pop pop pop moveto lineto lineto lineto { fill } { stroke } ifelse } bind def % SDL text extension from right % This should be used with "rank = same" /sdl_text_extension_from_right { 3 1 roll % put filled flag at end 4 ne { stop } if % sanity-check number of sides aload pop pop pop 8 4 roll moveto lineto lineto lineto { fill } { stroke } ifelse } bind def % SDL comment from left % This should be used with "style = dashed" and "rank = same" /sdl_comment_from_left { sdl_text_extension_from_left } bind def % SDL comment from right % This should be used with "style = dashed" and "rank = same" /sdl_comment_from_right { sdl_text_extension_from_right } bind def % SDL connector % The width of the bounding box is ignored /sdl_connector { 7 dict begin 3 1 roll % put filled flag at end 4 ne { stop } if % sanity-check number of sides aload pop pop pop /lry xdef /lrx xdef /lly xdef /llx xdef /uly xdef pop pop pop /h2 uly lly sub 2 div def /mx llx lrx add 2 div def newpath mx uly h2 sub h2 0 360 arc { fill } { stroke } ifelse end } bind def % SDL set (extension) % The hourglass has a size of twice the H height % There should be a few spaces at the start of this shape's label /sdl_set { 10 dict begin 3 1 roll % put filled flag at end 4 ne { stop } if % sanity-check number of sides aload pop /ury xdef /urx xdef /lry xdef /lrx xdef /lly xdef /llx xdef /uly xdef /ulx xdef /my uly lly add 2 div def newpath moveto /d (H) true charpath flattenpath pathbbox exch pop exch sub exch pop def newpath llx d add my d add moveto ulx d add uly lineto urx ury lineto lrx lry lineto llx d add lly lineto llx d add my d sub lineto dup { closepath fill } { stroke } ifelse llx my d sub moveto d 2 mul dup rlineto d 2 mul neg 0 rlineto d 2 mul dup neg rlineto closepath { fill } { stroke } ifelse end } bind def % SDL reset (extension) % The cross has a size of twice the H height % There should be a few spaces at the start of this shape's label /sdl_reset { 10 dict begin 3 1 roll % put filled flag at end 4 ne { stop } if % sanity-check number of sides aload pop /ury xdef /urx xdef /lry xdef /lrx xdef /lly xdef /llx xdef /uly xdef /ulx xdef /my uly lly add 2 div def newpath moveto /d (H) true charpath flattenpath pathbbox exch pop exch sub exch pop def newpath urx ury moveto lrx lry lineto llx d add lly lineto ulx d add uly lineto closepath { fill } { stroke } ifelse llx my d sub moveto d 2 mul dup rlineto llx d 2 mul add my d sub moveto d 2 mul dup neg exch rlineto stroke end } bind def % SDL export (extension) % The store has a width of twice the H height % There should be a few spaces at the start of this shape's label /sdl_export { 10 dict begin 3 1 roll % put filled flag at end 4 ne { stop } if % sanity-check number of sides aload pop /ury xdef /urx xdef /lry xdef /lrx xdef /lly xdef /llx xdef /uly xdef /ulx xdef /my uly lly add 2 div def newpath moveto /d (H) true charpath flattenpath pathbbox exch pop exch sub exch pop def newpath llx d add my d 2 div add moveto ulx d add uly lineto urx ury lineto lrx lry lineto llx d add lly lineto llx d add my d 2 div sub lineto { closepath fill } { stroke } ifelse llx my d 2 div sub moveto d 2 mul 0 rlineto llx my d 2 div add moveto d 2 mul 0 rlineto stroke end } bind defruby-graphviz-1.2.3/examples/sdlshapes/sdlshapes.dot0000644000004100000410000001341313111037426022660 0ustar www-datawww-datadigraph test { sdl_task [shape=sdl_task, color=red, fillcolor=cyan, style=filled, peripheries=0]; sdl_task2 [shape=sdl_task, label="sdl_task", peripheries=0]; sdl_task -> sdl_task2; sdl_input_from_right [shape=sdl_input_from_right, color=red, fillcolor=cyan, style=filled, peripheries=0]; sdl_input_from_right2 [shape=sdl_input_from_right, label="sdl_input_from_right ", peripheries=0]; sdl_input_from_right -> sdl_input_from_right2; sdl_input_from_left [shape=sdl_input_from_left, color=red, fillcolor=cyan, style=filled, peripheries=0]; sdl_input_from_left2 [shape=sdl_input_from_left, label=" sdl_input_from_left", peripheries=0]; sdl_input_from_left -> sdl_input_from_left2; sdl_priority_input_from_right [shape=sdl_priority_input_from_right, color=red, fillcolor=cyan, style=filled, peripheries=0]; sdl_priority_input_from_right2 [shape=sdl_priority_input_from_right, label="sdl_priority_input_from_right ", peripheries=0]; sdl_priority_input_from_right -> sdl_priority_input_from_right2; sdl_priority_input_from_left [shape=sdl_priority_input_from_left, color=red, fillcolor=cyan, style=filled, peripheries=0]; sdl_priority_input_from_left2 [shape=sdl_priority_input_from_left, label=" sdl_priority_input_from_left", peripheries=0]; sdl_priority_input_from_left -> sdl_priority_input_from_left2; sdl_start [shape=sdl_start, color=red, fillcolor=cyan, style=filled, peripheries=0]; sdl_start2 [shape=sdl_start, label=" ", peripheries=0]; sdl_start -> sdl_start2; sdl_procedure_start [shape=sdl_procedure_start, color=red, fillcolor=cyan, style=filled, peripheries=0]; sdl_procedure_start2 [shape=sdl_procedure_start, label=" ", peripheries=0]; sdl_procedure_start -> sdl_procedure_start2; sdl_state [shape=sdl_state, color=red, fillcolor=cyan, style=filled, peripheries=0]; sdl_state2 [shape=sdl_state, peripheries=0]; sdl_state -> sdl_state2; sdl_output_to_right [shape=sdl_output_to_right, color=red, fillcolor=cyan, style=filled, peripheries=0]; sdl_output_to_right2 [shape=sdl_output_to_right, label="sdl_output_to_right ", peripheries=0]; sdl_output_to_right -> sdl_output_to_right2; sdl_output_to_left [shape=sdl_output_to_left, color=red, fillcolor=cyan, style=filled, peripheries=0]; sdl_output_to_left2 [shape=sdl_output_to_left, label=" sdl_output_to_left", peripheries=0]; sdl_output_to_left -> sdl_output_to_left2; sdl_condition [shape=sdl_condition, color=red, fillcolor=cyan, style=filled, peripheries=0]; sdl_condition2 [shape=sdl_condition, label=" sdl_condition ", peripheries=0]; sdl_condition -> sdl_condition2; sdl_save [shape=sdl_save, color=red, fillcolor=cyan, style=filled, peripheries=0]; sdl_save2 [shape=sdl_save, label=" sdl_save ", peripheries=0]; sdl_save -> sdl_save2; sdl_stop [shape=sdl_stop, peripheries=0]; sdl_stop2 [shape=sdl_stop, label="", peripheries=0]; sdl_stop -> sdl_stop2 [arrowhead=none, headclip=false]; sdl_return [shape=sdl_return, color=red, fillcolor=cyan, style=filled, peripheries=0]; sdl_return2 [shape=sdl_return, label="", peripheries=0]; sdl_return -> sdl_return2; sdl_create [shape=sdl_create, color=red, fillcolor=cyan, style=filled, peripheries=0]; sdl_create2 [shape=sdl_create, peripheries=0]; sdl_create -> sdl_create2; sdl_call [shape=sdl_call, color=red, fillcolor=cyan, style=filled, peripheries=0]; sdl_call2 [shape=sdl_call, label=" sdl_call ", peripheries=0]; sdl_call -> sdl_call2; sdl_text [shape=sdl_text, color=red, fillcolor=cyan, style=filled, peripheries=0]; sdl_text2 [shape=sdl_text, peripheries=0]; sdl_text -> sdl_text2; sdl_text_extension_from_left [shape=sdl_text_extension_from_left, color=red, fillcolor=cyan, style=filled, peripheries=0]; sdl_text_extension_from_left2 [shape=sdl_text_extension_from_left, peripheries=0]; sdl_text_extension_from_left -> sdl_text_extension_from_left2; sdl_text_extension_from_right [shape=sdl_text_extension_from_right, color=red, fillcolor=cyan, style=filled, peripheries=0]; sdl_text_extension_from_right2 [shape=sdl_text_extension_from_right, peripheries=0]; sdl_text_extension_from_right -> sdl_text_extension_from_right2; sdl_comment_from_left [shape=sdl_comment_from_left, color=red, fillcolor=cyan, style=filled, peripheries=0]; sdl_comment_from_left2 [shape=sdl_comment_from_left, style=dashed, peripheries=0]; sdl_comment_from_left -> sdl_comment_from_left2; sdl_comment_from_right [shape=sdl_comment_from_right, color=red, fillcolor=cyan, style=filled, peripheries=0]; sdl_comment_from_right2 [shape=sdl_comment_from_right, style=dashed, peripheries=0]; sdl_comment_from_right -> sdl_comment_from_right2; sdl_connector [shape=sdl_connector, color=red, fillcolor=cyan, style=filled, peripheries=0]; sdl_connector2 [shape=sdl_connector, peripheries=0]; sdl_connector -> sdl_connector2; sdl_set [shape=sdl_set, color=red, fillcolor=cyan, style=filled, peripheries=0]; sdl_set2 [shape=sdl_set, label=" sdl_set2", peripheries=0]; sdl_set -> sdl_set2; sdl_reset [shape=sdl_reset, color=red, fillcolor=cyan, style=filled, peripheries=0]; sdl_reset2 [shape=sdl_reset, label=" sdl_reset2", peripheries=0]; sdl_reset -> sdl_reset2; sdl_export [shape=sdl_export, color=red, fillcolor=cyan, style=filled, peripheries=0]; sdl_export2 [shape=sdl_export, label=" sdl_export", peripheries=0]; sdl_export -> sdl_export2; }ruby-graphviz-1.2.3/examples/hello.png0000644000004100000410000001326113111037426020006 0ustar www-datawww-dataPNG  IHDRFhLiCCPICC ProfilexTkA6n"Zkx"IYhE6bk Ed3In6&*Ezd/JZE(ޫ(b-nL~7}ov r4 Ril|Bj A4%UN$As{z[V{wwҶ@G*q Y<ߡ)t9Nyx+=Y"|@5-MS%@H8qR>׋infObN~N>! ?F?aĆ=5`5_M'Tq. VJp8dasZHOLn}&wVQygE0  HPEaP@<14r?#{2u$jtbDA{6=Q<("qCA*Oy\V;噹sM^|vWGyz?W15s-_̗)UKuZ17ߟl;=..s7VgjHUO^gc)1&v!.K `m)m$``/]?[xF QT*d4o(/lșmSqens}nk~8X<R5 vz)Ӗ9R,bRPCRR%eKUbvؙn9BħJeRR~NցoEx pHYs  iIDATxw]U)I @hHB E   ⠨* 8eq(8X@P@"&"R HHH *B wz}_ ogoO=gws}~k^zѢNscۨ7aCWrB9]$[K= @v"N g矃B\e9):v.CM]'`*l6F)E60P.Q |Ё(v5iIi!X ̠ `seG@7XK_.xmG@iS}&0,{&فA o <ۘ'HL ;MH5^X.Wov4Q65Q9*鲜 K\d_+ӵ&Y RRއAO|5+W QT^Byx0C pTn+]@x`Ч Gpp2@1:1m.Ӏ6~LJ>\'K@y= AaX4my)|\ REp<౔o(Ml@N#ŵ t4f_[`"('1.G=C{P5pRIm`$(oi5͞d3| p3~[ȪݵA12ee@].'Jmri Ttdb;g ;^db@5(ձSgŽ]1#8'RaS+%t0_ڛ vy V~<8|0 <|} %䶗P?>xx<$tru㌓|տoc,)84A\;9&\'}&"S_w7Q۔OdYQӇAK6Z|H5꠯//G*F=|iPgTtwvx$ 3 5POЧn24zIo6S/!; UzxG[z^4fL<:ppkB`,d(̕tr(WWX:8tp'PyЖ^}mj`¸%HOK[:787o0}&cFOkCdeQשx/zKbNB|{ZFOÓ8p47-Vz#lːYJ`OF;뀴X)6F3|ٛG-!:vW49kt0p8 B+FGydK<|FΧ9e`Ww;S2ʧ;~'6]u(|9@sL2KGd~mIZG֍vi`B݁xn$\ߌ~:>9֤\78&Oy*ya:ږ -I>Ǩ 8zM2@y^ˌm=]ΎЃ"H'eKۣ29j~{)min؞Nʹ +CYNR]bNc p%hB^>нiNAs2)ye/ő9oˊǀI |؂&7Tm[ᆰ/ۺu/gc~y;::lz ֺ\JۛkTt8;aSܝ!k7r;jHY`FQK!}͙ 즚< ܓ}]R0myRo77 _I6 Ɉ3gQ#3_u|dMk2H-4~GNAxATQk< 0~ x з=x;2U;05"@[=4Fd r† *?< .`NgR@`5M (01(ƙ.b#S,ہUlZ x*c<'_"`OqFp  hP0Ĕ/2ޣClGP,`i)0` (CAraHFctZf48MX@[@RqS}HPpw-Ɂ2:$)@_UcK8TWL}HS5Du^ ͱIx .u(4icXS+Uw(^\׍1m#1׋j\c Li˘@汌 Li˘@汌 Li˘@汌YSҪl]_}ʣ1/*+#D# ^LقoRm{ьϨhHJNqddE%|U6Jx?$kuhX鿲RH'l6BHCo%HޅN7gM#1*\ϫBFm>G30D%-&L6H}?.8eyNB8?H )VC.Џ}2a9Hl .|׿9wC4PYƌ2<xXd|Ã?G}ʾDr ̗~_y:JHKs~/DOq4T ]g_f` Yj- UR>xĆ76:mKOMnb~XQ P߁`'ΆA`oRKb0~ m ^ e_IDp>!Ȗ踨*:|Φ#@r>XqC/6mo.ziYQ>Aέr)xrسʺNPéZqJ֗eo,%m|2VgX8|\ėW~|4$$ۤ?ͺګr>MF ˟d [!I5҅`*cjo-о$@3,u$G?"0). tQ~8~&}6{H'7/׬_Q\7OnA'sCpͬz iaD6./I WLit,)hԺ&ND}_N<Sn^}Kcm"HVwmp) Nc,VUIu]Y1Tt)榨d` .#'7Sn~ |O=h*rg,t=+[ *1#RչT='b=y( -EpN|1HNNq9s sI QW߶zj]}E T92u..11ZJAg4a)EGeSu~m FBEsUʼ dP|I=DMNٴCiIԽSی욺uDUmf/ r%:QpXj!=!#̠r#Um*G}6ve60%b?qPv"Jd=&.l7vhj udz)tXu1zIݏY7l*bMB}T `3"Ӑy 8xYOn^vS`TF! 4v+0r1MEh!k* >,7.Go%<{K6ѰFj2p ,0r9|ܛ)z b$Ɍ \<>q'Bes@ZFg^ i+qS=Vte:D`6l 2VQv$$;cBs\nM)OK'b0^yw00K"XQ3q1*QNZgH2ERFUd"uwFuU ʺQT/a"5QIENDB`ruby-graphviz-1.2.3/examples/sample49.rb0000644000004100000410000000041313111037426020153 0ustar www-datawww-data# http://www.graphviz.org/Gallery/directed/hello.html # # digraph G {Hello->World} $:.unshift( "../lib" ); require "graphviz" GraphViz::new( :G, :type => :digraph ) { |g| g.world( :label => "World" ) << g.hello( :label => "Hello" ) }.output( :png => "#{$0}.png" )ruby-graphviz-1.2.3/examples/sample33.rb0000644000004100000410000000160013111037426020143 0ustar www-datawww-data$:.unshift( "../lib" ); require 'graphviz/family_tree' tree = GraphViz::FamilyTree.new do generation do abraham.is_a_man( "Abraham" ) mona.is_a_woman( "Mona" ) abraham.is_maried_with mona clancy.is_a_man( "Clancy" ) jackeline.is_a_woman( "Jackeline" ) clancy.is_maried_with jackeline end generation do herb.is_a_man( "Herb" ) homer.is_a_man( "Homer" ) marge.is_a_woman( "Marge" ) patty.is_a_woman( "Patty" ) selma.is_a_woman( "Selma" ) homer.is_maried_with marge end couple( abraham, mona ).kids( herb, homer ) couple( clancy, jackeline ).kids( marge, patty, selma ) generation do bart.is_a_boy( "Bart" ) lisa.is_a_girl( "Lisa" ) maggie.is_a_girl( "Maggie" ) ling.is_a_boy( "Ling" ) end couple( homer, marge ).kids( bart, lisa, maggie ) ling.kids( selma ) end puts tree.graph.save( :none => String ) ruby-graphviz-1.2.3/examples/sample73.rb0000644000004100000410000000070413111037426020153 0ustar www-datawww-data#!/usr/bin/ruby $:.unshift( "../lib" ) require "graphviz" g = nil if ARGV[0] g = GraphViz::new( "G", :path => ARGV[0] ) else g = GraphViz::new( "G" ) end g.add_nodes "HtmlOne", label: '<This is an
HTML Node>' g.add_nodes "HtmlTwo", label: 'an HTML node>' g.add_nodes "NotHtmlOne", label: '' g.add_nodes "NotHtmlTwo", label: 'this is not an HTML node, too!' g.output( :png => "#{$0}.png" ) ruby-graphviz-1.2.3/examples/sample25.rb0000644000004100000410000000042613111037426020151 0ustar www-datawww-data#!/usr/bin/ruby $:.unshift( "../lib" ); require "graphviz" GraphViz::new( "G" ) { |g| g.hello << g.world g.bonjour( :label => '"Bonjour"' ) - g.monde( :label => "Le\nmonde") g.hola > g.mundo g.holla >> g.welt }.output( :path => "/usr/local/bin", :png => "#{$0}.png" ) ruby-graphviz-1.2.3/examples/sample62.rb0000644000004100000410000000111213111037426020143 0ustar www-datawww-data#!/usr/bin/ruby $:.unshift( "../lib" ); require "graphviz" hello_world = GraphViz::new( "" ) hello = hello_world.add_nodes("Hello") world = hello_world.add_nodes("World") hello_world.add_edges(hello, world) # final_graph = GraphViz.parse_string( hello_world.output( :dot => String ) ) # final_graph.each_node do |_, node| # puts "Node #{node.id} : position = #{node[:pos]}" # end hello_world = hello_world.complete hello_world.each_node do |_, node| puts "Node #{node.id} : position = " ; p node[:pos].point end puts "---------" puts hello_world.output( :canon => String ) ruby-graphviz-1.2.3/examples/sample03.rb0000644000004100000410000000146513111037426020151 0ustar www-datawww-data#!/usr/bin/ruby $:.unshift( "../lib" ); require "graphviz" g = nil if ARGV[0] g = GraphViz::new( "G", "path" => ARGV[0] ) else g = GraphViz::new( "G" ) end g.node["shape"] = "ellipse" g.node["sides"] = "4" g.node["peripheries"] = "" g.node["color"] = "black" g.node["style"] = "" g.node["skew"] = "0.0" g.node["distortion"] = "0.0" a = g.add_nodes( "a", "shape" => "polygon", "sides" => "5", "peripheries" => "3", "color" => "lightblue", "style" => "filled" ) b = g.add_nodes( "b" ) c = g.add_nodes( "c", "shape" => "polygon", "sides" => "4", "skew" => ".4", "label" => "hello world" ) d = g.add_nodes( "d", "shape" => "invtriangle" ) e = g.add_nodes( "e", "shape" => "polygon", "sides" => "4", "distortion" => ".7" ) g.add_edges( a, b ) g.add_edges( b, c ) g.add_edges( b, d ) g.output( :png => "#{$0}.png" ) ruby-graphviz-1.2.3/examples/sample51.rb0000644000004100000410000000137113111037426020150 0ustar www-datawww-data# http://www.graphviz.org/Gallery/undirected/process.html # # graph G { # run -- intr; # intr -- runbl; # runbl -- run; # run -- kernel; # kernel -- zombie; # kernel -- sleep; # kernel -- runmem; # sleep -- swap; # swap -- runswap; # runswap -- new; # runswap -- runmem; # new -- runmem; # sleep -- runmem; # } $:.unshift( "../../lib" ); require "graphviz" GraphViz::new( :G, :type => :graph ) { |g| g._new[:label] = "new" g.run << g.intr g.intr << g.runbl g.runbl << g.run g.run << g.kernel g.kernel << g.zombie g.kernel << g.sleep g.kernel << g.runmem g.sleep << g.swap g.swap << g.runswap g.runswap << g._new g.runswap << g.runmem g._new << g.runmem g.sleep << g.runmem }.output( :png => "#{$0}.png", :use => :fdp )ruby-graphviz-1.2.3/examples/theory/0000755000004100000410000000000013111037426017504 5ustar www-datawww-dataruby-graphviz-1.2.3/examples/theory/tests.rb0000644000004100000410000000372313111037426021200 0ustar www-datawww-data$:.unshift( "../../lib" ) require 'graphviz' require 'graphviz/theory' g = GraphViz.digraph( "G", :path => "/usr/local/bin" ) do |g| g.a[:label => "1"] g.b[:label => "2"] g.c[:label => "3"] g.d[:label => "4"] g.e[:label => "5"] g.f[:label => "6"] # g.a << g.a g.a << g.b g.a << g.d (g.a << g.f)[:weight => 6, :label => "6"] g.b << g.c g.b << g.d g.b << g.e g.c << g.d (g.c << g.f)[:weight => 2, :label => "2"] g.d << g.e # g.e << g.c end g.output( :png => "matrix.png" ) t = GraphViz::Theory.new( g ) puts "Adjancy matrix : " puts t.adjancy_matrix # => [ 0 1 0 1 0 1] # [ 0 0 1 1 1 0] # [ 0 0 0 1 0 1] # [ 0 0 0 0 1 0] # [ 0 0 0 0 0 0] # [ 0 0 0 0 0 0] puts "Symmetric ? #{t.symmetric?}" puts "Incidence matrix :" puts t.incidence_matrix # => [ 1 1 1 0 0 0 0 0 0] # [ -1 0 0 1 1 1 0 0 0] # [ 0 0 0 -1 0 0 1 1 0] # [ 0 -1 0 0 -1 0 -1 0 1] # [ 0 0 0 0 0 -1 0 0 -1] # [ 0 0 -1 0 0 0 0 -1 0] g.each_node do |name, node| puts "Degree of node `#{name}' = #{t.degree(node)}" print "neighbors : "; p t.neighbors(name).map{ |e| e.id } # = node.neighbors.map { |e| e.id } print "incidents : "; p t.incidents(name).map{ |e| e.id } # = node.incidents.map { |e| e.id } end puts "Laplacian matrix :" puts t.laplacian_matrix # => [ 3 -1 0 -1 0 -1] # [ 0 4 -1 -1 -1 0] # [ 0 0 3 -1 0 -1] # [ 0 0 0 4 -1 0] # [ 0 0 0 0 2 0] # [ 0 0 0 0 0 2] puts "Dijkstra between a and f" r = t.moore_dijkstra(g.a, g.f) if r.nil? puts "No way !" else print "\tPath : "; p r[:path] puts "\tDistance : #{r[:distance]}" end # => Path : ["a", "b", "c", "f"] # Distance : 4.0 print "Ranges : " rr = t.range p rr puts "Your graph contains circuits" if rr.include?(nil) puts "Critical path : " rrr = t.critical_path print "\tPath "; p rrr[:path] puts "\tDistance : #{rrr[:distance]}" t.pagerank.each { |node, rank| puts "Pagerank for node #{node.id} = #{rank}" } ruby-graphviz-1.2.3/examples/theory/pert.rb0000644000004100000410000000251313111037426021004 0ustar www-datawww-data$:.unshift( "../../lib" ) require 'graphviz' require 'graphviz/theory' g = GraphViz.digraph( "G", :path => "/usr/local/bin", :use => "fdp" ) do |g| g.node[:shape => "record"] g.start[:label => "Start"] g.task_1[:label => "Task #1 - Duration : 4d"] g.task_2[:label => "Task #2 - Duration : 5.25d"] g.task_3[:label => "Task #3 - Duration : 5.17d"] g.task_4[:label => "Task #4 - Duration : 6.33d"] g.task_5[:label => "Task #5 - Duration : 5.17d"] g.task_6[:label => "Task #6 - Duration : 4.5d"] g.task_7[:label => "Task #7 - Duration : 5.17d"] g.finish[:label => "End"] (g.start << g.task_1)[:weight => 0.0] (g.start << g.task_2)[:weight => 0.0] (g.task_1 << g.task_3)[:weight => 4.0] (g.task_1 << g.task_4)[:weight => 4.0] (g.task_2 << g.task_5)[:weight => 5.25] (g.task_3 << g.task_5)[:weight => 5.17] (g.task_4 << g.task_6)[:weight => 6.33] (g.task_5 << g.task_7)[:weight => 5.17] (g.task_6 << g.finish)[:weight => 4.5] (g.task_7 << g.finish)[:weight => 5.17] end g.output( :png => "PERT.png" ) t = GraphViz::Theory.new( g ) print "Ranges : " rr = t.range p rr puts "Your graph contains circuits" if rr.include?(nil) puts "Critical path : " rrr = t.critical_path print "\tPath :" _ = "" rrr[:path].each do |i| print _ + g.get_node_at_index(i-1).id _ = " -> " end puts puts "\tDistance : #{rrr[:distance]}"ruby-graphviz-1.2.3/examples/sample60.rb0000644000004100000410000000031613111037426020146 0ustar www-datawww-data#!/usr/bin/ruby $:.unshift( "../lib" ); require "graphviz" asm = GraphViz::new( "My ASM" ) my = asm.add_nodes("My") asmn = asm.add_nodes("ASM") asm.add_edges(my, asmn) asm.output( :png => "#{$0}.png" ) ruby-graphviz-1.2.3/examples/sample55.rb0000644000004100000410000000052213111037426020151 0ustar www-datawww-data$:.unshift( "../lib" ) require 'graphviz' puts GraphViz.graph( :G ) { |g| g[:label] = "<This is a test>" n1 = g.add_nodes( "N1", :label => '<node 1>') n2 = g.add_nodes( "N2", :label => '<node 2>') g.add_edges( n1, n2, :label => '<edge>') }.output( :png => "#{$0}.png", :none => String ) ruby-graphviz-1.2.3/examples/sample04.rb0000644000004100000410000000114113111037426020141 0ustar www-datawww-data#!/usr/bin/ruby $:.unshift( "../lib" ); require "graphviz" g = nil if ARGV[0] g = GraphViz::new( "structs", "path" => ARGV[0] ) else g = GraphViz::new( "structs" ) end g.node["shape"] = "record" struct1 = g.add_nodes( "struct1", "shape" => "record", "label" => " left| mid\ dle| right" ) struct2 = g.add_nodes( "struct2", "shape" => "record", "label" => " one| two" ) struct3 = g.add_nodes( "struct3", "shape" => "record", "label" => 'hello\nworld |{ b |{c| d|e}| f}| g | h' ) g.add_edges( struct1, struct2 ) g.add_edges( struct1, struct3 ) g.output( :png => "#{$0}.png" ) ruby-graphviz-1.2.3/examples/sample14.rb0000644000004100000410000000215613111037426020151 0ustar www-datawww-data#!/usr/bin/ruby $:.unshift( "../lib" ); require "graphviz" GraphViz::new( "G" ) { |graph| graph.node[:shape] = "ellipse" graph.node[:color] = "black" graph[:color] = "black" graph.cluster0( ) do |cluster| cluster[:label] = "process #1" cluster[:style] = "filled" cluster[:color] = "lightgrey" cluster.node[:style] = "filled" cluster.node[:color] = "white" cluster.a0 << cluster.a1 cluster.a1 << cluster.a2 cluster.a2 << cluster.a3 end graph.cluster1( :label => "process #2", :color => "blue" ) do |cluster| cluster.node[:style] = "filled" cluster.node[:color] = "lightgrey" cluster.b0 << cluster.b1 cluster.b1 << cluster.b2 cluster.b2 << cluster.b3 end graph.start :shape => "Mdiamond" graph.endn :shape => "Msquare", :label => "end" graph.start << graph.cluster0.a0 graph.start << graph.cluster1.b0 graph.cluster0.a1 << graph.cluster1.b3 graph.cluster1.b2 << graph.cluster0.a3 graph.cluster0.a3 << graph.cluster0.a0 graph.cluster0.a3 << graph.endn graph.cluster1.b3 << graph.endn }.output( :path => '/usr/local/bin/', :png => "#{$0}.png" )ruby-graphviz-1.2.3/CHANGELOG.rdoc0000644000004100000410000002604113111037426016517 0ustar www-datawww-data= CHANGELOG == 1.1.0 : * Issue #61 : Combine graphviz instances * Issue #73 : Avoid constructing shell commands as strings * Bug correction with development dependencies on JRuby == 1.0.9 : * Add support for attributs * forcelabels * gradientangle * imagepath * layerlistsep * layerselect * Issue #52 : Extracted xDOTScript to DOTScript class (by markus1189) * Issue #54 : Fixes a couple of typos and spacing (by Mike Fiedler) * Issue #55 : Avoid autoload * Issue #57 : Add man pages for the commandline programs (by Praveen Arimbrathodiyil) * Issue #59 : Support label as Fixnum (by Gabe Kopley) * Issue #62 : Remove warnings (by Kenichi Kamiya) * Issue #63 : Fix typo (by Kenichi Kamiya) * Issue #65 : ruby-graphviz breaks autoloading of ActiveSupport::Concerns * Update graphviz attributs == 1.0.8 : * Cleanup format (by markus1189) * Issue #49 : (undefined local variable or method `file' ) (by markus1189) == 1.0.7 : * Issue #48 : add_graph fails when passed a GraphViz object * Issue #47 : Find executable (by markus1189) == 1.0.6 : * Issue #46 : Some tests fail because it cannot find 'dot' * Issue #45 : Fix for copy/paste error (by coding46) * Issue #44 : characters escaping (by Neven Has) * Issue #43 : Added lib/ruby-graphviz to match the gem name (by Postmodern) * Issue #42 : "escaped dot in label" aka "GVPR error in Dot2Ruby" * Issue #40 : GraphML importation doesn't work... * Bug correction (with Ruby 1.8) * Add (experimental) support of LibXML/LibXSLT == 1.0.5 : * Change deprecated methods in gem2gv, git2gv and ruby2gv * Issue #38 * Issue #39 == 1.0.4 : * GraphViz::Edge#each_attribut is deprecated, please use GraphViz::Edge#each_attribute * GraphViz::GraphML#attributs is deprecated, please, use GraphViz::GraphML#attributes * GraphViz::Node#each_attribut is deprecated, please use GraphViz::Node#each_attribute * Major bug correction in GraphViz::Attrs and GraphViz::parse * An empty string means "false" for boolean attributes == 1.0.3 : * The GraphViz::Theory#moore_dijkstra return a path which contains GraphViz::Node instead of GraphViz::Node#id * Add Breadth First Search algorithm (GraphViz::Theory#bfs) * Add Depth First Search algorithm (GraphViz::Theory#dfs) * Add GraphViz#add_edges (GraphViz#add_edge is deprecated) * Add GraphViz#add_nodes (GraphViz#add_node is deprecated) * Add GraphViz::generate * Remove definition of Array#all? == 1.0.2 : * Add PageRank algorithm * Major bug corrections * Fix utils/colors.rb's case syntax * Modify deprecated method: Hash#index to Hash#key == 1.0.1 : * Add GraphViz::DSL * Change project to use Bundler gem tools * Fix a few typos in the README * Change Config to RbConfig * Add possibility to get the x,y coordinates of each of the nodes == 1.0.0 : * \o/ * GraphViz::Node#name has been removed - use GraphViz::Node#id * The html attribute has been removed - use a label attribut (:label => '<>') * :output option has been removed - use : => : * :file option has been removed - use : => : * Add GraphViz#to_s * Add GraphViz#add (see sample59.rb) * GraphViz::XML.output is deprecated, use GraphViz::XML.graph.output * Issue #22 : Error when generating a graph with an ID containing a space. == 0.9.21 : * Add attributes "label_scheme" and "rotation" * Add missing options : * :scale => v : Scale input by 'v' (=72) * :inverty => [true|false] : Invert y coordinate in output * :no_layout => v : No layout mode 'v' (=1) -- neato only * :reduce => [true|false] : Reduce graph -- neato only * :Lg => [true|false] : Don't use grid -- fdp only * :LO => [true|false] : Use old attractive force -- fdp only * :Ln => i : Set number of iterations to i -- fdp only * :LU => i : Set unscaled factor to i -- fdp only * :LC => v : Set overlap expansion factor to v -- fdp only * :LT => [*]v : Set temperature (temperature factor) to v -- fdp only == 0.9.20 : * Add GraphViz#each_attribut, Node#each_attribut and Edge#each_attribut * Bugs corrections in tests (by oupo) * Major bug correction in GraphViz#output for subgraphs * Update GraphViz.escape == 0.9.19 : * Add strict digraph support (by Jonas Elfström) (see sample58.rb) g = GraphViz.new(:G, :type => "strict digraph") # or g = GraphViz.new(:G, :type => "digraph", :strict => true) # or g = GraphViz.digraph(:G, :strict => true) # or g = GraphViz.strict_digraph(:G) * Add GraphViz#root_graph, Node#root_graph, Edge#root_graph * The GraphML parser now accept a graphml file or string == 0.9.18 : * JRuby bug correction (by Nigel Thorne) * Fix autoload problem for Rubinius (by Rolf Timmermans) * Bugs corrections == 0.9.17 : * GraphViz::Edge#node_one and GraphViz::Edge#node_one now have un optional parameter to indicate if you want to (or not) get the port in the name (default: true) * GraphViz#each_node now returns the Hash of nodes if there is no block given. * GraphViz#each_edge now returns the list of edges if there is no block given. * GraphViz#each_graph now returns the Hash of graphs if there is no block given. * Add GraphViz::Node#index : return the node index * Add GraphViz::Edge#index : return the edge index * Add GraphViz#type : return the graph type (graph or digraph) * Add GraphViz#get_edge_at_index and GraphViz#get_node_at_index * Add GvDouble * Add GraphViz::Theory (see examples/theory/tests.rb) * Add GraphML[http://graphml.graphdrawing.org/] support (see sample57.rb) * fixed "edge attribut 'to_ary' invalid" on mri 1.9.2 (by Stefan Huber) == 0.9.16 : * Add xml2gv * Rename GraphViz.parser2 to GraphViz.parser * Remove treetop dependency * Ruby 1.9 (and MacRuby) compatibility -- Issue #12: see sample38.rb * Add GraphViz::Attrs#each and GraphViz::Attrs#to_h * Add GraphViz::Edge#node_one and GraphViz::Edge#node_two == 0.9.15 : * Add GraphViz.parser2. WARNING this method will replace GraphViz.parser. So please don't use it, or only for testing. * Bug correction in dot2ruby * Add --output-format option to dot2ruby * Add git2gv * Issue #16 : escape graph ID == 0.9.14 : * Add dot2ruby script * Remove NULL character in the DOT script * WARNING : FamilyTree is (still) broken in this version ! == 0.9.13 : * Add dot2ruby.g * Bug correction with HTML label * The html attribut is deprecated. You can use the label attribut, as dot do it : :label => '<>' * Issue #15 : Thin server * WARNING : FamilyTree is (still) broken in this version ! == 0.9.12 : * GraphViz::Node#name is deprecated, you must use GraphViz::Node#id (issue #14) * Add :nothugly option to GraphViz#output (see sample41.rb and http://hokstad.com/making-graphviz-output-pretty-with-xsl) * Issue #13 : you must now specify a port in GraphViz::Edge.new with a syntax like this : GraphViz::Edge.new( {nodeOne => :port}, {nodeTwo => :other} ) * Issue #12 : UTF8 support (see sample38.rb) * Move and rename examples + remove maketest.[sh|bat] * WARNING : FamilyTree is broken in this version ! == 0.9.11 : * Issue #11 : Cygwin PATH * Major bugs correction in output * Bug correction in find_executable * Add tests (by Chip Malice : https://github.com/hipe) == 0.9.10 : * Move ChangeLog in README * Add GraphViz::FamilyTree (alpha). See examples/sample33.rb * Major bugs corrections in GraphViz::Parser * Issue #10 : Anonymous graph (see Subgraphs and Clusters at http://www.graphviz.org/doc/info/lang.html). See examples/sample34.rb * GraphViz#add_graph can now take a block parameter. See example/sample34.rb * Add GraphViz.digraph and GraphViz.graph (same as GraphViz.new( ..., :type => "digraph" ) and GraphViz.new( ..., :type => "graph" )). See examples/sample35.rb * Add GraphViz#subgraph. See examples/sample35.rb * GraphViz::Parser support anonymous graph * Add lage node example. See examples/sample36.rb == 0.9.9 : * Add graph as an accessor to allow you to set global graph attributs (like edge and node) * Add each_node, each_edge, each_graph (thanks to @metellius) and graph_count * Issue #9 (partial) - Solution : by default, a node will have his label set with the node ID) == 0.9.8 : * Update graph and node posibility to set properties (see sample28.rb) * Issue #7: Path option is never being used to find the executable * Adding classes to check if the attributes are in the correct type * Issue #8: dots in href are escaped with backslash, which corrupts the URL (see sample29.rb) * Add posibility to use external libraries (see sample30.rb) * Add options -u and -s to ruby2gv * Add gem2gv == 0.9.7 : * Issue #2: Small bug correction in escape_path_containing_blanks (by Andreas Ronge) * Issue #4: New find_executable (by reactive) * Issue #3: Tempfiles created in current working directory only in Windows * Issue #6: Respect "none" format in output options hash and respect String output-filename when the "none" format is selected. See examples/sample27.rb (by Dave Burt) == 0.9.6 : * jRuby support (by obruening) * Issue #1 : STDOUT in binmode == 0.9.5 : * Remove 'mkmf' dependency * GraphViz::Edge#[] modification * Small correction to escape the dot ('.') character (by Miguel Cabrera) == 0.9.4 : * Escape nodes and edges attributs * GraphViz::escape corrections (by Dave Burt) * Add :errors option to set level of message suppression (default : suppress warning messages) == 0.9.3 : * Minor bug correction for Windows * Use Open3.popen3 if installed, else use IO.popen (by Dave Burt) * Add '-', '>' and '>>' has aliases of '<<' to create an edge. == 0.9.2 : * Escape nodes (by Dave Burt) * Handle errors from graphviz command (by Dave Burt) * Output as string (if String class is passed as file i.e. output(:pdf => String)) (by Dave Burt) == 0.9.1 : * Bugs corrections * Add the ability to create edge like that : node1 << node2 << node3 ... * Complete README * Add a DOT parser. This parser has a lot of limitations. So don't use it in a production context ! * :output and :file options are deprecated, please use : => : * You can now specify multiple outputs via : => : (see sample 22). == 0.9.0 : * Add fdp example (sample 15) * Add edge between cluster and node and cluster and cluster support * GraphViz.add_node now support array (sample 16) * Bug correction in GraphViz.output (sample 19) * Add GraphViz#default to set default options (:use, :path and :output) * Add possibility to set node or edge attribut via : node.= or node.( ) edge.= or edge.( ) * Add GraphViz::Edge.set and GraphViz::Node.set * Add sample 20 * Add GraphViz.node_count and GraphViz.edge_count by Daniel Cadenas Nión == 0.8.2 : * Update Node, Edge and Graph Attributes (see http://www.graphviz.org/doc/info/attrs.html) * Bugs corrections == 0.8.1 : * Documentation == 0.8.0 : * Add all the features of the current graphviz version == 0.7.0 : * Add option "path" to output == 0.6.0 : * Add undirected graph support == 0.5.0 : * Preserve the original order of creation of nodes and edges == 0.4.0 : * Add HTML-Labels == 0.3.0 : * Bugs corrections == 0.2.0 : * Pure ruby == 0.1.0 : * Initial version ruby-graphviz-1.2.3/README.rdoc0000644000004100000410000001330713111037426016166 0ustar www-datawww-data= Ruby/GraphViz {}[https://travis-ci.org/glejeune/Ruby-Graphviz] {Gem Version}[https://rubygems.org/gems/ruby-graphviz] Copyright (C) 2004-2014 Gregoire Lejeune * Doc : http://rdoc.info/projects/glejeune/Ruby-Graphviz * Sources : https://github.com/glejeune/Ruby-Graphviz * On Rubygems: https://rubygems.org/gems/ruby-graphviz * NEW - Mailing List : https://groups.google.com/forum/#!forum/ruby-graphviz == DESCRIPTION Interface to the GraphViz graphing tool == TODO * New FamilyTree == SYNOPSIS A basic example require 'graphviz' # Create a new graph g = GraphViz.new( :G, :type => :digraph ) # Create two nodes hello = g.add_nodes( "Hello" ) world = g.add_nodes( "World" ) # Create an edge between the two nodes g.add_edges( hello, world ) # Generate output image g.output( :png => "hello_world.png" ) The same but with a block require 'graphviz' GraphViz::new( :G, :type => :digraph ) { |g| g.world( :label => "World" ) << g.hello( :label => "Hello" ) }.output( :png => "hello_world.png" ) Or with the DSL require 'graphviz/dsl' digraph :G do world[:label => "World"] << hello[:label => "Hello"] output :png => "hello_world.png" end Create a graph from a file require 'graphviz' # In this example, hello.dot is : # digraph G {Hello->World;} GraphViz.parse( "hello.dot", :path => "/usr/local/bin" ) { |g| g.get_node("Hello") { |n| n[:label] = "Bonjour" } g.get_node("World") { |n| n[:label] = "Le Monde" } }.output(:png => "sample.png") GraphML[http://graphml.graphdrawing.org/] support require 'graphviz/graphml' g = GraphViz::GraphML.new( "graphml/cluster.graphml" ) g.graph.output( :path => "/usr/local/bin", :png => "#{$0}.png" ) == TOOLS Ruby/GraphViz also includes : * ruby2gv, a simple tool that allows you to create a dependency graph from a ruby script. Example : http://drp.ly/dShaZ ruby2gv -Tpng -oruby2gv.png ruby2gv * gem2gv, a tool that allows you to create a dependency graph between gems. Example : http://drp.ly/dSj9Y gem2gv -Tpng -oruby-graphviz.png ruby-graphviz * dot2ruby, a tool that allows you to create a ruby script from a graphviz script $ cat hello.dot digraph G {Hello->World;} $ dot2ruby hello.dot # This code was generated by dot2ruby.g require 'rubygems' require 'graphviz' graph_g = GraphViz.digraph( "G" ) { |graph_g| graph_g[:bb] = '0,0,70,108' node_hello = graph_g.add_nodes( "Hello", :height => '0.5', :label => '\N', :pos => '35,90', :width => '0.88889' ) graph_g.add_edges( "Hello", "World", :pos => 'e,35,36.413 35,71.831 35,64.131 35,54.974 35,46.417' ) node_world = graph_g.add_nodes( "World", :height => '0.5', :label => '\N', :pos => '35,18', :width => '0.97222' ) } puts graph_g.output( :canon => String ) * git2gv, a tool that allows you to show your git commits * xml2gv, a tool that allows you to show a xml file as graph. == GRAPH THEORY require 'graphviz' require 'graphviz/theory' g = GraphViz.new( :G ) { ... } t = GraphViz::Theory.new( g ) puts "Adjancy matrix : " puts t.adjancy_matrix puts "Symmetric ? #{t.symmetric?}" puts "Incidence matrix :" puts t.incidence_matrix g.each_node do |name, node| puts "Degree of node `#{name}' = #{t.degree(node)}" end puts "Laplacian matrix :" puts t.laplacian_matrix puts "Dijkstra between a and f" r = t.moore_dijkstra(g.a, g.f) if r.nil? puts "No way !" else print "\tPath : "; p r[:path] puts "\tDistance : #{r[:distance]}" end print "Ranges : " rr = t.range p rr puts "Your graph contains circuits" if rr.include?(nil) puts "Critical path : " rrr = t.critical_path print "\tPath "; p rrr[:path] puts "\tDistance : #{rrr[:distance]}" == INSTALLATION sudo gem install ruby-graphviz You also need to install GraphViz[http://www.graphviz.org] On *Windows* you also need to install win32-open3. This is not an absolute requirement. == LICENCES === Ruby/GraphViz Ruby/GraphViz is freely distributable according to the terms of the GNU General Public License (see the file 'COPYING'). This program is distributed without any warranty. See the file 'COPYING' for details. GNU General Public Licence: https://en.wikipedia.org/wiki/Gpl === nothugly.xsl By Vidar Hokstad and Ryan Shea; Contributions by Jonas Tingborn, Earl Cummings, Michael Kennedy (Graphviz 2.20.2 compatibility, bug fixes, testing, lots of gradients) Copyright (c) 2009 Vidar Hokstad Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. MIT license: https://en.wikipedia.org/wiki/MIT_License ruby-graphviz-1.2.3/.travis.yml0000644000004100000410000000102213111037426016460 0ustar www-datawww-data# Need sudo to install rubinius-3.69 sudo: required # The binary for rubinius-3.69 is not available for # ubuntu/12.04 (Precise Pangolin) but is for ubuntu/14.04 (Trusty Tahr) # # See: # - https://rubinius-binaries-rubinius-com.s3-us-west-2.amazonaws.com/ # - "Rubinius no longer supports Precise. Please use Trusty." # https://docs.travis-ci.com/user/languages/ruby/#Supported-Ruby-Versions-and-RVM # # Note: travis-ci uses precise by default dist: trusty rvm: - 2.0.0 - 2.1.2 - 2.4.0 - jruby - rubinius-3.69 ruby-graphviz-1.2.3/lib/0000755000004100000410000000000013111037426015122 5ustar www-datawww-dataruby-graphviz-1.2.3/lib/ruby-graphviz.rb0000644000004100000410000000002313111037426020253 0ustar www-datawww-datarequire 'graphviz' ruby-graphviz-1.2.3/lib/graphviz/0000755000004100000410000000000013111037426016754 5ustar www-datawww-dataruby-graphviz-1.2.3/lib/graphviz/core_ext.rb0000644000004100000410000000320713111037426021113 0ustar www-datawww-dataclass String def self.random(size) s = "" d = ("a".."z").to_a + ("A".."Z").to_a + ("0".."9").to_a size.times { s << d[rand(d.size)] } return s end def convert_base(from, to) self.to_i(from).to_s(to) end end class Object def to_ruby begin eval self rescue self end end end # From : http://www.geekmade.co.uk/2008/09/ruby-tip-normalizing-hash-keys-as-symbols/ class Hash def symbolize_keys inject({}) do |options, (key, value)| options[(key.to_sym rescue key) || key] = value options end end # x = { # :none => String, # :png => "file.png", # :svg => "file.svg" # } # # x.each_except( :key => [:none], :value => [/\.png$/] ) do |k, v| # puts "#{k} -> #{v}" # end # # => svg -> file.svg def each_except( e, &b ) key_table = (e[:key]||[]).clone.delete_if {|i| i.kind_of? Regexp } key_regexp = (e[:key]||[]).clone.delete_if {|i| key_table.include? i }.map {|i| i.to_s }.join("|") value_table = (e[:value]||[]).clone.delete_if {|i| i.kind_of? Regexp } value_regexp = (e[:value]||[]).clone.delete_if {|i| value_table.include? i }.map {|i| i.to_s }.join("|") self.each do |k, v| yield( k, v ) unless (key_table.size > 0 and key_table.include?(k)) or (key_regexp.size > 0 and k.to_s.match(key_regexp)) or (value_table.size > 0 and value_table.include?(v)) or (value_regexp.size > 0 and v.to_s.match(value_regexp)) end end unless self.method_defined? :key # Add Hash#key to Ruby < 1.9 def key(v) index(v) end end end ruby-graphviz-1.2.3/lib/graphviz/nothugly.rb0000644000004100000410000000355313111037426021160 0ustar www-datawww-data# This file use notugly.xsl: An XSL transform to pretty up the SVG output from Graphviz # # See: http://hokstad.com/making-graphviz-output-pretty-with-xsl # And: http://hokstad.com/making-graphviz-output-pretty-with-xsl-updated # # By Vidar Hokstad and Ryan Shea; Contributions by Jonas Tingborn, # Earl Cummings, Michael Kennedy (Graphviz 2.20.2 compatibility, bug fixes, # testing, lots of gradients) require 'rubygems' begin require 'xml/xslt' XSLT_METHOD = :xml_xslt_transform rescue LoadError => e require 'libxml' require 'libxslt' XSLT_METHOD = :libxslt_transform end class GraphViz # Transform to pretty up the SVG output # # For more information, see http://hokstad.com/making-graphviz-output-pretty-with-xsl # and http://hokstad.com/making-graphviz-output-pretty-with-xsl-updated # # You can use the :nothugly option to GraphViz#output : # # graph.output( :svg => "myGraph.svg", :nothugly => true ) # # Or directly on an SVG output graph : # # GraphViz.nothugly( "myGraph.svg" ) def self.nothugly( file, save = true ) xsl = File.join( File.dirname(File.expand_path(__FILE__)), "nothugly", "nothugly.xsl" ) out = self.send(XSLT_METHOD, file, xsl) if save fname = File.join( File.dirname(File.expand_path(file)), File.basename(file)) File.open( fname, "w" ) { |io| io.print out } else return out end end def self.xml_xslt_transform(xml, xsl) xslt = XML::XSLT.new() xslt.xml = xml xslt.xsl = xsl xslt.serve() end def self.libxslt_transform(xml, xsl) LibXML::XML.default_load_external_dtd = false LibXML::XML.default_substitute_entities = false stylesheet_doc = LibXML::XML::Document.file(xsl) stylesheet = LibXSLT::XSLT::Stylesheet.new(stylesheet_doc) xml_doc = LibXML::XML::Document.file(xml) stylesheet.apply(xml_doc).to_s end end ruby-graphviz-1.2.3/lib/graphviz/utils.rb0000644000004100000410000000472213111037426020446 0ustar www-datawww-datarequire 'rbconfig' class GraphViz module Utils # Since this code is an adaptation of Launchy::Application#find_executable # (http://copiousfreetime.rubyforge.org/launchy/Launchy/Application.html) # it follow is licence : # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED AS IS AND THE AUTHOR DISCLAIMS ALL WARRANTIES # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY # SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION # OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN # CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. def find_executable(bin, custom_paths) #:nodoc: system_path = ENV['PATH'] user_given_path = Array(custom_paths).join(File::PATH_SEPARATOR) search_path = system_path + File::PATH_SEPARATOR + user_given_path search_path.split(File::PATH_SEPARATOR).each do |path| file_path = File.join(path,bin) return file_path if File.executable?(file_path) and File.file?(file_path) if RbConfig::CONFIG['host_os'] =~ /mswin|mingw/ # WAS: elsif RUBY_PLATFORM =~ /mswin|mingw/ found_ext = (ENV['PATHEXT'] || '.exe;.bat;.com').split(";").find {|ext| File.executable?(file_path + ext) } return file_path + found_ext if found_ext end end return nil end def output_and_errors_from_command(cmd) #:nodoc: unless defined? Open3 begin require 'open3' require 'win32/open3' rescue LoadError end end begin out, err, status = Open3.capture3(*cmd, :binmode => true) [out, err, status.exitstatus] rescue NotImplementedError, NoMethodError IO.popen( *cmd ) do |stdout| stdout.binmode [stdout.read, nil, nil] end end end def output_from_command(cmd) #:nodoc: output, errors, status = output_and_errors_from_command(cmd) if (status.nil? && (errors.nil? || errors.strip.empty?)) || status.zero? output else raise "Error from #{cmd}:\n#{errors}" end end end end ruby-graphviz-1.2.3/lib/graphviz/family_tree/0000755000004100000410000000000013111037426021254 5ustar www-datawww-dataruby-graphviz-1.2.3/lib/graphviz/family_tree/generation.rb0000644000004100000410000000144713111037426023742 0ustar www-datawww-dataclass GraphViz class FamilyTree class Generation def initialize( graph, persons, tree, gen_number ) #:nodoc: @graph = graph @all_persons = persons @persons = {} @tree = tree @gen_number = gen_number end def all_persons #:nodoc: @all_persons end def persons @persons end def make( &block ) #:nodoc: instance_eval(&block) if block end def method_missing(sym, *args, &block) #:nodoc: all_persons[sym.to_s] ||= (persons[sym.to_s] ||= GraphViz::FamilyTree::Person.new( @graph, @tree, self, sym.to_s )) end # Generation number def number @gen_number end # Generation size def size @persons.size end end end end ruby-graphviz-1.2.3/lib/graphviz/family_tree/person.rb0000644000004100000410000000564613111037426023122 0ustar www-datawww-datarequire 'rubygems' require 'graphviz' class GraphViz class FamilyTree class Person def initialize( graph, tree, generation, id ) #:nodoc: @graph = graph @node = @graph.add_nodes( id ) @node["shape"] = "box" @tree = tree @generation = generation @x, @y = 0, 0 @sibling = nil end def id @node.id end def name @node.label || @node.id end def sibling @sibling end def sibling=(x) @sibling=x end def couples #:nodoc: @couples end def node #:nodoc: @node end # Define the current person as a man # # greg.is_a_man( "Greg" ) def is_a_man( name ) @node["label"] = name @node["color"] = "blue" end # Define the current person as a boy # # greg.is_a_boy( "Greg" ) def is_a_boy( name ) is_a_man( name ) end # Define the current perdon as a woman # # mu.is_a_woman( "Muriel" ) def is_a_woman( name ) @node["label"] = name @node["color"] = "pink" end # Define the current perdon as a girl # # maia.is_a_girl( "Maia" ) def is_a_girl( name ) is_a_woman( name ) end # Define that's two persons are maried # # mu.is_maried_with greg def is_maried_with( x ) node = @graph.add_nodes( "#{@node.id}And#{x.node.id}" ) node["shape"] = "point" @graph.add_edges( @node, node, "dir" => "none" ) @graph.add_edges( node, x.node, "dir" => "none" ) @tree.add_couple( self, x, node ) end # Define that's two persons are divorced # # sophie.is_divorced_with john def is_divorced_with( x ) node = @graph.add_nodes( "#{@node.id}And#{x.node.id}" ) node["shape"] = "point" node["color"] = "red" @graph.add_edges( @node, node, "dir" => "none", "color" => "red" ) @graph.add_edges( node, x.node, "dir" => "none", "color" => "red" ) @tree.add_couple( self, x, node ) end # Define that's a person is widower of another # # simon.is_widower_of elisa def is_widower_of( x ) #veuf node = @graph.add_nodes( "#{@node.id}And#{x.node.id}" ) node["shape"] = "point" node["color"] = "green" @graph.add_edges( @node, node, "dir" => "none", "color" => "green" ) @graph.add_edges( node, x.node, "dir" => "none", "color" => "green" ) @tree.add_couple( self, x, node ) end # Define the current person as dead # # jack.is_dead def is_dead @node["style"] = "filled" end # Define the kids of a single person # # alice.kids( john, jack, julie ) def kids( *z ) GraphViz::FamilyTree::Couple.new( @graph, @node, [self] ).kids( *z ) end end end end ruby-graphviz-1.2.3/lib/graphviz/family_tree/sibling.rb0000644000004100000410000000041613111037426023231 0ustar www-datawww-dataclass GraphViz class FamilyTree class Sibling def initialize( bns, parents ) @brothers_and_sisters = bns @brothers_and_sisters.each do |person| person.sibling = self end @parents = parents end end end endruby-graphviz-1.2.3/lib/graphviz/family_tree/couple.rb0000644000004100000410000000310013111037426023062 0ustar www-datawww-dataclass GraphViz class FamilyTree class Couple def initialize( graph, node, persons ) #:nodoc: @graph = graph @node = node @kids = [] @persons = persons end def node #:nodoc: @node end # Add kids to a couple def kids( *z ) @kids = GraphViz::FamilyTree::Sibling.new( z, @persons ) return if z.size == 1 @graph.add_edges( @node, z[0].node, "dir" => "none" ) else cluster = @graph.add_graph( "#{@node.id}Kids" ) cluster["rank"] = "same" last = nil count = 0 add = (z.size-1)%2 * z.size/2 + (z.size-1)%2 link = (z.size/2)+1 z.each do |person| count = count + 1 if count == add middle = cluster.add_nodes( "#{@node.id}Kids", "shape" => "point" ) @graph.add_edges( @node, middle, "dir" => "none" ) unless last.nil? cluster.add_edges( last, middle, "dir" => "none" ) end last = middle end kid = cluster.add_nodes( "#{person.node.id}Kid", "shape" => "point" ) @graph.add_edges( kid, person.node, "dir" => "none" ) if add == 0 and count == link @graph.add_edges( @node, kid, "dir" => "none" ) end unless last.nil? cluster.add_edges( last, kid, "dir" => "none" ) end last = kid end end end def getKids @kids end end end end ruby-graphviz-1.2.3/lib/graphviz/graphml.rb0000644000004100000410000001673613111037426020750 0ustar www-datawww-data#!/usr/bin/env ruby # Copyright (C) 2010 Gregoire Lejeune # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA require 'graphviz' require 'rexml/document' class GraphViz class GraphMLError < RuntimeError end class GraphML attr_reader :attributes def attributs warn "`GraphViz::GraphML#attributs` is deprecated, please, use `GraphViz::GraphML#attributes`" return @attributes end # The GraphViz object attr_accessor :graph DEST = { 'node' => [:nodes], 'edge' => [:edges], 'graph' => [:graphs], 'graphml' => [:graphml], 'hyperedge' => [:hyperedge], 'port' => [:port], 'endpoint' => [:endpoint], 'all' => [:nodes, :edges, :graphs, :graphml, :hyperedge, :port, :endpoint] } GTYPE = { 'directed' => :digraph, 'undirected' => :graph } # Create a new GraphViz object from a GraphML file of string def initialize( file_or_str ) data = ((File.file?( file_or_str )) ? File::new(file_or_str) : file_or_str) @xmlDoc = REXML::Document::new( data ) @attributes = { :nodes => {}, :edges => {}, :graphs => {}, :graphml => {}, :endpoint => {}, :port => {}, :hyperedge => {} } @ignored_keys = [] @graph = nil @current_attr = nil @current_node = nil @current_edge = nil @current_graph = nil parse( @xmlDoc.root ) end def parse( node ) #:nodoc: send( node.name.to_sym, node ) end def graphml( node ) #:nodoc: node.each_element( ) do |child| begin send( "graphml_#{child.name}".to_sym, child ) rescue NoMethodError => e raise GraphMLError, "node #{child.name} can be child of graphml" end end end def graphml_data(node) warn "graphml/data not supported!" end def graphml_key( node ) #:nodoc: id = node.attributes['id'] @current_attr = { :name => node.attributes['attr.name'], :type => node.attributes['attr.type'] } if @current_attr[:name].nil? @ignored_keys << id else DEST[node.attributes['for']].each do |d| @attributes[d][id] = @current_attr end node.each_element( ) do |child| begin send( "graphml_key_#{child.name}".to_sym, child ) rescue NoMethodError => e raise GraphMLError, "node #{child.name} can be child of key" end end end @current_attr = nil end def graphml_key_default( node ) #:nodoc: @current_attr[:default] = node.texts().join('\n') end def graphml_graph( node ) #:nodoc: @current_node = nil if @current_graph.nil? @graph = GraphViz.new( node.attributes['id'], :type => GTYPE[node.attributes['edgedefault']] ) @current_graph = @graph previous_graph = @graph else previous_graph = @current_graph @current_graph = previous_graph.add_graph( node.attributes['id'] ) end @attributes[:graphs].each do |id, data| begin @current_graph.graph[data[:name]] = data[:default] if data.has_key?(:default) rescue ArgumentError => e warn e end end @attributes[:nodes].each do |id, data| begin @current_graph.node[data[:name]] = data[:default] if data.has_key?(:default) rescue ArgumentError => e warn e end end @attributes[:edges].each do |id, data| begin @current_graph.edge[data[:name]] = data[:default] if data.has_key?(:default) rescue ArgumentError => e warn e end end node.each_element( ) do |child| send( "graphml_graph_#{child.name}".to_sym, child ) end @current_graph = previous_graph end def graphml_graph_data( node ) #:nodoc: begin @current_graph[@attributes[:graphs][node.attributes['key']][:name]] = node.texts().join('\n') rescue ArgumentError => e warn e end end def graphml_graph_node( node ) #:nodoc: @current_node = {} node.each_element( ) do |child| case child.name when "graph" graphml_graph( child ) else begin send( "graphml_graph_node_#{child.name}".to_sym, child ) rescue NoMethodError => e raise GraphMLError, "node #{child.name} can be child of node" end end end unless @current_node.nil? node = @current_graph.add_nodes( node.attributes['id'] ) @current_node.each do |k, v| begin node[k] = v rescue ArgumentError => e warn e end end end @current_node = nil end def graphml_graph_node_data( node ) #:nodoc: return if @ignored_keys.include?(node.attributes['key']) begin @current_node[@attributes[:nodes][node.attributes['key']][:name]] = node.texts().join('\n') rescue ArgumentError => e warn e end end def graphml_graph_node_port( node ) #:nodoc: @current_node[:shape] = :record port = node.attributes['name'] if @current_node[:label] label = @current_node[:label].gsub( "{", "" ).gsub( "}", "" ) @current_node[:label] = "#{label}|<#{port}> #{port}" else @current_node[:label] = "<#{port}> #{port}" end end def graphml_graph_edge( node ) #:nodoc: source = node.attributes['source'] source = {source => node.attributes['sourceport']} if node.attributes['sourceport'] target = node.attributes['target'] target = {target => node.attributes['targetport']} if node.attributes['targetport'] @current_edge = @current_graph.add_edges( source, target ) node.each_element( ) do |child| begin send( "graphml_graph_edge_#{child.name}".to_sym, child ) rescue NoMethodError => e raise GraphMLError, "node #{child.name} can be child of edge" end end @current_edge = nil end def graphml_graph_edge_data( node ) #:nodoc: return if @ignored_keys.include?(node.attributes['key']) begin @current_edge[@attributes[:edges][node.attributes['key']][:name]] = node.texts().join('\n') rescue ArgumentError => e warn e end end def graphml_graph_hyperedge( node ) #:nodoc: list = [] node.each_element( ) do |child| if child.name == "endpoint" if child.attributes['port'] list << { child.attributes['node'] => child.attributes['port'] } else list << child.attributes['node'] end end end list.each { |s| list.each { |t| @current_graph.add_edges( s, t ) unless s == t } } end end end ruby-graphviz-1.2.3/lib/graphviz/ext.rb0000644000004100000410000000055613111037426020107 0ustar www-datawww-datarequire 'find' class GraphViz class Ext def self.find( ext = nil ) myPath = File.join( File.dirname( File.expand_path( __FILE__ ) ), "..", "ext" ) found = myPath unless ext.nil? Find.find(myPath) do |path| found = path if File.basename( path ) == ext end end File.expand_path( found ) end end endruby-graphviz-1.2.3/lib/graphviz/xml.rb0000644000004100000410000000647013111037426020110 0ustar www-datawww-data# Copyright (C) 2004 - 2012 Gregoire Lejeune # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA require 'graphviz' require 'rexml/document' class GraphViz class XML # The GraphViz object attr_accessor :graph # # Generate the graph # # THIS METHOD IS DEPRECATED, PLEASE USE GraphViz::XML.graph.output # def output( *options ) warn "GraphViz::XML.output is deprecated, use GraphViz::XML.graph.output" @graph.output( *options ) end private # # Create a graph from a XML file # # In: # * xml_file : XML File # * *options : Graph options: # * :text : show text nodes (default true) # * :attrs : show XML attributes (default true) # def initialize( xml_file, *options ) @node_name = "00000" @show_text = true @show_attributes = true if options and options[0] options[0].each do |xKey, xValue| case xKey.to_s when "text" @show_text = xValue options[0].delete( xKey ) when "attrs" @show_attributes = xValue options[0].delete( xKey ) end end end @rexml_document = REXML::Document::new( File::new( xml_file ) ) @graph = GraphViz::new( "XML", *options ) parse_xml_node( @rexml_document.root() ) end def parse_xml_node( xml_node ) #:nodoc: local_node_name = @node_name.clone @node_name.succ! label = xml_node.name if xml_node.has_attributes? and @show_attributes label = "{ " + xml_node.name xml_node.attributes.each do |xName, xValue| label << "| { #{xName} | #{xValue} } " end label << "}" end @graph.add_nodes( local_node_name, "label" => label, "color" => "blue", "shape" => "record" ) ## Act: Search and add Text nodes if xml_node.has_text? and @show_text text_node_name = local_node_name.clone text_node_name << "111" xText = "" xSep = "" xml_node.texts().each do |l| x = l.value.chomp.strip if x.length > 0 xText << xSep << x xSep = "\n" end end if xText.length > 0 @graph.add_nodes( text_node_name, "label" => xText, "color" => "black", "shape" => "ellipse" ) @graph.add_edges( local_node_name, text_node_name ) end end ## Act: Search and add attributes ## TODO xml_node.each_element( ) do |xml_child_node| child_node_name = parse_xml_node( xml_child_node ) @graph.add_edges( local_node_name, child_node_name ) end return( local_node_name ) end end end ruby-graphviz-1.2.3/lib/graphviz/dot2ruby.rb0000644000004100000410000000365013111037426021057 0ustar www-datawww-data#!/usr/bin/env ruby # Copyright (C) 2010 Gregoire Lejeune # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA require 'graphviz/ext' require 'graphviz/utils' class Dot2Ruby #:nodoc: include GraphViz::Utils def initialize( xGVPath, xOutFile, xOutFormat = nil ) #:nodoc: paths = (xGVPath.nil?) ? [] : [xGVPath] @xGvprPath = find_executable( 'gvpr', paths ) if(@xGvprPath.nil?) raise Exception, "GraphViz is not installed. Please be sure that 'gvpr' is on the search path'" end @xOutFile = xOutFile @xOutFormat = xOutFormat || "_" @gvprScript = GraphViz::Ext.find( "dot2ruby.g" ) end def run( xFile ) #:nodoc: xCmd = [@xGvprPath, '-f', @gvprScript, '-a', @xOutFormat, xFile] xOutput = output_from_command( xCmd ) if @xOutFile.nil? puts xOutput else File.open( @xOutFile, "w" ) do |io| io.print xOutput end end end def eval( xFile ) #:nodoc: xCmd = [@xGvprPath, '-f', @gvprScript, '-a', '-', xFile] xOutput = output_from_command( xCmd ) instance_eval(xOutput) return @_graph_eval end def eval_string( data ) #:nodoc: t = Tempfile::open( File.basename(__FILE__) ) t.print( data ) t.close result = self.eval(t.path) t.close return result end end ruby-graphviz-1.2.3/lib/graphviz/elements.rb0000644000004100000410000000141013111037426021111 0ustar www-datawww-dataclass GraphViz class Elements def initialize @elements = Array.new @elements_hash_by_type = Hash.new end def push( obj ) @elements.push( obj ) if @elements_hash_by_type[obj['type']].nil? @elements_hash_by_type[obj['type']] = Array.new end @elements_hash_by_type[obj['type']].push( obj ) end def each( &b ) @elements.each do |e| yield( e ) end end def size_of( type ) if @elements_hash_by_type[type].nil? return 0 else return @elements_hash_by_type[type].size end end def []( index, type = nil ) if type.nil? return @elements[index] else return @elements_hash_by_type[type][index] end end end endruby-graphviz-1.2.3/lib/graphviz/types.rb0000644000004100000410000000070113111037426020443 0ustar www-datawww-dataclass GraphViz class Types class Common def initialize( data ) @data = check(data) end def output return @data end def source return @data end end Dir.glob( File.dirname( File.expand_path(__FILE__) )+"/types/*.rb" ).each do |f| #autoload File.basename(f).gsub(File.extname(f), "").split( "_" ).map{|n| n.capitalize }.join.to_sym, f require f end end end ruby-graphviz-1.2.3/lib/graphviz/types/0000755000004100000410000000000013111037426020120 5ustar www-datawww-dataruby-graphviz-1.2.3/lib/graphviz/types/lbl_string.rb0000644000004100000410000000142613111037426022607 0ustar www-datawww-datarequire "rexml/document" class GraphViz class Types class LblString < Common def check(data) return data end def output html = /^<(.*)>$/m.match(@data.to_s) if html != nil xml = "" + html[1].to_s + "" begin doc = REXML::Document.new(xml) unless doc.root.text == html[1].to_s "<#{html[1]}>" else @data.to_s.inspect.gsub( "\\\\", "\\" ) end rescue REXML::ParseException => _ @data.to_s.inspect.gsub( "\\\\", "\\" ) end else @data.to_s.inspect.gsub( "\\\\", "\\" ) end end alias :to_gv :output alias :to_s :output alias :to_ruby :output end end end ruby-graphviz-1.2.3/lib/graphviz/types/gv_bool.rb0000644000004100000410000000232013111037426022071 0ustar www-datawww-dataclass BoolException < RuntimeError end # bool # # For the bool type, # - TRUE values are represented by "true" or "yes" (case-insensitive), true and any non-zero integer # - FALSE values by "false", "no" or empty string (case-insensitive), false and zero. # # Example # # graph[:center] = "true" # or # graph[:center] = true # or # graph[:center] = 23 class GraphViz class Types class GvBool < Common BOOL_TRUE = ["true", "yes"] BOOL_FALSE = ["false", "no", ""] def check(data) if true == data or (data.is_a?(Integer) and data != 0) or (data.is_a?(String) and !BOOL_FALSE.include?(data.downcase)) @to_ruby = true return data end if false == data or (data.is_a?(Integer) and data == 0) or (data.is_a?(String) and BOOL_FALSE.include?(data.downcase)) @to_ruby = false return data end raise BoolException, "Invalid bool value" end def output return @data.to_s.inspect.gsub( "\\\\", "\\" ) end alias :to_gv :output alias :to_s :output def to_ruby @to_ruby end end end end ruby-graphviz-1.2.3/lib/graphviz/types/rect.rb0000644000004100000410000000146613111037426021411 0ustar www-datawww-dataclass RectException < RuntimeError end class GraphViz class Types class Rect < Common FLOAT_MASK = /[-+]?(?:[0-9]*\.[0-9]+|[0-9]+)/ RECT_FINAL_MASK = /#{FLOAT_MASK}\s*,\s*#{FLOAT_MASK}\s*,\s*#{FLOAT_MASK}\s*,\s*#{FLOAT_MASK}/ def check(data) if data.is_a?(String) and RECT_FINAL_MASK.match(data) @to_ruby = data.split(",").map{ |e| e.to_f } return data end if data.is_a?(Array) return check(data.join(",")) end return nil if data.is_a?(String) and data.empty? raise RectException, "Invalid rect value" end def output return @data.to_s.inspect.gsub( "\\\\", "\\" ) end alias :to_gv :output alias :to_s :output def to_ruby @to_ruby end end end end ruby-graphviz-1.2.3/lib/graphviz/types/html_string.rb0000644000004100000410000000043413111037426023000 0ustar www-datawww-data# TODO: Remove class GraphViz class Types class HtmlString < Common def check(data) return data end def output return "<"+@data+">" end alias :to_gv :output alias :to_s :output alias :to_ruby :output end end end ruby-graphviz-1.2.3/lib/graphviz/types/color_list.rb0000644000004100000410000000074213111037426022621 0ustar www-datawww-dataclass GraphViz class Types class ColorList < Common def check(data) data = data.to_s if data.is_a?(Symbol) return nil if data.empty? @to_ruby = data.split(/\s*:\s*/).map { |c| GraphViz::Types::Color.new(c).to_ruby } return data end def output return @data.to_s.inspect.gsub( "\\\\", "\\" ) end alias :to_gv :output alias :to_s :output def to_ruby @data end end end end ruby-graphviz-1.2.3/lib/graphviz/types/gv_double.rb0000644000004100000410000000122113111037426022407 0ustar www-datawww-dataclass DoubleException < RuntimeError end class GraphViz class Types class GvDouble < Common FLOAT_MASK = /[-+]?(?:[0-9]*\.[0-9]+|[0-9]+)/ def check(data) if data.kind_of?(Numeric) or (data.is_a?(String) and FLOAT_MASK.match(data)) return data end return nil if data.is_a?(String) and data.empty? raise DoubleException, "Invalid double value for `#{data}`" end def output return @data.to_s.inspect.gsub( "\\\\", "\\" ) end def to_f @data.to_f end alias :to_gv :output alias :to_s :output alias :to_ruby :to_f end end end ruby-graphviz-1.2.3/lib/graphviz/types/esc_string.rb0000644000004100000410000000046513111037426022612 0ustar www-datawww-dataclass GraphViz class Types class EscString < Common def check(data) return data end def output return @data.to_s.inspect.gsub( "\\\\", "\\" ) end alias :to_gv :output alias :to_s :output def to_ruby @data end end end end ruby-graphviz-1.2.3/lib/graphviz/types/color.rb0000644000004100000410000000335113111037426021565 0ustar www-datawww-datarequire 'graphviz/utils/colors' class ColorException < RuntimeError end class GraphViz class Types class Color < Common HEX_FOR_COLOR = /[0-9a-fA-F]{2}/ RGBA = /^#(#{HEX_FOR_COLOR})(#{HEX_FOR_COLOR})(#{HEX_FOR_COLOR})(#{HEX_FOR_COLOR})?$/ def check(data) data = data.to_s if data.is_a?(Symbol) return nil if data.empty? if data[0].chr == "#" m = RGBA.match(data) if m.nil? raise ColorException, "Wrong color definition RGBA #{data}" end @to_ruby = GraphViz::Utils::Colors.rgb(m[1], m[2], m[3], m[4]) return data elsif data.include?(",") or data.include?(" ") m = data.split(/(?:\s*,\s*|\s+)/).map { |x| x.to_f } if m.size != 3 raise ColorException, "Wrong color definition HSV #{data}" end @to_ruby = GraphViz::Utils::Colors.hsv(m[0], m[1], m[2]) return data elsif data.is_a?(Array) if data.all? { |x| x.is_a?(String) and x =~ /^#{HEX_FOR_COLOR}$/ } and [3,4].include?(data.size) @to_ruby = GraphViz::Utils::Colors.rgb(data[0], data[1], data[2], data[3]) return data elsif data.all? { |x| x.kind_of?(Numeric) } and data.size == 3 @to_ruby = GraphViz::Utils::Colors.hsv(data[0], data[1], data[2]) return data end raise ColorException, "Wrong color definition Array #{data}" else @to_ruby = GraphViz::Utils::Colors.name(data) return data end end def output return @data.to_s.inspect.gsub( "\\\\", "\\" ) end alias :to_gv :output alias :to_s :output def to_ruby @to_ruby end end end end ruby-graphviz-1.2.3/lib/graphviz/types/spline_type.rb0000644000004100000410000000366513111037426023012 0ustar www-datawww-dataclass SplineTypeException < RuntimeError end # spliteType or point # # spline ( ';' spline )* # where spline = (endp)? (startp)? point (triple)+ # and triple = point point point # and endp = "e,%f,%f" # and startp = "s,%f,%f" # # If a spline has points p1 p2 p3 ... pn, (n = 1 (mod 3)), the points correspond # to the control points of a B-spline from p1 to pn. If startp is given, it touches # one node of the edge, and the arrowhead goes from p1 to startp. If startp is not # given, p1 touches a node. Similarly for pn and endp. class GraphViz class Types class SplineType < Common FLOAT_MASK = /[-+]?(?:[0-9]*\.[0-9]+|[0-9]+)/ ENDP_MASK = /e\s*,\s*#{FLOAT_MASK}\s*,\s*#{FLOAT_MASK}/ STARTP_MASK = /s\s*,\s*#{FLOAT_MASK}\s*,\s*#{FLOAT_MASK}/ POINT_MASK = /#{FLOAT_MASK}\s*,\s*#{FLOAT_MASK}(?:\s*,\s*#{FLOAT_MASK})?!?/ TRIPLE_MASK = /#{POINT_MASK}\s+#{POINT_MASK}\s+#{POINT_MASK}/ SPLINE_MASK = /(?:#{ENDP_MASK}\s+)?(?:#{STARTP_MASK}\s+)?#{POINT_MASK}(?:\s*#{TRIPLE_MASK})+/ FINAL_SPLINE_MASK = /^#{SPLINE_MASK}(?:\s*;\s*#{SPLINE_MASK})*$/ FINAL_POINT_MASK = /^#{POINT_MASK}$/ def check(data) unless SPLINE_MASK.match(data).nil? @is_spline = true return data end unless FINAL_POINT_MASK.match(data).nil? @is_spline = false return data end return nil if data.empty? raise SplineTypeException, "Invalid spline type value" end def output return @data.to_s.inspect.gsub( "\\\\", "\\" ) end alias :to_gv :output alias :to_s :output def point if point? "[#{@data}]".to_ruby else # TODO! end end def endp end def startp end def triples end private def point? not @is_spline end def splite_type? @is_spline end end end end ruby-graphviz-1.2.3/lib/graphviz/types/arrow_type.rb0000644000004100000410000000107613111037426022644 0ustar www-datawww-data# >> x = "hello\n\t\\l\"world\"" # => "hello\n\t\\l\"world\"" # >> puts x.inspect.gsub( "\\\\", "\\" ) # "hello\n\t\l\"world\"" # # OR # # >> x = 'hello\n\t\l"world"' # => "hello\\n\\t\\l\"world\"" # >> puts x.inspect.gsub( "\\\\", "\\" ) # "hello\n\t\l\"world\"" class GraphViz class Types class ArrowType < Common def check(data) return data end def output return @data.to_s.inspect.gsub( "\\\\", "\\" ) end alias :to_gv :output alias :to_s :output def to_ruby @data end end end end ruby-graphviz-1.2.3/lib/graphviz/nothugly/0000755000004100000410000000000013111037426020625 5ustar www-datawww-dataruby-graphviz-1.2.3/lib/graphviz/nothugly/nothugly.xsl0000644000004100000410000003265413111037426023240 0ustar www-datawww-data font-size:10px; font-family:Verdana fill: black; stroke: none; fill-opacity:0.3 translate(3,3) fill: black; stroke: none; fill-opacity:0.15 translate(3,3) fill: none; stroke: black; stroke-opacity:0.3 translate(3,3) fill:url(#);stroke:black; fill:url(#);stroke:; fill:url(#);stroke:black; ruby-graphviz-1.2.3/lib/graphviz/family_tree.rb0000644000004100000410000000537713111037426021615 0ustar www-datawww-data# -*- coding: utf-8 -*- require 'rubygems' require 'graphviz' require 'graphviz/family_tree/generation' require 'graphviz/family_tree/person' require 'graphviz/family_tree/couple' require 'graphviz/family_tree/sibling' class GraphViz class FamilyTree # Create a new family tree # # require 'graphviz/family_tree' # t = GraphViz::FamilyTree.new do # ... # end def initialize( &block ) @persons = {} @graph = GraphViz.new( "FamilyTree", :use => :neato ) @generation_number = 0 @generations = [] @couples = {} instance_eval(&block) if block end # Add a new generation in the tree # # require 'graphviz/family_tree' # t = GraphViz::FamilyTree.new do # generation do # ... # end # generation do # ... # end # end def generation( &b ) gen = GraphViz::FamilyTree::Generation.new( @graph, @persons, self, @generation_number ) gen.make( &b ) @generations << gen @generation_number += 1 end def persons #:nodoc: @persons ||= {} end def add_couple( x, y, node ) #:nodoc: @couples[x] = {} if @couples[x].nil? @couples[x][y] = GraphViz::FamilyTree::Couple.new( @graph, node, [x, y] ) @couples[y] = {} if @couples[y].nil? @couples[y][x] = @couples[x][y] end # Get a couple (GraphViz::FamilyTree::Couple) def couple( x, y ) @couples[x][y] end def method_missing(sym, *args, &block) #:nodoc: persons[sym.to_s] end # Family size def size @persons.size end # Get the graph def graph maxY = @generations.size biggestGen, maxX = biggestGenerationNumberAndSize puts "#{maxY} generations" puts "Plus grosse generation : ##{biggestGen} avec #{maxX} personnes" puts "traitement des générations..." puts " #{biggestGen}:" @generations[biggestGen].persons.each do |id, person| puts " - #{id} : #{person.class}" end puts " Up..." (0...biggestGen).reverse_each do |genNumber| puts " #{genNumber}:" @generations[genNumber].persons.each do |id, person| puts " - #{id} : #{person.class}" end end puts " Down..." ((biggestGen+1)...maxY).each do |genNumber| puts " #{genNumber}:" @generations[genNumber].persons.each do |id, person| puts " - #{id} : #{person.class}" end end @graph end private def biggestGenerationNumberAndSize size = 0 number = 0 @generations.each do |gen| if gen.size > size size = gen.size number = gen.number end end return number, size end end end ruby-graphviz-1.2.3/lib/graphviz/theory.rb0000644000004100000410000002224413111037426020617 0ustar www-datawww-datarequire 'graphviz/math/matrix' class GraphViz class Theory def initialize( graph ) @graph = graph end # Return the adjancy matrix of the graph def adjancy_matrix matrix = GraphViz::Math::Matrix.new( @graph.node_count, @graph.node_count ) @graph.each_edge { |e| x = @graph.get_node(e.node_one(false, false)).index y = @graph.get_node(e.node_two(false, false)).index matrix[x+1, y+1] = 1 matrix[y+1, x+1] = 1 if @graph.type == "graph" } return matrix end # Return the incidence matrix of the graph def incidence_matrix tail = (@graph.type == "digraph") ? -1 : 1 matrix = GraphViz::Math::Matrix.new( @graph.node_count, @graph.edge_count ) @graph.each_edge { |e| x = e.index nstart = @graph.get_node(e.node_one(false, false)).index nend = @graph.get_node(e.node_two(false, false)).index matrix[nstart+1, x+1] = 1 matrix[nend+1, x+1] = tail matrix[nend+1, x+1] = 2 if nstart == nend } return matrix end # Return the degree of the given node def degree( node ) degree = 0 name = node if node.kind_of?(GraphViz::Node) name = node.id end @graph.each_edge do |e| degree += 1 if e.node_one(false, false) == name or e.node_two(false, false) == name end return degree end # Return the laplacian matrix of the graph def laplacian_matrix return degree_matrix - adjancy_matrix end # Return true if the graph if symmetric, false otherwise def symmetric? adjancy_matrix == adjancy_matrix.transpose end # moore_dijkstra(source, destination) def moore_dijkstra( dep, arv ) dep = @graph.get_node(dep) unless dep.kind_of?(GraphViz::Node) arv = @graph.get_node(arv) unless arv.kind_of?(GraphViz::Node) m = distance_matrix n = @graph.node_count # Table des sommets à choisir c = [dep.index] # Table des distances d = [] d[dep.index] = 0 # Table des predecesseurs pred = [] @graph.each_node do |name, k| if k != dep d[k.index] = m[dep.index+1,k.index+1] pred[k.index] = dep end end while c.size < n # trouver y tel que d[y] = min{d[k]; k sommet tel que k n'appartient pas à c} mini = 1.0/0.0 y = nil @graph.each_node do |name, k| next if c.include?(k.index) if d[k.index] < mini mini = d[k.index] y = k end end # si ce minimum est ∞ alors sortir de la boucle fin si break unless mini.to_f.infinite?.nil? c << y.index @graph.each_node do |name, k| next if c.include?(k.index) if d[k.index] > d[y.index] + m[y.index+1,k.index+1] d[k.index] = d[y.index] + m[y.index+1,k.index+1] pred[k.index] = y end end end # Construction du chemin le plus court ch = [] k = arv while k.index != dep.index ch.unshift(k) k = pred[k.index] end ch.unshift(dep) if d[arv.index].to_f.infinite? return nil else return( { :path => ch, :distance => d[arv.index] } ) end end # Return a liste of range # # If the returned array include nil values, there is one or more circuits in the graph def range matrix = adjancy_matrix unseen = (1..matrix.columns).to_a result = Array.new(matrix.columns) r = 0 range_recursion( matrix, unseen, result, r ) end # Return the critical path for a PERT network # # If the given graph is not a PERT network, return nul def critical_path return nil if range.include?(nil) or @graph.type != "digraph" r = [ [0, [1]] ] critical_path_recursion( distance_matrix, adjancy_matrix, r, [], 0 ).inject( {:distance => 0, :path => []} ) { |_r, item| (_r[:distance] < item[0]) ? { :distance => item[0], :path => item[1] } : _r } end # Return the PageRank in an directed graph. # # * damping_factor: PageRank dumping factor. # * max_iterations: Maximum number of iterations. # * min_delta: Smallest variation required to have a new iteration. def pagerank(damping_factor = 0.85, max_iterations = 100, min_delta = 0.00001) return nil unless @graph.directed? min_value = (1.0-damping_factor)/@graph.node_count pagerank = {} @graph.each_node { |_, node| pagerank[node] = 1.0/@graph.node_count } max_iterations.times { |_| diff = 0 @graph.each_node { |_, node| rank = min_value incidents(node).each { |referent| rank += damping_factor * pagerank[referent] / neighbors(referent).size } diff += (pagerank[node] - rank).abs pagerank[node] = rank } break if diff < min_delta } return pagerank end # Return the list of nodes that are directly accessible from given node def neighbors(node) if node.class == String @graph.get_node(node).neighbors else node.neighbors end end # Return the list of nodes that are incident to the given node (in a directed graph neighbors == incidents) def incidents(node) if node.class == String @graph.get_node(node).incidents else node.incidents end end # Breadth First Search def bfs(node, &b) queue = [] visited_nodes = [] node = @graph.get_node(node) if node.kind_of? String queue << node visited_nodes << node while not queue.empty? node = queue.shift b.call(node) neighbors(node).each do |n| unless visited_nodes.include?(n) visited_nodes << n queue << n end end end end # Depth First Search def dfs(node, &b) visited_nodes = [] recursive_dfs(node, visited_nodes, &b) end private def recursive_dfs(node, visited_nodes, &b) node = @graph.get_node(node) if node.kind_of? String b.call(node) visited_nodes << node neighbors(node).each do |n| recursive_dfs(n, visited_nodes, &b) unless visited_nodes.include?(n) end end def distance_matrix type = @graph.type matrix = GraphViz::Math::Matrix.new( @graph.node_count, @graph.node_count, (1.0/0.0) ) @graph.each_edge { |e| x = @graph.get_node(e.node_one(false, false)).index y = @graph.get_node(e.node_two(false, false)).index unless x == y weight = ((e[:weight].nil?) ? 1 : e[:weight].to_f) matrix[x+1, y+1] = weight matrix[y+1, x+1] = weight if type == "graph" end } return matrix end def degree_matrix matrix = GraphViz::Math::Matrix.new( @graph.node_count, @graph.node_count ) @graph.each_node do |name, node| i = node.index matrix[i+1, i+1] = degree(node) end return matrix end def range_recursion(matrix, unseen, result, r) remove = [] matrix.columns.times do |c| if matrix.sum_of_column(c+1) == 0 result[unseen[c]-1] = r remove.unshift( c + 1 ) end end remove.each do |rem| matrix = matrix.remove_line(rem).remove_column(rem) unseen.delete_at(rem-1) end if matrix.columns == 1 and matrix.lines == 1 if matrix.sum_of_column(1) == 0 result[unseen[0]-1] = r+1 end elsif remove.size > 0 range_recursion( matrix, unseen, result, r+1 ) end return result end def index_of_item( array, item ) array.inject( [0,[]] ){|a,i| a[1] << a[0] if i == item a[0] += 1 a }[1] end def critical_path_recursion( d, a, r, result, level ) r.each do |p| node = p[1][-1] index_of_item( a.line(node), 1 ).each do |c| succ = c+1 cpath = [ (p[0] + d[node,succ]), (p[1].clone << succ) ] if index_of_item( a.line(succ), 1 ).size > 0 critical_path_recursion( d, a, [cpath], result, level+1 ) else result << cpath end end end return result end end end ruby-graphviz-1.2.3/lib/graphviz/attrs.rb0000644000004100000410000000403313111037426020436 0ustar www-datawww-data# Copyright (C) 2004 - 2012 Gregoire Lejeune # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA class AttributeException < RuntimeError end class GraphViz class Attrs attr_accessor :data def initialize( gviz, name, attributes ) @name = name @attributes = attributes @data = Hash::new( ) @graphviz = gviz end def each @data.each do |k, v| yield(k, v) end end def to_h @data.clone end def []( key ) if key.class == Hash key.each do |k, v| self[k] = v end else @data[key.to_s] end end def []=( key, value ) unless @attributes.keys.include?( key.to_s ) raise ArgumentError, "#{@name} attribute '#{key.to_s}' invalid" end if value.nil? warn "Value for attribute `#{key}` can't be null" return end begin value = GraphViz::Types.const_get(@attributes[key.to_s]).new(value) rescue => e raise AttributeException, "Invalid value `#{value}` for attribute `#{key}` : #{e}" end if value @data[key.to_s] = value @graphviz.set_position( @name, key.to_s, @data[key.to_s] ) if @graphviz end end end end ruby-graphviz-1.2.3/lib/graphviz/constants.rb0000644000004100000410000004075113111037426021324 0ustar www-datawww-data# Copyright (C) 2004 - 2012 Gregoire Lejeune # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # Constants for ruby-graphviz # # GraphViz::Constants::FORMATS: the possible output formats # "bmp", "canon", "dot", "xdot", "cmap", "dia", "eps", # "fig", "gd", "gd2", "gif", "gtk", "hpgl", "ico", "imap", # "cmapx", "imap_np", "cmapx_np", "ismap", "jpeg", "jpg", # "jpe", "mif", "mp", "pcl", "pdf", "pic", "plain", # "plain-ext", "png", "ps", "ps2", "svg", "svgz", "tga", # "tiff", "tif", "vml", "vmlz", "vrml", "vtx", "wbmp", # "xlib", "none" # # GraphViz::Constants::PROGRAMS: The possible programs # "dot", "neato", "twopi", "fdp", "circo" # # GraphViz::Constants::GRAPHTYPE The possible types of graph # "digraph", "graph" # # # The single letter codes used in constructors map as follows: # G => The root graph, with GRAPHATTRS # E => Edge, with EDGESATTRS # N => Node, with NODESATTRS # S => subgraph # C => cluster # class GraphViz module Constants RGV_VERSION = "1.2.3" ## Const: Output formats FORMATS = [ "bmp", "canon", "dot", "xdot", "cmap", "dia", "eps", "fig", "gd", "gd2", "gif", "gtk", "hpgl", "ico", "imap", "cmapx", "imap_np", "cmapx_np", "ismap", "jpeg", "jpg", "jpe", "mif", "mp", "pcl", "pdf", "pic", "plain", "plain-ext", "png", "ps", "ps2", "svg", "svgz", "tga", "tiff", "tif", "vml", "vmlz", "vrml", "vtx", "wbmp", "xlib", "none" ] ## Const: programs PROGRAMS = [ "dot", "neato", "twopi", "fdp", "circo", "sfdp" ] ## Const: graphs type GRAPHTYPE = [ "digraph", "graph", "strict digraph" ] def self.getAttrsFor( x ) list = {} GENCS_ATTRS.each { |k,v| list[k] = v[:type] if x.match( v[:usedBy] ) and not list.keys.include?(k) } list end # E, N, G, S and C represent edges, nodes, the root graph, subgraphs and cluster subgraphs, respectively GENCS_ATTRS = { "Damping" => { :usedBy => "G", :type => :GvDouble }, "K" => { :usedBy => "GC", :type => :GvDouble }, "URL" => { :usedBy => "ENGC", :type => :EscString }, "_background" => { :usedBy => "G", :type => :EscString }, "area" => { :usedBy => "NC", :type => :GvDouble }, "arrowhead" => { :usedBy => "E", :type => :ArrowType }, # arrowType "arrowsize" => { :usedBy => "E", :type => :GvDouble }, "arrowtail" => { :usedBy => "E", :type => :ArrowType }, # arrowType #"aspect" => { :usedBy => "G", :type => :EscString }, # aspectType "bb" => { :usedBy => "G", :type => :Rect }, # rect "bgcolor" => { :usedBy => "GC", :type => :Color }, # color "center" => { :usedBy => "G", :type => :GvBool }, # bool "charset" => { :usedBy => "G", :type => :EscString }, # string "clusterrank" => { :usedBy => "G", :type => :EscString }, # clusterMode "color" => { :usedBy => "ENC", :type => :ColorList }, # color, colorList "colorscheme" => { :usedBy => "ENCG", :type => :EscString }, # string "comment" => { :usedBy => "ENG", :type => :EscString }, # string "compound" => { :usedBy => "G", :type => :GvBool }, # bool "concentrate" => { :usedBy => "G", :type => :GvBool }, # bool "constraint" => { :usedBy => "E", :type => :GvBool }, # bool "decorate" => { :usedBy => "E", :type => :GvBool }, # bool "defaultdist" => { :usedBy => "G", :type => :GvDouble }, "dim" => { :usedBy => "G", :type => :EscString }, # int "dimen" => { :usedBy => "G", :type => :EscString }, # int "dir" => { :usedBy => "E", :type => :EscString }, # dirType "diredgeconstraints" => { :usedBy => "G", :type => :EscString }, # string, bool "distortion" => { :usedBy => "N", :type => :GvDouble }, "dpi" => { :usedBy => "G", :type => :GvDouble }, "edgeURL" => { :usedBy => "E", :type => :EscString }, "edgehref" => { :usedBy => "E", :type => :EscString }, "edgetarget" => { :usedBy => "E", :type => :EscString }, "edgetooltip" => { :usedBy => "E", :type => :EscString }, "epsilon" => { :usedBy => "G", :type => :GvDouble }, "esep" => { :usedBy => "G", :type => :EscString }, # GvDouble , pointf "fillcolor" => { :usedBy => "NEC", :type => :Color }, # color "fixedsize" => { :usedBy => "N", :type => :GvBool }, # bool "fontcolor" => { :usedBy => "ENGC", :type => :Color }, # color "fontname" => { :usedBy => "ENGC", :type => :EscString }, # string "fontnames" => { :usedBy => "G", :type => :EscString }, # string "fontpath" => { :usedBy => "G", :type => :EscString }, # string "fontsize" => { :usedBy => "ENGC", :type => :GvDouble }, "forcelabels" => { :usedBy => "G", :type => :GvBool}, # bool "gradientangle" => { :usedBy => "NCG", :type => :EscString }, # int "group" => { :usedBy => "N", :type => :EscString }, # string "headURL" => { :usedBy => "E", :type => :EscString }, "head_lp" => { :usedBy => "E", :type => :EscString }, #point "headclip" => { :usedBy => "E", :type => :GvBool }, # bool "headhref" => { :usedBy => "E", :type => :EscString }, "headlabel" => { :usedBy => "E", :type => :EscString }, # LblString "headport" => { :usedBy => "E", :type => :EscString }, # portPos "headtarget" => { :usedBy => "E", :type => :EscString }, "headtooltip" => { :usedBy => "E", :type => :EscString }, "height" => { :usedBy => "N", :type => :GvDouble }, "href" => { :usedBy => "ENGC", :type => :EscString }, "id" => { :usedBy => "ENG", :type => :EscString }, "image" => { :usedBy => "N", :type => :EscString }, # string "imagepath" => { :usedBy => "G", :type => :EscString }, # string "imagescale" => { :usedBy => "N", :type => :EscString }, # bool, string "inputscale" => { :usedBy => "G", :type => :GvDouble }, "label" => { :usedBy => "ENGC", :type => :LblString }, "labelURL" => { :usedBy => "E", :type => :EscString }, "label_scheme" => { :usedBy => "G", :type => :EscString }, # int "labelangle" => { :usedBy => "E", :type => :GvDouble }, "labeldistance" => { :usedBy => "E", :type => :GvDouble }, "labelfloat" => { :usedBy => "E", :type => :GvBool }, # bool "labelfontcolor" => { :usedBy => "E", :type => :Color }, # color "labelfontname" => { :usedBy => "E", :type => :EscString }, # string "labelfontsize" => { :usedBy => "E", :type => :GvDouble }, "labelhref" => { :usedBy => "E", :type => :EscString }, "labeljust" => { :usedBy => "GC", :type => :EscString }, # string "labelloc" => { :usedBy => "GCN", :type => :EscString }, # string "labeltarget" => { :usedBy => "E", :type => :EscString }, "labeltooltip" => { :usedBy => "E", :type => :EscString }, "landscape" => { :usedBy => "G", :type => :GvBool }, # bool "layer" => { :usedBy => "ENC", :type => :EscString }, # layerRange "layerlistsep" => { :usedBy => "G", :type => :EscString }, # string "layers" => { :usedBy => "G", :type => :EscString }, # layerList "layerselect" => { :usedBy => "G", :type => :EscString }, # layerRange "layersep" => { :usedBy => "G", :type => :EscString }, # string "layout" => { :usedBy => "G", :type => :EscString }, # string "len" => { :usedBy => "E", :type => :GvDouble }, "levels" => { :usedBy => "G", :type => :EscString }, # int "levelsgap" => { :usedBy => "G", :type => :GvDouble }, "lhead" => { :usedBy => "E", :type => :EscString }, # string "lheight" => { :usedBy => "GC", :type => :GvDouble }, "lp" => { :usedBy => "EGC", :type => :EscString }, # point "ltail" => { :usedBy => "E", :type => :EscString }, # string "lwidth" => { :usedBy => "GC", :type => :GvDouble }, "margin" => { :usedBy => "NGC", :type => :EscString }, # GvDouble , pointf "maxiter" => { :usedBy => "G", :type => :EscString }, # int "mclimit" => { :usedBy => "G", :type => :GvDouble }, "mindist" => { :usedBy => "G", :type => :GvDouble }, "minlen" => { :usedBy => "E", :type => :EscString }, # int "mode" => { :usedBy => "G", :type => :EscString }, # string "model" => { :usedBy => "G", :type => :EscString }, # string "mosek" => { :usedBy => "G", :type => :GvBool }, # bool "nodesep" => { :usedBy => "G", :type => :GvDouble }, "nojustify" => { :usedBy => "GCNE", :type => :GvBool }, # bool "normalize" => { :usedBy => "G", :type => :GvBool }, # bool "nslimit" => { :usedBy => "G", :type => :GvDouble }, "nslimit1" => { :usedBy => "G", :type => :GvDouble }, "ordering" => { :usedBy => "GN", :type => :EscString }, # string "orientation" => { :usedBy => "NG", :type => :GvDouble }, # N: double, G: string "outputorder" => { :usedBy => "G", :type => :EscString }, # outputMode "overlap" => { :usedBy => "G", :type => :EscString }, # string, bool "overlap_scaling" => { :usedBy => "G", :type => :GvDouble }, "overlap_shrink" => { :usedBy => "G", :type => :GvBool }, "pack" => { :usedBy => "G", :type => :EscString }, # bool, int "packmode" => { :usedBy => "G", :type => :EscString }, # packMode "pad" => { :usedBy => "G", :type => :EscString }, # GvDouble , pointf "page" => { :usedBy => "G", :type => :EscString }, # GvDouble , pointf "pagedir" => { :usedBy => "G", :type => :EscString }, # pageDir "pencolor" => { :usedBy => "C", :type => :Color }, # color "penwidth" => { :usedBy => "CNE", :type => :GvDouble }, "peripheries" => { :usedBy => "NC", :type => :EscString }, # int "pin" => { :usedBy => "N", :type => :GvBool }, # bool "pos" => { :usedBy => "EN", :type => :SplineType }, # point, splineTypes "quadtree" => { :usedBy => "G", :type => :GvBool }, # bool "quantum" => { :usedBy => "G", :type => :GvDouble }, "rank" => { :usedBy => "S", :type => :EscString }, # rankType "rankdir" => { :usedBy => "G", :type => :EscString }, # rankDir "ranksep" => { :usedBy => "G", :type => :EscString }, # GvDouble, doubleList "ratio" => { :usedBy => "G", :type => :EscString }, # GvDouble, String "rects" => { :usedBy => "N", :type => :Rect }, # rect "regular" => { :usedBy => "N", :type => :GvBool }, # bool "remincross" => { :usedBy => "G", :type => :GvBool }, # bool "repulsiveforce" => { :usedBy => "G", :type => :GvDouble }, "resolution" => { :usedBy => "G", :type => :GvDouble }, "root" => { :usedBy => "GN", :type => :EscString }, # bool, string "rotate" => { :usedBy => "G", :type => :EscString }, # int "rotation" => { :usedBy => "G", :type => :GvDouble }, "samehead" => { :usedBy => "E", :type => :EscString }, # string "sametail" => { :usedBy => "E", :type => :EscString }, # string "samplepoints" => { :usedBy => "G", :type => :EscString }, # int "scale" => { :usedBy => "G", :type => :EscString }, # double, pointf "searchsize" => { :usedBy => "G", :type => :EscString }, # int "sep" => { :usedBy => "G", :type => :EscString }, # double , pointf "shape" => { :usedBy => "N", :type => :EscString }, # shape "shapefile" => { :usedBy => "N", :type => :EscString }, # string "showboxes" => { :usedBy => "ENG", :type => :EscString }, # int "sides" => { :usedBy => "N", :type => :EscString }, # int "size" => { :usedBy => "NG", :type => :EscString }, # double , pointf "skew" => { :usedBy => "N", :type => :GvDouble }, "smoothing" => { :usedBy => "G", :type => :EscString }, # smoothType "sortv" => { :usedBy => "GCN", :type => :EscString }, # int "splines" => { :usedBy => "G", :type => :EscString }, # bool, string "start" => { :usedBy => "G", :type => :EscString }, # startType "style" => { :usedBy => "ENCG", :type => :EscString }, # style "stylesheet" => { :usedBy => "G", :type => :EscString }, # string "tailURL" => { :usedBy => "E", :type => :EscString }, "tail_lp" => { :usedBy => "E", :type => :EscString }, #point "tailclip" => { :usedBy => "E", :type => :GvBool }, # bool "tailhref" => { :usedBy => "E", :type => :EscString }, "taillabel" => { :usedBy => "E", :type => :EscString }, # lblString "tailport" => { :usedBy => "E", :type => :EscString }, # portPos "tailtarget" => { :usedBy => "E", :type => :EscString }, "tailtooltip" => { :usedBy => "E", :type => :EscString }, "target" => { :usedBy => "ENGC", :type => :EscString }, # escString, string "tooltip" => { :usedBy => "NEC", :type => :EscString }, "truecolor" => { :usedBy => "G", :type => :GvBool }, # bool "vertices" => { :usedBy => "N", :type => :EscString }, # pointfList "viewport" => { :usedBy => "G", :type => :EscString }, # viewPort "voro_margin" => { :usedBy => "G", :type => :GvDouble }, "weight" => { :usedBy => "E", :type => :GvDouble }, "width" => { :usedBy => "N", :type => :GvDouble }, "xdotversion" => { :usedBy => "G", :type => :EscString }, "xlabel" => { :usedBy => "EN", :type => :LblString }, "xlp" => { :usedBy => "EN", :type => :EscString }, # point "z" => { :usedBy => "N", :type => :GvDouble } } ## Const: Graph attributes GRAPHSATTRS = GraphViz::Constants::getAttrsFor( /G|S|C/ ) ## Const: Node attributes NODESATTRS = GraphViz::Constants::getAttrsFor( /N/ ) ## Const: Edge attributes EDGESATTRS = GraphViz::Constants::getAttrsFor( /E/ ) end end ruby-graphviz-1.2.3/lib/graphviz/edge.rb0000644000004100000410000001464413111037426020216 0ustar www-datawww-data# Copyright (C) 2004 - 2012 Gregoire Lejeune # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA require 'graphviz/attrs' require 'graphviz/constants' class GraphViz class Edge include GraphViz::Constants # Create a new edge # # In: # * vNodeOne : First node (can be a GraphViz::Node or a node ID) # * vNodeTwo : Second node (can be a GraphViz::Node or a node ID) # * parent_graph : Graph def initialize( vNodeOne, vNodeTwo, parent_graph ) @node_one_id, @node_one_port = getNodeNameAndPort( vNodeOne ) @node_two_id, @node_two_port = getNodeNameAndPort( vNodeTwo ) @parent_graph = parent_graph @edge_attributes = GraphViz::Attrs::new( nil, "edge", EDGESATTRS ) @index = nil unless @parent_graph.directed? (@parent_graph.find_node(@node_one_id) || @parent_graph.add_nodes(@node_one_id)).incidents << (@parent_graph.find_node(@node_two_id) || @parent_graph.add_nodes(@node_two_id)) (@parent_graph.find_node(@node_two_id) || @parent_graph.add_nodes(@node_two_id)).neighbors << (@parent_graph.find_node(@node_one_id) || @parent_graph.add_nodes(@node_one_id)) end (@parent_graph.find_node(@node_one_id) || @parent_graph.add_nodes(@node_one_id)).neighbors << (@parent_graph.find_node(@node_two_id) || @parent_graph.add_nodes(@node_two_id)) (@parent_graph.find_node(@node_two_id) || @parent_graph.add_nodes(@node_two_id)).incidents << (@parent_graph.find_node(@node_one_id) || @parent_graph.add_nodes(@node_one_id)) end # Return the node one as string (so with port if any) def node_one(with_port = true, escaped = true) if not(@node_one_port and with_port) escaped ? GraphViz.escape(@node_one_id) : @node_one_id else escaped ? GraphViz.escape(@node_one_id, :force => true) + ":#{@node_one_port}" : "#{@node_one_id}:#{@node_one_port}" end end alias :tail_node :node_one # Return the node two as string (so with port if any) def node_two(with_port = true, escaped = true) if not(@node_two_port and with_port) escaped ? GraphViz.escape(@node_two_id) : @node_two_id else escaped ? GraphViz.escape(@node_two_id, :force => true) + ":#{@node_two_port}" : "#{@node_two_id}:#{@node_two_port}" end end alias :head_node :node_two # Return the index of the edge def index @index end def index=(i) #:nodoc: @index = i if @index == nil end # Set value +attribute_value+ to the edge attribute +attribute_name+ def []=( attribute_name, attribute_value ) attribute_value = attribute_value.to_s if attribute_value.class == Symbol @edge_attributes[attribute_name.to_s] = attribute_value end # Set values for edge attributes or # get the value of the given edge attribute +attribute_name+ def []( attribute_name ) # Modification by axgle (https://github.com/axgle) if Hash === attribute_name attribute_name.each do |key, value| self[key] = value end else if @edge_attributes[attribute_name.to_s] @edge_attributes[attribute_name.to_s].clone else nil end end end # # Calls block once for each attribute of the edge, passing the name and value to the # block as a two-element array. # # If global is set to false, the block does not receive the attributes set globally # def each_attribute(global = true, &b) attrs = @edge_attributes.to_h if global attrs = pg.edge.to_h.merge attrs end attrs.each do |k,v| yield(k,v) end end def each_attribut(global = true, &b) warn "`GraphViz::Edge#each_attribut` is deprecated, please use `GraphViz::Edge#each_attribute`" each_attribute(global, &b) end def <<( node ) #:nodoc: n = @parent_graph.get_node(@node_two_id) GraphViz::commonGraph( node, n ).add_edges( n, node ) end alias :> :<< #:nodoc: alias :- :<< #:nodoc: alias :>> :<< #:nodoc: # # Return the root graph # def root_graph return( (self.pg.nil?) ? nil : self.pg.root_graph ) end def pg #:nodoc: @parent_graph end # Set edge attributes # # Example : # e = graph.add_edges( ... ) # ... # e.set { |_e| # _e.color = "blue" # _e.fontcolor = "red" # } def set( &b ) yield( self ) end # Add edge options # use edge.