pax_global_header00006660000000000000000000000064136302176100014511gustar00rootroot0000000000000052 comment=63f4bfae9ce294a7c84693a278d8bcc4e937afb4 Ruby-Graphviz-1.2.5/000077500000000000000000000000001363021761000142275ustar00rootroot00000000000000Ruby-Graphviz-1.2.5/.all-contributorsrc000066400000000000000000000177671363021761000201020ustar00rootroot00000000000000{ "projectName": "Ruby-Graphviz", "projectOwner": "glejeune", "repoType": "github", "repoHost": "https://github.com", "badgeTemplate": "[![All Contributors](https://img.shields.io/badge/all_contributors-<%= contributors.length %>-orange.svg)](#contributors)", "files": [ "README.md" ], "imageSize": 100, "commit": true, "contributors": [ { "login": "dburt", "name": "Dave Burt", "avatar_url": "https://avatars0.githubusercontent.com/u/139988?v=4", "profile": "https://github.com/dburt", "contributions": [ "code" ] }, { "login": "obruening", "name": "obruening", "avatar_url": "https://avatars2.githubusercontent.com/u/146361?v=4", "profile": "https://github.com/obruening", "contributions": [ "code" ] }, { "login": "hipe", "name": "Chip Malice", "avatar_url": "https://avatars1.githubusercontent.com/u/22006?v=4", "profile": "https://github.com/hipe", "contributions": [ "code" ] }, { "login": "MSNexploder", "name": "Stefan Stüben", "avatar_url": "https://avatars3.githubusercontent.com/u/101456?v=4", "profile": "https://github.com/MSNexploder", "contributions": [ "code" ] }, { "login": "oupo", "name": "oupo", "avatar_url": "https://avatars1.githubusercontent.com/u/143470?v=4", "profile": "https://github.com/oupo", "contributions": [ "code" ] }, { "login": "glejeune", "name": "Gregoire Lejeune", "avatar_url": "https://avatars1.githubusercontent.com/u/15168?v=4", "profile": "http://lejeun.es", "contributions": [ "code", "design", "doc" ] }, { "login": "markus1189", "name": "Markus Hauck", "avatar_url": "https://avatars0.githubusercontent.com/u/591567?v=4", "profile": "https://github.com/markus1189", "contributions": [ "code" ] }, { "login": "khalilfazal", "name": "Khalil Fazal", "avatar_url": "https://avatars2.githubusercontent.com/u/308027?v=4", "profile": "https://github.com/khalilfazal", "contributions": [ "code" ] }, { "login": "kachick", "name": "Kenichi Kamiya", "avatar_url": "https://avatars2.githubusercontent.com/u/1180335?v=4", "profile": "https://github.com/kachick", "contributions": [ "code" ] }, { "login": "nevenh", "name": "Neven Has", "avatar_url": "https://avatars0.githubusercontent.com/u/1448453?v=4", "profile": "https://github.com/nevenh", "contributions": [ "code" ] }, { "login": "AndrewKvalheim", "name": "Andrew", "avatar_url": "https://avatars1.githubusercontent.com/u/1844746?v=4", "profile": "https://Andrew.Kvalhe.im", "contributions": [ "code" ] }, { "login": "dznz", "name": "Daniel Zollinger", "avatar_url": "https://avatars3.githubusercontent.com/u/245206?v=4", "profile": "https://github.com/dznz", "contributions": [ "code" ] }, { "login": "guilhermesimoes", "name": "Guilherme Simoes", "avatar_url": "https://avatars0.githubusercontent.com/u/531168?v=4", "profile": "https://guilhermesimoes.github.io", "contributions": [ "code" ] }, { "login": "OrelSokolov", "name": "Oleg Orlov", "avatar_url": "https://avatars0.githubusercontent.com/u/2205407?v=4", "profile": "https://github.com/OrelSokolov", "contributions": [ "code" ] }, { "login": "gkop", "name": "Gabe Kopley", "avatar_url": "https://avatars3.githubusercontent.com/u/222582?v=4", "profile": "https://www.instagram.com/stewiecutedog/", "contributions": [ "code" ] }, { "login": "shepmaster", "name": "Jake Goulding", "avatar_url": "https://avatars0.githubusercontent.com/u/174509?v=4", "profile": "http://jakegoulding.com", "contributions": [ "code" ] }, { "login": "hirochachacha", "name": "hirochachacha", "avatar_url": "https://avatars0.githubusercontent.com/u/898442?v=4", "profile": "https://github.com/hirochachacha", "contributions": [ "code" ] }, { "login": "ronen", "name": "ronen barzel", "avatar_url": "https://avatars2.githubusercontent.com/u/125620?v=4", "profile": "http://www.ronenbarzel.org", "contributions": [ "code" ] }, { "login": "jergason", "name": "Jamison Dance", "avatar_url": "https://avatars1.githubusercontent.com/u/72027?v=4", "profile": "https://jamison.dance", "contributions": [ "code", "doc" ] }, { "login": "josephholsten", "name": "Joseph Anthony Pasquale Holsten", "avatar_url": "https://avatars3.githubusercontent.com/u/7495?v=4", "profile": "http://josephholsten.com", "contributions": [ "code" ] }, { "login": "mfcabrera", "name": "Miguel Cabrera", "avatar_url": "https://avatars0.githubusercontent.com/u/12527?v=4", "profile": "http://mfcabrera.com", "contributions": [ "code" ] }, { "login": "miketheman", "name": "Mike Fiedler", "avatar_url": "https://avatars0.githubusercontent.com/u/529516?v=4", "profile": "http://www.miketheman.net", "contributions": [ "code" ] }, { "login": "nathanl", "name": "Nathan Long", "avatar_url": "https://avatars2.githubusercontent.com/u/338814?v=4", "profile": "http://nathanmlong.com", "contributions": [ "code", "doc" ] }, { "login": "olleolleolle", "name": "Olle Jonsson", "avatar_url": "https://avatars0.githubusercontent.com/u/211?v=4", "profile": "http://ollehost.dk/", "contributions": [ "code", "doc" ] }, { "login": "postmodern", "name": "Postmodern", "avatar_url": "https://avatars2.githubusercontent.com/u/12671?v=4", "profile": "http://postmodern.github.com/", "contributions": [ "code" ] }, { "login": "reiz", "name": "Robert Reiz", "avatar_url": "https://avatars0.githubusercontent.com/u/652130?v=4", "profile": "https://www.versioneye.com", "contributions": [ "code" ] }, { "login": "coding46", "name": "Göran Bodenschatz", "avatar_url": "https://avatars2.githubusercontent.com/u/1724196?v=4", "profile": "http://46halbe.de", "contributions": [ "code" ] }, { "login": "hsbt", "name": "SHIBATA Hiroshi", "avatar_url": "https://avatars1.githubusercontent.com/u/12301?v=4", "profile": "https://www.hsbt.org/", "contributions": [ "code" ] }, { "login": "moracca", "name": "moracca", "avatar_url": "https://avatars1.githubusercontent.com/u/7213746?v=4", "profile": "https://github.com/moracca", "contributions": [ "code" ] }, { "login": "TPei", "name": "TPei", "avatar_url": "https://avatars0.githubusercontent.com/u/4004343?v=4", "profile": "https://github.com/TPei", "contributions": [ "doc" ] }, { "login": "villuorav", "name": "Villu Orav", "avatar_url": "https://avatars3.githubusercontent.com/u/8543094?v=4", "profile": "https://github.com/villuorav", "contributions": [ "doc" ] }, { "login": "deivid-rodriguez", "name": "David Rodríguez", "avatar_url": "https://avatars2.githubusercontent.com/u/2887858?v=4", "profile": "https://github.com/deivid-rodriguez", "contributions": [ "code", "platform" ] } ], "commitConvention": "none" } Ruby-Graphviz-1.2.5/.gemrc000066400000000000000000000000001363021761000153130ustar00rootroot00000000000000Ruby-Graphviz-1.2.5/.github/000077500000000000000000000000001363021761000155675ustar00rootroot00000000000000Ruby-Graphviz-1.2.5/.github/ISSUE_TEMPLATE/000077500000000000000000000000001363021761000177525ustar00rootroot00000000000000Ruby-Graphviz-1.2.5/.github/ISSUE_TEMPLATE/bug_report.md000066400000000000000000000011661363021761000224500ustar00rootroot00000000000000--- name: Bug report about: Create a report to help us improve title: '' labels: '' assignees: '' --- **Describe the bug** A clear and concise description of what the bug is. **To Reproduce** Steps to reproduce the behavior: 1. Go to '...' 2. Click on '....' 3. Scroll down to '....' 4. See error **Expected behavior** A clear and concise description of what you expected to happen. **Environment (please complete the following information):** - OS: [e.g. Ubuntu] - Version [e.g. 18.04] - Ruby Manager [e.g. rbenv] - Ruby Manager Version [e.g. 1.1.1] **Additional context** Add any other context about the problem here. Ruby-Graphviz-1.2.5/.github/ISSUE_TEMPLATE/feature_request.md000066400000000000000000000011231363021761000234740ustar00rootroot00000000000000--- name: Feature request about: Suggest an idea for this project title: '' labels: '' assignees: '' --- **Is your feature request related to a problem? Please describe.** A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] **Describe the solution you'd like** A clear and concise description of what you want to happen. **Describe alternatives you've considered** A clear and concise description of any alternative solutions or features you've considered. **Additional context** Add any other context or screenshots about the feature request here. Ruby-Graphviz-1.2.5/.gitignore000066400000000000000000000001621363021761000162160ustar00rootroot00000000000000.DS_Store .idea *.iml doc pkg test/output/ .rake_tasks .rbx Gemfile.lock .yardoc/ node_modules/ package-lock.json Ruby-Graphviz-1.2.5/.travis.yml000066400000000000000000000001151363021761000163350ustar00rootroot00000000000000dist: xenial rvm: - 2.4.9 - 2.5.7 - 2.6.5 - 2.7.0 - jruby-9.2.9.0 Ruby-Graphviz-1.2.5/.yardopts000066400000000000000000000006601363021761000160770ustar00rootroot00000000000000--protected --no-private --embed-mixin ClassMethods --title "Ruby/GraphViz, the Documentation" - README.md CHANGELOG.md COPYING.md 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 Ruby-Graphviz-1.2.5/CHANGELOG.md000066400000000000000000000350351363021761000160460ustar00rootroot00000000000000# Change Log ## [v1.2.4](https://github.com/glejeune/Ruby-Graphviz/tree/v1.2.4) (2018-11-13) [Full Changelog](https://github.com/glejeune/Ruby-Graphviz/compare/v1.2.3...v1.2.4) **Closed issues:** - sametail and samehead not working? [\#132](https://github.com/glejeune/Ruby-Graphviz/issues/132) **Merged pull requests:** - Add support for the 'class' attribute [\#138](https://github.com/glejeune/Ruby-Graphviz/pull/138) ([moracca](https://github.com/moracca)) - Added explicitly declaration for Open3 module on GraphVizTest. [\#130](https://github.com/glejeune/Ruby-Graphviz/pull/130) ([hsbt](https://github.com/hsbt)) ## [v1.2.3](https://github.com/glejeune/Ruby-Graphviz/tree/v1.2.3) (2017-03-21) [Full Changelog](https://github.com/glejeune/Ruby-Graphviz/compare/v1.2.2...v1.2.3) **Closed issues:** - Link to https://lejeun.es/ doesn't work [\#114](https://github.com/glejeune/Ruby-Graphviz/issues/114) - How to unflatten the graph? [\#67](https://github.com/glejeune/Ruby-Graphviz/issues/67) **Merged pull requests:** - Add gemspec requirements attribute [\#128](https://github.com/glejeune/Ruby-Graphviz/pull/128) ([guilhermesimoes](https://github.com/guilhermesimoes)) - Update links to HTTPS [\#127](https://github.com/glejeune/Ruby-Graphviz/pull/127) ([guilhermesimoes](https://github.com/guilhermesimoes)) - README: Use SVG badge icons [\#126](https://github.com/glejeune/Ruby-Graphviz/pull/126) ([olleolleolle](https://github.com/olleolleolle)) - Managed to get rubinius-3.69 to build with Travis-CI [\#123](https://github.com/glejeune/Ruby-Graphviz/pull/123) ([khalilfazal](https://github.com/khalilfazal)) - ruby 2.4.0 merged Fixnum and Bignum into Integer [\#121](https://github.com/glejeune/Ruby-Graphviz/pull/121) ([khalilfazal](https://github.com/khalilfazal)) - Make it obvious which gem this is [\#119](https://github.com/glejeune/Ruby-Graphviz/pull/119) ([nathanl](https://github.com/nathanl)) - Adding license info to gempsec [\#118](https://github.com/glejeune/Ruby-Graphviz/pull/118) ([reiz](https://github.com/reiz)) ## [v1.2.2](https://github.com/glejeune/Ruby-Graphviz/tree/v1.2.2) (2015-05-13) [Full Changelog](https://github.com/glejeune/Ruby-Graphviz/compare/v1.2.1...v1.2.2) **Fixed bugs:** - Can no longer create binary strings [\#92](https://github.com/glejeune/Ruby-Graphviz/issues/92) **Closed issues:** - uninitialized constant GraphViz \(NameError\) [\#95](https://github.com/glejeune/Ruby-Graphviz/issues/95) - labelfontcolor [\#86](https://github.com/glejeune/Ruby-Graphviz/issues/86) **Merged pull requests:** - Remove duplication in utils/colors.rb [\#103](https://github.com/glejeune/Ruby-Graphviz/pull/103) ([OrelSokolov](https://github.com/OrelSokolov)) ## [v1.2.1](https://github.com/glejeune/Ruby-Graphviz/tree/v1.2.1) (2014-07-02) [Full Changelog](https://github.com/glejeune/Ruby-Graphviz/compare/v1.2.0...v1.2.1) ## [v1.2.0](https://github.com/glejeune/Ruby-Graphviz/tree/v1.2.0) (2014-06-09) [Full Changelog](https://github.com/glejeune/Ruby-Graphviz/compare/v1.1.0...v1.2.0) **Fixed bugs:** - Force label to be HTML [\#89](https://github.com/glejeune/Ruby-Graphviz/issues/89) **Closed issues:** - Drawing a graph fails when a node is called "node" [\#90](https://github.com/glejeune/Ruby-Graphviz/issues/90) - Node IDs are not escaped for reserved keywords [\#87](https://github.com/glejeune/Ruby-Graphviz/issues/87) - time for another gem? [\#85](https://github.com/glejeune/Ruby-Graphviz/issues/85) - Theory\#moore\_dijkstra doesn't play nice with escaping [\#83](https://github.com/glejeune/Ruby-Graphviz/issues/83) - Rename project and gem on rubygems [\#80](https://github.com/glejeune/Ruby-Graphviz/issues/80) ## [v1.1.0](https://github.com/glejeune/Ruby-Graphviz/tree/v1.1.0) (2014-06-09) [Full Changelog](https://github.com/glejeune/Ruby-Graphviz/compare/v1.0.9...v1.1.0) **Fixed bugs:** - Dot2Ruby Subgraph of subgraph [\#74](https://github.com/glejeune/Ruby-Graphviz/issues/74) - RGB color list - supported? [\#70](https://github.com/glejeune/Ruby-Graphviz/issues/70) **Closed issues:** - Duplicate [\#75](https://github.com/glejeune/Ruby-Graphviz/issues/75) - don't treat dot's output into stderr as error. check dot's return code [\#72](https://github.com/glejeune/Ruby-Graphviz/issues/72) - Trouble with dot2ruby [\#71](https://github.com/glejeune/Ruby-Graphviz/issues/71) - HTML-like labels supported [\#64](https://github.com/glejeune/Ruby-Graphviz/issues/64) - How to combine graphviz instances? [\#61](https://github.com/glejeune/Ruby-Graphviz/issues/61) - man pages for the commandline programs [\#57](https://github.com/glejeune/Ruby-Graphviz/issues/57) **Merged pull requests:** - Node name error [\#91](https://github.com/glejeune/Ruby-Graphviz/pull/91) ([joaozeni](https://github.com/joaozeni)) - Escape reserved words in node IDs [\#88](https://github.com/glejeune/Ruby-Graphviz/pull/88) ([joaomsa](https://github.com/joaomsa)) - only escape Edge\#node\_one and Edge\#node\_two when output [\#84](https://github.com/glejeune/Ruby-Graphviz/pull/84) ([josephholsten](https://github.com/josephholsten)) - Avoid constructing shell commands as strings [\#73](https://github.com/glejeune/Ruby-Graphviz/pull/73) ([AndrewKvalheim](https://github.com/AndrewKvalheim)) ## [v1.0.9](https://github.com/glejeune/Ruby-Graphviz/tree/v1.0.9) (2013-04-24) [Full Changelog](https://github.com/glejeune/Ruby-Graphviz/compare/v1.0.8...v1.0.9) **Fixed bugs:** - ruby2gv is failing [\#56](https://github.com/glejeune/Ruby-Graphviz/issues/56) **Closed issues:** - ruby-graphviz breaks autoloading of ActiveSupport::Concerns [\#65](https://github.com/glejeune/Ruby-Graphviz/issues/65) - Can't convert Fixnum to String \(TypeError\) [\#59](https://github.com/glejeune/Ruby-Graphviz/issues/59) - tests are failing to run in a chroot environment [\#58](https://github.com/glejeune/Ruby-Graphviz/issues/58) - Avoid autoload [\#55](https://github.com/glejeune/Ruby-Graphviz/issues/55) - why deprecate add\_node\(\) and add\_edge\(\)? [\#53](https://github.com/glejeune/Ruby-Graphviz/issues/53) - feature request: title on graph [\#23](https://github.com/glejeune/Ruby-Graphviz/issues/23) **Merged pull requests:** - Fix typo [\#63](https://github.com/glejeune/Ruby-Graphviz/pull/63) ([kachick](https://github.com/kachick)) - Remove some warnings [\#62](https://github.com/glejeune/Ruby-Graphviz/pull/62) ([kachick](https://github.com/kachick)) - Fix for numberic labels, tested. Fixes \#59. [\#60](https://github.com/glejeune/Ruby-Graphviz/pull/60) ([gkop](https://github.com/gkop)) - Fixes a couple of typos and spacing [\#54](https://github.com/glejeune/Ruby-Graphviz/pull/54) ([miketheman](https://github.com/miketheman)) - Extracted xDOTScript to DOTScript class [\#52](https://github.com/glejeune/Ruby-Graphviz/pull/52) ([markus1189](https://github.com/markus1189)) ## [v1.0.8](https://github.com/glejeune/Ruby-Graphviz/tree/v1.0.8) (2012-07-03) [Full Changelog](https://github.com/glejeune/Ruby-Graphviz/compare/v1.0.7...v1.0.8) **Fixed bugs:** - add\_graph fails when passed a GraphViz object [\#48](https://github.com/glejeune/Ruby-Graphviz/issues/48) **Closed issues:** - \(undefined local variable or method `file' \) [\#49](https://github.com/glejeune/Ruby-Graphviz/issues/49) **Merged pull requests:** - Fix issue \#49 [\#51](https://github.com/glejeune/Ruby-Graphviz/pull/51) ([markus1189](https://github.com/markus1189)) - Cleanup format [\#50](https://github.com/glejeune/Ruby-Graphviz/pull/50) ([markus1189](https://github.com/markus1189)) ## [v1.0.7](https://github.com/glejeune/Ruby-Graphviz/tree/v1.0.7) (2012-07-02) [Full Changelog](https://github.com/glejeune/Ruby-Graphviz/compare/v1.0.6...v1.0.7) **Merged pull requests:** - Find executable [\#47](https://github.com/glejeune/Ruby-Graphviz/pull/47) ([markus1189](https://github.com/markus1189)) ## [v1.0.6](https://github.com/glejeune/Ruby-Graphviz/tree/v1.0.6) (2012-07-01) [Full Changelog](https://github.com/glejeune/Ruby-Graphviz/compare/v1.0.5...v1.0.6) **Fixed bugs:** - escaped dot in label, backslash showing up [\#42](https://github.com/glejeune/Ruby-Graphviz/issues/42) - cannot load such file -- xml/xslt [\#39](https://github.com/glejeune/Ruby-Graphviz/issues/39) **Closed issues:** - some tests fail because it cannot find 'dot' [\#46](https://github.com/glejeune/Ruby-Graphviz/issues/46) - GraphML importation doesn't work... [\#40](https://github.com/glejeune/Ruby-Graphviz/issues/40) - Can't assign nil to node attributes [\#38](https://github.com/glejeune/Ruby-Graphviz/issues/38) **Merged pull requests:** - Fix for copy/paste error [\#45](https://github.com/glejeune/Ruby-Graphviz/pull/45) ([coding46](https://github.com/coding46)) - characters escaping [\#44](https://github.com/glejeune/Ruby-Graphviz/pull/44) ([nevenh](https://github.com/nevenh)) - Added lib/ruby-graphviz to match the gem name. [\#43](https://github.com/glejeune/Ruby-Graphviz/pull/43) ([postmodern](https://github.com/postmodern)) ## [v1.0.5](https://github.com/glejeune/Ruby-Graphviz/tree/v1.0.5) (2012-02-06) [Full Changelog](https://github.com/glejeune/Ruby-Graphviz/compare/v1.0.4...v1.0.5) **Fixed bugs:** - About the acquisition of graphml \ tags with ruby 1.9.2p290, ruby-graphviz 1.0.3 [\#34](https://github.com/glejeune/Ruby-Graphviz/issues/34) ## [v1.0.4](https://github.com/glejeune/Ruby-Graphviz/tree/v1.0.4) (2012-01-29) [Full Changelog](https://github.com/glejeune/Ruby-Graphviz/compare/v1.0.3...v1.0.4) **Merged pull requests:** - Correct spelling of 'attribute' in node documentation [\#37](https://github.com/glejeune/Ruby-Graphviz/pull/37) ([shepmaster](https://github.com/shepmaster)) - Update example to reflect deprecation of methods [\#36](https://github.com/glejeune/Ruby-Graphviz/pull/36) ([shepmaster](https://github.com/shepmaster)) ## [v1.0.3](https://github.com/glejeune/Ruby-Graphviz/tree/v1.0.3) (2011-12-17) [Full Changelog](https://github.com/glejeune/Ruby-Graphviz/compare/v1.0.2...v1.0.3) **Merged pull requests:** - Removed definition of Array\#all? from core\_ext.rb [\#33](https://github.com/glejeune/Ruby-Graphviz/pull/33) ([ronen](https://github.com/ronen)) ## [v1.0.2](https://github.com/glejeune/Ruby-Graphviz/tree/v1.0.2) (2011-12-11) [Full Changelog](https://github.com/glejeune/Ruby-Graphviz/compare/v1.0.1...v1.0.2) **Closed issues:** - Instead of outputting an image, is it possible to get the x,y coordinates of each of the nodes? [\#28](https://github.com/glejeune/Ruby-Graphviz/issues/28) **Merged pull requests:** - fix utils/colors.rb's case syntax [\#32](https://github.com/glejeune/Ruby-Graphviz/pull/32) ([hirochachacha](https://github.com/hirochachacha)) ## [v1.0.1](https://github.com/glejeune/Ruby-Graphviz/tree/v1.0.1) (2011-12-08) [Full Changelog](https://github.com/glejeune/Ruby-Graphviz/compare/1.0.0...v1.0.1) **Closed issues:** - How can I add named edges? [\#31](https://github.com/glejeune/Ruby-Graphviz/issues/31) **Merged pull requests:** - Fix a few typos in the README. [\#30](https://github.com/glejeune/Ruby-Graphviz/pull/30) ([jergason](https://github.com/jergason)) - Changed deprecated Config to RbConfig in util.rb [\#29](https://github.com/glejeune/Ruby-Graphviz/pull/29) ([ronen](https://github.com/ronen)) - Add rubygems-test .gemrc file to enable easy testing of the installed gem [\#26](https://github.com/glejeune/Ruby-Graphviz/pull/26) ([dznz](https://github.com/dznz)) - Update gem creation [\#25](https://github.com/glejeune/Ruby-Graphviz/pull/25) ([dznz](https://github.com/dznz)) ## [1.0.0](https://github.com/glejeune/Ruby-Graphviz/tree/1.0.0) (2011-05-02) [Full Changelog](https://github.com/glejeune/Ruby-Graphviz/compare/0.9.21...1.0.0) ## [0.9.21](https://github.com/glejeune/Ruby-Graphviz/tree/0.9.21) (2011-03-26) [Full Changelog](https://github.com/glejeune/Ruby-Graphviz/compare/0.9.20...0.9.21) ## [0.9.20](https://github.com/glejeune/Ruby-Graphviz/tree/0.9.20) (2010-11-20) [Full Changelog](https://github.com/glejeune/Ruby-Graphviz/compare/0.9.19...0.9.20) ## [0.9.19](https://github.com/glejeune/Ruby-Graphviz/tree/0.9.19) (2010-10-30) [Full Changelog](https://github.com/glejeune/Ruby-Graphviz/compare/0.9.18...0.9.19) ## [0.9.18](https://github.com/glejeune/Ruby-Graphviz/tree/0.9.18) (2010-10-07) [Full Changelog](https://github.com/glejeune/Ruby-Graphviz/compare/0.9.17...0.9.18) ## [0.9.17](https://github.com/glejeune/Ruby-Graphviz/tree/0.9.17) (2010-08-29) [Full Changelog](https://github.com/glejeune/Ruby-Graphviz/compare/0.9.16...0.9.17) ## [0.9.16](https://github.com/glejeune/Ruby-Graphviz/tree/0.9.16) (2010-08-02) [Full Changelog](https://github.com/glejeune/Ruby-Graphviz/compare/0.9.15...0.9.16) ## [0.9.15](https://github.com/glejeune/Ruby-Graphviz/tree/0.9.15) (2010-07-19) [Full Changelog](https://github.com/glejeune/Ruby-Graphviz/compare/0.9.14...0.9.15) ## [0.9.14](https://github.com/glejeune/Ruby-Graphviz/tree/0.9.14) (2010-07-12) [Full Changelog](https://github.com/glejeune/Ruby-Graphviz/compare/0.9.13...0.9.14) ## [0.9.13](https://github.com/glejeune/Ruby-Graphviz/tree/0.9.13) (2010-07-06) [Full Changelog](https://github.com/glejeune/Ruby-Graphviz/compare/0.9.12...0.9.13) ## [0.9.12](https://github.com/glejeune/Ruby-Graphviz/tree/0.9.12) (2010-06-24) [Full Changelog](https://github.com/glejeune/Ruby-Graphviz/compare/0.9.11...0.9.12) ## [0.9.11](https://github.com/glejeune/Ruby-Graphviz/tree/0.9.11) (2010-03-28) [Full Changelog](https://github.com/glejeune/Ruby-Graphviz/compare/0.9.9...0.9.11) ## [0.9.9](https://github.com/glejeune/Ruby-Graphviz/tree/0.9.9) (2010-02-12) [Full Changelog](https://github.com/glejeune/Ruby-Graphviz/compare/0.9.8...0.9.9) ## [0.9.8](https://github.com/glejeune/Ruby-Graphviz/tree/0.9.8) (2010-01-16) [Full Changelog](https://github.com/glejeune/Ruby-Graphviz/compare/0.9.7...0.9.8) ## [0.9.7](https://github.com/glejeune/Ruby-Graphviz/tree/0.9.7) (2009-12-18) [Full Changelog](https://github.com/glejeune/Ruby-Graphviz/compare/0.9.5...0.9.7) ## [0.9.5](https://github.com/glejeune/Ruby-Graphviz/tree/0.9.5) (2009-11-15) [Full Changelog](https://github.com/glejeune/Ruby-Graphviz/compare/0.9.4...0.9.5) ## [0.9.4](https://github.com/glejeune/Ruby-Graphviz/tree/0.9.4) (2009-10-20) [Full Changelog](https://github.com/glejeune/Ruby-Graphviz/compare/0.9.3...0.9.4) ## [0.9.3](https://github.com/glejeune/Ruby-Graphviz/tree/0.9.3) (2009-10-19) [Full Changelog](https://github.com/glejeune/Ruby-Graphviz/compare/0.9.2...0.9.3) ## [0.9.2](https://github.com/glejeune/Ruby-Graphviz/tree/0.9.2) (2009-10-15) [Full Changelog](https://github.com/glejeune/Ruby-Graphviz/compare/0.9.1...0.9.2) ## [0.9.1](https://github.com/glejeune/Ruby-Graphviz/tree/0.9.1) (2009-10-10) \* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*Ruby-Graphviz-1.2.5/COPYING.md000066400000000000000000000425541363021761000156730ustar00rootroot00000000000000# GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. ## Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. ## GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0.This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1.You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2.You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3.You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4.You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5.You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6.Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7.If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8.If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9.The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10.If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. ## NO WARRANTY 11.BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12.IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. ## END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 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 Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. Ruby-Graphviz-1.2.5/Gemfile000066400000000000000000000001401363021761000155150ustar00rootroot00000000000000source "http://rubygems.org" # Specify your gem's dependencies in ruby-graphviz.gemspec gemspecRuby-Graphviz-1.2.5/README.md000066400000000000000000000403611363021761000155120ustar00rootroot00000000000000# Ruby/GraphViz [![All Contributors](https://img.shields.io/badge/all_contributors-31-orange.svg)](#contributors) [![Travis CI build](https://secure.travis-ci.org/glejeune/Ruby-Graphviz.svg)](https://travis-ci.org/glejeune/Ruby-Graphviz) [![Gem Version](https://badge.fury.io/rb/ruby-graphviz.svg)](https://rubygems.org/gems/ruby-graphviz) Copyright (C) 2004-2018 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 ## INSTALLATION Add this line to your application's Gemfile: gem 'ruby-graphviz' And then execute: $ bundle Or install it yourself as: $ gem install ruby-graphviz ## DESCRIPTION Interface to the GraphViz graphing tool ## TODO * New FamilyTree ## SYNOPSIS A basic example ```ruby require 'ruby-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 ```ruby require 'ruby-graphviz' GraphViz::new( :G, :type => :digraph ) { |g| g.world( :label => "World" ) << g.hello( :label => "Hello" ) }.output( :png => "hello_world.png" ) ``` Or with the DSL ```ruby require 'ruby-graphviz/dsl' digraph :G do world[:label => "World"] << hello[:label => "Hello"] output :png => "hello_world.png" end ``` Create a graph from a file ```ruby require 'ruby-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 ```ruby require 'ruby-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 ```ruby ruby2gv -Tpng -oruby2gv.png ruby2gv ``` * `gem2gv`, a tool that allows you to create a dependency graph between gems. Example : http://drp.ly/dSj9Y ```ruby gem2gv -Tpng -oruby-graphviz.png ruby-graphviz ``` * `dot2ruby`, a tool that allows you to create a ruby script from a graphviz script ```ruby $ cat hello.dot digraph G {Hello->World;} $ dot2ruby hello.dot # This code was generated by dot2ruby.g require 'rubygems' require 'ruby-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 ```ruby require 'ruby-graphviz' require 'ruby-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 ## Contributors Thanks goes to these wonderful people ([emoji key](https://github.com/kentcdodds/all-contributors#emoji-key)):

Dave Burt

💻

obruening

💻

Chip Malice

💻

Stefan Stüben

💻

oupo

💻

Gregoire Lejeune

💻 🎨 📖

Markus Hauck

💻

Khalil Fazal

💻

Kenichi Kamiya

💻

Neven Has

💻

Andrew

💻

Daniel Zollinger

💻

Guilherme Simoes

💻

Oleg Orlov

💻

Gabe Kopley

💻

Jake Goulding

💻

hirochachacha

💻

ronen barzel

💻

Jamison Dance

💻 📖

Joseph Anthony Pasquale Holsten

💻

Miguel Cabrera

💻

Mike Fiedler

💻

Nathan Long

💻 📖

Olle Jonsson

💻 📖

Postmodern

💻

Robert Reiz

💻

Göran Bodenschatz

💻

SHIBATA Hiroshi

💻

moracca

💻

TPei

📖

Villu Orav

📖

David Rodríguez

💻 📦
This project follows the [all-contributors](https://github.com/kentcdodds/all-contributors) specification. Contributions of any kind welcome! Ruby-Graphviz-1.2.5/Rakefile000066400000000000000000000025641363021761000157030ustar00rootroot00000000000000$:.unshift( "lib" ) require "graphviz/constants" require 'rubygems' require 'rake/clean' require 'bundler' require 'rubygems/package_task' require 'rake/testtask' require 'fileutils' require 'open-uri' require 'yard' include FileUtils CLEAN.include ['**/.*.sw?', '*.gem', '.config', 'test/test.log'] desc "Packages up Ruby/GraphViz." task :default => [:test, :package] task :package => [:clean] task :doc => :yard YARD::Rake::YardocTask.new do |t| 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 namespace :changelog do desc "Update CHANGELOG" task :update do require "github_changelog_generator" GitHubChangelogGenerator::ChangelogGenerator.new.run end end Bundler::GemHelper.install_tasks namespace :contributors do desc "Install all-contributors-cli" task :install do sh "npm install --save-dev all-contributors-cli" end desc "Run" task :run do sh "npx all-contributors" end end Ruby-Graphviz-1.2.5/bin/000077500000000000000000000000001363021761000147775ustar00rootroot00000000000000Ruby-Graphviz-1.2.5/bin/dot2ruby000077500000000000000000000057361363021761000165120ustar00rootroot00000000000000#!/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.5/bin/gem2gv000077500000000000000000000117021363021761000161150ustar00rootroot00000000000000#!/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.5/bin/git2gv000077500000000000000000000116501363021761000161320ustar00rootroot00000000000000#!/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.5/bin/ruby2gv000077500000000000000000000162441363021761000163340ustar00rootroot00000000000000#!/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.5/bin/xml2gv000077500000000000000000000063241363021761000161510ustar00rootroot00000000000000#!/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.5/examples/000077500000000000000000000000001363021761000160455ustar00rootroot00000000000000Ruby-Graphviz-1.2.5/examples/dot/000077500000000000000000000000001363021761000166335ustar00rootroot00000000000000Ruby-Graphviz-1.2.5/examples/dot/JSP.dot000066400000000000000000000014451363021761000200030ustar00rootroot00000000000000digraph 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.5/examples/dot/balanced.dot000066400000000000000000000014121363021761000210720ustar00rootroot00000000000000graph 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.5/examples/dot/cluster.dot000066400000000000000000000006501363021761000210250ustar00rootroot00000000000000digraph 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.5/examples/dot/dotgraph.dot000066400000000000000000000015321363021761000211540ustar00rootroot00000000000000digraph 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.5/examples/dot/fsm.dot000066400000000000000000000011531363021761000201300ustar00rootroot00000000000000digraph 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.5/examples/dot/genetic.dot000066400000000000000000000046721363021761000207720ustar00rootroot00000000000000graph "" { 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.5/examples/dot/hello.dot000066400000000000000000000000311363021761000204400ustar00rootroot00000000000000digraph G {Hello->World;}Ruby-Graphviz-1.2.5/examples/dot/hello_test.rb000066400000000000000000000010451363021761000213220ustar00rootroot00000000000000#!/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.5/examples/dot/lion_share.dot000066400000000000000000000125471363021761000214770ustar00rootroot00000000000000digraph 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.5/examples/dot/prof.dot000066400000000000000000000140541363021761000203150ustar00rootroot00000000000000digraph 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.5/examples/dot/psg.dot000066400000000000000000000136071363021761000201430ustar00rootroot00000000000000digraph 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.5/examples/dot/rank.dot000066400000000000000000000002111363021761000202700ustar00rootroot00000000000000digraph G { subgraph { rank = same; "node1"; "node2"; } subgraph { rank = same; "nodeA"; "nodeB"; } node1 -> nodeA; node2 -> nodeB; }Ruby-Graphviz-1.2.5/examples/dot/sdh.dot000066400000000000000000000124361363021761000201270ustar00rootroot00000000000000digraph 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.5/examples/dot/siblings.dot000066400000000000000000000715121363021761000211630ustar00rootroot00000000000000digraph 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.5/examples/dot/so-sample001.gv000066400000000000000000000007541363021761000213200ustar00rootroot00000000000000digraph 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.5/examples/dot/so-sample002.gv000066400000000000000000000007261363021761000213200ustar00rootroot00000000000000 //{: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.5/examples/dot/so-sample003.gv000066400000000000000000000017101363021761000213130ustar00rootroot00000000000000 //{: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.5/examples/dot/test.dot000066400000000000000000000006021363021761000203200ustar00rootroot00000000000000digraph 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.5/examples/dot/test_parse.rb000066400000000000000000000003161363021761000213310ustar00rootroot00000000000000#!/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.5/examples/dot/this_crach_with_dot_2.20.dot000066400000000000000000000020041363021761000240100ustar00rootroot00000000000000graph 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.5/examples/dot/unix.dot000066400000000000000000000127031363021761000203310ustar00rootroot00000000000000digraph "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.5/examples/graphml/000077500000000000000000000000001363021761000174775ustar00rootroot00000000000000Ruby-Graphviz-1.2.5/examples/graphml/attributes.ext.graphml000066400000000000000000000010031363021761000240320ustar00rootroot00000000000000 Ruby-Graphviz-1.2.5/examples/graphml/attributes.graphml000066400000000000000000000024711363021761000232450ustar00rootroot00000000000000 yellow green blue red turquoise 1.0 1.0 2.0 1.1 Ruby-Graphviz-1.2.5/examples/graphml/cluster.graphml000066400000000000000000000045141363021761000225400ustar00rootroot00000000000000 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.5/examples/graphml/failed_graph.graphml000066400000000000000000000657071363021761000234770ustar00rootroot00000000000000 K L J E I H G D F B C A Ruby-Graphviz-1.2.5/examples/graphml/hyper.graphml000066400000000000000000000015411363021761000222030ustar00rootroot00000000000000 Ruby-Graphviz-1.2.5/examples/graphml/nested.graphml000066400000000000000000000041331363021761000223360ustar00rootroot00000000000000 black filled SUB n5 red filled SUB n6 SUB n6::n0 blue filled Ruby-Graphviz-1.2.5/examples/graphml/port.graphml000066400000000000000000000020031363021761000220320ustar00rootroot00000000000000 Ruby-Graphviz-1.2.5/examples/graphml/simple.graphml000066400000000000000000000020171363021761000223440ustar00rootroot00000000000000 Ruby-Graphviz-1.2.5/examples/hello.png000066400000000000000000000132611363021761000176610ustar00rootroot00000000000000PNG  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.5/examples/rgv/000077500000000000000000000000001363021761000166435ustar00rootroot00000000000000Ruby-Graphviz-1.2.5/examples/rgv/rgv.ps000066400000000000000000000055451363021761000200160ustar00rootroot00000000000000%! 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.5/examples/rgv/test_rgv.rb000066400000000000000000000006131363021761000210250ustar00rootroot00000000000000#!/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.5/examples/sample01.rb000066400000000000000000000014061363021761000200150ustar00rootroot00000000000000#!/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.5/examples/sample02.rb000066400000000000000000000022041363021761000200130ustar00rootroot00000000000000#!/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.5/examples/sample03.rb000066400000000000000000000014651363021761000200240ustar00rootroot00000000000000#!/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.5/examples/sample04.rb000066400000000000000000000011411363021761000200140ustar00rootroot00000000000000#!/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.5/examples/sample05.rb000066400000000000000000000014721363021761000200240ustar00rootroot00000000000000#!/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.5/examples/sample06.rb000066400000000000000000000020671363021761000200260ustar00rootroot00000000000000$:.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.5/examples/sample07.rb000066400000000000000000000012111363021761000200150ustar00rootroot00000000000000#!/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.5/examples/sample08.rb000066400000000000000000000024641363021761000200310ustar00rootroot00000000000000#!/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.5/examples/sample09.rb000066400000000000000000000025441363021761000200310ustar00rootroot00000000000000#!/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.5/examples/sample10.rb000066400000000000000000000025441363021761000200210ustar00rootroot00000000000000#!/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.5/examples/sample11.rb000066400000000000000000000016001363021761000200120ustar00rootroot00000000000000#!/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.5/examples/sample12.rb000066400000000000000000000024041363021761000200160ustar00rootroot00000000000000#!/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.5/examples/sample13.rb000066400000000000000000000025561363021761000200270ustar00rootroot00000000000000#!/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.5/examples/sample14.rb000066400000000000000000000021561363021761000200240ustar00rootroot00000000000000#!/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.5/examples/sample15.rb000066400000000000000000000011011363021761000200120ustar00rootroot00000000000000#!/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.5/examples/sample16.rb000066400000000000000000000004141363021761000200210ustar00rootroot00000000000000#!/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.5/examples/sample17.rb000066400000000000000000000055701363021761000200320ustar00rootroot00000000000000#!/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.5/examples/sample18.rb000066400000000000000000000017331363021761000200300ustar00rootroot00000000000000#!/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.5/examples/sample19.rb000066400000000000000000000025121363021761000200250ustar00rootroot00000000000000#!/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.5/examples/sample20.rb000066400000000000000000000033141363021761000200160ustar00rootroot00000000000000#!/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.5/examples/sample21.rb000066400000000000000000000005231363021761000200160ustar00rootroot00000000000000#!/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.5/examples/sample22.rb000066400000000000000000000005661363021761000200260ustar00rootroot00000000000000#!/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.5/examples/sample23.rb000066400000000000000000000005541363021761000200240ustar00rootroot00000000000000#!/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.5/examples/sample24.rb000066400000000000000000000003451363021761000200230ustar00rootroot00000000000000#!/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.5/examples/sample25.rb000066400000000000000000000004261363021761000200240ustar00rootroot00000000000000#!/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.5/examples/sample26.rb000066400000000000000000000002601363021761000200210ustar00rootroot00000000000000#!/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.5/examples/sample27.rb000066400000000000000000000002611363021761000200230ustar00rootroot00000000000000#!/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.5/examples/sample28.rb000066400000000000000000000005341363021761000200270ustar00rootroot00000000000000#!/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.5/examples/sample29.rb000066400000000000000000000004241363021761000200260ustar00rootroot00000000000000#!/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.5/examples/sample30.rb000066400000000000000000000006451363021761000200230ustar00rootroot00000000000000#!/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.5/examples/sample31.rb000066400000000000000000000003331363021761000200160ustar00rootroot00000000000000#!/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.5/examples/sample32.rb000066400000000000000000000005161363021761000200220ustar00rootroot00000000000000#!/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.5/examples/sample33.rb000066400000000000000000000016001363021761000200160ustar00rootroot00000000000000$:.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.5/examples/sample34.rb000066400000000000000000000010021363021761000200130ustar00rootroot00000000000000#!/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.5/examples/sample35.rb000066400000000000000000000023511363021761000200240ustar00rootroot00000000000000#!/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.5/examples/sample36.rb000066400000000000000000000016061363021761000200270ustar00rootroot00000000000000#!/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.5/examples/sample37.rb000066400000000000000000000033051363021761000200260ustar00rootroot00000000000000$:.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.5/examples/sample38.rb000066400000000000000000000004501363021761000200250ustar00rootroot00000000000000# 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.5/examples/sample39.rb000066400000000000000000000004121363021761000200240ustar00rootroot00000000000000$:.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.5/examples/sample40.rb000066400000000000000000000006571363021761000200270ustar00rootroot00000000000000$:.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.5/examples/sample41.rb000066400000000000000000000003711363021761000200210ustar00rootroot00000000000000#!/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.5/examples/sample42.rb000066400000000000000000000017361363021761000200300ustar00rootroot00000000000000#!/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.5/examples/sample43.rb000066400000000000000000000017461363021761000200320ustar00rootroot00000000000000$:.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.5/examples/sample44.rb000066400000000000000000000023551363021761000200300ustar00rootroot00000000000000#!/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.5/examples/sample45.rb000066400000000000000000000012261363021761000200250ustar00rootroot00000000000000#!/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.5/examples/sample46.rb000066400000000000000000000022351363021761000200270ustar00rootroot00000000000000#!/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.5/examples/sample47.rb000066400000000000000000000003461363021761000200310ustar00rootroot00000000000000#!/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.5/examples/sample48.rb000066400000000000000000000023641363021761000200340ustar00rootroot00000000000000# 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.5/examples/sample49.rb000066400000000000000000000004131363021761000200260ustar00rootroot00000000000000# 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.5/examples/sample50.rb000066400000000000000000000354251363021761000200310ustar00rootroot00000000000000# 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.5/examples/sample51.rb000066400000000000000000000013711363021761000200230ustar00rootroot00000000000000# 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.5/examples/sample52.rb000066400000000000000000000040131363021761000200200ustar00rootroot00000000000000# 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.5/examples/sample53.rb000066400000000000000000000011041363021761000200170ustar00rootroot00000000000000$:.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.5/examples/sample54.rb000066400000000000000000000007601363021761000200270ustar00rootroot00000000000000$:.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.5/examples/sample55.rb000066400000000000000000000005221363021761000200240ustar00rootroot00000000000000$:.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.5/examples/sample56.rb000066400000000000000000000004151363021761000200260ustar00rootroot00000000000000# 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.5/examples/sample57.rb000066400000000000000000000004051363021761000200260ustar00rootroot00000000000000$:.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.5/examples/sample58.rb000066400000000000000000000014101363021761000200240ustar00rootroot00000000000000#!/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.5/examples/sample59.rb000066400000000000000000000003061363021761000200300ustar00rootroot00000000000000$:.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.5/examples/sample60.rb000066400000000000000000000003161363021761000200210ustar00rootroot00000000000000#!/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.5/examples/sample61.rb000066400000000000000000000003101363021761000200140ustar00rootroot00000000000000#!/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.5/examples/sample62.rb000066400000000000000000000011121363021761000200160ustar00rootroot00000000000000#!/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.5/examples/sample63.rb000066400000000000000000000011241363021761000200220ustar00rootroot00000000000000$:.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.5/examples/sample64.rb000066400000000000000000000011431363021761000200240ustar00rootroot00000000000000$:.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.5/examples/sample65.rb000066400000000000000000000002511363021761000200240ustar00rootroot00000000000000$:.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.5/examples/sample66.rb000066400000000000000000000001551363021761000200300ustar00rootroot00000000000000$:.unshift("../lib") require 'graphviz' GraphViz.generate(30, 44, true, (1..8)).output(:png => "#{$0}.png") Ruby-Graphviz-1.2.5/examples/sample67.rb000066400000000000000000000004261363021761000200320ustar00rootroot00000000000000$:.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.5/examples/sample68.rb000066400000000000000000000011371363021761000200330ustar00rootroot00000000000000$:.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.5/examples/sample69.rb000066400000000000000000000007021363021761000200310ustar00rootroot00000000000000#!/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.5/examples/sample70.rb000066400000000000000000000005221363021761000200210ustar00rootroot00000000000000$:.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.5/examples/sample71.rb000066400000000000000000000006331363021761000200250ustar00rootroot00000000000000#!/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.5/examples/sample72.rb000066400000000000000000000006761363021761000200350ustar00rootroot00000000000000#!/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.5/examples/sample73.rb000066400000000000000000000007041363021761000200260ustar00rootroot00000000000000#!/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.5/examples/sample74.rb000066400000000000000000000006211363021761000200250ustar00rootroot00000000000000#!/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.5/examples/sample99.rb000066400000000000000000000031651363021761000200420ustar00rootroot00000000000000$:.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.5/examples/sdlshapes/000077500000000000000000000000001363021761000200335ustar00rootroot00000000000000Ruby-Graphviz-1.2.5/examples/sdlshapes/README000066400000000000000000000001761363021761000207170ustar00rootroot00000000000000PostScript 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.5/examples/sdlshapes/sdl.ps000066400000000000000000000435261363021761000211730ustar00rootroot00000000000000%! 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.5/examples/sdlshapes/sdlshapes.dot000066400000000000000000000134131363021761000225330ustar00rootroot00000000000000digraph 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.5/examples/test.xml000066400000000000000000000016771363021761000175610ustar00rootroot00000000000000

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.5/examples/theory/000077500000000000000000000000001363021761000173575ustar00rootroot00000000000000Ruby-Graphviz-1.2.5/examples/theory/pert.rb000066400000000000000000000025131363021761000206570ustar00rootroot00000000000000$:.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.5/examples/theory/tests.rb000066400000000000000000000037231363021761000210530ustar00rootroot00000000000000$:.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.5/lib/000077500000000000000000000000001363021761000147755ustar00rootroot00000000000000Ruby-Graphviz-1.2.5/lib/ext/000077500000000000000000000000001363021761000155755ustar00rootroot00000000000000Ruby-Graphviz-1.2.5/lib/ext/gvpr/000077500000000000000000000000001363021761000165535ustar00rootroot00000000000000Ruby-Graphviz-1.2.5/lib/ext/gvpr/dot2ruby.g000066400000000000000000000113621363021761000205000ustar00rootroot00000000000000// 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 // // Usage : // gvpr -f dot2ruby.g [-a ] BEGIN { int g_strict; int g_direct; graph_t cluster; node_t cnode; edge_t cedge; string attr; string attrv; graph_t subgraph; graph_t pgraph; graph_t ofgraph; graph_t sub_graph; graph_t tmp_g; string xOut; if( ARGC == 0 ) { xOut = "_"; } else { xOut = tolower(ARGV[0]); } printf( "# This code was generated by dot2ruby.g\n\n" ); string rubyfy( string s ) { string out; out = tolower( s ); out = gsub( out, "[!a-zA-Z0-9_]", "_" ); return( out ); } string stringify( string s ) { string sout; sout = gsub(s, "\"", "\\\""); sout = gsub(sout, "@", "\\@"); sout = gsub(sout, "$", "\\$"); return( sout ); } void load_sub_graph( graph_t p ) { if(p == NULL) { return; } sub_graph = fstsubg(p); while( sub_graph != NULL ) { pgraph = sub_graph.parent; printf ( " graph_%s = graph_%s.add_graph( \"%s\" )\n", rubyfy(sub_graph.name), rubyfy(pgraph.name), rubyfy(sub_graph.name) ); // ATTRS attr = fstAttr(sub_graph, "G"); while( attr != "" ) { attrv = aget( sub_graph, attr ); if( attrv != "" ) { printf( " graph_%s[:%s] = '%s'\n", rubyfy(sub_graph.name), attr, attrv ); } attr = nxtAttr( sub_graph, "G", attr ); } tmp_g = sub_graph; load_sub_graph(sub_graph); sub_graph = nxtsubg( tmp_g ); } } graph_t get_node_graph(node_t n, graph_t p) { sub_graph = fstsubg(p); while( sub_graph != NULL ) { if( isSubnode( sub_graph, n) != 0 ) { return get_node_graph(n, sub_graph); } sub_graph = nxtsubg( sub_graph ); } return p; } graph_t get_edge_graph(edge_t e, graph_t p) { sub_graph = fstsubg(p); while( sub_graph != NULL ) { if( isSubedge( sub_graph, e) != 0 ) { return get_edge_graph(e, sub_graph); } sub_graph = nxtsubg( sub_graph ); } return p; } } BEG_G { printf( "require 'rubygems'\nrequire 'graphviz'\n"); // Directed g_direct = isDirect($); if( g_direct == 0 ) { printf( "graph_%s = GraphViz.graph( \"%s\"", rubyfy($.name), stringify($.name) ); } else { printf( "graph_%s = GraphViz.digraph( \"%s\"", rubyfy($.name), stringify($.name) ); } // Strict g_strict = isStrict($); if( g_strict != 0 ) { printf( ", :strict => true" ); } printf( " ) { |graph_%s|\n", rubyfy($.name) ); // Attributs of G attr = fstAttr($, "G"); while( attr != "" ) { attrv = aget( $, attr ); if( attrv != "" ) { printf( " graph_%s[:%s] = '%s'\n", rubyfy($.name), attr, attrv ); } attr = nxtAttr( $, "G", attr ); } load_sub_graph($); } N { pgraph = $.root; ofgraph = get_node_graph($, pgraph); printf( " node_%s = graph_%s.add_nodes( \"%s\"", rubyfy($.name), rubyfy(ofgraph.name), stringify($.name) ); // Attributs of N attr = fstAttr($G, "N"); while( attr != "" ) { attrv = aget( $, attr ); if( attrv != "" ) { printf( ", :%s => '%s'", attr, gsub( attrv, "'", "\\'" ) ); } else { printf( ", :%s => ''", attr ); } attr = nxtAttr( $G, "N", attr ); } printf( " )\n"); } E { pgraph = $.root; ofgraph = get_edge_graph($, $.root); printf( " graph_%s.add_edges( \"%s\", \"%s\"", rubyfy(ofgraph.name), stringify($.tail.name), stringify($.head.name) ); // Attributs of E attr = fstAttr($G, "E"); while( attr != "" ) { attrv = aget( $, attr ); if( attrv != "" ) { printf( ", :%s => '%s'", attr, gsub( attrv, "'", "\\'" ) ); } else { printf( ", :%s => ''", attr ); } attr = nxtAttr( $G, "E", attr ); } printf( " )\n" ); } END_G { printf( "}\n" ); if( xOut != "_" ) { if( xOut == "-" ) { printf( "@_graph_eval = graph_%s\n", rubyfy($.name) ); } else { printf( "graph_%s.output( :%s => \"%s.%s\" )\n", rubyfy($.name), xOut, gsub($F, ".*/", ""), xOut ); } } } Ruby-Graphviz-1.2.5/lib/graphviz.rb000066400000000000000000000602761363021761000171670ustar00rootroot00000000000000# coding: utf-8 # Copyright (C) 2003 - 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 IS_JRUBY = (defined?( JRUBY_VERSION ) != nil) IS_CYGWIN = ((RUBY_PLATFORM =~ /cygwin/) != nil) require 'tempfile' require 'graphviz/utils' require 'graphviz/node' require 'graphviz/edge' require 'graphviz/attrs' require 'graphviz/constants' require 'graphviz/elements' require 'graphviz/dot_script' require 'graphviz/dot2ruby' require 'graphviz/types' require 'graphviz/core_ext' class GraphViz include GraphViz::Constants include GraphViz::Utils public ## Var: Output format (dot, png, jpeg, ...) @@format = nil #"canon" @format = nil ## Var: Output file name @filename = nil ## Var: Output format and file @output = nil ## Var: program to use (dot|twopi) @@prog = "dot" @prog = nil ## Var: program path @@path = [] @path = nil ## Var: Error level @@errors = 1 @errors = nil ## Var: External libraries @@extlibs = [] @extlibs = nil ## Var: Graph name @name = nil ## Var: defined attributes @graph = nil @node = nil @edge = nil # This accessor allow you to set global graph attributes attr_accessor :graph alias_method :graph_attrs, :graph # This accessor allow you to set global nodes attributes attr_accessor :node alias_method :node_attrs, :node # This accessor allow you to set global edges attributes attr_accessor :edge alias_method :edge_attrs, :edge @elements_order = nil def add_node( xNodeName, hOpts = {} ) if xNodeName.kind_of? Array raise ArgumentError, "use `add_nodes' to add several nodes at the same time" end return add_nodes(xNodeName, hOpts) end # Create a new node # # In: # * xNodeName : Name of the new node # * hOpts : Node attributes # # Return the GraphViz::Node object created def add_nodes(node_name, options = {}) if node_name.kind_of? Array node_name.each { |n| add_nodes(n, options.clone) } else node = @hoNodes[node_name] if node.nil? @hoNodes[node_name] = GraphViz::Node::new( node_name, self ) @hoNodes[node_name].index = @elements_order.size_of( "node" ) unless options.keys.include?(:label) or options.keys.include?("label") options[:label] = node_name end @elements_order.push( { "type" => "node", "name" => node_name, "value" => @hoNodes[node_name] } ) node = @hoNodes[node_name] end options.each do |xKey, xValue| @hoNodes[node_name][xKey.to_s] = xValue end return node end end # Return the node object for the given name (or nil) in the current graph def get_node( xNodeName, &block ) node = @hoNodes[xNodeName] || nil yield( node ) if( block and node ) return node end # Returns the first node found in the entire graph, starting from the root graph def find_node(name) root = root_graph return root.search_node(name) end # Return the first node found in the current graph, and it subgraphs def search_node(name) n = get_node(name) return n unless n.nil? each_graph { |_, g| n = g.search_node(name) return n unless n.nil? } return nil end def enumerate_nodes nodes = @hoNodes.keys each_graph { |_, g| child_nodes = g.enumerate_nodes nodes += child_nodes } return nodes end # # Return the node object for the given index # def get_node_at_index( index ) element = @elements_order[index, "node"] (element.nil?) ? nil : element["value"] end # # Allow you to traverse nodes # def each_node( &block ) if block_given? @hoNodes.each do |name, node| yield( name, node ) end else return( @hoNodes ) end end # Get the number of nodes def node_count @hoNodes.size end def add_edge( oNodeOne, oNodeTwo, hOpts = {} ) if oNodeTwo.kind_of? Array or oNodeOne.kind_of? Array raise ArgumentError, "use `add_edges' to add several edges at the same time" end add_edges(oNodeOne, oNodeTwo, hOpts) end # Create a new edge # # In: # * node_one : First node (or node list) # * node_two : Second Node (or node list) # * options : Edge attributes def add_edges( node_one, node_two, options = {} ) if( node_one.class == Array ) node_one.each do |no| add_edges( no, node_two, options ) end else if( node_two.class == Array ) node_two.each do |nt| add_edges( node_one, nt, options ) end else edge = GraphViz::Edge::new( node_one, node_two, self ) edge.index = @elements_order.size_of( "edge" ) options.each do |xKey, xValue| edge[xKey.to_s] = xValue end @elements_order.push( { "type" => "edge", "value" => edge } ) @loEdges.push( edge ) return( edge ) end end end # # Allow you to traverse edges # def each_edge( &block ) if block_given? @loEdges.each do |edge| yield(edge) end else return @loEdges end end # # Get the number of edges # def edge_count @loEdges.size end # # Return the edge object for the given index # def get_edge_at_index( index ) element = @elements_order[index, "edge"] (element.nil?) ? nil : element["value"] end # # Create a new graph # # In: # * xGraphName : Graph name # * hOpts : Graph attributes # def add_graph( xGraphName = nil, hOpts = {}, &block ) if xGraphName.kind_of?(GraphViz) xGraphID = xGraphName.id @hoGraphs[xGraphID] = xGraphName.clone @hoGraphs[xGraphID].type = @oGraphType @hoGraphs[xGraphID].pg = self xGraphName = xGraphID else if xGraphName.kind_of?(Hash) hOpts = xGraphName xGraphName = nil end if xGraphName.nil? xGraphID = String.random(11) xGraphName = "" else xGraphID = xGraphName end @hoGraphs[xGraphID] = GraphViz::new( xGraphName, {:parent => self, :type => @oGraphType}, &block ) hOpts.each do |xKey, xValue| @hoGraphs[xGraphID][xKey.to_s] = xValue end end @elements_order.push( { "type" => "graph", "name" => xGraphName, "value" => @hoGraphs[xGraphID] } ) return( @hoGraphs[xGraphID] ) end alias :subgraph :add_graph # # Return the graph object for the given name (or nil) # def get_graph( xGraphName, &block ) graph = @hoGraphs[xGraphName] || nil yield( graph ) if( block and graph ) return graph end # # Allow you to traverse graphs # def each_graph( &block ) if block_given? @hoGraphs.each do |name, graph| yield( name, graph ) end else return @hoGraphs end end # # Add nodes and edges defined by a Hash # def add(h) if h.kind_of? Hash h.each do |node, data| add_hash_edge(node, data) end end end # # Return the graph type (graph digraph) # def type @oGraphType end def type=(x) #:nodoc: @oGraphType = x end # # Get the number of graphs # def graph_count @hoGraphs.size end def method_missing( idName, *args, &block ) #:nodoc: xName = idName.id2name rCod = nil if block # Creating a cluster named '#{xName}' rCod = add_graph( xName, args[0]||{} ) yield( rCod ) else # Create a node named '#{xName}' or search for a node, edge or cluster if @hoNodes.keys.include?( xName ) if( args[0] ) return { xName => args[0] } else return( @hoNodes[xName] ) end end return( @hoGraphs[xName] ) if @hoGraphs.keys.include?( xName ) rCod = add_nodes( xName, args[0]||{} ) end return rCod end # # Set value +xValue+ to the graph attribute +xAttrName+ # def []=( xAttrName, xValue ) xValue = xValue.to_s if xValue.class == Symbol @graph[xAttrName] = xValue end # # Get the value of the graph attribute +xAttrName+ # def []( xAttrName ) if Hash === xAttrName xAttrName.each do |key, value| self[key] = value end else attr = @graph[xAttrName] if attr.nil? return nil else return( @graph[xAttrName].clone ) end end end # # Calls block once for each attribute of the graph, passing the name and value to the # block as a two-element array. # def each_attribute(&b) @graph.each do |k,v| yield(k,v) end end def each_attribut(&b) warn "`GraphViz#each_attribut` is deprecated, please use `GraphViz#each_attribute`" each_attribute(&b) end # Create a new graph from the current subgraph def to_graph graph = self.clone graph.pg = nil return graph end # # Generate the graph # # Options : # * :output : Output format (GraphViz::Constants::FORMATS) # * :file : Output file name # * :use : Program to use (GraphViz::Constants::PROGRAMS) # * :path : Program PATH # * : => : can be # * a file name # * nil, then the output will be printed to STDOUT # * String, then the output will be returned as a String # * :errors : DOT error level (default 1) # * 0 = Error + Warning # * 1 = Error # * 2 = none # def output( hOpts = {} ) xDOTScript = DOTScript.new lNotHugly = [] append_attributes_and_types(xDOTScript) xDOTScript << "}" if has_parent_graph? xDOTScript.make_subgraph("#{GraphViz.escape(@name, :unquote_empty => true)}") else hOutput = {} hOpts.each do |xKey, xValue| xValue = xValue.to_s unless xValue.nil? or [Class, TrueClass, FalseClass].include?(xValue.class) case xKey.to_s when "use" if PROGRAMS.index( xValue ).nil? raise ArgumentError, "can't use '#{xValue}'" end @prog = xValue when "path" @path = xValue && xValue.split( "," ).map{ |x| x.strip } when "errors" @errors = xValue when "extlib" @extlibs = xValue.split( "," ).map{ |x| x.strip } when "scale" # Scale input by 'v' (=72) @scale = xValue when "inverty" # Invert y coordinate in output @inverty = xValue when "no_layout" # No layout mode 'v' (=1) @no_layout = xValue when "reduce" # Reduce graph @reduce_graph = xValue when "Lg" # Don't use grid @Lg = xValue when "LO" # Use old attractive force @LO = xValue when "Ln" # Set number of iterations to i @Ln = xValue when "LU" # Set unscaled factor to i @LU = xValue when "LC" # Set overlap expansion factor to v @LC = xValue when "LT" # Set temperature (temperature factor) to v @LT = xValue when "nothugly" begin require 'graphviz/nothugly' @nothugly = true rescue LoadError warn "You must install ruby-xslt or libxslt-ruby to use nothugly option!" @nothugly = false end else if FORMATS.index( xKey.to_s ).nil? raise ArgumentError, "output format '#{xValue}' invalid" end hOutput[xKey.to_s] = xValue end end @output = hOutput if hOutput.size > 0 xStict = ((@strict && @oGraphType == "digraph") ? "strict " : "") xDOTScript.prepend( "#{xStict}#{@oGraphType} #{GraphViz.escape(@name, :unquote_empty => true)} {" ) xOutputString = (@filename == String || @output.any? {|format, file| file == String }) xOutput = "" if @format.to_s == "none" or @output.any? {|fmt, fn| fmt.to_s == "none"} if xOutputString xOutput << xDOTScript else xFileName = @output["none"] || @filename open( xFileName, "w" ) do |h| h.puts xDOTScript end end end if (@format.to_s != "none" and not @format.nil?) or (@output.any? {|format, file| format != "none" } and @output.size > 0) ## Act: Save script and send it to dot t = Tempfile::open( File.basename(__FILE__) ) t.print( xDOTScript ) t.close cmd = find_executable( @prog, @path ) if cmd == nil raise StandardError, "GraphViz not installed or #{@prog} not in PATH. Install GraphViz or use the 'path' option" end xOutputWithFile = [] xOutputWithoutFile = [] unless @format.nil? or @format == "none" lNotHugly << @filename if @format.to_s == "svg" and @nothugly if @filename.nil? or @filename == String xOutputWithoutFile = ["-T#{@format}"] else xOutputWithFile = ["-T#{@format}", "-o#{@filename}"] end end @output.each_except( :key => ["none"] ) do |format, file| lNotHugly << file if format.to_s == "svg" and @nothugly if file.nil? or file == String xOutputWithoutFile += ["-T#{format}"] else xOutputWithFile += ["-T#{format}", "-o#{file}"] end end xExternalLibraries = @extlibs.map { |lib| "-l#{lib}" } xOtherOptions = [] xOtherOptions << "-s#{@scale}" if @scale xOtherOptions << "-y" if @inverty xOtherOptions << "-n#{@no_layout}" if @no_layout xOtherOptions << "-x" if @reduce_graph xOtherOptions << "-Lg" if @Lg xOtherOptions << "-LO" if @LO xOtherOptions << "-Ln#{@Ln}" if @Ln xOtherOptions << "-LU#{@LU}" if @LU xOtherOptions << "-LC#{@LC}" if @LC xOtherOptions << "-LT#{@LT}" if @LT tmpPath = if IS_JRUBY t.path elsif IS_CYGWIN begin IO.popen("cygpath", "-w", t.path).chomp rescue warn "cygpath is not installed!" t.path end else t.path end xCmd = [cmd, "-q#{@errors}"] + xExternalLibraries + xOtherOptions + xOutputWithFile + xOutputWithoutFile + [tmpPath] xOutput << output_from_command( xCmd ) end # Not Hugly lNotHugly.each do |f| if f.nil? or f == String xOutput = GraphViz.nothugly( xOutput, false ) else GraphViz.nothugly( f, true ) end end if xOutputString xOutput else print xOutput end end end alias :save :output def append_attributes_and_types(script) script_data = DOTScriptData.new @elements_order.each { |kElement| is_new_type = script_data.type != kElement["type"] if is_new_type script << script_data unless script_data.type.nil? or script_data.empty? script_data = DOTScriptData.new(kElement["type"]) end # Modified by Brandon Coleman verify value is NOT NULL kElement["value"] or raise ArgumentError, "#{kElement["name"]} is nil!" case kElement["type"] when "graph_attr", "node_attr", "edge_attr" script_data.add_attribute(kElement["name"], kElement["value"].to_gv) when "node", "graph" script << kElement["value"].output() when "edge" script << " " + kElement["value"].output( @oGraphType ) else raise ArgumentError, "Don't know what to do with element type '#{kElement['type']}'" end } script << script_data unless script_data.type.nil? or script_data.empty? end def to_s self.output(:none => String) end # # Get the graph name # def name @name.clone end alias :id :name # # Create an edge between the current cluster and the node or cluster +oNode+ # def <<( oNode ) raise( ArgumentError, "Edge between root graph and node or cluster not allowed!" ) if self.pg.nil? if( oNode.class == Array ) oNode.each do |no| self << no end else return GraphViz::commonGraph( oNode, self ).add_edges( self, oNode ) end end alias :> :<< alias :- :<< alias :>> :<< def pg #:nodoc: @oParentGraph end def pg=(x) #:nodoc: @oParentGraph = x end # # Return the root graph # def root_graph return( (self.pg.nil?) ? self : self.pg.root_graph ) end def self.commonGraph( o1, o2 ) #:nodoc: g1 = o1.pg g2 = o2.pg return o1 if g1.nil? return o2 if g2.nil? return g1 if g1.object_id == g2.object_id return GraphViz::commonGraph( g1, g2 ) end def set_position( xType, xKey, xValue ) #:nodoc: @elements_order.push( { "type" => "#{xType}_attr", "name" => xKey, "value" => xValue } ) end ## ---------------------------------------------------------------------------- # # Change default options (:use, :path, :errors and :output) # def self.default( hOpts ) hOpts.each do |k, v| case k.to_s when "use" @@prog = v when "path" @@path = v.split( "," ).map{ |x| x.strip } when "errors" @@errors = v when "extlibs" @@extlibs = v.split( "," ).map{ |x| x.strip } else warn "Invalid option #{k}!" end end end def self.options( hOpts ) GraphViz::default( hOpts ) end ## ---------------------------------------------------------------------------- # Create a new graph from a GraphViz File # # Options : # * :output : Output format (GraphViz::Constants::FORMATS) (default : dot) # * :file : Output file name (default : none) # * :use : Program to use (GraphViz::Constants::PROGRAMS) (default : dot) # * :path : Program PATH # def self.parse( xFile, hOpts = {}, &block ) graph = Dot2Ruby::new( hOpts[:path], nil, nil ).eval( xFile ) yield( graph ) if( block and graph ) return graph end # Create a new graph from a GraphViz File # # Options : # * :output : Output format (GraphViz::Constants::FORMATS) (default : dot) # * :file : Output file name (default : none) # * :use : Program to use (GraphViz::Constants::PROGRAMS) (default : dot) # * :path : Program PATH # def self.parse_string( str, hOpts = {}, &block ) graph = Dot2Ruby::new(hOpts[:path], nil, nil).eval_string(str) yield(graph) if(block and graph) return graph end # Return a new completed graph def complete GraphViz.parse_string( root_graph.output( :dot => String ) ) end # Complete the current graph def complete! # TODO: Keep options complete end # Return true if the graph is directed. def directed? not((/digraph/ =~ "bla digraph bla").nil?) end def has_parent_graph? not @oParentGraph.nil? end ## ---------------------------------------------------------------------------- private ## Var: Nodes, Edges and Graphs tables @hoNodes = nil @loEdges = nil @hoGraphs = nil ## Var: Parent graph @oParentGraph = nil ## Var: Type de graphe (orienté ou non) @oGraphType = nil # # Create a new graph object # # Options : # * :output : Output format (GraphViz::Constants::FORMATS) (default : dot) # * :file : Output file name (default : nil) # * :use : Program to use (GraphViz::Constants::PROGRAMS) (default : dot) # * :path : Program PATH # * :parent : Parent graph (default : nil) # * :type : Graph type (GraphViz::Constants::GRAPHTYPE) (default : digraph) # * :errors : DOT error level (default 1) # * 0 = Error + Warning # * 1 = Error # * 2 = none # def initialize( xGraphName, hOpts = {}, &block ) @filename = nil @name = xGraphName.to_s @format = @@format @prog = @@prog @path = @@path @errors = @@errors @extlibs = @@extlibs @output = {} @nothugly = false @strict = false @scale = nil @inverty = nil @no_layout = nil @reduce_graph = nil @Lg = nil @LO = nil @Ln = nil @LU = nil @LC = nil @LT = nil @elements_order = GraphViz::Elements::new() @oParentGraph = nil @oGraphType = "digraph" @hoNodes = Hash::new() @loEdges = Array::new() @hoGraphs = Hash::new() @node = GraphViz::Attrs::new( self, "node", NODESATTRS ) @edge = GraphViz::Attrs::new( self, "edge", EDGESATTRS ) @graph = GraphViz::Attrs::new( self, "graph", GRAPHSATTRS ) hOpts.each do |xKey, xValue| case xKey.to_s when "use" if PROGRAMS.index( xValue.to_s ).nil? raise ArgumentError, "can't use '#{xValue}'" end @prog = xValue.to_s when "parent" @oParentGraph = xValue when "type" if GRAPHTYPE.index( xValue.to_s ).nil? raise ArgumentError, "graph type '#{xValue}' unknow" end @oGraphType = xValue.to_s when "path" @path = xValue.split( "," ).map{ |x| x.strip } when "strict" @strict = (xValue ? true : false) when "errors" @errors = xValue when "extlibs" @extlibs = xValue.split( "," ).map{ |x| x.strip } else self[xKey.to_s] = xValue.to_s end end yield( self ) if( block ) end # Edge between a node and a Hash # Used by GraphViz#add def add_hash_edge(node, hash) if hash.kind_of? Hash hash.each do |nt, data| add_edges(node, nt) add_hash_edge(nt, data) end else add_edges(node, hash) end end # # Create a new undirected graph # # See also GraphViz::new # def self.graph( xGraphName, hOpts = {}, &block ) new( xGraphName, hOpts.symbolize_keys.merge( {:type => "graph"} ), &block ) end # # Create a new directed graph # # See also GraphViz::new # def self.digraph( xGraphName, hOpts = {}, &block ) new( xGraphName, hOpts.symbolize_keys.merge( {:type => "digraph"} ), &block ) end # Create a new strict directed graph # # See also GraphViz::new def self.strict_digraph( xGraphName, hOpts = {}, &block ) new( xGraphName, hOpts.symbolize_keys.merge( {:type => "digraph", :strict => true} ), &block ) end # Create a random graph. def self.generate(num_nodes, num_edges, directed = false, weight_range = (1..1)) g = nil if directed g = GraphViz.digraph(:G) else g = GraphViz.graph(:G) end nodes = (1..num_nodes).map{ |e| e.to_s } g.add_nodes(nodes) edges = [] nodes.each do |head| nodes.each do |tail| if (directed and head != tail) or (head < tail) edges << {:head => head, :tail => tail, :weight => weight_range.to_a.shuffle[0]} end end end edges.shuffle! (num_edges - 1).times do |i| g.add_edges(edges[i][:head], edges[i][:tail], :label => edges[i][:weight].to_s, :weight => edges[i][:weight]) end return g end # # Escape a string to be acceptable as a node name in a graphviz input file # def self.escape(str, opts = {} ) #:nodoc: options = { :force => false, :unquote_empty => false, }.merge(opts) reserved_words = %w{node edge graph digraph subgraph strict} if (options[:force] or str.match( /\A[a-zA-Z_]+[a-zA-Z0-9_]*\Z/ ).nil? or reserved_words.include?(str.downcase)) unless options[:unquote_empty] and str.size == 0 '"' + str.gsub('"', '\\"').gsub("\n", '\\\\n') + '"' end else str end end end Ruby-Graphviz-1.2.5/lib/graphviz/000077500000000000000000000000001363021761000166275ustar00rootroot00000000000000Ruby-Graphviz-1.2.5/lib/graphviz/attrs.rb000066400000000000000000000040331363021761000203110ustar00rootroot00000000000000# 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.5/lib/graphviz/constants.rb000066400000000000000000000412231363021761000211720ustar00rootroot00000000000000# 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.5" ## 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 "class" => { :usedBy => "ENCG", :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 "newrank" => { :usedBy => "G", :type => :EscString }, # rankType "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.5/lib/graphviz/core_ext.rb000066400000000000000000000030131363021761000207610ustar00rootroot00000000000000class 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 end Ruby-Graphviz-1.2.5/lib/graphviz/dot2ruby.rb000066400000000000000000000036501363021761000207320ustar00rootroot00000000000000#!/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.5/lib/graphviz/dot_script.rb000066400000000000000000000041541363021761000213320ustar00rootroot00000000000000require "forwardable" class GraphViz class DOTScriptData attr_accessor :type def initialize(type = nil) @data = [] @separator = "" @type = type end def append(data) @data << data end alias :<< :append def add_attribute(name, value) @data << @separator << name << " = " << value @separator = determine_separator end def to_str case @type when "graph_attr" then "#{@data.join}#{@separator}" when "node_attr" then "node[#{@data.join(' ')}];" when "edge_attr" then "edge[#{@data.join(' ')}];" else raise ArgumentError, "Wrong type: #{@type}." end end alias :to_s :to_str def empty? @data.empty? end private def determine_separator case @type when "graph_attr" then ";\n" when "node_attr", "edge_attr" then "," else raise ArgumentError, "Wrong type: #{@type}." end end end class DOTScript extend Forwardable def_delegators :@script, :end_with? def initialize @script = '' end def append(line) @script << assure_ends_with(line.to_s,"\n") self end alias :<< :append def prepend(line) @script = assure_ends_with(line.to_s,"\n") + @script self end def make_subgraph(name) prepend(assure_ends_with("subgraph #{name}"," {")) end def add_type(type, data) return self if data.empty? case type when "graph_attr" append_statement(" " + data) when "node_attr" append_statement(" node [" + data + "]") when "edge_attr" append_statement(" edge [" + data + "]") else raise ArgumentError, "Unknown type: #{type}." << "Possible: 'graph_attr','node_attr','edge_attr'" end self end def to_str @script end alias :to_s :to_str private def assure_ends_with(str,ending="\n") str.to_s.end_with?("\n") ? str : str + ending end def append_statement(statement) append(assure_ends_with(statement, ";\n")) end end end Ruby-Graphviz-1.2.5/lib/graphviz/dsl.rb000066400000000000000000000034351363021761000177430ustar00rootroot00000000000000require 'graphviz' class GraphViz::DSL attr_accessor :graph # Create a new graph def initialize(name, options = {}, &block) @graph = GraphViz.new(name, options) instance_eval(&block) if block end def method_missing(sym, *args, &block) #:nodoc: return @graph.get_graph(sym.to_s) unless @graph.get_graph(sym.to_s).nil? return @graph.get_node(sym.to_s) unless @graph.get_node(sym.to_s).nil? if(@graph.respond_to?(sym, true)) @graph.send(sym, *args) elsif(block) @graph.add_graph(GraphViz::DSL.new(sym, { :parent => @graph, :type => @graph.type }, &block).graph) else @graph.add_nodes(sym.to_s, *args) end end # Add a new node def n(name) return @graph.get_node(name) unless @graph.get_node(name.to_s).nil? @graph.add_nodes(name) end # Create edges def e(*args) e = nil last = args.shift while current = args.shift e = @graph.add_edges(last, current) last = current end return e end # Add a subgraph def subgraph(name, &block) @graph.add_graph(GraphViz::DSL.new(name, { :parent => @graph, :type => @graph.type }, &block).graph) end alias :cluster :subgraph # Generate output def output(options = {}) @graph.output(options) end end # Create a new undirected graph def graph(name, options = {}, &block) GraphViz::DSL.new(name, options.merge( { :type => "graph" } ), &block).graph end # Create a new directed graph def digraph(name, options = {}, &block) GraphViz::DSL.new(name, options.merge( { :type => "digraph" } ), &block).graph end # Create a new strict directed graph def strict(name, options = {}, &block) GraphViz::DSL.new(name, options.merge( { :type => "strict digraph" } ), &block).graph end Ruby-Graphviz-1.2.5/lib/graphviz/edge.rb000066400000000000000000000146231363021761000200660ustar00rootroot00000000000000# 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.