mermaid
Version:
Markdown-ish syntax for generating flowcharts, mindmaps, sequence diagrams, class diagrams, gantt charts, git graphs and more.
8 lines (7 loc) • 38.5 kB
Source Map (JSON)
{
"version": 3,
"sources": ["../../../src/rendering-util/rendering-elements/clusters/swimlane.js", "../../../src/rendering-util/rendering-elements/clusters.js"],
"sourcesContent": ["import { getConfig } from '../../../diagram-api/diagramAPI.js';\nimport { evaluate } from '../../../config.js';\nimport { log } from '../../../logger.js';\nimport { select } from 'd3';\nimport rough from 'roughjs';\nimport { createText } from '../../createText.ts';\nimport intersectRect from '../intersect/intersect-rect.js';\nimport { styles2String, userNodeOverrides } from '../shapes/handDrawnShapeStyles.js';\n\n/**\n * Swimlane cluster shape (lane). Extracted from the shared clusters.js so the\n * swimlane-specific rendering lives on its own; registered in the clusters.js\n * shape dispatch table. Supports LR/TB and the handdrawn (rough) look.\n */\nexport const swimlane = async (parent, node) => {\n const siteConfig = getConfig();\n const { themeVariables, handDrawnSeed } = siteConfig;\n const { clusterBkg, clusterBorder } = themeVariables;\n const laneStroke = clusterBorder;\n\n const { labelStyles, nodeStyles, borderStyles, backgroundStyles } = styles2String(node);\n\n // Add outer g element\n const shapeSvg = parent\n .insert('g')\n .attr('class', 'cluster swimlane ' + (node.cssClasses || ''))\n .attr('id', node.id)\n .attr('data-id', node.id)\n .attr('data-et', 'cluster')\n .attr('data-look', node.look);\n\n const useHtmlLabels = evaluate(siteConfig.flowchart.htmlLabels);\n\n // Determine if this is a left-to-right layout (title on left, rotated)\n const isLR = node.direction === 'LR';\n\n // Create the label and insert it after the rects\n const labelEl = shapeSvg.insert('g').attr('class', 'cluster-label swimlane-label');\n\n const text = await createText(labelEl, node.label, {\n style: node.labelStyle,\n useHtmlLabels,\n isNode: true,\n width: node.width,\n });\n\n // Get the size of the label\n let bbox = text.getBBox();\n\n if (useHtmlLabels) {\n const div = text.children[0];\n const dv = select(text);\n bbox = div.getBoundingClientRect();\n dv.attr('width', bbox.width);\n dv.attr('height', bbox.height);\n }\n\n const padding = node.padding ?? 0;\n const width = node.width <= bbox.width + padding ? bbox.width + padding : node.width;\n if (node.width <= bbox.width + padding) {\n node.diff = (width - node.width) / 2 - padding;\n } else {\n node.diff = -padding;\n }\n\n const height = node.height;\n const laneTop = node.y - height / 2;\n const laneBottom = node.y + height / 2;\n const laneLeft = node.x - width / 2;\n\n // Top of the content area across all lanes, computed in the swimlanes\n // layout write-back. This is the Y of the highest node in the pool.\n const contentTop =\n node.swimlaneContentTop !== undefined ? node.swimlaneContentTop : laneTop + height / 3;\n\n // Title band sizing - for LR, the title is on the left; for TB, on top.\n //\n // NOTE: For TB we intentionally use a smaller internal padding so that\n // the visible gap between the title band and the first row of nodes is\n // larger. In LR, the original padding works well visually and is kept.\n const titlePaddingY = isLR ? 4 : 0;\n const desiredTitleSize = bbox.height + 2 * titlePaddingY;\n\n let titleRect;\n let bodyRect;\n\n if (isLR) {\n // LR layout: title band is a vertical strip on the left\n // For rotated text, title width is based on label height (rotated)\n const titleWidth = Math.max(desiredTitleSize, bbox.height + 2 * titlePaddingY);\n const bodyX = laneLeft + titleWidth;\n const bodyWidth = Math.max(0, width - titleWidth);\n\n if (node.look === 'handDrawn') {\n // @ts-ignore TODO: Fix rough typings\n const rc = rough.svg(shapeSvg);\n const titleOptions = userNodeOverrides(node, {\n roughness: 0.7,\n fill: clusterBkg,\n stroke: laneStroke,\n fillWeight: 3,\n seed: handDrawnSeed,\n });\n const bodyOptions = userNodeOverrides(node, {\n roughness: 0.7,\n fill: 'none',\n stroke: laneStroke,\n seed: handDrawnSeed,\n });\n\n const roughTitle = rc.rectangle(laneLeft, laneTop, titleWidth, height, titleOptions);\n titleRect = shapeSvg.insert(() => roughTitle, ':first-child');\n const roughBody = rc.rectangle(bodyX, laneTop, bodyWidth, height, bodyOptions);\n bodyRect = shapeSvg.insert(() => roughBody, ':first-child');\n\n titleRect.select('path:nth-child(2)').attr('style', borderStyles.join(';'));\n titleRect.select('path').attr('style', backgroundStyles.join(';').replace('fill', 'stroke'));\n } else {\n titleRect = shapeSvg.insert('rect', ':first-child');\n bodyRect = shapeSvg.insert('rect', ':first-child');\n\n titleRect\n .attr('class', 'swimlane-title')\n .attr('style', nodeStyles)\n .attr('x', laneLeft)\n .attr('y', laneTop)\n .attr('width', titleWidth)\n .attr('height', height)\n .attr('fill', clusterBkg)\n .attr('stroke', laneStroke);\n\n bodyRect\n .attr('class', 'swimlane-body')\n .attr('style', nodeStyles)\n .attr('x', bodyX)\n .attr('y', laneTop)\n .attr('width', bodyWidth)\n .attr('height', height)\n .attr('fill', 'none')\n .attr('stroke', laneStroke);\n }\n\n // Position the label: center it within the title band and rotate -90 degrees\n // After rotation, the label reads bottom-to-top\n const labelCenterX = laneLeft + titleWidth / 2;\n const labelCenterY = node.y;\n labelEl.attr(\n 'transform',\n `translate(${labelCenterX}, ${labelCenterY}) rotate(-90) translate(${-bbox.width / 2}, ${-bbox.height / 2})`\n );\n } else {\n // TB layout (default): title band is a horizontal strip on top\n const headerMaxHeight = Math.max(0, contentTop - laneTop);\n const titleHeight = Math.min(desiredTitleSize, headerMaxHeight);\n\n // The lane body should visually start exactly where the title band ends\n // so that their borders touch. The vertical gap between the title text\n // and the first row of nodes is then controlled purely by the\n // headerMaxHeight/titleHeight relationship (and thus by titlePaddingY).\n const bodyY = laneTop + titleHeight;\n const contentHeight = Math.max(0, laneBottom - bodyY);\n\n const x = node.x - width / 2;\n\n if (node.look === 'handDrawn') {\n // @ts-ignore TODO: Fix rough typings\n const rc = rough.svg(shapeSvg);\n const titleOptions = userNodeOverrides(node, {\n roughness: 0.7,\n fill: clusterBkg,\n stroke: laneStroke,\n fillWeight: 3,\n seed: handDrawnSeed,\n });\n const bodyOptions = userNodeOverrides(node, {\n roughness: 0.7,\n fill: 'none',\n stroke: laneStroke,\n seed: handDrawnSeed,\n });\n\n const roughTitle = rc.rectangle(x, laneTop, width, titleHeight, titleOptions);\n titleRect = shapeSvg.insert(() => roughTitle, ':first-child');\n const roughBody = rc.rectangle(x, bodyY, width, contentHeight, bodyOptions);\n bodyRect = shapeSvg.insert(() => roughBody, ':first-child');\n\n titleRect.select('path:nth-child(2)').attr('style', borderStyles.join(';'));\n titleRect.select('path').attr('style', backgroundStyles.join(';').replace('fill', 'stroke'));\n } else {\n titleRect = shapeSvg.insert('rect', ':first-child');\n bodyRect = shapeSvg.insert('rect', ':first-child');\n\n titleRect\n .attr('class', 'swimlane-title')\n .attr('style', nodeStyles)\n .attr('x', x)\n .attr('y', laneTop)\n .attr('width', width)\n .attr('height', titleHeight)\n .attr('fill', clusterBkg)\n .attr('stroke', laneStroke);\n\n bodyRect\n .attr('class', 'swimlane-body')\n .attr('style', nodeStyles)\n .attr('x', x)\n .attr('y', bodyY)\n .attr('width', width)\n .attr('height', contentHeight)\n .attr('fill', 'none')\n .attr('stroke', laneStroke);\n }\n\n // Place the label centered within the title band\n const labelX = node.x - bbox.width / 2;\n const labelY = laneTop + (titleHeight - bbox.height) / 2;\n labelEl.attr('transform', `translate(${labelX}, ${labelY})`);\n }\n\n log.trace('Swimlane data ', node, JSON.stringify(node));\n\n if (labelStyles) {\n const span = labelEl.select('span');\n if (span) {\n span.attr('style', labelStyles);\n }\n }\n\n node.offsetX = 0;\n node.width = width;\n node.height = height;\n // Used by layout engine to position subgraph in parent\n node.offsetY = bbox.height - padding / 2;\n\n node.intersect = function (point) {\n return intersectRect(node, point);\n };\n\n return { cluster: shapeSvg, labelBBox: bbox };\n};\n", "import { getConfig } from '../../diagram-api/diagramAPI.js';\nimport { getEffectiveHtmlLabels } from '../../config.js';\nimport { log } from '../../logger.js';\nimport { getSubGraphTitleMargins } from '../../utils/subGraphTitleMargins.js';\nimport { select } from 'd3';\nimport rough from 'roughjs';\nimport { createText } from '../createText.ts';\nimport intersectRect from '../rendering-elements/intersect/intersect-rect.js';\nimport createLabel from './createLabel.js';\nimport { createRoundedRectPathD } from './shapes/roundedRectPath.ts';\nimport { styles2String, userNodeOverrides } from './shapes/handDrawnShapeStyles.js';\nimport { swimlane } from './clusters/swimlane.js';\n\nconst rect = async (parent, node) => {\n log.info('Creating subgraph rect for ', node.id, node);\n const siteConfig = getConfig();\n const { themeVariables, handDrawnSeed } = siteConfig;\n const { clusterBkg, clusterBorder } = themeVariables;\n\n const { labelStyles, nodeStyles, borderStyles, backgroundStyles } = styles2String(node);\n\n // Add outer g element\n const shapeSvg = parent\n .insert('g')\n .attr('class', 'cluster ' + node.cssClasses)\n .attr('id', node.domId)\n .attr('data-look', node.look);\n\n const useHtmlLabels = getEffectiveHtmlLabels(siteConfig);\n\n // Create the label and insert it after the rect\n const labelEl = shapeSvg.insert('g').attr('class', 'cluster-label ');\n\n let text;\n if (node.labelType === 'markdown') {\n text = await createText(labelEl, node.label, {\n style: node.labelStyle,\n useHtmlLabels,\n isNode: true,\n width: node.width,\n });\n } else {\n text = await createLabel(labelEl, node.label, node.labelStyle || '', false, true);\n }\n\n // Get the size of the label\n let bbox = text.getBBox();\n\n if (getEffectiveHtmlLabels(siteConfig)) {\n const div = text.children[0];\n const dv = select(text);\n bbox = div.getBoundingClientRect();\n dv.attr('width', bbox.width);\n dv.attr('height', bbox.height);\n }\n\n const width = node.width <= bbox.width + node.padding ? bbox.width + node.padding : node.width;\n if (node.width <= bbox.width + node.padding) {\n node.diff = (width - node.width) / 2 - node.padding;\n } else {\n node.diff = -node.padding;\n }\n\n const height = node.height;\n const x = node.x - width / 2;\n const y = node.y - height / 2;\n\n log.trace('Data ', node, JSON.stringify(node));\n let rect;\n if (node.look === 'handDrawn') {\n // @ts-ignore TODO: Fix rough typings\n const rc = rough.svg(shapeSvg);\n const options = userNodeOverrides(node, {\n roughness: 0.7,\n fill: clusterBkg,\n // fill: 'red',\n stroke: clusterBorder,\n fillWeight: 3,\n seed: handDrawnSeed,\n });\n const roughNode = rc.path(createRoundedRectPathD(x, y, width, height, 0), options);\n rect = shapeSvg.insert(() => {\n log.debug('Rough node insert CXC', roughNode);\n return roughNode;\n }, ':first-child');\n // Should we affect the options instead of doing this?\n rect.select('path:nth-child(2)').attr('style', borderStyles.join(';'));\n rect.select('path').attr('style', backgroundStyles.join(';').replace('fill', 'stroke'));\n } else {\n // add the rect\n rect = shapeSvg.insert('rect', ':first-child');\n // center the rect around its coordinate\n rect\n .attr('style', nodeStyles)\n .attr('rx', node.rx)\n .attr('ry', node.ry)\n .attr('x', x)\n .attr('y', y)\n .attr('width', width)\n .attr('height', height);\n }\n const { subGraphTitleTopMargin } = getSubGraphTitleMargins(siteConfig);\n labelEl.attr(\n 'transform',\n // This puts the label on top of the box instead of inside it\n `translate(${node.x - bbox.width / 2}, ${node.y - node.height / 2 + subGraphTitleTopMargin})`\n );\n\n if (labelStyles) {\n const span = labelEl.select('span');\n if (span) {\n span.attr('style', labelStyles);\n }\n }\n // Center the label\n\n const rectBox = rect.node().getBBox();\n node.offsetX = 0;\n node.width = rectBox.width;\n node.height = rectBox.height;\n // Used by layout engine to position subgraph in parent\n node.offsetY = bbox.height - node.padding / 2;\n\n node.intersect = function (point) {\n return intersectRect(node, point);\n };\n\n return { cluster: shapeSvg, labelBBox: bbox };\n};\n\n/**\n * Non visible cluster where the note is group with its\n *\n * @param {any} parent\n * @param {any} node\n * @returns {any} ShapeSvg\n */\nconst noteGroup = (parent, node) => {\n // Add outer g element\n const shapeSvg = parent.insert('g').attr('class', 'note-cluster').attr('id', node.domId);\n\n // add the rect\n const rect = shapeSvg.insert('rect', ':first-child');\n\n const padding = 0 * node.padding;\n const halfPadding = padding / 2;\n\n // center the rect around its coordinate\n rect\n .attr('rx', node.rx)\n .attr('ry', node.ry)\n .attr('x', node.x - node.width / 2 - halfPadding)\n .attr('y', node.y - node.height / 2 - halfPadding)\n .attr('width', node.width + padding)\n .attr('height', node.height + padding)\n .attr('fill', 'none');\n\n const rectBox = rect.node().getBBox();\n node.width = rectBox.width;\n node.height = rectBox.height;\n\n node.intersect = function (point) {\n return intersectRect(node, point);\n };\n\n return { cluster: shapeSvg, labelBBox: { width: 0, height: 0 } };\n};\n\nconst roundedWithTitle = async (parent, node) => {\n const siteConfig = getConfig();\n\n const { themeVariables, handDrawnSeed } = siteConfig;\n const { altBackground, compositeBackground, compositeTitleBackground, nodeBorder } =\n themeVariables;\n\n // Add outer g element\n const shapeSvg = parent\n .insert('g')\n .attr('class', node.cssClasses)\n .attr('id', node.domId)\n .attr('data-id', node.id)\n .attr('data-look', node.look);\n\n // add the rect\n const outerRectG = shapeSvg.insert('g', ':first-child');\n\n // Create the label and insert it after the rect\n const label = shapeSvg.insert('g').attr('class', 'cluster-label');\n let innerRect = shapeSvg.append('rect');\n\n const text = await createLabel(label, node.label, node.labelStyle, undefined, true);\n\n // Get the size of the label\n let bbox = text.getBBox();\n\n if (getEffectiveHtmlLabels(siteConfig)) {\n const div = text.children[0];\n const dv = select(text);\n bbox = div.getBoundingClientRect();\n dv.attr('width', bbox.width);\n dv.attr('height', bbox.height);\n }\n\n // Rounded With Title\n const padding = 0 * node.padding;\n const halfPadding = padding / 2;\n\n const width =\n (node.width <= bbox.width + node.padding ? bbox.width + node.padding : node.width) + padding;\n if (node.width <= bbox.width + node.padding) {\n node.diff = (width - node.width) / 2 - node.padding;\n } else {\n node.diff = -node.padding;\n }\n\n const height = node.height + padding;\n // const height = node.height + padding;\n const innerHeight = node.height + padding - bbox.height - 6;\n const x = node.x - width / 2;\n const y = node.y - height / 2;\n node.width = width;\n const innerY = node.y - node.height / 2 - halfPadding + bbox.height + 2;\n\n // add the rect\n let rect;\n if (node.look === 'handDrawn') {\n const isAlt = node.cssClasses.includes('statediagram-cluster-alt');\n const rc = rough.svg(shapeSvg);\n const roughOuterNode =\n node.rx || node.ry\n ? rc.path(createRoundedRectPathD(x, y, width, height, 10), {\n roughness: 0.7,\n fill: compositeTitleBackground,\n fillStyle: 'solid',\n stroke: nodeBorder,\n seed: handDrawnSeed,\n })\n : rc.rectangle(x, y, width, height, { seed: handDrawnSeed });\n\n rect = shapeSvg.insert(() => roughOuterNode, ':first-child');\n const roughInnerNode = rc.rectangle(x, innerY, width, innerHeight, {\n fill: isAlt ? altBackground : compositeBackground,\n fillStyle: isAlt ? 'hachure' : 'solid',\n stroke: nodeBorder,\n seed: handDrawnSeed,\n });\n\n rect = shapeSvg.insert(() => roughOuterNode, ':first-child');\n innerRect = shapeSvg.insert(() => roughInnerNode);\n } else {\n rect = outerRectG.insert('rect', ':first-child');\n const outerRectClass = 'outer';\n\n // center the rect around its coordinate\n rect\n .attr('class', outerRectClass)\n .attr('x', x)\n .attr('y', y)\n .attr('width', width)\n .attr('height', height)\n .attr('data-look', node.look);\n innerRect\n .attr('class', 'inner')\n .attr('x', x)\n .attr('y', innerY)\n .attr('width', width)\n .attr('height', innerHeight);\n }\n\n label.attr(\n 'transform',\n `translate(${node.x - bbox.width / 2}, ${y + 1 - (getEffectiveHtmlLabels(siteConfig) ? 0 : 3)})`\n );\n\n const rectBox = rect.node().getBBox();\n node.height = rectBox.height;\n node.offsetX = 0;\n // Used by layout engine to position subgraph in parent\n node.offsetY = bbox.height - node.padding / 2;\n node.labelBBox = bbox;\n\n node.intersect = function (point) {\n return intersectRect(node, point);\n };\n\n return { cluster: shapeSvg, labelBBox: bbox };\n};\nconst kanbanSection = async (parent, node) => {\n log.info('Creating subgraph rect for ', node.id, node);\n const siteConfig = getConfig();\n const { themeVariables, handDrawnSeed } = siteConfig;\n const { clusterBkg, clusterBorder } = themeVariables;\n\n const { labelStyles, nodeStyles, borderStyles, backgroundStyles } = styles2String(node);\n\n // Add outer g element\n const shapeSvg = parent\n .insert('g')\n .attr('class', 'cluster ' + node.cssClasses)\n .attr('id', node.domId)\n .attr('data-look', node.look);\n\n const useHtmlLabels = getEffectiveHtmlLabels(siteConfig);\n\n // Create the label and insert it after the rect\n const labelEl = shapeSvg.insert('g').attr('class', 'cluster-label ');\n\n const text = await createText(labelEl, node.label, {\n style: node.labelStyle,\n useHtmlLabels,\n isNode: true,\n width: node.width,\n });\n\n // Get the size of the label\n let bbox = text.getBBox();\n\n if (getEffectiveHtmlLabels(siteConfig)) {\n const div = text.children[0];\n const dv = select(text);\n bbox = div.getBoundingClientRect();\n dv.attr('width', bbox.width);\n dv.attr('height', bbox.height);\n }\n\n const width = node.width <= bbox.width + node.padding ? bbox.width + node.padding : node.width;\n if (node.width <= bbox.width + node.padding) {\n node.diff = (width - node.width) / 2 - node.padding;\n } else {\n node.diff = -node.padding;\n }\n\n const height = node.height;\n const x = node.x - width / 2;\n const y = node.y - height / 2;\n\n log.trace('Data ', node, JSON.stringify(node));\n let rect;\n if (node.look === 'handDrawn') {\n // @ts-ignore TODO: Fix rough typings\n const rc = rough.svg(shapeSvg);\n const options = userNodeOverrides(node, {\n roughness: 0.7,\n fill: clusterBkg,\n // fill: 'red',\n stroke: clusterBorder,\n fillWeight: 4,\n seed: handDrawnSeed,\n });\n const roughNode = rc.path(createRoundedRectPathD(x, y, width, height, node.rx), options);\n rect = shapeSvg.insert(() => {\n log.debug('Rough node insert CXC', roughNode);\n return roughNode;\n }, ':first-child');\n // Should we affect the options instead of doing this?\n rect.select('path:nth-child(2)').attr('style', borderStyles.join(';'));\n rect.select('path').attr('style', backgroundStyles.join(';').replace('fill', 'stroke'));\n } else {\n // add the rect\n rect = shapeSvg.insert('rect', ':first-child');\n // center the rect around its coordinate\n rect\n .attr('style', nodeStyles)\n .attr('rx', node.rx)\n .attr('ry', node.ry)\n .attr('x', x)\n .attr('y', y)\n .attr('width', width)\n .attr('height', height);\n }\n const { subGraphTitleTopMargin } = getSubGraphTitleMargins(siteConfig);\n labelEl.attr(\n 'transform',\n // This puts the label on top of the box instead of inside it\n `translate(${node.x - bbox.width / 2}, ${node.y - node.height / 2 + subGraphTitleTopMargin})`\n );\n\n if (labelStyles) {\n const span = labelEl.select('span');\n if (span) {\n span.attr('style', labelStyles);\n }\n }\n // Center the label\n\n const rectBox = rect.node().getBBox();\n node.offsetX = 0;\n node.width = rectBox.width;\n node.height = rectBox.height;\n // Used by layout engine to position subgraph in parent\n node.offsetY = bbox.height - node.padding / 2;\n\n node.intersect = function (point) {\n return intersectRect(node, point);\n };\n\n return { cluster: shapeSvg, labelBBox: bbox };\n};\nconst divider = (parent, node) => {\n const siteConfig = getConfig();\n\n const { themeVariables, handDrawnSeed } = siteConfig;\n const { nodeBorder } = themeVariables;\n\n // Add outer g element\n const shapeSvg = parent\n .insert('g')\n .attr('class', node.cssClasses)\n .attr('id', node.domId)\n .attr('data-look', node.look);\n\n // add the rect\n const outerRectG = shapeSvg.insert('g', ':first-child');\n\n const padding = 0 * node.padding;\n\n const width = node.width + padding;\n\n node.diff = -node.padding;\n\n const height = node.height + padding;\n // const height = node.height + padding;\n const x = node.x - width / 2;\n const y = node.y - height / 2;\n node.width = width;\n\n // add the rect\n let rect;\n if (node.look === 'handDrawn') {\n const rc = rough.svg(shapeSvg);\n const roughOuterNode = rc.rectangle(x, y, width, height, {\n fill: 'lightgrey',\n roughness: 0.5,\n strokeLineDash: [5],\n stroke: nodeBorder,\n seed: handDrawnSeed,\n });\n\n rect = shapeSvg.insert(() => roughOuterNode, ':first-child');\n } else {\n rect = outerRectG.insert('rect', ':first-child');\n let outerRectClass = 'outer';\n if (node.look === 'neo') {\n outerRectClass = 'divider';\n } else {\n outerRectClass = 'divider';\n }\n\n // center the rect around its coordinate\n rect\n .attr('class', outerRectClass)\n .attr('x', x)\n .attr('y', y)\n .attr('width', width)\n .attr('height', height)\n .attr('data-look', node.look);\n }\n\n const rectBox = rect.node().getBBox();\n node.height = rectBox.height;\n node.offsetX = 0;\n // Used by layout engine to position subgraph in parent\n node.offsetY = 0;\n\n node.intersect = function (point) {\n return intersectRect(node, point);\n };\n\n return { cluster: shapeSvg, labelBBox: {} };\n};\n\nconst squareRect = rect;\nconst shapes = {\n rect,\n squareRect,\n roundedWithTitle,\n noteGroup,\n divider,\n kanbanSection,\n swimlane,\n};\n\nlet clusterElems = new Map();\n\n/**\n * @typedef {keyof typeof shapes} ClusterShapeID\n */\n\n/**\n * @param {import('../types.js').ClusterNode} node - Shape defaults to 'rect'\n */\nexport const insertCluster = async (elem, node) => {\n const shape = node.shape || 'rect';\n const cluster = await shapes[shape](elem, node);\n clusterElems.set(node.id, cluster);\n return cluster;\n};\n\nexport const getClusterTitleWidth = (elem, node) => {\n // TODO: Doesn't this need an `await`?\n const label = createLabel(elem, node.label, node.labelStyle, undefined, true);\n const width = label.getBBox().width;\n elem.node().removeChild(label);\n return width;\n};\n\nexport const clear = () => {\n clusterElems = new Map();\n};\n\nexport const positionCluster = (node) => {\n log.info(\n 'Position cluster (' +\n node.id +\n ', ' +\n node.x +\n ', ' +\n node.y +\n ') (' +\n node?.width +\n ', ' +\n node?.height +\n ')',\n clusterElems.get(node.id)\n );\n const el = clusterElems.get(node.id);\n el.cluster.attr('transform', 'translate(' + node.x + ', ' + node.y + ')');\n};\n"],
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAcO,IAAM,WAAW,8BAAO,QAAQ,SAAS;AAC9C,QAAM,aAAa,UAAU;AAC7B,QAAM,EAAE,gBAAgB,cAAc,IAAI;AAC1C,QAAM,EAAE,YAAY,cAAc,IAAI;AACtC,QAAM,aAAa;AAEnB,QAAM,EAAE,aAAa,YAAY,cAAc,iBAAiB,IAAI,cAAc,IAAI;AAGtF,QAAM,WAAW,OACd,OAAO,GAAG,EACV,KAAK,SAAS,uBAAuB,KAAK,cAAc,GAAG,EAC3D,KAAK,MAAM,KAAK,EAAE,EAClB,KAAK,WAAW,KAAK,EAAE,EACvB,KAAK,WAAW,SAAS,EACzB,KAAK,aAAa,KAAK,IAAI;AAE9B,QAAM,gBAAgB,SAAS,WAAW,UAAU,UAAU;AAG9D,QAAM,OAAO,KAAK,cAAc;AAGhC,QAAM,UAAU,SAAS,OAAO,GAAG,EAAE,KAAK,SAAS,8BAA8B;AAEjF,QAAM,OAAO,MAAM,WAAW,SAAS,KAAK,OAAO;AAAA,IACjD,OAAO,KAAK;AAAA,IACZ;AAAA,IACA,QAAQ;AAAA,IACR,OAAO,KAAK;AAAA,EACd,CAAC;AAGD,MAAI,OAAO,KAAK,QAAQ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