Browse code

Add dotfiles

Robert Cranston authored on 04/04/2022 17:36:24
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,52 @@
1
+BEGIN
2
+{
3
+    void object_url(obj_t o)
4
+    {
5
+        if (hasAttr(o, "URL"))
6
+            return;
7
+        string s;
8
+        if (hasAttr(o, "label"))
9
+            s = o.label;
10
+        else
11
+            s = o.name;
12
+        if (match(s, "://[a-zA-Z0-9]") >= 0)
13
+            o.URL = s;
14
+        if (match(s, "/[a-zA-Z0-9]") == 0)
15
+            o.URL = sprintf("file://%s", s);
16
+    }
17
+    void graph_label_url(graph_t g)
18
+    {
19
+        if (g) {
20
+            g.label     = sub(g.name, "^cluster ");
21
+            g.labelloc  = "t";
22
+            g.labeljust = g.parent == NULL ? "c" : "l";
23
+            object_url(g);
24
+            graph_label_url(fstsubg(g));
25
+            graph_label_url(nxtsubg(g));
26
+        }
27
+    }
28
+}
29
+END_G {
30
+    $.fontname  = "Arial";
31
+    $.color     = "grey";
32
+    $.fontcolor = "grey";
33
+    $.shape     = "box";
34
+    $.style     = "rounded";
35
+    graph_label_url($G);
36
+}
37
+N {
38
+    $.fontname  = "Arial";
39
+    $.color     = "black";
40
+    $.fontcolor = "black";
41
+    if (hasAttr($, "style") && $.style == "invis") {
42
+        $.shape = "point";
43
+        $.style = "invis";
44
+    } else {
45
+        $.shape = "box";
46
+        $.style = "rounded";
47
+    }
48
+    object_url($);
49
+}
50
+E {
51
+    object_url($);
52
+}