├── .gitignore ├── .jshintrc ├── .travis.yml ├── Gruntfile.js ├── License ├── README.md ├── bower.json ├── dist ├── ace-mode.js ├── dot-checker.js ├── layout-worker.js └── renderer.js ├── karma.conf.js ├── package.json ├── spec ├── asts │ ├── adept.js │ ├── backslash.js │ ├── class-diagram.js │ ├── comma.js │ ├── directed │ │ └── clust4.js │ ├── image.js │ ├── node-id.js │ ├── quote.js │ └── unicode-labels.js ├── dot-checker-spec.js ├── dot-parser-spec.js ├── dots │ ├── adept.gv │ ├── directed.js │ ├── directed │ │ ├── KW91.gv │ │ ├── Latin1.gv │ │ ├── NaN.gv │ │ ├── abstract.gv │ │ ├── alf.gv │ │ ├── arr_none.gv │ │ ├── arrows.gv │ │ ├── awilliams.gv │ │ ├── biological.gv │ │ ├── clust.gv │ │ ├── clust1.gv │ │ ├── clust2.gv │ │ ├── clust3.gv │ │ ├── clust4.gv │ │ ├── clust5.gv │ │ ├── crazy.gv │ │ ├── ctext.gv │ │ ├── dfa.gv │ │ ├── fig6.gv │ │ ├── fsm.gv │ │ ├── grammar.gv │ │ ├── hashtable.gv │ │ ├── honda-tokoro.gv │ │ ├── japanese.gv │ │ ├── jcctree.gv │ │ ├── jsort.gv │ │ ├── ldbxtried.gv │ │ ├── longflat.gv │ │ ├── mike.gv │ │ ├── nhg.gv │ │ ├── oldarrows.gv │ │ ├── pgram.gv │ │ ├── pm2way.gv │ │ ├── pmpipe.gv │ │ ├── polypoly.gv │ │ ├── proc3d.gv │ │ ├── psfonttest.gv │ │ ├── record2.gv │ │ ├── records.gv │ │ ├── rowe.gv │ │ ├── russian.gv │ │ ├── sdh.gv │ │ ├── shells.gv │ │ ├── states.gv │ │ ├── structs.gv │ │ ├── switch.gv │ │ ├── table.gv │ │ ├── train11.gv │ │ ├── trapeziumlr.gv │ │ ├── tree.gv │ │ ├── triedds.gv │ │ ├── try.gv │ │ ├── unix.gv │ │ ├── unix2.gv │ │ ├── viewfile.gv │ │ └── world.gv │ └── undirected │ │ ├── ER.gv │ │ ├── Heawood.gv │ │ ├── Makefile.am │ │ ├── Petersen.gv │ │ ├── ngk10_4.gv │ │ └── process.gv ├── img │ ├── A-B-C.png │ └── B-zoomed.png ├── jasmine │ ├── data-helpers.js │ └── image-matchers.js ├── karma │ └── html-reporter-template.html ├── palette-spec.js ├── renderer-spec.js ├── shapes │ ├── adept.js │ ├── courier-fonts.js │ ├── directed │ │ ├── clust4.js │ │ ├── switch.js │ │ └── table.js │ ├── double-quotes.js │ ├── graph-label.js │ ├── longer-labels.js │ └── multiple-edges.js ├── stage-dom-spec.js ├── stage-spec.js ├── test-main.js ├── transformer-gallery-spec.js ├── transformer-integration-spec.js ├── transformer-spec.js ├── vizjs-spec.js ├── xdot-parser-spec.js └── xdots │ ├── adept.xdot │ ├── class-diagram.xdot │ ├── directed.js │ └── directed │ ├── KW91.xdot │ ├── Latin1.xdot │ ├── NaN.xdot │ ├── abstract.xdot │ ├── alf.xdot │ ├── arr_none.xdot │ ├── arrows.xdot │ ├── awilliams.xdot │ ├── biological.xdot │ ├── clust.xdot │ ├── clust1.xdot │ ├── clust2.xdot │ ├── clust3.xdot │ ├── clust4.xdot │ ├── clust5.xdot │ ├── crazy.xdot │ ├── ctext.xdot │ ├── dfa.xdot │ ├── fig6.xdot │ ├── fsm.xdot │ ├── grammar.xdot │ ├── hashtable.xdot │ ├── honda-tokoro.xdot │ ├── japanese.xdot │ ├── jcctree.xdot │ ├── jsort.xdot │ ├── ldbxtried.xdot │ ├── longflat.xdot │ ├── mike.xdot │ ├── nhg.xdot │ ├── oldarrows.xdot │ ├── pgram.xdot │ ├── pm2way.xdot │ ├── pmpipe.xdot │ ├── polypoly.xdot │ ├── proc3d.xdot │ ├── psfonttest.xdot │ ├── record2.xdot │ ├── records.xdot │ ├── rowe.xdot │ ├── russian.xdot │ ├── sdh.xdot │ ├── shells.xdot │ ├── states.xdot │ ├── structs.xdot │ ├── switch.xdot │ ├── table.xdot │ ├── train11.xdot │ ├── trapeziumlr.xdot │ ├── tree.xdot │ ├── triedds.xdot │ ├── try.xdot │ ├── unix.xdot │ ├── unix2.xdot │ ├── viewfile.xdot │ └── world.xdot └── src ├── grammar ├── dot.pegjs └── xdot.pegjs ├── js ├── dot-checker.js ├── editor │ └── mode │ │ └── pegjs.js ├── fonts.js ├── layout-worker.js ├── palette.js ├── pegast.js ├── renderer.js ├── stage.js ├── styliseur.js ├── transformer.js └── transitions │ └── default.js └── main.js /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | .grunt 3 | /node_modules 4 | /lib 5 | /parser 6 | /karma -------------------------------------------------------------------------------- /.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "curly": true, 3 | "eqeqeq": true, 4 | "immed": true, 5 | "latedef": true, 6 | "newcap": true, 7 | "noarg": true, 8 | "sub": true, 9 | "undef": true, 10 | "expr": true, 11 | "boss": true, 12 | "eqnull": true, 13 | "node": true, 14 | "jasmine": true, 15 | "require": true, 16 | "globals": { 17 | "define": false, 18 | "require": false, 19 | "using": false, 20 | "window": false, 21 | "importScripts": false 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | addons: 3 | firefox: "53.0" 4 | node_js: 5 | - '0.12' 6 | env: 7 | global: 8 | secure: ZNOz4JR/AqXTZkRXxvBs2mt3z3T14jBnuRREg324jsA5tg6VzgotbwW2fiL6SkkLzVsjXGDYJyAcr9vTMXw4WPlXCkuhZ6ga25UjvxMqYMDp4RJCpOcskxsmbHHeVBKzS5kQl1smKszizTq0dqvhSVTdOmcwNKKCT1QlqA/23W8= 9 | before_script: 10 | - export DISPLAY=:99.0 11 | - sh -e /etc/init.d/xvfb start 12 | - npm install -g grunt-cli 13 | - npm install -g bower 14 | - grunt build 15 | after_success: 16 | - grunt coveralls 17 | after_script: 18 | - grunt gh-pages 19 | -------------------------------------------------------------------------------- /Gruntfile.js: -------------------------------------------------------------------------------- 1 | module.exports = function (grunt) { 2 | 3 | // Project configuration. 4 | grunt.initConfig({ 5 | pkg: grunt.file.readJSON('package.json'), 6 | jshint: { 7 | all: [ 8 | 'Gruntfile.js', 9 | 'src/*.js' 10 | ], 11 | options: { 12 | jshintrc: '.jshintrc' 13 | } 14 | }, 15 | bower: { 16 | unit: { 17 | options: { 18 | layout: "byType", 19 | cleanBowerDir: true, 20 | bowerOptions: { 21 | production: false 22 | } 23 | } 24 | } 25 | }, 26 | clean: { 27 | dist: ["dist"], 28 | bower: ["lib/"] 29 | }, 30 | peg: { 31 | options: {exportVar: "parser"}, 32 | xdot: { 33 | src: "src/grammar/xdot.pegjs", 34 | dest: "parser/xdot.js" 35 | }, 36 | dot: { 37 | src: "src/grammar/dot.pegjs", 38 | dest: "parser/dot.js" 39 | } 40 | }, 41 | file_append: { 42 | default_options: { 43 | files: { 44 | 'parser/xdot.js': { 45 | prepend: "define(function () {\nvar ", 46 | append: "\nreturn parser;\n});" 47 | }, 48 | 'parser/dot.js': { 49 | prepend: "define(function () {\nvar ", 50 | append: "\nreturn parser;\n});" 51 | } 52 | } 53 | } 54 | }, 55 | requirejs: { 56 | options: { 57 | mainConfigFile: "src/main.js", 58 | baseUrl: "src/js", 59 | skipDirOptimize: false, 60 | optimize: "none", 61 | shim: { 62 | viz: { 63 | exports: "Viz" 64 | } 65 | }, 66 | paths: { 67 | requireLib: "../../lib/requirejs/require", 68 | d3: "empty:", 69 | "requirejs-web-workers": "empty:", 70 | ace: "empty:" 71 | } 72 | }, 73 | renderer: { 74 | options: { 75 | name: "renderer", 76 | out: "dist/renderer.js" 77 | } 78 | }, 79 | worker: { 80 | options: { 81 | name: "layout-worker", 82 | out: "dist/layout-worker.js", 83 | onBuildRead: function (moduleName, path, contents) { 84 | return contents.replace(/importScripts\([^)]+\)/gi, ''); 85 | }, 86 | include: ['requireLib'] 87 | } 88 | }, 89 | mode: { 90 | options: { 91 | name: "editor/mode/pegjs", 92 | out: "dist/ace-mode.js" 93 | } 94 | }, 95 | annotator: { 96 | options: { 97 | name: "dot-checker", 98 | out: "dist/dot-checker.js" 99 | } 100 | } 101 | }, 102 | watch: { 103 | page: { 104 | files: ['src/**', 'spec/**'], 105 | tasks: ['build', 'check'] 106 | }, 107 | options: { 108 | interval: 100 109 | } 110 | }, 111 | karma: { 112 | unit: { 113 | configFile: 'karma.conf.js' 114 | } 115 | }, 116 | coveralls: { 117 | options: { 118 | force: true 119 | }, 120 | firefox: { 121 | src: "karma/lcov.info" 122 | } 123 | }, 124 | 'gh-pages': { 125 | 'gh-pages': { 126 | options: { 127 | add: true, 128 | silent: true, 129 | user: { 130 | name: 'Marcin Stefaniuk', 131 | email: 'marcin@stefaniuk.info' 132 | }, 133 | repo: 'https://' + process.env.GH_TOKEN + '@github.com/mstefaniuk/graph-viz-d3-js.git', 134 | message: 'Publish karma tests results (auto)' 135 | }, 136 | src: ['karma/**'] 137 | } 138 | } 139 | }); 140 | 141 | grunt.loadNpmTasks('grunt-contrib-jshint'); 142 | grunt.loadNpmTasks('grunt-bower-task'); 143 | grunt.loadNpmTasks('grunt-contrib-uglify'); 144 | grunt.loadNpmTasks('grunt-contrib-copy'); 145 | grunt.loadNpmTasks('grunt-contrib-clean'); 146 | grunt.loadNpmTasks('grunt-contrib-requirejs'); 147 | grunt.loadNpmTasks('grunt-file-append'); 148 | grunt.loadNpmTasks('grunt-peg'); 149 | grunt.loadNpmTasks('grunt-contrib-watch'); 150 | grunt.loadNpmTasks('grunt-karma'); 151 | grunt.loadNpmTasks('grunt-gh-pages'); 152 | grunt.loadNpmTasks('grunt-coveralls'); 153 | 154 | // Macro tasks 155 | grunt.registerTask('default', ['build']); 156 | grunt.registerTask('build', ['clean:dist', 'compile']); 157 | grunt.registerTask('compile', ['peg', 'file_append']); 158 | grunt.registerTask('test', ['bower:unit', 'karma:unit']); 159 | grunt.registerTask('dist', ['requirejs']); 160 | grunt.registerTask('all', ['build', 'test', 'dist']); 161 | }; 162 | -------------------------------------------------------------------------------- /License: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) Copyright © 2013 Huddle 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of 4 | this software and associated documentation files (the “Software”), to deal in 5 | the Software without restriction, including without limitation the rights to 6 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 7 | the Software, and to permit persons to whom the Software is furnished to do so, 8 | subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 15 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 16 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 17 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 18 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 19 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Graphviz *dot* in your browser 2 | ============================== 3 | 4 | Bower component `graphviz-d3-renderer` renders [Graphviz](http://graphviz.org) source in the browser with [d3.js](https://github.com/mbostock/d3). 5 | Check it out on [Graphviz fiddling website](http://graphviz.it/). 6 | 7 | [![Build Status](https://travis-ci.org/mstefaniuk/graph-viz-d3-js.svg?branch=master)](https://travis-ci.org/mstefaniuk/graph-viz-d3-js) 8 | [![Coverage Status](https://coveralls.io/repos/mstefaniuk/graph-viz-d3-js/badge.svg?branch=master)](https://coveralls.io/r/mstefaniuk/graph-viz-d3-js?branch=master) 9 | ![Forks](https://img.shields.io/github/forks/mstefaniuk/graph-viz-d3-js.svg) 10 | ![Stars](https://img.shields.io/github/stars/mstefaniuk/graph-viz-d3-js.svg) 11 | [![Join the chat at https://gitter.im/mstefaniuk/graph-viz-d3-js](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/mstefaniuk/graph-viz-d3-js) 12 | 13 | Contents 14 | -------- 15 | * `dot` parser with lax mode to verify Graphviz input 16 | * `dot` mode for ACE editor 17 | * stage data renderer with `d3.js` 18 | 19 | Design 20 | ------ 21 | DOT parser is written in [PEG.js](https://github.com/dmajda/pegjs) has lax mode to parse source to the end with all errors. 22 | [Graphviz](http://graphviz.org) is embedded in browser using [viz.js](https://github.com/mdaines/viz.js). 23 | Instead of using SVG directly it uses `xdot` format and parses it. Data structure of the output is drawn using 24 | [d3.js](https://github.com/mbostock/d3) with animations during rendering. 25 | 26 | Usage 27 | ----- 28 | To include it in your project simply use `Bower`: 29 | ``` 30 | bower install graphviz-d3-renderer --save 31 | ``` 32 | 33 | Note that it needs `require.js` to work. Before loading proper paths should be defined for renderer and its dependecies (`d3.js` and `worker` for `require.js` plugin): 34 | ```javascript 35 | requirejs.config({ 36 | //By default load any module IDs from js/lib 37 | baseUrl: 'js', 38 | //except, if the module ID starts with "app", 39 | //load it from the js/app directory. paths 40 | //config is relative to the baseUrl, and 41 | //never includes a ".js" extension since 42 | //the paths config could be for a directory. 43 | paths: { 44 | d3: '/bower_components/d3/d3', 45 | "dot-checker": '/bower_components/graphviz-d3-renderer/dist/dot-checker', 46 | "layout-worker": '/bower_components/graphviz-d3-renderer/dist/layout-worker', 47 | worker: '/bower_components/requirejs-web-workers/src/worker', 48 | renderer: '/bower_components/graphviz-d3-renderer/dist/renderer' 49 | } 50 | }); 51 | ``` 52 | Then you can inject it into you app: 53 | ```javascript 54 | require(["renderer"], 55 | function (renderer) { 56 | 57 | dotSource = 'digraph xyz ...'; 58 | // initialize svg stage 59 | renderer.init("#graph"); 60 | 61 | // update stage with new dot source 62 | renderer.render(dotSource); 63 | }); 64 | ``` 65 | Now you can even zoom / drag your graph 66 | 67 | ```javascript 68 | require(["renderer"], 69 | function (renderer) { 70 | dotSource = 'digraph xyz ...'; 71 | // initialize svg stage. Have to get a return value from renderer.init 72 | // to properly reset the image. 73 | zoomFunc = renderer.init({element:"#graph", extend:[0.1, 10]}); 74 | 75 | // update stage with new dot source 76 | renderer.render(dotSource); 77 | 78 | // for saving the image, 79 | $('#copy-button').on('click', function(){ 80 | $('#copy-div').html(renderer.getImage({reset:true, zoomFunc:zoomFunc})); 81 | }); 82 | 83 | // if do not need to reset the image before saving the image 84 | $('#copy-button').on('click', function(){ 85 | $('#copy-div').html(renderer.getImage()); 86 | }); 87 | }); 88 | ``` 89 | 90 | Roadmap 91 | ------- 92 | * Test suite using Graphviz gallery examples (50% done) 93 | * Improve animations with path tweening and concatenation of arrow heads with arrow arcs 94 | * Custom `viz.js` compile with `xdot` output only to optimize size 95 | 96 | Building and contributing 97 | ------- 98 | To make controlled changes you need `node` and `grunt`. When you add a new feature you must cover it with unit tests. 99 | ```bash 100 | > grunt build test 101 | ``` 102 | 103 | When everything is ready you can build also dist version (takes some time). 104 | ```bash 105 | > grunt all 106 | ``` 107 | 108 | License 109 | ------- 110 | Currently project is available on LGPL so you can use it unmodified in free or commercial projects. If you add improvements 111 | to it you must share them. 112 | -------------------------------------------------------------------------------- /bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "graphviz-d3-renderer", 3 | "version": "0.9.24", 4 | "dependencies": { 5 | "requirejs": "2.1.15", 6 | "d3": "4.7.4", 7 | "requirejs-web-workers": "~1.0.1", 8 | "viz.js": "~1.5.1" 9 | }, 10 | "devDependencies": { 11 | "rfactory": "1.1.0", 12 | "requirejs-text": "2.0.13", 13 | "js-imagediff": "HumbleSoftware/js-imagediff#b7398e1", 14 | "resemblejs": "^2.2.0" 15 | }, 16 | "exportsOverride": { 17 | "requirejs": { 18 | "": "require.js" 19 | }, 20 | "requirejs-text": { 21 | "": "text.js" 22 | }, 23 | "requirejs-web-workers": { 24 | "": "src/*" 25 | }, 26 | "js-imagediff": { 27 | "": "js/imagediff.js" 28 | } 29 | }, 30 | "authors": [ 31 | "Marcin Stefaniuk " 32 | ], 33 | "license": "GPL", 34 | "private": false, 35 | "main": [ 36 | "dist/renderer.js", 37 | "dist/layout-worker.js", 38 | "dist/ace-mode.js", 39 | "dist/dot-checker.js" 40 | ], 41 | "ignore": [ 42 | "**/.*", 43 | "spec", 44 | "src", 45 | "Gruntfile.js", 46 | "karma.conf.js" 47 | ] 48 | } 49 | -------------------------------------------------------------------------------- /dist/ace-mode.js: -------------------------------------------------------------------------------- 1 | define( 'ace/mode/pegjs', [ 2 | 3 | 'ace/lib/oop', 4 | 'ace/mode/text_highlight_rules', 5 | 'ace/mode/javascript_highlight_rules' 6 | 7 | ], function ( oop, textHighlightRules, javascriptHighlightRules ) { 8 | 9 | 'use strict'; 10 | 11 | var TextHighlightRules = textHighlightRules.TextHighlightRules; 12 | var JavaScriptHighlightRules = javascriptHighlightRules.JavaScriptHighlightRules; 13 | 14 | var pegjsHighlightRules = function ( ) { 15 | 16 | this.$rules = { 17 | 18 | 'start' : [ { 19 | token : 'constant.language', 20 | regex : '[a-z][a-zA-Z]+' 21 | }, { 22 | token : 'keyword.operator', 23 | regex : '[=/]', 24 | next : 'peg-rule' 25 | } ], 26 | 27 | 'peg-rule' : [ { 28 | token : 'string', 29 | regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' 30 | }, { 31 | token : 'string', 32 | regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" 33 | }, { 34 | token : 'keyword.operator', 35 | regex : '^\\S*(?=[=/{(]|$)', 36 | next : 'wait' 37 | }, { 38 | token : 'variable', 39 | regex : '[a-z][a-zA-Z]+:' 40 | }, { 41 | token : 'identifier', 42 | regex : '[a-z][a-zA-Z]+' 43 | }, { 44 | token : 'string', 45 | regex : '\\[(?:(?:\\\\.)|(?:[^\\]\\\\]))*?\\]' 46 | }, { 47 | token : 'keyword.operator', 48 | regex : '[+?*()/]' 49 | }, { 50 | token : 'keyword.operator', 51 | regex : '{', 52 | next : 'js-start' 53 | } ] 54 | 55 | }; 56 | 57 | for ( var i in this.$rules ) { 58 | this.$rules[ i ].unshift( { 59 | token : 'comment', 60 | regex : '/\\*', 61 | next : 'comment' 62 | } ); 63 | } 64 | 65 | this.$rules.comment = [ { 66 | token : 'comment', 67 | regex : '\\*/', 68 | next : 'start' 69 | }, { 70 | token : 'comment', 71 | regex : '.' 72 | } ]; 73 | 74 | this.embedRules( JavaScriptHighlightRules, 'js-', [ 75 | { token : 'keyword', regex : '}', next : 'start' } 76 | ] ); 77 | 78 | }; 79 | 80 | oop.inherits( pegjsHighlightRules, TextHighlightRules ); 81 | return { pegjsHighlightRules : pegjsHighlightRules }; 82 | 83 | } ); 84 | define("editor/mode/pegjs", function(){}); 85 | 86 | -------------------------------------------------------------------------------- /karma.conf.js: -------------------------------------------------------------------------------- 1 | module.exports = function (config) { 2 | config.set({ 3 | basePath: '', 4 | frameworks: ['jasmine', 'requirejs'], 5 | files: [ 6 | 'spec/test-main.js', 7 | {pattern: 'lib/**/*.js', included: false}, 8 | {pattern: 'spec/jasmine/data-helpers.js', included: true}, 9 | {pattern: 'spec/jasmine/image-matchers.js', included: false}, 10 | {pattern: 'spec/*-spec.js', included: false}, 11 | {pattern: 'spec/*/**/*.+(js|gv|xdot)', included: false}, 12 | {pattern: 'spec/img/*.png', included: false}, 13 | {pattern: 'src/**/*.js', included: false}, 14 | {pattern: 'parser/*.js', included: false} 15 | ], 16 | exclude: [], 17 | preprocessors: { 18 | 'src/js/*.js': ['coverage'] 19 | }, 20 | reporters: ['jasmine-diff', 'progress', 'coverage', 'html'], 21 | coverageReporter: { 22 | type: 'lcovonly', 23 | dir: 'karma', 24 | subdir: '.' 25 | }, 26 | htmlReporter: { 27 | outputDir: 'karma', 28 | templatePath: 'spec/karma/html-reporter-template.html', 29 | namedFiles: true, 30 | reportName: 'report' 31 | }, 32 | port: 9876, 33 | browserNoActivityTimeout: 60000, 34 | colors: true, 35 | // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG 36 | logLevel: config.LOG_INFO, 37 | //autoWatch: true, 38 | //browsers: ['PhantomJS'], 39 | browsers: ['Firefox'], 40 | singleRun: true 41 | }); 42 | }; 43 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "graphviz-d3-renderer", 3 | "version": "0.9.24", 4 | "devDependencies": { 5 | "grunt": "~0.4.2", 6 | "grunt-bower-task": "~0.4.0", 7 | "grunt-contrib-clean": "~0.5.0", 8 | "grunt-contrib-copy": "~0.4.1", 9 | "grunt-contrib-jshint": "~0.8.0", 10 | "grunt-contrib-requirejs": "~0.4.1", 11 | "grunt-contrib-uglify": "~0.2.7", 12 | "grunt-contrib-watch": "~0.5.3", 13 | "grunt-coveralls": "^1.0.0", 14 | "grunt-file-append": "0.0.2", 15 | "grunt-gh-pages": "^1.1.0", 16 | "grunt-karma": "^0.12.1", 17 | "grunt-peg": "~1.1.0", 18 | "jasmine-core": "^2.3.4", 19 | "karma": "^0.13.10", 20 | "karma-chrome-launcher": "^0.1.7", 21 | "karma-coverage": "^0.2.7", 22 | "karma-firefox-launcher": "^0.1.6", 23 | "karma-html-reporter": "^0.2.7", 24 | "karma-jasmine": "^0.3.6", 25 | "karma-jasmine-diff-reporter": "^0.3.4", 26 | "karma-requirejs": "^0.2.2" 27 | }, 28 | "scripts": { 29 | "test": "grunt test" 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /spec/asts/backslash.js: -------------------------------------------------------------------------------- 1 | define({ 2 | "type": "digraph", 3 | "id": "G", 4 | "commands": [ 5 | { 6 | "type": "graph", 7 | "attributes": [ 8 | { 9 | "type": "draw", 10 | "elements": [ 11 | { 12 | "shape": "polygon", 13 | "points": [ 14 | [ 15 | 0, 16 | 0 17 | ], 18 | [ 19 | 0, 20 | 36 21 | ], 22 | [ 23 | 129.32, 24 | 36 25 | ], 26 | [ 27 | 129.32, 28 | 0 29 | ] 30 | ], 31 | "style": [ 32 | { 33 | "key": "stroke", 34 | "value": "#fffffe00" 35 | }, 36 | { 37 | "key": "fill", 38 | "value": "#ffffff" 39 | } 40 | ] 41 | } 42 | ] 43 | }, 44 | { 45 | "name": "bb", 46 | "type": "skip" 47 | }, 48 | { 49 | "name": "xdotversion", 50 | "type": "skip" 51 | } 52 | ] 53 | }, 54 | { 55 | "type": "skip", 56 | "attributes": [ 57 | { 58 | "name": "label", 59 | "type": "skip" 60 | } 61 | ] 62 | }, 63 | { 64 | "type": "node", 65 | "id": "Test", 66 | "attributes": [ 67 | { 68 | "type": "draw", 69 | "elements": [ 70 | { 71 | "shape": "ellipse", 72 | "cx": 64.66, 73 | "cy": 18, 74 | "rx": 64.82, 75 | "ry": 18, 76 | "style": [ 77 | { 78 | "key": "stroke", 79 | "value": "#000000" 80 | } 81 | ] 82 | } 83 | ] 84 | }, 85 | { 86 | "type": "ldraw", 87 | "elements": [ 88 | { 89 | "x": 64.66, 90 | "y": 13.8, 91 | "text": "alpha\\beta\\\\gamma\\\\\\delta space", 92 | "anchor": "middle", 93 | "style": [ 94 | { 95 | "key": "font-family", 96 | "value": "'Times-Roman',serif" 97 | }, 98 | { 99 | "key": "font-size", 100 | "value": 14 101 | }, 102 | { 103 | "key": "stroke", 104 | "value": "#000000" 105 | } 106 | ] 107 | } 108 | ] 109 | }, 110 | { 111 | "name": "height", 112 | "type": "skip" 113 | }, 114 | { 115 | "name": "label", 116 | "type": "skip" 117 | }, 118 | { 119 | "name": "pos", 120 | "type": "skip" 121 | }, 122 | { 123 | "name": "width", 124 | "type": "skip" 125 | } 126 | ] 127 | } 128 | ] 129 | }); 130 | -------------------------------------------------------------------------------- /spec/asts/comma.js: -------------------------------------------------------------------------------- 1 | define({ 2 | "type": "digraph", 3 | "id": "G", 4 | "commands": [ 5 | { 6 | "type": "graph", 7 | "attributes": [ 8 | { 9 | "type": "draw", 10 | "elements": [ 11 | { 12 | "shape": "polygon", 13 | "points": [ 14 | [ 15 | 0, 16 | 0 17 | ], 18 | [ 19 | 0, 20 | 36 21 | ], 22 | [ 23 | 118, 24 | 36 25 | ], 26 | [ 27 | 118, 28 | 0 29 | ] 30 | ], 31 | "style": [ 32 | { 33 | "key": "stroke", 34 | "value": "#fffffe00" 35 | }, 36 | { 37 | "key": "fill", 38 | "value": "#ffffff" 39 | } 40 | ] 41 | } 42 | ] 43 | }, 44 | { 45 | "name": "bb", 46 | "type": "skip" 47 | }, 48 | { 49 | "name": "xdotversion", 50 | "type": "skip" 51 | } 52 | ] 53 | }, 54 | { 55 | "type": "skip", 56 | "attributes": [ 57 | { 58 | "name": "label", 59 | "type": "skip" 60 | } 61 | ] 62 | }, 63 | { 64 | "type": "node", 65 | "id": "Test", 66 | "attributes": [ 67 | { 68 | "type": "draw", 69 | "elements": [ 70 | { 71 | "shape": "ellipse", 72 | "cx": 59, 73 | "cy": 18, 74 | "rx": 59.19, 75 | "ry": 18, 76 | "style": [ 77 | { 78 | "key": "stroke", 79 | "value": "#000000" 80 | } 81 | ] 82 | } 83 | ] 84 | }, 85 | { 86 | "type": "ldraw", 87 | "elements": [ 88 | { 89 | "x": 21, 90 | "y": 14.3, 91 | "text": "first,second", 92 | "anchor": "start", 93 | "style": [ 94 | { 95 | "key": "font-family", 96 | "value": "'Times-Roman',serif" 97 | }, 98 | { 99 | "key": "font-size", 100 | "value": 14 101 | }, 102 | { 103 | "key": "stroke", 104 | "value": "#000000" 105 | } 106 | ] 107 | } 108 | ] 109 | }, 110 | { 111 | "name": "height", 112 | "type": "skip" 113 | }, 114 | { 115 | "name": "label", 116 | "type": "skip" 117 | }, 118 | { 119 | "name": "pos", 120 | "type": "skip" 121 | }, 122 | { 123 | "name": "width", 124 | "type": "skip" 125 | } 126 | ] 127 | } 128 | ] 129 | }); 130 | -------------------------------------------------------------------------------- /spec/asts/image.js: -------------------------------------------------------------------------------- 1 | define({ 2 | "type": "digraph", 3 | "id": null, 4 | "commands": [ 5 | { 6 | "type": "graph", 7 | "attributes": [ 8 | { 9 | "type": "draw", 10 | "elements": [ 11 | { 12 | "shape": "polygon", 13 | "points": [ 14 | [ 15 | 0, 16 | 0 17 | ], 18 | [ 19 | 0, 20 | 36 21 | ], 22 | [ 23 | 60, 24 | 36 25 | ], 26 | [ 27 | 60, 28 | 0 29 | ] 30 | ], 31 | "style": [ 32 | { 33 | "key": "stroke", 34 | "value": "#fffffe00" 35 | }, 36 | { 37 | "key": "fill", 38 | "value": "#ffffff" 39 | } 40 | ] 41 | } 42 | ] 43 | } 44 | ] 45 | }, 46 | { 47 | "type": "node", 48 | "id": "TitleNode", 49 | "attributes": [ 50 | { 51 | "type": "draw", 52 | "elements": [ 53 | { 54 | "shape": "ellipse", 55 | "cx": 27, 56 | "cy": 18, 57 | "rx": 27, 58 | "ry": 18, 59 | "style": [ 60 | { 61 | "key": "stroke", 62 | "value": "#000000" 63 | } 64 | ] 65 | } 66 | ] 67 | }, 68 | { 69 | "type": "image", 70 | "value": "http://placehold.it/140x100" 71 | } 72 | ] 73 | } 74 | ] 75 | }); -------------------------------------------------------------------------------- /spec/asts/node-id.js: -------------------------------------------------------------------------------- 1 | define({ 2 | "type": "digraph", 3 | "id": "G", 4 | "commands": [ 5 | { 6 | "type": "graph", 7 | "attributes": [ 8 | { 9 | "type": "draw", 10 | "elements": [ 11 | { 12 | "shape": "polygon", 13 | "points": [ 14 | [ 15 | 0, 16 | 0 17 | ], 18 | [ 19 | 0, 20 | 36 21 | ], 22 | [ 23 | 95.02, 24 | 36 25 | ], 26 | [ 27 | 95.02, 28 | 0 29 | ] 30 | ], 31 | "style": [ 32 | { 33 | "key": "stroke", 34 | "value": "#fffffe00" 35 | }, 36 | { 37 | "key": "fill", 38 | "value": "#ffffff" 39 | } 40 | ] 41 | } 42 | ] 43 | }, 44 | { 45 | "name": "bb", 46 | "type": "skip" 47 | }, 48 | { 49 | "name": "xdotversion", 50 | "type": "skip" 51 | } 52 | ] 53 | }, 54 | { 55 | "type": "skip", 56 | "attributes": [ 57 | { 58 | "name": "label", 59 | "type": "skip" 60 | } 61 | ] 62 | }, 63 | { 64 | "type": "node", 65 | "id": "foo_node", 66 | "attributes": [ 67 | { 68 | "type": "draw", 69 | "elements": [ 70 | { 71 | "shape": "ellipse", 72 | "cx": 47.51, 73 | "cy": 18, 74 | "rx": 47.52, 75 | "ry": 18, 76 | "style": [ 77 | { 78 | "key": "stroke", 79 | "value": "#000000" 80 | } 81 | ] 82 | } 83 | ] 84 | }, 85 | { 86 | "type": "ldraw", 87 | "elements": [ 88 | { 89 | "x": 47.51, 90 | "y": 13.8, 91 | "text": "foo_node", 92 | "anchor": "middle", 93 | "style": [ 94 | { 95 | "key": "font-family", 96 | "value": "'Times-Roman',serif" 97 | }, 98 | { 99 | "key": "font-size", 100 | "value": 14 101 | }, 102 | { 103 | "key": "stroke", 104 | "value": "#000000" 105 | } 106 | ] 107 | } 108 | ] 109 | }, 110 | { 111 | "name": "height", 112 | "type": "skip" 113 | }, 114 | { 115 | "type": "id", 116 | "value": "foo_node_id" 117 | }, 118 | { 119 | "name": "pos", 120 | "type": "skip" 121 | }, 122 | { 123 | "name": "width", 124 | "type": "skip" 125 | } 126 | ] 127 | } 128 | ] 129 | }); -------------------------------------------------------------------------------- /spec/asts/quote.js: -------------------------------------------------------------------------------- 1 | define({ 2 | "type": "digraph", 3 | "id": "G", 4 | "commands": [ 5 | { 6 | "type": "graph", 7 | "attributes": [ 8 | { 9 | "type": "draw", 10 | "elements": [ 11 | { 12 | "shape": "polygon", 13 | "points": [ 14 | [ 15 | 0, 16 | 0 17 | ], 18 | [ 19 | 0, 20 | 36 21 | ], 22 | [ 23 | 129.32, 24 | 36 25 | ], 26 | [ 27 | 129.32, 28 | 0 29 | ] 30 | ], 31 | "style": [ 32 | { 33 | "key": "stroke", 34 | "value": "#fffffe00" 35 | }, 36 | { 37 | "key": "fill", 38 | "value": "#ffffff" 39 | } 40 | ] 41 | } 42 | ] 43 | }, 44 | { 45 | "name": "bb", 46 | "type": "skip" 47 | }, 48 | { 49 | "name": "xdotversion", 50 | "type": "skip" 51 | } 52 | ] 53 | }, 54 | { 55 | "type": "skip", 56 | "attributes": [ 57 | { 58 | "name": "label", 59 | "type": "skip" 60 | } 61 | ] 62 | }, 63 | { 64 | "type": "node", 65 | "id": "Test", 66 | "attributes": [ 67 | { 68 | "type": "draw", 69 | "elements": [ 70 | { 71 | "shape": "ellipse", 72 | "cx": 64.66, 73 | "cy": 18, 74 | "rx": 64.82, 75 | "ry": 18, 76 | "style": [ 77 | { 78 | "key": "stroke", 79 | "value": "#000000" 80 | } 81 | ] 82 | } 83 | ] 84 | }, 85 | { 86 | "type": "ldraw", 87 | "elements": [ 88 | { 89 | "x": 64.66, 90 | "y": 13.8, 91 | "text": "hello\"world\"", 92 | "anchor": "middle", 93 | "style": [ 94 | { 95 | "key": "font-family", 96 | "value": "'Times-Roman',serif" 97 | }, 98 | { 99 | "key": "font-size", 100 | "value": 14 101 | }, 102 | { 103 | "key": "stroke", 104 | "value": "#000000" 105 | } 106 | ] 107 | } 108 | ] 109 | }, 110 | { 111 | "name": "height", 112 | "type": "skip" 113 | }, 114 | { 115 | "name": "label", 116 | "type": "skip" 117 | }, 118 | { 119 | "name": "pos", 120 | "type": "skip" 121 | }, 122 | { 123 | "name": "width", 124 | "type": "skip" 125 | } 126 | ] 127 | } 128 | ] 129 | }); 130 | -------------------------------------------------------------------------------- /spec/asts/unicode-labels.js: -------------------------------------------------------------------------------- 1 | define({ 2 | "type": "digraph", 3 | "id": "G", 4 | "commands": [ 5 | { 6 | "type": "graph", 7 | "attributes": [ 8 | { 9 | "type": "draw", 10 | "elements": [ 11 | { 12 | "shape": "polygon", 13 | "points": [ 14 | [ 15 | 0, 16 | 0 17 | ], 18 | [ 19 | 0, 20 | 36 21 | ], 22 | [ 23 | 404.19, 24 | 36 25 | ], 26 | [ 27 | 404.19, 28 | 0 29 | ] 30 | ], 31 | "style": [ 32 | { 33 | "key": "stroke", 34 | "value": "#fffffe00" 35 | }, 36 | { 37 | "key": "fill", 38 | "value": "#ffffff" 39 | } 40 | ] 41 | } 42 | ] 43 | }, 44 | { 45 | "name": "bb", 46 | "type": "skip" 47 | }, 48 | { 49 | "name": "xdotversion", 50 | "type": "skip" 51 | } 52 | ] 53 | }, 54 | { 55 | "type": "skip", 56 | "attributes": [ 57 | { 58 | "name": "label", 59 | "type": "skip" 60 | } 61 | ] 62 | }, 63 | { 64 | "type": "node", 65 | "id": "installed", 66 | "attributes": [ 67 | { 68 | "type": "draw", 69 | "elements": [ 70 | { 71 | "shape": "ellipse", 72 | "cx": 61.44, 73 | "cy": 18, 74 | "rx": 61.38, 75 | "ry": 18, 76 | "style": [ 77 | { 78 | "key": "stroke", 79 | "value": "#000000" 80 | } 81 | ] 82 | } 83 | ] 84 | }, 85 | { 86 | "type": "ldraw", 87 | "elements": [ 88 | { 89 | "x": 61.44, 90 | "y": 13.8, 91 | "text": "已安装状态", 92 | "anchor": "middle", 93 | "style": [ 94 | { 95 | "key": "font-family", 96 | "value": "'Times-Roman',serif" 97 | }, 98 | { 99 | "key": "font-size", 100 | "value": 14 101 | }, 102 | { 103 | "key": "stroke", 104 | "value": "#000000" 105 | } 106 | ] 107 | } 108 | ] 109 | }, 110 | { 111 | "name": "height", 112 | "type": "skip" 113 | }, 114 | { 115 | "name": "label", 116 | "type": "skip" 117 | }, 118 | { 119 | "name": "pos", 120 | "type": "skip" 121 | }, 122 | { 123 | "name": "width", 124 | "type": "skip" 125 | } 126 | ] 127 | }, 128 | { 129 | "type": "node", 130 | "id": "Контрагенты", 131 | "attributes": [ 132 | { 133 | "type": "draw", 134 | "elements": [ 135 | { 136 | "shape": "ellipse", 137 | "cx": 272.44, 138 | "cy": 18, 139 | "rx": 132, 140 | "ry": 18, 141 | "style": [ 142 | { 143 | "key": "stroke", 144 | "value": "#000000" 145 | } 146 | ] 147 | } 148 | ] 149 | }, 150 | { 151 | "type": "ldraw", 152 | "elements": [ 153 | { 154 | "x": 272.44, 155 | "y": 13.8, 156 | "text": "Контрагенты", 157 | "anchor": "middle", 158 | "style": [ 159 | { 160 | "key": "font-family", 161 | "value": "'Times-Roman',serif" 162 | }, 163 | { 164 | "key": "font-size", 165 | "value": 14 166 | }, 167 | { 168 | "key": "stroke", 169 | "value": "#000000" 170 | } 171 | ] 172 | } 173 | ] 174 | }, 175 | { 176 | "name": "height", 177 | "type": "skip" 178 | }, 179 | { 180 | "name": "pos", 181 | "type": "skip" 182 | }, 183 | { 184 | "name": "width", 185 | "type": "skip" 186 | } 187 | ] 188 | } 189 | ] 190 | }); -------------------------------------------------------------------------------- /spec/dot-checker-spec.js: -------------------------------------------------------------------------------- 1 | define(['rfactory!dot-checker', 'parser/dot'], function (dotCheckerFactory, dot) { 2 | 3 | describe('Bridge between ACE and PEG', function () { 4 | var parserSpy, dotChecker; 5 | beforeEach(function () { 6 | parserSpy = jasmine.createSpyObj('parserMock', ['parse']); 7 | dotChecker = dotCheckerFactory({ 8 | 'parser/dot': parserSpy 9 | }); 10 | }); 11 | 12 | it("should provide proper options when dot source is linted", function () { 13 | var expectation = { 14 | clean: false, 15 | errors: [ 16 | {pos: 0, type: "keyword", string: "dgraph"}, 17 | {pos: 13, type: "attribute", string: "sape"} 18 | ] 19 | }; 20 | parserSpy.parse.and.callFake(function () { 21 | return expectation; 22 | }); 23 | var result = dotChecker.lint( 24 | "dgraph {node[sape=box]}" 25 | ); 26 | expect(result).toEqual(expectation); 27 | expect(parserSpy.parse.calls.count()).toEqual(1); 28 | expect(parserSpy.parse.calls.mostRecent().args[1]).toEqual({pegace: {mode: 'lint'}}); 29 | }); 30 | 31 | 32 | it("should provide proper options when dot source is parsed", function () { 33 | parserSpy.parse.and.callFake(function (source, options) { 34 | throw new Error(); 35 | }); 36 | expect(function () { 37 | dotChecker.parse( 38 | "dgraph {node[sape=box]}" 39 | ); 40 | }).toThrow(); 41 | expect(parserSpy.parse.calls.count()).toEqual(1); 42 | expect(parserSpy.parse.calls.mostRecent().args[1]).toEqual({pegace: {mode: 'strict'}}); 43 | }); 44 | 45 | it("should enrich parser exception with standard result flags when dot source is linted", function () { 46 | var provided = { 47 | message: 'Expected "digraph", "graph", "strict", [^ ] or whitespace but end of input found.', 48 | expected: [ 49 | {type: 'literal', value: 'digraph', description: '"digraph"'} 50 | ], 51 | found: null, 52 | offset: 0, 53 | line: 1, 54 | column: 1, 55 | name: 'SyntaxError' 56 | }; 57 | parserSpy.parse.and.callFake(function (source, options) { 58 | throw provided; 59 | }); 60 | var result = dotChecker.lint( 61 | "" 62 | ); 63 | expect(result.clean).toEqual(false); 64 | expect(result.level).toEqual("fatal"); 65 | expect(result.exception).toEqual(provided); 66 | expect(result.errors).toEqual([{pos: 0, type: 'syntax', string: null}]); 67 | }); 68 | }); 69 | }); -------------------------------------------------------------------------------- /spec/dot-parser-spec.js: -------------------------------------------------------------------------------- 1 | define(['parser/dot', 'spec/dots/directed'], function (dot, array) { 2 | 3 | describe('Dot parser', function () { 4 | var lint = {pegace: {mode: 'lint'}}; 5 | 6 | using("provided gallery graphs", array, function (graph) { 7 | it("should succeed in lint mode", function () { 8 | var result = dot.parse(graph, lint); 9 | expect(result.clean).toEqual(true); 10 | }); 11 | it("should succeed in strict mode", function () { 12 | var result = dot.parse(graph); 13 | expect(result.clean).toEqual(true); 14 | }); 15 | }); 16 | 17 | it("should parse escaped double quotes", function() { 18 | var result = dot.parse([ 19 | 'digraph G {', 20 | ' mynode [ label="Some\\\"quote" ];', 21 | '}'].join("\n")); 22 | expect(result.clean).toEqual(true); 23 | }); 24 | 25 | describe("during lax parsing", function() { 26 | 27 | it("should report unclosed curly brackets", function() { 28 | var result = dot.parse("digraph {unclosed", lint); 29 | expect(result.errors).toEqual([ { pos : 8, type : 'unterminated', string : '{' } ]); 30 | }); 31 | 32 | it("should report unclosed square brackets", function() { 33 | var result = dot.parse("digraph {unclosed[}", lint); 34 | expect(result.errors).toEqual([ { pos : 17, type : 'unterminated', string : '[' } ]); 35 | }); 36 | 37 | it("should report unclosed double angular brackets", function() { 38 | var result = dot.parse("digraph {uncl[url=<<]}", lint); 39 | expect(result.errors).toEqual([ { pos : 18, type : 'unterminated', string : '<<' } ]); 40 | }); 41 | 42 | it("should report unknown keyword", function() { 43 | var result = dot.parse("digrh {}", lint); 44 | expect(result.errors).toEqual([ { pos : 0, type : 'keyword', string : 'digrh' } ]); 45 | }); 46 | 47 | it("should report unknown attribute for node", function() { 48 | var result = dot.parse('graph {b->l[u="eee"]}', lint); 49 | expect(result.errors).toEqual([ { pos : 12, type : 'attribute', string : 'u' } ]); 50 | }); 51 | }); 52 | }); 53 | }); -------------------------------------------------------------------------------- /spec/dots/adept.gv: -------------------------------------------------------------------------------- 1 | graph Adept { 2 | labelloc="t"; 3 | label="The Apprentice Adept"; 4 | fontname="times new roman"; 5 | fontcolor="#000000"; 6 | fontsize="20"; 7 | splines=ortho; 8 | ranksep=".1"; 9 | bgcolor="transparent"; 10 | 11 | node [shape="box", style="filled", fontname="arial", fontsize="14"]; 12 | 13 | node [fillcolor="#ccccff"]; 14 | Stile; 15 | BAdept [label="Blue Adept"]; 16 | Chip; 17 | Bane; 18 | Mach; 19 | 20 | node [fillcolor="#ffcccc"]; 21 | LBlue [label="Lady Blue"]; 22 | Sheen [label="Sheen\n(robot)"]; 23 | Neysa [label="Neysa\n(unicorn)"]; 24 | Agape [label="Agape\n(alien)"]; 25 | Fleta; 26 | Nepe; 27 | Flach; 28 | 29 | node [shape="point"]; 30 | sUni [fillcolor="#00ff00", color="#ccffcc", label="Unicorn siblings"]; 31 | 32 | node [fillcolor="#ff0000", color="#ffcccc"] 33 | mBlue [label="Marriage of Lady Blue and the Blue Adept"]; 34 | mLBSt [label="Marriage of Lady Blue and Stile"]; 35 | mShBl [label="Marriage of Sheen and the Blue Adept"]; 36 | mAgBa [label="Marriage of Agape and Bane"]; 37 | mFlMa [label="Marriage of Fleta and Mach"]; 38 | 39 | { rank=same; Stile; mLBSt; LBlue; mBlue; BAdept; mShBl; Sheen; Neysa; Chip; } 40 | { rank=same; Bane; Agape; Mach; Fleta; mAgBa; mFlMa; } 41 | { rank=same; Nepe; Flach; } 42 | 43 | edge [style="bold", color="#ff0000"]; 44 | Stile -- mLBSt -- LBlue -- mBlue -- BAdept -- mShBl -- Sheen; 45 | Bane -- mAgBa -- Agape; 46 | Mach -- mFlMa -- Fleta; 47 | 48 | edge [style="solid", color="#000000"]; 49 | sUni -- { Neysa Chip }; 50 | 51 | Neysa -- Fleta; 52 | mLBSt -- Bane; 53 | mShBl -- Mach; 54 | mAgBa -- Nepe; 55 | mFlMa -- Flach; 56 | } -------------------------------------------------------------------------------- /spec/dots/directed.js: -------------------------------------------------------------------------------- 1 | define( 2 | [ 3 | //'text!spec/dots/directed/abstract.gv', 4 | 'text!spec/dots/directed/alf.gv', 5 | 'text!spec/dots/directed/arr_none.gv', 6 | 'text!spec/dots/directed/arrows.gv', 7 | 'text!spec/dots/directed/awilliams.gv', 8 | 'text!spec/dots/directed/biological.gv', 9 | 'text!spec/dots/directed/clust.gv', 10 | 'text!spec/dots/directed/clust1.gv', 11 | 'text!spec/dots/directed/clust2.gv', 12 | 'text!spec/dots/directed/clust3.gv', 13 | 'text!spec/dots/directed/clust4.gv', 14 | 'text!spec/dots/directed/clust5.gv', 15 | 'text!spec/dots/directed/crazy.gv', 16 | 'text!spec/dots/directed/ctext.gv', 17 | 'text!spec/dots/directed/dfa.gv', 18 | 'text!spec/dots/directed/fig6.gv', 19 | 'text!spec/dots/directed/fsm.gv', 20 | 'text!spec/dots/directed/grammar.gv', 21 | 'text!spec/dots/directed/hashtable.gv', 22 | // 'text!spec/dots/directed/honda-tokoro.gv', 23 | 'text!spec/dots/directed/japanese.gv', 24 | 'text!spec/dots/directed/jcctree.gv', 25 | 'text!spec/dots/directed/jsort.gv', 26 | 'text!spec/dots/directed/KW91.gv', 27 | 'text!spec/dots/directed/Latin1.gv', 28 | 'text!spec/dots/directed/ldbxtried.gv', 29 | 'text!spec/dots/directed/longflat.gv', 30 | 'text!spec/dots/directed/mike.gv', 31 | 'text!spec/dots/directed/NaN.gv', 32 | 'text!spec/dots/directed/nhg.gv', 33 | // 'text!spec/dots/directed/oldarrows.gv', 34 | 'text!spec/dots/directed/pgram.gv', 35 | // 'text!spec/dots/directed/pm2way.gv', 36 | // 'text!spec/dots/directed/pmpipe.gv', 37 | 'text!spec/dots/directed/polypoly.gv', 38 | // 'text!spec/dots/directed/proc3d.gv', 39 | 'text!spec/dots/directed/psfonttest.gv', 40 | 'text!spec/dots/directed/record2.gv', 41 | 'text!spec/dots/directed/records.gv', 42 | 'text!spec/dots/directed/rowe.gv', 43 | 'text!spec/dots/directed/russian.gv', 44 | //'text!spec/dots/directed/sdh.gv', 45 | 'text!spec/dots/directed/shells.gv', 46 | // 'text!spec/dots/directed/states.gv', 47 | 'text!spec/dots/directed/structs.gv', 48 | //'text!spec/dots/directed/switch.gv', 49 | 'text!spec/dots/directed/table.gv', 50 | 'text!spec/dots/directed/train11.gv', 51 | 'text!spec/dots/directed/trapeziumlr.gv', 52 | 'text!spec/dots/directed/tree.gv', 53 | 'text!spec/dots/directed/triedds.gv', 54 | 'text!spec/dots/directed/try.gv', 55 | 'text!spec/dots/directed/unix.gv', 56 | 'text!spec/dots/directed/unix2.gv', 57 | 'text!spec/dots/directed/viewfile.gv' 58 | //'text!spec/dots/directed/world.gv' 59 | ], function () { 60 | return [].slice.call(arguments,0,-1); 61 | }); -------------------------------------------------------------------------------- /spec/dots/directed/KW91.gv: -------------------------------------------------------------------------------- 1 | digraph G { 2 | style=bold; 3 | subgraph cluster_outer { 4 | Act_1 -> Act_21; 5 | Act_1 -> Act_23; 6 | Act_25 -> Act_3; 7 | subgraph cluster_inner { 8 | label = " Act_2"; 9 | {Act_21 -> Act_22 [minlen=2]; rank=same;} 10 | Act_22 -> Act_23; 11 | Act_22 -> Act_24; 12 | {Act_23 -> Act_24 [minlen=2]; rank=same;} 13 | Act_23 -> Act_25; 14 | Act_24 -> Act_25; 15 | } 16 | } 17 | Ext_1 -> Act_1; 18 | Act_3 -> Ext_2; 19 | Ext_3 -> Act_24; 20 | } 21 | -------------------------------------------------------------------------------- /spec/dots/directed/Latin1.gv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mstefaniuk/graph-viz-d3-js/546cc2e419bff3a10cdd981ed90d858a5324a526/spec/dots/directed/Latin1.gv -------------------------------------------------------------------------------- /spec/dots/directed/NaN.gv: -------------------------------------------------------------------------------- 1 | digraph xyz { 2 | orientation=landscape; 3 | ratio=compress; 4 | size="16,10"; 5 | AbstractMemory -> Memory; 6 | AliasedMemory -> AliasedMemory; 7 | AliasedMemory -> Memory; 8 | Architecture -> ROOT; 9 | Assembly -> ROOT; 10 | AtomProperties -> NRAtom; 11 | AtomWr -> Wr; 12 | Break -> Break; 13 | Break -> Target; 14 | Breakpoint -> Breakpoint; 15 | Breakpoint -> Event; 16 | Breakpoint -> ROOT; 17 | CDB -> Target; 18 | CDB -> Thread; 19 | CommonFrame -> Target; 20 | ControlOps -> InterpF; 21 | Displayed -> Displayed; 22 | Displayed -> InterpTypes; 23 | ETimer -> RTHeapRep; 24 | Event -> Event; 25 | Event -> ROOT; 26 | Event -> Target; 27 | EventHandler -> ROOT; 28 | EventHandler -> StandardEvents; 29 | Expression -> ROOT; 30 | ExpressionServer -> Expression; 31 | FollowBreakpoint -> Breakpoint; 32 | Formatter -> ROOT; 33 | Formatter -> Thread; 34 | Frame -> Frame; 35 | Frame -> Memory; 36 | Frame -> Target; 37 | FrameClass -> Frame; 38 | IntIntTbl -> IntIntTbl; 39 | IntIntTbl -> ROOT; 40 | Interp -> InterpF; 41 | Interp -> ROOT; 42 | InterpF -> Interp; 43 | InterpF -> InterpF; 44 | InterpF -> ROOT; 45 | InterpScan -> TokenStream; 46 | InterpTypes -> InterpTypes; 47 | InterpTypes -> ROOT; 48 | List -> Thread; 49 | LoadState -> LoadState; 50 | LoadState -> LoadStateRep; 51 | LoadState -> ROOT; 52 | LoadStateRep -> LoadState; 53 | LocationRep -> Memory; 54 | MC68Frame -> CommonFrame; 55 | MC68GCommonFrame -> EventHandler; 56 | MUTEX -> ROOT; 57 | Memory -> Displayed; 58 | Memory -> InterpTypes; 59 | MipsFrame -> CommonFrame; 60 | MipsFrame -> InterpTypes; 61 | MipsGCommonFrame -> EventHandler; 62 | NRAtom -> AtomProperties; 63 | NRAtom -> ROOT; 64 | NopBreakpoint -> Breakpoint; 65 | PSFormatter -> InterpTypes; 66 | PSInterp -> InterpTypes; 67 | PSLoadState -> InterpTypes; 68 | PSMemory -> InterpTypes; 69 | ProtectedWire -> ProtectedWire; 70 | ProtectedWire -> Wire; 71 | RTHeap -> RTHeapRep; 72 | RTHeapRep -> ROOT; 73 | Rd -> RdClass; 74 | RdClass -> MUTEX; 75 | RegisterMemory -> Memory; 76 | Scope -> ROOT; 77 | Scope -> Scope; 78 | Scope -> Target; 79 | SourceLoc -> Target; 80 | SourceMap -> ROOT; 81 | SparcFrame -> CommonFrame; 82 | SparcGCommonFrame -> EventHandler; 83 | StandardEvents -> StandardEvents; 84 | StandardEvents -> Target; 85 | StreamWire -> Wire; 86 | Symbol -> Displayed; 87 | Symbol -> Symbol; 88 | TThread -> ROOT; 89 | TThread -> Target; 90 | Target -> Displayed; 91 | Target -> Event; 92 | Target -> FrameClass; 93 | Target -> ROOT; 94 | Target -> TThread; 95 | Target -> Target; 96 | Target -> TargetF; 97 | Target -> Thread; 98 | TargetF -> Target; 99 | TargetState -> Assembly; 100 | TextRd -> Rd; 101 | TextWr -> Wr; 102 | Thread -> ROOT; 103 | Thread -> Thread; 104 | TokenStream -> ROOT; 105 | TokenStream -> TokenStream; 106 | Trap -> ROOT; 107 | TrapMemory -> Memory; 108 | UFileRd -> Rd; 109 | UFileRd -> UFileRd; 110 | UFileWr -> UFileWr; 111 | UFileWr -> Wr; 112 | UnixHandler -> Event; 113 | UnixHandler -> UnixHandler; 114 | UserBreak -> Break; 115 | UserBreak -> Breakpoint; 116 | UserBreak -> Event; 117 | UserBreak -> Trap; 118 | UserBreak -> UserBreak; 119 | VaxFrame -> CommonFrame; 120 | VaxGCommonFrame -> EventHandler; 121 | Wire -> ROOT; 122 | Wire -> TrapMemory; 123 | Wire -> Wire; 124 | Wr -> WrClass; 125 | WrClass -> MUTEX; 126 | } 127 | -------------------------------------------------------------------------------- /spec/dots/directed/abstract.gv: -------------------------------------------------------------------------------- 1 | digraph abstract { 2 | size="6,6"; 3 | S24 -> 27; 4 | S24 -> 25; 5 | S1 -> 10; 6 | S1 -> 2; 7 | S35 -> 36; 8 | S35 -> 43; 9 | S30 -> 31; 10 | S30 -> 33; 11 | 9 -> 42; 12 | 9 -> T1; 13 | 25 -> T1; 14 | 25 -> 26; 15 | 27 -> T24; 16 | 2 -> 3; 17 | 2 -> 16; 18 | 2 -> 17; 19 | 2 -> T1; 20 | 2 -> 18; 21 | 10 -> 11; 22 | 10 -> 14; 23 | 10 -> T1; 24 | 10 -> 13; 25 | 10 -> 12; 26 | 31 -> T1; 27 | 31 -> 32; 28 | 33 -> T30; 29 | 33 -> 34; 30 | 42 -> 4; 31 | 26 -> 4; 32 | 3 -> 4; 33 | 16 -> 15; 34 | 17 -> 19; 35 | 18 -> 29; 36 | 11 -> 4; 37 | 14 -> 15; 38 | 37 -> 39; 39 | 37 -> 41; 40 | 37 -> 38; 41 | 37 -> 40; 42 | 13 -> 19; 43 | 12 -> 29; 44 | 43 -> 38; 45 | 43 -> 40; 46 | 36 -> 19; 47 | 32 -> 23; 48 | 34 -> 29; 49 | 39 -> 15; 50 | 41 -> 29; 51 | 38 -> 4; 52 | 40 -> 19; 53 | 4 -> 5; 54 | 19 -> 21; 55 | 19 -> 20; 56 | 19 -> 28; 57 | 5 -> 6; 58 | 5 -> T35; 59 | 5 -> 23; 60 | 21 -> 22; 61 | 20 -> 15; 62 | 28 -> 29; 63 | 6 -> 7; 64 | 15 -> T1; 65 | 22 -> 23; 66 | 22 -> T35; 67 | 29 -> T30; 68 | 7 -> T8; 69 | 23 -> T24; 70 | 23 -> T1; 71 | } 72 | -------------------------------------------------------------------------------- /spec/dots/directed/alf.gv: -------------------------------------------------------------------------------- 1 | digraph Alf { 2 | size = "6,9"; 3 | node [ shape = record ]; 4 | Decl [ label = "\n\nDecl|{name|access|decl_flags|extern_c_linkage}"]; 5 | Nontype_decl [ label = "Nontype_decl|{type}"]; 6 | Defined_decl [ label = "Defined_decl|{linkage}"]; 7 | Data_decl [ label = "Data_decl|{storage_class}"]; 8 | Function_decl [ label = "Function_decl|{formals|defaults}"]; 9 | Data [ label = "Data|{initializer}"]; 10 | Function [ label = "Function|{body}"]; 11 | Constructor [ label = "Constructor|{member_initializers}"]; 12 | Aggregate -> Type_decl ; 13 | Class -> Aggregate; 14 | Union -> Aggregate; 15 | Data -> Data_decl; 16 | Data -> Defn; 17 | Data_decl -> Defined_decl; 18 | Data_member -> Nontype_decl ; 19 | Defined_decl -> Nontype_decl; 20 | Defn -> Defined_decl; 21 | Enum -> Type_decl ; 22 | Enumerator -> Nontype_decl ; 23 | Function -> Defn; 24 | Function -> Function_decl; 25 | Constructor -> Function; 26 | Destructor -> Function; 27 | Function_decl -> Defined_decl; 28 | Nontype_decl -> Decl ; 29 | Template_type_arg -> Type_decl ; 30 | Type_decl -> Decl ; 31 | Typedef -> Type_decl ; 32 | } 33 | -------------------------------------------------------------------------------- /spec/dots/directed/arr_none.gv: -------------------------------------------------------------------------------- 1 | digraph { 2 | node [shape=point label=none] 3 | a->b[arrowhead="nonenonenonenone"] 4 | c->d[arrowhead="teenonenonenone"] 5 | e->f[arrowhead="noneteenonenone"] 6 | g->h[arrowhead="teeteenonenone"] 7 | i->j[arrowhead="nonenoneteenone"] 8 | k->l[arrowhead="teenoneteenone"] 9 | m->n[arrowhead="noneteeteenone"] 10 | o->p[arrowhead="teeteeteenone"] 11 | q->r[arrowhead="nonenonenoneteenone"] 12 | s->t[arrowhead="teenonenonetee"] 13 | u->v[arrowhead="noneteenonetee"] 14 | w->y[arrowhead="teeteenonetee"] 15 | x->z[arrowhead="nonenoneteetee"] 16 | A->B[arrowhead="teenoneteetee"] 17 | C->D[arrowhead="noneteeteetee"] 18 | E->F[arrowhead="teeteeteetee"] 19 | } 20 | -------------------------------------------------------------------------------- /spec/dots/directed/arrows.gv: -------------------------------------------------------------------------------- 1 | digraph G { 2 | graph [rankdir=LR nodesep=0] 3 | node [shape=point label=""] 4 | edge [fontsize=10] 5 | _box -> box [arrowhead=box label=box] 6 | box -> boxbox [arrowhead=boxbox label=boxbox] 7 | _box -> lbox [arrowhead=lbox label=lbox] 8 | lbox -> lboxlbox [arrowhead=lboxlbox label=lboxlbox] 9 | _box -> rbox [arrowhead=rbox label=rbox] 10 | rbox -> rboxrbox [arrowhead=rboxrbox label=rboxrbox] 11 | _box -> olbox [arrowhead=olbox label=olbox] 12 | olbox -> olboxolbox [arrowhead=olboxolbox label=olboxolbox] 13 | _box -> orbox [arrowhead=orbox label=orbox] 14 | orbox -> orboxorbox [arrowhead=orboxorbox label=orboxorbox] 15 | _box -> obox [arrowhead=obox label=obox] 16 | obox -> oboxobox [arrowhead=oboxobox label=oboxobox] 17 | _crow -> crow [arrowhead=crow label=crow] 18 | crow -> crowcrow [arrowhead=crowcrow label=crowcrow] 19 | _crow -> lcrow [arrowhead=lcrow label=lcrow] 20 | lcrow -> lcrowlcrow [arrowhead=lcrowlcrow label=lcrowlcrow] 21 | _crow -> rcrow [arrowhead=rcrow label=rcrow] 22 | rcrow -> rcrowrcrow [arrowhead=rcrowrcrow label=rcrowrcrow] 23 | _diamond -> diamond [arrowhead=diamond label=diamond] 24 | diamond -> diamonddiamond [arrowhead=diamonddiamond label=diamonddiamond] 25 | _diamond -> ldiamond [arrowhead=ldiamond label=ldiamond] 26 | ldiamond -> ldiamondldiamond [arrowhead=ldiamondldiamond label=ldiamondldiamond] 27 | _diamond -> rdiamond [arrowhead=rdiamond label=rdiamond] 28 | rdiamond -> rdiamondrdiamond [arrowhead=rdiamondrdiamond label=rdiamondrdiamond] 29 | _diamond -> oldiamond [arrowhead=oldiamond label=oldiamond] 30 | oldiamond -> oldiamondoldiamond [arrowhead=oldiamondoldiamond label=oldiamondoldiamond] 31 | _diamond -> ordiamond [arrowhead=ordiamond label=ordiamond] 32 | ordiamond -> ordiamondordiamond [arrowhead=ordiamondordiamond label=ordiamondordiamond] 33 | _diamond -> odiamond [arrowhead=odiamond label=odiamond] 34 | odiamond -> odiamondodiamond [arrowhead=odiamondodiamond label=odiamondodiamond] 35 | _dot -> dot [arrowhead=dot label=dot] 36 | dot -> dotdot [arrowhead=dotdot label=dotdot] 37 | _dot -> odot [arrowhead=odot label=odot] 38 | odot -> odotodot [arrowhead=odotodot label=odotodot] 39 | _inv -> inv [arrowhead=inv label=inv] 40 | inv -> invinv [arrowhead=invinv label=invinv] 41 | _inv -> linv [arrowhead=linv label=linv] 42 | linv -> linvlinv [arrowhead=linvlinv label=linvlinv] 43 | _inv -> rinv [arrowhead=rinv label=rinv] 44 | rinv -> rinvrinv [arrowhead=rinvrinv label=rinvrinv] 45 | _inv -> olinv [arrowhead=olinv label=olinv] 46 | olinv -> olinvolinv [arrowhead=olinvolinv label=olinvolinv] 47 | _inv -> orinv [arrowhead=orinv label=orinv] 48 | orinv -> orinvorinv [arrowhead=orinvorinv label=orinvorinv] 49 | _inv -> oinv [arrowhead=oinv label=oinv] 50 | oinv -> oinvoinv [arrowhead=oinvoinv label=oinvoinv] 51 | _none -> none [arrowhead=none label=none] 52 | none -> nonenone [arrowhead=nonenone label=nonenone] 53 | _normal -> normal [arrowhead=normal label=normal] 54 | normal -> normalnormal [arrowhead=normalnormal label=normalnormal] 55 | _normal -> lnormal [arrowhead=lnormal label=lnormal] 56 | lnormal -> lnormallnormal [arrowhead=lnormallnormal label=lnormallnormal] 57 | _normal -> rnormal [arrowhead=rnormal label=rnormal] 58 | rnormal -> rnormalrnormal [arrowhead=rnormalrnormal label=rnormalrnormal] 59 | _normal -> olnormal [arrowhead=olnormal label=olnormal] 60 | olnormal -> olnormalolnormal [arrowhead=olnormalolnormal label=olnormalolnormal] 61 | _normal -> ornormal [arrowhead=ornormal label=ornormal] 62 | ornormal -> ornormalornormal [arrowhead=ornormalornormal label=ornormalornormal] 63 | _normal -> onormal [arrowhead=onormal label=onormal] 64 | onormal -> onormalonormal [arrowhead=onormalonormal label=onormalonormal] 65 | _tee -> tee [arrowhead=tee label=tee] 66 | tee -> teetee [arrowhead=teetee label=teetee] 67 | _tee -> ltee [arrowhead=ltee label=ltee] 68 | ltee -> lteeltee [arrowhead=lteeltee label=lteeltee] 69 | _tee -> rtee [arrowhead=rtee label=rtee] 70 | rtee -> rteertee [arrowhead=rteertee label=rteertee] 71 | _vee -> vee [arrowhead=vee label=vee] 72 | vee -> veevee [arrowhead=veevee label=veevee] 73 | _vee -> lvee [arrowhead=lvee label=lvee] 74 | lvee -> lveelvee [arrowhead=lveelvee label=lveelvee] 75 | _vee -> rvee [arrowhead=rvee label=rvee] 76 | rvee -> rveervee [arrowhead=rveervee label=rveervee] 77 | _curve -> curve [arrowhead=curve label=curve] 78 | curve -> curvecurve [arrowhead=curvecurve label=curvecurve] 79 | _curve -> lcurve [arrowhead=lcurve label=lcurve] 80 | lcurve -> lcurvelcurve [arrowhead=lcurvelcurve label=lcurvelcurve] 81 | _curve -> rcurve [arrowhead=rcurve label=rcurve] 82 | rcurve -> rcurvercurve [arrowhead=rcurvercurve label=rcurvercurve] 83 | } 84 | -------------------------------------------------------------------------------- /spec/dots/directed/biological.gv: -------------------------------------------------------------------------------- 1 | digraph g { 2 | rankdir=LR; 3 | 4 | node [shape=rpromoter colorscheme=rdbu5 color=1 style=filled fontcolor=3]; Hef1a; TRE; UAS; Hef1aLacOid; 5 | Hef1aLacOid [label="Hef1a-LacOid"]; 6 | node [shape=rarrow colorscheme=rdbu5 color=5 style=filled fontcolor=3]; Gal4VP16; LacI; rtTA3; DeltamCherry; 7 | Gal4VP16 [label="Gal4-VP16"]; 8 | product [shape=oval style=filled colorscheme=rdbu5 color=2 label=""]; 9 | repression [shape=oval label="LacI repression" fontcolor=black style=dotted]; 10 | node [shape=oval style=filled colorscheme=rdbu5 color=4 fontcolor=5]; 11 | combination [label="rtTA3 + Doxycycline"]; 12 | LacIprotein [label="LacI"]; 13 | rtTA3protein [label="rtTA3"]; 14 | Gal4VP16protein [label="Gal4-VP16"]; 15 | 16 | 17 | subgraph cluster_0 { 18 | colorscheme=rdbu5; 19 | color=3; 20 | node [colorscheme=rdbu5 fontcolor=3]; 21 | Hef1a -> Gal4VP16 [arrowhead=none]; 22 | Gal4VP16 -> UAS [arrowhead=none]; 23 | UAS -> LacI [arrowhead=none]; 24 | LacI -> Hef1aLacOid [arrowhead=none]; 25 | Hef1aLacOid -> rtTA3 [arrowhead=none]; 26 | rtTA3 -> TRE [arrowhead=none]; 27 | TRE -> DeltamCherry [arrowhead=none] 28 | } 29 | 30 | Gal4VP16 -> Gal4VP16protein; 31 | Gal4VP16protein -> UAS; 32 | LacI -> LacIprotein; 33 | LacIprotein -> repression; 34 | repression -> Hef1aLacOid [arrowhead=tee]; 35 | IPTG -> repression [arrowhead=tee]; 36 | rtTA3 -> rtTA3protein; 37 | rtTA3protein -> combination; 38 | combination -> TRE; 39 | Doxycycline -> combination; 40 | DeltamCherry -> product; 41 | 42 | 43 | 44 | } 45 | -------------------------------------------------------------------------------- /spec/dots/directed/clust.gv: -------------------------------------------------------------------------------- 1 | digraph G { 2 | subgraph cluster_0 { 3 | label = "hello world"; 4 | a -> b; 5 | a -> c; 6 | color = hotpink; 7 | } 8 | 9 | subgraph cluster_1 { 10 | label = "MSDOT"; 11 | style= "dashed"; 12 | color=purple; 13 | x -> y; 14 | x -> z; 15 | y -> z; 16 | y -> q; 17 | } 18 | 19 | top -> a; 20 | top -> y; 21 | y -> b; 22 | } 23 | -------------------------------------------------------------------------------- /spec/dots/directed/clust1.gv: -------------------------------------------------------------------------------- 1 | digraph G { 2 | subgraph cluster_c0 {a0 -> a1 -> a2 -> a3;} 3 | subgraph cluster_c1 {b0 -> b1 -> b2 -> b3;} 4 | x -> a0; 5 | x -> b0; 6 | a1 -> a3; 7 | a3 -> a0; 8 | } 9 | -------------------------------------------------------------------------------- /spec/dots/directed/clust2.gv: -------------------------------------------------------------------------------- 1 | digraph G { 2 | subgraph cluster_c0 {a0 -> a1 -> a2 -> a3;} 3 | subgraph cluster_c1 {b0 -> b1 -> b2 -> b3;} 4 | x -> a0; 5 | x -> b0; 6 | a1 -> b3; 7 | b3 -> a1; 8 | } 9 | -------------------------------------------------------------------------------- /spec/dots/directed/clust3.gv: -------------------------------------------------------------------------------- 1 | digraph G { 2 | subgraph cluster_c0 {a0 -> a1 -> a2 -> a3;} 3 | subgraph cluster_c1 {b0 -> b1 -> b2 -> b3;} 4 | x -> a0; 5 | x -> b0; 6 | a1 -> b3; 7 | b1 -> a3; 8 | } 9 | -------------------------------------------------------------------------------- /spec/dots/directed/clust4.gv: -------------------------------------------------------------------------------- 1 | digraph G { 2 | 3 | subgraph cluster_0 { 4 | style=filled; 5 | color=lightgrey; 6 | node [style=filled,color=white]; 7 | a0 -> a1 -> a2 -> a3; 8 | label = "process #1"; 9 | } 10 | 11 | subgraph cluster_1 { 12 | node [style=filled]; 13 | b0 -> b1 -> b2 -> b3; 14 | label = "process #2"; 15 | color=blue 16 | } 17 | start -> a0; 18 | start -> b0; 19 | a1 -> b3; 20 | b2 -> a3; 21 | a3 -> a0; 22 | a3 -> end; 23 | b3 -> end; 24 | 25 | start [shape=Mdiamond]; 26 | end [shape=Msquare]; 27 | } 28 | -------------------------------------------------------------------------------- /spec/dots/directed/clust5.gv: -------------------------------------------------------------------------------- 1 | digraph G { 2 | size="6,6"; 3 | a -> b -> c; 4 | 5 | subgraph cluster0 { 6 | x0 -> y0; 7 | x0 -> z0; 8 | } 9 | 10 | subgraph cluster1 { 11 | x1 -> y1; 12 | x1 -> z1; 13 | } 14 | 15 | subgraph cluster2 { 16 | x2 -> y2; 17 | x2 -> z2; 18 | } 19 | 20 | a -> x0; 21 | b -> x1; 22 | b -> x2; 23 | a -> z2; 24 | c -> z1; 25 | } 26 | -------------------------------------------------------------------------------- /spec/dots/directed/ctext.gv: -------------------------------------------------------------------------------- 1 | digraph G { 2 | xyz [label = "hello\nworld",color="slateblue",fontsize=24,fontname="Palatino-Italic",style=filled,fontcolor="hotpink"]; 3 | node [style=filled]; 4 | red [color=red]; 5 | green [color=green]; 6 | blue [color=blue,fontcolor=black]; 7 | cyan [color=cyan]; 8 | magenta [color=magenta]; 9 | yellow [color=yellow]; 10 | orange [color=orange]; 11 | red -> green; 12 | red -> blue; 13 | blue -> cyan; 14 | blue -> magenta; 15 | green -> yellow; 16 | green -> orange; 17 | } 18 | -------------------------------------------------------------------------------- /spec/dots/directed/dfa.gv: -------------------------------------------------------------------------------- 1 | digraph g { 2 | "start" [ label = "MWGC-" ]; 3 | "n1" [ label = "WC-MG" ]; 4 | "n2" [ label = "MWC-G" ]; 5 | "n3" [ label = "C-MWG" ]; 6 | "n4" [ label = "W-MGC" ]; 7 | "n5" [ label = "MGC-W" ]; 8 | "n6" [ label = "MWG-C" ]; 9 | "n7" [ label = "G-MWC" ]; 10 | "n8" [ label = "MG-WC" ]; 11 | "n9" [ label = "-MWGC" ]; 12 | "start" -> "n1" [ label = "g" ]; 13 | "n1" -> "start" [ label = "g" ]; 14 | subgraph l { rank = same; "n3" "n4" } 15 | subgraph r { rank = same; "n5" "n6" } 16 | "n1" -> "n2" [ label = "m" ]; 17 | "n2" -> "n1" [ label = "m" ]; 18 | "n2" -> "n3" [ label = "w" ]; 19 | "n3" -> "n2" [ label = "w" ]; 20 | "n2" -> "n4" [ label = "c" ]; 21 | "n4" -> "n2" [ label = "c" ]; 22 | "n3" -> "n5" [ label = "g" ]; 23 | "n5" -> "n3" [ label = "g" ]; 24 | "n4" -> "n6" [ label = "g" ]; 25 | "n6" -> "n4" [ label = "g" ]; 26 | "n5" -> "n7" [ label = "c" ]; 27 | "n7" -> "n5" [ label = "c" ]; 28 | "n6" -> "n7" [ label = "w" ]; 29 | "n7" -> "n6" [ label = "w" ]; 30 | "n7" -> "n8" [ label = "m" ]; 31 | "n8" -> "n7" [ label = "m" ]; 32 | "n8" -> "n9" [ label = "g" ]; 33 | "n9" -> "n8" [ label = "g" ]; 34 | } 35 | -------------------------------------------------------------------------------- /spec/dots/directed/fig6.gv: -------------------------------------------------------------------------------- 1 | digraph G { 2 | size = "8,8"; 3 | {rank=min S8 S24 S1 S35 S30} 4 | {rank=max T8 T24 T1 T35 T30} 5 | S8 -> 9; 6 | S24 -> 27; 7 | S24 -> 25; 8 | S1 -> 10; 9 | S1 -> 2; 10 | S35 -> 36; 11 | S35 -> 43; 12 | S30 -> 31; 13 | S30 -> 33; 14 | 9 -> 42; 15 | 9 -> T1; 16 | 25 -> T1; 17 | 25 -> 26; 18 | 27 -> T24; 19 | 2 -> 3; 20 | 2 -> 16; 21 | 2 -> 17; 22 | 2 -> T1; 23 | 2 -> 18; 24 | 10 -> 11; 25 | 10 -> 14; 26 | 10 -> T1; 27 | 10 -> 13; 28 | 10 -> 12; 29 | 31 -> T1; 30 | 31 -> 32; 31 | 33 -> T30; 32 | 33 -> 34; 33 | 42 -> 4; 34 | 26 -> 4; 35 | 3 -> 4; 36 | 16 -> 15; 37 | 17 -> 19; 38 | 18 -> 29; 39 | 11 -> 4; 40 | 14 -> 15; 41 | 37 -> 39; 42 | 37 -> 41; 43 | 37 -> 38; 44 | 37 -> 40; 45 | 13 -> 19; 46 | 12 -> 29; 47 | 43 -> 38; 48 | 43 -> 40; 49 | 36 -> 19; 50 | 32 -> 23; 51 | 34 -> 29; 52 | 39 -> 15; 53 | 41 -> 29; 54 | 38 -> 4; 55 | 40 -> 19; 56 | 4 -> 5; 57 | 19 -> 21; 58 | 19 -> 20; 59 | 19 -> 28; 60 | 5 -> 6; 61 | 5 -> T35; 62 | 5 -> 23; 63 | 21 -> 22; 64 | 20 -> 15; 65 | 28 -> 29; 66 | 6 -> 7; 67 | 15 -> T1; 68 | 22 -> 23; 69 | 22 -> T35; 70 | 29 -> T30; 71 | 7 -> T8; 72 | 23 -> T24; 73 | 23 -> T1; 74 | } 75 | -------------------------------------------------------------------------------- /spec/dots/directed/fsm.gv: -------------------------------------------------------------------------------- 1 | digraph finite_state_machine { 2 | 3 | node [shape = doublecircle]; LR_0 LR_3 LR_4 LR_8; 4 | node [shape = circle]; 5 | rankdir=LR; 6 | LR_0 -> LR_2 [ label = "SS(B)" ]; 7 | LR_0 -> LR_1 [ label = "SS(S)" ]; 8 | LR_1 -> LR_3 [ label = "S($end)" ]; 9 | LR_2 -> LR_6 [ label = "SS(b)" ]; 10 | LR_2 -> LR_5 [ label = "SS(a)" ]; 11 | LR_2 -> LR_4 [ label = "S(A)" ]; 12 | LR_5 -> LR_7 [ label = "S(b)" ]; 13 | LR_5 -> LR_5 [ label = "S(a)" ]; 14 | LR_6 -> LR_6 [ label = "S(b)" ]; 15 | LR_6 -> LR_5 [ label = "S(a)" ]; 16 | LR_7 -> LR_8 [ label = "S(b)" ]; 17 | LR_7 -> LR_5 [ label = "S(a)" ]; 18 | LR_8 -> LR_6 [ label = "S(b)" ]; 19 | LR_8 -> LR_5 [ label = "S(a)" ]; 20 | } 21 | -------------------------------------------------------------------------------- /spec/dots/directed/grammar.gv: -------------------------------------------------------------------------------- 1 | digraph L0 { 2 | size = "8,8"; 3 | ordering=out; 4 | node [shape = box]; 5 | 6 | n0 [label="E"]; 7 | n1 [label="T"]; 8 | n2 [label="F"]; 9 | n3 [label="IDENT : a "]; 10 | n4 [label="+"]; 11 | n5 [label="T"]; 12 | n6 [label="F"]; 13 | n7 [label="("]; 14 | n8 [label="E"]; 15 | n9 [label="T"]; 16 | n10 [label="F"]; 17 | n11 [label="IDENT : b "]; 18 | n12 [label="*"]; 19 | n13 [label="F"]; 20 | n14 [label="IDENT : c "]; 21 | n15 [label=")"]; 22 | n16 [label="*"]; 23 | n17 [label="F"]; 24 | n18 [label="("]; 25 | n19 [label="E"]; 26 | n20 [label="T"]; 27 | n21 [label="F"]; 28 | n22 [label="IDENT : d "]; 29 | n23 [label="*"]; 30 | n24 [label="F"]; 31 | n25 [label="IDENT : e "]; 32 | n26 [label="+"]; 33 | n27 [label="T"]; 34 | n28 [label="F"]; 35 | n29 [label="("]; 36 | n30 [label="E"]; 37 | n31 [label="T"]; 38 | n32 [label="F"]; 39 | n33 [label="IDENT : a "]; 40 | n34 [label="*"]; 41 | n35 [label="F"]; 42 | n36 [label="IDENT : b "]; 43 | n37 [label=")"]; 44 | n38 [label=")"]; 45 | n39 [label="+"]; 46 | n40 [label="T"]; 47 | n41 [label="F"]; 48 | n42 [label="IDENT : q "]; 49 | n0 -> { n1 n4 n5 n39 n40 }; 50 | n1 -> n2 ; 51 | n2 -> n3 ; 52 | n5 -> { n6 n16 n17 }; 53 | n6 -> { n7 n8 n15 }; 54 | n8 -> n9 ; 55 | n9 -> { n10 n12 n13 }; 56 | n10 -> n11 ; 57 | n13 -> n14 ; 58 | n17 -> { n18 n19 n38 }; 59 | n19 -> { n20 n26 n27 }; 60 | n20 -> { n21 n23 n24 }; 61 | n21 -> n22 ; 62 | n24 -> n25 ; 63 | n27 -> n28 ; 64 | n28 -> { n29 n30 n37 }; 65 | n30 -> n31 ; 66 | n31 -> { n32 n34 n35 }; 67 | n32 -> n33 ; 68 | n35 -> n36 ; 69 | n40 -> n41 ; 70 | n41 -> n42 ; 71 | } 72 | -------------------------------------------------------------------------------- /spec/dots/directed/hashtable.gv: -------------------------------------------------------------------------------- 1 | digraph G { 2 | nodesep=.05; 3 | rankdir=LR; 4 | node [shape=record,width=.1,height=.1]; 5 | 6 | node0 [label = " | | | | | | | ",height=2.0]; 7 | node [width = 1.5]; 8 | node1 [label = "{ n14 | 719 |

}"]; 9 | node2 [label = "{ a1 | 805 |

}"]; 10 | node3 [label = "{ i9 | 718 |

}"]; 11 | node4 [label = "{ e5 | 989 |

}"]; 12 | node5 [label = "{ t20 | 959 |

}"] ; 13 | node6 [label = "{ o15 | 794 |

}"] ; 14 | node7 [label = "{ s19 | 659 |

}"] ; 15 | 16 | node0:f0 -> node1:n; 17 | node0:f1 -> node2:n; 18 | node0:f2 -> node3:n; 19 | node0:f5 -> node4:n; 20 | node0:f6 -> node5:n; 21 | node2:p -> node6:n; 22 | node4:p -> node7:n; 23 | } 24 | -------------------------------------------------------------------------------- /spec/dots/directed/honda-tokoro.gv: -------------------------------------------------------------------------------- 1 | digraph "Honda-Tokoro" { 2 | rankdir="LR" ranksep="0.2" edge[labelfontsize="8" fontsize="8" labeldistance="0.8" arrowsize="0.9" labelangle="-30" dir="none"] nodesep="0.2" node[width="0" height="0" fontsize="10"] 3 | 4 | /*Net net00*/ 5 | 6 | n000 [label="z"] 7 | n001->n000 [headlabel=":s:" arrowhead="invdot"] 8 | n001 [label="m"] 9 | n002->n001 [samehead="m002" headlabel=":r:" samearrowhead="1" arrowhead="invdot" arrowtail="inv"] 10 | n002 [label="p1"] 11 | n003->n002 [headlabel=":s:" arrowhead="dot"] 12 | n003 [label="b"] 13 | n004->n003 14 | n004 [label="x1"] 15 | n022->n004 [weight="0" headlabel=":s/r:" fontsize="8" arrowhead="invdot"] 16 | n003->n002 [samehead="m000" fontsize="8" samearrowhead="1" arrowtail="inv"] 17 | n005->n002 [samehead="m000" headlabel=":u:" fontsize="8" samearrowhead="1" arrowhead="dot" arrowtail="inv"] 18 | n005->n001 [samehead="m002" samearrowhead="1"] 19 | n005 [label="b"] 20 | n006->n005 [arrowtail="inv"] 21 | n006 [label="p2"] 22 | n007->n006 [headlabel=":s:" arrowhead="dot"] 23 | n007 [label="b"] 24 | n008->n007 25 | n008 [label="x2"] 26 | n022->n008 [weight="0" headlabel=":s/r:" fontsize="8" arrowhead="invdot"] 27 | n007->n006 [samehead="m001" headlabel=":u:" fontsize="8" samearrowhead="1" arrowhead="dot" arrowtail="inv"] 28 | n009->n006 [samehead="m001" samearrowhead="1" arrowtail="inv"] 29 | n009 [label="b2"] 30 | n022->n009 [fontsize="8"] 31 | n022->n009 [fontsize="8"] 32 | n010->n006 [samehead="m001" samearrowhead="1" arrowtail="inv"] 33 | n010 [label="b2"] 34 | n022->n010 [fontsize="8"] 35 | n022->n010 [fontsize="8"] 36 | n011->n000 [headlabel=":r:" arrowhead="invdot" arrowtail="inv"] 37 | n011 [label="n"] 38 | n012->n011 [samehead="m005" headlabel=":s:" samearrowhead="1" arrowhead="dot"] 39 | n012 [label="b"] 40 | n013->n012 41 | n013 [label="c1"] 42 | n014->n013 [headlabel=":r:" arrowhead="invdot"] 43 | n014 [label="b"] 44 | n015->n014 [arrowtail="inv"] 45 | n015 [label="y1"] 46 | n023->n015 [weight="0" headlabel=":s/r:" fontsize="8" arrowhead="dot"] 47 | n016->n015 [samehead="m003" headlabel=":u:" fontsize="8" samearrowhead="1" arrowhead="dot" arrowtail="inv"] 48 | n018->n015 [samehead="m003" fontsize="8" samearrowhead="1" arrowtail="inv"] 49 | n014->n011 [samehead="m006" headlabel=":u:" fontsize="8" samearrowhead="1" arrowhead="dot" arrowtail="inv"] 50 | n012->n011 [samehead="m006" fontsize="8" samearrowhead="1" arrowtail="inv"] 51 | n016->n011 [samehead="m005" samearrowhead="1"] 52 | n016 [label="b"] 53 | n017->n016 54 | n017 [label="c2"] 55 | n018->n017 [headlabel=":r:" arrowhead="invdot"] 56 | n018 [label="b"] 57 | n019->n018 [arrowtail="inv"] 58 | n019 [label="y2"] 59 | n023->n019 [weight="0" headlabel=":s/r:" fontsize="8" arrowhead="dot"] 60 | n020->n019 [samehead="m004" headlabel=":u:" samearrowhead="1" arrowhead="dot" arrowtail="inv"] 61 | n020 [label="b2"] 62 | n023->n020 [fontsize="8"] 63 | n023->n020 [fontsize="8"] 64 | n021->n019 [samehead="m004" samearrowhead="1" arrowtail="inv"] 65 | n021 [label="b2"] 66 | n023->n021 [fontsize="8"] 67 | n023->n021 [fontsize="8"] 68 | n022 [width="0.5" label="[P]" shape="box" style="dashed" height="0.35"] 69 | n023 [width="0.5" label="[Q]" shape="box" style="dashed" height="0.35"] 70 | {/*L=x1*/rank=same n004 n015} 71 | {/*L=p1*/rank=same n002 n013} 72 | {/*L=b*/rank=same n009 n010 n020 n021} 73 | {/*L=x2*/rank=same n008 n019} 74 | {/*L=p2*/rank=same n006 n017} 75 | {/*L=m*/rank=same n001 n011} 76 | } 77 | -------------------------------------------------------------------------------- /spec/dots/directed/japanese.gv: -------------------------------------------------------------------------------- 1 | digraph G { 2 | graph [label="下駄配列の派生図"] 3 | 4 | getas [label = "下駄配列"]; 5 | new_getas [label = "新下駄配列"]; 6 | getas_in_fine_weather [label = "日和下駄配列"]; 7 | black_lacquered_getas [label = "黒塗り下駄配列"]; 8 | black_lacquered_getas_made_of_paulownia [label = "黒塗り桐下駄配列"]; 9 | lacquered_getas [label = "塗り下駄配列"]; 10 | new_JIS_getas [label = "新JIS下駄配列"]; 11 | 12 | getas -> { 13 | getas_in_fine_weather 14 | lacquered_getas 15 | new_JIS_getas new_getas 16 | lacquered_getas 17 | }; 18 | 19 | lacquered_getas -> black_lacquered_getas; 20 | black_lacquered_getas -> black_lacquered_getas_made_of_paulownia; 21 | black_lacquered_getas_made_of_paulownia -> black_lacquered_getas; 22 | 23 | black_lacquered_getas -> getas_in_fine_weather [style = dotted]; 24 | } 25 | -------------------------------------------------------------------------------- /spec/dots/directed/jcctree.gv: -------------------------------------------------------------------------------- 1 | digraph "tree" { 2 | // The problem disappeared when I removed the "ELEM3 -> ID5;" line! 3 | //size="4,5"; 4 | ordering=out; 5 | node [shape=plaintext]; 6 | SPEC -> DEF2; 7 | SPEC -> DEF1; 8 | DEF1 -> ID1; 9 | DEF1 -> SET1; 10 | DEF1 -> SC1; 11 | DEF2 -> ID2; 12 | DEF2 -> SET2; 13 | DEF2 -> SC2; 14 | SET1 -> OPEN1; 15 | SET1 -> ELEM1; 16 | SET1 -> SC3; 17 | SET1 -> ELEM2; 18 | SET1 -> CLOSE1; 19 | ELEM1 -> ID3; 20 | SET2 -> OPEN2; 21 | SET2 -> ELEM3; 22 | SET2 -> CLOSE2; 23 | ELEM2 -> ID4; 24 | ELEM3 -> ID5; 25 | DEF1 [label=DEF]; 26 | DEF2 [label=DEF]; 27 | SET1 [label=SET]; 28 | SC1 [label=";"]; 29 | SC3 [label=";"]; 30 | SET2 [label=SET]; 31 | SC2 [label=";"]; 32 | OPEN1 [label="{"]; 33 | OPEN2 [label="{"]; 34 | CLOSE1 [label="}"]; 35 | CLOSE2 [label="}"]; 36 | ELEM1 [label=ELEMENT]; 37 | ELEM2 [label=ELEMENT]; 38 | ELEM3 [label=ELEMENT]; 39 | ID1 [label=cities]; 40 | ID2 [label=insects]; 41 | ID3 [label=andover]; 42 | ID4 [label=boston]; 43 | ID5 [label=fly]; 44 | } 45 | -------------------------------------------------------------------------------- /spec/dots/directed/longflat.gv: -------------------------------------------------------------------------------- 1 | digraph if 2 | { 3 | rankdir=LR; 4 | {rank=same;b;c;} 5 | a->b; 6 | c->b[label="long long long"]; 7 | } 8 | -------------------------------------------------------------------------------- /spec/dots/directed/mike.gv: -------------------------------------------------------------------------------- 1 | digraph mike{ 2 | size = "8,8"; 3 | a -> A; 4 | a -> m; 5 | a -> E; 6 | t -> O; 7 | r -> V; 8 | r -> Q; 9 | p -> B; 10 | m -> R; 11 | l -> C; 12 | c -> C; 13 | W -> X; 14 | W -> D; 15 | V -> W; 16 | T -> U; 17 | Q -> T; 18 | Q -> H; 19 | Q -> A; 20 | O -> K; 21 | L -> U; 22 | K -> L; 23 | K -> J; 24 | K -> E; 25 | J -> I; 26 | R -> B; 27 | P -> F; 28 | H -> R; 29 | H -> P; 30 | U -> H; 31 | G -> U; 32 | E -> G; 33 | C -> Z; 34 | C -> D; 35 | S -> D; 36 | B -> N; 37 | B -> D; 38 | B -> S; 39 | M -> B; 40 | A -> M; 41 | N -> Y; 42 | } 43 | -------------------------------------------------------------------------------- /spec/dots/directed/nhg.gv: -------------------------------------------------------------------------------- 1 | digraph automata_0 { 2 | size ="8.5, 11"; 3 | node [shape = circle]; 4 | 0 [ style = filled, color=lightgrey ]; 5 | 2 [ shape = doublecircle ]; 6 | 0 -> 2 [ label = "a " ]; 7 | 0 -> 1 [ label = "other " ]; 8 | 1 -> 2 [ label = "a " ]; 9 | 1 -> 1 [ label = "other " ]; 10 | 2 -> 2 [ label = "a " ]; 11 | 2 -> 1 [ label = "other " ]; 12 | "Machine: a" [ shape = plaintext ]; 13 | } 14 | -------------------------------------------------------------------------------- /spec/dots/directed/oldarrows.gv: -------------------------------------------------------------------------------- 1 | digraph G { 2 | // leave some space for the head/taillabels 3 | graph [ranksep=1.5 splines=true overlap=false] 4 | 5 | // to avoid confusion, remember this: 6 | // it's spelt tail/head, but it's read start/end 7 | 8 | // put head/tail labels farther from the node 9 | edge [labeldistance=3] 10 | 11 | // not interested in node labels 12 | node [shape=circle width=0.5 label=""] 13 | 14 | { 15 | edge [dir=back samehead=ahead samearrowhead=1] 16 | a->Z [arrowtail=none taillabel=none] 17 | b->Z [arrowtail=normal taillabel=normal] 18 | c->Z [arrowtail=inv taillabel=inv] 19 | d->Z [arrowtail=dot taillabel=dot] 20 | e->Z [arrowtail=odot taillabel=odot] 21 | f->Z [arrowtail=invdot taillabel=invdot] 22 | g->Z [arrowtail=invodot taillabel=invodot] 23 | h->Z [arrowtail=open taillabel=open] 24 | i->Z [arrowtail=halfopen taillabel=halfopen arrowhead=inv headlabel=samehead] 25 | j->Z [arrowtail=empty taillabel=empty] 26 | k->Z [arrowtail=invempty taillabel=invempty] 27 | l->Z [arrowtail=diamond taillabel=diamond] 28 | m->Z [arrowtail=odiamond taillabel=odiamond] 29 | n->Z [arrowtail=box taillabel=box] 30 | o->Z [arrowtail=obox taillabel=obox] 31 | p->Z [arrowtail=tee taillabel=tee] 32 | q->Z [arrowtail=crow taillabel=crow] 33 | } 34 | { 35 | edge [sametail=atail samearrowtail=1] 36 | Z->A [arrowhead=none headlabel=none] 37 | Z->B [arrowhead=normal headlabel=normal] 38 | Z->C [arrowhead=inv headlabel=inv] 39 | Z->D [arrowhead=dot headlabel=dot] 40 | Z->E [arrowhead=odot headlabel=odot] 41 | Z->F [arrowhead=invdot headlabel=invdot] 42 | Z->G [arrowhead=invodot headlabel=invodot] 43 | Z->H [arrowhead=open headlabel=open] 44 | Z->I [arrowhead=halfopen headlabel=halfopen arrowtail=inv taillabel=sametail] 45 | Z->J [arrowhead=empty headlabel=empty] 46 | Z->K [arrowhead=invempty headlabel=invempty] 47 | Z->L [arrowhead=diamond headlabel=diamond] 48 | Z->M [arrowhead=odiamond headlabel=odiamond] 49 | Z->N [arrowhead=box headlabel=box] 50 | Z->O [arrowhead=obox headlabel=obox] 51 | Z->P [arrowhead=tee headlabel=tee] 52 | Z->Q [arrowhead=crow headlabel=crow] 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /spec/dots/directed/pgram.gv: -------------------------------------------------------------------------------- 1 | digraph test { 2 | 3 | size="7,9.5"; 4 | page="8,10.5"; 5 | ratio=fill; 6 | rankdir=LR; 7 | 8 | { rank=same; 9 | node [shape=house]; 10 | A;C;E;G;I;K;M;O;Q;S;U;W;Y; 11 | node [shape=invhouse]; 12 | B;D;F;H;J;L;N;P;R;T;V;X;Z; 13 | } 14 | 15 | { rank=same; 16 | node [shape=parallelogram]; 17 | "Parallelogram" [label="This is a test\nof a multiline\nlabel in an\nparallelogram with approx\nsquare aspect"]; 18 | "a ----- long thin parallelogram"; 19 | "xx" [label="m"]; 20 | "yy" [label="a\nb\nc\nd\ne\nf"]; 21 | node [shape=octagon]; 22 | "Octagon" [label="This is a test\nof a multiline\nlabel in an\noctagon with approx\nsquare aspect"]; 23 | node [shape=parallelogram]; 24 | "Parallelogram" [label="This is a test\nof a multiline\nlabel in an\nparallelogram with approx\nsquare aspect"]; 25 | "a ----- long thin parallelogram"; 26 | "zz" [label="m"]; 27 | "qq" [label="a\nb\nc\nd\ne\nf"]; 28 | ordering=out; 29 | } 30 | 31 | Parallelogram -> A; 32 | Parallelogram -> B; 33 | Parallelogram -> C; 34 | Parallelogram -> D; 35 | Parallelogram -> E; 36 | Parallelogram -> F; 37 | Parallelogram -> G; 38 | Parallelogram -> H; 39 | Parallelogram -> I; 40 | Parallelogram -> J; 41 | Parallelogram -> K; 42 | Parallelogram -> L; 43 | Parallelogram -> M; 44 | Parallelogram -> N; 45 | Parallelogram -> O; 46 | Parallelogram -> P; 47 | Parallelogram -> Q; 48 | Parallelogram -> R; 49 | Parallelogram -> S; 50 | Parallelogram -> T; 51 | Parallelogram -> U; 52 | Parallelogram -> V; 53 | Parallelogram -> W; 54 | Parallelogram -> X; 55 | Parallelogram -> Y; 56 | Parallelogram -> Z; 57 | 58 | { rank=same; 59 | node [shape=triangle]; 60 | a;c;e;g;i;k;m;o;q;s;u;w;y; 61 | node [shape=tripleoctagon]; 62 | b;d;f;h;j;l;n;p;r;t;v;x;z; 63 | } 64 | 65 | a -> Parallelogram -> Octagon; 66 | b -> Parallelogram -> Octagon; 67 | c -> Parallelogram -> Octagon; 68 | d -> Parallelogram -> Octagon; 69 | e -> Parallelogram -> Octagon; 70 | f -> Parallelogram -> Octagon; 71 | g -> Parallelogram -> Octagon; 72 | h -> Parallelogram -> Octagon; 73 | i -> Parallelogram -> Octagon; 74 | j -> Parallelogram -> Octagon; 75 | k -> Parallelogram -> Octagon; 76 | l -> Parallelogram -> Octagon; 77 | m -> Parallelogram -> Octagon; 78 | n -> Parallelogram -> Octagon; 79 | o -> Parallelogram -> Octagon; 80 | p -> Parallelogram -> Octagon; 81 | q -> Parallelogram -> Octagon; 82 | r -> Parallelogram -> Octagon; 83 | s -> Parallelogram -> Octagon; 84 | t -> Parallelogram -> Octagon; 85 | u -> Parallelogram -> Octagon; 86 | v -> Parallelogram -> Octagon; 87 | w -> Parallelogram -> Octagon; 88 | x -> Parallelogram -> Octagon; 89 | y -> Parallelogram -> Octagon; 90 | z -> Parallelogram -> Octagon; 91 | } 92 | -------------------------------------------------------------------------------- /spec/dots/directed/pm2way.gv: -------------------------------------------------------------------------------- 1 | digraph g { 2 | graph [ 3 | ]; 4 | node [ 5 | fontsize = "14" 6 | fontname = "Times-Roman" 7 | fontcolor = "black" 8 | shape = "box" 9 | color = "black" 10 | width = "0.5" 11 | ]; 12 | edge [ 13 | fontsize = "14" 14 | fontname = "Times-Roman" 15 | fontcolor = "black" 16 | color = "black" 17 | ]; 18 | "22690" [ 19 | label = "22690\n?" 20 | pname = "?" 21 | kind = "proc" 22 | ]; 23 | "22692" [ 24 | label = "22692\ndotty" 25 | pname = "dotty" 26 | kind = "proc" 27 | ]; 28 | "116842+2595" [ 29 | label = "116842+2595\n/home/ek/work/sun4/bin/dotty" 30 | fname = "/home/ek/work/sun4/bin/dotty" 31 | shape = "ellipse" 32 | kind = "file" 33 | ]; 34 | "22693" [ 35 | label = "22693\nlefty" 36 | pname = "lefty" 37 | kind = "proc" 38 | ]; 39 | "182440-1" [ 40 | label = "182440-1\n182441-1\npipe" 41 | fontsize = "7" 42 | fname = "pipe" 43 | shape = "doublecircle" 44 | subkind = "pipe" 45 | kind = "file" 46 | ]; 47 | "182442-1" [ 48 | label = "182442-1\n182443-1\npipe" 49 | fontsize = "7" 50 | fname = "pipe" 51 | shape = "doublecircle" 52 | subkind = "pipe" 53 | kind = "file" 54 | ]; 55 | "22694" [ 56 | label = "22694\ndot" 57 | pname = "dot" 58 | kind = "proc" 59 | ]; 60 | "4761+2595" [ 61 | label = "4761+2595\n/home/ek/pm2.dot" 62 | fname = "/home/ek/pm2.dot" 63 | shape = "ellipse" 64 | kind = "file" 65 | ]; 66 | "22690" -> "22692" [ 67 | fontsize = "14" 68 | fontname = "Times-Roman" 69 | fontcolor = "black" 70 | color = "black" 71 | ]; 72 | "22692" -> "116842+2595" [ 73 | fontsize = "14" 74 | fontname = "Times-Roman" 75 | fontcolor = "black" 76 | dir = "back" 77 | color = "black" 78 | ]; 79 | "22692" -> "22693" [ 80 | fontsize = "14" 81 | fontname = "Times-Roman" 82 | fontcolor = "black" 83 | color = "black" 84 | ]; 85 | "22693" -> "182440-1" [ 86 | fontsize = "14" 87 | fontname = "Times-Roman" 88 | fontcolor = "black" 89 | dir = "back" 90 | color = "black" 91 | ]; 92 | "22693" -> "182442-1" [ 93 | fontsize = "14" 94 | fontname = "Times-Roman" 95 | fontcolor = "black" 96 | dir = "forward" 97 | color = "black" 98 | ]; 99 | "22693" -> "22694" [ 100 | fontsize = "14" 101 | fontname = "Times-Roman" 102 | fontcolor = "black" 103 | color = "black" 104 | ]; 105 | "22694" -> "182440-1" [ 106 | fontsize = "14" 107 | fontname = "Times-Roman" 108 | fontcolor = "black" 109 | dir = "forward" 110 | color = "black" 111 | ]; 112 | "22694" -> "182442-1" [ 113 | fontsize = "14" 114 | fontname = "Times-Roman" 115 | fontcolor = "black" 116 | dir = "back" 117 | color = "black" 118 | ]; 119 | "22693" -> "4761+2595" [ 120 | fontsize = "14" 121 | fontname = "Times-Roman" 122 | fontcolor = "black" 123 | dir = "back" 124 | color = "black" 125 | ]; 126 | } 127 | -------------------------------------------------------------------------------- /spec/dots/directed/pmpipe.gv: -------------------------------------------------------------------------------- 1 | digraph g { 2 | graph [ 3 | ]; 4 | node [ 5 | fontsize = "14" 6 | fontname = "Times-Roman" 7 | fontcolor = "black" 8 | shape = "box" 9 | color = "black" 10 | width = "0.5" 11 | ]; 12 | edge [ 13 | fontsize = "14" 14 | fontname = "Times-Roman" 15 | fontcolor = "black" 16 | color = "black" 17 | ]; 18 | "23296" [ 19 | label = "23296\n?" 20 | pname = "?" 21 | kind = "proc" 22 | ]; 23 | "182948-1" [ 24 | label = "182948-1\n182949-1\npipe" 25 | fontsize = "7" 26 | fname = "pipe" 27 | shape = "doublecircle" 28 | subkind = "pipe" 29 | kind = "file" 30 | ]; 31 | "23310" [ 32 | label = "23310\ncat" 33 | pname = "cat" 34 | kind = "proc" 35 | ]; 36 | "182950-1" [ 37 | label = "182950-1\n182951-1\npipe" 38 | fontsize = "7" 39 | fname = "pipe" 40 | shape = "doublecircle" 41 | subkind = "pipe" 42 | kind = "file" 43 | ]; 44 | "23311" [ 45 | label = "23311\ncat" 46 | pname = "cat" 47 | kind = "proc" 48 | ]; 49 | "182952-1" [ 50 | label = "182952-1\n182953-1\npipe" 51 | fontsize = "7" 52 | fname = "pipe" 53 | shape = "doublecircle" 54 | subkind = "pipe" 55 | kind = "file" 56 | ]; 57 | "23312" [ 58 | label = "23312\ncat" 59 | pname = "cat" 60 | kind = "proc" 61 | ]; 62 | "182954-1" [ 63 | label = "182954-1\n182955-1\npipe" 64 | fontsize = "7" 65 | fname = "pipe" 66 | shape = "doublecircle" 67 | subkind = "pipe" 68 | kind = "file" 69 | ]; 70 | "23313" [ 71 | label = "23313\ncat" 72 | pname = "cat" 73 | kind = "proc" 74 | ]; 75 | "79893+2568" [ 76 | label = "79893+2568\n/usr/share/lib/termcap" 77 | fname = "/usr/share/lib/termcap" 78 | shape = "ellipse" 79 | kind = "file" 80 | ]; 81 | "85+2560" [ 82 | label = "85+2560\n?" 83 | fname = "?" 84 | shape = "ellipse" 85 | kind = "file" 86 | ]; 87 | "23314" [ 88 | label = "23314\ncat" 89 | pname = "cat" 90 | kind = "proc" 91 | ]; 92 | "4151865284+0" [ 93 | label = "4151865284+0\n/tmp/termcap" 94 | fname = "/tmp/termcap" 95 | shape = "ellipse" 96 | kind = "file" 97 | ]; 98 | "23296" -> "23310" [ 99 | fontsize = "14" 100 | fontname = "Times-Roman" 101 | fontcolor = "black" 102 | color = "black" 103 | ]; 104 | "23296" -> "23311" [ 105 | fontsize = "14" 106 | fontname = "Times-Roman" 107 | fontcolor = "black" 108 | color = "black" 109 | ]; 110 | "23311" -> "182948-1" [ 111 | fontsize = "14" 112 | fontname = "Times-Roman" 113 | fontcolor = "black" 114 | dir = "back" 115 | color = "black" 116 | ]; 117 | "23310" -> "182948-1" [ 118 | fontsize = "14" 119 | fontname = "Times-Roman" 120 | fontcolor = "black" 121 | dir = "forward" 122 | color = "black" 123 | ]; 124 | "23296" -> "23312" [ 125 | fontsize = "14" 126 | fontname = "Times-Roman" 127 | fontcolor = "black" 128 | color = "black" 129 | ]; 130 | "23312" -> "182952-1" [ 131 | fontsize = "14" 132 | fontname = "Times-Roman" 133 | fontcolor = "black" 134 | dir = "forward" 135 | color = "black" 136 | ]; 137 | "23312" -> "182950-1" [ 138 | fontsize = "14" 139 | fontname = "Times-Roman" 140 | fontcolor = "black" 141 | dir = "back" 142 | color = "black" 143 | ]; 144 | "23296" -> "23313" [ 145 | fontsize = "14" 146 | fontname = "Times-Roman" 147 | fontcolor = "black" 148 | color = "black" 149 | ]; 150 | "23313" -> "182954-1" [ 151 | fontsize = "14" 152 | fontname = "Times-Roman" 153 | fontcolor = "black" 154 | dir = "forward" 155 | color = "black" 156 | ]; 157 | "23311" -> "182950-1" [ 158 | fontsize = "14" 159 | fontname = "Times-Roman" 160 | fontcolor = "black" 161 | dir = "forward" 162 | color = "black" 163 | ]; 164 | "23310" -> "79893+2568" [ 165 | fontsize = "14" 166 | fontname = "Times-Roman" 167 | fontcolor = "black" 168 | dir = "back" 169 | color = "black" 170 | ]; 171 | "23296" -> "85+2560" [ 172 | fontsize = "14" 173 | fontname = "Times-Roman" 174 | fontcolor = "black" 175 | dir = "both" 176 | color = "black" 177 | ]; 178 | "23296" -> "23314" [ 179 | fontsize = "14" 180 | fontname = "Times-Roman" 181 | fontcolor = "black" 182 | color = "black" 183 | ]; 184 | "23314" -> "85+2560" [ 185 | fontsize = "14" 186 | fontname = "Times-Roman" 187 | fontcolor = "black" 188 | dir = "both" 189 | color = "black" 190 | ]; 191 | "23314" -> "182954-1" [ 192 | fontsize = "14" 193 | fontname = "Times-Roman" 194 | fontcolor = "black" 195 | dir = "back" 196 | color = "black" 197 | ]; 198 | "23296" -> "85+2560" [ 199 | fontsize = "14" 200 | fontname = "Times-Roman" 201 | fontcolor = "black" 202 | dir = "both" 203 | color = "black" 204 | ]; 205 | "23314" -> "4151865284+0" [ 206 | fontsize = "14" 207 | fontname = "Times-Roman" 208 | fontcolor = "black" 209 | dir = "forward" 210 | color = "black" 211 | ]; 212 | "23313" -> "182952-1" [ 213 | fontsize = "14" 214 | fontname = "Times-Roman" 215 | fontcolor = "black" 216 | dir = "back" 217 | color = "black" 218 | ]; 219 | } 220 | -------------------------------------------------------------------------------- /spec/dots/directed/psfonttest.gv: -------------------------------------------------------------------------------- 1 | digraph G { 2 | rankdir=LR 3 | nodesep=0 4 | node [shape=none margin=0] 5 | edge [color=white] 6 | "AvantGarde-Book" [fontname="AvantGarde-Book"] 7 | "AvantGarde-Demi" [fontname="AvantGarde-Demi"] 8 | "AvantGarde-BookOblique" [fontname="AvantGarde-BookOblique"] 9 | "AvantGarde-DemiOblique" [fontname="AvantGarde-DemiOblique"] 10 | 11 | "AvantGarde-Book" -> "AvantGarde-Demi" -> "AvantGarde-BookOblique" -> "AvantGarde-DemiOblique" 12 | 13 | "Bookman-Light" [fontname="Bookman-Light"] 14 | "Bookman-Demi" [fontname="Bookman-Demi"] 15 | "Bookman-LightItalic" [fontname="Bookman-LightItalic"] 16 | "Bookman-DemiItalic" [fontname="Bookman-DemiItalic"] 17 | 18 | "Bookman-Light" -> "Bookman-Demi" -> "Bookman-LightItalic" -> "Bookman-DemiItalic" 19 | 20 | "Courier" [fontname="Courier"] 21 | "Courier-Bold" [fontname="Courier-Bold"] 22 | "Courier-Oblique" [fontname="Courier-Oblique"] 23 | "Courier-BoldOblique" [fontname="Courier-BoldOblique"] 24 | 25 | "Courier" -> "Courier-Bold" -> "Courier-Oblique" -> "Courier-BoldOblique" 26 | 27 | "Helvetica" [fontname="Helvetica"] 28 | "Helvetica-Bold" [fontname="Helvetica-Bold"] 29 | "Helvetica-Oblique" [fontname="Helvetica-Oblique"] 30 | "Helvetica-BoldOblique" [fontname="Helvetica-BoldOblique"] 31 | 32 | "Helvetica-Narrow" [fontname="Helvetica-Narrow"] 33 | "Helvetica-Narrow-Bold" [fontname="Helvetica-Narrow-Bold"] 34 | "Helvetica-Narrow-Oblique" [fontname="Helvetica-Narrow-Oblique"] 35 | "Helvetica-Narrow-BoldOblique" [fontname="Helvetica-Narrow-BoldOblique"] 36 | 37 | "Helvetica" -> "Helvetica-Bold" -> "Helvetica-Oblique" -> "Helvetica-BoldOblique" 38 | 39 | "Helvetica-Narrow" -> "Helvetica-Narrow-Bold" -> "Helvetica-Narrow-Oblique" -> "Helvetica-Narrow-BoldOblique" 40 | 41 | "NewCenturySchlbk-Roman" [fontname="NewCenturySchlbk-Roman"] 42 | "NewCenturySchlbk-Bold" [fontname="NewCenturySchlbk-Bold"] 43 | "NewCenturySchlbk-Italic" [fontname="NewCenturySchlbk-Italic"] 44 | "NewCenturySchlbk-BoldItalic" [fontname="NewCenturySchlbk-BoldItalic"] 45 | 46 | "NewCenturySchlbk-Roman" -> "NewCenturySchlbk-Bold" -> "NewCenturySchlbk-Italic" -> "NewCenturySchlbk-BoldItalic" 47 | 48 | "Palatino-Roman" [fontname="Palatino-Roman"] 49 | "Palatino-Bold" [fontname="Palatino-Bold"] 50 | "Palatino-Italic" [fontname="Palatino-Italic"] 51 | "Palatino-BoldItalic" [fontname="Palatino-BoldItalic"] 52 | 53 | "Palatino-Roman" -> "Palatino-Bold" -> "Palatino-Italic" -> "Palatino-BoldItalic" 54 | 55 | "Times-Roman" [fontname="Times-Roman"] 56 | "Times-Bold" [fontname="Times-Bold"] 57 | "Times-Italic" [fontname="Times-Italic"] 58 | "Times-BoldItalic" [fontname="Times-BoldItalic"] 59 | 60 | "Times-Roman" -> "Times-Bold" -> "Times-Italic" -> "Times-BoldItalic" 61 | 62 | "ZapfChancery-MediumItalic" [fontname="ZapfChancery-MediumItalic"] 63 | "ZapfDingbats" [fontname="ZapfDingbats"] 64 | "Symbol" [fontname="Symbol"] 65 | 66 | "Symbol" -> "ZapfDingbats" -> "ZapfChancery-MediumItalic" 67 | } 68 | -------------------------------------------------------------------------------- /spec/dots/directed/record2.gv: -------------------------------------------------------------------------------- 1 | digraph G { 2 | node [shape=record]; 3 | a [label = " foo | x | bar"]; 4 | b [label = "a | { foo | x | bar } | b"]; 5 | a:f0 -> b:f1 6 | } 7 | -------------------------------------------------------------------------------- /spec/dots/directed/records.gv: -------------------------------------------------------------------------------- 1 | digraph G { 2 | rankdir=LR; 3 | node [shape=record]; 4 | a [ label =" Graphs can\lbe fun\l| mid| right\r"]; 5 | b [ label =" | b | " ]; 6 | c [ label =" | c | " ]; 7 | x [ label =" | x | " ]; 8 | y [ label =" | y | " ]; 9 | z [ label =" | z | " ]; 10 | a:bala -> b:left; 11 | a:f1 -> d; 12 | a:f2 -> y:"p1"; 13 | c:"p1" -> d; 14 | b:mid -> x:"p1"; 15 | c:"p2" -> y:"p2"; 16 | b:left -> z:"p2"; 17 | } 18 | -------------------------------------------------------------------------------- /spec/dots/directed/rowe.gv: -------------------------------------------------------------------------------- 1 | digraph rowe { 2 | node [shape = box]; 3 | size = "6,6"; 4 | 1 -> 2; 5 | 1 -> 10; 6 | 10 -> 14; 7 | 10 -> 12; 8 | 10 -> 13; 9 | 10 -> 11; 10 | 2 -> 18; 11 | 2 -> 17; 12 | 2 -> 16; 13 | 2 -> 3; 14 | 11 -> 4; 15 | 16 -> 4; 16 | 3 -> 4; 17 | 4 -> 5; 18 | 13 -> 19; 19 | 17 -> 19; 20 | 5 -> 23; 21 | 5 -> 35; 22 | 5 -> 6; 23 | 37 -> 39; 24 | 37 -> 41; 25 | 37 -> 40; 26 | 37 -> 38; 27 | 19 -> 20; 28 | 19 -> 28; 29 | 19 -> 21; 30 | 12 -> 29; 31 | 18 -> 29; 32 | 41 -> 29; 33 | 28 -> 29; 34 | 29 -> 30; 35 | 30 -> 31; 36 | 30 -> 33; 37 | 31 -> 32; 38 | 21 -> 22; 39 | 32 -> 23; 40 | 22 -> 23; 41 | 6 -> 7; 42 | 23 -> 24; 43 | 7 -> 8; 44 | 24 -> 25; 45 | 24 -> 27; 46 | 35 -> 43; 47 | 35 -> 36; 48 | 8 -> 9; 49 | 14 -> 15; 50 | 39 -> 15; 51 | 20 -> 15; 52 | 33 -> 34; 53 | 43 -> 40; 54 | 43 -> 38; 55 | 25 -> 26; 56 | 9 -> 42; 57 | 10 -> 1; 58 | 15 -> 1; 59 | 23 -> 1; 60 | 31 -> 1; 61 | 2 -> 1; 62 | 25 -> 1; 63 | 9 -> 1; 64 | 38 -> 4; 65 | 26 -> 4; 66 | 42 -> 4; 67 | 40 -> 19; 68 | 36 -> 19; 69 | 34 -> 29; 70 | 33 -> 30; 71 | 27 -> 24; 72 | } 73 | -------------------------------------------------------------------------------- /spec/dots/directed/russian.gv: -------------------------------------------------------------------------------- 1 | digraph G { 2 | Контрагенты -> БанковскиеСчета; 3 | Организации -> БанковскиеСчета; 4 | ВопросыДляАнкетирования -> ВариантыОтветовОпросов; 5 | Контрагенты -> ДоговорыВзаиморасчетов; 6 | Номенклатура -> ЕдиницыИзмерения; 7 | НоменклатурныеГруппы -> ЕдиницыИзмерения; 8 | СвойстваОбектов -> ЗначенияСвойствОбектов; 9 | } -------------------------------------------------------------------------------- /spec/dots/directed/shells.gv: -------------------------------------------------------------------------------- 1 | digraph shells { 2 | size="7,8"; 3 | node [fontsize=24, shape = plaintext]; 4 | 5 | 1972 -> 1976; 6 | 1976 -> 1978; 7 | 1978 -> 1980; 8 | 1980 -> 1982; 9 | 1982 -> 1984; 10 | 1984 -> 1986; 11 | 1986 -> 1988; 12 | 1988 -> 1990; 13 | 1990 -> future; 14 | 15 | node [fontsize=20, shape = box]; 16 | { rank=same; 1976 Mashey Bourne; } 17 | { rank=same; 1978 Formshell csh; } 18 | { rank=same; 1980 esh vsh; } 19 | { rank=same; 1982 ksh "System-V"; } 20 | { rank=same; 1984 v9sh tcsh; } 21 | { rank=same; 1986 "ksh-i"; } 22 | { rank=same; 1988 KornShell Perl rc; } 23 | { rank=same; 1990 tcl Bash; } 24 | { rank=same; "future" POSIX "ksh-POSIX"; } 25 | 26 | Thompson -> Mashey; 27 | Thompson -> Bourne; 28 | Thompson -> csh; 29 | csh -> tcsh; 30 | Bourne -> ksh; 31 | Bourne -> esh; 32 | Bourne -> vsh; 33 | Bourne -> "System-V"; 34 | Bourne -> v9sh; 35 | v9sh -> rc; 36 | Bourne -> Bash; 37 | "ksh-i" -> Bash; 38 | KornShell -> Bash; 39 | esh -> ksh; 40 | vsh -> ksh; 41 | Formshell -> ksh; 42 | csh -> ksh; 43 | KornShell -> POSIX; 44 | "System-V" -> POSIX; 45 | ksh -> "ksh-i"; 46 | "ksh-i" -> KornShell; 47 | KornShell -> "ksh-POSIX"; 48 | Bourne -> Formshell; 49 | 50 | edge [style=invis]; 51 | 1984 -> v9sh -> tcsh ; 52 | 1988 -> rc -> KornShell; 53 | Formshell -> csh; 54 | KornShell -> Perl; 55 | } 56 | -------------------------------------------------------------------------------- /spec/dots/directed/states.gv: -------------------------------------------------------------------------------- 1 | /* 2 | The command line is 3 | 4 | dot -Tps -Grankdir=LR states.gv > states.ps 5 | 6 | and the file is: 7 | */ 8 | digraph states { 9 | size="3,2"; 10 | rankdir=LR; 11 | node [shape=ellipse]; 12 | empty [label = "Empty"]; 13 | stolen [label = "Stolen"]; 14 | waiting [label = "Waiting"]; 15 | full [label = "Full"]; 16 | empty -> full [label = "return"] 17 | empty -> stolen [label = "dispatch", wt=28] 18 | stolen -> full [label = "return"]; 19 | stolen -> waiting [label = "touch"]; 20 | waiting -> full [label = "return"]; 21 | } 22 | -------------------------------------------------------------------------------- /spec/dots/directed/structs.gv: -------------------------------------------------------------------------------- 1 | digraph structs { 2 | node [shape=record]; 3 | struct1 [shape=record,label=" left| middle| right"]; 4 | struct2 [shape=record,label=" one| two"]; 5 | struct3 [shape=record,label="hello\nworld |{ b |{c| d|e}| f}| g | h"]; 6 | struct1:f1 -> struct2:f0; 7 | struct1:f2 -> struct3:here; 8 | } 9 | -------------------------------------------------------------------------------- /spec/dots/directed/switch.gv: -------------------------------------------------------------------------------- 1 | digraph G { 2 | graph [center=true rankdir=LR bgcolor="#808080"] 3 | edge [dir=none] 4 | node [width=0.3 height=0.3 label=""] 5 | { node [shape=circle style=invis] 6 | 1 2 3 4 5 6 7 8 10 20 30 40 50 60 70 80 7 | } 8 | { node [shape=circle] 9 | a b c d e f g h i j k l m n o p q r s t u v w x 10 | } 11 | { node [shape=diamond] 12 | A B C D E F G H I J K L M N O P Q R S T U V W X 13 | } 14 | 1 -> a -> {A B} [color="#0000ff"] 15 | 2 -> b -> {B A} [color="#ff0000"] 16 | 3 -> c -> {C D} [color="#ffff00"] 17 | 4 -> d -> {D C} [color="#00ff00"] 18 | 5 -> e -> {E F} [color="#000000"] 19 | 6 -> f -> {F E} [color="#00ffff"] 20 | 7 -> g -> {G H} [color="#ffffff"] 21 | 8 -> h -> {H G} [color="#ff00ff"] 22 | { edge [color="#ff0000:#0000ff"] 23 | A -> i -> {I K} 24 | B -> j -> {J L} 25 | } 26 | { edge [color="#00ff00:#ffff00"] 27 | C -> k -> {K I} 28 | D -> l -> {L J} 29 | } 30 | { edge [color="#00ffff:#000000"] 31 | E -> m -> {M O} 32 | F -> n -> {N P} 33 | } 34 | { edge [color="#ff00ff:#ffffff"] 35 | G -> o -> {O M} 36 | H -> p -> {P N} 37 | } 38 | { edge [color="#00ff00:#ffff00:#ff0000:#0000ff"] 39 | I -> q -> {Q U} 40 | J -> r -> {R V} 41 | K -> s -> {S W} 42 | L -> t -> {T X} 43 | } 44 | { edge [color="#ff00ff:#ffffff:#00ffff:#000000"] 45 | M -> u -> {U Q} 46 | N -> v -> {V R} 47 | O -> w -> {W S} 48 | P -> x -> {X T} 49 | } 50 | { edge [color="#ff00ff:#ffffff:#00ffff:#000000:#00ff00:#ffff00:#ff0000:#0000ff"] 51 | Q -> 10 52 | R -> 20 53 | S -> 30 54 | T -> 40 55 | U -> 50 56 | V -> 60 57 | W -> 70 58 | X -> 80 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /spec/dots/directed/table.gv: -------------------------------------------------------------------------------- 1 | digraph structs { 2 | node [shape=plaintext]; 3 | 4 | struct1 [label=< 5 | 6 | 7 | 8 | 9 | 10 |
abc
>]; 11 | 12 | struct2 [label=< 13 | 14 | 15 | 16 | 17 | 26 | 27 | 28 | 29 | 30 |
elefanteltwo
18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 |
buca
c
f
patratos
4
>]; 31 | 32 | struct3 [label=< 33 | 34 | 35 | 46 | 47 | 48 | 49 | 50 | 51 | 52 |
Hello 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 |
b
adinoy
rhino
climbUp
low
>]; 53 | 54 | struct1 -> struct3; 55 | struct1 -> struct2; 56 | } 57 | -------------------------------------------------------------------------------- /spec/dots/directed/train11.gv: -------------------------------------------------------------------------------- 1 | digraph G { 2 | size="6,6"; 3 | node [shape=circle,fontsize=8]; 4 | rankdir=LR; 5 | st9 -> st9 [label="11/1"]; 6 | st9 -> st10 [label="10/1"]; 7 | st8 -> st8 [label="10/1"]; 8 | st8 -> st0 [label="00/-"]; 9 | st7 -> st8 [label="10/1"]; 10 | st7 -> st7 [label="00/1"]; 11 | st6 -> st6 [label="01/1"]; 12 | st6 -> st0 [label="00/-"]; 13 | st5 -> st6 [label="01/1"]; 14 | st5 -> st5 [label="11/1"]; 15 | st4 -> st4 [label="01/1"]; 16 | st4 -> st0 [label="00/-"]; 17 | st3 -> st4 [label="01/1"]; 18 | st3 -> st3 [label="00/1"]; 19 | st2 -> st9 [label="11/1"]; 20 | st2 -> st7 [label="00/1"]; 21 | st2 -> st2 [label="01/1"]; 22 | st10 -> st10 [label="10/1"]; 23 | st10 -> st0 [label="00/-"]; 24 | st1 -> st5 [label="11/1"]; 25 | st1 -> st3 [label="00/1"]; 26 | st1 -> st1 [label="10/1"]; 27 | st0 -> st2 [label="01/-"]; 28 | st0 -> st1 [label="10/-"]; 29 | st0 -> st0 [label="00/0"]; 30 | } 31 | -------------------------------------------------------------------------------- /spec/dots/directed/trapeziumlr.gv: -------------------------------------------------------------------------------- 1 | digraph test { 2 | 3 | size="7,9.5"; 4 | page="8,10.5"; 5 | ratio=fill; 6 | rankdir=LR; 7 | 8 | { rank=same; 9 | node [shape=house]; 10 | A;C;E;G;I;K;M;O;Q;S;U;W;Y; 11 | node [shape=invhouse]; 12 | B;D;F;H;J;L;N;P;R;T;V;X;Z; 13 | } 14 | 15 | { rank=same; 16 | node [shape=trapezium]; 17 | "Trapezium"; 18 | ordering=out; 19 | } 20 | 21 | Trapezium -> A; 22 | Trapezium -> B; 23 | Trapezium -> C; 24 | Trapezium -> D; 25 | Trapezium -> E; 26 | Trapezium -> F; 27 | Trapezium -> G; 28 | Trapezium -> H; 29 | Trapezium -> I; 30 | Trapezium -> J; 31 | Trapezium -> K; 32 | Trapezium -> L; 33 | Trapezium -> M; 34 | Trapezium -> N; 35 | Trapezium -> O; 36 | Trapezium -> P; 37 | Trapezium -> Q; 38 | Trapezium -> R; 39 | Trapezium -> S; 40 | Trapezium -> T; 41 | Trapezium -> U; 42 | Trapezium -> V; 43 | Trapezium -> W; 44 | Trapezium -> X; 45 | Trapezium -> Y; 46 | Trapezium -> Z; 47 | 48 | { rank=same; 49 | node [shape=parallelogram]; 50 | a;b;c;d;e;f;g;h;i;j;k;l;m;n;o;p;q;r;s;t;u;v;w;x;y;z; 51 | } 52 | 53 | a -> Trapezium; 54 | b -> Trapezium; 55 | c -> Trapezium; 56 | d -> Trapezium; 57 | e -> Trapezium; 58 | f -> Trapezium; 59 | g -> Trapezium; 60 | h -> Trapezium; 61 | i -> Trapezium; 62 | j -> Trapezium; 63 | k -> Trapezium; 64 | l -> Trapezium; 65 | m -> Trapezium; 66 | n -> Trapezium; 67 | o -> Trapezium; 68 | p -> Trapezium; 69 | q -> Trapezium; 70 | r -> Trapezium; 71 | s -> Trapezium; 72 | t -> Trapezium; 73 | u -> Trapezium; 74 | v -> Trapezium; 75 | w -> Trapezium; 76 | x -> Trapezium; 77 | y -> Trapezium; 78 | z -> Trapezium; 79 | } 80 | -------------------------------------------------------------------------------- /spec/dots/directed/tree.gv: -------------------------------------------------------------------------------- 1 | digraph g { 2 | node [shape = record,height=.1]; 3 | node0[label = " | G| "]; 4 | node1[label = " | E| "]; 5 | node2[label = " | B| "]; 6 | node3[label = " | F| "]; 7 | node4[label = " | R| "]; 8 | node5[label = " | H| "]; 9 | node6[label = " | Y| "]; 10 | node7[label = " | A| "]; 11 | node8[label = " | C| "]; 12 | "node0":f2 -> "node4":f1; 13 | "node0":f0 -> "node1":f1; 14 | "node1":f0 -> "node2":f1; 15 | "node1":f2 -> "node3":f1; 16 | "node2":f2 -> "node8":f1; 17 | "node2":f0 -> "node7":f1; 18 | "node4":f2 -> "node6":f1; 19 | "node4":f0 -> "node5":f1; 20 | } 21 | -------------------------------------------------------------------------------- /spec/dots/directed/triedds.gv: -------------------------------------------------------------------------------- 1 | digraph g { 2 | graph [ 3 | rankdir = "LR" 4 | ]; 5 | node [ 6 | fontsize = "16" 7 | shape = "ellipse" 8 | ]; 9 | edge [ 10 | ]; 11 | "node0" [ 12 | label = " 0x10ba8| " 13 | shape = "record" 14 | ]; 15 | "node1" [ 16 | label = " 0xf7fc4380| | |-1" 17 | shape = "record" 18 | ]; 19 | "node2" [ 20 | label = " 0xf7fc44b8| | |2" 21 | shape = "record" 22 | ]; 23 | "node3" [ 24 | label = " 3.43322790286038071e-06|44.79998779296875|0" 25 | shape = "record" 26 | ]; 27 | "node4" [ 28 | label = " 0xf7fc4380| | |2" 29 | shape = "record" 30 | ]; 31 | "node5" [ 32 | label = " (nil)| | |-1" 33 | shape = "record" 34 | ]; 35 | "node6" [ 36 | label = " 0xf7fc4380| | |1" 37 | shape = "record" 38 | ]; 39 | "node7" [ 40 | label = " 0xf7fc4380| | |2" 41 | shape = "record" 42 | ]; 43 | "node8" [ 44 | label = " (nil)| | |-1" 45 | shape = "record" 46 | ]; 47 | "node9" [ 48 | label = " (nil)| | |-1" 49 | shape = "record" 50 | ]; 51 | "node10" [ 52 | label = " (nil)| | |-1" 53 | shape = "record" 54 | ]; 55 | "node11" [ 56 | label = " (nil)| | |-1" 57 | shape = "record" 58 | ]; 59 | "node12" [ 60 | label = " 0xf7fc43e0| | |1" 61 | shape = "record" 62 | ]; 63 | "node0":f0 -> "node1":f0 [ 64 | id = 0 65 | ]; 66 | "node0":f1 -> "node2":f0 [ 67 | id = 1 68 | ]; 69 | "node1":f0 -> "node3":f0 [ 70 | id = 2 71 | ]; 72 | "node1":f1 -> "node4":f0 [ 73 | id = 3 74 | ]; 75 | "node1":f2 -> "node5":f0 [ 76 | id = 4 77 | ]; 78 | "node4":f0 -> "node3":f0 [ 79 | id = 5 80 | ]; 81 | "node4":f1 -> "node6":f0 [ 82 | id = 6 83 | ]; 84 | "node4":f2 -> "node10":f0 [ 85 | id = 7 86 | ]; 87 | "node6":f0 -> "node3":f0 [ 88 | id = 8 89 | ]; 90 | "node6":f1 -> "node7":f0 [ 91 | id = 9 92 | ]; 93 | "node6":f2 -> "node9":f0 [ 94 | id = 10 95 | ]; 96 | "node7":f0 -> "node3":f0 [ 97 | id = 11 98 | ]; 99 | "node7":f1 -> "node1":f0 [ 100 | id = 12 101 | ]; 102 | "node7":f2 -> "node8":f0 [ 103 | id = 13 104 | ]; 105 | "node10":f1 -> "node11":f0 [ 106 | id = 14 107 | ]; 108 | "node10":f2 -> "node12":f0 [ 109 | id = 15 110 | ]; 111 | "node11":f2 -> "node1":f0 [ 112 | id = 16 113 | ]; 114 | } 115 | -------------------------------------------------------------------------------- /spec/dots/directed/try.gv: -------------------------------------------------------------------------------- 1 | digraph G { 2 | subgraph cluster_small { 3 | a -> b; 4 | label=small; 5 | } 6 | 7 | subgraph cluster_big { 8 | p -> q -> r -> s -> t; 9 | label=big; 10 | t -> p; 11 | } 12 | 13 | t -> a; 14 | b -> q; 15 | } 16 | -------------------------------------------------------------------------------- /spec/dots/directed/unix.gv: -------------------------------------------------------------------------------- 1 | /* courtesy Ian Darwin and Geoff Collyer, Softquad Inc. */ 2 | digraph unix { 3 | size="6,6"; 4 | "5th Edition" -> "6th Edition"; 5 | "5th Edition" -> "PWB 1.0"; 6 | "6th Edition" -> "LSX"; 7 | "6th Edition" -> "1 BSD"; 8 | "6th Edition" -> "Mini Unix"; 9 | "6th Edition" -> "Wollongong"; 10 | "6th Edition" -> "Interdata"; 11 | "Interdata" -> "Unix/TS 3.0"; 12 | "Interdata" -> "PWB 2.0"; 13 | "Interdata" -> "7th Edition"; 14 | "7th Edition" -> "8th Edition"; 15 | "7th Edition" -> "32V"; 16 | "7th Edition" -> "V7M"; 17 | "7th Edition" -> "Ultrix-11"; 18 | "7th Edition" -> "Xenix"; 19 | "7th Edition" -> "UniPlus+"; 20 | "V7M" -> "Ultrix-11"; 21 | "8th Edition" -> "9th Edition"; 22 | "1 BSD" -> "2 BSD"; 23 | "2 BSD" -> "2.8 BSD"; 24 | "2.8 BSD" -> "Ultrix-11"; 25 | "2.8 BSD" -> "2.9 BSD"; 26 | "32V" -> "3 BSD"; 27 | "3 BSD" -> "4 BSD"; 28 | "4 BSD" -> "4.1 BSD"; 29 | "4.1 BSD" -> "4.2 BSD"; 30 | "4.1 BSD" -> "2.8 BSD"; 31 | "4.1 BSD" -> "8th Edition"; 32 | "4.2 BSD" -> "4.3 BSD"; 33 | "4.2 BSD" -> "Ultrix-32"; 34 | "PWB 1.0" -> "PWB 1.2"; 35 | "PWB 1.0" -> "USG 1.0"; 36 | "PWB 1.2" -> "PWB 2.0"; 37 | "USG 1.0" -> "CB Unix 1"; 38 | "USG 1.0" -> "USG 2.0"; 39 | "CB Unix 1" -> "CB Unix 2"; 40 | "CB Unix 2" -> "CB Unix 3"; 41 | "CB Unix 3" -> "Unix/TS++"; 42 | "CB Unix 3" -> "PDP-11 Sys V"; 43 | "USG 2.0" -> "USG 3.0"; 44 | "USG 3.0" -> "Unix/TS 3.0"; 45 | "PWB 2.0" -> "Unix/TS 3.0"; 46 | "Unix/TS 1.0" -> "Unix/TS 3.0"; 47 | "Unix/TS 3.0" -> "TS 4.0"; 48 | "Unix/TS++" -> "TS 4.0"; 49 | "CB Unix 3" -> "TS 4.0"; 50 | "TS 4.0" -> "System V.0"; 51 | "System V.0" -> "System V.2"; 52 | "System V.2" -> "System V.3"; 53 | } 54 | -------------------------------------------------------------------------------- /spec/dots/directed/unix2.gv: -------------------------------------------------------------------------------- 1 | /* Courtesy of Ian Darwin 2 | * and Geoff Collyer 3 | * Mildly updated by Ian Darwin in 2000. 4 | */ 5 | digraph unix { 6 | size="6,6"; 7 | node [color=lightblue2, style=filled]; 8 | "5th Edition" -> "6th Edition"; 9 | "5th Edition" -> "PWB 1.0"; 10 | "6th Edition" -> "LSX"; 11 | "6th Edition" -> "1 BSD"; 12 | "6th Edition" -> "Mini Unix"; 13 | "6th Edition" -> "Wollongong"; 14 | "6th Edition" -> "Interdata"; 15 | "Interdata" -> "Unix/TS 3.0"; 16 | "Interdata" -> "PWB 2.0"; 17 | "Interdata" -> "7th Edition"; 18 | "7th Edition" -> "8th Edition"; 19 | "7th Edition" -> "32V"; 20 | "7th Edition" -> "V7M"; 21 | "7th Edition" -> "Ultrix-11"; 22 | "7th Edition" -> "Xenix"; 23 | "7th Edition" -> "UniPlus+"; 24 | "V7M" -> "Ultrix-11"; 25 | "8th Edition" -> "9th Edition"; 26 | "9th Edition" -> "10th Edition"; 27 | "1 BSD" -> "2 BSD"; 28 | "2 BSD" -> "2.8 BSD"; 29 | "2.8 BSD" -> "Ultrix-11"; 30 | "2.8 BSD" -> "2.9 BSD"; 31 | "32V" -> "3 BSD"; 32 | "3 BSD" -> "4 BSD"; 33 | "4 BSD" -> "4.1 BSD"; 34 | "4.1 BSD" -> "4.2 BSD"; 35 | "4.1 BSD" -> "2.8 BSD"; 36 | "4.1 BSD" -> "8th Edition"; 37 | "4.2 BSD" -> "4.3 BSD"; 38 | "4.2 BSD" -> "Ultrix-32"; 39 | "4.3 BSD" -> "4.4 BSD"; 40 | "4.4 BSD" -> "FreeBSD"; 41 | "4.4 BSD" -> "NetBSD"; 42 | "4.4 BSD" -> "OpenBSD"; 43 | "PWB 1.0" -> "PWB 1.2"; 44 | "PWB 1.0" -> "USG 1.0"; 45 | "PWB 1.2" -> "PWB 2.0"; 46 | "USG 1.0" -> "CB Unix 1"; 47 | "USG 1.0" -> "USG 2.0"; 48 | "CB Unix 1" -> "CB Unix 2"; 49 | "CB Unix 2" -> "CB Unix 3"; 50 | "CB Unix 3" -> "Unix/TS++"; 51 | "CB Unix 3" -> "PDP-11 Sys V"; 52 | "USG 2.0" -> "USG 3.0"; 53 | "USG 3.0" -> "Unix/TS 3.0"; 54 | "PWB 2.0" -> "Unix/TS 3.0"; 55 | "Unix/TS 1.0" -> "Unix/TS 3.0"; 56 | "Unix/TS 3.0" -> "TS 4.0"; 57 | "Unix/TS++" -> "TS 4.0"; 58 | "CB Unix 3" -> "TS 4.0"; 59 | "TS 4.0" -> "System V.0"; 60 | "System V.0" -> "System V.2"; 61 | "System V.2" -> "System V.3"; 62 | "System V.3" -> "System V.4"; 63 | } 64 | -------------------------------------------------------------------------------- /spec/dots/directed/viewfile.gv: -------------------------------------------------------------------------------- 1 | digraph Viewfile { 2 | node [ style = filled ]; 3 | atoi [color=green]; 4 | chkmalloc [color=green]; 5 | close [color=green]; 6 | error [color=blue]; 7 | exit [color=blue]; 8 | fclose [color=green]; 9 | fgets [color=red]; 10 | fopen [color=green]; 11 | fprintf [color=blue]; 12 | free [color=blue]; 13 | free_list [color=blue]; 14 | fstat [color=green]; 15 | getopt [color=green]; 16 | init_list [color=green]; 17 | insert_list [color=green]; 18 | main [color=green]; 19 | makeargs [color=blue]; 20 | makepairs [color=green]; 21 | malloc [color=green]; 22 | open [color=green]; 23 | printf [color=red]; 24 | read [color=green]; 25 | rewind [color=green]; 26 | viewline [color=green]; 27 | viewlines [color=green]; 28 | walk_list [color=green]; 29 | write [color=green]; 30 | fclose -> close [color=green]; 31 | fgets -> fstat [color=green]; 32 | fgets -> read [color=green]; 33 | fopen -> open [color=green]; 34 | printf -> write [color=green]; 35 | main -> fgets [color=blue]; 36 | main -> getopt [color=green]; 37 | main -> makeargs [color=blue]; 38 | main -> makepairs [color=green]; 39 | main -> chkmalloc [color=green]; 40 | main -> error [color=blue]; 41 | main -> viewlines [color=green]; 42 | makeargs -> chkmalloc [color=blue]; 43 | makepairs -> atoi [color=green]; 44 | makepairs -> init_list [color=green]; 45 | makepairs -> insert_list [color=green]; 46 | makepairs -> chkmalloc [color=green]; 47 | free_list -> free [color=blue]; 48 | init_list -> chkmalloc [color=green]; 49 | insert_list -> chkmalloc [color=green]; 50 | walk_list -> error [color=blue]; 51 | walk_list -> viewline [color=green]; 52 | chkmalloc -> malloc [color=green]; 53 | chkmalloc -> error [color=blue]; 54 | error -> exit [color=blue]; 55 | error -> fprintf [color=blue]; 56 | error -> error [color=blue]; 57 | viewline -> fgets [color=red]; 58 | viewline -> printf [color=red]; 59 | viewline -> rewind [color=green]; 60 | viewlines -> fclose [color=green]; 61 | viewlines -> fopen [color=green]; 62 | viewlines -> walk_list [color=green]; 63 | viewlines -> viewline [color=blue]; 64 | } 65 | -------------------------------------------------------------------------------- /spec/dots/directed/world.gv: -------------------------------------------------------------------------------- 1 | digraph world { 2 | size="7,7"; 3 | {rank=same; S8 S24 S1 S35 S30;} 4 | {rank=same; T8 T24 T1 T35 T30;} 5 | {rank=same; 43 37 36 10 2;} 6 | {rank=same; 25 9 38 40 13 17 12 18;} 7 | {rank=same; 26 42 11 3 33 19 39 14 16;} 8 | {rank=same; 4 31 34 21 41 28 20;} 9 | {rank=same; 27 5 22 32 29 15;} 10 | {rank=same; 6 23;} 11 | {rank=same; 7;} 12 | 13 | S8 -> 9; 14 | S24 -> 25; 15 | S24 -> 27; 16 | S1 -> 2; 17 | S1 -> 10; 18 | S35 -> 43; 19 | S35 -> 36; 20 | S30 -> 31; 21 | S30 -> 33; 22 | 9 -> 42; 23 | 9 -> T1; 24 | 25 -> T1; 25 | 25 -> 26; 26 | 27 -> T24; 27 | 2 -> {3 ; 16 ; 17 ; T1 ; 18} 28 | 10 -> { 11 ; 14 ; T1 ; 13; 12;} 29 | 31 -> T1; 30 | 31 -> 32; 31 | 33 -> T30; 32 | 33 -> 34; 33 | 42 -> 4; 34 | 26 -> 4; 35 | 3 -> 4; 36 | 16 -> 15; 37 | 17 -> 19; 38 | 18 -> 29; 39 | 11 -> 4; 40 | 14 -> 15; 41 | 37 -> {39 ; 41 ; 38 ; 40;} 42 | 13 -> 19; 43 | 12 -> 29; 44 | 43 -> 38; 45 | 43 -> 40; 46 | 36 -> 19; 47 | 32 -> 23; 48 | 34 -> 29; 49 | 39 -> 15; 50 | 41 -> 29; 51 | 38 -> 4; 52 | 40 -> 19; 53 | 4 -> 5; 54 | 19 -> {21 ; 20 ; 28;} 55 | 5 -> {6 ; T35 ; 23;} 56 | 21 -> 22; 57 | 20 -> 15; 58 | 28 -> 29; 59 | 6 -> 7; 60 | 15 -> T1; 61 | 22 -> T35; 62 | 22 -> 23; 63 | 29 -> T30; 64 | 7 -> T8; 65 | 23 -> T24; 66 | 23 -> T1; 67 | } 68 | -------------------------------------------------------------------------------- /spec/dots/undirected/ER.gv: -------------------------------------------------------------------------------- 1 | graph ER { 2 | node [shape=box]; course; institute; student; 3 | node [shape=ellipse]; {node [label="name"] name0; name1; name2;} 4 | code; grade; number; 5 | node [shape=diamond,style=filled,color=lightgrey]; "C-I"; "S-C"; "S-I"; 6 | 7 | name0 -- course; 8 | code -- course; 9 | course -- "C-I" [label="n",len=1.00]; 10 | "C-I" -- institute [label="1",len=1.00]; 11 | institute -- name1; 12 | institute -- "S-I" [label="1",len=1.00]; 13 | "S-I" -- student [label="n",len=1.00]; 14 | student -- grade; 15 | student -- name2; 16 | student -- number; 17 | student -- "S-C" [label="m",len=1.00]; 18 | "S-C" -- course [label="n",len=1.00]; 19 | 20 | label = "\n\nEntity Relation Diagram\ndrawn by NEATO"; 21 | fontsize=20; 22 | } 23 | -------------------------------------------------------------------------------- /spec/dots/undirected/Heawood.gv: -------------------------------------------------------------------------------- 1 | /* 2 | * The transitive 6-net, also known as Heawood's graph, 3 | * can be used to test the "stability points" of the layout 4 | * algorithm. 5 | 6 | * The "ideal" layout occurs when len="2.5". The layout 7 | * loses the regularity when smaller values are used. 8 | */ 9 | graph "Heawood" { 10 | node [ 11 | fontname = "Arial" 12 | label = "\N" 13 | shape = "circle" 14 | width = "0.50000" 15 | height = "0.500000" 16 | color = "black" 17 | ] 18 | edge [ 19 | color = "black" 20 | ] 21 | /* The outer wheel */ 22 | "0" -- "1" -- "2" -- "3" -- "4" -- "5" -- "6" -- "7" -- "8" -- "9" -- "10" -- "11" -- "12" -- "13" -- "0"; 23 | /* The internal edges. The len = makes them internal */ 24 | "0" -- "5" [len = 2.5]; 25 | "2" -- "7" [len = 2.5]; 26 | "4" -- "9" [len = 2.5]; 27 | "6" -- "11" [len = 2.5]; 28 | "8" -- "13" [len = 2.5]; 29 | "10" -- "1" [len = 2.5]; 30 | "12" -- "3" [len = 2.5]; 31 | } 32 | -------------------------------------------------------------------------------- /spec/dots/undirected/Petersen.gv: -------------------------------------------------------------------------------- 1 | /* 2 | * The transitive 5-net, also known as Petersen's graph, 3 | * can be used to test the "stability points" of the layout 4 | * algorithm. 5 | * 6 | * The "ideal" layout is achieved for certain random seed 7 | * values when len=1.5. For len=2.5 or above, the layout 8 | * is stable. Sometimes, the graph is rendered "inside-out". 9 | */ 10 | graph "Petersen" { 11 | node [ 12 | fontname = "Arial" 13 | label = "\N" 14 | shape = "circle" 15 | width = "0.400000" 16 | height = "0.400000" 17 | color = "black" 18 | ] 19 | edge [ 20 | color = "black" 21 | ] 22 | /* Outer wheel. The len= is what makes it outer */ 23 | "0" -- "1" -- "2" -- "3" -- "4" -- "0" [ 24 | color = "blue" 25 | len = 2.6 26 | ] 27 | "0" -- "5" [ 28 | color = "red" 29 | weight = "5" 30 | ] 31 | "1" -- "6" [ 32 | color = "red" 33 | weight = "5" 34 | ] 35 | "2" -- "7" [ 36 | color = "red" 37 | weight = "5" 38 | ] 39 | "3" -- "8" [ 40 | color = "red" 41 | weight = "5" 42 | ] 43 | "4" -- "9" [ 44 | color = "red" 45 | weight = "5" 46 | ] 47 | "5" -- "7" -- "9" -- "6" -- "8" -- "5"; 48 | } 49 | -------------------------------------------------------------------------------- /spec/dots/undirected/ngk10_4.gv: -------------------------------------------------------------------------------- 1 | graph G { 2 | graph [splines=true overlap=false] 3 | 1 -- 30 [f=1]; 4 | 1 -- 40 [f=14]; 5 | 8 -- 46 [f=1]; 6 | 8 -- 16 [f=18]; 7 | 10 -- 25 [f=1]; 8 | 10 -- 19 [f=5]; 9 | 10 -- 33 [f=1]; 10 | 12 -- 8 [f=1]; 11 | 12 -- 36 [f=5]; 12 | 12 -- 17 [f=16]; 13 | 13 -- 38 [f=1]; 14 | 13 -- 24 [f=19]; 15 | 24 -- 49 [f=1]; 16 | 24 -- 13 [f=1]; 17 | 24 -- 47 [f=12]; 18 | 24 -- 12 [f=19]; 19 | 25 -- 27 [f=1]; 20 | 25 -- 12 [f=1]; 21 | 27 -- 12 [f=1]; 22 | 27 -- 14 [f=8]; 23 | 29 -- 10 [f=1]; 24 | 29 -- 8 [f=17]; 25 | 30 -- 24 [f=1]; 26 | 30 -- 44 [f=15]; 27 | 38 -- 29 [f=1]; 28 | 38 -- 35 [f=15]; 29 | 2 -- 42 [f=2]; 30 | 2 -- 35 [f=3]; 31 | 2 -- 11 [f=19]; 32 | 14 -- 18 [f=2]; 33 | 14 -- 24 [f=15]; 34 | 14 -- 38 [f=18]; 35 | 18 -- 49 [f=2]; 36 | 18 -- 47 [f=20]; 37 | 26 -- 41 [f=2]; 38 | 26 -- 42 [f=15]; 39 | 31 -- 39 [f=2]; 40 | 31 -- 47 [f=17]; 41 | 31 -- 25 [f=14]; 42 | 37 -- 26 [f=2]; 43 | 37 -- 16 [f=14]; 44 | 39 -- 50 [f=2]; 45 | 39 -- 14 [f=2]; 46 | 39 -- 18 [f=17]; 47 | 39 -- 47 [f=10]; 48 | 41 -- 31 [f=2]; 49 | 41 -- 8 [f=16]; 50 | 42 -- 44 [f=2]; 51 | 42 -- 29 [f=12]; 52 | 44 -- 37 [f=2]; 53 | 44 -- 32 [f=15]; 54 | 3 -- 20 [f=2]; 55 | 3 -- 28 [f=19]; 56 | 6 -- 45 [f=2]; 57 | 6 -- 28 [f=10]; 58 | 9 -- 6 [f=2]; 59 | 9 -- 16 [f=1]; 60 | 15 -- 16 [f=2]; 61 | 15 -- 48 [f=2]; 62 | 16 -- 50 [f=2]; 63 | 16 -- 32 [f=14]; 64 | 16 -- 39 [f=8]; 65 | 20 -- 33 [f=2]; 66 | 33 -- 9 [f=2]; 67 | 33 -- 46 [f=3]; 68 | 33 -- 48 [f=17]; 69 | 45 -- 15 [f=2]; 70 | 4 -- 17 [f=4]; 71 | 4 -- 15 [f=6]; 72 | 4 -- 12 [f=16]; 73 | 17 -- 21 [f=4]; 74 | 19 -- 35 [f=4]; 75 | 19 -- 15 [f=9]; 76 | 19 -- 43 [f=4]; 77 | 21 -- 19 [f=4]; 78 | 21 -- 50 [f=4]; 79 | 23 -- 36 [f=4]; 80 | 34 -- 23 [f=4]; 81 | 34 -- 24 [f=11]; 82 | 35 -- 34 [f=4]; 83 | 35 -- 16 [f=6]; 84 | 35 -- 18 [f=16]; 85 | 36 -- 46 [f=4]; 86 | 5 -- 7 [f=1]; 87 | 5 -- 36 [f=6]; 88 | 7 -- 32 [f=1]; 89 | 7 -- 11 [f=2]; 90 | 7 -- 14 [f=17]; 91 | 11 -- 40 [f=1]; 92 | 11 -- 50 [f=1]; 93 | 22 -- 46 [f=1]; 94 | 28 -- 43 [f=1]; 95 | 28 -- 8 [f=18]; 96 | 32 -- 28 [f=1]; 97 | 32 -- 39 [f=13]; 98 | 32 -- 42 [f=15]; 99 | 40 -- 22 [f=1]; 100 | 40 -- 47 [f=1]; 101 | 43 -- 11 [f=1]; 102 | 43 -- 17 [f=19]; 103 | } 104 | -------------------------------------------------------------------------------- /spec/dots/undirected/process.gv: -------------------------------------------------------------------------------- 1 | graph G { 2 | run -- intr; 3 | intr -- runbl; 4 | runbl -- run; 5 | run -- kernel; 6 | kernel -- zombie; 7 | kernel -- sleep; 8 | kernel -- runmem; 9 | sleep -- swap; 10 | swap -- runswap; 11 | runswap -- new; 12 | runswap -- runmem; 13 | new -- runmem; 14 | sleep -- runmem; 15 | } 16 | -------------------------------------------------------------------------------- /spec/img/A-B-C.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mstefaniuk/graph-viz-d3-js/546cc2e419bff3a10cdd981ed90d858a5324a526/spec/img/A-B-C.png -------------------------------------------------------------------------------- /spec/img/B-zoomed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mstefaniuk/graph-viz-d3-js/546cc2e419bff3a10cdd981ed90d858a5324a526/spec/img/B-zoomed.png -------------------------------------------------------------------------------- /spec/jasmine/data-helpers.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | (function() { 4 | 5 | var root = this, 6 | toString = Object.prototype.toString; 7 | 8 | function all(description, dataset, fn) { 9 | return createDataDrivenSpecs(root.it, description, dataset, fn, true); 10 | } 11 | 12 | function xall(description, dataset, fn) { 13 | return createDataDrivenSpecs(root.xit, description, dataset, fn, true); 14 | } 15 | 16 | function using(description, dataset, fn) { 17 | return createDataDrivenSpecs(root.describe, description, dataset, fn, false); 18 | } 19 | 20 | function xusing(description, dataset, fn) { 21 | return createDataDrivenSpecs(root.xdescribe, description, dataset, fn, false); 22 | } 23 | 24 | function createSyncDataDrivenFn(args, fn) { 25 | return function synchronousSpec() { 26 | fn.apply(this, args); 27 | }; 28 | } 29 | 30 | function createAsyncDataDrivenFn(args, fn) { 31 | return function asynchronousSpec(done) { 32 | var fnArgs = [done]; 33 | fnArgs.unshift.apply(fnArgs, args); 34 | fn.apply(this, fnArgs); 35 | }; 36 | } 37 | 38 | function createVariantDescription(description, args, index) { 39 | var variantDesc = description + " (Variant #" + index + " <", 40 | i = 0, length = args.length, x; 41 | 42 | for (i; i < length; i++) { 43 | if (i > 0) { 44 | variantDesc += ", "; 45 | } 46 | 47 | if (typeof args[i] === "string") { 48 | variantDesc += '"' + args[i] + '"'; 49 | } 50 | else if (isArray(args[i])) { 51 | variantDesc += toString.call(args[i]); 52 | } 53 | else { 54 | variantDesc += String(args[i]); 55 | } 56 | } 57 | 58 | variantDesc += ">)"; 59 | 60 | return variantDesc; 61 | } 62 | 63 | function createDataDrivenSpecs(specProvider, description, dataset, fn, isAsyncAllowed) { 64 | var i = 0, 65 | length = 0, 66 | specs = [], 67 | args, 68 | maxArgCount = 0, 69 | variantDesc, 70 | suite; 71 | 72 | if (!dataset || !isArray(dataset) || dataset.length === 0) { 73 | throw error("Jasmine.ArgumentsMissingError", "No arguments for a data-driven test were provided ({0})", description); 74 | } 75 | 76 | // Validate the dataset first 77 | for (i, length = dataset.length; i < length; i++) { 78 | args = isArray(dataset[i]) ? dataset[i] : [dataset[i]]; 79 | maxArgCount = maxArgCount || args.length; 80 | variantDesc = createVariantDescription(description, args, i); 81 | 82 | if (args.length !== maxArgCount) { 83 | throw error("Jasmine.ArgumentCountMismatchError", 84 | "Expected {0} argument(s). Found {1} at index {2} ({3})", 85 | maxArgCount, args.length, i, description); 86 | } 87 | else if (args.length === fn.length) { 88 | specs.push({ 89 | description: variantDesc, 90 | fn: createSyncDataDrivenFn(args, fn) 91 | }); 92 | } 93 | else if (isAsyncAllowed && args.length + 1 === fn.length) { 94 | specs.push({ 95 | description: variantDesc, 96 | fn: createAsyncDataDrivenFn(args, fn) 97 | }); 98 | } 99 | else { 100 | throw error("Jasmine.ArgumentCountMismatchError", 101 | "Expecting data driven spec to accept {0} {1}, but {2} {3} specified in the callback function ({4})", 102 | args.length, 103 | args.length === 1 ? "argument" : "arguments", 104 | fn.length, 105 | fn.length === 1 ? "argument is" : "arguments are", 106 | description); 107 | } 108 | } 109 | 110 | // Create the suite and specs 111 | suite = root.describe(description, function() { 112 | for (i = 0, length = specs.length; i < length; i++) { 113 | specProvider(specs[i].description, specs[i].fn); 114 | } 115 | }); 116 | 117 | return suite; 118 | } 119 | 120 | function isArray(x) { 121 | return toString.call(x) === "[object Array]"; 122 | } 123 | 124 | function error(name, message) { 125 | var args = Array.prototype.slice.call(arguments, 2), 126 | error; 127 | 128 | if (args && args.length) { 129 | message = message.replace(/\{(\d+)\}/g, function(match, index) { 130 | return args[Number(index)] || ""; 131 | }); 132 | } 133 | 134 | error = new Error(message); 135 | error.name = name; 136 | 137 | return error; 138 | } 139 | 140 | root.all = all; 141 | root.xall = xall; 142 | root.using = using; 143 | root.xusing = xusing; 144 | 145 | }).call(this); 146 | -------------------------------------------------------------------------------- /spec/jasmine/image-matchers.js: -------------------------------------------------------------------------------- 1 | define(["imagediff"], function(imagediff) { 2 | 3 | function toCanvas (object) { 4 | var 5 | data = imagediff.toImageData(object), 6 | canvas = imagediff.createCanvas(data.width, data.height), 7 | context = canvas.getContext('2d'); 8 | 9 | context.putImageData(data, 0, 0); 10 | return canvas; 11 | } 12 | 13 | function imageDiffEqualMessage (actual, expected, diffImage) { 14 | var actualImage = toCanvas(actual).toDataURL(); 15 | var expectedImage = toCanvas(expected).toDataURL(); 16 | 17 | return 'Image "' + actualImage + '" is not equal image "' + expectedImage + 18 | '" and it gives following difference image "' + diffImage + '".'; 19 | } 20 | 21 | return { 22 | 23 | toImageEqual: function () { 24 | return { 25 | compare: function (actual, expected, differences, tolerance) { 26 | var 27 | result = {}; 28 | 29 | result.pass = differences.rawMisMatchPercentage < tolerance; 30 | if (typeof (document) !== 'undefined') { 31 | result.message = imageDiffEqualMessage(actual, expected, differences.getImageDataUrl()); 32 | } 33 | return result; 34 | }, 35 | negativeCompare: function (actual, expected, tolerance) { 36 | return { 37 | pass: !imagediff.equal(actual, expected, tolerance), 38 | message: 'Expected not to be equal.' 39 | }; 40 | } 41 | }; 42 | } 43 | }; 44 | }); -------------------------------------------------------------------------------- /spec/palette-spec.js: -------------------------------------------------------------------------------- 1 | define(['palette'], function (palette) { 2 | 3 | describe("Palette", function () { 4 | it("should generate vanilla path", function () { 5 | var path = palette.path({ 6 | points: [ 7 | [10, 90], 8 | [40, 10], 9 | [30, 90], 10 | [90, 10] 11 | ] 12 | }); 13 | expect(path).toEqual("M 10,-90 C 40,-10,30,-90,90,-10"); 14 | }); 15 | 16 | it("should generate polygon as a path", function () { 17 | var path = palette.polygon({ 18 | points: [ 19 | [11, 12], 20 | [21, 22], 21 | [31, 32], 22 | [41, 42], 23 | [51, 52] 24 | ] 25 | }); 26 | expect(path).toEqual("M 11,-12 L 21,-22,31,-32,41,-42,51,-52 Z"); 27 | }); 28 | 29 | it("should generate ellipse as a path", function () { 30 | var path = palette.ellipse({ 31 | cx: 11, 32 | cy: 21, 33 | rx: 15, 34 | ry: 16 35 | }); 36 | expect(path).toEqual("M 11,-21 m -15,0 a 15,16 0 1,0 30,0 a 15,16 0 1,0 -30,0"); 37 | }); 38 | 39 | it("should generate circle as a path", function () { 40 | var path = palette.circle({ 41 | cx: 11, 42 | cy: 12, 43 | r: 15 44 | }); 45 | expect(path).toEqual("M 11,12 m -15,0 a 15,15 0 1,0 30,0 a 15,15 0 1,0 -30,0"); 46 | }); 47 | 48 | it("should generate rect as a path", function () { 49 | var path = palette.rect({ 50 | x: 11, 51 | y: 12, 52 | width: 20, 53 | height: 30 54 | }); 55 | expect(path).toEqual("M 11,12 L 31,12,31,-18,11,-18 Z"); 56 | }); 57 | 58 | it("should generate bspline as path", function () { 59 | var path = palette.bspline({ 60 | points: [ 61 | [11, 51], 62 | [51, 33], 63 | [21, 52], 64 | [11, 62] 65 | ] 66 | }); 67 | expect(path).toEqual("M 11,-51 C 51,-33,21,-52,11,-62"); 68 | }); 69 | 70 | it("should generate polyline as path", function () { 71 | var path = palette.polyline({ 72 | points: [ 73 | [5, 30], 74 | [15, 30], 75 | [15, 20], 76 | [25, 20], 77 | [25, 10], 78 | [35, 10] 79 | ] 80 | }); 81 | expect(path).toEqual("M 5,-30 L 15,-30,15,-20,25,-20,25,-10,35,-10"); 82 | }); 83 | }); 84 | }); -------------------------------------------------------------------------------- /spec/renderer-spec.js: -------------------------------------------------------------------------------- 1 | define(["rfactory!renderer"], function(rendererFactory) { 2 | 3 | describe("Dot source renderer", function() { 4 | 5 | var stageSpy, workerSpy, callbackSpy, renderer; 6 | beforeEach(function () { 7 | stageSpy = jasmine.createSpyObj('stage', ["init", "draw", "svg", "getImage"]); 8 | workerSpy = jasmine.createSpyObj('worker', ['postMessage']); 9 | callbackSpy = jasmine.createSpy("callback"); 10 | renderer = rendererFactory({ 11 | 'stage': stageSpy, 12 | "worker!layout-worker.js": workerSpy 13 | }); 14 | }); 15 | 16 | it("should init stage with provided element", function() { 17 | var element = "element"; 18 | renderer.init(element); 19 | expect(stageSpy.init).toHaveBeenCalledWith(element); 20 | }); 21 | 22 | it("should buffer source to be rendered until worker is initialized", function() { 23 | var source = "source"; 24 | renderer.render(source); 25 | workerSpy.onmessage({ 26 | data: { 27 | type: "ready" 28 | } 29 | }); 30 | expect(workerSpy.postMessage).toHaveBeenCalledWith(source); 31 | }); 32 | 33 | it("should send source directly when worker is already initialized", function() { 34 | var source = "source"; 35 | workerSpy.onmessage({ 36 | data: { 37 | type: "ready" 38 | } 39 | }); 40 | renderer.render(source); 41 | expect(workerSpy.postMessage).toHaveBeenCalledWith(source); 42 | }); 43 | 44 | it("should draw stage with output of worker", function() { 45 | renderer.renderHandler(callbackSpy); 46 | workerSpy.onmessage({ 47 | data: { 48 | type: "stage", 49 | body: {} 50 | } 51 | }); 52 | expect(callbackSpy).toHaveBeenCalled(); 53 | expect(stageSpy.draw).toHaveBeenCalledWith({}); 54 | }); 55 | 56 | it("should return error when rendering failed", function() { 57 | var output = "output", source = "source"; 58 | renderer.errorHandler(callbackSpy); 59 | workerSpy.onmessage({ 60 | data: { 61 | type: "ready" 62 | } 63 | }); 64 | renderer.render(source); 65 | workerSpy.onmessage({ 66 | data: { 67 | type: "error", 68 | body: output 69 | } 70 | }); 71 | expect(workerSpy.postMessage).toHaveBeenCalledWith(source); 72 | expect(stageSpy.draw).not.toHaveBeenCalled(); 73 | expect(callbackSpy).toHaveBeenCalledWith(output); 74 | }); 75 | }); 76 | }); -------------------------------------------------------------------------------- /spec/shapes/double-quotes.js: -------------------------------------------------------------------------------- 1 | define({ 2 | "main": { 3 | "id": "G", 4 | "class": "digraph", 5 | "shapes": [ 6 | { 7 | "shape": "polygon", 8 | "points": [ 9 | [ 10 | 0, 11 | 0 12 | ], 13 | [ 14 | 0, 15 | 36 16 | ], 17 | [ 18 | 126.51, 19 | 36 20 | ], 21 | [ 22 | 126.51, 23 | 0 24 | ] 25 | ], 26 | "style": [ 27 | { 28 | "key": "stroke", 29 | "value": "#fffffe00" 30 | }, 31 | { 32 | "key": "fill", 33 | "value": "#ffffff" 34 | } 35 | ] 36 | } 37 | ], 38 | "labels": [] 39 | }, 40 | "groups": [ 41 | { 42 | "id": "mynode", 43 | "class": "node", 44 | "shapes": [ 45 | { 46 | "shape": "ellipse", 47 | "cx": 63.26, 48 | "cy": 18, 49 | "rx": 63.01, 50 | "ry": 18, 51 | "style": [ 52 | { 53 | "key": "stroke", 54 | "value": "#000000" 55 | }, 56 | { 57 | "key": "fill", 58 | "value": "none" 59 | } 60 | ] 61 | } 62 | ], 63 | "labels": [ 64 | { 65 | "x": 63.26, 66 | "y": 13.8, 67 | "text": "Some \" quote", 68 | "anchor": "middle", 69 | "style": [ 70 | { 71 | "key": "font-family", 72 | "value": "'Times-Roman',serif" 73 | }, 74 | { 75 | "key": "font-size", 76 | "value": 14 77 | }, 78 | { 79 | "key": "stroke", 80 | "value": "#000000" 81 | } 82 | ] 83 | } 84 | ] 85 | } 86 | ] 87 | }); -------------------------------------------------------------------------------- /spec/shapes/graph-label.js: -------------------------------------------------------------------------------- 1 | define({ 2 | "main": { 3 | "id": "G", 4 | "class": "digraph", 5 | "shapes": [ 6 | { 7 | "shape": "polygon", 8 | "points": [ 9 | [ 10 | 0, 11 | 0 12 | ], 13 | [ 14 | 0, 15 | 132.8 16 | ], 17 | [ 18 | 54, 19 | 132.8 20 | ], 21 | [ 22 | 54, 23 | 0 24 | ] 25 | ], 26 | "style": [ 27 | { 28 | "key": "stroke", 29 | "value": "#fffffe" 30 | }, 31 | { 32 | "key": "fill", 33 | "value": "#ffffff" 34 | } 35 | ] 36 | } 37 | ], 38 | "labels": [ 39 | { 40 | "x": 25.49, 41 | "y": 116.2, 42 | "text": "Graph", 43 | "anchor": "middle", 44 | "style": [ 45 | { 46 | "key": "font-family", 47 | "value": "'Times-Roman',serif" 48 | }, 49 | { 50 | "key": "font-size", 51 | "value": 14 52 | }, 53 | { 54 | "key": "stroke", 55 | "value": "#000000" 56 | } 57 | ] 58 | } 59 | ] 60 | }, 61 | "groups": [ 62 | { 63 | "id": "A", 64 | "class": "node", 65 | "shapes": [ 66 | { 67 | "shape": "ellipse", 68 | "cx": 27, 69 | "cy": 90, 70 | "rx": 27, 71 | "ry": 18, 72 | "style": [ 73 | { 74 | "key": "stroke", 75 | "value": "#000000" 76 | } 77 | ] 78 | } 79 | ], 80 | "labels": [ 81 | { 82 | "x": 27, 83 | "y": 85.8, 84 | "text": "A", 85 | "anchor": "middle", 86 | "style": [ 87 | { 88 | "key": "font-family", 89 | "value": "'Times-Roman',serif" 90 | }, 91 | { 92 | "key": "font-size", 93 | "value": 14 94 | }, 95 | { 96 | "key": "stroke", 97 | "value": "#000000" 98 | } 99 | ] 100 | } 101 | ] 102 | }, 103 | { 104 | "id": "B", 105 | "class": "node", 106 | "shapes": [ 107 | { 108 | "shape": "ellipse", 109 | "cx": 27, 110 | "cy": 18, 111 | "rx": 27, 112 | "ry": 18, 113 | "style": [ 114 | { 115 | "key": "stroke", 116 | "value": "#000000" 117 | } 118 | ] 119 | } 120 | ], 121 | "labels": [ 122 | { 123 | "x": 27, 124 | "y": 13.8, 125 | "text": "B", 126 | "anchor": "middle", 127 | "style": [ 128 | { 129 | "key": "font-family", 130 | "value": "'Times-Roman',serif" 131 | }, 132 | { 133 | "key": "font-size", 134 | "value": 14 135 | }, 136 | { 137 | "key": "stroke", 138 | "value": "#000000" 139 | } 140 | ] 141 | } 142 | ] 143 | }, 144 | { 145 | "id": "A-B", 146 | "class": "relation", 147 | "shapes": [ 148 | { 149 | "shape": "bspline", 150 | "points": [ 151 | [ 152 | 27, 153 | 71.7 154 | ], 155 | [ 156 | 27, 157 | 63.98 158 | ], 159 | [ 160 | 27, 161 | 54.71 162 | ], 163 | [ 164 | 27, 165 | 46.11 166 | ] 167 | ], 168 | "style": [ 169 | { 170 | "key": "stroke", 171 | "value": "#000000" 172 | } 173 | ] 174 | }, 175 | { 176 | "shape": "polygon", 177 | "points": [ 178 | [ 179 | 30.5, 180 | 46.1 181 | ], 182 | [ 183 | 27, 184 | 36.1 185 | ], 186 | [ 187 | 23.5, 188 | 46.1 189 | ] 190 | ], 191 | "style": [ 192 | { 193 | "key": "style", 194 | "value": "solid" 195 | }, 196 | { 197 | "key": "stroke", 198 | "value": "#000000" 199 | }, 200 | { 201 | "key": "fill", 202 | "value": "#000000" 203 | } 204 | ] 205 | } 206 | ], 207 | "labels": [] 208 | } 209 | ] 210 | }); -------------------------------------------------------------------------------- /spec/test-main.js: -------------------------------------------------------------------------------- 1 | var tests = []; 2 | for (var file in window.__karma__.files) { 3 | if (/spec\.js$/.test(file)) { 4 | tests.push(file); 5 | } 6 | } 7 | 8 | requirejs.config({ 9 | baseUrl: '/base/src/js', 10 | waitSeconds: 20, 11 | 12 | paths: { 13 | text: '../../lib/requirejs-text/text', 14 | d3: '../../lib/d3/d3', 15 | ace: '../../lib/ace', 16 | viz: '../../lib/viz.js/viz', 17 | spec: '../../spec', 18 | parser: '../../parser', 19 | rfactory: '../../lib/rfactory/rfactory', 20 | worker: '../../lib/requirejs-web-workers/worker', 21 | imagediff: '../../lib/js-imagediff/imagediff', 22 | resemble: '../../lib/resemblejs/resemble' 23 | }, 24 | 25 | shim: { 26 | d3: { 27 | exports: 'd3' 28 | }, 29 | viz: { 30 | exports: "Viz" 31 | } 32 | }, 33 | 34 | deps: ["rfactory"].concat(tests), 35 | 36 | callback: window.__karma__.start 37 | }); -------------------------------------------------------------------------------- /spec/transformer-gallery-spec.js: -------------------------------------------------------------------------------- 1 | define(['transformer', 'spec/dots/directed'], function (transformer, array) { 2 | 3 | describe('Transformer', function () { 4 | using("provided gallery graphs", array, function (graph) { 5 | var result = transformer.generate(graph); 6 | 7 | it("returned stageshould have shapes to draw canvas and shapes with diagram itself", function () { 8 | expect(result.main.shapes.length).toBeGreaterThan(0); 9 | expect(result.main.shapes[0].points.length).toEqual(4); 10 | expect(result.groups.length).toBeGreaterThan(0); 11 | }); 12 | }); 13 | }); 14 | }); -------------------------------------------------------------------------------- /spec/transformer-integration-spec.js: -------------------------------------------------------------------------------- 1 | define(['transformer', 'spec/shapes/longer-labels', 2 | 'text!spec/dots/directed/switch.gv', 'spec/shapes/directed/switch', 3 | 'text!spec/dots/directed/table.gv', 'spec/shapes/directed/table', 4 | 'text!spec/dots/adept.gv', 'spec/shapes/adept', 'spec/shapes/double-quotes', 5 | 'spec/shapes/multiple-edges'], 6 | function (transformer, longerLabels, switchSource, switchShape, tableSource, tableShape, 7 | adeptSource, adeptShape, doubleQuotesShape, multipleEdgesShape) { 8 | describe('Transformer', function() { 9 | it("should extract node shapes correctly when labels are longer than 4 chars", function() { 10 | var stage = transformer.generate("digraph { longer -> labels -> ok}"); 11 | expect(stage).toEqual(longerLabels); 12 | }); 13 | 14 | xit("should handle struct with multiple edges", function() { 15 | var stage = transformer.generate(switchSource); 16 | expect(stage).toEqual(switchShape); 17 | }); 18 | 19 | xit("should handle diagrams with html tables", function() { 20 | var stage = transformer.generate(tableSource); 21 | expect(stage).toEqual(tableShape); 22 | }); 23 | 24 | it("should handle undirected diagrams", function() { 25 | var stage = transformer.generate(adeptSource); 26 | expect(stage).toEqual(adeptShape); 27 | }); 28 | 29 | xit("should handle diagrams with html tables", function() { 30 | var stage = transformer.generate( 31 | 'digraph G { G[ label="google.com" shape=box URL="http://google.com" tooltip="Click me!" style="filled" fillcolor="#5cb85c" color="#5cb85c" fontcolor="#ffffff"];}' 32 | ); 33 | expect(stage).toEqual(tableShape); 34 | }); 35 | 36 | it("should handle diagrams with escaped quotes", function() { 37 | var stage = transformer.generate('digraph G {mynode [ label="Some \\\" quote" ];}'); 38 | expect(stage).toEqual(doubleQuotesShape); 39 | }); 40 | 41 | it("should handle multiple edges between nodes", function() { 42 | var stage = transformer.generate([ 43 | "digraph G {", 44 | " A; B; C", 45 | " subgraph Rel1 {", 46 | " edge [dir=none, color=red]", 47 | " A -> B -> C -> A", 48 | " }", 49 | " subgraph Rel2 {", 50 | " edge [color=blue]", 51 | " B -> C", 52 | " C -> A", 53 | " }", 54 | "}" 55 | ].join("\n")); 56 | expect(stage).toEqual(multipleEdgesShape); 57 | }); 58 | 59 | it("should handle id of nodes", function() { 60 | var stage = transformer.generate( 61 | "digraph G {foo_node [id=foo_node_id]}" 62 | ); 63 | expect(stage.groups[0].identifier).toEqual("foo_node_id"); 64 | }); 65 | }); 66 | }); -------------------------------------------------------------------------------- /spec/transformer-spec.js: -------------------------------------------------------------------------------- 1 | define(['rfactory!transformer', 'spec/asts/directed/clust4', 'spec/shapes/directed/clust4', 'text!spec/xdots/directed/clust4.xdot'], 2 | function (transformerFactory, ast_clust4, shape_clust4, xdot_clust4) { 3 | 4 | describe("Transformer of xdot format", function () { 5 | 6 | var vizSpy, xdotSpy, transformer; 7 | beforeEach(function () { 8 | vizSpy = jasmine.createSpy('viz'); 9 | xdotSpy = jasmine.createSpyObj('xdotSpy', ['parse']); 10 | transformer = transformerFactory({ 11 | 'viz': vizSpy, 12 | 'parser/xdot': xdotSpy 13 | }); 14 | }); 15 | 16 | it("should provide stage size property in points", function () { 17 | var source = { 18 | "type": "digraph", 19 | "id": "a", 20 | "commands": [{"type": "graph", "attributes": [{"type": "size", "value": [6, 7]}]}] 21 | }; 22 | var result = transformer.shapeast(source); 23 | expect(result.main.size).toEqual([6*72, 7*72]); 24 | }); 25 | 26 | it("should call viz.js with xdot option and call xdot parser with AST", function() { 27 | vizSpy.and.returnValue(xdot_clust4); 28 | xdotSpy.parse.and.returnValue(ast_clust4); 29 | var input = 'source'; 30 | 31 | var result = transformer.generate(input); 32 | expect(vizSpy).toHaveBeenCalledWith(input, { format : 'xdot' }); 33 | expect(xdotSpy.parse).toHaveBeenCalledWith(xdot_clust4); 34 | expect(result).toEqual(shape_clust4); 35 | }); 36 | 37 | it("should pass error from viz.js", function() { 38 | var error = "Error: Syntax error from viz.js"; 39 | vizSpy.and.callFake(function(){ 40 | throw error; 41 | }); 42 | 43 | try { 44 | transformer.generate('invalid'); 45 | } catch (e) { 46 | expect(e).toEqual(error); 47 | } 48 | }); 49 | 50 | it("should return error when xdot source parsing failed", function() { 51 | var error = "Parsing of xdot output failed"; 52 | vizSpy.and.returnValue({invalid: true}); 53 | xdotSpy.parse.and.callFake(function() { 54 | throw new Error(); 55 | }); 56 | 57 | try { 58 | transformer.generate('invalid'); 59 | } catch (e) { 60 | expect(e).toEqual(error); 61 | } 62 | }); 63 | }); 64 | }); -------------------------------------------------------------------------------- /spec/vizjs-spec.js: -------------------------------------------------------------------------------- 1 | define(["viz"], function(viz) { 2 | 3 | describe("Viz.js", function() { 4 | 5 | it("should recover after unclosed quotes error", function() { 6 | expect(function() { 7 | viz([ 8 | 'digraph {', 9 | ' a -> b [label="erroneous]', 10 | '}'].join("\n")); 11 | }).toThrow(); 12 | var svg = viz([ 13 | 'digraph {', 14 | ' a -> b [label="correcteous"]', 15 | '}'].join("\n")); 16 | expect(svg).toBeDefined(); 17 | }); 18 | }); 19 | }); -------------------------------------------------------------------------------- /spec/xdots/directed.js: -------------------------------------------------------------------------------- 1 | define( 2 | ['text!spec/xdots/directed/abstract.xdot', 3 | 'text!spec/xdots/directed/alf.xdot', 4 | 'text!spec/xdots/directed/arr_none.xdot', 5 | 'text!spec/xdots/directed/arrows.xdot', 6 | 'text!spec/xdots/directed/awilliams.xdot', 7 | 'text!spec/xdots/directed/biological.xdot', 8 | 'text!spec/xdots/directed/clust.xdot', 9 | 'text!spec/xdots/directed/clust1.xdot', 10 | 'text!spec/xdots/directed/clust2.xdot', 11 | 'text!spec/xdots/directed/clust3.xdot', 12 | 'text!spec/xdots/directed/clust4.xdot', 13 | 'text!spec/xdots/directed/clust5.xdot', 14 | 'text!spec/xdots/directed/crazy.xdot', 15 | 'text!spec/xdots/directed/ctext.xdot', 16 | 'text!spec/xdots/directed/dfa.xdot', 17 | 'text!spec/xdots/directed/fig6.xdot', 18 | 'text!spec/xdots/directed/fsm.xdot', 19 | 'text!spec/xdots/directed/grammar.xdot', 20 | 'text!spec/xdots/directed/hashtable.xdot', 21 | 'text!spec/xdots/directed/honda-tokoro.xdot', 22 | 'text!spec/xdots/directed/japanese.xdot', 23 | 'text!spec/xdots/directed/jcctree.xdot', 24 | 'text!spec/xdots/directed/jsort.xdot', 25 | 'text!spec/xdots/directed/KW91.xdot', 26 | 'text!spec/xdots/directed/Latin1.xdot', 27 | 'text!spec/xdots/directed/ldbxtried.xdot', 28 | 'text!spec/xdots/directed/longflat.xdot', 29 | 'text!spec/xdots/directed/mike.xdot', 30 | 'text!spec/xdots/directed/NaN.xdot', 31 | 'text!spec/xdots/directed/nhg.xdot', 32 | // 'text!spec/xdots/directed/oldarrows.xdot', 33 | 'text!spec/xdots/directed/pgram.xdot', 34 | // 'text!spec/xdots/directed/pm2way.xdot', 35 | // 'text!spec/xdots/directed/pmpipe.xdot', 36 | 'text!spec/xdots/directed/polypoly.xdot', 37 | // 'text!spec/xdots/directed/proc3d.xdot', 38 | 'text!spec/xdots/directed/psfonttest.xdot', 39 | 'text!spec/xdots/directed/record2.xdot', 40 | 'text!spec/xdots/directed/records.xdot', 41 | 'text!spec/xdots/directed/rowe.xdot', 42 | 'text!spec/xdots/directed/russian.xdot', 43 | 'text!spec/xdots/directed/sdh.xdot', 44 | 'text!spec/xdots/directed/shells.xdot', 45 | // 'text!spec/xdots/directed/states.xdot', 46 | 'text!spec/xdots/directed/structs.xdot', 47 | 'text!spec/xdots/directed/switch.xdot', 48 | 'text!spec/xdots/directed/table.xdot', 49 | 'text!spec/xdots/directed/train11.xdot', 50 | 'text!spec/xdots/directed/trapeziumlr.xdot', 51 | 'text!spec/xdots/directed/tree.xdot', 52 | 'text!spec/xdots/directed/triedds.xdot', 53 | 'text!spec/xdots/directed/try.xdot', 54 | 'text!spec/xdots/directed/unix.xdot', 55 | 'text!spec/xdots/directed/unix2.xdot', 56 | 'text!spec/xdots/directed/viewfile.xdot', 57 | 'text!spec/xdots/directed/world.xdot'], function () { 58 | return [].slice.call(arguments,0,-1); 59 | }); -------------------------------------------------------------------------------- /spec/xdots/directed/Latin1.xdot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mstefaniuk/graph-viz-d3-js/546cc2e419bff3a10cdd981ed90d858a5324a526/spec/xdots/directed/Latin1.xdot -------------------------------------------------------------------------------- /spec/xdots/directed/clust.xdot: -------------------------------------------------------------------------------- 1 | digraph G { 2 | graph [_draw_="c 9 -#fffffe00 C 7 -#ffffff P 4 0 0 0 236 308 236 308 0 ", 3 | bb="0,0,308,236", 4 | xdotversion=1.7 5 | ]; 6 | node [label="\N"]; 7 | subgraph cluster_0 { 8 | graph [_draw_="c 7 -#ff69b4 p 4 158 8 158 154 300 154 300 8 ", 9 | _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 229 138.8 0 64.16 11 -hello world ", 10 | bb="158,8,300,154", 11 | color=hotpink, 12 | label="hello world", 13 | lheight=0.19, 14 | lp="229,143", 15 | lwidth=0.89 16 | ]; 17 | a [_draw_="c 7 -#000000 e 193 106 27 18 ", 18 | _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 193 101.8 0 6.21 1 -a ", 19 | height=0.5, 20 | pos="193,106", 21 | width=0.75]; 22 | b [_draw_="c 7 -#000000 e 193 34 27 18 ", 23 | _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 193 29.8 0 7 1 -b ", 24 | height=0.5, 25 | pos="193,34", 26 | width=0.75]; 27 | a -> b [_draw_="c 7 -#000000 B 4 193 87.7 193 79.98 193 70.71 193 62.11 ", 28 | _hdraw_="S 5 -solid c 7 -#000000 C 7 -#000000 P 3 196.5 62.1 193 52.1 189.5 62.1 ", 29 | pos="e,193,52.104 193,87.697 193,79.983 193,70.712 193,62.112"]; 30 | c [_draw_="c 7 -#000000 e 265 34 27 18 ", 31 | _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 265 29.8 0 6.21 1 -c ", 32 | height=0.5, 33 | pos="265,34", 34 | width=0.75]; 35 | a -> c [_draw_="c 7 -#000000 B 4 207.57 90.83 217.75 80.94 231.52 67.55 243.03 56.36 ", 36 | _hdraw_="S 5 -solid c 7 -#000000 C 7 -#000000 P 3 245.47 58.87 250.2 49.38 240.59 53.85 ", 37 | pos="e,250.2,49.385 207.57,90.834 217.75,80.938 231.52,67.546 243.03,56.359"]; 38 | } 39 | subgraph cluster_1 { 40 | graph [_draw_="S 6 -dashed c 7 -#a020f0 p 4 8 8 8 228 150 228 150 8 ", 41 | _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 79 212.8 0 49.01 5 -MSDOT ", 42 | bb="8,8,150,228", 43 | color=purple, 44 | label=MSDOT, 45 | lheight=0.19, 46 | lp="79,217", 47 | lwidth=0.68, 48 | style=dashed 49 | ]; 50 | x [_draw_="c 7 -#000000 e 79 180 27 18 ", 51 | _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 79 175.8 0 7 1 -x ", 52 | height=0.5, 53 | pos="79,180", 54 | width=0.75]; 55 | y [_draw_="c 7 -#000000 e 115 106 27 18 ", 56 | _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 115 101.8 0 7 1 -y ", 57 | height=0.5, 58 | pos="115,106", 59 | width=0.75]; 60 | x -> y [_draw_="c 7 -#000000 B 4 87.17 162.66 91.63 153.73 97.26 142.47 102.29 132.42 ", 61 | _hdraw_="S 5 -solid c 7 -#000000 C 7 -#000000 P 3 105.52 133.78 106.86 123.27 99.26 130.65 ", 62 | pos="e,106.86,123.27 87.169,162.66 91.634,153.73 97.263,142.47 102.29,132.42"]; 63 | z [_draw_="c 7 -#000000 e 43 34 27 18 ", 64 | _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 43 29.8 0 6.21 1 -z ", 65 | height=0.5, 66 | pos="43,34", 67 | width=0.75]; 68 | x -> z [_draw_="c 7 -#000000 B 4 74.8 162.2 68.65 137.62 57.15 91.59 49.79 62.16 ", 69 | _hdraw_="S 5 -solid c 7 -#000000 C 7 -#000000 P 3 53.11 60.99 47.28 52.14 46.31 62.69 ", 70 | pos="e,47.285,52.14 74.8,162.2 68.655,137.62 57.147,91.588 49.79,62.16"]; 71 | y -> z [_draw_="c 7 -#000000 B 4 100.43 90.83 90.25 80.94 76.48 67.55 64.97 56.36 ", 72 | _hdraw_="S 5 -solid c 7 -#000000 C 7 -#000000 P 3 67.41 53.85 57.8 49.38 62.53 58.87 ", 73 | pos="e,57.796,49.385 100.43,90.834 90.25,80.938 76.476,67.546 64.969,56.359"]; 74 | q [_draw_="c 7 -#000000 e 115 34 27 18 ", 75 | _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 115 29.8 0 7 1 -q ", 76 | height=0.5, 77 | pos="115,34", 78 | width=0.75]; 79 | y -> q [_draw_="c 7 -#000000 B 4 115 87.7 115 79.98 115 70.71 115 62.11 ", 80 | _hdraw_="S 5 -solid c 7 -#000000 C 7 -#000000 P 3 118.5 62.1 115 52.1 111.5 62.1 ", 81 | pos="e,115,52.104 115,87.697 115,79.983 115,70.712 115,62.112"]; 82 | } 83 | y -> b [_draw_="c 7 -#000000 B 4 130.41 91.17 141.73 81.01 157.31 67.03 170.09 55.56 ", 84 | _hdraw_="S 5 -solid c 7 -#000000 C 7 -#000000 P 3 172.52 58.09 177.62 48.8 167.84 52.88 ", 85 | pos="e,177.62,48.801 130.41,91.17 141.73,81.008 157.31,67.03 170.09,55.561"]; 86 | top [_draw_="c 7 -#000000 e 189 180 27 18 ", 87 | _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 189 175.8 0 17.89 3 -top ", 88 | height=0.5, 89 | pos="189,180", 90 | width=0.75]; 91 | top -> a [_draw_="c 7 -#000000 B 4 189.95 161.94 190.4 153.81 190.95 143.88 191.46 134.7 ", 92 | _hdraw_="S 5 -solid c 7 -#000000 C 7 -#000000 P 3 194.97 134.62 192.03 124.44 187.98 134.23 ", 93 | pos="e,192.03,124.44 189.95,161.94 190.4,153.81 190.95,143.88 191.46,134.7"]; 94 | top -> y [_draw_="c 7 -#000000 B 7 170.14 166.87 164.71 163.03 158.92 158.58 154 154 146.47 147 139.06 138.56 132.74 130.78 ", 95 | _hdraw_="S 5 -solid c 7 -#000000 C 7 -#000000 P 3 135.31 128.38 126.37 122.69 129.81 132.71 ", 96 | pos="e,126.37,122.69 170.14,166.87 164.71,163.03 158.92,158.58 154,154 146.47,147 139.06,138.56 132.74,130.78"]; 97 | } 98 | -------------------------------------------------------------------------------- /spec/xdots/directed/clust1.xdot: -------------------------------------------------------------------------------- 1 | digraph G { 2 | graph [_draw_="c 9 -#fffffe00 C 7 -#ffffff P 4 0 0 0 340 204 340 204 0 ", 3 | bb="0,0,204,340", 4 | xdotversion=1.7 5 | ]; 6 | node [label="\N"]; 7 | subgraph cluster_c0 { 8 | graph [_draw_="c 7 -#000000 p 4 8 8 8 276 118 276 118 8 ", 9 | bb="8,8,118,276" 10 | ]; 11 | a0 [_draw_="c 7 -#000000 e 83 250 27 18 ", 12 | _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 83 245.8 0 13.21 2 -a0 ", 13 | height=0.5, 14 | pos="83,250", 15 | width=0.75]; 16 | a1 [_draw_="c 7 -#000000 e 63 178 27 18 ", 17 | _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 63 173.8 0 13.21 2 -a1 ", 18 | height=0.5, 19 | pos="63,178", 20 | width=0.75]; 21 | a0 -> a1 [_draw_="c 7 -#000000 B 4 78.16 232.05 75.9 224.14 73.15 214.54 70.63 205.69 ", 22 | _hdraw_="S 5 -solid c 7 -#000000 C 7 -#000000 P 3 73.91 204.44 67.8 195.79 67.18 206.37 ", 23 | pos="e,67.797,195.79 78.159,232.05 75.898,224.14 73.154,214.54 70.625,205.69"]; 24 | a2 [_draw_="c 7 -#000000 e 43 106 27 18 ", 25 | _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 43 101.8 0 13.21 2 -a2 ", 26 | height=0.5, 27 | pos="43,106", 28 | width=0.75]; 29 | a1 -> a2 [_draw_="c 7 -#000000 B 4 58.16 160.05 55.9 152.14 53.15 142.54 50.63 133.69 ", 30 | _hdraw_="S 5 -solid c 7 -#000000 C 7 -#000000 P 3 53.91 132.44 47.8 123.79 47.18 134.37 ", 31 | pos="e,47.797,123.79 58.159,160.05 55.898,152.14 53.154,142.54 50.625,133.69"]; 32 | a3 [_draw_="c 7 -#000000 e 83 34 27 18 ", 33 | _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 83 29.8 0 13.21 2 -a3 ", 34 | height=0.5, 35 | pos="83,34", 36 | width=0.75]; 37 | a1 -> a3 [_draw_="c 7 -#000000 B 7 69.28 160.07 72.8 149.79 76.9 136.32 79 124 82.49 103.55 83.42 80.09 83.52 62.39 ", 38 | _hdraw_="S 5 -solid c 7 -#000000 C 7 -#000000 P 3 87.02 62.18 83.48 52.2 80.02 62.21 ", 39 | pos="e,83.483,52.196 69.285,160.07 72.805,149.79 76.898,136.32 79,124 82.491,103.55 83.422,80.088 83.517,62.392"]; 40 | a2 -> a3 [_draw_="c 7 -#000000 B 4 52.28 88.76 57.17 80.19 63.29 69.49 68.77 59.9 ", 41 | _hdraw_="S 5 -solid c 7 -#000000 C 7 -#000000 P 3 71.85 61.57 73.77 51.15 65.77 58.09 ", 42 | pos="e,73.773,51.147 52.277,88.765 57.174,80.195 63.289,69.494 68.771,59.9"]; 43 | a3 -> a0 [_draw_="c 7 -#000000 B 7 87.42 51.99 94.47 81.42 106.71 143.76 99 196 97.7 204.79 95.26 214.14 92.66 222.5 ", 44 | _hdraw_="S 5 -solid c 7 -#000000 C 7 -#000000 P 3 89.3 221.51 89.49 232.1 95.95 223.71 ", 45 | pos="e,89.486,232.1 87.42,51.986 94.469,81.419 106.71,143.76 99,196 97.702,204.79 95.256,214.14 92.66,222.5"]; 46 | } 47 | subgraph cluster_c1 { 48 | graph [_draw_="c 7 -#000000 p 4 126 8 126 276 196 276 196 8 ", 49 | bb="126,8,196,276" 50 | ]; 51 | b0 [_draw_="c 7 -#000000 e 161 250 27 18 ", 52 | _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 161 245.8 0 14 2 -b0 ", 53 | height=0.5, 54 | pos="161,250", 55 | width=0.75]; 56 | b1 [_draw_="c 7 -#000000 e 161 178 27 18 ", 57 | _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 161 173.8 0 14 2 -b1 ", 58 | height=0.5, 59 | pos="161,178", 60 | width=0.75]; 61 | b0 -> b1 [_draw_="c 7 -#000000 B 4 161 231.7 161 223.98 161 214.71 161 206.11 ", 62 | _hdraw_="S 5 -solid c 7 -#000000 C 7 -#000000 P 3 164.5 206.1 161 196.1 157.5 206.1 ", 63 | pos="e,161,196.1 161,231.7 161,223.98 161,214.71 161,206.11"]; 64 | b2 [_draw_="c 7 -#000000 e 161 106 27 18 ", 65 | _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 161 101.8 0 14 2 -b2 ", 66 | height=0.5, 67 | pos="161,106", 68 | width=0.75]; 69 | b1 -> b2 [_draw_="c 7 -#000000 B 4 161 159.7 161 151.98 161 142.71 161 134.11 ", 70 | _hdraw_="S 5 -solid c 7 -#000000 C 7 -#000000 P 3 164.5 134.1 161 124.1 157.5 134.1 ", 71 | pos="e,161,124.1 161,159.7 161,151.98 161,142.71 161,134.11"]; 72 | b3 [_draw_="c 7 -#000000 e 161 34 27 18 ", 73 | _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 161 29.8 0 14 2 -b3 ", 74 | height=0.5, 75 | pos="161,34", 76 | width=0.75]; 77 | b2 -> b3 [_draw_="c 7 -#000000 B 4 161 87.7 161 79.98 161 70.71 161 62.11 ", 78 | _hdraw_="S 5 -solid c 7 -#000000 C 7 -#000000 P 3 164.5 62.1 161 52.1 157.5 62.1 ", 79 | pos="e,161,52.104 161,87.697 161,79.983 161,70.712 161,62.112"]; 80 | } 81 | x [_draw_="c 7 -#000000 e 122 322 27 18 ", 82 | _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 122 317.8 0 7 1 -x ", 83 | height=0.5, 84 | pos="122,322", 85 | width=0.75]; 86 | x -> a0 [_draw_="c 7 -#000000 B 4 112.95 304.76 108.18 296.19 102.22 285.49 96.87 275.9 ", 87 | _hdraw_="S 5 -solid c 7 -#000000 C 7 -#000000 P 3 99.92 274.18 92 267.15 93.81 277.59 ", 88 | pos="e,91.996,267.15 112.95,304.76 108.18,296.19 102.22,285.49 96.873,275.9"]; 89 | x -> b0 [_draw_="c 7 -#000000 B 4 131.05 304.76 135.82 296.19 141.78 285.49 147.13 275.9 ", 90 | _hdraw_="S 5 -solid c 7 -#000000 C 7 -#000000 P 3 150.19 277.59 152 267.15 144.08 274.18 ", 91 | pos="e,152,267.15 131.05,304.76 135.82,296.19 141.78,285.49 147.13,275.9"]; 92 | } 93 | -------------------------------------------------------------------------------- /spec/xdots/directed/clust2.xdot: -------------------------------------------------------------------------------- 1 | digraph G { 2 | graph [_draw_="c 9 -#fffffe00 C 7 -#ffffff P 4 0 0 0 412 164 412 164 0 ", 3 | bb="0,0,164,412", 4 | xdotversion=1.7 5 | ]; 6 | node [label="\N"]; 7 | subgraph cluster_c0 { 8 | graph [_draw_="c 7 -#000000 p 4 86 8 86 276 156 276 156 8 ", 9 | bb="86,8,156,276" 10 | ]; 11 | a0 [_draw_="c 7 -#000000 e 121 250 27 18 ", 12 | _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 121 245.8 0 13.21 2 -a0 ", 13 | height=0.5, 14 | pos="121,250", 15 | width=0.75]; 16 | a1 [_draw_="c 7 -#000000 e 121 178 27 18 ", 17 | _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 121 173.8 0 13.21 2 -a1 ", 18 | height=0.5, 19 | pos="121,178", 20 | width=0.75]; 21 | a0 -> a1 [_draw_="c 7 -#000000 B 4 121 231.7 121 223.98 121 214.71 121 206.11 ", 22 | _hdraw_="S 5 -solid c 7 -#000000 C 7 -#000000 P 3 124.5 206.1 121 196.1 117.5 206.1 ", 23 | pos="e,121,196.1 121,231.7 121,223.98 121,214.71 121,206.11"]; 24 | a2 [_draw_="c 7 -#000000 e 121 106 27 18 ", 25 | _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 121 101.8 0 13.21 2 -a2 ", 26 | height=0.5, 27 | pos="121,106", 28 | width=0.75]; 29 | a1 -> a2 [_draw_="c 7 -#000000 B 4 121 159.7 121 151.98 121 142.71 121 134.11 ", 30 | _hdraw_="S 5 -solid c 7 -#000000 C 7 -#000000 P 3 124.5 134.1 121 124.1 117.5 134.1 ", 31 | pos="e,121,124.1 121,159.7 121,151.98 121,142.71 121,134.11"]; 32 | a3 [_draw_="c 7 -#000000 e 121 34 27 18 ", 33 | _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 121 29.8 0 13.21 2 -a3 ", 34 | height=0.5, 35 | pos="121,34", 36 | width=0.75]; 37 | a2 -> a3 [_draw_="c 7 -#000000 B 4 121 87.7 121 79.98 121 70.71 121 62.11 ", 38 | _hdraw_="S 5 -solid c 7 -#000000 C 7 -#000000 P 3 124.5 62.1 121 52.1 117.5 62.1 ", 39 | pos="e,121,52.104 121,87.697 121,79.983 121,70.712 121,62.112"]; 40 | } 41 | subgraph cluster_c1 { 42 | graph [_draw_="c 7 -#000000 p 4 8 80 8 348 78 348 78 80 ", 43 | bb="8,80,78,348" 44 | ]; 45 | b0 [_draw_="c 7 -#000000 e 43 322 27 18 ", 46 | _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 43 317.8 0 14 2 -b0 ", 47 | height=0.5, 48 | pos="43,322", 49 | width=0.75]; 50 | b1 [_draw_="c 7 -#000000 e 43 250 27 18 ", 51 | _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 43 245.8 0 14 2 -b1 ", 52 | height=0.5, 53 | pos="43,250", 54 | width=0.75]; 55 | b0 -> b1 [_draw_="c 7 -#000000 B 4 43 303.7 43 295.98 43 286.71 43 278.11 ", 56 | _hdraw_="S 5 -solid c 7 -#000000 C 7 -#000000 P 3 46.5 278.1 43 268.1 39.5 278.1 ", 57 | pos="e,43,268.1 43,303.7 43,295.98 43,286.71 43,278.11"]; 58 | b2 [_draw_="c 7 -#000000 e 43 178 27 18 ", 59 | _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 43 173.8 0 14 2 -b2 ", 60 | height=0.5, 61 | pos="43,178", 62 | width=0.75]; 63 | b1 -> b2 [_draw_="c 7 -#000000 B 4 43 231.7 43 223.98 43 214.71 43 206.11 ", 64 | _hdraw_="S 5 -solid c 7 -#000000 C 7 -#000000 P 3 46.5 206.1 43 196.1 39.5 206.1 ", 65 | pos="e,43,196.1 43,231.7 43,223.98 43,214.71 43,206.11"]; 66 | b3 [_draw_="c 7 -#000000 e 43 106 27 18 ", 67 | _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 43 101.8 0 14 2 -b3 ", 68 | height=0.5, 69 | pos="43,106", 70 | width=0.75]; 71 | b2 -> b3 [_draw_="c 7 -#000000 B 4 43 159.7 43 151.98 43 142.71 43 134.11 ", 72 | _hdraw_="S 5 -solid c 7 -#000000 C 7 -#000000 P 3 46.5 134.1 43 124.1 39.5 134.1 ", 73 | pos="e,43,124.1 43,159.7 43,151.98 43,142.71 43,134.11"]; 74 | } 75 | a1 -> b3 [_draw_="c 7 -#000000 B 4 109.41 161.46 98.91 150.92 83.43 136.93 69.97 125.77 ", 76 | _hdraw_="S 5 -solid c 7 -#000000 C 7 -#000000 P 3 71.88 122.81 61.91 119.24 67.48 128.25 ", 77 | pos="e,61.911,119.24 109.41,161.46 98.914,150.92 83.433,136.93 69.97,125.77"]; 78 | b3 -> a1 [_draw_="c 7 -#000000 B 4 54.54 122.48 65.04 133.04 80.57 147.08 94.07 158.27 ", 79 | _hdraw_="S 5 -solid c 7 -#000000 C 7 -#000000 P 3 92.17 161.23 102.15 164.81 96.58 155.79 ", 80 | pos="e,102.15,164.81 54.537,122.48 65.043,133.04 80.574,147.08 94.07,158.27"]; 81 | x [_draw_="c 7 -#000000 e 76 394 27 18 ", 82 | _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 76 389.8 0 7 1 -x ", 83 | height=0.5, 84 | pos="76,394", 85 | width=0.75]; 86 | x -> a0 [_draw_="c 7 -#000000 B 4 81.34 376.15 89.05 351.81 103.39 306.57 112.55 277.67 ", 87 | _hdraw_="S 5 -solid c 7 -#000000 C 7 -#000000 P 3 115.98 278.42 115.67 267.82 109.31 276.3 ", 88 | pos="e,115.67,267.82 81.339,376.15 89.052,351.81 103.39,306.57 112.55,277.67"]; 89 | x -> b0 [_draw_="c 7 -#000000 B 4 68.18 376.41 64.28 368.13 59.46 357.92 55.1 348.66 ", 90 | _hdraw_="S 5 -solid c 7 -#000000 C 7 -#000000 P 3 58.19 347.02 50.76 339.47 51.86 350.01 ", 91 | pos="e,50.764,339.47 68.179,376.41 64.275,368.13 59.465,357.92 55.098,348.66"]; 92 | } 93 | -------------------------------------------------------------------------------- /spec/xdots/directed/clust3.xdot: -------------------------------------------------------------------------------- 1 | digraph G { 2 | graph [_draw_="c 9 -#fffffe00 C 7 -#ffffff P 4 0 0 0 340 234 340 234 0 ", 3 | bb="0,0,234,340", 4 | xdotversion=1.7 5 | ]; 6 | node [label="\N"]; 7 | subgraph cluster_c0 { 8 | graph [_draw_="c 7 -#000000 p 4 8 8 8 276 78 276 78 8 ", 9 | bb="8,8,78,276" 10 | ]; 11 | a0 [_draw_="c 7 -#000000 e 43 250 27 18 ", 12 | _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 43 245.8 0 13.21 2 -a0 ", 13 | height=0.5, 14 | pos="43,250", 15 | width=0.75]; 16 | a1 [_draw_="c 7 -#000000 e 43 178 27 18 ", 17 | _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 43 173.8 0 13.21 2 -a1 ", 18 | height=0.5, 19 | pos="43,178", 20 | width=0.75]; 21 | a0 -> a1 [_draw_="c 7 -#000000 B 4 43 231.7 43 223.98 43 214.71 43 206.11 ", 22 | _hdraw_="S 5 -solid c 7 -#000000 C 7 -#000000 P 3 46.5 206.1 43 196.1 39.5 206.1 ", 23 | pos="e,43,196.1 43,231.7 43,223.98 43,214.71 43,206.11"]; 24 | a2 [_draw_="c 7 -#000000 e 43 106 27 18 ", 25 | _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 43 101.8 0 13.21 2 -a2 ", 26 | height=0.5, 27 | pos="43,106", 28 | width=0.75]; 29 | a1 -> a2 [_draw_="c 7 -#000000 B 4 43 159.7 43 151.98 43 142.71 43 134.11 ", 30 | _hdraw_="S 5 -solid c 7 -#000000 C 7 -#000000 P 3 46.5 134.1 43 124.1 39.5 134.1 ", 31 | pos="e,43,124.1 43,159.7 43,151.98 43,142.71 43,134.11"]; 32 | a3 [_draw_="c 7 -#000000 e 43 34 27 18 ", 33 | _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 43 29.8 0 13.21 2 -a3 ", 34 | height=0.5, 35 | pos="43,34", 36 | width=0.75]; 37 | a2 -> a3 [_draw_="c 7 -#000000 B 4 43 87.7 43 79.98 43 70.71 43 62.11 ", 38 | _hdraw_="S 5 -solid c 7 -#000000 C 7 -#000000 P 3 46.5 62.1 43 52.1 39.5 62.1 ", 39 | pos="e,43,52.104 43,87.697 43,79.983 43,70.712 43,62.112"]; 40 | } 41 | subgraph cluster_c1 { 42 | graph [_draw_="c 7 -#000000 p 4 156 8 156 276 226 276 226 8 ", 43 | bb="156,8,226,276" 44 | ]; 45 | b0 [_draw_="c 7 -#000000 e 191 250 27 18 ", 46 | _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 191 245.8 0 14 2 -b0 ", 47 | height=0.5, 48 | pos="191,250", 49 | width=0.75]; 50 | b1 [_draw_="c 7 -#000000 e 191 178 27 18 ", 51 | _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 191 173.8 0 14 2 -b1 ", 52 | height=0.5, 53 | pos="191,178", 54 | width=0.75]; 55 | b0 -> b1 [_draw_="c 7 -#000000 B 4 191 231.7 191 223.98 191 214.71 191 206.11 ", 56 | _hdraw_="S 5 -solid c 7 -#000000 C 7 -#000000 P 3 194.5 206.1 191 196.1 187.5 206.1 ", 57 | pos="e,191,196.1 191,231.7 191,223.98 191,214.71 191,206.11"]; 58 | b2 [_draw_="c 7 -#000000 e 191 106 27 18 ", 59 | _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 191 101.8 0 14 2 -b2 ", 60 | height=0.5, 61 | pos="191,106", 62 | width=0.75]; 63 | b1 -> b2 [_draw_="c 7 -#000000 B 4 191 159.7 191 151.98 191 142.71 191 134.11 ", 64 | _hdraw_="S 5 -solid c 7 -#000000 C 7 -#000000 P 3 194.5 134.1 191 124.1 187.5 134.1 ", 65 | pos="e,191,124.1 191,159.7 191,151.98 191,142.71 191,134.11"]; 66 | b3 [_draw_="c 7 -#000000 e 191 34 27 18 ", 67 | _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 191 29.8 0 14 2 -b3 ", 68 | height=0.5, 69 | pos="191,34", 70 | width=0.75]; 71 | b2 -> b3 [_draw_="c 7 -#000000 B 4 191 87.7 191 79.98 191 70.71 191 62.11 ", 72 | _hdraw_="S 5 -solid c 7 -#000000 C 7 -#000000 P 3 194.5 62.1 191 52.1 187.5 62.1 ", 73 | pos="e,191,52.104 191,87.697 191,79.983 191,70.712 191,62.112"]; 74 | } 75 | a1 -> b3 [_draw_="c 7 -#000000 B 4 57.73 162.87 83.75 137.9 137.98 85.87 168.63 56.46 ", 76 | _hdraw_="S 5 -solid c 7 -#000000 C 7 -#000000 P 3 171.09 58.95 175.89 49.5 166.25 53.9 ", 77 | pos="e,175.89,49.5 57.732,162.87 83.749,137.9 137.98,85.875 168.63,56.461"]; 78 | b1 -> a3 [_draw_="c 7 -#000000 B 4 176.27 162.87 150.25 137.9 96.02 85.87 65.37 56.46 ", 79 | _hdraw_="S 5 -solid c 7 -#000000 C 7 -#000000 P 3 67.75 53.9 58.11 49.5 62.91 58.95 ", 80 | pos="e,58.113,49.5 176.27,162.87 150.25,137.9 96.025,85.875 65.368,56.461"]; 81 | x [_draw_="c 7 -#000000 e 117 322 27 18 ", 82 | _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 117 317.8 0 7 1 -x ", 83 | height=0.5, 84 | pos="117,322", 85 | width=0.75]; 86 | x -> a0 [_draw_="c 7 -#000000 B 4 102.02 306.83 91.49 296.87 77.22 283.37 65.34 272.14 ", 87 | _hdraw_="S 5 -solid c 7 -#000000 C 7 -#000000 P 3 67.62 269.47 57.95 265.14 62.81 274.56 ", 88 | pos="e,57.953,265.14 102.02,306.83 91.493,296.87 77.218,283.37 65.345,272.14"]; 89 | x -> b0 [_draw_="c 7 -#000000 B 4 131.98 306.83 142.51 296.87 156.78 283.37 168.66 272.14 ", 90 | _hdraw_="S 5 -solid c 7 -#000000 C 7 -#000000 P 3 171.19 274.56 176.05 265.14 166.38 269.47 ", 91 | pos="e,176.05,265.14 131.98,306.83 142.51,296.87 156.78,283.37 168.66,272.14"]; 92 | } 93 | -------------------------------------------------------------------------------- /spec/xdots/directed/ctext.xdot: -------------------------------------------------------------------------------- 1 | digraph G { 2 | graph [_draw_="c 9 -#fffffe00 C 7 -#ffffff P 4 0 0 0 229.99 324.24 229.99 324.24 0 ", 3 | bb="0,0,324.24,229.99", 4 | xdotversion=1.7 5 | ]; 6 | node [label="\N", 7 | style=filled 8 | ]; 9 | xyz [_draw_="c 7 -#6a5acd C 7 -#6a5acd E 64.18 187 50.81 42.99 ", 10 | _ldraw_="F 24 15 -Palatino-Italic c 7 -#ff69b4 T 64.18 194.2 0 45.33 5 -hello F 24 15 -Palatino-Italic c 7 -#ff69b4 T 64.18 167.8 0 55.99 \ 11 | 5 -world ", 12 | color=slateblue, 13 | fontcolor=hotpink, 14 | fontname="Palatino-Italic", 15 | fontsize=24, 16 | height=1.1943, 17 | label="hello\nworld", 18 | pos="64.176,187", 19 | width=1.4141]; 20 | red [_draw_="c 7 -#ff0000 C 7 -#ff0000 E 160.18 187 27 18 ", 21 | _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 160.18 182.8 0 17.88 3 -red ", 22 | color=red, 23 | height=0.5, 24 | pos="160.18,187", 25 | width=0.75]; 26 | green [_draw_="c 7 -#00ff00 C 7 -#00ff00 E 120.18 90 29.99 18 ", 27 | _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 120.18 85.8 0 31.09 5 -green ", 28 | color=green, 29 | height=0.5, 30 | pos="120.18,90", 31 | width=0.82626]; 32 | red -> green [_draw_="c 7 -#000000 B 4 153.21 169.45 147.11 154.96 138.14 133.67 131.09 116.93 ", 33 | _hdraw_="S 5 -solid c 7 -#000000 C 7 -#000000 P 3 134.3 115.53 127.2 107.68 127.85 118.25 ", 34 | pos="e,127.2,107.68 153.21,169.45 147.11,154.96 138.14,133.67 131.09,116.93"]; 35 | blue [_draw_="c 7 -#0000ff C 7 -#0000ff E 199.18 90 27 18 ", 36 | _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 199.18 85.8 0 24.1 4 -blue ", 37 | color=blue, 38 | fontcolor=black, 39 | height=0.5, 40 | pos="199.18,90", 41 | width=0.75]; 42 | red -> blue [_draw_="c 7 -#000000 B 4 166.97 169.45 172.86 155.1 181.49 134.07 188.34 117.4 ", 43 | _hdraw_="S 5 -solid c 7 -#000000 C 7 -#000000 P 3 191.77 118.26 192.33 107.68 185.29 115.6 ", 44 | pos="e,192.33,107.68 166.97,169.45 172.86,155.1 181.49,134.07 188.34,117.4"]; 45 | yellow [_draw_="c 7 -#ffff00 C 7 -#ffff00 E 34.18 18 34.35 18 ", 46 | _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 34.18 13.8 0 38.1 6 -yellow ", 47 | color=yellow, 48 | height=0.5, 49 | pos="34.176,18", 50 | width=0.94933]; 51 | green -> yellow [_draw_="c 7 -#000000 B 4 103.19 75.17 90.83 65.11 73.88 51.32 59.87 39.91 ", 52 | _hdraw_="S 5 -solid c 7 -#000000 C 7 -#000000 P 3 61.98 37.12 52.02 33.52 57.57 42.55 ", 53 | pos="e,52.02,33.524 103.19,75.17 90.827,65.112 73.878,51.316 59.871,39.914"]; 54 | orange [_draw_="c 7 -#ffa500 C 7 -#ffa500 E 120.18 18 34.34 18 ", 55 | _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 120.18 13.8 0 38.09 6 -orange ", 56 | color=orange, 57 | height=0.5, 58 | pos="120.18,18", 59 | width=0.94909]; 60 | green -> orange [_draw_="c 7 -#000000 B 4 120.18 71.7 120.18 63.98 120.18 54.71 120.18 46.11 ", 61 | _hdraw_="S 5 -solid c 7 -#000000 C 7 -#000000 P 3 123.68 46.1 120.18 36.1 116.68 46.1 ", 62 | pos="e,120.18,36.104 120.18,71.697 120.18,63.983 120.18,54.712 120.18,46.112"]; 63 | cyan [_draw_="c 7 -#00ffff C 7 -#00ffff E 199.18 18 27 18 ", 64 | _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 199.18 13.8 0 26.43 4 -cyan ", 65 | color=cyan, 66 | height=0.5, 67 | pos="199.18,18", 68 | width=0.75]; 69 | blue -> cyan [_draw_="c 7 -#000000 B 4 199.18 71.7 199.18 63.98 199.18 54.71 199.18 46.11 ", 70 | _hdraw_="S 5 -solid c 7 -#000000 C 7 -#000000 P 3 202.68 46.1 199.18 36.1 195.68 46.1 ", 71 | pos="e,199.18,36.104 199.18,71.697 199.18,63.983 199.18,54.712 199.18,46.112"]; 72 | magenta [_draw_="c 7 -#ff00ff C 7 -#ff00ff E 284.18 18 40.12 18 ", 73 | _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 284.18 13.8 0 47.42 7 -magenta ", 74 | color=magenta, 75 | height=0.5, 76 | pos="284.18,18", 77 | width=1.1128]; 78 | blue -> magenta [_draw_="c 7 -#000000 B 4 215.56 75.5 227.58 65.61 244.15 51.96 257.99 40.56 ", 79 | _hdraw_="S 5 -solid c 7 -#000000 C 7 -#000000 P 3 260.28 43.22 265.77 34.16 255.83 37.81 ", 80 | pos="e,265.77,34.157 215.56,75.503 227.58,65.606 244.15,51.964 257.99,40.564"]; 81 | } 82 | -------------------------------------------------------------------------------- /spec/xdots/directed/japanese.xdot: -------------------------------------------------------------------------------- 1 | digraph G { 2 | graph [_draw_="c 9 -#fffffe00 C 7 -#ffffff P 4 0 0 0 291.73 484.28 291.73 484.28 0 ", 3 | _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 242.14 12.4 0 112 24 -下駄配列の派生図 ", 4 | bb="0,0,484.28,291.73", 5 | label=下駄配列の派生図, 6 | lheight=0.27, 7 | lp="242.14,13.8", 8 | lwidth=1.56, 9 | xdotversion=1.7 10 | ]; 11 | node [label="\N"]; 12 | { 13 | new_getas [_draw_="c 7 -#000000 e 60.81 197.18 60.62 19.53 ", 14 | _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 60.81 195.78 0 70 15 -新下駄配列 ", 15 | height=0.54211, 16 | label=新下駄配列, 17 | pos="60.811,197.18", 18 | width=1.6892]; 19 | getas_in_fine_weather [_draw_="c 7 -#000000 e 132.81 47.12 70.92 19.53 ", 20 | _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 132.81 45.72 0 84 18 -日和下駄配列 ", 21 | height=0.54211, 22 | label=日和下駄配列, 23 | pos="132.81,47.116", 24 | width=1.9642]; 25 | lacquered_getas [_draw_="c 7 -#000000 e 248.81 197.18 70.92 19.53 ", 26 | _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 248.81 195.78 0 84 18 -塗り下駄配列 ", 27 | height=0.54211, 28 | label=塗り下駄配列, 29 | pos="248.81,197.18", 30 | width=1.9642]; 31 | new_JIS_getas [_draw_="c 7 -#000000 e 410.81 197.18 73.43 19.53 ", 32 | _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 410.81 195.78 0 87.9 18 -新JIS下駄配列 ", 33 | height=0.54211, 34 | label=新JIS下駄配列, 35 | pos="410.81,197.18", 36 | width=2.0407]; 37 | } 38 | getas [_draw_="c 7 -#000000 e 198.81 272.21 50.82 19.53 ", 39 | _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 198.81 270.81 0 56 12 -下駄配列 ", 40 | height=0.54211, 41 | label=下駄配列, 42 | pos="198.81,272.21", 43 | width=1.4142]; 44 | getas -> new_getas [_draw_="c 7 -#000000 B 4 169.88 255.9 149.6 245.17 122.24 230.69 100.01 218.92 ", 45 | _hdraw_="S 5 -solid c 7 -#000000 C 7 -#000000 P 3 101.61 215.81 91.14 214.23 98.34 222 ", 46 | pos="e,91.136,214.23 169.88,255.9 149.6,245.17 122.24,230.69 100.01,218.92"]; 47 | getas -> getas_in_fine_weather [_draw_="c 7 -#000000 B 7 187.14 253.18 180.91 242.86 173.56 229.45 168.81 216.7 151.18 169.38 141.15 111.2 136.36 77.03 ", 48 | _hdraw_="S 5 -solid c 7 -#000000 C 7 -#000000 P 3 139.79 76.27 134.99 66.83 132.85 77.2 ", 49 | pos="e,134.99,66.826 187.14,253.18 180.91,242.86 173.56,229.45 168.81,216.7 151.18,169.38 141.15,111.2 136.36,77.03"]; 50 | getas -> lacquered_getas [_draw_="c 7 -#000000 B 4 211.17 253.16 217.02 244.62 224.11 234.26 230.56 224.84 ", 51 | _hdraw_="S 5 -solid c 7 -#000000 C 7 -#000000 P 3 233.49 226.76 236.25 216.53 227.71 222.81 ", 52 | pos="e,236.25,216.53 211.17,253.16 217.02,244.62 224.11,234.26 230.56,224.84"]; 53 | getas -> new_JIS_getas [_draw_="c 7 -#000000 B 4 235.74 258.49 269.5 246.86 319.81 229.53 357.85 216.42 ", 54 | _hdraw_="S 5 -solid c 7 -#000000 C 7 -#000000 P 3 359.42 219.59 367.73 213.02 357.14 212.97 ", 55 | pos="e,367.73,213.02 235.74,258.49 269.5,246.86 319.81,229.53 357.85,216.42"]; 56 | black_lacquered_getas [_draw_="c 7 -#000000 e 293.81 122.15 80.72 19.53 ", 57 | _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 293.81 120.75 0 98 21 -黒塗り下駄配列 ", 58 | height=0.54211, 59 | label=黒塗り下駄配列, 60 | pos="293.81,122.15", 61 | width=2.2392]; 62 | black_lacquered_getas -> getas_in_fine_weather [_draw_="S 6 -dotted c 7 -#000000 B 4 257.28 104.58 233.58 93.83 202.56 79.76 177.42 68.35 ", 63 | _hdraw_="S 5 -solid c 7 -#000000 C 7 -#000000 P 3 178.65 65.06 168.09 64.12 175.75 71.44 ", 64 | pos="e,168.09,64.121 257.28,104.58 233.58,93.829 202.56,79.756 177.42,68.349", 65 | style=dotted]; 66 | black_lacquered_getas_made_of_paulownia [_draw_="c 7 -#000000 e 311.81 47.12 90.52 19.53 ", 67 | _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 311.81 45.72 0 112 24 -黒塗り桐下駄配列 ", 68 | height=0.54211, 69 | label=黒塗り桐下駄配列, 70 | pos="311.81,47.116", 71 | width=2.5142]; 72 | black_lacquered_getas -> black_lacquered_getas_made_of_paulownia [_draw_="c 7 -#000000 B 4 292.46 102.34 293.67 94.44 295.77 85.09 298.25 76.39 ", 73 | _hdraw_="S 5 -solid c 7 -#000000 C 7 -#000000 P 3 301.66 77.2 301.3 66.61 294.98 75.11 ", 74 | pos="e,301.3,66.607 292.46,102.34 293.67,94.443 295.77,85.086 298.25,76.388"]; 75 | black_lacquered_getas_made_of_paulownia -> black_lacquered_getas [_draw_="c 7 -#000000 B 4 313.18 66.79 311.96 74.81 309.82 84.34 307.29 93.17 ", 76 | _hdraw_="S 5 -solid c 7 -#000000 C 7 -#000000 P 3 303.95 92.13 304.31 102.72 310.63 94.22 ", 77 | pos="e,304.31,102.72 313.18,66.793 311.96,74.807 309.82,84.341 307.29,93.17"]; 78 | lacquered_getas -> black_lacquered_getas [_draw_="c 7 -#000000 B 4 260.17 177.75 265.28 169.45 271.43 159.48 277.06 150.34 ", 79 | _hdraw_="S 5 -solid c 7 -#000000 C 7 -#000000 P 3 280.19 151.92 282.46 141.57 274.23 148.25 ", 80 | pos="e,282.46,141.57 260.17,177.75 265.28,169.45 271.43,159.48 277.06,150.34"]; 81 | } 82 | -------------------------------------------------------------------------------- /spec/xdots/directed/longflat.xdot: -------------------------------------------------------------------------------- 1 | digraph if { 2 | graph [_draw_="c 9 -#fffffe00 C 7 -#ffffff P 4 0 0 0 108 145 108 145 0 ", 3 | bb="0,0,145,108", 4 | rankdir=LR, 5 | xdotversion=1.7 6 | ]; 7 | node [label="\N"]; 8 | { 9 | graph [rank=same]; 10 | b [_draw_="c 7 -#000000 e 118 18 27 18 ", 11 | _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 118 13.8 0 7 1 -b ", 12 | height=0.5, 13 | pos="118,18", 14 | width=0.75]; 15 | c [_draw_="c 7 -#000000 e 118 90 27 18 ", 16 | _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 118 85.8 0 6.21 1 -c ", 17 | height=0.5, 18 | pos="118,90", 19 | width=0.75]; 20 | } 21 | c -> b [_draw_="c 7 -#000000 B 4 118 71.59 118 63.94 118 54.89 118 46.43 ", 22 | _hdraw_="S 5 -solid c 7 -#000000 C 7 -#000000 P 3 121.5 46.17 118 36.17 114.5 46.17 ", 23 | _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 108 49.8 0 81.67 14 -long long long ", 24 | label="long long long", 25 | lp="108,54", 26 | pos="e,118,36.169 118,71.587 118,63.941 118,54.892 118,46.427"]; 27 | a [_draw_="c 7 -#000000 e 27 18 27 18 ", 28 | _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 27 13.8 0 6.21 1 -a ", 29 | height=0.5, 30 | pos="27,18", 31 | width=0.75]; 32 | a -> b [_draw_="c 7 -#000000 B 4 54.22 18 62.55 18 71.91 18 80.82 18 ", 33 | _hdraw_="S 5 -solid c 7 -#000000 C 7 -#000000 P 3 80.97 21.5 90.97 18 80.97 14.5 ", 34 | pos="e,90.966,18 54.222,18 62.551,18 71.914,18 80.816,18"]; 35 | } 36 | -------------------------------------------------------------------------------- /spec/xdots/directed/nhg.xdot: -------------------------------------------------------------------------------- 1 | digraph automata_0 { 2 | graph [_draw_="c 9 -#fffffe00 C 7 -#ffffff P 4 0 0 0 216 193.29 216 193.29 0 ", 3 | bb="0,0,193.29,216", 4 | size="8.5, 11", 5 | xdotversion=1.7 6 | ]; 7 | node [label="\N", 8 | shape=circle 9 | ]; 10 | 0 [_draw_="c 7 -#d3d3d3 C 7 -#d3d3d3 E 79 198 18 18 ", 11 | _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 79 193.8 0 7 1 -0 ", 12 | color=lightgrey, 13 | height=0.5, 14 | pos="79,198", 15 | style=filled, 16 | width=0.5]; 17 | 2 [_draw_="c 7 -#000000 e 22 108 18 18 c 7 -#000000 e 22 108 22 22 ", 18 | _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 22 103.8 0 7 1 -2 ", 19 | height=0.61111, 20 | pos="22,108", 21 | shape=doublecircle, 22 | width=0.61111]; 23 | 0 -> 2 [_draw_="c 7 -#000000 B 4 69.59 182.47 61.34 169.74 49.15 150.91 39.17 135.51 ", 24 | _hdraw_="S 5 -solid c 7 -#000000 C 7 -#000000 P 3 41.97 133.39 33.59 126.9 36.09 137.2 ", 25 | _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 60.86 150.8 0 9.71 2 -a ", 26 | label="a ", 27 | lp="60.857,155", 28 | pos="e,33.595,126.9 69.588,182.47 61.341,169.74 49.147,150.91 39.168,135.51"]; 29 | 1 [_draw_="c 7 -#000000 e 77 18 18 18 ", 30 | _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 77 13.8 0 7 1 -1 ", 31 | height=0.5, 32 | pos="77,18", 33 | width=0.5]; 34 | 0 -> 1 [_draw_="c 7 -#000000 B 7 79.49 179.69 80.04 157.85 80.74 119.14 80 86 79.71 72.86 79.09 58.27 78.49 46.07 ", 35 | _hdraw_="S 5 -solid c 7 -#000000 C 7 -#000000 P 3 81.98 45.87 77.98 36.07 74.99 46.23 ", 36 | _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 97.13 103.8 0 32.27 6 -other ", 37 | label="other ", 38 | lp="97.133,108", 39 | pos="e,77.975,36.067 79.492,179.69 80.035,157.85 80.742,119.14 80,86 79.706,72.855 79.087,58.27 78.488,46.074"]; 40 | 2 -> 2 [_draw_="c 7 -#000000 B 7 42.58 116.37 52.84 117.53 62 114.74 62 108 62 103.68 58.24 100.99 52.84 99.91 ", 41 | _hdraw_="S 5 -solid c 7 -#000000 C 7 -#000000 P 3 52.67 96.41 42.58 99.63 52.48 103.4 ", 42 | _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 66.86 103.8 0 9.71 2 -a ", 43 | label="a ", 44 | lp="66.857,108", 45 | pos="e,42.581,99.63 42.581,116.37 52.845,117.53 62,114.74 62,108 62,103.68 58.243,100.99 52.844,99.911"]; 46 | 2 -> 1 [_draw_="c 7 -#000000 B 7 15.7 86.68 13.68 76.28 13.2 63.79 18.73 54 25.54 41.96 38.33 33.61 50.19 28.1 ", 47 | _hdraw_="S 5 -solid c 7 -#000000 C 7 -#000000 P 3 51.9 31.18 59.79 24.11 49.21 24.71 ", 48 | _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 35.13 56.8 0 32.27 6 -other ", 49 | label="other ", 50 | lp="35.133,61", 51 | pos="e,59.788,24.109 15.7,86.684 13.678,76.284 13.196,63.789 18.734,54 25.545,41.965 38.329,33.614 50.192,28.096"]; 52 | 1 -> 2 [_draw_="c 7 -#000000 B 7 71.13 35.02 67.2 44.88 61.56 57.59 55 68 51.67 73.29 47.67 78.62 43.63 83.57 ", 53 | _hdraw_="S 5 -solid c 7 -#000000 C 7 -#000000 P 3 40.71 81.59 36.88 91.47 46.04 86.14 ", 54 | _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 67.86 56.8 0 9.71 2 -a ", 55 | label="a ", 56 | lp="67.857,61", 57 | pos="e,36.883,91.469 71.133,35.021 67.205,44.883 61.561,57.585 55,68 51.669,73.288 47.671,78.621 43.626,83.572"]; 58 | 1 -> 1 [_draw_="c 7 -#000000 B 7 93.66 25.38 103.62 27.02 113 24.56 113 18 113 13.8 109.15 11.28 103.77 10.44 ", 59 | _hdraw_="S 5 -solid c 7 -#000000 C 7 -#000000 P 3 103.6 6.94 93.66 10.62 103.72 13.94 ", 60 | _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 129.13 13.8 0 32.27 6 -other ", 61 | label="other ", 62 | lp="129.13,18", 63 | pos="e,93.664,10.617 93.664,25.383 103.62,27.023 113,24.562 113,18 113,13.796 109.15,11.275 103.77,10.438"]; 64 | "Machine: a" [_ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 154 193.8 0 62.58 10 -Machine: a ", 65 | height=0.5, 66 | pos="154,198", 67 | shape=plaintext, 68 | width=1.0914]; 69 | } 70 | -------------------------------------------------------------------------------- /spec/xdots/directed/record2.xdot: -------------------------------------------------------------------------------- 1 | digraph G { 2 | graph [_draw_="c 9 -#fffffe00 C 7 -#ffffff P 4 0 0 0 151.61 113.71 151.61 113.71 0 ", 3 | bb="0,0,113.71,151.61", 4 | xdotversion=1.7 5 | ]; 6 | node [label="\N", 7 | shape=record 8 | ]; 9 | a [_draw_="c 7 -#000000 p 4 22.17 115.11 22.17 151.11 113.71 151.11 113.71 115.11 c 7 -#000000 L 2 56.83 115.11 56.83 151.11 c 7 -#000000 L \ 10 | 2 79.83 115.11 79.83 151.11 ", 11 | _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 39.5 128.91 0 18.66 3 -foo F 14 11 -Times-Roman c 7 -#000000 T 68.33 128.91 0 7 1 -x F 14 11 \ 12 | -Times-Roman c 7 -#000000 T 96.77 128.91 0 17.88 3 -bar ", 13 | height=0.51389, 14 | label=" foo | x | bar", 15 | pos="67.938,133.11", 16 | rects="22.169,115.11,56.831,151.11 56.831,115.11,79.831,151.11 79.831,115.11,113.71,151.11", 17 | width=1.2714]; 18 | b [_draw_="c 7 -#000000 p 4 0 12.11 0 78.11 79.88 78.11 79.88 12.11 c 7 -#000000 L 2 22.21 12.11 22.21 78.11 c 7 -#000000 L 2 22.21 56.11 56.88 \ 19 | 56.11 c 7 -#000000 L 2 22.21 34.11 56.88 34.11 c 7 -#000000 L 2 56.88 12.11 56.88 78.11 ", 20 | _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 11.11 40.91 0 6.21 1 -a F 14 11 -Times-Roman c 7 -#000000 T 39.54 62.91 0 18.66 3 -foo F 14 \ 21 | 11 -Times-Roman c 7 -#000000 T 39.54 40.91 0 7 1 -x F 14 11 -Times-Roman c 7 -#000000 T 39.54 18.91 0 17.88 3 -bar F 14 11 -Times-Roman \ 22 | c 7 -#000000 T 68.38 40.91 0 7 1 -b ", 23 | height=0.93056, 24 | label="a | { foo | x | bar } | b", 25 | pos="39.938,45.112", 26 | rects="0,12.112,22.214,78.112 22.214,56.112,56.876,78.112 22.214,34.112,56.876,56.112 22.214,12.112,56.876,34.112 56.876,12.112,79.876,\ 27 | 78.112", 28 | width=1.1094]; 29 | a:f0 -> b:f1 [_draw_="c 7 -#000000 B 10 39.94 114.61 39.94 90.72 70.16 100.45 79.88 78.61 91.89 51.61 100.51 33.27 79.88 12.11 70.58 2.58 52.76 -3.2 44.43 \ 30 | 1.99 ", 31 | _hdraw_="S 5 -solid c 7 -#000000 C 7 -#000000 P 3 41.22 0.6 39.94 11.11 47.5 3.69 ", 32 | pos="e,39.938,11.112 39.938,114.61 39.938,90.715 70.162,100.45 79.876,78.612 91.89,51.608 100.51,33.271 79.876,12.112 70.578,2.5785 52.762,\ 33 | -3.2048 44.435,1.9901"]; 34 | } 35 | -------------------------------------------------------------------------------- /spec/xdots/directed/russian.xdot: -------------------------------------------------------------------------------- 1 | digraph G { 2 | graph [_draw_="c 9 -#fffffe00 C 7 -#ffffff P 4 0 0 0 108 1249.14 108 1249.14 0 ", 3 | bb="0,0,1249.1,108", 4 | xdotversion=1.7 5 | ]; 6 | node [label="\N"]; 7 | Контрагенты [_draw_="c 7 -#000000 e 245.28 90 59.9 18 ", 8 | _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 245.28 85.8 0 78.51 22 -Контрагенты ", 9 | height=0.5, 10 | pos="245.28,90", 11 | width=1.6583]; 12 | БанковскиеСчета [_draw_="c 7 -#000000 e 76.28 18 76.06 18 ", 13 | _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 76.28 13.8 0 104.75 30 -БанковскиеСчета ", 14 | height=0.5, 15 | pos="76.277,18", 16 | width=2.1188]; 17 | Контрагенты -> БанковскиеСчета [_draw_="c 7 -#000000 B 4 211.48 75 185.69 64.32 149.91 49.5 121.63 37.78 ", 18 | _hdraw_="S 5 -solid c 7 -#000000 C 7 -#000000 P 3 122.93 34.53 112.35 33.94 120.25 41 ", 19 | pos="e,112.35,33.941 211.48,75.003 185.69,64.321 149.91,49.497 121.63,37.784"]; 20 | ДоговорыВзаиморасчетов [_draw_="c 7 -#000000 e 278.28 18 108.39 18 ", 21 | _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 278.28 13.8 0 155.29 44 -ДоговорыВзаиморасчетов ", 22 | height=0.5, 23 | pos="278.28,18", 24 | width=3.0055]; 25 | Контрагенты -> ДоговорыВзаиморасчетов [_draw_="c 7 -#000000 B 4 253.27 72.05 257.02 64.09 261.58 54.41 265.78 45.51 ", 26 | _hdraw_="S 5 -solid c 7 -#000000 C 7 -#000000 P 3 269.03 46.81 270.13 36.28 262.7 43.83 ", 27 | pos="e,270.13,36.275 253.27,72.055 257.02,64.091 261.58,54.411 265.78,45.51"]; 28 | Организации [_draw_="c 7 -#000000 e 76.28 90 58.15 18 ", 29 | _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 76.28 85.8 0 76.33 22 -Организации ", 30 | height=0.5, 31 | pos="76.277,90", 32 | width=1.6201]; 33 | Организации -> БанковскиеСчета [_draw_="c 7 -#000000 B 4 76.28 71.7 76.28 63.98 76.28 54.71 76.28 46.11 ", 34 | _hdraw_="S 5 -solid c 7 -#000000 C 7 -#000000 P 3 79.78 46.1 76.28 36.1 72.78 46.1 ", 35 | pos="e,76.277,36.104 76.277,71.697 76.277,63.983 76.277,54.712 76.277,46.112"]; 36 | ВопросыДляАнкетирования [_draw_="c 7 -#000000 e 514.28 90 115.97 18 ", 37 | _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 514.28 85.8 0 167.22 46 -ВопросыДляАнкетирования ", 38 | height=0.5, 39 | pos="514.28,90", 40 | width=3.2149]; 41 | ВариантыОтветовОпросов [_draw_="c 7 -#000000 e 514.28 18 110 18 ", 42 | _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 514.28 13.8 0 158.54 44 -ВариантыОтветовОпросов ", 43 | height=0.5, 44 | pos="514.28,18", 45 | width=3.0626]; 46 | ВопросыДляАнкетирования -> ВариантыОтветовОпросов [_draw_="c 7 -#000000 B 4 514.28 71.7 514.28 63.98 514.28 54.71 514.28 46.11 ", 47 | _hdraw_="S 5 -solid c 7 -#000000 C 7 -#000000 P 3 517.78 46.1 514.28 36.1 510.78 46.1 ", 48 | pos="e,514.28,36.104 514.28,71.697 514.28,63.983 514.28,54.712 514.28,46.112"]; 49 | Номенклатура [_draw_="c 7 -#000000 e 758.28 90 64.47 18 ", 50 | _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 758.28 85.8 0 85.69 24 -Номенклатура ", 51 | height=0.5, 52 | pos="758.28,90", 53 | width=1.7843]; 54 | ЕдиницыИзмерения [_draw_="c 7 -#000000 e 805.28 18 84.29 18 ", 55 | _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 805.28 13.8 0 117.21 32 -ЕдиницыИзмерения ", 56 | height=0.5, 57 | pos="805.28,18", 58 | width=2.3374]; 59 | Номенклатура -> ЕдиницыИзмерения [_draw_="c 7 -#000000 B 4 769.65 72.05 775.17 63.84 781.92 53.79 788.05 44.66 ", 60 | _hdraw_="S 5 -solid c 7 -#000000 C 7 -#000000 P 3 791.01 46.53 793.68 36.28 785.2 42.63 ", 61 | pos="e,793.68,36.275 769.65,72.055 775.17,63.837 781.92,53.791 788.05,44.66"]; 62 | НоменклатурныеГруппы [_draw_="c 7 -#000000 e 943.28 90 103.01 18 ", 63 | _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 943.28 85.8 0 147.46 40 -НоменклатурныеГруппы ", 64 | height=0.5, 65 | pos="943.28,90", 66 | width=2.8682]; 67 | НоменклатурныеГруппы -> ЕдиницыИзмерения [_draw_="c 7 -#000000 B 4 911.27 72.76 891.71 62.84 866.52 50.07 845.61 39.46 ", 68 | _hdraw_="S 5 -solid c 7 -#000000 C 7 -#000000 P 3 847.14 36.31 836.63 34.91 843.97 42.55 ", 69 | pos="e,836.63,34.906 911.27,72.765 891.71,62.843 866.52,50.066 845.61,39.457"]; 70 | СвойстваОбектов [_draw_="c 7 -#000000 e 1141.28 90 76.72 18 ", 71 | _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 1141.28 85.8 0 105.28 30 -СвойстваОбектов ", 72 | height=0.5, 73 | pos="1141.3,90", 74 | width=2.1281]; 75 | ЗначенияСвойствОбектов [_draw_="c 7 -#000000 e 1141.28 18 107.73 18 ", 76 | _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 1141.28 13.8 0 154.76 44 -ЗначенияСвойствОбектов ", 77 | height=0.5, 78 | pos="1141.3,18", 79 | width=2.9962]; 80 | СвойстваОбектов -> ЗначенияСвойствОбектов [_draw_="c 7 -#000000 B 4 1141.28 71.7 1141.28 63.98 1141.28 54.71 1141.28 46.11 ", 81 | _hdraw_="S 5 -solid c 7 -#000000 C 7 -#000000 P 3 1144.78 46.1 1141.28 36.1 1137.78 46.1 ", 82 | pos="e,1141.3,36.104 1141.3,71.697 1141.3,63.983 1141.3,54.712 1141.3,46.112"]; 83 | } 84 | -------------------------------------------------------------------------------- /spec/xdots/directed/states.xdot: -------------------------------------------------------------------------------- 1 | digraph states { 2 | graph [_draw_="c 9 -#fffffe00 C 7 -#ffffff P 4 0 0 0 113 484.08 113 484.08 0 ", 3 | bb="0,0,484.08,113", 4 | rankdir=LR, 5 | size="3,2", 6 | xdotversion=1.7 7 | ]; 8 | node [label="\N", 9 | shape=ellipse 10 | ]; 11 | empty [_draw_="c 7 -#000000 e 33.69 18 33.88 18 ", 12 | _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 33.69 13.8 0 37.33 5 -Empty ", 13 | height=0.5, 14 | label=Empty, 15 | pos="33.688,18", 16 | width=0.93578]; 17 | stolen [_draw_="c 7 -#000000 e 182.74 45 32.92 18 ", 18 | _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 182.74 40.8 0 35.78 6 -Stolen ", 19 | height=0.5, 20 | label=Stolen, 21 | pos="182.74,45", 22 | width=0.90855]; 23 | empty -> stolen [_draw_="c 7 -#000000 B 4 65.87 23.73 87.91 27.77 117.63 33.23 141.46 37.6 ", 24 | _hdraw_="S 5 -solid c 7 -#000000 C 7 -#000000 P 3 141.14 41.1 151.6 39.47 142.4 34.22 ", 25 | _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 108.7 37.8 0 46.66 8 -dispatch ", 26 | label=dispatch, 27 | lp="108.7,42", 28 | pos="e,151.6,39.467 65.874,23.726 87.906,27.771 117.63,33.229 141.46,37.604", 29 | wt=28]; 30 | full [_draw_="c 7 -#000000 e 457.08 45 27 18 ", 31 | _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 457.08 40.8 0 22.57 4 -Full ", 32 | height=0.5, 33 | label=Full, 34 | pos="457.08,45", 35 | width=0.75]; 36 | empty -> full [_draw_="c 7 -#000000 B 7 67.37 16.9 103.6 15.94 163.75 15.11 215.45 18 288.61 22.09 373.71 33.13 420.57 39.76 ", 37 | _hdraw_="S 5 -solid c 7 -#000000 C 7 -#000000 P 3 420.12 43.23 430.52 41.18 421.11 36.3 ", 38 | _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 250.16 23.8 0 33.43 6 -return ", 39 | label=return, 40 | lp="250.16,28", 41 | pos="e,430.52,41.18 67.373,16.904 103.6,15.944 163.75,15.109 215.45,18 288.61,22.092 373.71,33.13 420.57,39.757"]; 42 | waiting [_draw_="c 7 -#000000 e 322.76 95 37.78 18 ", 43 | _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 322.76 90.8 0 43.98 7 -Waiting ", 44 | height=0.5, 45 | label=Waiting, 46 | pos="322.76,95", 47 | width=1.0525]; 48 | stolen -> waiting [_draw_="c 7 -#000000 B 4 210.68 54.76 231.14 62.17 259.57 72.47 282.55 80.79 ", 49 | _hdraw_="S 5 -solid c 7 -#000000 C 7 -#000000 P 3 281.43 84.11 292.02 84.23 283.81 77.53 ", 50 | _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 250.16 76.8 0 31.1 5 -touch ", 51 | label=touch, 52 | lp="250.16,81", 53 | pos="e,292.02,84.225 210.68,54.759 231.14,62.17 259.57,72.469 282.55,80.793"]; 54 | stolen -> full [_draw_="c 7 -#000000 B 4 215.51 45 266.42 45 365.98 45 419.68 45 ", 55 | _hdraw_="S 5 -solid c 7 -#000000 C 7 -#000000 P 3 419.78 48.5 429.78 45 419.78 41.5 ", 56 | _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 322.76 47.8 0 33.43 6 -return ", 57 | label=return, 58 | lp="322.76,52", 59 | pos="e,429.78,45 215.51,45 266.42,45 365.98,45 419.68,45"]; 60 | waiting -> full [_draw_="c 7 -#000000 B 4 352.8 84.03 373.78 76.1 402.12 65.39 423.81 57.2 ", 61 | _hdraw_="S 5 -solid c 7 -#000000 C 7 -#000000 P 3 425.14 60.43 433.25 53.63 422.66 53.89 ", 62 | _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 395.37 74.8 0 33.43 6 -return ", 63 | label=return, 64 | lp="395.37,79", 65 | pos="e,433.25,53.626 352.8,84.027 373.78,76.1 402.12,65.39 423.81,57.195"]; 66 | } 67 | -------------------------------------------------------------------------------- /spec/xdots/directed/structs.xdot: -------------------------------------------------------------------------------- 1 | digraph structs { 2 | graph [_draw_="c 9 -#fffffe00 C 7 -#ffffff P 4 0 0 0 140 253.65 140 253.65 0 ", 3 | bb="0,0,253.65,140", 4 | xdotversion=1.7 5 | ]; 6 | node [label="\N", 7 | shape=record 8 | ]; 9 | struct1 [_draw_="c 7 -#000000 p 4 8.62 103.5 8.62 139.5 140.6 139.5 140.6 103.5 c 7 -#000000 L 2 43.27 103.5 43.27 139.5 c 7 -#000000 L 2 98.16 103.5 \ 10 | 98.16 139.5 ", 11 | _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 25.94 117.3 0 18.66 4 -left F 14 11 -Times-Roman c 7 -#000000 T 70.71 117.3 0 38.88 6 -middle \ 12 | F 14 11 -Times-Roman c 7 -#000000 T 119.38 117.3 0 26.44 5 -right ", 13 | height=0.51389, 14 | label=" left| middle| right", 15 | pos="74.607,121.5", 16 | rects="8.6172,103.5,43.272,139.5 43.272,103.5,98.155,139.5 98.155,103.5,140.6,139.5", 17 | width=1.833]; 18 | struct2 [_draw_="c 7 -#000000 p 4 0 15.5 0 51.5 73.21 51.5 73.21 15.5 c 7 -#000000 L 2 36.21 15.5 36.21 51.5 ", 19 | _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 18.11 29.3 0 20.21 3 -one F 14 11 -Times-Roman c 7 -#000000 T 54.71 29.3 0 21 3 -two ", 20 | height=0.51389, 21 | label=" one| two", 22 | pos="36.607,33.5", 23 | rects="0,15.5,36.214,51.5 36.214,15.5,73.214,51.5", 24 | width=1.0169]; 25 | struct1:f1 -> struct2:f0 [_draw_="c 7 -#000000 B 4 70.61 103 70.61 74.4 29.67 82.2 19.75 62.41 ", 26 | _hdraw_="S 5 -solid c 7 -#000000 C 7 -#000000 P 3 23.14 61.53 17.61 52.5 16.3 63.01 ", 27 | pos="e,17.607,52.5 70.607,103 70.607,74.404 29.666,82.198 19.75,62.415"]; 28 | struct3 [_draw_="c 7 -#000000 p 4 91.56 0.5 91.56 66.5 253.65 66.5 253.65 0.5 c 7 -#000000 L 2 140.22 0.5 140.22 66.5 c 7 -#000000 L 2 140.22 44.5 \ 29 | 207.65 44.5 c 7 -#000000 L 2 162.44 22.5 162.44 44.5 c 7 -#000000 L 2 185.44 22.5 185.44 44.5 c 7 -#000000 L 2 140.22 22.5 207.65 \ 30 | 22.5 c 7 -#000000 L 2 207.65 0.5 207.65 66.5 c 7 -#000000 L 2 230.65 0.5 230.65 66.5 ", 31 | _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 115.89 36.3 0 27.99 5 -hello F 14 11 -Times-Roman c 7 -#000000 T 115.89 22.3 0 32.66 5 -world \ 32 | F 14 11 -Times-Roman c 7 -#000000 T 173.94 51.3 0 7 1 -b F 14 11 -Times-Roman c 7 -#000000 T 151.33 29.3 0 6.21 1 -c F 14 11 -Times-Roman \ 33 | c 7 -#000000 T 173.94 29.3 0 7 1 -d F 14 11 -Times-Roman c 7 -#000000 T 196.54 29.3 0 6.21 1 -e F 14 11 -Times-Roman c 7 -#000000 \ 34 | T 173.94 7.3 0 4.66 1 -f F 14 11 -Times-Roman c 7 -#000000 T 219.15 29.3 0 7 1 -g F 14 11 -Times-Roman c 7 -#000000 T 242.15 29.3 \ 35 | 0 7 1 -h ", 36 | height=0.93056, 37 | label="hello\nworld |{ b |{c| d|e}| f}| g | h", 38 | pos="172.61,33.5", 39 | rects="91.562,0.5,140.22,66.5 140.22,44.5,207.65,66.5 140.22,22.5,162.44,44.5 162.44,22.5,185.44,44.5 185.44,22.5,207.65,44.5 140.22,0.5,\ 40 | 207.65,22.5 207.65,0.5,230.65,66.5 230.65,0.5,253.65,66.5", 41 | width=2.2512]; 42 | struct1:f2 -> struct3:here [_draw_="c 7 -#000000 B 4 119.61 103 119.61 91.12 139.54 68.02 155.19 51.72 ", 43 | _hdraw_="S 5 -solid c 7 -#000000 C 7 -#000000 P 3 157.92 53.93 162.42 44.34 152.92 49.03 ", 44 | pos="e,162.42,44.34 119.61,103 119.61,91.116 139.54,68.015 155.19,51.716"]; 45 | } 46 | -------------------------------------------------------------------------------- /spec/xdots/directed/table.xdot: -------------------------------------------------------------------------------- 1 | digraph structs { 2 | graph [_draw_="c 9 -#fffffe00 C 7 -#ffffff P 4 0 0 0 232 417.5 232 417.5 0 ", 3 | bb="0,0,417.5,232", 4 | xdotversion=1.7 5 | ]; 6 | node [label="\N", 7 | shape=plaintext 8 | ]; 9 | struct1 [_ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 152.39 204.8 -1 6.21 1 -a F 14 11 -Times-Roman c 7 -#000000 T 212.5 204.8 -1 7 1 -b F 14 11 \ 10 | -Times-Roman c 7 -#000000 T 241.39 204.8 -1 6.21 1 -c ", 11 | height=0.63889, 12 | label=< 13 | 14 | 15 | 16 | 17 | 18 |
abc
>, 19 | pos="183.5,209", 20 | width=2.3194]; 21 | struct2 [_ldraw_="S 5 -solid c 7 -#000000 p 4 11.5 105 11.5 125 109.5 125 109.5 105 F 14 11 -Times-Roman c 7 -#000000 T 36.41 110.8 -1 48.19 9 -elefantel \ 22 | S 5 -solid c 7 -#000000 p 4 111.5 65 111.5 125 138.5 125 138.5 65 F 14 11 -Times-Roman c 7 -#000000 T 114.5 70.8 -1 21 3 -two S \ 23 | 5 -solid c 7 -#000000 p 4 11.5 25 11.5 103 57.5 103 57.5 25 S 5 -solid c 9 -#fffffe00 C 7 -#c0c0c0 P 4 14.5 28 14.5 100 54.5 100 \ 24 | 54.5 28 S 5 -solid c 7 -#000000 p 4 17.5 76 17.5 97 51.5 97 51.5 76 F 14 11 -Times-Roman c 7 -#000000 T 21.29 82.3 -1 26.43 4 -buca \ 25 | S 5 -solid c 9 -#fffffe00 C 7 -#ffff00 P 4 17.5 53 17.5 74 51.5 74 51.5 53 S 5 -solid c 7 -#000000 p 4 17.5 53 17.5 74 51.5 74 51.5 \ 26 | 53 F 14 11 -Times-Roman c 7 -#000000 T 31.39 59.3 -1 6.21 1 -c S 5 -solid c 7 -#000000 p 4 17.5 31 17.5 51 51.5 51 51.5 31 F 14 \ 27 | 11 -Times-Roman c 7 -#000000 T 32.17 36.8 -1 4.66 1 -f S 5 -solid c 7 -#000000 p 4 14.5 28 14.5 100 54.5 100 54.5 28 S 5 -solid \ 28 | c 7 -#000000 p 4 59.5 65 59.5 103 109.5 103 109.5 65 F 14 11 -Times-Roman c 7 -#000000 T 62.34 79.8 -1 44.32 8 -patratos S 5 -solid \ 29 | c 7 -#000000 p 4 59.5 25 59.5 63 138.5 63 138.5 25 F 14 11 -Times-Roman c 7 -#000000 T 128.5 39.8 -1 7 1 -4 S 5 -solid c 7 -#000000 \ 30 | p 4 8 22 8 128 141 128 141 22 ", 31 | height=1.5833, 32 | label=< 33 | 34 | 35 | 36 | 37 | 46 | 47 | 48 | 49 | 50 |
elefanteltwo
38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 |
buca
c
f
patratos
4
>, 51 | pos="74.5,75", 52 | width=2.0694]; 53 | struct1 -> struct2 [_draw_="c 7 -#000000 B 4 165.26 185.91 154.79 173.23 141.05 156.6 127.45 140.12 ", 54 | _hdraw_="S 5 -solid c 7 -#000000 C 7 -#000000 P 3 129.86 137.54 120.79 132.06 124.46 142 ", 55 | pos="e,120.79,132.06 165.26,185.91 154.79,173.23 141.05,156.6 127.45,140.12"]; 56 | struct3 [_ldraw_="S 5 -solid c 7 -#000000 p 4 178.5 7 178.5 143 221.5 143 221.5 7 F 14 11 -Times-Roman c 7 -#000000 T 184.45 70.8 -1 31.1 5 -Hello \ 57 | S 5 -solid c 7 -#000000 p 4 223.5 35 223.5 143 328.5 143 328.5 35 S 15 -setlinewidth(4) S 5 -solid c 7 -#000000 p 4 237.5 106 237.5 \ 58 | 129 314.5 129 314.5 106 F 14 11 -Times-Roman c 7 -#000000 T 272.5 113.3 -1 7 1 -b S 5 -solid c 7 -#000000 p 4 237.5 77 237.5 100 \ 59 | 253.5 100 253.5 77 F 14 11 -Times-Roman c 7 -#000000 T 242.39 84.3 -1 6.21 1 -a S 5 -solid c 7 -#000000 p 4 259.5 77 259.5 100 292.5 \ 60 | 100 292.5 77 F 14 11 -Times-Roman c 7 -#000000 T 263.56 84.3 -1 24.89 4 -dino S 5 -solid c 7 -#000000 p 4 298.5 77 298.5 100 314.5 \ 61 | 100 314.5 77 F 14 11 -Times-Roman c 7 -#000000 T 303 84.3 -1 7 1 -y S 5 -solid c 7 -#000000 p 4 237.5 49 237.5 71 314.5 71 314.5 \ 62 | 49 F 14 11 -Times-Roman c 7 -#000000 T 261.22 55.8 -1 29.55 5 -rhino S 5 -solid c 7 -#000000 p 4 231.5 43 231.5 135 320.5 135 320.5 \ 63 | 43 S 15 -setlinewidth(1) S 5 -solid c 7 -#000000 p 4 330.5 35 330.5 101 375.5 101 375.5 35 F 14 11 -Times-Roman c 7 -#000000 T 337.06 \ 64 | 63.8 -1 31.88 5 -climb S 5 -solid c 7 -#000000 p 4 377.5 7 377.5 101 406.5 101 406.5 7 F 14 11 -Times-Roman c 7 -#000000 T 383.44 \ 65 | 49.8 -1 17.11 2 -Up S 5 -solid c 7 -#000000 p 4 223.5 7 223.5 33 328.5 33 328.5 7 F 14 11 -Times-Roman c 7 -#000000 T 265.5 15.8 \ 66 | -1 21 3 -low S 5 -solid c 7 -#000000 p 4 175.5 4 175.5 146 409.5 146 409.5 4 ", 67 | height=2.0833, 68 | label=< 69 | 70 | 71 | 82 | 83 | 84 | 85 | 86 | 87 | 88 |
Hello 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 |
b
adinoy
rhino
climbUp
low
>, 89 | pos="292.5,75", 90 | width=3.4722]; 91 | struct1 -> struct3 [_draw_="c 7 -#000000 B 4 201.74 185.91 208.41 177.84 216.4 168.16 224.83 157.94 ", 92 | _hdraw_="S 5 -solid c 7 -#000000 C 7 -#000000 P 3 227.69 159.98 231.36 150.04 222.29 155.53 ", 93 | pos="e,231.36,150.04 201.74,185.91 208.41,177.84 216.4,168.16 224.83,157.94"]; 94 | } 95 | -------------------------------------------------------------------------------- /spec/xdots/directed/try.xdot: -------------------------------------------------------------------------------- 1 | digraph G { 2 | graph [_draw_="c 9 -#fffffe00 C 7 -#ffffff P 4 0 0 0 532 118 532 118 0 ", 3 | bb="0,0,118,532", 4 | xdotversion=1.7 5 | ]; 6 | node [label="\N"]; 7 | subgraph cluster_small { 8 | graph [_draw_="c 7 -#000000 p 4 28 8 28 154 98 154 98 8 ", 9 | _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 63 138.8 0 30.33 5 -small ", 10 | bb="28,8,98,154", 11 | label=small, 12 | lheight=0.19, 13 | lp="63,143", 14 | lwidth=0.42 15 | ]; 16 | a [_draw_="c 7 -#000000 e 63 106 27 18 ", 17 | _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 63 101.8 0 6.21 1 -a ", 18 | height=0.5, 19 | pos="63,106", 20 | width=0.75]; 21 | b [_draw_="c 7 -#000000 e 63 34 27 18 ", 22 | _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 63 29.8 0 7 1 -b ", 23 | height=0.5, 24 | pos="63,34", 25 | width=0.75]; 26 | a -> b [_draw_="c 7 -#000000 B 4 63 87.7 63 79.98 63 70.71 63 62.11 ", 27 | _hdraw_="S 5 -solid c 7 -#000000 C 7 -#000000 P 3 66.5 62.1 63 52.1 59.5 62.1 ", 28 | pos="e,63,52.104 63,87.697 63,79.983 63,70.712 63,62.112"]; 29 | } 30 | subgraph cluster_big { 31 | graph [_draw_="c 7 -#000000 p 4 8 162 8 524 98 524 98 162 ", 32 | _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 53 508.8 0 17.89 3 -big ", 33 | bb="8,162,98,524", 34 | label=big, 35 | lheight=0.19, 36 | lp="53,513", 37 | lwidth=0.25 38 | ]; 39 | p [_draw_="c 7 -#000000 e 53 476 27 18 ", 40 | _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 53 471.8 0 7 1 -p ", 41 | height=0.5, 42 | pos="53,476", 43 | width=0.75]; 44 | q [_draw_="c 7 -#000000 e 63 404 27 18 ", 45 | _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 63 399.8 0 7 1 -q ", 46 | height=0.5, 47 | pos="63,404", 48 | width=0.75]; 49 | p -> q [_draw_="c 7 -#000000 B 4 55.42 458.05 56.52 450.35 57.85 441.03 59.09 432.36 ", 50 | _hdraw_="S 5 -solid c 7 -#000000 C 7 -#000000 P 3 62.58 432.67 60.53 422.28 55.65 431.68 ", 51 | pos="e,60.532,422.28 55.421,458.05 56.522,450.35 57.853,441.03 59.091,432.36"]; 52 | r [_draw_="c 7 -#000000 e 63 332 27 18 ", 53 | _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 63 327.8 0 4.66 1 -r ", 54 | height=0.5, 55 | pos="63,332", 56 | width=0.75]; 57 | q -> r [_draw_="c 7 -#000000 B 4 63 385.7 63 377.98 63 368.71 63 360.11 ", 58 | _hdraw_="S 5 -solid c 7 -#000000 C 7 -#000000 P 3 66.5 360.1 63 350.1 59.5 360.1 ", 59 | pos="e,63,350.1 63,385.7 63,377.98 63,368.71 63,360.11"]; 60 | s [_draw_="c 7 -#000000 e 63 260 27 18 ", 61 | _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 63 255.8 0 5.45 1 -s ", 62 | height=0.5, 63 | pos="63,260", 64 | width=0.75]; 65 | r -> s [_draw_="c 7 -#000000 B 4 63 313.7 63 305.98 63 296.71 63 288.11 ", 66 | _hdraw_="S 5 -solid c 7 -#000000 C 7 -#000000 P 3 66.5 288.1 63 278.1 59.5 288.1 ", 67 | pos="e,63,278.1 63,313.7 63,305.98 63,296.71 63,288.11"]; 68 | t [_draw_="c 7 -#000000 e 63 188 27 18 ", 69 | _ldraw_="F 14 11 -Times-Roman c 7 -#000000 T 63 183.8 0 3.89 1 -t ", 70 | height=0.5, 71 | pos="63,188", 72 | width=0.75]; 73 | s -> t [_draw_="c 7 -#000000 B 4 63 241.7 63 233.98 63 224.71 63 216.11 ", 74 | _hdraw_="S 5 -solid c 7 -#000000 C 7 -#000000 P 3 66.5 216.1 63 206.1 59.5 216.1 ", 75 | pos="e,63,206.1 63,241.7 63,233.98 63,224.71 63,216.11"]; 76 | t -> p [_draw_="c 7 -#000000 B 10 49.25 203.93 41.04 213.9 31.38 227.75 27 242 3.49 318.47 8.91 344.07 27 422 29.22 431.57 33.43 441.41 37.82 449.98 ", 77 | _hdraw_="S 5 -solid c 7 -#000000 C 7 -#000000 P 3 34.89 451.92 42.76 459.02 41.04 448.56 ", 78 | pos="e,42.762,459.02 49.25,203.93 41.039,213.9 31.381,227.75 27,242 3.486,318.47 8.9148,344.07 27,422 29.222,431.57 33.428,441.41 37.82,\ 79 | 449.98"]; 80 | } 81 | b -> q [_draw_="c 7 -#000000 B 16 75.84 50.26 83.69 60.36 93.29 74.23 99 88 116.16 129.39 118 142.2 118 187 118 261 118 261 118 261 118 301.45 114.88 \ 82 | 312.8 99 350 94.61 360.28 88.12 370.66 81.85 379.47 ", 83 | _hdraw_="S 5 -solid c 7 -#000000 C 7 -#000000 P 3 78.89 377.59 75.75 387.7 84.52 381.76 ", 84 | pos="e,75.748,387.7 75.845,50.257 83.694,60.356 93.29,74.232 99,88 116.16,129.39 118,142.2 118,187 118,261 118,261 118,261 118,301.45 \ 85 | 114.88,312.8 99,350 94.611,360.28 88.12,370.66 81.853,379.47"]; 86 | t -> a [_draw_="c 7 -#000000 B 4 63 169.64 63 159.3 63 145.94 63 134.22 ", 87 | _hdraw_="S 5 -solid c 7 -#000000 C 7 -#000000 P 3 66.5 134.05 63 124.05 59.5 134.05 ", 88 | pos="e,63,124.05 63,169.64 63,159.3 63,145.94 63,134.22"]; 89 | } 90 | -------------------------------------------------------------------------------- /src/grammar/xdot.pegjs: -------------------------------------------------------------------------------- 1 | { 2 | function lengthInUtf8Bytes(str) { 3 | var c = str.charCodeAt(0); 4 | if (c < 128) { 5 | return 1; 6 | } else if (c < 2048) { 7 | return 2; 8 | } else { 9 | return 3; 10 | } 11 | } 12 | 13 | var counter; 14 | } 15 | 16 | dot = prolog? ("strict" _)? t:("digraph" / "graph") i:(_ identifier)? _ b:body {return {type:"digraph", id: i==null ? null : i[1], commands:b}} 17 | prolog = ("#" [^\n]* CR)+ CR 18 | body = "{" c:statement+ "}" WS* {return c} 19 | statement= WS* cc:(skip /graph / node / relation / subgraph / struct) {return cc} 20 | skip = n:"node" a:attributes ";" WS+ {return {type:"skip", attributes:a}} 21 | struct = b:body {return {type:"struct", commands:b}} 22 | graph = n:"graph" a:attributes ";" WS+ {return {type:n, attributes:a}} 23 | subgraph = t:"subgraph" _ i:identifier _ b:body {return {type:t, id:i, commands:b}} 24 | relation = f:identifier _ r:("->" / "--") _ t:identifier a:attributes? ";" WS+ 25 | {return {type:"relation", id: [f,t].join(r), from:f, to:t, attributes:a}} 26 | node = i:identifier a:attributes? ";" WS+ {return {type:"node",id:i,attributes:a}} 27 | 28 | attributes = _+ "[" a:attribute aa:("," WS+ a:attribute {return a})* _* "]" {return aa!=null ? [a].concat(aa) : [a];} 29 | attribute = 30 | draw 31 | / size 32 | / image 33 | / URL 34 | / tooltip 35 | / id 36 | / a:(anyattribute) {a.type="skip"; return a} 37 | 38 | image = "image" "=" q url:nq q {return {type: 'image', value: url.join('')}} 39 | URL = "URL" "=" q url:nq q {return {type: 'url', value: url.join('')}} 40 | tooltip = "tooltip" "=" q tt:nq q {return {type: 'tooltip', value: tt.join('')}} 41 | size = "size" "=" q w:decimal "," h:decimal q {return {type: "size", value: [w,h]}} 42 | id = "id" "=" id:identifier {return {type: 'id', value: id}} 43 | anyattribute = nn:identifier "=" nqs {return {name: nn}} 44 | 45 | draw = "_" s:("draw" / "ldraw" / "hdraw" / "tdraw" / "hldraw" / "tldraw") "_=" q d:drawing+ q {return {type: s, elements: d}} 46 | drawing = st:styling? _ sh:shapes _ {sh.style = st; return sh} 47 | styling = s:styles ss:(_ s:styles {return s})* 48 | {return [].concat(s).concat(ss);} 49 | styles = pen / font / style / fontdecoration 50 | shapes = polygon / polyline / ellipse / bspline / text 51 | 52 | ellipse = [eE] c:coordinates _ rx:decimal _ ry:decimal {return {shape: 'ellipse', cx: c[0], cy:c[1], rx:rx, ry:ry}} 53 | polygon = p:[pP] _ l:integer c:coordinates+ {return {shape: 'polygon', points:c}} 54 | polyline = [L] _ integer c:coordinates+ {return {shape: 'polyline', points:c}} 55 | bspline = [bB] _ integer c:coordinates+ {return {shape: 'bspline', points: c}} 56 | text = [T] c:coordinates _ a:integer _ decimal _ t:vardata { 57 | return { 58 | x: c[0], 59 | y: c[1], 60 | text: t, 61 | anchor: a==0 ? "middle" : (a<0 ? "start" : "end") 62 | }} 63 | pen = p:[Cc] _ c:vardata {return p=='C' ? {key: "fill", value: c} : {key: "stroke", value: c}} 64 | font = f:[F] _ s:decimal _ t:vardata {return [{key:'font-family', value: "'" + t + "',serif"}, {key:'font-size', value: s}]} 65 | fontdecoration = [t] _ v:integer {return {key:"text-decoration", value: v}} 66 | style = [S] _ s:vardata {return {key:'style', value: s}} 67 | 68 | vardata = s:varsize _ "-" v:varchar {return v} 69 | varsize = s:integer {counter=s; c0=""} 70 | varchar = &{return counter==0} / a:anysign s:varchar {return a + (s||'')} 71 | anysign = LC? c:. { 72 | c2=""; 73 | if (c != "\\" || c0 == "\\") { 74 | counter -= lengthInUtf8Bytes(c); 75 | if (c0 == "\\" && c != "\\" && c != '"') { 76 | counter -=1; 77 | c2=c0; 78 | } 79 | c2 += c; 80 | } 81 | c0=c; 82 | return c2; 83 | } 84 | 85 | coordinates = _ p1:decimal _ p2:decimal {return [p1,p2]} 86 | identifier = s:$CHAR+ port? {return s} / '"' s:$nq '"' port? {return s} 87 | port = ':' identifier 88 | integer = s:"-"? i:$[0-9]+ {return parseInt((s||'') + i)} 89 | decimal = s:"-"? f:$[0-9]+ r:("." d:$[0-9]+ {return "." + d})? {return parseFloat((s||'') + f + (r||''))} 90 | 91 | ncs = [^,\]]+ 92 | nqs = '"' nq '"' / "<" ts ">" / ncs 93 | nq = ('\\"' / [^"])* 94 | ts = ([^<>]+ / "<" [^<>]* ">")* 95 | c = [,] 96 | q = '"' 97 | 98 | CHAR = [a-zA-Z0-9_\.\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD] 99 | CR = [\n\r] 100 | WS = [\n\t\r ] 101 | _ = WS LC? / LC? WS 102 | LC = [\\] CR+ -------------------------------------------------------------------------------- /src/js/dot-checker.js: -------------------------------------------------------------------------------- 1 | define(['parser/dot'], function (dot) { 2 | return { 3 | lint: function (source) { 4 | var result; 5 | try { 6 | result = dot.parse(source, { 7 | pegace: { 8 | mode: 'lint' 9 | } 10 | }); 11 | } catch (e) { 12 | result = { 13 | clean: false, 14 | level: "fatal", 15 | exception: e, 16 | errors: [{ 17 | pos: e.offset, 18 | type: "syntax", 19 | string: e.found 20 | }] 21 | }; 22 | } 23 | return result; 24 | }, 25 | parse: function (source) { 26 | return dot.parse(source, { 27 | pegace: { 28 | mode: 'strict' 29 | } 30 | }); 31 | } 32 | }; 33 | }); -------------------------------------------------------------------------------- /src/js/editor/mode/pegjs.js: -------------------------------------------------------------------------------- 1 | define( 'ace/mode/pegjs', [ 2 | 3 | 'ace/lib/oop', 4 | 'ace/mode/text_highlight_rules', 5 | 'ace/mode/javascript_highlight_rules' 6 | 7 | ], function ( oop, textHighlightRules, javascriptHighlightRules ) { 8 | 9 | 'use strict'; 10 | 11 | var TextHighlightRules = textHighlightRules.TextHighlightRules; 12 | var JavaScriptHighlightRules = javascriptHighlightRules.JavaScriptHighlightRules; 13 | 14 | var pegjsHighlightRules = function ( ) { 15 | 16 | this.$rules = { 17 | 18 | 'start' : [ { 19 | token : 'constant.language', 20 | regex : '[a-z][a-zA-Z]+' 21 | }, { 22 | token : 'keyword.operator', 23 | regex : '[=/]', 24 | next : 'peg-rule' 25 | } ], 26 | 27 | 'peg-rule' : [ { 28 | token : 'string', 29 | regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' 30 | }, { 31 | token : 'string', 32 | regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" 33 | }, { 34 | token : 'keyword.operator', 35 | regex : '^\\S*(?=[=/{(]|$)', 36 | next : 'wait' 37 | }, { 38 | token : 'variable', 39 | regex : '[a-z][a-zA-Z]+:' 40 | }, { 41 | token : 'identifier', 42 | regex : '[a-z][a-zA-Z]+' 43 | }, { 44 | token : 'string', 45 | regex : '\\[(?:(?:\\\\.)|(?:[^\\]\\\\]))*?\\]' 46 | }, { 47 | token : 'keyword.operator', 48 | regex : '[+?*()/]' 49 | }, { 50 | token : 'keyword.operator', 51 | regex : '{', 52 | next : 'js-start' 53 | } ] 54 | 55 | }; 56 | 57 | for ( var i in this.$rules ) { 58 | this.$rules[ i ].unshift( { 59 | token : 'comment', 60 | regex : '/\\*', 61 | next : 'comment' 62 | } ); 63 | } 64 | 65 | this.$rules.comment = [ { 66 | token : 'comment', 67 | regex : '\\*/', 68 | next : 'start' 69 | }, { 70 | token : 'comment', 71 | regex : '.' 72 | } ]; 73 | 74 | this.embedRules( JavaScriptHighlightRules, 'js-', [ 75 | { token : 'keyword', regex : '}', next : 'start' } 76 | ] ); 77 | 78 | }; 79 | 80 | oop.inherits( pegjsHighlightRules, TextHighlightRules ); 81 | return { pegjsHighlightRules : pegjsHighlightRules }; 82 | 83 | } ); -------------------------------------------------------------------------------- /src/js/fonts.js: -------------------------------------------------------------------------------- 1 | define({ 2 | "Symbol": { 3 | "font-family": "Symbol,fantasy" 4 | }, 5 | "ZapfDingbats": { 6 | "font-family": "Dingbats,fantasy" 7 | }, 8 | "ZapfChancery-MediumItalic": { 9 | "font-family": "URW Chancery L,serif", 10 | "font-style": "italic", 11 | "font-weight": "medium" 12 | }, 13 | "Times-Roman": { 14 | "font-family": "Times,serif" 15 | }, 16 | "Times-Bold": { 17 | "font-family": "Times,serif", 18 | "font-weight": "bold" 19 | }, 20 | "Times-Italic": { 21 | "font-family": "Times,serif", 22 | "font-style": "italic" 23 | }, 24 | "Times-BoldItalic": { 25 | "font-family": "Times,serif", 26 | "font-style": "italic", 27 | "font-weight": "bold" 28 | }, 29 | "Palatino-Roman": { 30 | "font-family": "Palatino Linotype,serif" 31 | }, 32 | "Palatino-Bold": { 33 | "font-family": "Palatino Linotype,serif", 34 | "font-weight": "bold" 35 | }, 36 | "Palatino-Italic": { 37 | "font-family": "Palatino Linotype,serif", 38 | "font-style": "italic" 39 | }, 40 | "Palatino-BoldItalic": { 41 | "font-family": "Palatino Linotype,serif", 42 | "font-style": "italic", 43 | "font-weight": "bold" 44 | }, 45 | "NewCenturySchlbk-Roman": { 46 | "font-family": "Century Schoolbook L,serif", 47 | "font-weight": "roman" 48 | }, 49 | "NewCenturySchlbk-Bold": { 50 | "font-family": "Century Schoolbook L,serif", 51 | "font-weight": "bold" 52 | }, 53 | "NewCenturySchlbk-Italic": { 54 | "font-family": "Century Schoolbook L,serif", 55 | "font-style": "italic" 56 | }, 57 | "NewCenturySchlbk-BoldItalic": { 58 | "font-family": "Century Schoolbook L,serif", 59 | "font-weight": "bold", 60 | "font-style": "italic" 61 | }, 62 | "Helvetica-Narrow": { 63 | "font-family": "Helvetica,sans-serif", 64 | "font-stretch": "condensed" 65 | }, 66 | "Helvetica-Narrow-Bold": { 67 | "font-family": "Helvetica,sans-serif", 68 | "font-stretch": "condensed", 69 | "font-weight": "bold" 70 | }, 71 | "Helvetica-Narrow-Oblique": { 72 | "font-family": "Helvetica,sans-serif", 73 | "font-stretch": "condensed", 74 | "font-style": "oblique" 75 | }, 76 | "Helvetica-Narrow-BoldOblique": { 77 | "font-family": "Helvetica,sans-serif", 78 | "font-stretch": "condensed", 79 | "font-weight": "bold", 80 | "font-style": "oblique" 81 | }, 82 | "Helvetica": { 83 | "font-family": "Helvetica,sans-serif" 84 | }, 85 | "Helvetica-Bold": { 86 | "font-family": "Helvetica,sans-serif", 87 | "font-weight": "bold" 88 | }, 89 | "Helvetica-Oblique": { 90 | "font-family": "Helvetica,sans-serif", 91 | "font-style": "oblique" 92 | }, 93 | "Helvetica-BoldOblique": { 94 | "font-family": "Helvetica,sans-serif", 95 | "font-weight": "bold", 96 | "font-style": "oblique" 97 | }, 98 | "Courier": { 99 | "font-family": "Courier,monospace" 100 | }, 101 | "Courier-Bold": { 102 | "font-family": "Courier,monospace", 103 | "font-weight": "bold" 104 | }, 105 | "Courier-Oblique": { 106 | "font-family": "Courier,monospace", 107 | "font-style": "oblique" 108 | }, 109 | "Courier-BoldOblique": { 110 | "font-family": "Courier,monospace", 111 | "font-weight": "bold", 112 | "font-style": "oblique" 113 | }, 114 | "Bookman-Light": { 115 | "font-family": "URW Bookman L,serif", 116 | "font-weight": "light" 117 | }, 118 | "Bookman-Demi": { 119 | "font-family": "URW Bookman L,serif", 120 | "font-weight": "demi" 121 | }, 122 | "Bookman-LightItalic": { 123 | "font-family": "URW Bookman L,serif", 124 | "font-weight": "light", 125 | "font-style": "italic" 126 | }, 127 | "Bookman-DemiItalic": { 128 | "font-family": "URW Bookman L,serif", 129 | "font-weight": "demi", 130 | "font-style": "italic" 131 | }, 132 | "AvantGarde-Book": { 133 | "font-family": "URW Gothic L,sans-serif", 134 | "font-weight": "book" 135 | }, 136 | "AvantGarde-Demi": { 137 | "font-family": "URW Gothic L,sans-serif", 138 | "font-weight": "demi" 139 | }, 140 | "AvantGarde-BookOblique": { 141 | "font-family": "URW Gothic L,sans-serif", 142 | "font-weight": "book", 143 | "font-style": "oblique" 144 | }, 145 | "AvantGarde-DemiOblique": { 146 | "font-family": "URW Gothic L,sans-serif", 147 | "font-weight": "demi", 148 | "font-style": "oblique" 149 | } 150 | }); -------------------------------------------------------------------------------- /src/js/layout-worker.js: -------------------------------------------------------------------------------- 1 | importScripts('../../lib/requirejs/require.js'); 2 | importScripts('../main.js'); 3 | 4 | require({ 5 | baseUrl: "." 6 | }, 7 | ["transformer"], 8 | function(transformer) { 9 | 10 | onmessage = function(event) { 11 | try { 12 | var result = transformer.generate(event.data); 13 | postMessage({ 14 | type: "stage", 15 | body: result 16 | }); 17 | } catch (e) { 18 | postMessage({ 19 | type: "error", 20 | body: e 21 | }); 22 | } 23 | }; 24 | 25 | postMessage({ 26 | type: "ready" 27 | }); 28 | } 29 | ); -------------------------------------------------------------------------------- /src/js/palette.js: -------------------------------------------------------------------------------- 1 | define(function () { 2 | function path(points, command, close) { 3 | return [ 4 | "M", 5 | [points[0][0], -points[0][1]].join(','), 6 | command, 7 | points.slice(1, points.length) 8 | .map(function (e) { 9 | return [e[0], -e[1]].join(","); 10 | }), close===true ? "Z" : "" 11 | ].join(" ").trim(); 12 | } 13 | 14 | return { 15 | polygon: function (d) { 16 | return path(d.points, "L", true); 17 | }, 18 | ellipse: function (d) { 19 | return [ 20 | 'M', [d.cx, -d.cy].join(','), 21 | 'm', [-d.rx, 0].join(','), 22 | 'a', [d.rx, d.ry].join(','), 23 | 0, "1,0", [2 * d.rx, 0].join(','), 24 | 'a', [d.rx, d.ry].join(','), 25 | 0, "1,0", [-2 * d.rx, 0].join(',')].join(' '); 26 | }, 27 | circle: function (d) { 28 | return this.ellipse({ 29 | cx: d.cx, 30 | cy: -d.cy, 31 | rx: d.r, 32 | ry: d.r 33 | }); 34 | }, 35 | rect: function (d) { 36 | return this.polygon({ 37 | points: [ 38 | [d.x, -d.y], 39 | [d.x + d.width, -d.y], 40 | [d.x + d.width, -d.y + d.height], 41 | [d.x, -d.y + d.height] 42 | ] 43 | }); 44 | }, 45 | path: function (d) { 46 | return path(d.points, "C"); 47 | }, 48 | bspline: function (d) { 49 | return path(d.points, "C"); 50 | }, 51 | polyline: function (d) { 52 | return path(d.points, "L"); 53 | } 54 | }; 55 | }); -------------------------------------------------------------------------------- /src/js/pegast.js: -------------------------------------------------------------------------------- 1 | define([], function () { 2 | return { 3 | nodeVisitor: function (functions) { 4 | return function (node) { 5 | return functions[node.type]!==undefined ? functions[node.type].apply(null, arguments) : function () {}; 6 | }; 7 | } 8 | }; 9 | }); -------------------------------------------------------------------------------- /src/js/renderer.js: -------------------------------------------------------------------------------- 1 | define(["stage", "worker!layout-worker.js"], function(stage, worker) { 2 | 3 | var initialized = false, pending, errorCallback, renderCallback; 4 | 5 | worker.onmessage = function (event) { 6 | switch (event.data.type) { 7 | case "ready": 8 | initialized = true; 9 | if (pending) { 10 | worker.postMessage(pending); 11 | } 12 | break; 13 | case "stage": 14 | stage.draw(event.data.body); 15 | renderCallback && renderCallback(); 16 | break; 17 | case "error": 18 | if (errorCallback) { 19 | errorCallback(event.data.body); 20 | } 21 | } 22 | }; 23 | 24 | return { 25 | init: function(element) { 26 | return stage.init(element); 27 | }, 28 | render: function(source) { 29 | if (initialized) { 30 | worker.postMessage(source); 31 | } else { 32 | pending = source; 33 | } 34 | }, 35 | stage: stage, 36 | errorHandler: function(handler) { 37 | errorCallback = handler; 38 | }, 39 | renderHandler: function(handler) { 40 | renderCallback = handler; 41 | } 42 | }; 43 | 44 | }); -------------------------------------------------------------------------------- /src/js/styliseur.js: -------------------------------------------------------------------------------- 1 | define(["d3"], function(d3) { 2 | var styliseur = function (selection) { 3 | selection.each(function (d) { 4 | var self = d3.select(this); 5 | var fillInsteadOfStroke = this instanceof SVGTextElement || false; 6 | d && d.style && d.style.forEach(function (e) { 7 | switch (e.key) { 8 | case "stroke": 9 | case "fill": 10 | var attribute = e.key==="stroke" && fillInsteadOfStroke ? "fill" : e.key; 11 | var transparent = e.value.indexOf("#")===0 && e.value.length === 9; 12 | var color = transparent ? e.value.substr(0,7) : e.value; 13 | var opacity = transparent ? parseInt(e.value.substr(7,2),16)/255 : 1; 14 | self.attr(attribute, color); 15 | opacity < 1 && self.attr(attribute + "-opacity", opacity); 16 | break; 17 | case "font-size": 18 | case "font-family": 19 | self.attr(e.key, e.value); 20 | break; 21 | case "style": 22 | if (e.value.indexOf('setline') === 0) { 23 | self.attr('stroke-width', 2); 24 | } else { 25 | self.attr('class', e.value); 26 | } 27 | } 28 | }); 29 | }); 30 | }; 31 | 32 | return styliseur; 33 | }); -------------------------------------------------------------------------------- /src/js/transformer.js: -------------------------------------------------------------------------------- 1 | define(['viz', 'parser/xdot', 'pegast'], function (viz, xdotparser, pegast) { 2 | return { 3 | generate: function (source) { 4 | var xdot, result; 5 | 6 | xdot = viz(source, { format: "xdot" }); 7 | 8 | try { 9 | var ast = xdotparser.parse(xdot); 10 | result = this.shapeast(ast); 11 | } catch(e) { 12 | throw "Parsing of xdot output failed"; 13 | } 14 | return result; 15 | }, 16 | shapeast: function(ast) { 17 | var result = []; 18 | var cursor; 19 | 20 | function visitSubnodes(propertyName) { 21 | return function (node) { 22 | node[propertyName] && node[propertyName].forEach(visit); 23 | }; 24 | } 25 | 26 | function startGroup(propertyName) { 27 | return function (node) { 28 | var groupById = result.filter(function(e) { 29 | return e.id === node.id; 30 | }); 31 | cursor = 32 | groupById.length > 0 ? 33 | groupById[0] : {id: node.id, class: node.type, shapes: [], labels: []}; 34 | groupById.length === 0 && result.push(cursor); 35 | node[propertyName] && node[propertyName].forEach(visit); 36 | }; 37 | } 38 | 39 | function addShapesAndLabels(node) { 40 | cursor.shapes = cursor.shapes.concat(node.elements.filter(function(e){ 41 | return e.shape; 42 | })).map(fixShapeStyles); 43 | cursor.labels = cursor.labels.concat(node.elements.filter(function(e){ 44 | return e.text; 45 | })); 46 | } 47 | 48 | function fixShapeStyles(element) { 49 | if (element.style) { 50 | var keys = element.style.map(function(e) {return e.key}); 51 | keys.indexOf("fill") < 0 && element.style.push({key: 'fill', value: "none"}); 52 | keys.indexOf("stroke") < 0 && element.style.push({key: 'stroke', value: "black"}); 53 | } 54 | return element; 55 | } 56 | 57 | function addNodeAttribute(name) { 58 | return function(node) { 59 | cursor[name] = node.value; 60 | }; 61 | } 62 | 63 | var visit = pegast.nodeVisitor({ 64 | digraph: startGroup('commands'), 65 | graph: visitSubnodes('attributes'), 66 | subgraph: startGroup('commands'), 67 | struct: visitSubnodes('commands'), 68 | node: startGroup('attributes'), 69 | relation: startGroup('attributes'), 70 | draw: addShapesAndLabels, 71 | hdraw: addShapesAndLabels, 72 | tdraw: addShapesAndLabels, 73 | ldraw: addShapesAndLabels, 74 | hldraw: addShapesAndLabels, 75 | tldraw: addShapesAndLabels, 76 | url: addNodeAttribute('url'), 77 | tooltip: addNodeAttribute('tooltip'), 78 | id: addNodeAttribute('identifier'), 79 | size: function(node) { 80 | cursor.size = node.value.map(function(e) { 81 | return e*72; 82 | }); 83 | } 84 | }); 85 | visit(ast); 86 | 87 | return { 88 | main: result.shift(), 89 | groups: result 90 | }; 91 | } 92 | }; 93 | }); -------------------------------------------------------------------------------- /src/js/transitions/default.js: -------------------------------------------------------------------------------- 1 | define(["styliseur"], function(styliseur) { 2 | return { 3 | document: function(selection, attributer) { 4 | selection 5 | .transition() 6 | .delay(150) 7 | .duration(700) 8 | .call(attributer); 9 | }, 10 | canvas: function (selection, attributer) { 11 | selection 12 | .transition() 13 | .delay(150) 14 | .duration(900) 15 | .call(attributer) 16 | .call(styliseur); 17 | }, 18 | nodes: function (selection, attributer) { 19 | selection 20 | .style("opacity", 0.0) 21 | .transition() 22 | .delay(150) 23 | .duration(900) 24 | .call(attributer) 25 | .call(styliseur); 26 | }, 27 | relations: function (selection, attributer) { 28 | selection 29 | .style("opacity", 0.0) 30 | .transition() 31 | .delay(150) 32 | .duration(900) 33 | .call(attributer) 34 | .call(styliseur); 35 | }, 36 | exits: function (selection, attributer) { 37 | selection 38 | .transition() 39 | .duration(100) 40 | .style("opacity", 0.0) 41 | .call(attributer); 42 | }, 43 | shapes: function (shapes, attributer) { 44 | shapes 45 | .transition() 46 | .delay(150) 47 | .duration(900) 48 | .call(attributer) 49 | .call(styliseur); 50 | }, 51 | labels: function (labels, attributer) { 52 | labels 53 | .transition() 54 | .delay(150) 55 | .duration(900) 56 | .call(attributer) 57 | .call(styliseur); 58 | } 59 | }; 60 | }); -------------------------------------------------------------------------------- /src/main.js: -------------------------------------------------------------------------------- 1 | require.config({ 2 | baseUrl: "js", 3 | shim: { 4 | exports: "Viz" 5 | }, 6 | paths: { 7 | parser: '../../parser', 8 | d3: '../../lib/d3/d3', 9 | worker: '../../lib/requirejs-web-workers/worker', 10 | viz: '../../lib/viz.js/viz' 11 | } 12 | }); 13 | --------------------------------------------------------------------------------