graphpkg
graphpkg copied to clipboard
usage + browser flag
@davecheney thanks for making this!
this PR adds:
- usage output if no args given.
- ability to output the svg to stdout.
-
browserflag to open in browser (currently defaults to false, which is TRTTD, but defaulting to true would match the current functionality, which is backwards compatible and doesn't break people's scripts).
> graphpkg
usage: graphpkg [flags] <package name>
> graphpkg -browser=true net
opening in your browser...
> graphpkg sort
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by graphviz version 2.38.0 (20140413.2041)
-->
<!-- Title: %3 Pages: 1 -->
<svg width="62pt" height="44pt"
viewBox="0.00 0.00 62.00 44.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 40)">
<title>%3</title>
<polygon fill="white" stroke="none" points="-4,4 -4,-40 58,-40 58,4 -4,4"/>
<!-- N0 -->
<g id="node1" class="node"><title>N0</title>
<polygon fill="none" stroke="black" points="54,-36 0,-36 0,-0 54,-0 54,-36"/>
<text text-anchor="middle" x="27" y="-13.8" font-family="Times,serif" font-size="14.00">sort</text>
</g>
</g>
</svg>
:heart: @jbenet
I ended up making other changes. I'm pushing to my master, so they'll also show up here (sorry, i should've made a feature branch). This PR was originally just for 6b839b7...360d2cc
Feel free to totally ignore them, they move this into a bit of a different direction. Look: http://bl.ocks.org/jbenet/c51cd7eb730d18e5cdc2
non interactive version:
