mermaid
Version:
Markdown-ish syntax for generating flowcharts, mindmaps, sequence diagrams, class diagrams, gantt charts, git graphs and more.
8 lines • 59.2 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';\nimport { stampColorSlot } from '../../../diagrams/common/colorThemeGate.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 { theme, themeVariables, handDrawnSeed } = siteConfig;\n const { clusterBkg, clusterBorder, borderColorArray } = 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 // Per-lane colour slot; a no-op unless the theme carries a palette. The matching\n // `[data-color-id]` rules come from the flowchart stylesheet, which swimlanes reuses.\n stampColorSlot(shapeSvg, node.colorIndex, theme, borderColorArray);\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 // Same classes as the classic look, so CSS can tell the two halves apart.\n titleRect = shapeSvg.insert(() => roughTitle, ':first-child').attr('class', 'swimlane-title');\n const roughBody = rc.rectangle(bodyX, laneTop, bodyWidth, height, bodyOptions);\n bodyRect = shapeSvg.insert(() => roughBody, ':first-child').attr('class', 'swimlane-body');\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').attr('class', 'swimlane-title');\n const roughBody = rc.rectangle(x, bodyY, width, contentHeight, bodyOptions);\n bodyRect = shapeSvg.insert(() => roughBody, ':first-child').attr('class', 'swimlane-body');\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 { compileStyles, styles2String, userNodeOverrides } from './shapes/handDrawnShapeStyles.js';\nimport { swimlane } from './clusters/swimlane.js';\nimport { stampColorSlot } from '../../diagrams/common/colorThemeGate.js';\n\nconst rect = async (parent, node) => {\n log.info('Creating subgraph rect for ', node.id, node);\n const siteConfig = getConfig();\n const { theme, themeVariables, handDrawnSeed } = siteConfig;\n const { clusterBkg, clusterBorder, borderColorArray } = 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 // Per-container colour slot. A no-op unless the active theme carries a palette, and\n // painted only by diagrams whose stylesheet defines the matching `[data-color-id]`\n // rules -- for state, block and class namespaces this is an inert attribute.\n stampColorSlot(shapeSvg, node.colorIndex, theme, borderColorArray);\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 { theme, themeVariables, handDrawnSeed } = siteConfig;\n const {\n altBackground,\n borderColorArray,\n compositeBackground,\n compositeTitleBackground,\n 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 // Per-composite colour slot, painted by the `[data-color-id]` rules in `state/styles.js`.\n // A no-op unless the active theme carries a palette.\n stampColorSlot(shapeSvg, node.colorIndex, theme, borderColorArray);\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 // The classic branch below gives its two rects `outer` and `inner`; roughjs wraps each\n // shape in a `g` with no class, so without the same names here a stylesheet cannot tell\n // the title shape from the body and any `path` rule hits both.\n rect.attr('class', 'outer');\n innerRect.attr('class', 'inner');\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 { theme, themeVariables, handDrawnSeed } = siteConfig;\n const { altBackground, nodeBorder, borderColorArray } = themeVariables;\n\n // Sibling regions of one composite share a slot -- see `nextColorSlot` in the state\n // diagram's `dataFetcher.ts`.\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 stampColorSlot(shapeSvg, node.colorIndex, theme, borderColorArray);\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 // The theme's own value, matching what `rect.divider` gets from CSS under the other\n // looks -- and the same fallback. It was hardcoded `lightgrey`, which no dark theme\n // ever asked for; that stayed tolerable only while the fill was sparse hatching, and\n // turns into a bright block on a dark canvas once it is solid.\n fill: altBackground ?? '#efefef',\n // Solid rather than roughjs's default hachure. A hachure fill is drawn as *stroked*\n // lines, so both of the group's paths come out with `fill=\"none\"` and a stylesheet\n // cannot tell the fill from the outline -- which is the same trap documented on\n // `roundedWithTitle`'s inner shape in `state/styles.js`. Solid splits them the way\n // the composite's outer shape already does, so a region can take the palette's tint\n // and border without its hatching being repainted. `roundedWithTitle` fills solid\n // too, except for its deliberately hatched alt variant.\n fillStyle: 'solid',\n roughness: 0.5,\n strokeLineDash: [5],\n stroke: nodeBorder,\n seed: handDrawnSeed,\n });\n\n rect = shapeSvg.insert(() => roughOuterNode, ':first-child').attr('class', 'divider');\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\n/**\n * Shared helper for agentflow container cluster shapes.\n * Renders a labeled rounded-rect cluster with configurable visual style.\n *\n * Agentflow's grammar has a single container kind (`flow`), so `flowGroup`\n * below is the only caller today. The options object is kept so a second\n * container kind does not have to re-derive the label/rough/separator logic.\n *\n * @param {object} opts\n * @param {string} opts.cssClass - CSS class suffix (e.g. 'agent-cluster')\n * @param {number} opts.rx - Corner radius\n * @param {string} opts.fill - Fill color (or 'none'/'transparent')\n * @param {string} opts.stroke - Stroke color\n * @param {number} opts.strokeWidth - Stroke width in px\n * @param {number[]} [opts.strokeDash] - Optional dash array\n * @param {number} opts.roughness - rough.js roughness\n */\nconst createContainerGroup = async (parent, node, opts) => {\n log.info(`Creating ${opts.cssClass} for `, node.id, node);\n const siteConfig = getConfig();\n const { theme, themeVariables, handDrawnSeed } = siteConfig;\n const { borderColorArray } = themeVariables;\n\n const { labelStyles, borderStyles } = styles2String(node);\n\n const shapeSvg = parent\n .insert('g')\n .attr('class', 'cluster ' + opts.cssClass + ' ' + node.cssClasses)\n // `domId` is generated per render (render.ts prefixes it with the diagram's\n // svg id). Using the raw, author-supplied `node.id` here collided across two\n // diagrams on the same page, like every other cluster shape in this file.\n .attr('id', node.domId ?? node.id)\n .attr('data-look', node.look);\n\n // Per-container colour slot, exactly as `rect` above does it. Every other cluster\n // function stamps; this one did not, which left the containers drawn through it \u2014 only\n // agentflow's `flowGroup` \u2014 unable to use the mechanism every other diagram's containers\n // use. A no-op unless the theme carries a palette, and inert for any diagram whose\n // stylesheet defines no matching `[data-color-id]` rules.\n stampColorSlot(shapeSvg, node.colorIndex, theme, borderColorArray);\n\n const useHtmlLabels = getEffectiveHtmlLabels(siteConfig);\n const labelEl = shapeSvg.insert('g').attr('class', 'cluster-label');\n\n let bbox = { width: 0, height: 0 };\n const hasLabel = node.label?.trim();\n if (hasLabel) {\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 bbox = text.getBBox();\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\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 let rectEl;\n if (node.look === 'handDrawn') {\n const rc = rough.svg(shapeSvg);\n const roughOpts = userNodeOverrides(node, {\n roughness: opts.roughness,\n fill: opts.fill,\n stroke: opts.stroke,\n strokeWidth: opts.strokeWidth,\n seed: handDrawnSeed,\n ...(opts.fill === 'none' ? { fillWeight: 0 } : { fillStyle: 'solid' }),\n ...(opts.strokeDash ? { strokeLineDash: opts.strokeDash } : {}),\n });\n const roughNode = rc.path(createRoundedRectPathD(x, y, width, height, opts.rx), roughOpts);\n rectEl = shapeSvg.insert(() => roughNode, ':first-child');\n rectEl.select('path:nth-child(2)').attr('style', borderStyles.join(';'));\n } else {\n rectEl = shapeSvg.insert('rect', ':first-child');\n rectEl\n .attr('rx', opts.rx)\n .attr('ry', opts.rx)\n .attr('x', x)\n .attr('y', y)\n .attr('width', width)\n .attr('height', height)\n .attr('fill', opts.fill)\n .attr('stroke', opts.stroke)\n .attr('stroke-width', opts.strokeWidth + 'px');\n if (opts.strokeDash) {\n rectEl.attr('stroke-dasharray', opts.strokeDash.join(', '));\n }\n }\n\n if (hasLabel) {\n const { subGraphTitleTopMargin } = getSubGraphTitleMargins(siteConfig);\n labelEl.attr(\n 'transform',\n `translate(${node.x - bbox.width / 2}, ${node.y - node.height / 2 + subGraphTitleTopMargin})`\n );\n if (labelStyles) {\n const span = labelEl.select('span');\n if (span) {\n span.attr('style', labelStyles);\n }\n }\n }\n\n const rectBox = rectEl.node().getBBox();\n node.offsetX = 0;\n node.width = rectBox.width;\n node.height = rectBox.height;\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/** Flow group: organizational grouping. Transparent, solid 0.75px, rx=10. */\nconst flowGroup = async (parent, node) => {\n const { themeVariables } = getConfig();\n const stroke = themeVariables.flowContainerStroke || themeVariables.secondaryBorderColor;\n return createContainerGroup(parent, node, {\n cssClass: 'flow-cluster',\n rx: 10,\n fill: 'none',\n stroke,\n strokeWidth: 0.75,\n roughness: 0.7,\n });\n};\n\nexport const getUsecaseSystemBoundaryGeometry = (node, labelBBox) => {\n const boundaryType = node.boundaryType || 'rect';\n const horizontalLabelPadding = boundaryType === 'package' ? 20 : node.padding;\n const tabHeight = boundaryType === 'package' ? labelBBox.height + 10 : 0;\n const width = Math.max(node.width, labelBBox.width + horizontalLabelPadding);\n const height =\n boundaryType === 'package' ? Math.max(node.height, tabHeight + node.padding * 2) : node.height;\n const x = node.x - width / 2;\n const y = node.y - height / 2;\n\n return {\n boundaryType,\n width,\n height,\n x,\n y,\n bodyY: y + tabHeight,\n bodyHeight: height - tabHeight,\n tabHeight,\n tabWidth: boundaryType === 'package' ? Math.min(width, Math.max(80, labelBBox.width + 20)) : 0,\n };\n};\n\n/**\n * Custom cluster shape for use-case system boundaries.\n * @param {any} parent\n * @param {any} node\n * @returns {any} ShapeSvg\n */\nconst usecaseSystemBoundary = async (parent, node) => {\n log.info('Creating usecase system boundary for ', node.id, node);\n const siteConfig = getConfig();\n const { theme, themeVariables, handDrawnSeed } = siteConfig;\n const { clusterBkg, clusterBorder, borderColorArray } = themeVariables;\n const { labelStyles, nodeStyles } = styles2String(node);\n const { stylesMap } = compileStyles(node);\n\n const boundaryType = node.boundaryType || 'rect';\n const shapeSvg = parent\n .insert('g')\n .attr(\n 'class',\n `cluster usecase-system-boundary usecase-system-boundary-${boundaryType} ${node.cssClasses}`\n )\n .attr('id', typeof node.domId === 'string' ? node.domId : node.id)\n .attr('data-boundary-type', boundaryType)\n .attr('data-look', node.look);\n\n // Per-container colour slot, as in `rect` above. A boundary is a container, but unlike a\n // class namespace it is painted -- `usecase/styles.ts` defines the matching rules.\n stampColorSlot(shapeSvg, node.colorIndex, theme, borderColorArray);\n\n const useHtmlLabels = getEffectiveHtmlLabels(siteConfig);\n const labelEl = shapeSvg.insert('g').attr('class', 'cluster-label system-boundary-title');\n const text = await createText(labelEl, node.label, {\n style: labelStyles,\n useHtmlLabels,\n isNode: true,\n });\n\n let bbox = text.getBBox();\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 geometry = getUsecaseSystemBoundaryGeometry(node, bbox);\n const { width, height, x, y, bodyY, bodyHeight, tabHeight, tabWidth } = geometry;\n node.diff =\n node.width <= bbox.width + node.padding\n ? (width - node.width) / 2 - node.padding\n : -node.padding;\n\n const roughOptions = userNodeOverrides(node, {\n fill: stylesMap.get('fill') || clusterBkg,\n stroke: stylesMap.get('stroke') || clusterBorder,\n strokeWidth: stylesMap.get('stroke-width')?.replace('px', '') || 1,\n seed: handDrawnSeed,\n });\n\n if (node.look === 'handDrawn') {\n const rc = rough.svg(shapeSvg);\n const roughBody = rc.rectangle(x, bodyY, width, bodyHeight, roughOptions);\n shapeSvg.insert(() => roughBody, ':first-child').attr('class', 'boundary-body label-container');\n\n if (boundaryType === 'package') {\n const roughTab = rc.rectangle(x, y, tabWidth, tabHeight, roughOptions);\n shapeSvg\n .insert(() => roughTab, ':first-child')\n .attr('class', 'boundary-tab system-boundary-package-tab label-container');\n }\n } else {\n shapeSvg\n .insert('rect', ':first-child')\n .attr('class', 'boundary-body label-container')\n .attr('style', nodeStyles)\n .attr('x', x)\n .attr('y', bodyY)\n .attr('width', width)\n .attr('height', bodyHeight);\n\n if (boundaryType === 'package') {\n shapeSvg\n .insert('rect', ':first-child')\n .attr('class', 'boundary-tab system-boundary-package-tab label-container')\n .attr('style', nodeStyles)\n .attr('x', x)\n .attr('y', y)\n .attr('width', tabWidth)\n .attr('height', tabHeight);\n }\n }\n\n const { subGraphTitleTopMargin } = getSubGraphTitleMargins(siteConfig);\n if (boundaryType === 'package') {\n labelEl.attr(\n 'transform',\n `translate(${x + (tabWidth - bbox.width) / 2}, ${y + (tabHeight - bbox.height) / 2})`\n );\n } else {\n labelEl.attr(\n 'transform',\n `translate(${node.x - bbox.width / 2}, ${y + subGraphTitleTopMargin})`\n );\n }\n\n if (labelStyles) {\n labelEl.attr('style', labelStyles);\n labelEl.select('span').attr('style', labelStyles);\n }\n\n node.offsetX = 0;\n node.width = width;\n node.height = height;\n node.offsetY = bbox.height - node.padding / 2;\n node.labelBBox = bbox;\n node.intersect = function (point) {\n return intersectRect(node, point);\n };\n\n return { cluster: shapeSvg, labelBBox: bbox };\n};\n\nconst squareRect = rect;\nconst shapes = {\n rect,\n squareRect,\n roundedWithTitle,\n noteGroup,\n divider,\n kanbanSection,\n flowGroup,\n usecaseSystemBoundary,\n swimlane,\n};\n\n/**\n * Cluster shapes that never paint their label as a title. A note group's label\n * is the note's text, painted by the note node inside it; the group itself is\n * an invisible frame. Layout must not reserve title space for these.\n */\nconst UNTITLED_CLUSTER_SHAPES = new Set(['noteGroup', 'divider']);\n\n/**\n * Whether a cluster shape paints its label as a title strip above its children.\n * @param {string | undefined} shape - Shape id; defaults to 'rect' like `insertCluster`\n * @returns {boolean}\n */\nexport const clusterPaintsTitle = (shape) => !UNTITLED_CLUSTER_SHAPES.has(shape ?? 'rect');\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": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAeO,IAAM,WAAW,8BAAO,QAAQ,SAAS;AAC9C,QAAM,aAAa,UAAU;AAC7B,QAAM,EAAE,OAAO,gBAAgB,cAAc,IAAI;AACjD,QAAM,EAAE,YAAY,eAAe,iBAAiB,IAAI;AACxD,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;AAI9B,iBAAe,UAAU,KAAK,YAAY,OAAO,gBAAgB;AAEjE,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;AAExB,MAAI,eAAe;AACjB,UAAM,MAAM,KAAK,SAAS,CAAC;AAC3B,UAAM,KAAK,eAAO,IAAI;AACtB,WAAO,IAAI,sBAAsB;AACjC,OAAG,KAAK,SAAS,KAAK,KAAK;AAC3B,OAAG,KAAK,UAAU,K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