Skip to content

Instantly share code, notes, and snippets.

View steveroush's full-sized avatar

steveroush

  • nope
  • colorado, usa
View GitHub Profile
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
digraph G {
/* based on work by Kaspar Bumke */
graph [comment="based on work by Kaspar Bumke "]
graph [inputscale="72" layout="neato" rankdir=RL layers="visible:invisible:OFF_layer:TRIG_START_layer:RECORD_layer:TRIG_STOP_layer:PLAY_layer:OVERDUB_layer:MULTIPLY_layer:INSERT_layer:REPLACE_layer:DELAY_layer:MUTE_layer:SCRATCH_layer:ONESHOT_layer:SUBSTITUTE_layer:PAUSED_layer:UNDO_ALL_layer:TRIGGER_PLAY_layer:UNDO_layer:REDO_layer:REDO_ALL_layer:OFF_MUTE_layer" size="9,9!" outputorder="nodesfirst"]
subgraph cluster1 {
node [style="filled" fillcolor="white" fontname=Times]
node [id=":\N:"]; // set the ID field in the SVG output, used by the SVG postprocessor
digraph G {
layers="local:pvt:test:new:ofc";
node [style=filled,color=lightblue];
node1 [layer="pvt"];
node2 [layer="all",color=red];
node3 [layer="pvt:ofc"]; /* pvt, test, new, and ofc */
node2 -> node3 [layer="pvt:all"]; /* same as pvt:ofc */
node2 -> node4 [layer=3]; /* same as test */
}
/* Courtesy of Ian Darwin <ian@darwinsys.com>
* and Geoff Collyer <geoff@plan9.bell-labs.com>
* Mildly updated by Ian Darwin in 2000.
*/
digraph unix {
size="6,6";
layers="L1:L2:L3:L4:L5:L6:L7:L8:L9:L10:L11:L12";
node [color=lightblue2, style=filled];
"5th Edition" [layer = "L1:L12"];
@steveroush
steveroush / radialArchive.sh
Last active July 12, 2023 00:54
Graphviz Radial Layout Engine (shell archive)
#!/bin/sh
cat <<QUitquIT
# This is a shell archive.
#
# to execute this file, type: sh radialEngine_archive.sh
#
# On Linux/UNIX/MacOS(?) systems it is an executable program that will create
# a subdirectory (named radialEngine) in the currect directory and then
# install multiple (text) files in that directory.
# This shell archive and all contents are humanly readable - no binary files.
@steveroush
steveroush / wordWrapShared.sh
Created March 15, 2023 20:56
word wrap for Graphviz
## set -x
## This is a Linux (and maybe MacOS?) shell script.
## It will need to be modified to run on Windows.
## It performs word-wrap (https://en.wikipedia.org/wiki/Line_wrap_and_word_wrap) on the labels of certain Graphviz nodes.
## - not html-like labels
## - not record or Mrecord shaped nodes
## - not edge labels
## - not graph or cluster labels
## - not xlabels
## - it DOES NOT recognize any meaning of TAB character (ASCII 09) or
@steveroush
steveroush / keepOrder_archive.sh
Last active April 17, 2023 14:50
Graphviz node reorder software
#!/bin/sh
cat <<QUitquIT
# This is a shell archive.
#
# to execute this file, type: sh keepOrder_archive.sh
#
# On Linux/UNIX/MacOS(?) systems it is an executable program that will create
# a subdirectory (named keepOrder) in the currect directory and then
# install multiple (text) files in that directory.
# This shell archive and all contents are humanly readable - no binary files.
@steveroush
steveroush / improveEdgeLabels.gvpr
Created June 5, 2023 02:21
A GVPR program to improve Graphviz edge labels
/***********************************************
1. save this file as improveEdgeLabels.gvpr
2. what it does: it allows you to re-position Graphviz edge labels
3. command line example (works with any Graphviz engine):
dot myfile.gv |gvpr -cf improveEdgeLabels.gvpr |neato -n2 -Tpng >myfile.png
4. how to use:
improveEdgeLabels adds 3 new edge attributes to Graphviz:
- labelOverlay, labelAdjust, label2Node
- they can be used separately or in combination
- if labelOverlay=true
@steveroush
steveroush / twopiCircles.gvpr
Last active July 19, 2023 19:59
A Graphviz gvpr program to add concentric circles to a twopi graph
/*************************************************************************
twopiCircles: add circles to twopi graph
similar to the "addrings" gvpr program that comes with Graphviz source
New Attributes, only used by twopiCircles.gvpr:
- maxRank - set a maximum number of concentric circles (ranks).
Ranks counted from the center, Root is not counted as a rank
- noOffset - if true, draw circles through the center of nodes
otherwise, draw circles between the ranks
(i.e half-way from one rank to the next)