package.dist.chunks.mermaid.esm.min.chunk-4BPNZXC3.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": "gGAKA,SAASA,EAAMC,EAAG,CAChB,IAAIC,EAAO,CACT,QAAS,CACP,SAAUD,EAAE,WAAW,EACvB,WAAYA,EAAE,aAAa,EAC3B,SAAUA,EAAE,WAAW,CACzB,EACA,MAAOE,EAAWF,CAAC,EACnB,MAAOG,EAAWH,CAAC,CACrB,EACA,OAAOI,EAAYJ,EAAE,MAAM,CAAC,IAC1BC,EAAK,MAAUI,EAAML,EAAE,MAAM,CAAC,GAEzBC,CACT,CAdSK,EAAAP,EAAA,SAgBT,SAASG,EAAWF,EAAG,CACrB,OAASO,EAAIP,EAAE,MAAM,EAAG,SAAUQ,EAAG,CACnC,IAAIC,EAAYT,EAAE,KAAKQ,CAAC,EACpBE,EAASV,EAAE,OAAOQ,CAAC,EACnBG,EAAO,CAAE,EAAGH,CAAE,EAClB,OAAOJ,EAAYK,CAAS,IAC1BE,EAAK,MAAQF,GAERL,EAAYM,CAAM,IACvBC,EAAK,OAASD,GAETC,CACT,CAAC,CACH,CAbSL,EAAAJ,EAAA,cAeT,SAASC,EAAWH,EAAG,CACrB,OAASO,EAAIP,EAAE,MAAM,EAAG,SAAUY,EAAG,CACnC,IAAIC,EAAYb,EAAE,KAAKY,CAAC,EACpBE,EAAO,CAAE,EAAGF,EAAE,EAAG,EAAGA,EAAE,CAAE,EAC5B,OAAOR,EAAYQ,EAAE,IAAI,IACvBE,EAAK,KAAOF,EAAE,MAETR,EAAYS,CAAS,IAC1BC,EAAK,MAAQD,GAERC,CACT,CAAC,CACH,CAZSR,EAAAH,EAAA",
"names": ["write", "g", "json", "writeNodes", "writeEdges", "isUndefined_default", "clone_default", "__name", "map_default", "v", "nodeValue", "parent", "node", "e", "edgeValue", "edge"]
}