File tree Expand file tree Collapse file tree 3 files changed +57
-4
lines changed Expand file tree Collapse file tree 3 files changed +57
-4
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ export default {
13
13
{ path : "/javascript/mutables" , name : "Mutables" } ,
14
14
{ path : "/javascript/imports" , name : "Imports" } ,
15
15
{ path : "/javascript/inputs" , name : "Inputs" } ,
16
- { path : "/dot" , name : "Dot " } ,
16
+ { path : "/dot" , name : "DOT " } ,
17
17
{ path : "/mermaid" , name : "Mermaid" } ,
18
18
{ path : "/tex" , name : "TeX" } ,
19
19
{ path : "/loaders" , name : "Data loaders" } ,
Original file line number Diff line number Diff line change 1
- # Dot
1
+ # DOT
2
2
3
- ``` dot show
3
+ [ DOT] ( https://graphviz.org/doc/info/lang.html ) is a language for rendering node-link diagrams using [ Graphviz] ( https://graphviz.org ) . Observable Markdown’s implementation is powered by [ Viz.js] ( https://github.com/mdaines/viz-js ) .
4
+
5
+ To use DOT, write a ` dot ` fenced code block:
6
+
7
+ ```` md
8
+ ```dot
4
9
digraph G {
10
+ rankdir = LR
5
11
a -> b -> c
6
12
}
7
13
```
14
+ ````
15
+
16
+ This produces:
17
+
18
+ ``` dot
19
+ digraph G {
20
+ rankdir = LR
21
+ a -> b -> c
22
+ }
23
+ ```
24
+
25
+ Here are some more examples.
26
+
27
+ ``` dot show
28
+ graph { n0 -- n1 -- n2 -- n3 -- n0 }
29
+ ```
30
+
31
+ ``` dot show
32
+ digraph { x -> y -> z }
33
+ ```
34
+
35
+ ``` dot show
36
+ digraph G {
37
+ subgraph cluster_0 {
38
+ a0 -> a1 -> a2 -> a3
39
+ label = "process #1"
40
+ }
41
+ subgraph cluster_1 {
42
+ b0 -> b1 -> b2 -> b3
43
+ label = "process #2"
44
+ color = blue
45
+ }
46
+ start -> a0
47
+ start -> b0
48
+ a1 -> b3
49
+ b2 -> a3
50
+ a3 -> a0
51
+ a3 -> end
52
+ b3 -> end
53
+ start [shape = Mdiamond]
54
+ end [shape = Msquare]
55
+ }
56
+ ```
Original file line number Diff line number Diff line change @@ -116,7 +116,11 @@ async function dot() {
116
116
while ( ++ i < n ) string += arguments [ i ] + "" + strings [ i ] ;
117
117
const svg = viz . renderSVGElement ( string , {
118
118
graphAttributes : {
119
- bgcolor : "none"
119
+ bgcolor : "none" ,
120
+ color : "#00000101" ,
121
+ fontcolor : "#00000101" ,
122
+ fontname : "var(--sans-serif)" ,
123
+ fontsize : "12"
120
124
} ,
121
125
nodeAttributes : {
122
126
color : "#00000101" ,
You can’t perform that action at this time.
0 commit comments