updates 33.1 139
This commit is contained in:
92
docs/graphs/themes/dark.gvpr
Normal file
92
docs/graphs/themes/dark.gvpr
Normal file
@@ -0,0 +1,92 @@
|
||||
// Dark — the palette the docs have always used, restated as a theme.
|
||||
//
|
||||
// This exists so the .dot sources can stop carrying colour. It reproduces what
|
||||
// the committed SVGs look like today, which also makes it the regression
|
||||
// oracle: strip the inline colours from a source, render it through this, and
|
||||
// the result should be the diagram you had before. If it is not, the strip was
|
||||
// wrong.
|
||||
//
|
||||
// Palette matches common/theme/themes/soleprint.css, so a diagram and the page
|
||||
// around it are the same visual language.
|
||||
|
||||
BEGIN {
|
||||
string BG = "#0a0a0a";
|
||||
string FILL = "#1a1a1a";
|
||||
string LINE = "#333333";
|
||||
string INK = "#e5e5e5";
|
||||
string MUTED = "#a3a3a3";
|
||||
string DIM = "#666666";
|
||||
string FONT = "Helvetica";
|
||||
graph_t sg;
|
||||
|
||||
// The soleprint amber, and the three system colours, each with the lighter
|
||||
// text variant the docs use for labels on dark.
|
||||
string ACC_S = "#d4a574"; string ACC_T = "#d4a574";
|
||||
string ART_S = "#b91c1c"; string ART_T = "#fca5a5";
|
||||
string ATL_S = "#15803d"; string ATL_T = "#86efac";
|
||||
string STA_S = "#1d4ed8"; string STA_T = "#93c5fd";
|
||||
}
|
||||
|
||||
BEG_G {
|
||||
$G.bgcolor = BG;
|
||||
setDflt($G, "N", "fontname", FONT);
|
||||
setDflt($G, "E", "fontname", FONT);
|
||||
// Declare `class` so reading it on an untagged object is defined
|
||||
// rather than a warning — most nodes carry no class by design.
|
||||
setDflt($G, "G", "class", "");
|
||||
setDflt($G, "N", "class", "");
|
||||
setDflt($G, "E", "class", "");
|
||||
$G.fontname = FONT;
|
||||
// The graph title takes the accent of whatever system the graph is about;
|
||||
// graphs declare that with a class on the digraph itself.
|
||||
if ($G.class == "artery") { $G.fontcolor = ART_T; }
|
||||
else if ($G.class == "atlas") { $G.fontcolor = ATL_T; }
|
||||
else if ($G.class == "station") { $G.fontcolor = STA_T; }
|
||||
else { $G.fontcolor = ACC_T; }
|
||||
|
||||
|
||||
for (sg = fstsubg($G); sg; sg = nxtsubg(sg)) {
|
||||
if (index(sg.name, "cluster") == 0) {
|
||||
sg.fontname = FONT;
|
||||
sg.color = LINE;
|
||||
sg.fontcolor = DIM;
|
||||
if (sg.class == "artery") { sg.color = ART_S; sg.fontcolor = ART_T; }
|
||||
else if (sg.class == "atlas") { sg.color = ATL_S; sg.fontcolor = ATL_T; }
|
||||
else if (sg.class == "station") { sg.color = STA_S; sg.fontcolor = STA_T; }
|
||||
else if (sg.class == "accent") { sg.color = ACC_S; sg.fontcolor = ACC_T; }
|
||||
else if (sg.class == "ok") { sg.color = ATL_S; sg.fontcolor = ATL_T; }
|
||||
if (index(sg.style, "dashed") < 0) { sg.style = "dashed"; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
N {
|
||||
if (index($.style, "invis") >= 0) { continue; }
|
||||
|
||||
$.fontname = FONT;
|
||||
$.fontcolor = INK;
|
||||
$.color = LINE;
|
||||
$.fillcolor = FILL;
|
||||
|
||||
if ($.class == "accent") { $.color = ACC_S; }
|
||||
else if ($.class == "artery") { $.color = ART_S; }
|
||||
else if ($.class == "atlas") { $.color = ATL_S; }
|
||||
else if ($.class == "station") { $.color = STA_S; }
|
||||
else if ($.class == "accent-text") { $.fontcolor = ACC_T; }
|
||||
else if ($.class == "ok") { $.fontcolor = ATL_T; }
|
||||
else if ($.class == "muted") { $.fontcolor = MUTED; }
|
||||
|
||||
if (index($.style, "dashed") >= 0) { $.style = "filled,dashed"; }
|
||||
else { $.style = "filled"; }
|
||||
}
|
||||
|
||||
E {
|
||||
$.fontname = FONT;
|
||||
$.fontcolor = MUTED;
|
||||
$.color = DIM;
|
||||
|
||||
if ($.class == "accent") { $.color = ACC_S; $.fontcolor = ACC_T; }
|
||||
else if ($.class == "artery") { $.color = ART_S; $.fontcolor = ART_T; }
|
||||
else if ($.class == "atlas") { $.color = ATL_S; $.fontcolor = ATL_T; }
|
||||
else if ($.class == "station") { $.color = STA_S; $.fontcolor = STA_T; }
|
||||
}
|
||||
114
docs/graphs/themes/lucid.gvpr
Normal file
114
docs/graphs/themes/lucid.gvpr
Normal file
@@ -0,0 +1,114 @@
|
||||
// Lucid — graphviz output shaped after a lucid.app export.
|
||||
//
|
||||
// Run through gvpr, not as .dot attributes, because gvpr rewrites the parsed
|
||||
// graph: it wins over whatever the source set inline, so one .dot renders in
|
||||
// any theme without being edited. See render.sh.
|
||||
//
|
||||
// The look, and why each part is what it is:
|
||||
// white canvas this ends up in a document and gets printed
|
||||
// rounded box, hairline Lucid's default shape is a rounded rect with a grey
|
||||
// 1px stroke, not a coloured fill
|
||||
// pale-blue accent #d6e4ff on #3a7dff is Lucid's own selected-shape pair
|
||||
// Arial the one face guaranteed on Windows, and aliased to
|
||||
// Liberation Sans by fontconfig on Linux — so the SVG
|
||||
// measures the same on both and the text does not
|
||||
// reflow out of its box
|
||||
//
|
||||
// Structure is preserved, only palette is replaced. Two styles carry meaning
|
||||
// rather than decoration and are explicitly kept: `invis` (a layout spacer —
|
||||
// overwriting it makes hidden scaffolding visible) and `dashed` (a weaker
|
||||
// relationship). Shapes are never touched: a cylinder is a datastore.
|
||||
|
||||
BEGIN {
|
||||
string BG = "#ffffff";
|
||||
string INK = "#1f2933";
|
||||
string MUTED = "#616e7c";
|
||||
string LINE = "#9aa5b1";
|
||||
string SOFT = "#cbd2d9";
|
||||
string FONT = "Arial";
|
||||
graph_t sg;
|
||||
|
||||
string FILL = "#ffffff";
|
||||
string FILL_ALT = "#f5f7fa";
|
||||
|
||||
// class -> (stroke, fill). Lucid's palette for emphasised shapes.
|
||||
string ACC_S = "#3a7dff"; string ACC_F = "#d6e4ff";
|
||||
string ART_S = "#c0392b"; string ART_F = "#fdeaea";
|
||||
string ATL_S = "#1a7f45"; string ATL_F = "#e6f5ec";
|
||||
string STA_S = "#2b5fd9"; string STA_F = "#e8effd";
|
||||
}
|
||||
|
||||
BEG_G {
|
||||
$G.bgcolor = BG;
|
||||
$G.fontname = FONT;
|
||||
$G.fontcolor = INK;
|
||||
|
||||
// Defaults for anything the per-node block does not reach.
|
||||
setDflt($G, "N", "fontname", FONT);
|
||||
setDflt($G, "E", "fontname", FONT);
|
||||
// Declare `class` so reading it on an untagged object is defined
|
||||
// rather than a warning — most nodes carry no class by design.
|
||||
setDflt($G, "G", "class", "");
|
||||
setDflt($G, "N", "class", "");
|
||||
setDflt($G, "E", "class", "");
|
||||
|
||||
// Clusters: a pale container, the way Lucid draws a grouping box.
|
||||
for (sg = fstsubg($G); sg; sg = nxtsubg(sg)) {
|
||||
if (index(sg.name, "cluster") == 0) {
|
||||
sg.fontname = FONT;
|
||||
sg.color = SOFT;
|
||||
sg.fontcolor = MUTED;
|
||||
sg.bgcolor = FILL_ALT;
|
||||
// A tagged container keeps its identity, the way a Lucid swimlane
|
||||
// is tinted by what it holds.
|
||||
if (sg.class == "artery") { sg.color = ART_S; sg.bgcolor = ART_F; }
|
||||
else if (sg.class == "atlas") { sg.color = ATL_S; sg.bgcolor = ATL_F; }
|
||||
else if (sg.class == "station") { sg.color = STA_S; sg.bgcolor = STA_F; }
|
||||
else if (sg.class == "accent") { sg.color = ACC_S; sg.bgcolor = ACC_F; }
|
||||
// Keep dashed where the source chose it; it reads as "logical
|
||||
// grouping" rather than "deployed boundary".
|
||||
if (index(sg.style, "dashed") < 0) { sg.style = "rounded"; }
|
||||
else { sg.style = "dashed,rounded"; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
N {
|
||||
// An invisible node is layout scaffolding. Filling it would draw it.
|
||||
if (index($.style, "invis") >= 0) { continue; }
|
||||
|
||||
$.fontname = FONT;
|
||||
$.fontcolor = INK;
|
||||
$.color = LINE;
|
||||
$.fillcolor = FILL;
|
||||
$.penwidth = 1;
|
||||
|
||||
if ($.class == "accent") { $.color = ACC_S; $.fillcolor = ACC_F; }
|
||||
else if ($.class == "artery") { $.color = ART_S; $.fillcolor = ART_F; }
|
||||
else if ($.class == "atlas") { $.color = ATL_S; $.fillcolor = ATL_F; }
|
||||
else if ($.class == "station") { $.color = STA_S; $.fillcolor = STA_F; }
|
||||
else if ($.class == "accent-text") { $.fontcolor = ACC_S; }
|
||||
else if ($.class == "ok") { $.color = ATL_S; $.fillcolor = ATL_F; }
|
||||
else if ($.class == "muted") { $.fillcolor = FILL_ALT; $.fontcolor = MUTED; }
|
||||
|
||||
// `record` ignores rounding, and plaintext has no box to round.
|
||||
if ($.shape == "record" || $.shape == "Mrecord" || $.shape == "plaintext") {
|
||||
$.style = "filled";
|
||||
} else if (index($.style, "dashed") >= 0) {
|
||||
$.style = "filled,rounded,dashed";
|
||||
} else {
|
||||
$.style = "filled,rounded";
|
||||
}
|
||||
}
|
||||
|
||||
E {
|
||||
$.fontname = FONT;
|
||||
$.fontcolor = MUTED;
|
||||
$.color = LINE;
|
||||
$.arrowsize = 0.7;
|
||||
|
||||
if ($.class == "accent") { $.color = ACC_S; $.fontcolor = ACC_S; }
|
||||
else if ($.class == "artery") { $.color = ART_S; $.fontcolor = ART_S; }
|
||||
else if ($.class == "atlas") { $.color = ATL_S; $.fontcolor = ATL_S; }
|
||||
else if ($.class == "station") { $.color = STA_S; $.fontcolor = STA_S; }
|
||||
}
|
||||
Reference in New Issue
Block a user