├── .vscode └── launch.json ├── LICENSE ├── README.md ├── dot ├── dot.configuration.json ├── snippets │ ├── package.json │ └── snippets │ │ ├── dot.json │ │ ├── principalEdgeAttributes.json │ │ ├── principalGraphAttributes.json │ │ └── principalNodeAttributes.json └── syntaxes │ └── dot.tmLanguage ├── img ├── GraphvizLogo.png └── syntax.png └── package.json /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.2.0", 3 | "configurations": [ 4 | { 5 | "name": "Launch Extension", 6 | "type": "extensionHost", 7 | "request": "launch", 8 | "runtimeExecutable": "${execPath}", 9 | "args": [ 10 | "--extensionDevelopmentPath=${workspaceRoot}" 11 | ] 12 | } 13 | ] 14 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Stephan van Stekelenburg 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # vscode-graphviz 2 | This extension provides GraphViz (dot) language support for [VS Code](https://code.visualstudio.com/). 3 | 4 | # Functionality 5 | - Syntax Highlighting 6 | - Snippets 7 | - `graph` Graph Template 8 | - `>` Convert > to -> 9 | - `var` New Variable 10 | - `var` New variable [plaintext] 11 | - `prop` Property [dir=both…] 12 | - `prop` Property [shape=box] 13 | - `prop` Property [styles…] 14 | - `path` Path from -> to [label] 15 | - `path` Path from -> {to list} 16 | - `rank` { rank=same|min|max; x; y } 17 | 18 | # Install 19 | 20 | Open up VS Code and hit `F1` and type `ext` select `install` and type `dot` hit enter and reload window to enable. 21 | 22 | ![Preview of Syntax Highlighting](img/syntax.png) 23 | 24 | # Attribution 25 | 26 | "GraphvizLogo" by Source. Licensed under Fair use via [Wikipedia](https://en.wikipedia.org/wiki/File:GraphvizLogo.png#/media/File:GraphvizLogo.png) -------------------------------------------------------------------------------- /dot/dot.configuration.json: -------------------------------------------------------------------------------- 1 | { 2 | "comments": { 3 | "lineComment": "//", 4 | "blockComment": [ "/*", "*/" ] 5 | }, 6 | "brackets": [ 7 | ["{", "}"], 8 | ["[", "]"], 9 | ["(", ")"] 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /dot/snippets/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "dot_snippets", 3 | "contributors": [ 4 | "Dennis Pettersson " 5 | ], 6 | "publisher": "Stephanvs", 7 | "description": "Code snippets for Graphviz (DOT)", 8 | "version": "0.1.0", 9 | "engines": { 10 | "vscode": "*" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /dot/snippets/snippets/dot.json: -------------------------------------------------------------------------------- 1 | { 2 | "Graph Template": { 3 | "prefix": "graph", 4 | "body": [ 5 | "digraph ${name:G} {", 6 | "\tsplines=\"FALSE\";", 7 | "", 8 | "\t/* Entities */", 9 | "\t${1:shortName} [label=\"${2:$1}\", shape=\"${3|square,rectangle,circle,ellipse,triangle,plaintext,point,diamond,pentagon,hexagon,septagon,octagon,egg,trapezium,parallelogram,house,doublecircle,doubleoctagon,tripleoctagon,invtriangle,invtrapezium,invhouse,Mdiamond,Msquare,Mcircle,none,note,tab,folder,box3d|}\"${4:, URL=\"${5:http://en.wikipedia.org/wiki/John de Fries}\"}]", 10 | "\t${0}", 11 | "\t/* Relationships */", 12 | "\t${6:F1} -> $1${7:[label=\"${8:.63}\"]}", 13 | "", 14 | "\t/* Ranks */", 15 | "\t{ rank=${9:|same,min,max,# max is bottom|}; $1; };", 16 | "}" 17 | ], 18 | "description": "Graph Template" 19 | }, 20 | "Convert > to ->": { 21 | "prefix": ">", 22 | "body": [ 23 | "-> " 24 | ], 25 | "description": "-> (convert \">\" to \"->\")" 26 | }, 27 | "New Variable": { 28 | "prefix": "var", 29 | "body": [ 30 | "${1:shortname} [label=\"${2:$1}\", shape=\"${3|square,rectangle,circle,ellipse,triangle,plaintext,point,diamond,pentagon,hexagon,septagon,octagon,egg,trapezium,parallelogram,house,doublecircle,doubleoctagon,tripleoctagon,invtriangle,invtrapezium,invhouse,Mdiamond,Msquare,Mcircle,none,note,tab,folder,box3d|}\"${4:, URL=\"${5:http://en.wikipedia.org/wiki/John de Fries}\"}]", 31 | "${0}" 32 | ], 33 | "description": "New variable" 34 | }, 35 | "New variable [plaintext]": { 36 | "prefix": "var", 37 | "body": [ 38 | "\"${1:Machine: a}\" [ shape = plaintext ];" 39 | ], 40 | "description": "New variable [plaintext]" 41 | }, 42 | "Property [styles…]": { 43 | "prefix": "prop", 44 | "body": [ 45 | "[style=dotted; color=red; style=bold,label=\"100 times\"; weight=8]" 46 | ], 47 | "description": "Property [styles…]" 48 | }, 49 | "Path from -> to [label]": { 50 | "prefix": "path", 51 | "body": [ 52 | "${1:from} -> ${2:to} [label=\"${3:.7}\";]" 53 | ], 54 | "description": "Path from -> to [label]" 55 | }, 56 | "Path from -> {to list}": { 57 | "prefix": "path", 58 | "body": [ 59 | "${1:From} -> {${2:item1} ${3:item2} $0}" 60 | ], 61 | "description": "Path from -> {to list}" 62 | }, 63 | "{ rank=same|min|max; x; y }": { 64 | "prefix": "rank", 65 | "body": [ 66 | "{ rank=${1|same,min,max,# max is bottom|}; ${2:space delimitted list }};" 67 | ], 68 | "description": "{rank=same|min|max; x; y}" 69 | }, 70 | "Subgraph template": { 71 | "prefix": "subgraph", 72 | "body": [ 73 | "subgraph ${1:cluster0}", 74 | "\t${2:node [style=filled color=white]}", 75 | "}" 76 | ], 77 | "description": "subgraph template" 78 | }, 79 | "Attribute label=": { 80 | "prefix": "label=", 81 | "body": "label=\"$1\"" 82 | }, 83 | "Attribute label=table": { 84 | "prefix": "label=table", 85 | "body": [ 86 | "label=<", 87 | "\t", 88 | "\t\t", 89 | "\t\t\t", 92 | "\t\t", 93 | "\t
", 90 | "\t\t\t\t$2", 91 | "\t\t\t
", 94 | ">" 95 | ] 96 | }, 97 | "Attribute style=...": { 98 | "prefix": "style", 99 | "body": "style=\"${1|solid,dashed,dotted,bold,invis|}\"", 100 | "description": "This attribute is a comma-separated list of primitives with optional argument list" 101 | }, 102 | "Attribute dir=...": { 103 | "prefix": "dir", 104 | "body": "dir=${1|back,forward,both,none|}" 105 | }, 106 | "Attribute shape=...": { 107 | "prefix": "shape", 108 | "body": "shape=${1|square,rectangle,circle,ellipse,triangle,plaintext,point,diamond,pentagon,hexagon,septagon,octagon,egg,trapezium,parallelogram,house,doublecircle,doubleoctagon,tripleoctagon,invtriangle,invtrapezium,invhouse,Mdiamond,Msquare,Mcircle,none,note,tab,folder,box3d|}" 109 | }, 110 | "Attribute shape=record": { 111 | "prefix": "shape=record", 112 | "body": "shape=record label=\"<${1:f0}> $2${3:|}${4}\"" 113 | } 114 | } 115 | -------------------------------------------------------------------------------- /dot/snippets/snippets/principalEdgeAttributes.json: -------------------------------------------------------------------------------- 1 | { 2 | "arrowhead": { 3 | "prefix": "arrowhead", 4 | "body": "arrowhead=${1|normal,normal,inv,dot,invdot,odot,invodot,none|}", 5 | "description": "[Principal Edge Attributes]\nstyle of arrowhead at head end\n\n" 6 | }, 7 | "arrowsize": { 8 | "prefix": "arrowsize", 9 | "body": "arrowsize=${1:1.0}", 10 | "description": "[Principal Edge Attributes]\nscaling factor for arrowheads\n\n" 11 | }, 12 | "arrowtail": { 13 | "prefix": "arrowtail", 14 | "body": "arrowtail=${1|normal,normal,inv,dot,invdot,odot,invodot,none|}", 15 | "description": "[Principal Edge Attributes]\nstyle of arrowhead at tail end\n\n" 16 | }, 17 | "color": { 18 | "prefix": "color", 19 | "body": "color=${1:black}", 20 | "description": "[Principal Edge Attributes]\nedge stroke color\n\n" 21 | }, 22 | "colorscheme": { 23 | "prefix": "colorscheme", 24 | "body": "colorscheme=${1:X11}", 25 | "description": "[Principal Edge Attributes]\nscheme for interpreting color names\n\n" 26 | }, 27 | "comment": { 28 | "prefix": "comment", 29 | "body": "comment=\"$1\"", 30 | "description": "[Principal Edge Attributes]\nany string (format-dependent)\n\n" 31 | }, 32 | "constraint": { 33 | "prefix": "constraint", 34 | "body": "constraint=${1|true,false|}", 35 | "description": "[Principal Edge Attributes]\nuse edge to affect node ranking\n\n" 36 | }, 37 | "decorate": { 38 | "prefix": "decorate", 39 | "body": "decorate=${1|true,false|}", 40 | "description": "[Principal Edge Attributes]\nif set, draws a line connecting labels with their edges\n\n" 41 | }, 42 | "dir": { 43 | "prefix": "dir", 44 | "body": "dir=${1|forward,back,both,none|}", 45 | "description": "[Principal Edge Attributes]\n `forward`, `back`, `both`, or `none`\n\n" 46 | }, 47 | "edgeURL": { 48 | "prefix": "edgeURL", 49 | "body": "edgeURL=\"$1\"", 50 | "description": "[Principal Edge Attributes]\nURL attached to non-label part of edge\n\n" 51 | }, 52 | "edgehref": { 53 | "prefix": "edgehref", 54 | "body": "edgehref=\"$1\"", 55 | "description": "[Principal Edge Attributes]\nsynonym for edgeURL\n\n" 56 | }, 57 | "edgetarget": { 58 | "prefix": "edgetarget", 59 | "body": "edgetarget=\"$1\"", 60 | "description": "[Principal Edge Attributes]\nif URL is set, determines browser window for URL\n\n" 61 | }, 62 | "edgetooltip": { 63 | "prefix": "edgetooltip", 64 | "body": "edgetooltip=\"${1:label}\"", 65 | "description": "[Principal Edge Attributes]\ntooltip annotation for non-label part of edge\n\n" 66 | }, 67 | "fontcolor": { 68 | "prefix": "fontcolor", 69 | "body": "fontcolor=${1:black}", 70 | "description": "[Principal Edge Attributes]\ntype face color\n\n" 71 | }, 72 | "fontname": { 73 | "prefix": "fontname", 74 | "body": "fontname=\"${1:Times-Roman}\"", 75 | "description": "[Principal Edge Attributes]\nfont family\n\n" 76 | }, 77 | "fontsize": { 78 | "prefix": "fontsize", 79 | "body": "fontsize=${1:14}", 80 | "description": "[Principal Edge Attributes]\npoint size of label\n\n" 81 | }, 82 | "headclip": { 83 | "prefix": "headclip", 84 | "body": "headclip=${1|true,false|}", 85 | "description": "[Principal Edge Attributes]\nif `false`, edge is not clipped to head node boundary\n\n" 86 | }, 87 | "headhref": { 88 | "prefix": "headhref", 89 | "body": "headhref=$1", 90 | "description": "[Principal Edge Attributes]\nsynonym for headURL\n\n" 91 | }, 92 | "headlabel": { 93 | "prefix": "headlabel", 94 | "body": "headlabel=\"$1\"", 95 | "description": "[Principal Edge Attributes]\nlabel placed near head of edge\n\n" 96 | }, 97 | "headport": { 98 | "prefix": "headport", 99 | "body": "headport=${1|n,ne,e,se,s,sw,w,nw|}", 100 | "description": "[Principal Edge Attributes]\n`n`, `ne`, `e`, `se`, `s`, `sw`, `w`, `nw`\n\n" 101 | }, 102 | "headtarget": { 103 | "prefix": "headtarget", 104 | "body": "headtarget=$1", 105 | "description": "[Principal Edge Attributes]\nif headURL is set, determines browser window for URL\n\n" 106 | }, 107 | "headtooltip": { 108 | "prefix": "headtooltip", 109 | "body": "headtooltip=\"${1:label}\"", 110 | "description": "[Principal Edge Attributes]\ntooltip annotation near head of edge\n\n" 111 | }, 112 | "headURL": { 113 | "prefix": "headURL", 114 | "body": "headURL=\"$1\"", 115 | "description": "[Principal Edge Attributes]\nURL attached to head label\n\n" 116 | }, 117 | "href": { 118 | "prefix": "href", 119 | "body": "href=\"$1\"", 120 | "description": "[Principal Edge Attributes]\nalias for URL\n\n" 121 | }, 122 | "id": { 123 | "prefix": "id", 124 | "body": "id=$1", 125 | "description": "[Principal Edge Attributes]\nany string (user-defined output object tags)\n\n" 126 | }, 127 | "label": { 128 | "prefix": "label", 129 | "body": "label=$1", 130 | "description": "[Principal Edge Attributes]\nedge label\n\n" 131 | }, 132 | "labelangle": { 133 | "prefix": "labelangle", 134 | "body": "labelangle=${1:-25.0}", 135 | "description": "[Principal Edge Attributes]\nangle in degrees which head or tail label is rotated off edge\n\n" 136 | }, 137 | "labeldistance": { 138 | "prefix": "labeldistance", 139 | "body": "labeldistance=${1:1.0}", 140 | "description": "[Principal Edge Attributes]\nscaling factor for distance of head or tail label from node\n\n" 141 | }, 142 | "labelfloat": { 143 | "prefix": "labelfloat", 144 | "body": "labelfloat=${1|false,true|}", 145 | "description": "[Principal Edge Attributes]\nlessen constraints on edge label placement\n\n" 146 | }, 147 | "labelfontcolor": { 148 | "prefix": "labelfontcolor", 149 | "body": "labelfontcolor=${1:black}", 150 | "description": "[Principal Edge Attributes]\ntype face color for head and tail labels\n\n" 151 | }, 152 | "labelfontname": { 153 | "prefix": "labelfontname", 154 | "body": "labelfontname=${1:Times-Roman}", 155 | "description": "[Principal Edge Attributes]\nfont family for head and tail labels\n\n" 156 | }, 157 | "labelfontsize": { 158 | "prefix": "labelfontsize", 159 | "body": "labelfontsize=${1:14}", 160 | "description": "[Principal Edge Attributes]\npoint size for head and tail labels\n\n" 161 | }, 162 | "labelhref": { 163 | "prefix": "labelhref", 164 | "body": "labelhref=\"$1\"", 165 | "description": "[Principal Edge Attributes]\nsynonym for labelURL\n\n" 166 | }, 167 | "labelURL": { 168 | "prefix": "labelURL", 169 | "body": "labelURL=\"$1\"", 170 | "description": "[Principal Edge Attributes]\nURL for label, overrides edge URL\n\n" 171 | }, 172 | "labeltarget": { 173 | "prefix": "labeltarget", 174 | "body": "labeltarget=\"$1\"", 175 | "description": "[Principal Edge Attributes]\nif URL or labelURL is set, determines browser window for URL\n\n" 176 | }, 177 | "labeltooltip": { 178 | "prefix": "labeltooltip", 179 | "body": "labeltooltip=\"${1:label}\"", 180 | "description": "[Principal Edge Attributes]\ntooltip annotation near label\n\n" 181 | }, 182 | "layer": { 183 | "prefix": "layer", 184 | "body": "layer=\"${1|overlay range,all,id,id:id|}\"", 185 | "description": "[Principal Edge Attributes]\n`all`, `id` or `id:id`, or a comma-separated list of the former\n\n" 186 | }, 187 | "lhead": { 188 | "prefix": "lhead", 189 | "body": "lhead=$1", 190 | "description": "[Principal Edge Attributes]\nname of cluster to use as head of edge\n\n" 191 | }, 192 | "ltail": { 193 | "prefix": "ltail", 194 | "body": "ltail=$1", 195 | "description": "[Principal Edge Attributes]\nname of cluster to use as tail of edge\n\n" 196 | }, 197 | "minlen": { 198 | "prefix": "minlen", 199 | "body": "minlen=${1:1}", 200 | "description": "[Principal Edge Attributes]\nminimum rank distance between head and tail\n\n" 201 | }, 202 | "penwidth": { 203 | "prefix": "penwidth", 204 | "body": "penwidth=${1:1.0}", 205 | "description": "[Principal Edge Attributes]\nwidth of pen for drawing edge stroke, in points\n\n" 206 | }, 207 | "samehead": { 208 | "prefix": "samehead", 209 | "body": "samehead=$1", 210 | "description": "[Principal Edge Attributes]\ntag for head node; edge heads with the same tag are merged onto the same port\n\n" 211 | }, 212 | "sametail": { 213 | "prefix": "sametail", 214 | "body": "sametail=$1", 215 | "description": "[Principal Edge Attributes]\ntag for tail node; edge tails with the same tag are merged onto the same port\n\n" 216 | }, 217 | "style": { 218 | "prefix": "style", 219 | "body": "style=\"$1\"", 220 | "description": "[Principal Edge Attributes]\ngraphics options, e.g. `bold`, `dotted`, `filled`\n\n" 221 | }, 222 | "tailclip": { 223 | "prefix": "tailclip", 224 | "body": "tailclip=${1|true,false|}", 225 | "description": "[Principal Edge Attributes]\nif `false`, edge is not clipped to tail node boundary\n\n" 226 | }, 227 | "tailhref": { 228 | "prefix": "tailhref", 229 | "body": "tailhref=\"$1\"", 230 | "description": "[Principal Edge Attributes]\nsynonym for tailURL\n\n" 231 | }, 232 | "taillabel": { 233 | "prefix": "taillabel", 234 | "body": "taillabel=$1", 235 | "description": "[Principal Edge Attributes]\nlabel placed near tail of edgetail\n\n" 236 | }, 237 | "port": { 238 | "prefix": "port", 239 | "body": "port=${1|n,ne,e,se,s,sw,w,nw|}", 240 | "description": "[Principal Edge Attributes]\n`n`, `ne`, `e`, `se`, `s`, `sw`, `w`, `nw`\n\n" 241 | }, 242 | "tailtarget": { 243 | "prefix": "tailtarget", 244 | "body": "tailtarget=$1", 245 | "description": "[Principal Edge Attributes]\nif tailURL is set, determines browser window for URL\n\n" 246 | }, 247 | "tailtooltip": { 248 | "prefix": "tailtooltip", 249 | "body": "tailtooltip=${1:label}", 250 | "description": "[Principal Edge Attributes]\ntooltip annotation near tail of edge\n\n" 251 | }, 252 | "tailURL": { 253 | "prefix": "tailURL", 254 | "body": "tailURL=$1", 255 | "description": "[Principal Edge Attributes]\nURL attached to tail label\n\n" 256 | }, 257 | "target": { 258 | "prefix": "target", 259 | "body": "target=\"$1\"", 260 | "description": "[Principal Edge Attributes]\nif URL is set, determines browser window for URL\n\n" 261 | }, 262 | "tooltip": { 263 | "prefix": "tooltip", 264 | "body": "tooltip=\"${1:label}\"", 265 | "description": "[Principal Edge Attributes]\ntooltip annotation\n\n" 266 | }, 267 | "weight": { 268 | "prefix": "weight", 269 | "body": "weight=${1:1}", 270 | "description": "[Principal Edge Attributes]\ninteger cost of stretching an edge\n\n" 271 | } 272 | } 273 | -------------------------------------------------------------------------------- /dot/snippets/snippets/principalGraphAttributes.json: -------------------------------------------------------------------------------- 1 | { 2 | "aspect": { 3 | "prefix": "aspect", 4 | "body": "aspect=$1", 5 | "description": "[Principal Graph Attributes]\ncontrols aspect ratio adjustment\n\n" 6 | }, 7 | "bgcolor": { 8 | "prefix": "bgcolor", 9 | "body": "bgcolor=$1", 10 | "description": "[Principal Graph Attributes]\nbackground color for drawing, plus initial fill color\n\n" 11 | }, 12 | "center": { 13 | "prefix": "center", 14 | "body": "center=${1|false,true|}", 15 | "description": "[Principal Graph Attributes]\ncenter drawing on `page`\n\n" 16 | }, 17 | "clusterrank": { 18 | "prefix": "clusterrank", 19 | "body": "clusterrank=${1|local,global,none|}", 20 | "description": "[Principal Graph Attributes]\nmay be `global` or `none`\n\n" 21 | }, 22 | "color": { 23 | "prefix": "color", 24 | "body": "color=${1:black}", 25 | "description": "[Principal Graph Attributes]\nfor clusters, outline color, and fill color if `fillcolor` not defined\n\n" 26 | }, 27 | "colorscheme": { 28 | "prefix": "colorscheme", 29 | "body": "colorscheme=${1:X11}", 30 | "description": "[Principal Graph Attributes]\nscheme for interpreting color names\n\n" 31 | }, 32 | "comment": { 33 | "prefix": "comment", 34 | "body": "comment=\"$1\"", 35 | "description": "[Principal Graph Attributes]\nany string (format-dependent)\n\n" 36 | }, 37 | "compound": { 38 | "prefix": "compound", 39 | "body": "compound=${1|false,true|}", 40 | "description": "[Principal Graph Attributes]\nallow edges between clusters\n\n" 41 | }, 42 | "concentrate": { 43 | "prefix": "concentrate", 44 | "body": "concentrate=${1|false,true|}", 45 | "description": "[Principal Graph Attributes]\nenables edge concentrators\n\n" 46 | }, 47 | "dpi": { 48 | "prefix": "dpi", 49 | "body": "dpi=${1:96}", 50 | "description": "[Principal Graph Attributes]\ndots per inch for image output\n\n" 51 | }, 52 | "fillcolor": { 53 | "prefix": "fillcolor", 54 | "body": "fillcolor=${1:black}", 55 | "description": "[Principal Graph Attributes]\ncluster fill color\n\n" 56 | }, 57 | "fontcolor": { 58 | "prefix": "fontcolor", 59 | "body": "fontcolor=${1:black}", 60 | "description": "[Principal Graph Attributes]\ntype face color\n\n" 61 | }, 62 | "fontname": { 63 | "prefix": "fontname", 64 | "body": "fontname=\"${1:Times-Roman}\"", 65 | "description": "[Principal Graph Attributes]\nfont family\n\n" 66 | }, 67 | "fontnames": { 68 | "prefix": "fontnames", 69 | "body": "fontnames=\"${1|svg,ps,gd|}\"", 70 | "description": "[Principal Graph Attributes]\n`svg`,`ps`,`gd` (SVG only)\n\n" 71 | }, 72 | "fontpath": { 73 | "prefix": "fontpath", 74 | "body": "fontpath=\"${1:$TM_DIRECTORY}\"", 75 | "description": "[Principal Graph Attributes]\nlist of directories to search for fonts\n\n" 76 | }, 77 | "fontsize": { 78 | "prefix": "fontsize", 79 | "body": "fontsize=${1:14}", 80 | "description": "[Principal Graph Attributes]\npoint size of label\n\n" 81 | }, 82 | "id": { 83 | "prefix": "id", 84 | "body": "id=\"$1\"", 85 | "description": "[Principal Graph Attributes]\nany string (user-defined output object tags)\n\n" 86 | }, 87 | "label": { 88 | "prefix": "label", 89 | "body": "label=\"$1\"", 90 | "description": "[Principal Graph Attributes]\nany string\n\n" 91 | }, 92 | "labeljust": { 93 | "prefix": "labeljust", 94 | "body": "labeljust=${1|centered,l,r|}", 95 | "description": "[Principal Graph Attributes]\n`l` and `r` for left- and right-justified cluster labels, respectively\n\n" 96 | }, 97 | "labelloc": { 98 | "prefix": "labelloc", 99 | "body": "labelloc=${1|top,t,b|}", 100 | "description": "[Principal Graph Attributes]\n`t` and `b` for top- and bottom-justified cluster labels, respectively\n\n" 101 | }, 102 | "landscape": { 103 | "prefix": "landscape", 104 | "body": "landscape=${1|false,true|}", 105 | "description": "[Principal Graph Attributes]\nif true, means orientation=landscape\n\n" 106 | }, 107 | "layers": { 108 | "prefix": "layers", 109 | "body": "layers=\"$1\"", 110 | "description": "[Principal Graph Attributes]\n`id`:`id`:`id`...\n\n" 111 | }, 112 | "layersep": { 113 | "prefix": "layersep", 114 | "body": "layersep=${1:\":\"}", 115 | "description": "[Principal Graph Attributes]\nspecifies separator character to split `layers`\n\n" 116 | }, 117 | "margin": { 118 | "prefix": "margin", 119 | "body": "margin=${1:.5}", 120 | "description": "[Principal Graph Attributes]\nmargin included in `page`, inches\n\n" 121 | }, 122 | "mindist": { 123 | "prefix": "mindist", 124 | "body": "mindist=${1:1.0}", 125 | "description": "[Principal Graph Attributes]\nminimum separation between all nodes (not dot)\n\n" 126 | }, 127 | "nodesep": { 128 | "prefix": "nodesep", 129 | "body": "nodesep=${1:.25}", 130 | "description": "[Principal Graph Attributes]\nseparation between nodes, in inches\n\n" 131 | }, 132 | "nojustify": { 133 | "prefix": "nojustify", 134 | "body": "nojustify=${1|false,true|}", 135 | "description": "[Principal Graph Attributes]\nif `true`, justify to label, not graph\n\n" 136 | }, 137 | "ordering": { 138 | "prefix": "ordering", 139 | "body": "ordering=${1|out, |}", 140 | "description": "[Principal Graph Attributes]\nif `out` out edge order is preserved\n\n" 141 | }, 142 | "orientation": { 143 | "prefix": "orientation", 144 | "body": "orientation=${1|portrait,landscape|}", 145 | "description": "[Principal Graph Attributes]\nif `rotate` is not used and the value islandscape, use landscape orientation\n\n" 146 | }, 147 | "outputorder": { 148 | "prefix": "outputorder", 149 | "body": "outputorder=${1|breadthfirst,nodesfirst,edgesfirst|}", 150 | "description": "[Principal Graph Attributes]\nor `nodesfirst`, `edgesfirst`\n\n" 151 | }, 152 | "page": { 153 | "prefix": "page", 154 | "body": "page=\"$1\"", 155 | "description": "[Principal Graph Attributes]\nunit of pagination,e.g.`8.5,11`\n\n" 156 | }, 157 | "pagedir": { 158 | "prefix": "pagedir", 159 | "body": "pagedir=${1|BL,BR,TL,TR|}", 160 | "description": "[Principal Graph Attributes]\ntraversal order of pages\n\n" 161 | }, 162 | "pencolor": { 163 | "prefix": "pencolor", 164 | "body": "pencolor=${1:black}", 165 | "description": "[Principal Graph Attributes]\ncolor for drawing cluster boundaries\n\n" 166 | }, 167 | "penwidth": { 168 | "prefix": "penwidth", 169 | "body": "penwidth=${1:1.0}", 170 | "description": "[Principal Graph Attributes]\nwidth of pen for drawing boundaries, in points\n\n" 171 | }, 172 | "peripheries": { 173 | "prefix": "peripheries", 174 | "body": "peripheries=${1:1}", 175 | "description": "[Principal Graph Attributes]\nnumber of cluster boundaries\n\n" 176 | }, 177 | "rank": { 178 | "prefix": "rank", 179 | "body": "rank=${1|same,min,max,source,sink|}}", 180 | "description": "[Principal Graph Attributes]\n`same`, `min`, `max`, `source` or `sink`\n\n" 181 | }, 182 | "rankdir": { 183 | "prefix": "rankdir", 184 | "body": "rankdir=${1|TB,LR|}", 185 | "description": "[Principal Graph Attributes]\n`LR` (left to right) or `TB` (top to bottom)\n\n" 186 | }, 187 | "ranksep": { 188 | "prefix": "ranksep", 189 | "body": "ranksep=${1:.75}", 190 | "description": "[Principal Graph Attributes]\nseparation between ranks, in inches\n\n" 191 | }, 192 | "ratio": { 193 | "prefix": "ratio", 194 | "body": "ratio=${1|fill,auto|}", 195 | "description": "[Principal Graph Attributes]\napproximate aspect ratio desired, `fill` or `auto`\n\n" 196 | }, 197 | "rotate": { 198 | "prefix": "rotate", 199 | "body": "rotate=\"$1\"", 200 | "description": "[Principal Graph Attributes]\nif `90`, set orientation to landscape\n\n" 201 | }, 202 | "samplepoints": { 203 | "prefix": "samplepoints", 204 | "body": "samplepoints=${1:8}", 205 | "description": "[Principal Graph Attributes]\nnumber of points used to represent ellipses and circles on output\n\n" 206 | }, 207 | "searchsize": { 208 | "prefix": "searchsize", 209 | "body": "searchsize=${1:30}", 210 | "description": "[Principal Graph Attributes]\nmaximum edges with negative cut values to check when looking for a minimum one during network simplex\n\n" 211 | }, 212 | "size": { 213 | "prefix": "size", 214 | "body": "size=\"$1\"", 215 | "description": "[Principal Graph Attributes]\nmaximum drawing size, in inches\n\n" 216 | }, 217 | "splines": { 218 | "prefix": "splines", 219 | "body": "splines=${1|true,false|}", 220 | "description": "[Principal Graph Attributes]\ndraw edges as splines, polylines, lines\n\n" 221 | }, 222 | "style": { 223 | "prefix": "style", 224 | "body": "style=\"$1\"", 225 | "description": "[Principal Graph Attributes]\ngraphics options, e.g. `filled` for clusters\n\n" 226 | }, 227 | "stylesheet": { 228 | "prefix": "stylesheet", 229 | "body": "stylesheet=\"${1:$TM_DIRECTORY}\"", 230 | "description": "[Principal Graph Attributes]\npathname or URL to XML style sheet for SVG\n\n" 231 | }, 232 | "target": { 233 | "prefix": "target", 234 | "body": "target=\"$1\"", 235 | "description": "[Principal Graph Attributes]\nif URL is set, determines browser window for URL\n\n" 236 | }, 237 | "tooltip": { 238 | "prefix": "tooltip", 239 | "body": "tooltip=\"${1:label}\"", 240 | "description": "[Principal Graph Attributes]\ntooltip annotation for cluster\n\n" 241 | }, 242 | "truecolor": { 243 | "prefix": "truecolor", 244 | "body": "truecolor=${1|true,false|}", 245 | "description": "[Principal Graph Attributes]\nif set, force 24 bit or indexed color in image output\n\n" 246 | }, 247 | "viewport": { 248 | "prefix": "viewport", 249 | "body": "viewport=$1", 250 | "description": "[Principal Graph Attributes]\nclipping window on output\n\n" 251 | }, 252 | "URL": { 253 | "prefix": "URL", 254 | "body": "URL=\"$1\"", 255 | "description": "[Principal Graph Attributes]\nURL associated with graph (format-dependent)\n\n" 256 | } 257 | } 258 | -------------------------------------------------------------------------------- /dot/snippets/snippets/principalNodeAttributes.json: -------------------------------------------------------------------------------- 1 | { 2 | "color": { 3 | "prefix": "color", 4 | "body": "color=${1:black}", 5 | "description": "[Principal Node Attributes]\nnode shape color\n\n" 6 | }, 7 | "colorscheme": { 8 | "prefix": "colorscheme", 9 | "body": "colorscheme=${1:X11}", 10 | "description": "[Principal Node Attributes]\nscheme for interpreting color names\n\n" 11 | }, 12 | "comment": { 13 | "prefix": "comment", 14 | "body": "comment=$1", 15 | "description": "[Principal Node Attributes]\nany string (format-dependent)\n\n" 16 | }, 17 | "distortion": { 18 | "prefix": "distortion", 19 | "body": "distortion=${1:0.0}", 20 | "description": "[Principal Node Attributes]\nnode distortion for `shape=polygon`\n\n" 21 | }, 22 | "fillcolor": { 23 | "prefix": "fillcolor", 24 | "body": "fillcolor=\"${1:lightgrey/black}\"", 25 | "description": "[Principal Node Attributes]\nnode fill color\n\n" 26 | }, 27 | "fixedsize": { 28 | "prefix": "fixedsize", 29 | "body": "fixedsize=${1:false}", 30 | "description": "[Principal Node Attributes]\nlabel text has no affect on node size\n\n" 31 | }, 32 | "fontcolor": { 33 | "prefix": "fontcolor", 34 | "body": "fontcolor=${1:black}", 35 | "description": "[Principal Node Attributes]\ntype face color\n\n" 36 | }, 37 | "fontname": { 38 | "prefix": "fontname", 39 | "body": "fontname=\"${1:Times-Roman}\"", 40 | "description": "[Principal Node Attributes]\nfont family\n\n" 41 | }, 42 | "fontsize": { 43 | "prefix": "fontsize", 44 | "body": "fontsize=${1:14}", 45 | "description": "[Principal Node Attributes]\npoint size of label\n\n" 46 | }, 47 | "group": { 48 | "prefix": "group", 49 | "body": "group=$1", 50 | "description": "[Principal Node Attributes]\nname of node’s horizontal alignment group\n\n" 51 | }, 52 | "height": { 53 | "prefix": "height", 54 | "body": "height=${1:.5}", 55 | "description": "[Principal Node Attributes]\nminimum height in inches\n\n" 56 | }, 57 | "id": { 58 | "prefix": "id", 59 | "body": "id=$1", 60 | "description": "[Principal Node Attributes]\nany string (user-defined output object tags)\n\n" 61 | }, 62 | "image": { 63 | "prefix": "image", 64 | "body": "image=\"$1\"", 65 | "description": "[Principal Node Attributes]\nimage file name\n\n" 66 | }, 67 | "imagescale": { 68 | "prefix": "imagescale", 69 | "body": "imagescale=${1|false,true,width,height,both|}", 70 | "description": "[Principal Node Attributes]\n`true`, `width`, `height`, `both`\n\n" 71 | }, 72 | "label": { 73 | "prefix": "label", 74 | "body": "label=\"${1:node-name}\"", 75 | "description": "[Principal Node Attributes]\nany string\n\n" 76 | }, 77 | "labelloc": { 78 | "prefix": "labelloc", 79 | "body": "labelloc=${1:c}", 80 | "description": "[Principal Node Attributes]\nnode label vertical alignment\n\n" 81 | }, 82 | "layer": { 83 | "prefix": "layer", 84 | "body": "layer=\"${1|overlay range,all,id,id:id, |}\"", 85 | "description": "[Principal Node Attributes]\n`all`, `id` or `id:id`, or a comma-separated list of theformer\n\n" 86 | }, 87 | "margin": { 88 | "prefix": "margin", 89 | "body": "margin=\"${1:0.11,0.55}\"", 90 | "description": "[Principal Node Attributes]\nspace around label\n\n" 91 | }, 92 | "nojustify": { 93 | "prefix": "nojustify", 94 | "body": "nojustify=${1|false,true|}", 95 | "description": "[Principal Node Attributes]\nif `true`, justify to label, not node\n\n" 96 | }, 97 | "orientation": { 98 | "prefix": "orientation", 99 | "body": "orientation=${1:0.0}", 100 | "description": "[Principal Node Attributes]\nnode rotation angle\n\n" 101 | }, 102 | "penwidth": { 103 | "prefix": "penwidth", 104 | "body": "penwidth=${1:1.0}", 105 | "description": "[Principal Node Attributes]\nwidth of pen for drawing boundaries, in points\n\n" 106 | }, 107 | "peripheries": { 108 | "prefix": "peripheries", 109 | "body": "peripheries=${1:shape-dependent}", 110 | "description": "[Principal Node Attributes]\nnumber of node boundaries\n\n" 111 | }, 112 | "regular": { 113 | "prefix": "regular", 114 | "body": "regular=${1:false}", 115 | "description": "[Principal Node Attributes]\nforce polygon to be regular\n\n" 116 | }, 117 | "samplepoints": { 118 | "prefix": "samplepoints", 119 | "body": "samplepoints=${1:8 or 20}", 120 | "description": "[Principal Node Attributes]\nnumber vertices to convert circle or ellipse\n\n" 121 | }, 122 | "shape": { 123 | "prefix": "shape", 124 | "body": "shape=${1:ellipse}", 125 | "description": "[Principal Node Attributes]\nnode shape\n\n" 126 | }, 127 | "sides": { 128 | "prefix": "sides", 129 | "body": "sides=${1:4}", 130 | "description": "[Principal Node Attributes]\nnumber of sides for `shape=polygon`\n\n" 131 | }, 132 | "skew": { 133 | "prefix": "skew", 134 | "body": "skew=${1:0.0}", 135 | "description": "[Principal Node Attributes]\nskewing of node for `shape=polygon`\n\n" 136 | }, 137 | "style": { 138 | "prefix": "style", 139 | "body": "style=\"${1|bold,dotted,filled, |\"", 140 | "description": "[Principal Node Attributes]\ngraphics options, e.g. `bold`, `dotted`, `filled`\n\n" 141 | }, 142 | "target": { 143 | "prefix": "target", 144 | "body": "target=$1", 145 | "description": "[Principal Node Attributes]\nif `URL` is set, determines browser window for URL\n\n" 146 | }, 147 | "tooltip": { 148 | "prefix": "tooltip", 149 | "body": "tooltip=\"${1:label}\"", 150 | "description": "[Principal Node Attributes]\ntooltip annotation\n\n" 151 | }, 152 | "URL": { 153 | "prefix": "URL", 154 | "body": "URL=\"$1\"", 155 | "description": "[Principal Node Attributes]\nURL associated with node (format-dependent)\n\n" 156 | }, 157 | "width": { 158 | "prefix": "width", 159 | "body": "width=${1:.75}", 160 | "description": "[Principal Node Attributes]\nminimum width in inches\n\n" 161 | } 162 | } 163 | -------------------------------------------------------------------------------- /dot/syntaxes/dot.tmLanguage: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | fileTypes 6 | 7 | dot 8 | DOT 9 | 10 | firstLineMatch 11 | digraph.* 12 | keyEquivalent 13 | ^~G 14 | name 15 | Graphviz (DOT) 16 | patterns 17 | 18 | 19 | captures 20 | 21 | 1 22 | 23 | name 24 | storage.type.dot 25 | 26 | 2 27 | 28 | name 29 | variable.other.dot 30 | 31 | 4 32 | 33 | name 34 | punctuation.section.dot 35 | 36 | 37 | comment 38 | named digraph declaration: "digraph NAME {" 39 | match 40 | ?(digraph)[ \t]+([A-Za-z0-9]+) ?(\{) 41 | 42 | 43 | comment 44 | edge definition: <- -> -- 45 | match 46 | (<|-)(>|-) 47 | name 48 | keyword.operator.dot 49 | 50 | 51 | match 52 | \b(node|edge|graph|digraph|subgraph|strict)\b 53 | name 54 | storage.type.dot 55 | 56 | 57 | match 58 | \b(bottomlabel|color|comment|distortion|fillcolor|fixedsize|fontcolor|fontname|fontsize|group|height|label|layer|orientation|peripheries|regular|shape|shapefile|sides|skew|style|toplabel|URL|width|z)\b 59 | name 60 | support.constant.attribute.node.dot 61 | 62 | 63 | match 64 | \b(arrowhead|arrowsize|arrowtail|color|comment|constraint|decorate|dir|fontcolor|fontname|fontsize|headlabel|headport|headURL|label|labelangle|labeldistance|labelfloat|labelcolor|labelfontname|labelfontsize|layer|lhead|ltail|minlen|samehead|sametail|splines|style|taillabel|tailport|tailURL|weight)\b 65 | name 66 | support.constant.attribute.edge.dot 67 | 68 | 69 | match 70 | \b(bgcolor|center|clusterrank|color|comment|compound|concentrate|fillcolor|fontname|fontpath|fontsize|label|labeljust|labelloc|layers|margin|mclimit|nodesep|nslimit|nslimit1|ordering|orientation|page|pagedir|quantum|rank|rankdir|ranksep|ratio|remincross|rotate|samplepoints|searchsize|size|style|URL)\b 71 | name 72 | support.constant.attribute.graph.dot 73 | 74 | 75 | match 76 | \b(box|polygon|ellipse|circle|point|egg|triangle|plaintext|diamond|trapezium|parallelogram|house|pentagon|hexagon|septagon|octagon|doublecircle|doubleoctagon|tripleoctagon|invtriangle|invtrapezium|invhouse|Mdiamond|Msquare|Mcircle|rect|rectangle|none|note|tab|folder|box3d|component|max|min|same)\b 77 | name 78 | variable.other.dot 79 | 80 | 81 | begin 82 | " 83 | beginCaptures 84 | 85 | 0 86 | 87 | name 88 | punctuation.definition.string.begin.dot 89 | 90 | 91 | end 92 | " 93 | endCaptures 94 | 95 | 0 96 | 97 | name 98 | punctuation.definition.string.end.dot 99 | 100 | 101 | name 102 | string.quoted.double.dot 103 | patterns 104 | 105 | 106 | match 107 | \\. 108 | name 109 | constant.character.escape.dot 110 | 111 | 112 | 113 | 114 | begin 115 | (^[ \t]+)?(?=//) 116 | beginCaptures 117 | 118 | 1 119 | 120 | name 121 | punctuation.whitespace.comment.leading.dot 122 | 123 | 124 | end 125 | (?!\G) 126 | patterns 127 | 128 | 129 | begin 130 | // 131 | beginCaptures 132 | 133 | 0 134 | 135 | name 136 | punctuation.definition.comment.dot 137 | 138 | 139 | end 140 | \n 141 | name 142 | comment.line.double-slash.dot 143 | 144 | 145 | 146 | 147 | begin 148 | (^[ \t]+)?(?=#) 149 | beginCaptures 150 | 151 | 1 152 | 153 | name 154 | punctuation.whitespace.comment.leading.dot 155 | 156 | 157 | end 158 | (?!\G) 159 | patterns 160 | 161 | 162 | begin 163 | # 164 | beginCaptures 165 | 166 | 0 167 | 168 | name 169 | punctuation.definition.comment.dot 170 | 171 | 172 | end 173 | \n 174 | name 175 | comment.line.number-sign.dot 176 | 177 | 178 | 179 | 180 | begin 181 | /\* 182 | captures 183 | 184 | 0 185 | 186 | name 187 | punctuation.definition.comment.dot 188 | 189 | 190 | end 191 | \*/ 192 | name 193 | comment.block.dot 194 | 195 | 196 | scopeName 197 | source.dot 198 | uuid 199 | 1A53D54E-6B1D-11D9-A006-000D93589AF6 200 | 201 | 202 | -------------------------------------------------------------------------------- /img/GraphvizLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Stephanvs/vscode-graphviz/fd44e3010a42eaba90b62a18dbd035f6d3748bd5/img/GraphvizLogo.png -------------------------------------------------------------------------------- /img/syntax.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Stephanvs/vscode-graphviz/fd44e3010a42eaba90b62a18dbd035f6d3748bd5/img/syntax.png -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "dot", 3 | "displayName": "Graphviz (dot) language support for Visual Studio Code", 4 | "description": "This extension provides GraphViz (dot) language support for Visual Studio Code", 5 | "version": "0.1.0", 6 | "contributors": [ 7 | "Dennis Pettersson " 8 | ], 9 | "publisher": "Stephanvs", 10 | "engines": { 11 | "vscode": "^0.10.1" 12 | }, 13 | "icon": "img/GraphvizLogo.png", 14 | "galleryBanner": { 15 | "color": "#69c", 16 | "theme": "light" 17 | }, 18 | "categories": [ 19 | "Programming Languages", 20 | "Snippets" 21 | ], 22 | "contributes": { 23 | "languages": [ 24 | { 25 | "id": "dot", 26 | "aliases": [ 27 | "Graphviz (DOT)", 28 | "dot" 29 | ], 30 | "extensions": [ 31 | ".dot", 32 | ".DOT", 33 | ".gv" 34 | ], 35 | "configuration": "dot/dot.configuration.json" 36 | } 37 | ], 38 | "grammars": [ 39 | { 40 | "language": "dot", 41 | "scopeName": "source.dot", 42 | "path": "dot/syntaxes/dot.tmLanguage" 43 | } 44 | ], 45 | "snippets": [ 46 | { 47 | "language": "dot", 48 | "path": "dot/snippets/snippets/dot.json" 49 | }, 50 | { 51 | "language": "dot", 52 | "path": "dot/snippets/snippets/principalNodeAttributes.json" 53 | }, 54 | { 55 | "language": "dot", 56 | "path": "dot/snippets/snippets/principalEdgeAttributes.json" 57 | }, 58 | { 59 | "language": "dot", 60 | "path": "dot/snippets/snippets/principalGraphAttributes.json" 61 | } 62 | ] 63 | }, 64 | "license": "https://github.com/Stephanvs/vscode-graphviz/blob/master/LICENSE", 65 | "bugs": { 66 | "url": "https://github.com/Stephanvs/vscode-graphviz/issues" 67 | }, 68 | "homepage": "https://github.com/Stephanvs/vscode-graphviz/blob/master/README.md", 69 | "repository": { 70 | "type": "git", 71 | "url": "https://github.com/Stephanvs/vscode-graphviz.git" 72 | } 73 | } 74 | --------------------------------------------------------------------------------