{ "version": 3, "sources": ["../src/diagrams/flowchart/flowRenderer.js", "../src/diagrams/flowchart/flowChartShapes.js", "../src/diagrams/flowchart/flowDiagram.ts"], "sourcesContent": ["import * as graphlib from 'dagre-d3-es/src/graphlib/index.js';\nimport { select, curveLinear, selectAll } from 'd3';\nimport { getConfig } from '../../config.js';\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.js';\nimport common, { evaluate } from '../common/common.js';\nimport { interpolateToCurve, getStylesFromArray } from '../../utils.js';\nimport { setupGraphViewbox } from '../../setupGraphViewbox.js';\nimport flowChartShapes from './flowChartShapes.js';\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) => ``\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 const linkId = 'L-' + edge.start + '-' + edge.end;\n const linkNameStart = 'LS-' + edge.start;\n const 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 = `${edge.text.replace(\n /fa[blrs]?:fa-[\\w-]+/g,\n (s) => ``\n )}`;\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 // 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", "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", "// @ts-ignore: JISON doesn't support types\nimport flowParser from './parser/flow.jison';\nimport flowDb from './flowDb.js';\nimport flowRenderer from './flowRenderer.js';\nimport flowRendererV2 from './flowRenderer-v2.js';\nimport flowStyles from './styles.js';\nimport { MermaidConfig } from '../../config.type.js';\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 },\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EvB,GAAIY,EAAO,KAAM,CACf,IAAMQ,EAAOf,EAAK,OAAO,IAAMM,EAAK,SAAWJ,EAAQ,GAAG,YAAYP,CAAG,EAAI,IAAI,EACjF,GAAIoB,EAAM,CACR,IAAM4D,EAAOtE,EAAI,gBAAgB,6BAA8B,GAAG,EAClEsE,EAAK,eAAe,6BAA8B,QAASpE,EAAO,QAAQ,KAAK,GAAG,CAAC,EACnFoE,EAAK,eAAe,6BAA8B,OAAQpE,EAAO,IAAI,EACrEoE,EAAK,eAAe,6BAA8B,MAAO,UAAU,EAC/D7B,IAAkB,UACpB6B,EAAK,eAAe,6BAA8B,SAAU,MAAM,EACzDpE,EAAO,YAChBoE,EAAK,eAAe,6BAA8B,SAAUpE,EAAO,UAAU,EAG/E,IAAMqE,EAAW7D,EAAK,OAAO,UAAY,CACvC,OAAO4D,CACT,EAAG,cAAc,EAEXE,EAAQ9D,EAAK,OAAO,kBAAkB,EACxC8D,GACFD,EAAS,OAAO,UAAY,CAC1B,OAAOC,EAAM,KAAK,CACpB,CAAC,EAGH,IAAMN,EAAQxD,EAAK,OAAO,QAAQ,EAC9BwD,GACFK,EAAS,OAAO,UAAY,CAC1B,OAAOL,EAAM,KAAK,CACpB,CAAC,CAEL,CACF,CACF,CAAC,CACH,EAlNoB,QAoNbO,GAAQ,CACb,QAAAvF,GACA,YAAAK,GACA,SAAA8B,GACA,WAAAe,GACA,KAAAG,EACF,EExfO,IAAMmC,GAAU,CACrB,OAAQC,EACR,GAAIC,EACJ,SAAUC,EACV,OAAQC,EACR,KAAOC,GAAuB,CACvBA,EAAI,YACPA,EAAI,UAAY,CAAC,GAGnBA,EAAI,UAAU,oBAAsBA,EAAI,oBACxCC,GAAa,QAAQD,EAAI,SAAS,EAClCH,EAAO,MAAM,EACbA,EAAO,OAAO,OAAO,CACvB,CACF", "names": ["graphlib", "select", "curveLinear", "selectAll", "Render", "applyStyle", "addHtmlLabel", "intersectPolygon", "intersectRect", "question", "parent", "bbox", "node", "w", "h", "s", "points", "shapeSvg", "insertPolygonShape", "point", "intersectPolygon", "__name", "hexagon", "m", "rect_left_inv_arrow", "lean_right", "lean_left", "trapezoid", "inv_trapezoid", "rect_right_inv_arrow", "stadium", "intersectRect", "subroutine", "cylinder", "rx", "ry", "shape", "pos", "x", "y", "addToRender", "render", "addToRenderV2", "addShape", "d", "flowChartShapes_default", "conf", "setConf", "__name", "cnf", "keys", "key", "addVertices", "vert", "g", "svgId", "root", "_doc", "diagObj", "svg", "select", "doc", "id", "vertex", "classStr", "styles", "getStylesFromArray", "vertexText", "vertexNode", "evaluate", "getConfig", "node", "s", "addHtmlLabel", "svgLabel", "rows", "common_default", "row", "tspan", "radious", "_shape", "log", "addEdges", "edges", "cnt", "defaultStyle", "defaultLabelStyle", "defaultStyles", "edge", "linkId", "linkNameStart", "linkNameEnd", "edgeData", "style", "labelStyle", "interpolateToCurve", "curveLinear", "getClasses", "text", "e", "draw", "_version", "securityLevel", "sandboxElement", "dir", "nodeSpacing", "rankSpacing", "subG", "subGraphs", "i", "selectAll", "j", "render", "Render", "flowChartShapes_default", "parent", "type", "path", "applyStyle", "element", "clusterRects", "clusterEl", "xPos", "yPos", "_width", "te", "labels", "label", "dim", "rect", "setupGraphViewbox", "link", "linkNode", "shape", "flowRenderer_default", "diagram", "flow_default", "flowDb_default", "flowRenderer_v2_default", "styles_default", "cnf", "flowRenderer_default"] }