Created
April 23, 2012 01:57
-
-
Save kellyrob99/2468212 to your computer and use it in GitHub Desktop.
Given a GraphViz dot file, create combinations of layouts and output formats; depends on having the dot executable preinstalled
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import groovyx.gpars.GParsPool | |
| def inputfile = args[0] | |
| def layouts = [ 'twopi', 'sfdp', 'osage'] | |
| def formats = [ 'pdf','svg'] | |
| def combinations = [layouts, formats].combinations() | |
| GParsPool.withPool(4) { | |
| combinations.eachParallel { combination -> | |
| String layout = combination[0] | |
| String format = combination[1] | |
| List args = [ '/usr/local/bin/dot', "-K$layout", '-Goverlap=prism', '-Goverlap_scaling=-10', "-T$format", | |
| '-o', "${inputfile}.${layout}.$format", inputfile ] | |
| println args | |
| final Process execute = args.execute() | |
| execute.waitFor() | |
| println execute.exitValue() | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment