cullmann.io/themes/blowfish/assets/lib/mermaid/flowDiagram-42bb1e4d.js.map

1 line
40 KiB
Plaintext

{"version":3,"file":"flowDiagram-42bb1e4d.js","sources":["../src/diagrams/flowchart/flowChartShapes.js","../src/diagrams/flowchart/flowRenderer.js","../src/diagrams/flowchart/flowDiagram.ts"],"sourcesContent":["import { intersectPolygon } from 'dagre-d3-es/src/dagre-js/intersect/intersect-polygon.js';\nimport { intersectRect } from 'dagre-d3-es/src/dagre-js/intersect/intersect-rect.js';\n\n/**\n * @param parent\n * @param bbox\n * @param node\n */\nfunction question(parent, bbox, node) {\n const w = bbox.width;\n const h = bbox.height;\n const s = (w + h) * 0.9;\n const points = [\n { x: s / 2, y: 0 },\n { x: s, y: -s / 2 },\n { x: s / 2, y: -s },\n { x: 0, y: -s / 2 },\n ];\n const shapeSvg = insertPolygonShape(parent, s, s, points);\n node.intersect = function (point) {\n return intersectPolygon(node, points, point);\n };\n return shapeSvg;\n}\n\n/**\n * @param parent\n * @param bbox\n * @param node\n */\nfunction hexagon(parent, bbox, node) {\n const f = 4;\n const h = bbox.height;\n const m = h / f;\n const w = bbox.width + 2 * m;\n const points = [\n { x: m, y: 0 },\n { x: w - m, y: 0 },\n { x: w, y: -h / 2 },\n { x: w - m, y: -h },\n { x: m, y: -h },\n { x: 0, y: -h / 2 },\n ];\n const shapeSvg = insertPolygonShape(parent, w, h, points);\n node.intersect = function (point) {\n return intersectPolygon(node, points, point);\n };\n return shapeSvg;\n}\n\n/**\n * @param parent\n * @param bbox\n * @param node\n */\nfunction rect_left_inv_arrow(parent, bbox, node) {\n const w = bbox.width;\n const h = bbox.height;\n const points = [\n { x: -h / 2, y: 0 },\n { x: w, y: 0 },\n { x: w, y: -h },\n { x: -h / 2, y: -h },\n { x: 0, y: -h / 2 },\n ];\n const shapeSvg = insertPolygonShape(parent, w, h, points);\n node.intersect = function (point) {\n return intersectPolygon(node, points, point);\n };\n return shapeSvg;\n}\n\n/**\n * @param parent\n * @param bbox\n * @param node\n */\nfunction lean_right(parent, bbox, node) {\n const w = bbox.width;\n const h = bbox.height;\n const points = [\n { x: (-2 * h) / 6, y: 0 },\n { x: w - h / 6, y: 0 },\n { x: w + (2 * h) / 6, y: -h },\n { x: h / 6, y: -h },\n ];\n const shapeSvg = insertPolygonShape(parent, w, h, points);\n node.intersect = function (point) {\n return intersectPolygon(node, points, point);\n };\n return shapeSvg;\n}\n\n/**\n * @param parent\n * @param bbox\n * @param node\n */\nfunction lean_left(parent, bbox, node) {\n const w = bbox.width;\n const h = bbox.height;\n const points = [\n { x: (2 * h) / 6, y: 0 },\n { x: w + h / 6, y: 0 },\n { x: w - (2 * h) / 6, y: -h },\n { x: -h / 6, y: -h },\n ];\n const shapeSvg = insertPolygonShape(parent, w, h, points);\n node.intersect = function (point) {\n return intersectPolygon(node, points, point);\n };\n return shapeSvg;\n}\n\n/**\n * @param parent\n * @param bbox\n * @param node\n */\nfunction trapezoid(parent, bbox, node) {\n const w = bbox.width;\n const h = bbox.height;\n const points = [\n { x: (-2 * h) / 6, y: 0 },\n { x: w + (2 * h) / 6, y: 0 },\n { x: w - h / 6, y: -h },\n { x: h / 6, y: -h },\n ];\n const shapeSvg = insertPolygonShape(parent, w, h, points);\n node.intersect = function (point) {\n return intersectPolygon(node, points, point);\n };\n return shapeSvg;\n}\n\n/**\n * @param parent\n * @param bbox\n * @param node\n */\nfunction inv_trapezoid(parent, bbox, node) {\n const w = bbox.width;\n const h = bbox.height;\n const points = [\n { x: h / 6, y: 0 },\n { x: w - h / 6, y: 0 },\n { x: w + (2 * h) / 6, y: -h },\n { x: (-2 * h) / 6, y: -h },\n ];\n const shapeSvg = insertPolygonShape(parent, w, h, points);\n node.intersect = function (point) {\n return intersectPolygon(node, points, point);\n };\n return shapeSvg;\n}\n\n/**\n * @param parent\n * @param bbox\n * @param node\n */\nfunction rect_right_inv_arrow(parent, bbox, node) {\n const w = bbox.width;\n const h = bbox.height;\n const points = [\n { x: 0, y: 0 },\n { x: w + h / 2, y: 0 },\n { x: w, y: -h / 2 },\n { x: w + h / 2, y: -h },\n { x: 0, y: -h },\n ];\n const shapeSvg = insertPolygonShape(parent, w, h, points);\n node.intersect = function (point) {\n return intersectPolygon(node, points, point);\n };\n return shapeSvg;\n}\n\n/**\n * @param parent\n * @param bbox\n * @param node\n */\nfunction stadium(parent, bbox, node) {\n const h = bbox.height;\n const w = bbox.width + h / 4;\n\n const shapeSvg = parent\n .insert('rect', ':first-child')\n .attr('rx', h / 2)\n .attr('ry', h / 2)\n .attr('x', -w / 2)\n .attr('y', -h / 2)\n .attr('width', w)\n .attr('height', h);\n\n node.intersect = function (point) {\n return intersectRect(node, point);\n };\n return shapeSvg;\n}\n\n/**\n * @param parent\n * @param bbox\n * @param node\n */\nfunction subroutine(parent, bbox, node) {\n const w = bbox.width;\n const h = bbox.height;\n const points = [\n { x: 0, y: 0 },\n { x: w, y: 0 },\n { x: w, y: -h },\n { x: 0, y: -h },\n { x: 0, y: 0 },\n { x: -8, y: 0 },\n { x: w + 8, y: 0 },\n { x: w + 8, y: -h },\n { x: -8, y: -h },\n { x: -8, y: 0 },\n ];\n const shapeSvg = insertPolygonShape(parent, w, h, points);\n node.intersect = function (point) {\n return intersectPolygon(node, points, point);\n };\n return shapeSvg;\n}\n\n/**\n * @param parent\n * @param bbox\n * @param node\n */\nfunction cylinder(parent, bbox, node) {\n const w = bbox.width;\n const rx = w / 2;\n const ry = rx / (2.5 + w / 50);\n const h = bbox.height + ry;\n\n const shape =\n 'M 0,' +\n ry +\n ' a ' +\n rx +\n ',' +\n ry +\n ' 0,0,0 ' +\n w +\n ' 0 a ' +\n rx +\n ',' +\n ry +\n ' 0,0,0 ' +\n -w +\n ' 0 l 0,' +\n h +\n ' a ' +\n rx +\n ',' +\n ry +\n ' 0,0,0 ' +\n w +\n ' 0 l 0,' +\n -h;\n\n const shapeSvg = parent\n .attr('label-offset-y', ry)\n .insert('path', ':first-child')\n .attr('d', shape)\n .attr('transform', 'translate(' + -w / 2 + ',' + -(h / 2 + ry) + ')');\n\n node.intersect = function (point) {\n const pos = intersectRect(node, point);\n const x = pos.x - node.x;\n\n if (\n rx != 0 &&\n (Math.abs(x) < node.width / 2 ||\n (Math.abs(x) == node.width / 2 && Math.abs(pos.y - node.y) > node.height / 2 - ry))\n ) {\n // ellipsis equation: x*x / a*a + y*y / b*b = 1\n // solve for y to get adjusted value for pos.y\n let y = ry * ry * (1 - (x * x) / (rx * rx));\n if (y != 0) {\n y = Math.sqrt(y);\n }\n y = ry - y;\n if (point.y - node.y > 0) {\n y = -y;\n }\n\n pos.y += y;\n }\n\n return pos;\n };\n\n return shapeSvg;\n}\n\n/** @param render */\nexport function addToRender(render) {\n render.shapes().question = question;\n render.shapes().hexagon = hexagon;\n render.shapes().stadium = stadium;\n render.shapes().subroutine = subroutine;\n render.shapes().cylinder = cylinder;\n\n // Add custom shape for box with inverted arrow on left side\n render.shapes().rect_left_inv_arrow = rect_left_inv_arrow;\n\n // Add custom shape for box with inverted arrow on left side\n render.shapes().lean_right = lean_right;\n\n // Add custom shape for box with inverted arrow on left side\n render.shapes().lean_left = lean_left;\n\n // Add custom shape for box with inverted arrow on left side\n render.shapes().trapezoid = trapezoid;\n\n // Add custom shape for box with inverted arrow on left side\n render.shapes().inv_trapezoid = inv_trapezoid;\n\n // Add custom shape for box with inverted arrow on right side\n render.shapes().rect_right_inv_arrow = rect_right_inv_arrow;\n}\n\n/** @param addShape */\nexport function addToRenderV2(addShape) {\n addShape({ question });\n addShape({ hexagon });\n addShape({ stadium });\n addShape({ subroutine });\n addShape({ cylinder });\n\n // Add custom shape for box with inverted arrow on left side\n addShape({ rect_left_inv_arrow });\n\n // Add custom shape for box with inverted arrow on left side\n addShape({ lean_right });\n\n // Add custom shape for box with inverted arrow on left side\n addShape({ lean_left });\n\n // Add custom shape for box with inverted arrow on left side\n addShape({ trapezoid });\n\n // Add custom shape for box with inverted arrow on left side\n addShape({ inv_trapezoid });\n\n // Add custom shape for box with inverted arrow on right side\n addShape({ rect_right_inv_arrow });\n}\n\n/**\n * @param parent\n * @param w\n * @param h\n * @param points\n */\nfunction insertPolygonShape(parent, w, h, points) {\n return parent\n .insert('polygon', ':first-child')\n .attr(\n 'points',\n points\n .map(function (d) {\n return d.x + ',' + d.y;\n })\n .join(' ')\n )\n .attr('transform', 'translate(' + -w / 2 + ',' + h / 2 + ')');\n}\n\nexport default {\n addToRender,\n addToRenderV2,\n};\n","import * as graphlib from 'dagre-d3-es/src/graphlib/index.js';\nimport { select, curveLinear, selectAll } from 'd3';\nimport { getConfig } from '../../config';\nimport { render as Render } from 'dagre-d3-es';\nimport { applyStyle } from 'dagre-d3-es/src/dagre-js/util.js';\nimport { addHtmlLabel } from 'dagre-d3-es/src/dagre-js/label/add-html-label.js';\nimport { log } from '../../logger';\nimport common, { evaluate } from '../common/common';\nimport { interpolateToCurve, getStylesFromArray } from '../../utils';\nimport { setupGraphViewbox } from '../../setupGraphViewbox';\nimport flowChartShapes from './flowChartShapes';\n\nconst conf = {};\nexport const setConf = function (cnf) {\n const keys = Object.keys(cnf);\n for (const key of keys) {\n conf[key] = cnf[key];\n }\n};\n\n/**\n * Function that adds the vertices found in the graph definition to the graph to be rendered.\n *\n * @param vert Object containing the vertices.\n * @param g The graph that is to be drawn.\n * @param svgId\n * @param root\n * @param _doc\n * @param diagObj\n */\nexport const addVertices = function (vert, g, svgId, root, _doc, diagObj) {\n const svg = !root ? select(`[id=\"${svgId}\"]`) : root.select(`[id=\"${svgId}\"]`);\n const doc = !_doc ? document : _doc;\n const keys = Object.keys(vert);\n\n // Iterate through each item in the vertex object (containing all the vertices found) in the graph definition\n keys.forEach(function (id) {\n const vertex = vert[id];\n\n /**\n * Variable for storing the classes for the vertex\n *\n * @type {string}\n */\n let classStr = 'default';\n if (vertex.classes.length > 0) {\n classStr = vertex.classes.join(' ');\n }\n\n const styles = getStylesFromArray(vertex.styles);\n\n // Use vertex id as text in the box if no text is provided by the graph definition\n let vertexText = vertex.text !== undefined ? vertex.text : vertex.id;\n\n // We create a SVG label, either by delegating to addHtmlLabel or manually\n let vertexNode;\n if (evaluate(getConfig().flowchart.htmlLabels)) {\n // TODO: addHtmlLabel accepts a labelStyle. Do we possibly have that?\n const node = {\n label: vertexText.replace(\n /fa[blrs]?:fa-[\\w-]+/g,\n (s) => `<i class='${s.replace(':', ' ')}'></i>`\n ),\n };\n vertexNode = addHtmlLabel(svg, node).node();\n vertexNode.parentNode.removeChild(vertexNode);\n } else {\n const svgLabel = doc.createElementNS('http://www.w3.org/2000/svg', 'text');\n svgLabel.setAttribute('style', styles.labelStyle.replace('color:', 'fill:'));\n\n const rows = vertexText.split(common.lineBreakRegex);\n\n for (const row of rows) {\n const tspan = doc.createElementNS('http://www.w3.org/2000/svg', 'tspan');\n tspan.setAttributeNS('http://www.w3.org/XML/1998/namespace', 'xml:space', 'preserve');\n tspan.setAttribute('dy', '1em');\n tspan.setAttribute('x', '1');\n tspan.textContent = row;\n svgLabel.appendChild(tspan);\n }\n vertexNode = svgLabel;\n }\n\n let radious = 0;\n let _shape = '';\n // Set the shape based parameters\n switch (vertex.type) {\n case 'round':\n radious = 5;\n _shape = 'rect';\n break;\n case 'square':\n _shape = 'rect';\n break;\n case 'diamond':\n _shape = 'question';\n break;\n case 'hexagon':\n _shape = 'hexagon';\n break;\n case 'odd':\n _shape = 'rect_left_inv_arrow';\n break;\n case 'lean_right':\n _shape = 'lean_right';\n break;\n case 'lean_left':\n _shape = 'lean_left';\n break;\n case 'trapezoid':\n _shape = 'trapezoid';\n break;\n case 'inv_trapezoid':\n _shape = 'inv_trapezoid';\n break;\n case 'odd_right':\n _shape = 'rect_left_inv_arrow';\n break;\n case 'circle':\n _shape = 'circle';\n break;\n case 'ellipse':\n _shape = 'ellipse';\n break;\n case 'stadium':\n _shape = 'stadium';\n break;\n case 'subroutine':\n _shape = 'subroutine';\n break;\n case 'cylinder':\n _shape = 'cylinder';\n break;\n case 'group':\n _shape = 'rect';\n break;\n default:\n _shape = 'rect';\n }\n // Add the node\n log.warn('Adding node', vertex.id, vertex.domId);\n g.setNode(diagObj.db.lookUpDomId(vertex.id), {\n labelType: 'svg',\n labelStyle: styles.labelStyle,\n shape: _shape,\n label: vertexNode,\n rx: radious,\n ry: radious,\n class: classStr,\n style: styles.style,\n id: diagObj.db.lookUpDomId(vertex.id),\n });\n });\n};\n\n/**\n * Add edges to graph based on parsed graph definition\n *\n * @param {object} edges The edges to add to the graph\n * @param {object} g The graph object\n * @param diagObj\n */\nexport const addEdges = function (edges, g, diagObj) {\n let cnt = 0;\n\n let defaultStyle;\n let defaultLabelStyle;\n\n if (edges.defaultStyle !== undefined) {\n const defaultStyles = getStylesFromArray(edges.defaultStyle);\n defaultStyle = defaultStyles.style;\n defaultLabelStyle = defaultStyles.labelStyle;\n }\n\n edges.forEach(function (edge) {\n cnt++;\n\n // Identify Link\n var linkId = 'L-' + edge.start + '-' + edge.end;\n var linkNameStart = 'LS-' + edge.start;\n var linkNameEnd = 'LE-' + edge.end;\n\n const edgeData = {};\n\n // Set link type for rendering\n if (edge.type === 'arrow_open') {\n edgeData.arrowhead = 'none';\n } else {\n edgeData.arrowhead = 'normal';\n }\n\n let style = '';\n let labelStyle = '';\n\n if (edge.style !== undefined) {\n const styles = getStylesFromArray(edge.style);\n style = styles.style;\n labelStyle = styles.labelStyle;\n } else {\n switch (edge.stroke) {\n case 'normal':\n style = 'fill:none';\n if (defaultStyle !== undefined) {\n style = defaultStyle;\n }\n if (defaultLabelStyle !== undefined) {\n labelStyle = defaultLabelStyle;\n }\n break;\n case 'dotted':\n style = 'fill:none;stroke-width:2px;stroke-dasharray:3;';\n break;\n case 'thick':\n style = ' stroke-width: 3.5px;fill:none';\n break;\n }\n }\n\n edgeData.style = style;\n edgeData.labelStyle = labelStyle;\n\n if (edge.interpolate !== undefined) {\n edgeData.curve = interpolateToCurve(edge.interpolate, curveLinear);\n } else if (edges.defaultInterpolate !== undefined) {\n edgeData.curve = interpolateToCurve(edges.defaultInterpolate, curveLinear);\n } else {\n edgeData.curve = interpolateToCurve(conf.curve, curveLinear);\n }\n\n if (edge.text === undefined) {\n if (edge.style !== undefined) {\n edgeData.arrowheadStyle = 'fill: #333';\n }\n } else {\n edgeData.arrowheadStyle = 'fill: #333';\n edgeData.labelpos = 'c';\n\n if (evaluate(getConfig().flowchart.htmlLabels)) {\n edgeData.labelType = 'html';\n edgeData.label = `<span id=\"L-${linkId}\" class=\"edgeLabel L-${linkNameStart}' L-${linkNameEnd}\" style=\"${\n edgeData.labelStyle\n }\">${edge.text.replace(\n /fa[blrs]?:fa-[\\w-]+/g,\n (s) => `<i class='${s.replace(':', ' ')}'></i>`\n )}</span>`;\n } else {\n edgeData.labelType = 'text';\n edgeData.label = edge.text.replace(common.lineBreakRegex, '\\n');\n\n if (edge.style === undefined) {\n edgeData.style = edgeData.style || 'stroke: #333; stroke-width: 1.5px;fill:none';\n }\n\n edgeData.labelStyle = edgeData.labelStyle.replace('color:', 'fill:');\n }\n }\n\n edgeData.id = linkId;\n edgeData.class = linkNameStart + ' ' + linkNameEnd;\n edgeData.minlen = edge.length || 1;\n\n // Add the edge to the graph\n g.setEdge(diagObj.db.lookUpDomId(edge.start), diagObj.db.lookUpDomId(edge.end), edgeData, cnt);\n });\n};\n\n/**\n * Returns the all the styles from classDef statements in the graph definition.\n *\n * @param text\n * @param diagObj\n * @returns {object} ClassDef styles\n */\nexport const getClasses = function (text, diagObj) {\n log.info('Extracting classes');\n diagObj.db.clear();\n try {\n // Parse the graph definition\n diagObj.parse(text);\n return diagObj.db.getClasses();\n } catch (e) {\n log.error(e);\n return {};\n }\n};\n\n/**\n * Draws a flowchart in the tag with id: id based on the graph definition in text.\n *\n * @param text\n * @param id\n * @param _version\n * @param diagObj\n */\nexport const draw = function (text, id, _version, diagObj) {\n log.info('Drawing flowchart');\n diagObj.db.clear();\n const { securityLevel, flowchart: conf } = getConfig();\n let sandboxElement;\n if (securityLevel === 'sandbox') {\n sandboxElement = select('#i' + id);\n }\n const root =\n securityLevel === 'sandbox'\n ? select(sandboxElement.nodes()[0].contentDocument.body)\n : select('body');\n const doc = securityLevel === 'sandbox' ? sandboxElement.nodes()[0].contentDocument : document;\n\n // Parse the graph definition\n try {\n diagObj.parser.parse(text);\n } catch (err) {\n log.debug('Parsing failed');\n }\n\n // Fetch the default direction, use TD if none was found\n let dir = diagObj.db.getDirection();\n if (dir === undefined) {\n dir = 'TD';\n }\n const nodeSpacing = conf.nodeSpacing || 50;\n const rankSpacing = conf.rankSpacing || 50;\n\n // Create the input mermaid.graph\n const g = new graphlib.Graph({\n multigraph: true,\n compound: true,\n })\n .setGraph({\n rankdir: dir,\n nodesep: nodeSpacing,\n ranksep: rankSpacing,\n marginx: 8,\n marginy: 8,\n })\n .setDefaultEdgeLabel(function () {\n return {};\n });\n\n let subG;\n const subGraphs = diagObj.db.getSubGraphs();\n for (let i = subGraphs.length - 1; i >= 0; i--) {\n subG = subGraphs[i];\n diagObj.db.addVertex(subG.id, subG.title, 'group', undefined, subG.classes);\n }\n\n // Fetch the vertices/nodes and edges/links from the parsed graph definition\n const vert = diagObj.db.getVertices();\n log.warn('Get vertices', vert);\n\n const edges = diagObj.db.getEdges();\n\n let i = 0;\n for (i = subGraphs.length - 1; i >= 0; i--) {\n subG = subGraphs[i];\n\n selectAll('cluster').append('text');\n\n for (let j = 0; j < subG.nodes.length; j++) {\n log.warn(\n 'Setting subgraph',\n subG.nodes[j],\n diagObj.db.lookUpDomId(subG.nodes[j]),\n diagObj.db.lookUpDomId(subG.id)\n );\n g.setParent(diagObj.db.lookUpDomId(subG.nodes[j]), diagObj.db.lookUpDomId(subG.id));\n }\n }\n addVertices(vert, g, id, root, doc, diagObj);\n addEdges(edges, g, diagObj);\n\n // Create the renderer\n const render = new Render();\n\n // Add custom shapes\n flowChartShapes.addToRender(render);\n\n // Add our custom arrow - an empty arrowhead\n render.arrows().none = function normal(parent, id, edge, type) {\n const marker = parent\n .append('marker')\n .attr('id', id)\n .attr('viewBox', '0 0 10 10')\n .attr('refX', 9)\n .attr('refY', 5)\n .attr('markerUnits', 'strokeWidth')\n .attr('markerWidth', 8)\n .attr('markerHeight', 6)\n .attr('orient', 'auto');\n\n const path = marker.append('path').attr('d', 'M 0 0 L 0 0 L 0 0 z');\n applyStyle(path, edge[type + 'Style']);\n };\n\n // Override normal arrowhead defined in d3. Remove style & add class to allow css styling.\n render.arrows().normal = function normal(parent, id) {\n const marker = parent\n .append('marker')\n .attr('id', id)\n .attr('viewBox', '0 0 10 10')\n .attr('refX', 9)\n .attr('refY', 5)\n .attr('markerUnits', 'strokeWidth')\n .attr('markerWidth', 8)\n .attr('markerHeight', 6)\n .attr('orient', 'auto');\n\n marker\n .append('path')\n .attr('d', 'M 0 0 L 10 5 L 0 10 z')\n .attr('class', 'arrowheadPath')\n .style('stroke-width', 1)\n .style('stroke-dasharray', '1,0');\n };\n\n // Set up an SVG group so that we can translate the final graph.\n const svg = root.select(`[id=\"${id}\"]`);\n\n // Run the renderer. This is what draws the final graph.\n const element = root.select('#' + id + ' g');\n render(element, g);\n\n element.selectAll('g.node').attr('title', function () {\n return diagObj.db.getTooltip(this.id);\n });\n\n // Index nodes\n diagObj.db.indexNodes('subGraph' + i);\n\n // reposition labels\n for (i = 0; i < subGraphs.length; i++) {\n subG = subGraphs[i];\n if (subG.title !== 'undefined') {\n const clusterRects = doc.querySelectorAll(\n '#' + id + ' [id=\"' + diagObj.db.lookUpDomId(subG.id) + '\"] rect'\n );\n const clusterEl = doc.querySelectorAll(\n '#' + id + ' [id=\"' + diagObj.db.lookUpDomId(subG.id) + '\"]'\n );\n\n const xPos = clusterRects[0].x.baseVal.value;\n const yPos = clusterRects[0].y.baseVal.value;\n const _width = clusterRects[0].width.baseVal.value;\n const cluster = select(clusterEl[0]);\n const te = cluster.select('.label');\n te.attr('transform', `translate(${xPos + _width / 2}, ${yPos + 14})`);\n te.attr('id', id + 'Text');\n\n for (let j = 0; j < subG.classes.length; j++) {\n clusterEl[0].classList.add(subG.classes[j]);\n }\n }\n }\n\n // Add label rects for non html labels\n if (!conf.htmlLabels) {\n const labels = doc.querySelectorAll('[id=\"' + id + '\"] .edgeLabel .label');\n for (const label of labels) {\n // Get dimensions of label\n const dim = label.getBBox();\n\n const rect = doc.createElementNS('http://www.w3.org/2000/svg', 'rect');\n rect.setAttribute('rx', 0);\n rect.setAttribute('ry', 0);\n rect.setAttribute('width', dim.width);\n rect.setAttribute('height', dim.height);\n // rect.setAttribute('style', 'fill:#e8e8e8;');\n\n label.insertBefore(rect, label.firstChild);\n }\n }\n setupGraphViewbox(g, svg, conf.diagramPadding, conf.useMaxWidth);\n\n // If node has a link, wrap it in an anchor SVG object.\n const keys = Object.keys(vert);\n keys.forEach(function (key) {\n const vertex = vert[key];\n\n if (vertex.link) {\n const node = root.select('#' + id + ' [id=\"' + diagObj.db.lookUpDomId(key) + '\"]');\n if (node) {\n const link = doc.createElementNS('http://www.w3.org/2000/svg', 'a');\n link.setAttributeNS('http://www.w3.org/2000/svg', 'class', vertex.classes.join(' '));\n link.setAttributeNS('http://www.w3.org/2000/svg', 'href', vertex.link);\n link.setAttributeNS('http://www.w3.org/2000/svg', 'rel', 'noopener');\n if (securityLevel === 'sandbox') {\n link.setAttributeNS('http://www.w3.org/2000/svg', 'target', '_top');\n } else if (vertex.linkTarget) {\n link.setAttributeNS('http://www.w3.org/2000/svg', 'target', vertex.linkTarget);\n }\n\n const linkNode = node.insert(function () {\n return link;\n }, ':first-child');\n\n const shape = node.select('.label-container');\n if (shape) {\n linkNode.append(function () {\n return shape.node();\n });\n }\n\n const label = node.select('.label');\n if (label) {\n linkNode.append(function () {\n return label.node();\n });\n }\n }\n }\n });\n};\n\nexport default {\n setConf,\n addVertices,\n addEdges,\n getClasses,\n draw,\n};\n","// @ts-ignore: TODO Fix ts errors\nimport flowParser from './parser/flow';\nimport flowDb from './flowDb';\nimport flowRenderer from './flowRenderer';\nimport flowRendererV2 from './flowRenderer-v2';\nimport flowStyles from './styles';\nimport { MermaidConfig } from '../../config.type';\n\nexport const diagram = {\n parser: flowParser,\n db: flowDb,\n renderer: flowRendererV2,\n styles: flowStyles,\n init: (cnf: MermaidConfig) => {\n if (!cnf.flowchart) {\n cnf.flowchart = {};\n }\n // TODO, broken as of 2022-09-14 (13809b50251845475e6dca65cc395761be38fbd2)\n cnf.flowchart.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute;\n flowRenderer.setConf(cnf.flowchart);\n flowDb.clear();\n flowDb.setGen('gen-1');\n },\n};\n"],"names":["render","conf","i","Render","id"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,SAAS,SAAS,QAAQ,MAAM,MAAM;AACpC,QAAM,IAAI,KAAK;AACf,QAAM,IAAI,KAAK;AACf,QAAM,KAAK,IAAI,KAAK;AACpB,QAAM,SAAS;AAAA,IACb,EAAE,GAAG,IAAI,GAAG,GAAG,EAAG;AAAA,IAClB,EAAE,GAAG,GAAG,GAAG,CAAC,IAAI,EAAG;AAAA,IACnB,EAAE,GAAG,IAAI,GAAG,GAAG,CAAC,EAAG;AAAA,IACnB,EAAE,GAAG,GAAG,GAAG,CAAC,IAAI,EAAG;AAAA,EACvB;AACE,QAAM,WAAW,mBAAmB,QAAQ,GAAG,GAAG,MAAM;AACxD,OAAK,YAAY,SAAU,OAAO;AAChC,WAAO,iBAAiB,MAAM,QAAQ,KAAK;AAAA,EAC/C;AACE,SAAO;AACT;AAOA,SAAS,QAAQ,QAAQ,MAAM,MAAM;AACnC,QAAM,IAAI;AACV,QAAM,IAAI,KAAK;AACf,QAAM,IAAI,IAAI;AACd,QAAM,IAAI,KAAK,QAAQ,IAAI;AAC3B,QAAM,SAAS;AAAA,IACb,EAAE,GAAG,GAAG,GAAG,EAAG;AAAA,IACd,EAAE,GAAG,IAAI,GAAG,GAAG,EAAG;AAAA,IAClB,EAAE,GAAG,GAAG,GAAG,CAAC,IAAI,EAAG;AAAA,IACnB,EAAE,GAAG,IAAI,GAAG,GAAG,CAAC,EAAG;AAAA,IACnB,EAAE,GAAG,GAAG,GAAG,CAAC,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