@dpuse/dpuse-tool-d3-visualiser 0.0.18 → 0.0.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"sankeyDiagram-Dgf87Zt4.js","names":[],"sources":["../node_modules/d3-sankey/src/align.js","../node_modules/d3-sankey/src/constant.js","../node_modules/d3-sankey/src/sankey.js","../node_modules/d3-sankey/src/sankeyLinkHorizontal.js","../src/palette.ts","../src/sankeyDiagram.ts"],"sourcesContent":["import {min} from \"d3-array\";\n\nfunction targetDepth(d) {\n return d.target.depth;\n}\n\nexport function left(node) {\n return node.depth;\n}\n\nexport function right(node, n) {\n return n - 1 - node.height;\n}\n\nexport function justify(node, n) {\n return node.sourceLinks.length ? node.depth : n - 1;\n}\n\nexport function center(node) {\n return node.targetLinks.length ? node.depth\n : node.sourceLinks.length ? min(node.sourceLinks, targetDepth) - 1\n : 0;\n}\n","export default function constant(x) {\n return function() {\n return x;\n };\n}\n","import {max, min, sum} from \"d3-array\";\nimport {justify} from \"./align.js\";\nimport constant from \"./constant.js\";\n\nfunction ascendingSourceBreadth(a, b) {\n return ascendingBreadth(a.source, b.source) || a.index - b.index;\n}\n\nfunction ascendingTargetBreadth(a, b) {\n return ascendingBreadth(a.target, b.target) || a.index - b.index;\n}\n\nfunction ascendingBreadth(a, b) {\n return a.y0 - b.y0;\n}\n\nfunction value(d) {\n return d.value;\n}\n\nfunction defaultId(d) {\n return d.index;\n}\n\nfunction defaultNodes(graph) {\n return graph.nodes;\n}\n\nfunction defaultLinks(graph) {\n return graph.links;\n}\n\nfunction find(nodeById, id) {\n const node = nodeById.get(id);\n if (!node) throw new Error(\"missing: \" + id);\n return node;\n}\n\nfunction computeLinkBreadths({nodes}) {\n for (const node of nodes) {\n let y0 = node.y0;\n let y1 = y0;\n for (const link of node.sourceLinks) {\n link.y0 = y0 + link.width / 2;\n y0 += link.width;\n }\n for (const link of node.targetLinks) {\n link.y1 = y1 + link.width / 2;\n y1 += link.width;\n }\n }\n}\n\nexport default function Sankey() {\n let x0 = 0, y0 = 0, x1 = 1, y1 = 1; // extent\n let dx = 24; // nodeWidth\n let dy = 8, py; // nodePadding\n let id = defaultId;\n let align = justify;\n let sort;\n let linkSort;\n let nodes = defaultNodes;\n let links = defaultLinks;\n let iterations = 6;\n\n function sankey() {\n const graph = {nodes: nodes.apply(null, arguments), links: links.apply(null, arguments)};\n computeNodeLinks(graph);\n computeNodeValues(graph);\n computeNodeDepths(graph);\n computeNodeHeights(graph);\n computeNodeBreadths(graph);\n computeLinkBreadths(graph);\n return graph;\n }\n\n sankey.update = function(graph) {\n computeLinkBreadths(graph);\n return graph;\n };\n\n sankey.nodeId = function(_) {\n return arguments.length ? (id = typeof _ === \"function\" ? _ : constant(_), sankey) : id;\n };\n\n sankey.nodeAlign = function(_) {\n return arguments.length ? (align = typeof _ === \"function\" ? _ : constant(_), sankey) : align;\n };\n\n sankey.nodeSort = function(_) {\n return arguments.length ? (sort = _, sankey) : sort;\n };\n\n sankey.nodeWidth = function(_) {\n return arguments.length ? (dx = +_, sankey) : dx;\n };\n\n sankey.nodePadding = function(_) {\n return arguments.length ? (dy = py = +_, sankey) : dy;\n };\n\n sankey.nodes = function(_) {\n return arguments.length ? (nodes = typeof _ === \"function\" ? _ : constant(_), sankey) : nodes;\n };\n\n sankey.links = function(_) {\n return arguments.length ? (links = typeof _ === \"function\" ? _ : constant(_), sankey) : links;\n };\n\n sankey.linkSort = function(_) {\n return arguments.length ? (linkSort = _, sankey) : linkSort;\n };\n\n sankey.size = function(_) {\n return arguments.length ? (x0 = y0 = 0, x1 = +_[0], y1 = +_[1], sankey) : [x1 - x0, y1 - y0];\n };\n\n sankey.extent = function(_) {\n return arguments.length ? (x0 = +_[0][0], x1 = +_[1][0], y0 = +_[0][1], y1 = +_[1][1], sankey) : [[x0, y0], [x1, y1]];\n };\n\n sankey.iterations = function(_) {\n return arguments.length ? (iterations = +_, sankey) : iterations;\n };\n\n function computeNodeLinks({nodes, links}) {\n for (const [i, node] of nodes.entries()) {\n node.index = i;\n node.sourceLinks = [];\n node.targetLinks = [];\n }\n const nodeById = new Map(nodes.map((d, i) => [id(d, i, nodes), d]));\n for (const [i, link] of links.entries()) {\n link.index = i;\n let {source, target} = link;\n if (typeof source !== \"object\") source = link.source = find(nodeById, source);\n if (typeof target !== \"object\") target = link.target = find(nodeById, target);\n source.sourceLinks.push(link);\n target.targetLinks.push(link);\n }\n if (linkSort != null) {\n for (const {sourceLinks, targetLinks} of nodes) {\n sourceLinks.sort(linkSort);\n targetLinks.sort(linkSort);\n }\n }\n }\n\n function computeNodeValues({nodes}) {\n for (const node of nodes) {\n node.value = node.fixedValue === undefined\n ? Math.max(sum(node.sourceLinks, value), sum(node.targetLinks, value))\n : node.fixedValue;\n }\n }\n\n function computeNodeDepths({nodes}) {\n const n = nodes.length;\n let current = new Set(nodes);\n let next = new Set;\n let x = 0;\n while (current.size) {\n for (const node of current) {\n node.depth = x;\n for (const {target} of node.sourceLinks) {\n next.add(target);\n }\n }\n if (++x > n) throw new Error(\"circular link\");\n current = next;\n next = new Set;\n }\n }\n\n function computeNodeHeights({nodes}) {\n const n = nodes.length;\n let current = new Set(nodes);\n let next = new Set;\n let x = 0;\n while (current.size) {\n for (const node of current) {\n node.height = x;\n for (const {source} of node.targetLinks) {\n next.add(source);\n }\n }\n if (++x > n) throw new Error(\"circular link\");\n current = next;\n next = new Set;\n }\n }\n\n function computeNodeLayers({nodes}) {\n const x = max(nodes, d => d.depth) + 1;\n const kx = (x1 - x0 - dx) / (x - 1);\n const columns = new Array(x);\n for (const node of nodes) {\n const i = Math.max(0, Math.min(x - 1, Math.floor(align.call(null, node, x))));\n node.layer = i;\n node.x0 = x0 + i * kx;\n node.x1 = node.x0 + dx;\n if (columns[i]) columns[i].push(node);\n else columns[i] = [node];\n }\n if (sort) for (const column of columns) {\n column.sort(sort);\n }\n return columns;\n }\n\n function initializeNodeBreadths(columns) {\n const ky = min(columns, c => (y1 - y0 - (c.length - 1) * py) / sum(c, value));\n for (const nodes of columns) {\n let y = y0;\n for (const node of nodes) {\n node.y0 = y;\n node.y1 = y + node.value * ky;\n y = node.y1 + py;\n for (const link of node.sourceLinks) {\n link.width = link.value * ky;\n }\n }\n y = (y1 - y + py) / (nodes.length + 1);\n for (let i = 0; i < nodes.length; ++i) {\n const node = nodes[i];\n node.y0 += y * (i + 1);\n node.y1 += y * (i + 1);\n }\n reorderLinks(nodes);\n }\n }\n\n function computeNodeBreadths(graph) {\n const columns = computeNodeLayers(graph);\n py = Math.min(dy, (y1 - y0) / (max(columns, c => c.length) - 1));\n initializeNodeBreadths(columns);\n for (let i = 0; i < iterations; ++i) {\n const alpha = Math.pow(0.99, i);\n const beta = Math.max(1 - alpha, (i + 1) / iterations);\n relaxRightToLeft(columns, alpha, beta);\n relaxLeftToRight(columns, alpha, beta);\n }\n }\n\n // Reposition each node based on its incoming (target) links.\n function relaxLeftToRight(columns, alpha, beta) {\n for (let i = 1, n = columns.length; i < n; ++i) {\n const column = columns[i];\n for (const target of column) {\n let y = 0;\n let w = 0;\n for (const {source, value} of target.targetLinks) {\n let v = value * (target.layer - source.layer);\n y += targetTop(source, target) * v;\n w += v;\n }\n if (!(w > 0)) continue;\n let dy = (y / w - target.y0) * alpha;\n target.y0 += dy;\n target.y1 += dy;\n reorderNodeLinks(target);\n }\n if (sort === undefined) column.sort(ascendingBreadth);\n resolveCollisions(column, beta);\n }\n }\n\n // Reposition each node based on its outgoing (source) links.\n function relaxRightToLeft(columns, alpha, beta) {\n for (let n = columns.length, i = n - 2; i >= 0; --i) {\n const column = columns[i];\n for (const source of column) {\n let y = 0;\n let w = 0;\n for (const {target, value} of source.sourceLinks) {\n let v = value * (target.layer - source.layer);\n y += sourceTop(source, target) * v;\n w += v;\n }\n if (!(w > 0)) continue;\n let dy = (y / w - source.y0) * alpha;\n source.y0 += dy;\n source.y1 += dy;\n reorderNodeLinks(source);\n }\n if (sort === undefined) column.sort(ascendingBreadth);\n resolveCollisions(column, beta);\n }\n }\n\n function resolveCollisions(nodes, alpha) {\n const i = nodes.length >> 1;\n const subject = nodes[i];\n resolveCollisionsBottomToTop(nodes, subject.y0 - py, i - 1, alpha);\n resolveCollisionsTopToBottom(nodes, subject.y1 + py, i + 1, alpha);\n resolveCollisionsBottomToTop(nodes, y1, nodes.length - 1, alpha);\n resolveCollisionsTopToBottom(nodes, y0, 0, alpha);\n }\n\n // Push any overlapping nodes down.\n function resolveCollisionsTopToBottom(nodes, y, i, alpha) {\n for (; i < nodes.length; ++i) {\n const node = nodes[i];\n const dy = (y - node.y0) * alpha;\n if (dy > 1e-6) node.y0 += dy, node.y1 += dy;\n y = node.y1 + py;\n }\n }\n\n // Push any overlapping nodes up.\n function resolveCollisionsBottomToTop(nodes, y, i, alpha) {\n for (; i >= 0; --i) {\n const node = nodes[i];\n const dy = (node.y1 - y) * alpha;\n if (dy > 1e-6) node.y0 -= dy, node.y1 -= dy;\n y = node.y0 - py;\n }\n }\n\n function reorderNodeLinks({sourceLinks, targetLinks}) {\n if (linkSort === undefined) {\n for (const {source: {sourceLinks}} of targetLinks) {\n sourceLinks.sort(ascendingTargetBreadth);\n }\n for (const {target: {targetLinks}} of sourceLinks) {\n targetLinks.sort(ascendingSourceBreadth);\n }\n }\n }\n\n function reorderLinks(nodes) {\n if (linkSort === undefined) {\n for (const {sourceLinks, targetLinks} of nodes) {\n sourceLinks.sort(ascendingTargetBreadth);\n targetLinks.sort(ascendingSourceBreadth);\n }\n }\n }\n\n // Returns the target.y0 that would produce an ideal link from source to target.\n function targetTop(source, target) {\n let y = source.y0 - (source.sourceLinks.length - 1) * py / 2;\n for (const {target: node, width} of source.sourceLinks) {\n if (node === target) break;\n y += width + py;\n }\n for (const {source: node, width} of target.targetLinks) {\n if (node === source) break;\n y -= width;\n }\n return y;\n }\n\n // Returns the source.y0 that would produce an ideal link from source to target.\n function sourceTop(source, target) {\n let y = target.y0 - (target.targetLinks.length - 1) * py / 2;\n for (const {source: node, width} of target.targetLinks) {\n if (node === source) break;\n y += width + py;\n }\n for (const {target: node, width} of source.sourceLinks) {\n if (node === target) break;\n y -= width;\n }\n return y;\n }\n\n return sankey;\n}\n","import {linkHorizontal} from \"d3-shape\";\n\nfunction horizontalSource(d) {\n return [d.source.x1, d.y0];\n}\n\nfunction horizontalTarget(d) {\n return [d.target.x0, d.y1];\n}\n\nexport default function() {\n return linkHorizontal()\n .source(horizontalSource)\n .target(horizontalTarget);\n}\n","// ── Types ────────────────────────────────────────────────────────────────────────────────────────────────────────────\n\nexport type ColorModeId = 'dark' | 'light';\n\n// ── Constants ────────────────────────────────────────────────────────────────────────────────────────────────────────\n// Fixed-order categorical palette validated for adjacent-pair CVD/normal-vision contrast in both modes. Every node in a\n// Sankey diagram carries a direct text label, so identity never relies on colour alone - slots may cycle past 8.\n\nexport const CATEGORICAL_PALETTE: readonly { readonly dark: string; readonly light: string }[] = [\n { dark: '#3987e5', light: '#2a78d6' }, // blue\n { dark: '#d95926', light: '#eb6834' }, // orange\n { dark: '#199e70', light: '#1baf7a' }, // aqua\n { dark: '#c98500', light: '#eda100' }, // yellow\n { dark: '#d55181', light: '#e87ba4' }, // magenta\n { dark: '#008300', light: '#008300' }, // green\n { dark: '#9085e9', light: '#4a3aa7' }, // violet\n { dark: '#e66767', light: '#e34948' } // red\n];\n\nexport const INK: Readonly<Record<ColorModeId, { readonly muted: string; readonly primary: string; readonly secondary: string }>> = {\n dark: { muted: '#898781', primary: '#ffffff', secondary: '#c3c2b7' },\n light: { muted: '#898781', primary: '#0b0b0b', secondary: '#52514e' }\n};\n\nexport const SURFACE: Readonly<Record<ColorModeId, { readonly border: string; readonly chart: string }>> = {\n dark: { border: 'rgba(255,255,255,0.10)', chart: '#1a1a19' },\n light: { border: 'rgba(11,11,11,0.10)', chart: '#fcfcfb' }\n};\n\n// ── Helpers ──────────────────────────────────────────────────────────────────────────────────────────────────────────\n\nexport function categoricalColor(index: number, colorModeId: ColorModeId): string {\n const slot = CATEGORICAL_PALETTE[((index % CATEGORICAL_PALETTE.length) + CATEGORICAL_PALETTE.length) % CATEGORICAL_PALETTE.length];\n if (slot == null) throw new Error('Categorical palette is empty.');\n return colorModeId === 'dark' ? slot.dark : slot.light;\n}\n","// ── External Dependencies & Registrations\nimport { select } from 'd3-selection';\nimport { sankey, type SankeyGraph, type SankeyLink as SankeyLinkExtra, sankeyLinkHorizontal, type SankeyNode as SankeyNodeExtra } from 'd3-sankey';\n\n// ── Local\nimport { categoricalColor, type ColorModeId, INK, SURFACE } from '@/palette';\n\n// ── Types ────────────────────────────────────────────────────────────────────────────────────────────────────────────\n\nexport interface SankeyDiagramNode {\n id: string;\n name: string;\n}\n\nexport interface SankeyDiagramLink {\n source: string;\n target: string;\n value: number;\n}\n\nexport interface SankeyDiagramData {\n links: SankeyDiagramLink[];\n nodes: SankeyDiagramNode[];\n}\n\nexport interface SankeyDiagramOptions {\n colorModeId?: ColorModeId;\n nodePadding?: number;\n nodeWidth?: number;\n}\n\nexport interface SankeyDiagramHandle {\n resize: () => void;\n svg: SVGSVGElement;\n}\n\ntype LaidOutNode = SankeyDiagramNode & SankeyNodeExtra<SankeyDiagramNode, SankeyDiagramLink>;\ntype LaidOutLink = SankeyLinkExtra<SankeyDiagramNode, SankeyDiagramLink>;\n\n// ── Constants ────────────────────────────────────────────────────────────────────────────────────────────────────────\n\nconst DEFAULT_NODE_WIDTH = 16;\nconst DEFAULT_NODE_PADDING = 12;\nconst DEFAULT_HEIGHT = 480;\nconst DEFAULT_WIDTH = 640;\nconst LABEL_MARGIN = 6;\n\n// ── Actions ──────────────────────────────────────────────────────────────────────────────────────────────────────────\n\nexport function renderSankeyDiagram(data: SankeyDiagramData, renderTo: HTMLElement, options: SankeyDiagramOptions = {}): SankeyDiagramHandle {\n const colorModeId = options.colorModeId ?? 'light';\n const ink = INK[colorModeId];\n const surface = SURFACE[colorModeId];\n\n if (getComputedStyle(renderTo).position === 'static') renderTo.style.position = 'relative';\n\n const tooltip = select(renderTo)\n .append('div')\n .attr('role', 'tooltip')\n .style('position', 'absolute')\n .style('pointer-events', 'none')\n .style('z-index', '1')\n .style('opacity', '0')\n .style('transition', 'opacity 120ms ease')\n .style('padding', '4px 8px')\n .style('border-radius', '4px')\n .style('font', '12px system-ui, -apple-system, \"Segoe UI\", sans-serif')\n .style('white-space', 'nowrap')\n .style('background', surface.chart)\n .style('color', ink.primary)\n .style('border', `1px solid ${surface.border}`)\n .style('box-shadow', '0 2px 8px rgba(0,0,0,0.15)');\n\n function showTooltip(event: MouseEvent, text: string): void {\n const bounds = renderTo.getBoundingClientRect();\n tooltip\n .html(text)\n .style('left', `${String(event.clientX - bounds.left + 12)}px`)\n .style('top', `${String(event.clientY - bounds.top + 12)}px`)\n .style('opacity', '1');\n }\n\n function hideTooltip(): void {\n tooltip.style('opacity', '0');\n }\n\n function draw(): SVGSVGElement {\n select(renderTo).selectAll('svg').remove();\n\n const width = renderTo.clientWidth || DEFAULT_WIDTH;\n const height = renderTo.clientHeight || DEFAULT_HEIGHT;\n\n const graph: SankeyGraph<SankeyDiagramNode, SankeyDiagramLink> = {\n links: data.links.map((link) => ({ ...link })),\n nodes: data.nodes.map((node) => ({ ...node }))\n };\n\n const layout = sankey<SankeyDiagramNode, SankeyDiagramLink>()\n .nodeId((node) => node.id)\n .nodeWidth(options.nodeWidth ?? DEFAULT_NODE_WIDTH)\n .nodePadding(options.nodePadding ?? DEFAULT_NODE_PADDING)\n .extent([\n [1, 1],\n [width - 1, height - 1]\n ]);\n\n const { links, nodes } = layout(graph) as { links: LaidOutLink[]; nodes: LaidOutNode[] };\n\n const svgSelection = select(renderTo)\n .insert('svg', 'div')\n .attr('viewBox', `0 0 ${String(width)} ${String(height)}`)\n .attr('width', '100%')\n .attr('height', '100%')\n .attr('font-family', 'system-ui, -apple-system, \"Segoe UI\", sans-serif')\n .attr('font-size', 12);\n\n const linkPath = sankeyLinkHorizontal<SankeyDiagramNode, SankeyDiagramLink>();\n\n svgSelection\n .append('g')\n .attr('fill', 'none')\n .selectAll('path')\n .data(links)\n .join('path')\n .attr('d', linkPath)\n .attr('stroke', (link) => categoricalColor(nodes.indexOf(link.source as LaidOutNode), colorModeId))\n .attr('stroke-opacity', 0.35)\n .attr('stroke-width', (link) => Math.max(1, link.width ?? 1))\n .on('mouseenter', (event: MouseEvent, link) => {\n select(event.currentTarget as SVGPathElement).attr('stroke-opacity', 0.6);\n const source = link.source as LaidOutNode;\n const target = link.target as LaidOutNode;\n showTooltip(event, `${source.name} → ${target.name}<br>${link.value.toLocaleString()}`);\n })\n .on('mousemove', (event: MouseEvent, link) => {\n const source = link.source as LaidOutNode;\n const target = link.target as LaidOutNode;\n showTooltip(event, `${source.name} → ${target.name}<br>${link.value.toLocaleString()}`);\n })\n .on('mouseleave', (event: MouseEvent) => {\n select(event.currentTarget as SVGPathElement).attr('stroke-opacity', 0.35);\n hideTooltip();\n });\n\n const nodeGroup = svgSelection.append('g').selectAll('g').data(nodes).join('g');\n\n nodeGroup\n .append('rect')\n .attr('x', (node) => node.x0 ?? 0)\n .attr('y', (node) => node.y0 ?? 0)\n .attr('width', (node) => (node.x1 ?? 0) - (node.x0 ?? 0))\n .attr('height', (node) => Math.max(1, (node.y1 ?? 0) - (node.y0 ?? 0)))\n .attr('rx', 2)\n .attr('fill', (_node, index) => categoricalColor(index, colorModeId))\n .on('mouseenter', (event: MouseEvent, node) => {\n showTooltip(event, `${node.name}<br>${(node.value ?? 0).toLocaleString()}`);\n })\n .on('mousemove', (event: MouseEvent, node) => {\n showTooltip(event, `${node.name}<br>${(node.value ?? 0).toLocaleString()}`);\n })\n .on('mouseleave', hideTooltip);\n\n nodeGroup\n .append('text')\n .attr('x', (node) => ((node.x0 ?? 0) < width / 2 ? (node.x1 ?? 0) + LABEL_MARGIN : (node.x0 ?? 0) - LABEL_MARGIN))\n .attr('y', (node) => ((node.y0 ?? 0) + (node.y1 ?? 0)) / 2)\n .attr('dy', '0.35em')\n .attr('text-anchor', (node) => ((node.x0 ?? 0) < width / 2 ? 'start' : 'end'))\n .attr('fill', ink.primary)\n .text((node) => node.name);\n\n const svgNode = svgSelection.node();\n if (svgNode == null) throw new Error('Failed to create Sankey diagram SVG element.');\n return svgNode;\n }\n\n let svg = draw();\n\n return {\n resize: () => {\n svg = draw();\n },\n get svg() {\n return svg;\n }\n };\n}\n"],"x_google_ignoreList":[0,1,2,3],"mappings":";;;;AAcA,SAAgB,EAAQ,GAAM,GAAG;CAC/B,OAAO,EAAK,YAAY,SAAS,EAAK,QAAQ,IAAI;AACpD;;;AChBA,SAAwB,EAAS,GAAG;CAClC,OAAO,WAAW;EAChB,OAAO;CACT;AACF;;;ACAA,SAAS,EAAuB,GAAG,GAAG;CACpC,OAAO,EAAiB,EAAE,QAAQ,EAAE,MAAM,KAAK,EAAE,QAAQ,EAAE;AAC7D;AAEA,SAAS,EAAuB,GAAG,GAAG;CACpC,OAAO,EAAiB,EAAE,QAAQ,EAAE,MAAM,KAAK,EAAE,QAAQ,EAAE;AAC7D;AAEA,SAAS,EAAiB,GAAG,GAAG;CAC9B,OAAO,EAAE,KAAK,EAAE;AAClB;AAEA,SAAS,EAAM,GAAG;CAChB,OAAO,EAAE;AACX;AAEA,SAAS,EAAU,GAAG;CACpB,OAAO,EAAE;AACX;AAEA,SAAS,EAAa,GAAO;CAC3B,OAAO,EAAM;AACf;AAEA,SAAS,EAAa,GAAO;CAC3B,OAAO,EAAM;AACf;AAEA,SAAS,EAAK,GAAU,GAAI;CAC1B,IAAM,IAAO,EAAS,IAAI,CAAE;CAC5B,IAAI,CAAC,GAAM,MAAU,MAAM,cAAc,CAAE;CAC3C,OAAO;AACT;AAEA,SAAS,EAAoB,EAAC,YAAQ;CACpC,KAAK,IAAM,KAAQ,GAAO;EACxB,IAAI,IAAK,EAAK,IACV,IAAK;EACT,KAAK,IAAM,KAAQ,EAAK,aAEtB,AADA,EAAK,KAAK,IAAK,EAAK,QAAQ,GAC5B,KAAM,EAAK;EAEb,KAAK,IAAM,KAAQ,E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AAK,OAAO,EAAK,SAAS,EAAA,CAAG,eAAe,GAAG;EAC9E,CAAC,CAAC,CACD,GAAG,cAAc,GAAmB,MAAS;GAC1C,EAAY,GAAO,GAAG,EAAK,KAAK,OAAO,EAAK,SAAS,EAAA,CAAG,eAAe,GAAG;EAC9E,CAAC,CAAC,CACD,GAAG,cAAc,CAAW,GAEjC,EACK,OAAO,MAAM,CAAC,CACd,KAAK,MAAM,OAAW,EAAK,MAAM,KAAK,IAAQ,KAAK,EAAK,MAAM,KAAK,KAAgB,EAAK,MAAM,KAAK,CAAa,CAAC,CACjH,KAAK,MAAM,QAAW,EAAK,MAAM,MAAM,EAAK,MAAM,MAAM,CAAC,CAAC,CAC1D,KAAK,MAAM,QAAQ,CAAC,CACpB,KAAK,gBAAgB,OAAW,EAAK,MAAM,KAAK,IAAQ,IAAI,UAAU,KAAM,CAAC,CAC7E,KAAK,QAAQ,EAAI,OAAO,CAAC,CACzB,MAAM,MAAS,EAAK,IAAI;EAE7B,IAAM,IAAU,EAAa,KAAK;EAClC,IAAI,KAAW,MAAM,MAAU,MAAM,8CAA8C;EACnF,OAAO;CACX;CAEA,IAAI,IAAM,EAAK;CAEf,OAAO;EACH,cAAc;GACV,IAAM,EAAK;EACf;EACA,IAAI,MAAM;GACN,OAAO;EACX;CACJ;AACJ"}
1
+ {"version":3,"file":"sankeyDiagram-DDZfWF8l.js","names":[],"sources":["../node_modules/d3-sankey/src/align.js","../node_modules/d3-sankey/src/constant.js","../node_modules/d3-sankey/src/sankey.js","../node_modules/d3-sankey/src/sankeyLinkHorizontal.js","../src/palette.ts","../src/sankeyDiagram.ts"],"sourcesContent":["import {min} from \"d3-array\";\n\nfunction targetDepth(d) {\n return d.target.depth;\n}\n\nexport function left(node) {\n return node.depth;\n}\n\nexport function right(node, n) {\n return n - 1 - node.height;\n}\n\nexport function justify(node, n) {\n return node.sourceLinks.length ? node.depth : n - 1;\n}\n\nexport function center(node) {\n return node.targetLinks.length ? node.depth\n : node.sourceLinks.length ? min(node.sourceLinks, targetDepth) - 1\n : 0;\n}\n","export default function constant(x) {\n return function() {\n return x;\n };\n}\n","import {max, min, sum} from \"d3-array\";\nimport {justify} from \"./align.js\";\nimport constant from \"./constant.js\";\n\nfunction ascendingSourceBreadth(a, b) {\n return ascendingBreadth(a.source, b.source) || a.index - b.index;\n}\n\nfunction ascendingTargetBreadth(a, b) {\n return ascendingBreadth(a.target, b.target) || a.index - b.index;\n}\n\nfunction ascendingBreadth(a, b) {\n return a.y0 - b.y0;\n}\n\nfunction value(d) {\n return d.value;\n}\n\nfunction defaultId(d) {\n return d.index;\n}\n\nfunction defaultNodes(graph) {\n return graph.nodes;\n}\n\nfunction defaultLinks(graph) {\n return graph.links;\n}\n\nfunction find(nodeById, id) {\n const node = nodeById.get(id);\n if (!node) throw new Error(\"missing: \" + id);\n return node;\n}\n\nfunction computeLinkBreadths({nodes}) {\n for (const node of nodes) {\n let y0 = node.y0;\n let y1 = y0;\n for (const link of node.sourceLinks) {\n link.y0 = y0 + link.width / 2;\n y0 += link.width;\n }\n for (const link of node.targetLinks) {\n link.y1 = y1 + link.width / 2;\n y1 += link.width;\n }\n }\n}\n\nexport default function Sankey() {\n let x0 = 0, y0 = 0, x1 = 1, y1 = 1; // extent\n let dx = 24; // nodeWidth\n let dy = 8, py; // nodePadding\n let id = defaultId;\n let align = justify;\n let sort;\n let linkSort;\n let nodes = defaultNodes;\n let links = defaultLinks;\n let iterations = 6;\n\n function sankey() {\n const graph = {nodes: nodes.apply(null, arguments), links: links.apply(null, arguments)};\n computeNodeLinks(graph);\n computeNodeValues(graph);\n computeNodeDepths(graph);\n computeNodeHeights(graph);\n computeNodeBreadths(graph);\n computeLinkBreadths(graph);\n return graph;\n }\n\n sankey.update = function(graph) {\n computeLinkBreadths(graph);\n return graph;\n };\n\n sankey.nodeId = function(_) {\n return arguments.length ? (id = typeof _ === \"function\" ? _ : constant(_), sankey) : id;\n };\n\n sankey.nodeAlign = function(_) {\n return arguments.length ? (align = typeof _ === \"function\" ? _ : constant(_), sankey) : align;\n };\n\n sankey.nodeSort = function(_) {\n return arguments.length ? (sort = _, sankey) : sort;\n };\n\n sankey.nodeWidth = function(_) {\n return arguments.length ? (dx = +_, sankey) : dx;\n };\n\n sankey.nodePadding = function(_) {\n return arguments.length ? (dy = py = +_, sankey) : dy;\n };\n\n sankey.nodes = function(_) {\n return arguments.length ? (nodes = typeof _ === \"function\" ? _ : constant(_), sankey) : nodes;\n };\n\n sankey.links = function(_) {\n return arguments.length ? (links = typeof _ === \"function\" ? _ : constant(_), sankey) : links;\n };\n\n sankey.linkSort = function(_) {\n return arguments.length ? (linkSort = _, sankey) : linkSort;\n };\n\n sankey.size = function(_) {\n return arguments.length ? (x0 = y0 = 0, x1 = +_[0], y1 = +_[1], sankey) : [x1 - x0, y1 - y0];\n };\n\n sankey.extent = function(_) {\n return arguments.length ? (x0 = +_[0][0], x1 = +_[1][0], y0 = +_[0][1], y1 = +_[1][1], sankey) : [[x0, y0], [x1, y1]];\n };\n\n sankey.iterations = function(_) {\n return arguments.length ? (iterations = +_, sankey) : iterations;\n };\n\n function computeNodeLinks({nodes, links}) {\n for (const [i, node] of nodes.entries()) {\n node.index = i;\n node.sourceLinks = [];\n node.targetLinks = [];\n }\n const nodeById = new Map(nodes.map((d, i) => [id(d, i, nodes), d]));\n for (const [i, link] of links.entries()) {\n link.index = i;\n let {source, target} = link;\n if (typeof source !== \"object\") source = link.source = find(nodeById, source);\n if (typeof target !== \"object\") target = link.target = find(nodeById, target);\n source.sourceLinks.push(link);\n target.targetLinks.push(link);\n }\n if (linkSort != null) {\n for (const {sourceLinks, targetLinks} of nodes) {\n sourceLinks.sort(linkSort);\n targetLinks.sort(linkSort);\n }\n }\n }\n\n function computeNodeValues({nodes}) {\n for (const node of nodes) {\n node.value = node.fixedValue === undefined\n ? Math.max(sum(node.sourceLinks, value), sum(node.targetLinks, value))\n : node.fixedValue;\n }\n }\n\n function computeNodeDepths({nodes}) {\n const n = nodes.length;\n let current = new Set(nodes);\n let next = new Set;\n let x = 0;\n while (current.size) {\n for (const node of current) {\n node.depth = x;\n for (const {target} of node.sourceLinks) {\n next.add(target);\n }\n }\n if (++x > n) throw new Error(\"circular link\");\n current = next;\n next = new Set;\n }\n }\n\n function computeNodeHeights({nodes}) {\n const n = nodes.length;\n let current = new Set(nodes);\n let next = new Set;\n let x = 0;\n while (current.size) {\n for (const node of current) {\n node.height = x;\n for (const {source} of node.targetLinks) {\n next.add(source);\n }\n }\n if (++x > n) throw new Error(\"circular link\");\n current = next;\n next = new Set;\n }\n }\n\n function computeNodeLayers({nodes}) {\n const x = max(nodes, d => d.depth) + 1;\n const kx = (x1 - x0 - dx) / (x - 1);\n const columns = new Array(x);\n for (const node of nodes) {\n const i = Math.max(0, Math.min(x - 1, Math.floor(align.call(null, node, x))));\n node.layer = i;\n node.x0 = x0 + i * kx;\n node.x1 = node.x0 + dx;\n if (columns[i]) columns[i].push(node);\n else columns[i] = [node];\n }\n if (sort) for (const column of columns) {\n column.sort(sort);\n }\n return columns;\n }\n\n function initializeNodeBreadths(columns) {\n const ky = min(columns, c => (y1 - y0 - (c.length - 1) * py) / sum(c, value));\n for (const nodes of columns) {\n let y = y0;\n for (const node of nodes) {\n node.y0 = y;\n node.y1 = y + node.value * ky;\n y = node.y1 + py;\n for (const link of node.sourceLinks) {\n link.width = link.value * ky;\n }\n }\n y = (y1 - y + py) / (nodes.length + 1);\n for (let i = 0; i < nodes.length; ++i) {\n const node = nodes[i];\n node.y0 += y * (i + 1);\n node.y1 += y * (i + 1);\n }\n reorderLinks(nodes);\n }\n }\n\n function computeNodeBreadths(graph) {\n const columns = computeNodeLayers(graph);\n py = Math.min(dy, (y1 - y0) / (max(columns, c => c.length) - 1));\n initializeNodeBreadths(columns);\n for (let i = 0; i < iterations; ++i) {\n const alpha = Math.pow(0.99, i);\n const beta = Math.max(1 - alpha, (i + 1) / iterations);\n relaxRightToLeft(columns, alpha, beta);\n relaxLeftToRight(columns, alpha, beta);\n }\n }\n\n // Reposition each node based on its incoming (target) links.\n function relaxLeftToRight(columns, alpha, beta) {\n for (let i = 1, n = columns.length; i < n; ++i) {\n const column = columns[i];\n for (const target of column) {\n let y = 0;\n let w = 0;\n for (const {source, value} of target.targetLinks) {\n let v = value * (target.layer - source.layer);\n y += targetTop(source, target) * v;\n w += v;\n }\n if (!(w > 0)) continue;\n let dy = (y / w - target.y0) * alpha;\n target.y0 += dy;\n target.y1 += dy;\n reorderNodeLinks(target);\n }\n if (sort === undefined) column.sort(ascendingBreadth);\n resolveCollisions(column, beta);\n }\n }\n\n // Reposition each node based on its outgoing (source) links.\n function relaxRightToLeft(columns, alpha, beta) {\n for (let n = columns.length, i = n - 2; i >= 0; --i) {\n const column = columns[i];\n for (const source of column) {\n let y = 0;\n let w = 0;\n for (const {target, value} of source.sourceLinks) {\n let v = value * (target.layer - source.layer);\n y += sourceTop(source, target) * v;\n w += v;\n }\n if (!(w > 0)) continue;\n let dy = (y / w - source.y0) * alpha;\n source.y0 += dy;\n source.y1 += dy;\n reorderNodeLinks(source);\n }\n if (sort === undefined) column.sort(ascendingBreadth);\n resolveCollisions(column, beta);\n }\n }\n\n function resolveCollisions(nodes, alpha) {\n const i = nodes.length >> 1;\n const subject = nodes[i];\n resolveCollisionsBottomToTop(nodes, subject.y0 - py, i - 1, alpha);\n resolveCollisionsTopToBottom(nodes, subject.y1 + py, i + 1, alpha);\n resolveCollisionsBottomToTop(nodes, y1, nodes.length - 1, alpha);\n resolveCollisionsTopToBottom(nodes, y0, 0, alpha);\n }\n\n // Push any overlapping nodes down.\n function resolveCollisionsTopToBottom(nodes, y, i, alpha) {\n for (; i < nodes.length; ++i) {\n const node = nodes[i];\n const dy = (y - node.y0) * alpha;\n if (dy > 1e-6) node.y0 += dy, node.y1 += dy;\n y = node.y1 + py;\n }\n }\n\n // Push any overlapping nodes up.\n function resolveCollisionsBottomToTop(nodes, y, i, alpha) {\n for (; i >= 0; --i) {\n const node = nodes[i];\n const dy = (node.y1 - y) * alpha;\n if (dy > 1e-6) node.y0 -= dy, node.y1 -= dy;\n y = node.y0 - py;\n }\n }\n\n function reorderNodeLinks({sourceLinks, targetLinks}) {\n if (linkSort === undefined) {\n for (const {source: {sourceLinks}} of targetLinks) {\n sourceLinks.sort(ascendingTargetBreadth);\n }\n for (const {target: {targetLinks}} of sourceLinks) {\n targetLinks.sort(ascendingSourceBreadth);\n }\n }\n }\n\n function reorderLinks(nodes) {\n if (linkSort === undefined) {\n for (const {sourceLinks, targetLinks} of nodes) {\n sourceLinks.sort(ascendingTargetBreadth);\n targetLinks.sort(ascendingSourceBreadth);\n }\n }\n }\n\n // Returns the target.y0 that would produce an ideal link from source to target.\n function targetTop(source, target) {\n let y = source.y0 - (source.sourceLinks.length - 1) * py / 2;\n for (const {target: node, width} of source.sourceLinks) {\n if (node === target) break;\n y += width + py;\n }\n for (const {source: node, width} of target.targetLinks) {\n if (node === source) break;\n y -= width;\n }\n return y;\n }\n\n // Returns the source.y0 that would produce an ideal link from source to target.\n function sourceTop(source, target) {\n let y = target.y0 - (target.targetLinks.length - 1) * py / 2;\n for (const {source: node, width} of target.targetLinks) {\n if (node === source) break;\n y += width + py;\n }\n for (const {target: node, width} of source.sourceLinks) {\n if (node === target) break;\n y -= width;\n }\n return y;\n }\n\n return sankey;\n}\n","import {linkHorizontal} from \"d3-shape\";\n\nfunction horizontalSource(d) {\n return [d.source.x1, d.y0];\n}\n\nfunction horizontalTarget(d) {\n return [d.target.x0, d.y1];\n}\n\nexport default function() {\n return linkHorizontal()\n .source(horizontalSource)\n .target(horizontalTarget);\n}\n","// ── Types ────────────────────────────────────────────────────────────────────────────────────────────────────────────\n\nexport type ColorModeId = 'dark' | 'light';\n\n// ── Constants ────────────────────────────────────────────────────────────────────────────────────────────────────────\n// Fixed-order categorical palette validated for adjacent-pair CVD/normal-vision contrast in both modes. Every node in a\n// Sankey diagram carries a direct text label, so identity never relies on colour alone - slots may cycle past 8.\n\nexport const CATEGORICAL_PALETTE: readonly { readonly dark: string; readonly light: string }[] = [\n { dark: '#3987e5', light: '#2a78d6' }, // blue\n { dark: '#d95926', light: '#eb6834' }, // orange\n { dark: '#199e70', light: '#1baf7a' }, // aqua\n { dark: '#c98500', light: '#eda100' }, // yellow\n { dark: '#d55181', light: '#e87ba4' }, // magenta\n { dark: '#008300', light: '#008300' }, // green\n { dark: '#9085e9', light: '#4a3aa7' }, // violet\n { dark: '#e66767', light: '#e34948' } // red\n];\n\nexport const INK: Readonly<Record<ColorModeId, { readonly muted: string; readonly primary: string; readonly secondary: string }>> = {\n dark: { muted: '#898781', primary: '#ffffff', secondary: '#c3c2b7' },\n light: { muted: '#898781', primary: '#0b0b0b', secondary: '#52514e' }\n};\n\nexport const SURFACE: Readonly<Record<ColorModeId, { readonly border: string; readonly chart: string }>> = {\n dark: { border: 'rgba(255,255,255,0.10)', chart: '#1a1a19' },\n light: { border: 'rgba(11,11,11,0.10)', chart: '#fcfcfb' }\n};\n\n// ── Helpers ──────────────────────────────────────────────────────────────────────────────────────────────────────────\n\nexport function categoricalColor(index: number, colorModeId: ColorModeId): string {\n const slot = CATEGORICAL_PALETTE[((index % CATEGORICAL_PALETTE.length) + CATEGORICAL_PALETTE.length) % CATEGORICAL_PALETTE.length];\n if (slot == null) throw new Error('Categorical palette is empty.');\n return colorModeId === 'dark' ? slot.dark : slot.light;\n}\n","// ── External Dependencies & Registrations\nimport { select } from 'd3-selection';\nimport { sankey, type SankeyGraph, type SankeyLink as SankeyLinkExtra, sankeyLinkHorizontal, type SankeyNode as SankeyNodeExtra } from 'd3-sankey';\n\n// ── Local\nimport { categoricalColor, type ColorModeId, INK, SURFACE } from '@/palette';\n\n// ── Types ────────────────────────────────────────────────────────────────────────────────────────────────────────────\n\nexport interface SankeyDiagramNode {\n id: string;\n name: string;\n}\n\nexport interface SankeyDiagramLink {\n source: string;\n target: string;\n value: number;\n}\n\nexport interface SankeyDiagramData {\n links: SankeyDiagramLink[];\n nodes: SankeyDiagramNode[];\n}\n\nexport interface SankeyDiagramOptions {\n colorModeId?: ColorModeId;\n nodePadding?: number;\n nodeWidth?: number;\n}\n\nexport interface SankeyDiagramHandle {\n resize: () => void;\n svg: SVGSVGElement;\n}\n\ntype LaidOutNode = SankeyDiagramNode & SankeyNodeExtra<SankeyDiagramNode, SankeyDiagramLink>;\ntype LaidOutLink = SankeyLinkExtra<SankeyDiagramNode, SankeyDiagramLink>;\n\n// ── Constants ────────────────────────────────────────────────────────────────────────────────────────────────────────\n\nconst DEFAULT_NODE_WIDTH = 16;\nconst DEFAULT_NODE_PADDING = 12;\nconst DEFAULT_HEIGHT = 480;\nconst DEFAULT_WIDTH = 640;\nconst LABEL_MARGIN = 6;\n\n// ── Actions ──────────────────────────────────────────────────────────────────────────────────────────────────────────\n\nexport function renderSankeyDiagram(data: SankeyDiagramData, renderTo: HTMLElement, options: SankeyDiagramOptions = {}): SankeyDiagramHandle {\n const colorModeId = options.colorModeId ?? 'light';\n const ink = INK[colorModeId];\n const surface = SURFACE[colorModeId];\n\n if (getComputedStyle(renderTo).position === 'static') renderTo.style.position = 'relative';\n\n const tooltip = select(renderTo)\n .append('div')\n .attr('role', 'tooltip')\n .style('position', 'absolute')\n .style('pointer-events', 'none')\n .style('z-index', '1')\n .style('opacity', '0')\n .style('transition', 'opacity 120ms ease')\n .style('padding', '4px 8px')\n .style('border-radius', '4px')\n .style('font', '12px system-ui, -apple-system, \"Segoe UI\", sans-serif')\n .style('white-space', 'nowrap')\n .style('background', surface.chart)\n .style('color', ink.primary)\n .style('border', `1px solid ${surface.border}`)\n .style('box-shadow', '0 2px 8px rgba(0,0,0,0.15)');\n\n function showTooltip(event: MouseEvent, text: string): void {\n const bounds = renderTo.getBoundingClientRect();\n tooltip\n .html(text)\n .style('left', `${String(event.clientX - bounds.left + 12)}px`)\n .style('top', `${String(event.clientY - bounds.top + 12)}px`)\n .style('opacity', '1');\n }\n\n function hideTooltip(): void {\n tooltip.style('opacity', '0');\n }\n\n function draw(): SVGSVGElement {\n select(renderTo).selectAll('svg').remove();\n\n const width = renderTo.clientWidth || DEFAULT_WIDTH;\n const height = renderTo.clientHeight || DEFAULT_HEIGHT;\n\n const graph: SankeyGraph<SankeyDiagramNode, SankeyDiagramLink> = {\n links: data.links.map((link) => ({ ...link })),\n nodes: data.nodes.map((node) => ({ ...node }))\n };\n\n const layout = sankey<SankeyDiagramNode, SankeyDiagramLink>()\n .nodeId((node) => node.id)\n .nodeWidth(options.nodeWidth ?? DEFAULT_NODE_WIDTH)\n .nodePadding(options.nodePadding ?? DEFAULT_NODE_PADDING)\n .extent([\n [1, 1],\n [width - 1, height - 1]\n ]);\n\n const { links, nodes } = layout(graph) as { links: LaidOutLink[]; nodes: LaidOutNode[] };\n\n const svgSelection = select(renderTo)\n .insert('svg', 'div')\n .attr('viewBox', `0 0 ${String(width)} ${String(height)}`)\n .attr('width', '100%')\n .attr('height', '100%')\n .attr('font-family', 'system-ui, -apple-system, \"Segoe UI\", sans-serif')\n .attr('font-size', 12);\n\n const linkPath = sankeyLinkHorizontal<SankeyDiagramNode, SankeyDiagramLink>();\n\n svgSelection\n .append('g')\n .attr('fill', 'none')\n .selectAll('path')\n .data(links)\n .join('path')\n .attr('d', linkPath)\n .attr('stroke', (link) => categoricalColor(nodes.indexOf(link.source as LaidOutNode), colorModeId))\n .attr('stroke-opacity', 0.35)\n .attr('stroke-width', (link) => Math.max(1, link.width ?? 1))\n .on('mouseenter', (event: MouseEvent, link) => {\n select(event.currentTarget as SVGPathElement).attr('stroke-opacity', 0.6);\n const source = link.source as LaidOutNode;\n const target = link.target as LaidOutNode;\n showTooltip(event, `${source.name} → ${target.name}<br>${link.value.toLocaleString()}`);\n })\n .on('mousemove', (event: MouseEvent, link) => {\n const source = link.source as LaidOutNode;\n const target = link.target as LaidOutNode;\n showTooltip(event, `${source.name} → ${target.name}<br>${link.value.toLocaleString()}`);\n })\n .on('mouseleave', (event: MouseEvent) => {\n select(event.currentTarget as SVGPathElement).attr('stroke-opacity', 0.35);\n hideTooltip();\n });\n\n const nodeGroup = svgSelection.append('g').selectAll('g').data(nodes).join('g');\n\n nodeGroup\n .append('rect')\n .attr('x', (node) => node.x0 ?? 0)\n .attr('y', (node) => node.y0 ?? 0)\n .attr('width', (node) => (node.x1 ?? 0) - (node.x0 ?? 0))\n .attr('height', (node) => Math.max(1, (node.y1 ?? 0) - (node.y0 ?? 0)))\n .attr('rx', 2)\n .attr('fill', (_node, index) => categoricalColor(index, colorModeId))\n .on('mouseenter', (event: MouseEvent, node) => {\n showTooltip(event, `${node.name}<br>${(node.value ?? 0).toLocaleString()}`);\n })\n .on('mousemove', (event: MouseEvent, node) => {\n showTooltip(event, `${node.name}<br>${(node.value ?? 0).toLocaleString()}`);\n })\n .on('mouseleave', hideTooltip);\n\n nodeGroup\n .append('text')\n .attr('x', (node) => ((node.x0 ?? 0) < width / 2 ? (node.x1 ?? 0) + LABEL_MARGIN : (node.x0 ?? 0) - LABEL_MARGIN))\n .attr('y', (node) => ((node.y0 ?? 0) + (node.y1 ?? 0)) / 2)\n .attr('dy', '0.35em')\n .attr('text-anchor', (node) => ((node.x0 ?? 0) < width / 2 ? 'start' : 'end'))\n .attr('fill', ink.primary)\n .text((node) => node.name);\n\n const svgNode = svgSelection.node();\n if (svgNode == null) throw new Error('Failed to create Sankey diagram SVG element.');\n return svgNode;\n }\n\n let svg = draw();\n\n return {\n resize: () => {\n svg = draw();\n },\n get svg() {\n return svg;\n }\n };\n}\n"],"x_google_ignoreList":[0,1,2,3],"mappings":";;;;AAcA,SAAgB,EAAQ,GAAM,GAAG;CAC/B,OAAO,EAAK,YAAY,SAAS,EAAK,QAAQ,IAAI;AACpD;;;AChBA,SAAwB,EAAS,GAAG;CAClC,OAAO,WAAW;EAChB,OAAO;CACT;AACF;;;ACAA,SAAS,EAAuB,GAAG,GAAG;CACpC,OAAO,EAAiB,EAAE,QAAQ,EAAE,MAAM,KAAK,EAAE,QAAQ,EAAE;AAC7D;AAEA,SAAS,EAAuB,GAAG,GAAG;CACpC,OAAO,EA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EAAI,OAAO,CAAC,CACzB,MAAM,MAAS,EAAK,IAAI;EAE7B,IAAM,IAAU,EAAa,KAAK;EAClC,IAAI,KAAW,MAAM,MAAU,MAAM,8CAA8C;EACnF,OAAO;CACX;CAEA,IAAI,IAAM,EAAK;CAEf,OAAO;EACH,cAAc;GACV,IAAM,EAAK;EACf;EACA,IAAI,MAAM;GACN,OAAO;EACX;CACJ;AACJ"}
@@ -1,5 +1,5 @@
1
1
  import { t as e } from "./select-BIuoFcZG.js";
2
- import { t } from "./link-Dti9fi9g.js";
2
+ import { t } from "./link-20hHJfDf.js";
3
3
  //#region node_modules/d3-hierarchy/src/hierarchy/count.js
4
4
  function n(e) {
5
5
  var t = 0, n = e.children, r = n && n.length;
@@ -274,4 +274,4 @@ function z(n, r, i = {}) {
274
274
  //#endregion
275
275
  export { z as renderTreeDiagram };
276
276
 
277
- //# sourceMappingURL=treeDiagram-BJ_QF4os.js.map
277
+ //# sourceMappingURL=treeDiagram-C8jl6ALp.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"treeDiagram-BJ_QF4os.js","names":["node_count","node_each","node_eachAfter","node_eachBefore","node_find","node_sum","node_sort","node_path","node_ancestors","node_descendants","node_leaves","node_links","node_iterator"],"sources":["../node_modules/d3-hierarchy/src/hierarchy/count.js","../node_modules/d3-hierarchy/src/hierarchy/each.js","../node_modules/d3-hierarchy/src/hierarchy/eachBefore.js","../node_modules/d3-hierarchy/src/hierarchy/eachAfter.js","../node_modules/d3-hierarchy/src/hierarchy/find.js","../node_modules/d3-hierarchy/src/hierarchy/sum.js","../node_modules/d3-hierarchy/src/hierarchy/sort.js","../node_modules/d3-hierarchy/src/hierarchy/path.js","../node_modules/d3-hierarchy/src/hierarchy/ancestors.js","../node_modules/d3-hierarchy/src/hierarchy/descendants.js","../node_modules/d3-hierarchy/src/hierarchy/leaves.js","../node_modules/d3-hierarchy/src/hierarchy/links.js","../node_modules/d3-hierarchy/src/hierarchy/iterator.js","../node_modules/d3-hierarchy/src/hierarchy/index.js","../node_modules/d3-hierarchy/src/tree.js","../src/treeDiagram.ts"],"sourcesContent":["function count(node) {\n var sum = 0,\n children = node.children,\n i = children && children.length;\n if (!i) sum = 1;\n else while (--i >= 0) sum += children[i].value;\n node.value = sum;\n}\n\nexport default function() {\n return this.eachAfter(count);\n}\n","export default function(callback, that) {\n let index = -1;\n for (const node of this) {\n callback.call(that, node, ++index, this);\n }\n return this;\n}\n","export default function(callback, that) {\n var node = this, nodes = [node], children, i, index = -1;\n while (node = nodes.pop()) {\n callback.call(that, node, ++index, this);\n if (children = node.children) {\n for (i = children.length - 1; i >= 0; --i) {\n nodes.push(children[i]);\n }\n }\n }\n return this;\n}\n","export default function(callback, that) {\n var node = this, nodes = [node], next = [], children, i, n, index = -1;\n while (node = nodes.pop()) {\n next.push(node);\n if (children = node.children) {\n for (i = 0, n = children.length; i < n; ++i) {\n nodes.push(children[i]);\n }\n }\n }\n while (node = next.pop()) {\n callback.call(that, node, ++index, this);\n }\n return this;\n}\n","export default function(callback, that) {\n let index = -1;\n for (const node of this) {\n if (callback.call(that, node, ++index, this)) {\n return node;\n }\n }\n}\n","export default function(value) {\n return this.eachAfter(function(node) {\n var sum = +value(node.data) || 0,\n children = node.children,\n i = children && children.length;\n while (--i >= 0) sum += children[i].value;\n node.value = sum;\n });\n}\n","export default function(compare) {\n return this.eachBefore(function(node) {\n if (node.children) {\n node.children.sort(compare);\n }\n });\n}\n","export default function(end) {\n var start = this,\n ancestor = leastCommonAncestor(start, end),\n nodes = [start];\n while (start !== ancestor) {\n start = start.parent;\n nodes.push(start);\n }\n var k = nodes.length;\n while (end !== ancestor) {\n nodes.splice(k, 0, end);\n end = end.parent;\n }\n return nodes;\n}\n\nfunction leastCommonAncestor(a, b) {\n if (a === b) return a;\n var aNodes = a.ancestors(),\n bNodes = b.ancestors(),\n c = null;\n a = aNodes.pop();\n b = bNodes.pop();\n while (a === b) {\n c = a;\n a = aNodes.pop();\n b = bNodes.pop();\n }\n return c;\n}\n","export default function() {\n var node = this, nodes = [node];\n while (node = node.parent) {\n nodes.push(node);\n }\n return nodes;\n}\n","export default function() {\n return Array.from(this);\n}\n","export default function() {\n var leaves = [];\n this.eachBefore(function(node) {\n if (!node.children) {\n leaves.push(node);\n }\n });\n return leaves;\n}\n","export default function() {\n var root = this, links = [];\n root.each(function(node) {\n if (node !== root) { // Don’t include the root’s parent, if any.\n links.push({source: node.parent, target: node});\n }\n });\n return links;\n}\n","export default function*() {\n var node = this, current, next = [node], children, i, n;\n do {\n current = next.reverse(), next = [];\n while (node = current.pop()) {\n yield node;\n if (children = node.children) {\n for (i = 0, n = children.length; i < n; ++i) {\n next.push(children[i]);\n }\n }\n }\n } while (next.length);\n}\n","import node_count from \"./count.js\";\nimport node_each from \"./each.js\";\nimport node_eachBefore from \"./eachBefore.js\";\nimport node_eachAfter from \"./eachAfter.js\";\nimport node_find from \"./find.js\";\nimport node_sum from \"./sum.js\";\nimport node_sort from \"./sort.js\";\nimport node_path from \"./path.js\";\nimport node_ancestors from \"./ancestors.js\";\nimport node_descendants from \"./descendants.js\";\nimport node_leaves from \"./leaves.js\";\nimport node_links from \"./links.js\";\nimport node_iterator from \"./iterator.js\";\n\nexport default function hierarchy(data, children) {\n if (data instanceof Map) {\n data = [undefined, data];\n if (children === undefined) children = mapChildren;\n } else if (children === undefined) {\n children = objectChildren;\n }\n\n var root = new Node(data),\n node,\n nodes = [root],\n child,\n childs,\n i,\n n;\n\n while (node = nodes.pop()) {\n if ((childs = children(node.data)) && (n = (childs = Array.from(childs)).length)) {\n node.children = childs;\n for (i = n - 1; i >= 0; --i) {\n nodes.push(child = childs[i] = new Node(childs[i]));\n child.parent = node;\n child.depth = node.depth + 1;\n }\n }\n }\n\n return root.eachBefore(computeHeight);\n}\n\nfunction node_copy() {\n return hierarchy(this).eachBefore(copyData);\n}\n\nfunction objectChildren(d) {\n return d.children;\n}\n\nfunction mapChildren(d) {\n return Array.isArray(d) ? d[1] : null;\n}\n\nfunction copyData(node) {\n if (node.data.value !== undefined) node.value = node.data.value;\n node.data = node.data.data;\n}\n\nexport function computeHeight(node) {\n var height = 0;\n do node.height = height;\n while ((node = node.parent) && (node.height < ++height));\n}\n\nexport function Node(data) {\n this.data = data;\n this.depth =\n this.height = 0;\n this.parent = null;\n}\n\nNode.prototype = hierarchy.prototype = {\n constructor: Node,\n count: node_count,\n each: node_each,\n eachAfter: node_eachAfter,\n eachBefore: node_eachBefore,\n find: node_find,\n sum: node_sum,\n sort: node_sort,\n path: node_path,\n ancestors: node_ancestors,\n descendants: node_descendants,\n leaves: node_leaves,\n links: node_links,\n copy: node_copy,\n [Symbol.iterator]: node_iterator\n};\n","import {Node} from \"./hierarchy/index.js\";\n\nfunction defaultSeparation(a, b) {\n return a.parent === b.parent ? 1 : 2;\n}\n\n// function radialSeparation(a, b) {\n// return (a.parent === b.parent ? 1 : 2) / a.depth;\n// }\n\n// This function is used to traverse the left contour of a subtree (or\n// subforest). It returns the successor of v on this contour. This successor is\n// either given by the leftmost child of v or by the thread of v. The function\n// returns null if and only if v is on the highest level of its subtree.\nfunction nextLeft(v) {\n var children = v.children;\n return children ? children[0] : v.t;\n}\n\n// This function works analogously to nextLeft.\nfunction nextRight(v) {\n var children = v.children;\n return children ? children[children.length - 1] : v.t;\n}\n\n// Shifts the current subtree rooted at w+. This is done by increasing\n// prelim(w+) and mod(w+) by shift.\nfunction moveSubtree(wm, wp, shift) {\n var change = shift / (wp.i - wm.i);\n wp.c -= change;\n wp.s += shift;\n wm.c += change;\n wp.z += shift;\n wp.m += shift;\n}\n\n// All other shifts, applied to the smaller subtrees between w- and w+, are\n// performed by this function. To prepare the shifts, we have to adjust\n// change(w+), shift(w+), and change(w-).\nfunction executeShifts(v) {\n var shift = 0,\n change = 0,\n children = v.children,\n i = children.length,\n w;\n while (--i >= 0) {\n w = children[i];\n w.z += shift;\n w.m += shift;\n shift += w.s + (change += w.c);\n }\n}\n\n// If vi-’s ancestor is a sibling of v, returns vi-’s ancestor. Otherwise,\n// returns the specified (default) ancestor.\nfunction nextAncestor(vim, v, ancestor) {\n return vim.a.parent === v.parent ? vim.a : ancestor;\n}\n\nfunction TreeNode(node, i) {\n this._ = node;\n this.parent = null;\n this.children = null;\n this.A = null; // default ancestor\n this.a = this; // ancestor\n this.z = 0; // prelim\n this.m = 0; // mod\n this.c = 0; // change\n this.s = 0; // shift\n this.t = null; // thread\n this.i = i; // number\n}\n\nTreeNode.prototype = Object.create(Node.prototype);\n\nfunction treeRoot(root) {\n var tree = new TreeNode(root, 0),\n node,\n nodes = [tree],\n child,\n children,\n i,\n n;\n\n while (node = nodes.pop()) {\n if (children = node._.children) {\n node.children = new Array(n = children.length);\n for (i = n - 1; i >= 0; --i) {\n nodes.push(child = node.children[i] = new TreeNode(children[i], i));\n child.parent = node;\n }\n }\n }\n\n (tree.parent = new TreeNode(null, 0)).children = [tree];\n return tree;\n}\n\n// Node-link tree diagram using the Reingold-Tilford \"tidy\" algorithm\nexport default function() {\n var separation = defaultSeparation,\n dx = 1,\n dy = 1,\n nodeSize = null;\n\n function tree(root) {\n var t = treeRoot(root);\n\n // Compute the layout using Buchheim et al.’s algorithm.\n t.eachAfter(firstWalk), t.parent.m = -t.z;\n t.eachBefore(secondWalk);\n\n // If a fixed node size is specified, scale x and y.\n if (nodeSize) root.eachBefore(sizeNode);\n\n // If a fixed tree size is specified, scale x and y based on the extent.\n // Compute the left-most, right-most, and depth-most nodes for extents.\n else {\n var left = root,\n right = root,\n bottom = root;\n root.eachBefore(function(node) {\n if (node.x < left.x) left = node;\n if (node.x > right.x) right = node;\n if (node.depth > bottom.depth) bottom = node;\n });\n var s = left === right ? 1 : separation(left, right) / 2,\n tx = s - left.x,\n kx = dx / (right.x + s + tx),\n ky = dy / (bottom.depth || 1);\n root.eachBefore(function(node) {\n node.x = (node.x + tx) * kx;\n node.y = node.depth * ky;\n });\n }\n\n return root;\n }\n\n // Computes a preliminary x-coordinate for v. Before that, FIRST WALK is\n // applied recursively to the children of v, as well as the function\n // APPORTION. After spacing out the children by calling EXECUTE SHIFTS, the\n // node v is placed to the midpoint of its outermost children.\n function firstWalk(v) {\n var children = v.children,\n siblings = v.parent.children,\n w = v.i ? siblings[v.i - 1] : null;\n if (children) {\n executeShifts(v);\n var midpoint = (children[0].z + children[children.length - 1].z) / 2;\n if (w) {\n v.z = w.z + separation(v._, w._);\n v.m = v.z - midpoint;\n } else {\n v.z = midpoint;\n }\n } else if (w) {\n v.z = w.z + separation(v._, w._);\n }\n v.parent.A = apportion(v, w, v.parent.A || siblings[0]);\n }\n\n // Computes all real x-coordinates by summing up the modifiers recursively.\n function secondWalk(v) {\n v._.x = v.z + v.parent.m;\n v.m += v.parent.m;\n }\n\n // The core of the algorithm. Here, a new subtree is combined with the\n // previous subtrees. Threads are used to traverse the inside and outside\n // contours of the left and right subtree up to the highest common level. The\n // vertices used for the traversals are vi+, vi-, vo-, and vo+, where the\n // superscript o means outside and i means inside, the subscript - means left\n // subtree and + means right subtree. For summing up the modifiers along the\n // contour, we use respective variables si+, si-, so-, and so+. Whenever two\n // nodes of the inside contours conflict, we compute the left one of the\n // greatest uncommon ancestors using the function ANCESTOR and call MOVE\n // SUBTREE to shift the subtree and prepare the shifts of smaller subtrees.\n // Finally, we add a new thread (if necessary).\n function apportion(v, w, ancestor) {\n if (w) {\n var vip = v,\n vop = v,\n vim = w,\n vom = vip.parent.children[0],\n sip = vip.m,\n sop = vop.m,\n sim = vim.m,\n som = vom.m,\n shift;\n while (vim = nextRight(vim), vip = nextLeft(vip), vim && vip) {\n vom = nextLeft(vom);\n vop = nextRight(vop);\n vop.a = v;\n shift = vim.z + sim - vip.z - sip + separation(vim._, vip._);\n if (shift > 0) {\n moveSubtree(nextAncestor(vim, v, ancestor), v, shift);\n sip += shift;\n sop += shift;\n }\n sim += vim.m;\n sip += vip.m;\n som += vom.m;\n sop += vop.m;\n }\n if (vim && !nextRight(vop)) {\n vop.t = vim;\n vop.m += sim - sop;\n }\n if (vip && !nextLeft(vom)) {\n vom.t = vip;\n vom.m += sip - som;\n ancestor = v;\n }\n }\n return ancestor;\n }\n\n function sizeNode(node) {\n node.x *= dx;\n node.y = node.depth * dy;\n }\n\n tree.separation = function(x) {\n return arguments.length ? (separation = x, tree) : separation;\n };\n\n tree.size = function(x) {\n return arguments.length ? (nodeSize = false, dx = +x[0], dy = +x[1], tree) : (nodeSize ? null : [dx, dy]);\n };\n\n tree.nodeSize = function(x) {\n return arguments.length ? (nodeSize = true, dx = +x[0], dy = +x[1], tree) : (nodeSize ? [dx, dy] : null);\n };\n\n return tree;\n}\n","// ── External Dependencies & Registrations\nimport { linkHorizontal } from 'd3-shape';\nimport { select } from 'd3-selection';\nimport { hierarchy, type HierarchyPointLink, type HierarchyPointNode, tree } from 'd3-hierarchy';\n\n// ── Types ────────────────────────────────────────────────────────────────────────────────────────────────────────────\n\nexport type TreeDiagramNodeRoleId = 'branch' | 'leaf' | 'root';\n\nexport interface TreeDiagramNode {\n children?: TreeDiagramNode[];\n id: string;\n label: string;\n}\n\nexport interface TreeDiagramOptions {\n levelGap?: number;\n nodeColors?: Record<TreeDiagramNodeRoleId, { fill: string; stroke: string }>;\n nodeHeight?: number;\n nodeWidth?: number;\n padding?: number;\n siblingGap?: number;\n}\n\nexport interface TreeDiagramHandle {\n resize: () => void;\n svg: SVGSVGElement;\n}\n\n// ── Constants ────────────────────────────────────────────────────────────────────────────────────────────────────────\n\nconst DEFAULT_NODE_WIDTH = 140;\nconst DEFAULT_NODE_HEIGHT = 40;\nconst DEFAULT_SIBLING_GAP = 24;\nconst DEFAULT_LEVEL_GAP = 50;\nconst DEFAULT_PADDING = 8;\nconst DEFAULT_NODE_COLORS: Record<TreeDiagramNodeRoleId, { fill: string; stroke: string }> = {\n branch: { fill: '#ffe6cc', stroke: '#d79b00' },\n leaf: { fill: '#dae8fc', stroke: '#6c8ebf' },\n root: { fill: '#d5e8d4', stroke: '#82b366' }\n};\n\n// ── Actions ──────────────────────────────────────────────────────────────────────────────────────────────────────────\n\nexport function renderTreeDiagram(data: TreeDiagramNode, renderTo: HTMLElement, options: TreeDiagramOptions = {}): TreeDiagramHandle {\n const nodeWidth = options.nodeWidth ?? DEFAULT_NODE_WIDTH;\n const nodeHeight = options.nodeHeight ?? DEFAULT_NODE_HEIGHT;\n const siblingGap = options.siblingGap ?? DEFAULT_SIBLING_GAP;\n const levelGap = options.levelGap ?? DEFAULT_LEVEL_GAP;\n const padding = options.padding ?? DEFAULT_PADDING;\n const nodeColors = options.nodeColors ?? DEFAULT_NODE_COLORS;\n\n function getNodeRole(node: HierarchyPointNode<TreeDiagramNode>): TreeDiagramNodeRoleId {\n if (node.depth === 0) return 'root';\n return node.children ? 'branch' : 'leaf';\n }\n\n function draw(): SVGSVGElement {\n select(renderTo).selectAll('svg').remove();\n\n const root = hierarchy(data, (node) => node.children);\n const treeLayout = tree<TreeDiagramNode>()\n .nodeSize([nodeHeight + siblingGap, nodeWidth + levelGap])\n .separation(() => 1);\n const treeRoot = treeLayout(root);\n\n // Align each parent with its first child (instead of d3's default centering over all children) so the root sits at the top and the tree cascades downward.\n treeRoot.eachAfter((node) => {\n const [firstChild] = node.children ?? [];\n if (!firstChild) return;\n node.x = firstChild.x;\n });\n\n const treeNodes = treeRoot.descendants();\n\n // Screen axes are swapped for a left-to-right tree: node.y (depth) drives horizontal position, node.x (sibling spread) drives vertical.\n const minX = Math.min(...treeNodes.map((node) => node.y)) - nodeWidth / 2;\n const maxX = Math.max(...treeNodes.map((node) => node.y)) + nodeWidth / 2;\n const minY = Math.min(...treeNodes.map((node) => node.x)) - nodeHeight / 2;\n const maxY = Math.max(...treeNodes.map((node) => node.x)) + nodeHeight / 2;\n\n const viewBoxWidth = maxX - minX + padding * 2;\n const viewBoxHeight = maxY - minY + padding * 2;\n\n const svgSelection = select(renderTo)\n .append('svg')\n .attr('viewBox', `0 0 ${String(viewBoxWidth)} ${String(viewBoxHeight)}`)\n .attr('width', viewBoxWidth)\n .attr('height', viewBoxHeight);\n\n const canvas = svgSelection.append('g').attr('transform', `translate(${String(padding - minX)}, ${String(padding - minY)})`);\n\n const linkGenerator = linkHorizontal<HierarchyPointLink<TreeDiagramNode>, HierarchyPointNode<TreeDiagramNode>>()\n .x((node) => node.y)\n .y((node) => node.x);\n\n canvas.append('g').attr('fill', 'none').attr('stroke', '#999999').attr('stroke-width', 1.5).selectAll('path').data(treeRoot.links()).join('path').attr('d', linkGenerator);\n\n const nodeGroups = canvas\n .append('g')\n .selectAll('g')\n .data(treeNodes)\n .join('g')\n .attr('transform', (node) => `translate(${String(node.y - nodeWidth / 2)}, ${String(node.x - nodeHeight / 2)})`);\n\n nodeGroups\n .append('rect')\n .attr('width', nodeWidth)\n .attr('height', nodeHeight)\n .attr('rx', 6)\n .attr('fill', (node) => nodeColors[getNodeRole(node)].fill)\n .attr('stroke', (node) => nodeColors[getNodeRole(node)].stroke);\n\n nodeGroups\n .append('text')\n .attr('x', nodeWidth / 2)\n .attr('y', nodeHeight / 2)\n .attr('text-anchor', 'middle')\n .attr('dominant-baseline', 'middle')\n .attr('font-family', 'Helvetica, Arial, sans-serif')\n .attr('font-size', 12)\n .attr('fill', '#000000')\n .text((node) => node.data.label);\n\n const svgNode = svgSelection.node();\n if (svgNode == null) throw new Error('Failed to create tree diagram SVG element.');\n return svgNode;\n }\n\n let svg = draw();\n\n return {\n resize: () => {\n svg = draw();\n },\n get svg() {\n return svg;\n }\n };\n}\n"],"x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14],"mappings":";;;AAAA,SAAS,EAAM,GAAM;CACnB,IAAI,IAAM,GACN,IAAW,EAAK,UAChB,IAAI,KAAY,EAAS;CAC7B,IAAI,CAAC,GAAG,IAAM;MACT,OAAO,EAAE,KAAK,IAAG,KAAO,EAAS,EAAE,CAAC;CACzC,EAAK,QAAQ;AACf;AAEA,SAAA,IAA0B;CACxB,OAAO,KAAK,UAAU,CAAK;AAC7B;;;ACXA,SAAA,EAAwB,GAAU,GAAM;CACtC,IAAI,IAAQ;CACZ,KAAK,IAA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":"treeDiagram-C8jl6ALp.js","names":["node_count","node_each","node_eachAfter","node_eachBefore","node_find","node_sum","node_sort","node_path","node_ancestors","node_descendants","node_leaves","node_links","node_iterator"],"sources":["../node_modules/d3-hierarchy/src/hierarchy/count.js","../node_modules/d3-hierarchy/src/hierarchy/each.js","../node_modules/d3-hierarchy/src/hierarchy/eachBefore.js","../node_modules/d3-hierarchy/src/hierarchy/eachAfter.js","../node_modules/d3-hierarchy/src/hierarchy/find.js","../node_modules/d3-hierarchy/src/hierarchy/sum.js","../node_modules/d3-hierarchy/src/hierarchy/sort.js","../node_modules/d3-hierarchy/src/hierarchy/path.js","../node_modules/d3-hierarchy/src/hierarchy/ancestors.js","../node_modules/d3-hierarchy/src/hierarchy/descendants.js","../node_modules/d3-hierarchy/src/hierarchy/leaves.js","../node_modules/d3-hierarchy/src/hierarchy/links.js","../node_modules/d3-hierarchy/src/hierarchy/iterator.js","../node_modules/d3-hierarchy/src/hierarchy/index.js","../node_modules/d3-hierarchy/src/tree.js","../src/treeDiagram.ts"],"sourcesContent":["function count(node) {\n var sum = 0,\n children = node.children,\n i = children && children.length;\n if (!i) sum = 1;\n else while (--i >= 0) sum += children[i].value;\n node.value = sum;\n}\n\nexport default function() {\n return this.eachAfter(count);\n}\n","export default function(callback, that) {\n let index = -1;\n for (const node of this) {\n callback.call(that, node, ++index, this);\n }\n return this;\n}\n","export default function(callback, that) {\n var node = this, nodes = [node], children, i, index = -1;\n while (node = nodes.pop()) {\n callback.call(that, node, ++index, this);\n if (children = node.children) {\n for (i = children.length - 1; i >= 0; --i) {\n nodes.push(children[i]);\n }\n }\n }\n return this;\n}\n","export default function(callback, that) {\n var node = this, nodes = [node], next = [], children, i, n, index = -1;\n while (node = nodes.pop()) {\n next.push(node);\n if (children = node.children) {\n for (i = 0, n = children.length; i < n; ++i) {\n nodes.push(children[i]);\n }\n }\n }\n while (node = next.pop()) {\n callback.call(that, node, ++index, this);\n }\n return this;\n}\n","export default function(callback, that) {\n let index = -1;\n for (const node of this) {\n if (callback.call(that, node, ++index, this)) {\n return node;\n }\n }\n}\n","export default function(value) {\n return this.eachAfter(function(node) {\n var sum = +value(node.data) || 0,\n children = node.children,\n i = children && children.length;\n while (--i >= 0) sum += children[i].value;\n node.value = sum;\n });\n}\n","export default function(compare) {\n return this.eachBefore(function(node) {\n if (node.children) {\n node.children.sort(compare);\n }\n });\n}\n","export default function(end) {\n var start = this,\n ancestor = leastCommonAncestor(start, end),\n nodes = [start];\n while (start !== ancestor) {\n start = start.parent;\n nodes.push(start);\n }\n var k = nodes.length;\n while (end !== ancestor) {\n nodes.splice(k, 0, end);\n end = end.parent;\n }\n return nodes;\n}\n\nfunction leastCommonAncestor(a, b) {\n if (a === b) return a;\n var aNodes = a.ancestors(),\n bNodes = b.ancestors(),\n c = null;\n a = aNodes.pop();\n b = bNodes.pop();\n while (a === b) {\n c = a;\n a = aNodes.pop();\n b = bNodes.pop();\n }\n return c;\n}\n","export default function() {\n var node = this, nodes = [node];\n while (node = node.parent) {\n nodes.push(node);\n }\n return nodes;\n}\n","export default function() {\n return Array.from(this);\n}\n","export default function() {\n var leaves = [];\n this.eachBefore(function(node) {\n if (!node.children) {\n leaves.push(node);\n }\n });\n return leaves;\n}\n","export default function() {\n var root = this, links = [];\n root.each(function(node) {\n if (node !== root) { // Don’t include the root’s parent, if any.\n links.push({source: node.parent, target: node});\n }\n });\n return links;\n}\n","export default function*() {\n var node = this, current, next = [node], children, i, n;\n do {\n current = next.reverse(), next = [];\n while (node = current.pop()) {\n yield node;\n if (children = node.children) {\n for (i = 0, n = children.length; i < n; ++i) {\n next.push(children[i]);\n }\n }\n }\n } while (next.length);\n}\n","import node_count from \"./count.js\";\nimport node_each from \"./each.js\";\nimport node_eachBefore from \"./eachBefore.js\";\nimport node_eachAfter from \"./eachAfter.js\";\nimport node_find from \"./find.js\";\nimport node_sum from \"./sum.js\";\nimport node_sort from \"./sort.js\";\nimport node_path from \"./path.js\";\nimport node_ancestors from \"./ancestors.js\";\nimport node_descendants from \"./descendants.js\";\nimport node_leaves from \"./leaves.js\";\nimport node_links from \"./links.js\";\nimport node_iterator from \"./iterator.js\";\n\nexport default function hierarchy(data, children) {\n if (data instanceof Map) {\n data = [undefined, data];\n if (children === undefined) children = mapChildren;\n } else if (children === undefined) {\n children = objectChildren;\n }\n\n var root = new Node(data),\n node,\n nodes = [root],\n child,\n childs,\n i,\n n;\n\n while (node = nodes.pop()) {\n if ((childs = children(node.data)) && (n = (childs = Array.from(childs)).length)) {\n node.children = childs;\n for (i = n - 1; i >= 0; --i) {\n nodes.push(child = childs[i] = new Node(childs[i]));\n child.parent = node;\n child.depth = node.depth + 1;\n }\n }\n }\n\n return root.eachBefore(computeHeight);\n}\n\nfunction node_copy() {\n return hierarchy(this).eachBefore(copyData);\n}\n\nfunction objectChildren(d) {\n return d.children;\n}\n\nfunction mapChildren(d) {\n return Array.isArray(d) ? d[1] : null;\n}\n\nfunction copyData(node) {\n if (node.data.value !== undefined) node.value = node.data.value;\n node.data = node.data.data;\n}\n\nexport function computeHeight(node) {\n var height = 0;\n do node.height = height;\n while ((node = node.parent) && (node.height < ++height));\n}\n\nexport function Node(data) {\n this.data = data;\n this.depth =\n this.height = 0;\n this.parent = null;\n}\n\nNode.prototype = hierarchy.prototype = {\n constructor: Node,\n count: node_count,\n each: node_each,\n eachAfter: node_eachAfter,\n eachBefore: node_eachBefore,\n find: node_find,\n sum: node_sum,\n sort: node_sort,\n path: node_path,\n ancestors: node_ancestors,\n descendants: node_descendants,\n leaves: node_leaves,\n links: node_links,\n copy: node_copy,\n [Symbol.iterator]: node_iterator\n};\n","import {Node} from \"./hierarchy/index.js\";\n\nfunction defaultSeparation(a, b) {\n return a.parent === b.parent ? 1 : 2;\n}\n\n// function radialSeparation(a, b) {\n// return (a.parent === b.parent ? 1 : 2) / a.depth;\n// }\n\n// This function is used to traverse the left contour of a subtree (or\n// subforest). It returns the successor of v on this contour. This successor is\n// either given by the leftmost child of v or by the thread of v. The function\n// returns null if and only if v is on the highest level of its subtree.\nfunction nextLeft(v) {\n var children = v.children;\n return children ? children[0] : v.t;\n}\n\n// This function works analogously to nextLeft.\nfunction nextRight(v) {\n var children = v.children;\n return children ? children[children.length - 1] : v.t;\n}\n\n// Shifts the current subtree rooted at w+. This is done by increasing\n// prelim(w+) and mod(w+) by shift.\nfunction moveSubtree(wm, wp, shift) {\n var change = shift / (wp.i - wm.i);\n wp.c -= change;\n wp.s += shift;\n wm.c += change;\n wp.z += shift;\n wp.m += shift;\n}\n\n// All other shifts, applied to the smaller subtrees between w- and w+, are\n// performed by this function. To prepare the shifts, we have to adjust\n// change(w+), shift(w+), and change(w-).\nfunction executeShifts(v) {\n var shift = 0,\n change = 0,\n children = v.children,\n i = children.length,\n w;\n while (--i >= 0) {\n w = children[i];\n w.z += shift;\n w.m += shift;\n shift += w.s + (change += w.c);\n }\n}\n\n// If vi-’s ancestor is a sibling of v, returns vi-’s ancestor. Otherwise,\n// returns the specified (default) ancestor.\nfunction nextAncestor(vim, v, ancestor) {\n return vim.a.parent === v.parent ? vim.a : ancestor;\n}\n\nfunction TreeNode(node, i) {\n this._ = node;\n this.parent = null;\n this.children = null;\n this.A = null; // default ancestor\n this.a = this; // ancestor\n this.z = 0; // prelim\n this.m = 0; // mod\n this.c = 0; // change\n this.s = 0; // shift\n this.t = null; // thread\n this.i = i; // number\n}\n\nTreeNode.prototype = Object.create(Node.prototype);\n\nfunction treeRoot(root) {\n var tree = new TreeNode(root, 0),\n node,\n nodes = [tree],\n child,\n children,\n i,\n n;\n\n while (node = nodes.pop()) {\n if (children = node._.children) {\n node.children = new Array(n = children.length);\n for (i = n - 1; i >= 0; --i) {\n nodes.push(child = node.children[i] = new TreeNode(children[i], i));\n child.parent = node;\n }\n }\n }\n\n (tree.parent = new TreeNode(null, 0)).children = [tree];\n return tree;\n}\n\n// Node-link tree diagram using the Reingold-Tilford \"tidy\" algorithm\nexport default function() {\n var separation = defaultSeparation,\n dx = 1,\n dy = 1,\n nodeSize = null;\n\n function tree(root) {\n var t = treeRoot(root);\n\n // Compute the layout using Buchheim et al.’s algorithm.\n t.eachAfter(firstWalk), t.parent.m = -t.z;\n t.eachBefore(secondWalk);\n\n // If a fixed node size is specified, scale x and y.\n if (nodeSize) root.eachBefore(sizeNode);\n\n // If a fixed tree size is specified, scale x and y based on the extent.\n // Compute the left-most, right-most, and depth-most nodes for extents.\n else {\n var left = root,\n right = root,\n bottom = root;\n root.eachBefore(function(node) {\n if (node.x < left.x) left = node;\n if (node.x > right.x) right = node;\n if (node.depth > bottom.depth) bottom = node;\n });\n var s = left === right ? 1 : separation(left, right) / 2,\n tx = s - left.x,\n kx = dx / (right.x + s + tx),\n ky = dy / (bottom.depth || 1);\n root.eachBefore(function(node) {\n node.x = (node.x + tx) * kx;\n node.y = node.depth * ky;\n });\n }\n\n return root;\n }\n\n // Computes a preliminary x-coordinate for v. Before that, FIRST WALK is\n // applied recursively to the children of v, as well as the function\n // APPORTION. After spacing out the children by calling EXECUTE SHIFTS, the\n // node v is placed to the midpoint of its outermost children.\n function firstWalk(v) {\n var children = v.children,\n siblings = v.parent.children,\n w = v.i ? siblings[v.i - 1] : null;\n if (children) {\n executeShifts(v);\n var midpoint = (children[0].z + children[children.length - 1].z) / 2;\n if (w) {\n v.z = w.z + separation(v._, w._);\n v.m = v.z - midpoint;\n } else {\n v.z = midpoint;\n }\n } else if (w) {\n v.z = w.z + separation(v._, w._);\n }\n v.parent.A = apportion(v, w, v.parent.A || siblings[0]);\n }\n\n // Computes all real x-coordinates by summing up the modifiers recursively.\n function secondWalk(v) {\n v._.x = v.z + v.parent.m;\n v.m += v.parent.m;\n }\n\n // The core of the algorithm. Here, a new subtree is combined with the\n // previous subtrees. Threads are used to traverse the inside and outside\n // contours of the left and right subtree up to the highest common level. The\n // vertices used for the traversals are vi+, vi-, vo-, and vo+, where the\n // superscript o means outside and i means inside, the subscript - means left\n // subtree and + means right subtree. For summing up the modifiers along the\n // contour, we use respective variables si+, si-, so-, and so+. Whenever two\n // nodes of the inside contours conflict, we compute the left one of the\n // greatest uncommon ancestors using the function ANCESTOR and call MOVE\n // SUBTREE to shift the subtree and prepare the shifts of smaller subtrees.\n // Finally, we add a new thread (if necessary).\n function apportion(v, w, ancestor) {\n if (w) {\n var vip = v,\n vop = v,\n vim = w,\n vom = vip.parent.children[0],\n sip = vip.m,\n sop = vop.m,\n sim = vim.m,\n som = vom.m,\n shift;\n while (vim = nextRight(vim), vip = nextLeft(vip), vim && vip) {\n vom = nextLeft(vom);\n vop = nextRight(vop);\n vop.a = v;\n shift = vim.z + sim - vip.z - sip + separation(vim._, vip._);\n if (shift > 0) {\n moveSubtree(nextAncestor(vim, v, ancestor), v, shift);\n sip += shift;\n sop += shift;\n }\n sim += vim.m;\n sip += vip.m;\n som += vom.m;\n sop += vop.m;\n }\n if (vim && !nextRight(vop)) {\n vop.t = vim;\n vop.m += sim - sop;\n }\n if (vip && !nextLeft(vom)) {\n vom.t = vip;\n vom.m += sip - som;\n ancestor = v;\n }\n }\n return ancestor;\n }\n\n function sizeNode(node) {\n node.x *= dx;\n node.y = node.depth * dy;\n }\n\n tree.separation = function(x) {\n return arguments.length ? (separation = x, tree) : separation;\n };\n\n tree.size = function(x) {\n return arguments.length ? (nodeSize = false, dx = +x[0], dy = +x[1], tree) : (nodeSize ? null : [dx, dy]);\n };\n\n tree.nodeSize = function(x) {\n return arguments.length ? (nodeSize = true, dx = +x[0], dy = +x[1], tree) : (nodeSize ? [dx, dy] : null);\n };\n\n return tree;\n}\n","// ── External Dependencies & Registrations\nimport { linkHorizontal } from 'd3-shape';\nimport { select } from 'd3-selection';\nimport { hierarchy, type HierarchyPointLink, type HierarchyPointNode, tree } from 'd3-hierarchy';\n\n// ── Types ────────────────────────────────────────────────────────────────────────────────────────────────────────────\n\nexport type TreeDiagramNodeRoleId = 'branch' | 'leaf' | 'root';\n\nexport interface TreeDiagramNode {\n children?: TreeDiagramNode[];\n id: string;\n label: string;\n}\n\nexport interface TreeDiagramOptions {\n levelGap?: number;\n nodeColors?: Record<TreeDiagramNodeRoleId, { fill: string; stroke: string }>;\n nodeHeight?: number;\n nodeWidth?: number;\n padding?: number;\n siblingGap?: number;\n}\n\nexport interface TreeDiagramHandle {\n resize: () => void;\n svg: SVGSVGElement;\n}\n\n// ── Constants ────────────────────────────────────────────────────────────────────────────────────────────────────────\n\nconst DEFAULT_NODE_WIDTH = 140;\nconst DEFAULT_NODE_HEIGHT = 40;\nconst DEFAULT_SIBLING_GAP = 24;\nconst DEFAULT_LEVEL_GAP = 50;\nconst DEFAULT_PADDING = 8;\nconst DEFAULT_NODE_COLORS: Record<TreeDiagramNodeRoleId, { fill: string; stroke: string }> = {\n branch: { fill: '#ffe6cc', stroke: '#d79b00' },\n leaf: { fill: '#dae8fc', stroke: '#6c8ebf' },\n root: { fill: '#d5e8d4', stroke: '#82b366' }\n};\n\n// ── Actions ──────────────────────────────────────────────────────────────────────────────────────────────────────────\n\nexport function renderTreeDiagram(data: TreeDiagramNode, renderTo: HTMLElement, options: TreeDiagramOptions = {}): TreeDiagramHandle {\n const nodeWidth = options.nodeWidth ?? DEFAULT_NODE_WIDTH;\n const nodeHeight = options.nodeHeight ?? DEFAULT_NODE_HEIGHT;\n const siblingGap = options.siblingGap ?? DEFAULT_SIBLING_GAP;\n const levelGap = options.levelGap ?? DEFAULT_LEVEL_GAP;\n const padding = options.padding ?? DEFAULT_PADDING;\n const nodeColors = options.nodeColors ?? DEFAULT_NODE_COLORS;\n\n function getNodeRole(node: HierarchyPointNode<TreeDiagramNode>): TreeDiagramNodeRoleId {\n if (node.depth === 0) return 'root';\n return node.children ? 'branch' : 'leaf';\n }\n\n function draw(): SVGSVGElement {\n select(renderTo).selectAll('svg').remove();\n\n const root = hierarchy(data, (node) => node.children);\n const treeLayout = tree<TreeDiagramNode>()\n .nodeSize([nodeHeight + siblingGap, nodeWidth + levelGap])\n .separation(() => 1);\n const treeRoot = treeLayout(root);\n\n // Align each parent with its first child (instead of d3's default centering over all children) so the root sits at the top and the tree cascades downward.\n treeRoot.eachAfter((node) => {\n const [firstChild] = node.children ?? [];\n if (!firstChild) return;\n node.x = firstChild.x;\n });\n\n const treeNodes = treeRoot.descendants();\n\n // Screen axes are swapped for a left-to-right tree: node.y (depth) drives horizontal position, node.x (sibling spread) drives vertical.\n const minX = Math.min(...treeNodes.map((node) => node.y)) - nodeWidth / 2;\n const maxX = Math.max(...treeNodes.map((node) => node.y)) + nodeWidth / 2;\n const minY = Math.min(...treeNodes.map((node) => node.x)) - nodeHeight / 2;\n const maxY = Math.max(...treeNodes.map((node) => node.x)) + nodeHeight / 2;\n\n const viewBoxWidth = maxX - minX + padding * 2;\n const viewBoxHeight = maxY - minY + padding * 2;\n\n const svgSelection = select(renderTo)\n .append('svg')\n .attr('viewBox', `0 0 ${String(viewBoxWidth)} ${String(viewBoxHeight)}`)\n .attr('width', viewBoxWidth)\n .attr('height', viewBoxHeight);\n\n const canvas = svgSelection.append('g').attr('transform', `translate(${String(padding - minX)}, ${String(padding - minY)})`);\n\n const linkGenerator = linkHorizontal<HierarchyPointLink<TreeDiagramNode>, HierarchyPointNode<TreeDiagramNode>>()\n .x((node) => node.y)\n .y((node) => node.x);\n\n canvas.append('g').attr('fill', 'none').attr('stroke', '#999999').attr('stroke-width', 1.5).selectAll('path').data(treeRoot.links()).join('path').attr('d', linkGenerator);\n\n const nodeGroups = canvas\n .append('g')\n .selectAll('g')\n .data(treeNodes)\n .join('g')\n .attr('transform', (node) => `translate(${String(node.y - nodeWidth / 2)}, ${String(node.x - nodeHeight / 2)})`);\n\n nodeGroups\n .append('rect')\n .attr('width', nodeWidth)\n .attr('height', nodeHeight)\n .attr('rx', 6)\n .attr('fill', (node) => nodeColors[getNodeRole(node)].fill)\n .attr('stroke', (node) => nodeColors[getNodeRole(node)].stroke);\n\n nodeGroups\n .append('text')\n .attr('x', nodeWidth / 2)\n .attr('y', nodeHeight / 2)\n .attr('text-anchor', 'middle')\n .attr('dominant-baseline', 'middle')\n .attr('font-family', 'Helvetica, Arial, sans-serif')\n .attr('font-size', 12)\n .attr('fill', '#000000')\n .text((node) => node.data.label);\n\n const svgNode = svgSelection.node();\n if (svgNode == null) throw new Error('Failed to create tree diagram SVG element.');\n return svgNode;\n }\n\n let svg = draw();\n\n return {\n resize: () => {\n svg = draw();\n },\n get svg() {\n return svg;\n }\n };\n}\n"],"x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14],"mappings":";;;AAAA,SAAS,EAAM,GAAM;CACnB,IAAI,IAAM,GACN,IAAW,EAAK,UAChB,IAAI,KAAY,EAAS;CAC7B,IAAI,CAAC,GAAG,IAAM;MACT,OAAO,EAAE,KAAK,IAAG,KAAO,EAAS,EAAE,CAAC;CACzC,EAAK,QAAQ;AACf;AAEA,SAAA,IAA0B;CACxB,OAAO,KAAK,UAAU,CAAK;AAC7B;;;ACXA,SAAA,EAAwB,GAAU,GAAM;CACtC,IAAI,IAAQ;CACZ,KAAK,IAAM,KAAQ,MACjB,EAAS,KAAK,GAAM,GAAM,EAAE,GAAO,IAAI;CAEzC,OAAO;AACT;;;ACNA,SAAA,EAAwB,GAAU,GAAM;CAEtC,KADA,IAAI,IAAO,MAAM,IAAQ,CAAC,CAAI,GAAG,GAAU,GAAG,IAAQ,IAC/C,IAAO,EAAM,IAAI,IAEtB,IADA,EAAS,KAAK,GAAM,GAAM,EAAE,GAAO,IAAI,GACnC,IAAW,EAAK,UAClB,KAAK,IAAI,EAAS,SAAS,GAAG,KAAK,GAAG,EAAE,GACtC,EAAM,KAAK,EAAS,EAAE;CAI5B,OAAO;AACT;;;ACXA,SAAA,EAAwB,GAAU,GAAM;CAEtC,KADA,IAAI,IAAO,MAAM,IAAQ,CAAC,CAAI,GAAG,IAAO,CAAC,GAAG,GAAU,GAAG,GAAG,IAAQ,IAC7D,IAAO,EAAM,IAAI,IAEtB,IADA,EAAK,KAAK,CAAI,GACV,IAAW,EAAK,UAClB,KAAK,IAAI,GAAG,IAAI,EAAS,QAAQ,IAAI,GAAG,E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,CAAC,CAC1D,KAAK,WAAW,MAAS,EAAW,EAAY,CAAI,EAAE,CAAC,MAAM,GAElE,EACK,OAAO,MAAM,CAAC,CACd,KAAK,KAAK,IAAY,CAAC,CAAC,CACxB,KAAK,KAAK,IAAa,CAAC,CAAC,CACzB,KAAK,eAAe,QAAQ,CAAC,CAC7B,KAAK,qBAAqB,QAAQ,CAAC,CACnC,KAAK,eAAe,8BAA8B,CAAC,CACnD,KAAK,aAAa,EAAE,CAAC,CACrB,KAAK,QAAQ,SAAS,CAAC,CACvB,MAAM,MAAS,EAAK,KAAK,KAAK;EAEnC,IAAM,IAAU,EAAa,KAAK;EAClC,IAAI,KAAW,MAAM,MAAU,MAAM,4CAA4C;EACjF,OAAO;CACX;CAEA,IAAI,IAAM,EAAK;CAEf,OAAO;EACH,cAAc;GACV,IAAM,EAAK;EACf;EACA,IAAI,MAAM;GACN,OAAO;EACX;CACJ;AACJ"}
@@ -19,6 +19,10 @@ export interface ErdDiagramOptions {
19
19
  }>;
20
20
  nodeHeight?: number;
21
21
  nodeWidth?: number;
22
+ orderConstraints?: {
23
+ left: string;
24
+ right: string;
25
+ }[];
22
26
  padding?: number;
23
27
  selfEdgeSize?: number;
24
28
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dpuse/dpuse-tool-d3-visualiser",
3
- "version": "0.0.18",
3
+ "version": "0.0.22",
4
4
  "private": false,
5
5
  "description": "A TypeScript wrapper for D3, Billboard.js, and Observable Plot that implements the Data Positioning chart-rendering interface, providing ERD (dagre), Sankey (d3-sankey), network (d3-force), tree (d3-hierarchy), and bar chart (billboard.js, Observable Plot) renderers.",
6
6
  "license": "MIT",
@@ -55,7 +55,7 @@
55
55
  "test": "node -e \"import('@dpuse/dpuse-development').then(m => m.testProject())\""
56
56
  },
57
57
  "dependencies": {
58
- "@dagrejs/dagre": "^3.0.0",
58
+ "@dagrejs/dagre": "^3.1.0",
59
59
  "@dpuse/dpuse-shared": "^0.3.760",
60
60
  "@observablehq/plot": "^0.6.17",
61
61
  "billboard.js": "^4.0.3",
@@ -1,75 +0,0 @@
1
- import { t as e } from "./path-Bt1sPr2f.js";
2
- //#region node_modules/d3-shape/src/constant.js
3
- function t(e) {
4
- return function() {
5
- return e;
6
- };
7
- }
8
- //#endregion
9
- //#region node_modules/d3-shape/src/path.js
10
- function n(t) {
11
- let n = 3;
12
- return t.digits = function(e) {
13
- if (!arguments.length) return n;
14
- if (e == null) n = null;
15
- else {
16
- let t = Math.floor(e);
17
- if (!(t >= 0)) throw RangeError(`invalid digits: ${e}`);
18
- n = t;
19
- }
20
- return t;
21
- }, () => new e(n);
22
- }
23
- //#endregion
24
- //#region node_modules/d3-shape/src/array.js
25
- var r = Array.prototype.slice;
26
- function i(e) {
27
- return typeof e == "object" && "length" in e ? e : Array.from(e);
28
- }
29
- //#endregion
30
- //#region node_modules/d3-shape/src/point.js
31
- function a(e) {
32
- return e[0];
33
- }
34
- function o(e) {
35
- return e[1];
36
- }
37
- //#endregion
38
- //#region node_modules/d3-shape/src/curve/bump.js
39
- var s = class {
40
- constructor(e, t) {
41
- this._context = e, this._x = t;
42
- }
43
- areaStart() {
44
- this._line = 0;
45
- }
46
- areaEnd() {
47
- this._line = NaN;
48
- }
49
- lineStart() {
50
- this._point = 0;
51
- }
52
- lineEnd() {
53
- (this._line || this._line !== 0 && this._point === 1) && this._context.closePath(), this._line = 1 - this._line;
54
- }
55
- point(e, t) {
56
- switch (e = +e, t = +t, this._point) {
57
- case 0:
58
- this._point = 1, this._line ? this._context.lineTo(e, t) : this._context.moveTo(e, t);
59
- break;
60
- case 1: this._point = 2;
61
- default: this._x ? this._context.bezierCurveTo(this._x0 = (this._x0 + e) / 2, this._y0, this._x0, t, e, t) : this._context.bezierCurveTo(this._x0, this._y0 = (this._y0 + t) / 2, e, this._y0, e, t);
62
- }
63
- this._x0 = e, this._y0 = t;
64
- }
65
- };
66
- function c(e) {
67
- return new s(e, !0);
68
- }
69
- function l(e) {
70
- return new s(e, !1);
71
- }
72
- //#endregion
73
- export { i as a, t as c, o as i, l as n, r as o, a as r, n as s, c as t };
74
-
75
- //# sourceMappingURL=bump-znhpCF6A.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"bump-znhpCF6A.js","names":[],"sources":["../node_modules/d3-shape/src/constant.js","../node_modules/d3-shape/src/path.js","../node_modules/d3-shape/src/array.js","../node_modules/d3-shape/src/point.js","../node_modules/d3-shape/src/curve/bump.js"],"sourcesContent":["export default function(x) {\n return function constant() {\n return x;\n };\n}\n","import {Path} from \"d3-path\";\n\nexport function withPath(shape) {\n let digits = 3;\n\n shape.digits = function(_) {\n if (!arguments.length) return digits;\n if (_ == null) {\n digits = null;\n } else {\n const d = Math.floor(_);\n if (!(d >= 0)) throw new RangeError(`invalid digits: ${_}`);\n digits = d;\n }\n return shape;\n };\n\n return () => new Path(digits);\n}\n","export var slice = Array.prototype.slice;\n\nexport default function(x) {\n return typeof x === \"object\" && \"length\" in x\n ? x // Array, TypedArray, NodeList, array-like\n : Array.from(x); // Map, Set, iterable, string, or anything else\n}\n","export function x(p) {\n return p[0];\n}\n\nexport function y(p) {\n return p[1];\n}\n","import pointRadial from \"../pointRadial.js\";\n\nclass Bump {\n constructor(context, x) {\n this._context = context;\n this._x = x;\n }\n areaStart() {\n this._line = 0;\n }\n areaEnd() {\n this._line = NaN;\n }\n lineStart() {\n this._point = 0;\n }\n lineEnd() {\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n }\n point(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: {\n this._point = 1;\n if (this._line) this._context.lineTo(x, y);\n else this._context.moveTo(x, y);\n break;\n }\n case 1: this._point = 2; // falls through\n default: {\n if (this._x) this._context.bezierCurveTo(this._x0 = (this._x0 + x) / 2, this._y0, this._x0, y, x, y);\n else this._context.bezierCurveTo(this._x0, this._y0 = (this._y0 + y) / 2, x, this._y0, x, y);\n break;\n }\n }\n this._x0 = x, this._y0 = y;\n }\n}\n\nclass BumpRadial {\n constructor(context) {\n this._context = context;\n }\n lineStart() {\n this._point = 0;\n }\n lineEnd() {}\n point(x, y) {\n x = +x, y = +y;\n if (this._point === 0) {\n this._point = 1;\n } else {\n const p0 = pointRadial(this._x0, this._y0);\n const p1 = pointRadial(this._x0, this._y0 = (this._y0 + y) / 2);\n const p2 = pointRadial(x, this._y0);\n const p3 = pointRadial(x, y);\n this._context.moveTo(...p0);\n this._context.bezierCurveTo(...p1, ...p2, ...p3);\n }\n this._x0 = x, this._y0 = y;\n }\n}\n\nexport function bumpX(context) {\n return new Bump(context, true);\n}\n\nexport function bumpY(context) {\n return new Bump(context, false);\n}\n\nexport function bumpRadial(context) {\n return new BumpRadial(context);\n}\n"],"x_google_ignoreList":[0,1,2,3,4],"mappings":";;AAAA,SAAA,EAAwB,GAAG;CACzB,OAAO,WAAoB;EACzB,OAAO;CACT;AACF;;;ACFA,SAAgB,EAAS,GAAO;CAC9B,IAAI,IAAS;CAcb,OAZA,EAAM,SAAS,SAAS,GAAG;EACzB,IAAI,CAAC,UAAU,QAAQ,OAAO;EAC9B,IAAI,KAAK,MACP,IAAS;OACJ;GACL,IAAM,IAAI,KAAK,MAAM,CAAC;GACtB,IAAI,EAAE,KAAK,IAAI,MAAU,WAAW,mBAAmB,GAAG;GAC1D,IAAS;EACX;EACA,OAAO;CACT,SAEa,IAAI,EAAK,CAAM;AAC9B;;;AClBA,IAAW,IAAQ,MAAM,UAAU;AAEnC,SAAA,EAAwB,GAAG;CACzB,OAAO,OAAO,KAAM,YAAY,YAAY,IACxC,IACA,MAAM,KAAK,CAAC;AAClB;;;ACNA,SAAgB,EAAE,GAAG;CACnB,OAAO,EAAE;AACX;AAEA,SAAgB,EAAE,GAAG;CACnB,OAAO,EAAE;AACX;;;ACJA,IAAM,IAAN,MAAW;CACT,YAAY,GAAS,GAAG;EAEtB,AADA,KAAK,WAAW,GAChB,KAAK,KAAK;CACZ;CACA,YAAY;EACV,KAAK,QAAQ;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