"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([["6467"],{8317:function(e,n,a){a.r(n),a.d(n,{default:()=>g,frontMatter:()=>d,metadata:()=>i,assets:()=>r,toc:()=>h,contentTitle:()=>c});var i=JSON.parse('{"id":"languages/diagrams","title":"Diagrams","description":"Overview","source":"@site/docs/languages/diagrams.mdx","sourceDirName":"languages","slug":"/languages/diagrams","permalink":"/docs/languages/diagrams","draft":false,"unlisted":false,"editUrl":"https://github.com/live-codes/livecodes/tree/develop/docs/docs/languages/diagrams.mdx","tags":[],"version":"current","frontMatter":{},"sidebar":"docsSidebar","previous":{"title":"cssnano","permalink":"/docs/languages/cssnano"},"next":{"title":"doT","permalink":"/docs/languages/dot"}}'),t=a("5893"),l=a("65");function s(e){let n=e.id?`/?x=id/${e.id}`:e.template?`/?template=${e.template}`:"/";return(0,t.jsx)("a",{href:n,target:"_blank",children:e.children||"open in LiveCodes"})}let d={},c="Diagrams",r={},h=[{value:"Overview",id:"overview",level:2},{value:"Usage",id:"usage",level:2},{value:"1. Add a diagram target:",id:"1-add-a-diagram-target",level:4},{value:"2. Add a script element with the diagram syntax:",id:"2-add-a-script-element-with-the-diagram-syntax",level:4},{value:"Supported Libraries",id:"supported-libraries",level:2},{value:"Cytoscape",id:"cytoscape",level:3},{value:"ELK",id:"elk",level:3},{value:"Gnuplot",id:"gnuplot",level:3},{value:"Graphviz",id:"graphviz",level:3},{value:"Mermaid",id:"mermaid",level:3},{value:"Nomnoml",id:"nomnoml",level:3},{value:"Pintora",id:"pintora",level:3},{value:"Plotly",id:"plotly",level:3},{value:"Svgbob",id:"svgbob",level:3},{value:"Vega",id:"vega",level:3},{value:"VegaLite",id:"vegalite",level:3},{value:"WaveDrom",id:"wavedrom",level:3}];function o(e){let n={a:"a",code:"code",h1:"h1",h2:"h2",h3:"h3",h4:"h4",header:"header",img:"img",li:"li",p:"p",pre:"pre",ul:"ul",...(0,l.a)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.header,{children:(0,t.jsx)(n.h1,{id:"diagrams",children:"Diagrams"})}),"\n","\n",(0,t.jsx)(n.h2,{id:"overview",children:"Overview"}),"\n",(0,t.jsx)(n.p,{children:"Diagrams-as-code."}),"\n",(0,t.jsxs)(n.p,{children:["Allows using syntax for multiple visualization libraries inside HTML to produce diagrams.\nThe rendered diagrams are added to the ",(0,t.jsx)(n.a,{href:"/docs/features/result",children:"result page"})," as either:"]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsx)(n.li,{children:"SVG elements (which you can style with CSS or manipulate with JavaScript)"}),"\n",(0,t.jsx)(n.li,{children:"HTML images (which you can right-click and save or open in a new window)"}),"\n"]}),"\n",(0,t.jsx)(n.p,{children:"Diagrams from multiple libraries can be used in the same page. Only the libraries used will be loaded in the LiveCodes playground. The result page will have no libraries (only the output SVG or images)."}),"\n",(0,t.jsx)(s,{template:"diagrams",children:"Open starter template in LiveCodes"}),"\n",(0,t.jsx)(n.h2,{id:"usage",children:"Usage"}),"\n",(0,t.jsxs)(n.p,{children:["This code: (",(0,t.jsx)(s,{id:"2m8u9hgeiq4"}),")"]}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-html",children:'
\n\n