Skip to content

Instantly share code, notes, and snippets.

View steveroush's full-sized avatar

steveroush

  • nope
  • colorado, usa
View GitHub Profile
@steveroush
steveroush / clusterEdges.gvpr
Created April 9, 2025 02:45
clusterEdges.gvpr - create edges to/from clusters in dot (Graphviz) graphs
/********************************************************************
see help below
********************************************************************/
BEGIN{
graph_t tmpG, aGraph, Root; //, Cluster[];
edge_t newE;
node_t aNode, tNode, hNode;
graph_t tailCluster, headCluster;
int i, Gcnt;
string BB[];
@steveroush
steveroush / improveSVG.sh
Created March 4, 2025 16:06
improveSVG.sh - to improve SVG files created by Graphviz
#set -x
:<<"__COMMENT__"
improveSVG.sh -
a program to improve the font usage / text placement in SVG files created by Graphviz programs.
usage:
# if the resulting SVG file will only be used on this computer
bash improveSVG.sh myFile.gv > myFile.svg
@steveroush
steveroush / gist:bce1733ba8f423e3846cd789d53c71b3
Last active February 27, 2025 19:47
GoudyBookletter1911-Regular Font
We couldn’t find that file to show.
@steveroush
steveroush / multiGraph.sh
Created October 10, 2024 02:48
Graphviz - create layout variations
# set -x
T=svg
usage() { # Function: Print a help message.
echo "Usage: $0 [ -G|N|E GraphvizOption ] [ -L layoutEngine ] [ -T outputFormat ] myFile.gv" 1>&2
}
exit_abnormal() { # Function: Exit with error.
usage
exit 1
}
@steveroush
steveroush / addGrid.gvpr
Created September 22, 2024 20:49
add a grid to any Graphviz graph
/**************************************************************************
add a grid to a graph in .dot format
**************************************************************************/
BEGIN{
int i, Indx, bcnt, LR;
string Type, Val, Gcolor[], Gstyle[], Gsize[], tmpstr;
string Hcolor, Vcolor, Hstyle, Vstyle, gridType, gridAlign;
float Hsize, Vsize, deltaX, deltaY, minX, minY, maxX, maxY;
@steveroush
steveroush / roundedOrtho.gvpr
Last active August 26, 2024 16:05
Graphviz - round ortho edges
/*****************************************************
Name: roundedOrtho.gvpr
As of Date: 2024-08-25 20:24:11
Description: when possible, changes ortho edges to round the squared edges
Usage: dot -Gsplines=ortho myFile.gv | gvpr -cf roundedOrtho2.gvpr|neato -n2 -T...
@steveroush
steveroush / justifyRanks.gvpr
Last active August 20, 2024 22:06
reposition nodes within a rank (dot / Graphviz)
/**********************************************************************
justify nodes that are on the same rank
- add a new "rankjustify" to any nodes you want "justified"
- legal values: t,b,l,r,min,max (for top, bottom, left, right, min, and max)
usage:
dot myFile.gv | gvpr -cf justifyRanks.gvpr | neato -n ...
**********************************************************************/
@steveroush
steveroush / addGrid.gvpr
Last active February 20, 2025 08:55
add a grid to any Graphviz graph
/**************************************************************************
add a grid to a graph in .dot format
**************************************************************************/
BEGIN{
int i, Indx, bcnt, LR;
string Type, Val, Gcolor[], Gstyle[], Gsize[], tmpstr;
string Hcolor, Vcolor, Hstyle, Vstyle, gridType, gridAlign;
float Hsize, Vsize, deltaX, deltaY, minX, minY, maxX, maxY;
@steveroush
steveroush / testing.md
Last active August 3, 2024 21:55
Transforming a Graphviz graph to 3 swimlanes

Converting a dot output to swimlanes

SWIMclustRankdirOff.mp4

@steveroush
steveroush / swimlane.gvpr
Last active July 17, 2024 21:38
a GVPR program that adds a swimlane feature to Graphviz (dot)
/*************************************************************************
swimlanes
- for more info on swim lanes: https://en.wikipedia.org/wiki/Swim_lane
- new attributes, all at the parent cluster-level:
- swimlanePool=true/false/[0-9]+ - turns on swimlane algorithm
- if having nested swimlanes is desirable, true/false is
insufficient. Instead, use swimlane=someuniquename
- swimlaneequalSize=true/false all lanes given same width, or width determined "naturally" by dot