package.dist.chunks.mermaid.esm.chunk-B7GIP3BC.mjs.map Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mermaid Show documentation
Show all versions of mermaid Show documentation
Markdown-ish syntax for generating flowcharts, mindmaps, sequence diagrams, class diagrams, gantt charts, git graphs and more.
{
"version": 3,
"sources": ["../../../../../node_modules/.pnpm/[email protected]/node_modules/dagre-d3-es/src/graphlib/json.js"],
"sourcesContent": ["import * as _ from 'lodash-es';\nimport { Graph } from './graph.js';\n\nexport { write, read };\n\nfunction write(g) {\n var json = {\n options: {\n directed: g.isDirected(),\n multigraph: g.isMultigraph(),\n compound: g.isCompound(),\n },\n nodes: writeNodes(g),\n edges: writeEdges(g),\n };\n if (!_.isUndefined(g.graph())) {\n json.value = _.clone(g.graph());\n }\n return json;\n}\n\nfunction writeNodes(g) {\n return _.map(g.nodes(), function (v) {\n var nodeValue = g.node(v);\n var parent = g.parent(v);\n var node = { v: v };\n if (!_.isUndefined(nodeValue)) {\n node.value = nodeValue;\n }\n if (!_.isUndefined(parent)) {\n node.parent = parent;\n }\n return node;\n });\n}\n\nfunction writeEdges(g) {\n return _.map(g.edges(), function (e) {\n var edgeValue = g.edge(e);\n var edge = { v: e.v, w: e.w };\n if (!_.isUndefined(e.name)) {\n edge.name = e.name;\n }\n if (!_.isUndefined(edgeValue)) {\n edge.value = edgeValue;\n }\n return edge;\n });\n}\n\nfunction read(json) {\n var g = new Graph(json.options).setGraph(json.value);\n _.each(json.nodes, function (entry) {\n g.setNode(entry.v, entry.value);\n if (entry.parent) {\n g.setParent(entry.v, entry.parent);\n }\n });\n _.each(json.edges, function (entry) {\n g.setEdge({ v: entry.v, w: entry.w, name: entry.name }, entry.value);\n });\n return g;\n}\n"],
"mappings": ";;;;;;;;;;AAKA,SAAS,MAAM,GAAG;AAChB,MAAI,OAAO;AAAA,IACT,SAAS;AAAA,MACP,UAAU,EAAE,WAAW;AAAA,MACvB,YAAY,EAAE,aAAa;AAAA,MAC3B,UAAU,EAAE,WAAW;AAAA,IACzB;AAAA,IACA,OAAO,WAAW,CAAC;AAAA,IACnB,OAAO,WAAW,CAAC;AAAA,EACrB;AACA,MAAI,CAAG,oBAAY,EAAE,MAAM,CAAC,GAAG;AAC7B,SAAK,QAAU,cAAM,EAAE,MAAM,CAAC;AAAA,EAChC;AACA,SAAO;AACT;AAdS;AAgBT,SAAS,WAAW,GAAG;AACrB,SAAS,YAAI,EAAE,MAAM,GAAG,SAAU,GAAG;AACnC,QAAI,YAAY,EAAE,KAAK,CAAC;AACxB,QAAI,SAAS,EAAE,OAAO,CAAC;AACvB,QAAI,OAAO,EAAE,EAAK;AAClB,QAAI,CAAG,oBAAY,SAAS,GAAG;AAC7B,WAAK,QAAQ;AAAA,IACf;AACA,QAAI,CAAG,oBAAY,MAAM,GAAG;AAC1B,WAAK,SAAS;AAAA,IAChB;AACA,WAAO;AAAA,EACT,CAAC;AACH;AAbS;AAeT,SAAS,WAAW,GAAG;AACrB,SAAS,YAAI,EAAE,MAAM,GAAG,SAAU,GAAG;AACnC,QAAI,YAAY,EAAE,KAAK,CAAC;AACxB,QAAI,OAAO,EAAE,GAAG,EAAE,GAAG,GAAG,EAAE,EAAE;AAC5B,QAAI,CAAG,oBAAY,EAAE,IAAI,GAAG;AAC1B,WAAK,OAAO,EAAE;AAAA,IAChB;AACA,QAAI,CAAG,oBAAY,SAAS,GAAG;AAC7B,WAAK,QAAQ;AAAA,IACf;AACA,WAAO;AAAA,EACT,CAAC;AACH;AAZS;",
"names": []
}