cullmann.io/themes/blowfish/assets/lib/mermaid/timeline-definition-274a7ee6.js.map

1 line
69 KiB
Plaintext

{"version":3,"file":"timeline-definition-274a7ee6.js","sources":["../src/diagrams/timeline/parser/timeline.jison","../src/diagrams/timeline/timelineDb.js","../src/diagrams/timeline/svgDraw.js","../src/diagrams/timeline/timelineRenderer.ts","../src/diagrams/timeline/styles.js","../src/diagrams/timeline/timeline-definition.ts"],"sourcesContent":["/** mermaid\n * https://mermaidjs.github.io/\n * (c) 2023 Knut Sveidqvist\n * MIT license.\n */\n%lex\n%options case-insensitive\n%x acc_title\n%x acc_descr\n%x acc_descr_multiline\n\n// Directive states\n%x open_directive type_directive arg_directive\n\n\n%%\n\n\\%\\%\\{ { this.begin('open_directive'); return 'open_directive'; }\n<open_directive>((?:(?!\\}\\%\\%)[^:.])*) { this.begin('type_directive'); return 'type_directive'; }\n<type_directive>\":\" { this.popState(); this.begin('arg_directive'); return ':'; }\n<type_directive,arg_directive>\\}\\%\\% { this.popState(); this.popState(); return 'close_directive'; }\n<arg_directive>((?:(?!\\}\\%\\%).|\\n)*) return 'arg_directive';\n\\%%(?!\\{)[^\\n]* /* skip comments */\n[^\\}]\\%\\%[^\\n]* /* skip comments */\n[\\n]+ return 'NEWLINE';\n\\s+ /* skip whitespace */\n\\#[^\\n]* /* skip comments */\n\n\"timeline\" return 'timeline';\n\"title\"\\s[^#\\n;]+ return 'title';\naccTitle\\s*\":\"\\s* { this.begin(\"acc_title\");return 'acc_title'; }\n<acc_title>(?!\\n|;|#)*[^\\n]* { this.popState(); return \"acc_title_value\"; }\naccDescr\\s*\":\"\\s* { this.begin(\"acc_descr\");return 'acc_descr'; }\n<acc_descr>(?!\\n|;|#)*[^\\n]* { this.popState(); return \"acc_descr_value\"; }\naccDescr\\s*\"{\"\\s* { this.begin(\"acc_descr_multiline\");}\n<acc_descr_multiline>[\\}] { this.popState(); }\n<acc_descr_multiline>[^\\}]* return \"acc_descr_multiline_value\";\n\"section\"\\s[^#:\\n;]+ return 'section';\n\n// event starting with \"==>\" keyword\n\":\"\\s[^#:\\n;]+ return 'event';\n[^#:\\n;]+ return 'period';\n\n\n<<EOF>> return 'EOF';\n. return 'INVALID';\n\n/lex\n\n%left '^'\n\n%start start\n\n%% /* language grammar */\n\nstart\n\t: timeline document 'EOF' { return $2; }\n\t| directive start\n\t;\n\ndocument\n\t: /* empty */ { $$ = [] }\n\t| document line {$1.push($2);$$ = $1}\n\t;\n\nline\n\t: SPACE statement { $$ = $2 }\n\t| statement { $$ = $1 }\n\t| NEWLINE { $$=[];}\n\t| EOF { $$=[];}\n\t;\n\ndirective\n : openDirective typeDirective closeDirective 'NEWLINE'\n | openDirective typeDirective ':' argDirective closeDirective 'NEWLINE'\n ;\n\nstatement\n : title {yy.getCommonDb().setDiagramTitle($1.substr(6));$$=$1.substr(6);}\n | acc_title acc_title_value { $$=$2.trim();yy.getCommonDb().setAccTitle($$); }\n | acc_descr acc_descr_value { $$=$2.trim();yy.getCommonDb().setAccDescription($$); }\n | acc_descr_multiline_value { $$=$1.trim();yy.getCommonDb().setAccDescription($$); }\n | section {yy.addSection($1.substr(8));$$=$1.substr(8);}\n | period_statement\n | event_statement\n | directive\n ;\nperiod_statement\n : period {yy.addTask($1,0,'');$$=$1;}\n;\nevent_statement\n : event {yy.addEvent($1.substr(2));$$=$1;}\n;\n\n\nopenDirective\n : open_directive { yy.parseDirective('%%{', 'open_directive'); }\n ;\n\ntypeDirective\n : type_directive { yy.parseDirective($1, 'type_directive'); }\n ;\n\nargDirective\n : arg_directive { $1 = $1.trim().replace(/'/g, '\"'); yy.parseDirective($1, 'arg_directive'); }\n ;\n\ncloseDirective\n : close_directive { yy.parseDirective('}%%', 'close_directive', 'timeline'); }\n ;\n\n%%\n","import { parseDirective as _parseDirective } from '../../directiveUtils';\nimport * as commonDb from '../../commonDb';\nlet currentSection = '';\nlet currentTaskId = 0;\n\nconst sections = [];\nconst tasks = [];\nconst rawTasks = [];\n\nexport const getCommonDb = () => commonDb;\n\nexport const parseDirective = (statement, context, type) => {\n _parseDirective(this, statement, context, type);\n};\n\nexport const clear = function () {\n sections.length = 0;\n tasks.length = 0;\n currentSection = '';\n rawTasks.length = 0;\n commonDb.clear();\n};\n\nexport const addSection = function (txt) {\n currentSection = txt;\n sections.push(txt);\n};\n\nexport const getSections = function () {\n return sections;\n};\n\nexport const getTasks = function () {\n let allItemsProcessed = compileTasks();\n const maxDepth = 100;\n let iterationCount = 0;\n while (!allItemsProcessed && iterationCount < maxDepth) {\n allItemsProcessed = compileTasks();\n iterationCount++;\n }\n\n tasks.push(...rawTasks);\n\n return tasks;\n};\n\nexport const addTask = function (period, length, event) {\n const rawTask = {\n id: currentTaskId++,\n section: currentSection,\n type: currentSection,\n task: period,\n score: length ? length : 0,\n //if event is defined, then add it the events array\n events: event ? [event] : [],\n };\n rawTasks.push(rawTask);\n};\n\nexport const addEvent = function (event) {\n // fetch current task with currnetTaskId\n const currentTask = rawTasks.find((task) => task.id === currentTaskId - 1);\n //add event to the events array\n currentTask.events.push(event);\n};\n\nexport const addTaskOrg = function (descr) {\n const newTask = {\n section: currentSection,\n type: currentSection,\n description: descr,\n task: descr,\n classes: [],\n };\n tasks.push(newTask);\n};\n\n/**\n * Compiles the raw tasks into a list of tasks with events\n * @returns {boolean} true if all items are processed\n * @private\n * @memberof timelineDb\n */\nconst compileTasks = function () {\n const compileTask = function (pos) {\n return rawTasks[pos].processed;\n };\n\n let allProcessed = true;\n for (const [i, rawTask] of rawTasks.entries()) {\n compileTask(i);\n\n allProcessed = allProcessed && rawTask.processed;\n }\n return allProcessed;\n};\n\nexport default {\n clear,\n getCommonDb,\n addSection,\n getSections,\n getTasks,\n addTask,\n addTaskOrg,\n addEvent,\n parseDirective,\n};\n","import { arc as d3arc, select } from 'd3';\nconst MAX_SECTIONS = 12;\n\nexport const drawRect = function (elem, rectData) {\n const rectElem = elem.append('rect');\n rectElem.attr('x', rectData.x);\n rectElem.attr('y', rectData.y);\n rectElem.attr('fill', rectData.fill);\n rectElem.attr('stroke', rectData.stroke);\n rectElem.attr('width', rectData.width);\n rectElem.attr('height', rectData.height);\n rectElem.attr('rx', rectData.rx);\n rectElem.attr('ry', rectData.ry);\n\n if (rectData.class !== undefined) {\n rectElem.attr('class', rectData.class);\n }\n\n return rectElem;\n};\n\nexport const drawFace = function (element, faceData) {\n const radius = 15;\n const circleElement = element\n .append('circle')\n .attr('cx', faceData.cx)\n .attr('cy', faceData.cy)\n .attr('class', 'face')\n .attr('r', radius)\n .attr('stroke-width', 2)\n .attr('overflow', 'visible');\n\n const face = element.append('g');\n\n //left eye\n face\n .append('circle')\n .attr('cx', faceData.cx - radius / 3)\n .attr('cy', faceData.cy - radius / 3)\n .attr('r', 1.5)\n .attr('stroke-width', 2)\n .attr('fill', '#666')\n .attr('stroke', '#666');\n\n //right eye\n face\n .append('circle')\n .attr('cx', faceData.cx + radius / 3)\n .attr('cy', faceData.cy - radius / 3)\n .attr('r', 1.5)\n .attr('stroke-width', 2)\n .attr('fill', '#666')\n .attr('stroke', '#666');\n\n /** @param {any} face */\n function smile(face) {\n const arc = d3arc()\n .startAngle(Math.PI / 2)\n .endAngle(3 * (Math.PI / 2))\n .innerRadius(radius / 2)\n .outerRadius(radius / 2.2);\n //mouth\n face\n .append('path')\n .attr('class', 'mouth')\n .attr('d', arc)\n .attr('transform', 'translate(' + faceData.cx + ',' + (faceData.cy + 2) + ')');\n }\n\n /** @param {any} face */\n function sad(face) {\n const arc = d3arc()\n .startAngle((3 * Math.PI) / 2)\n .endAngle(5 * (Math.PI / 2))\n .innerRadius(radius / 2)\n .outerRadius(radius / 2.2);\n //mouth\n face\n .append('path')\n .attr('class', 'mouth')\n .attr('d', arc)\n .attr('transform', 'translate(' + faceData.cx + ',' + (faceData.cy + 7) + ')');\n }\n\n /** @param {any} face */\n function ambivalent(face) {\n face\n .append('line')\n .attr('class', 'mouth')\n .attr('stroke', 2)\n .attr('x1', faceData.cx - 5)\n .attr('y1', faceData.cy + 7)\n .attr('x2', faceData.cx + 5)\n .attr('y2', faceData.cy + 7)\n .attr('class', 'mouth')\n .attr('stroke-width', '1px')\n .attr('stroke', '#666');\n }\n\n if (faceData.score > 3) {\n smile(face);\n } else if (faceData.score < 3) {\n sad(face);\n } else {\n ambivalent(face);\n }\n\n return circleElement;\n};\n\nexport const drawCircle = function (element, circleData) {\n const circleElement = element.append('circle');\n circleElement.attr('cx', circleData.cx);\n circleElement.attr('cy', circleData.cy);\n circleElement.attr('class', 'actor-' + circleData.pos);\n circleElement.attr('fill', circleData.fill);\n circleElement.attr('stroke', circleData.stroke);\n circleElement.attr('r', circleData.r);\n\n if (circleElement.class !== undefined) {\n circleElement.attr('class', circleElement.class);\n }\n\n if (circleData.title !== undefined) {\n circleElement.append('title').text(circleData.title);\n }\n\n return circleElement;\n};\n\nexport const drawText = function (elem, textData) {\n // Remove and ignore br:s\n const nText = textData.text.replace(/<br\\s*\\/?>/gi, ' ');\n\n const textElem = elem.append('text');\n textElem.attr('x', textData.x);\n textElem.attr('y', textData.y);\n textElem.attr('class', 'legend');\n\n textElem.style('text-anchor', textData.anchor);\n\n if (textData.class !== undefined) {\n textElem.attr('class', textData.class);\n }\n\n const span = textElem.append('tspan');\n span.attr('x', textData.x + textData.textMargin * 2);\n span.text(nText);\n\n return textElem;\n};\n\nexport const drawLabel = function (elem, txtObject) {\n /**\n * @param {any} x\n * @param {any} y\n * @param {any} width\n * @param {any} height\n * @param {any} cut\n */\n function genPoints(x, y, width, height, cut) {\n return (\n x +\n ',' +\n y +\n ' ' +\n (x + width) +\n ',' +\n y +\n ' ' +\n (x + width) +\n ',' +\n (y + height - cut) +\n ' ' +\n (x + width - cut * 1.2) +\n ',' +\n (y + height) +\n ' ' +\n x +\n ',' +\n (y + height)\n );\n }\n const polygon = elem.append('polygon');\n polygon.attr('points', genPoints(txtObject.x, txtObject.y, 50, 20, 7));\n polygon.attr('class', 'labelBox');\n\n txtObject.y = txtObject.y + txtObject.labelMargin;\n txtObject.x = txtObject.x + 0.5 * txtObject.labelMargin;\n drawText(elem, txtObject);\n};\n\nexport const drawSection = function (elem, section, conf) {\n const g = elem.append('g');\n\n const rect = getNoteRect();\n rect.x = section.x;\n rect.y = section.y;\n rect.fill = section.fill;\n rect.width = conf.width;\n rect.height = conf.height;\n rect.class = 'journey-section section-type-' + section.num;\n rect.rx = 3;\n rect.ry = 3;\n drawRect(g, rect);\n\n _drawTextCandidateFunc(conf)(\n section.text,\n g,\n rect.x,\n rect.y,\n rect.width,\n rect.height,\n { class: 'journey-section section-type-' + section.num },\n conf,\n section.colour\n );\n};\n\nlet taskCount = -1;\n/**\n * Draws an actor in the diagram with the attached line\n *\n * @param {any} elem The HTML element\n * @param {any} task The task to render\n * @param {any} conf The global configuration\n */\nexport const drawTask = function (elem, task, conf) {\n const center = task.x + conf.width / 2;\n const g = elem.append('g');\n taskCount++;\n const maxHeight = 300 + 5 * 30;\n g.append('line')\n .attr('id', 'task' + taskCount)\n .attr('x1', center)\n .attr('y1', task.y)\n .attr('x2', center)\n .attr('y2', maxHeight)\n .attr('class', 'task-line')\n .attr('stroke-width', '1px')\n .attr('stroke-dasharray', '4 2')\n .attr('stroke', '#666');\n\n drawFace(g, {\n cx: center,\n cy: 300 + (5 - task.score) * 30,\n score: task.score,\n });\n\n const rect = getNoteRect();\n rect.x = task.x;\n rect.y = task.y;\n rect.fill = task.fill;\n rect.width = conf.width;\n rect.height = conf.height;\n rect.class = 'task task-type-' + task.num;\n rect.rx = 3;\n rect.ry = 3;\n drawRect(g, rect);\n\n let xPos = task.x + 14;\n // task.people.forEach((person) => {\n // const colour = task.actors[person].color;\n\n // const circle = {\n // cx: xPos,\n // cy: task.y,\n // r: 7,\n // fill: colour,\n // stroke: '#000',\n // title: person,\n // pos: task.actors[person].position,\n // };\n\n // drawCircle(g, circle);\n // xPos += 10;\n // });\n\n _drawTextCandidateFunc(conf)(\n task.task,\n g,\n rect.x,\n rect.y,\n rect.width,\n rect.height,\n { class: 'task' },\n conf,\n task.colour\n );\n};\n\n/**\n * Draws a background rectangle\n *\n * @param {any} elem The html element\n * @param {any} bounds The bounds of the drawing\n */\nexport const drawBackgroundRect = function (elem, bounds) {\n const rectElem = drawRect(elem, {\n x: bounds.startx,\n y: bounds.starty,\n width: bounds.stopx - bounds.startx,\n height: bounds.stopy - bounds.starty,\n fill: bounds.fill,\n class: 'rect',\n });\n rectElem.lower();\n};\n\nexport const getTextObj = function () {\n return {\n x: 0,\n y: 0,\n fill: undefined,\n 'text-anchor': 'start',\n width: 100,\n height: 100,\n textMargin: 0,\n rx: 0,\n ry: 0,\n };\n};\n\nexport const getNoteRect = function () {\n return {\n x: 0,\n y: 0,\n width: 100,\n anchor: 'start',\n height: 100,\n rx: 0,\n ry: 0,\n };\n};\n\nconst _drawTextCandidateFunc = (function () {\n /**\n * @param {any} content\n * @param {any} g\n * @param {any} x\n * @param {any} y\n * @param {any} width\n * @param {any} height\n * @param {any} textAttrs\n * @param {any} colour\n */\n function byText(content, g, x, y, width, height, textAttrs, colour) {\n const text = g\n .append('text')\n .attr('x', x + width / 2)\n .attr('y', y + height / 2 + 5)\n .style('font-color', colour)\n .style('text-anchor', 'middle')\n .text(content);\n _setTextAttrs(text, textAttrs);\n }\n\n /**\n * @param {any} content\n * @param {any} g\n * @param {any} x\n * @param {any} y\n * @param {any} width\n * @param {any} height\n * @param {any} textAttrs\n * @param {any} conf\n * @param {any} colour\n */\n function byTspan(content, g, x, y, width, height, textAttrs, conf, colour) {\n const { taskFontSize, taskFontFamily } = conf;\n\n const lines = content.split(/<br\\s*\\/?>/gi);\n for (let i = 0; i < lines.length; i++) {\n const dy = i * taskFontSize - (taskFontSize * (lines.length - 1)) / 2;\n const text = g\n .append('text')\n .attr('x', x + width / 2)\n .attr('y', y)\n .attr('fill', colour)\n .style('text-anchor', 'middle')\n .style('font-size', taskFontSize)\n .style('font-family', taskFontFamily);\n text\n .append('tspan')\n .attr('x', x + width / 2)\n .attr('dy', dy)\n .text(lines[i]);\n\n text\n .attr('y', y + height / 2.0)\n .attr('dominant-baseline', 'central')\n .attr('alignment-baseline', 'central');\n\n _setTextAttrs(text, textAttrs);\n }\n }\n\n /**\n * @param {any} content\n * @param {any} g\n * @param {any} x\n * @param {any} y\n * @param {any} width\n * @param {any} height\n * @param {any} textAttrs\n * @param {any} conf\n */\n function byFo(content, g, x, y, width, height, textAttrs, conf) {\n const body = g.append('switch');\n const f = body\n .append('foreignObject')\n .attr('x', x)\n .attr('y', y)\n .attr('width', width)\n .attr('height', height)\n .attr('position', 'fixed');\n\n const text = f\n .append('xhtml:div')\n .style('display', 'table')\n .style('height', '100%')\n .style('width', '100%');\n\n text\n .append('div')\n .attr('class', 'label')\n .style('display', 'table-cell')\n .style('text-align', 'center')\n .style('vertical-align', 'middle')\n .text(content);\n\n byTspan(content, body, x, y, width, height, textAttrs, conf);\n _setTextAttrs(text, textAttrs);\n }\n\n /**\n * @param {any} toText\n * @param {any} fromTextAttrsDict\n */\n function _setTextAttrs(toText, fromTextAttrsDict) {\n for (const key in fromTextAttrsDict) {\n if (key in fromTextAttrsDict) {\n // noinspection JSUnfilteredForInLoop\n toText.attr(key, fromTextAttrsDict[key]);\n }\n }\n }\n\n return function (conf) {\n return conf.textPlacement === 'fo' ? byFo : conf.textPlacement === 'old' ? byText : byTspan;\n };\n})();\n\nconst initGraphics = function (graphics) {\n graphics\n .append('defs')\n .append('marker')\n .attr('id', 'arrowhead')\n .attr('refX', 5)\n .attr('refY', 2)\n .attr('markerWidth', 6)\n .attr('markerHeight', 4)\n .attr('orient', 'auto')\n .append('path')\n .attr('d', 'M 0,0 V 4 L6,2 Z'); // this is actual shape for arrowhead\n};\n\n/**\n * @param {string} text The text to be wrapped\n * @param {number} width The max width of the text\n */\nfunction wrap(text, width) {\n text.each(function () {\n var text = select(this),\n words = text\n .text()\n .split(/(\\s+|<br>)/)\n .reverse(),\n word,\n line = [],\n lineHeight = 1.1, // ems\n y = text.attr('y'),\n dy = parseFloat(text.attr('dy')),\n tspan = text\n .text(null)\n .append('tspan')\n .attr('x', 0)\n .attr('y', y)\n .attr('dy', dy + 'em');\n for (let j = 0; j < words.length; j++) {\n word = words[words.length - 1 - j];\n line.push(word);\n tspan.text(line.join(' ').trim());\n if (tspan.node().getComputedTextLength() > width || word === '<br>') {\n line.pop();\n tspan.text(line.join(' ').trim());\n if (word === '<br>') {\n line = [''];\n } else {\n line = [word];\n }\n\n tspan = text\n .append('tspan')\n .attr('x', 0)\n .attr('y', y)\n .attr('dy', lineHeight + 'em')\n .text(word);\n }\n }\n });\n}\n\nexport const drawNode = function (elem, node, fullSection, conf) {\n const section = (fullSection % MAX_SECTIONS) - 1;\n const nodeElem = elem.append('g');\n node.section = section;\n nodeElem.attr(\n 'class',\n (node.class ? node.class + ' ' : '') + 'timeline-node ' + ('section-' + section)\n );\n const bkgElem = nodeElem.append('g');\n\n // Create the wrapped text element\n const textElem = nodeElem.append('g');\n\n const txt = textElem\n .append('text')\n .text(node.descr)\n .attr('dy', '1em')\n .attr('alignment-baseline', 'middle')\n .attr('dominant-baseline', 'middle')\n .attr('text-anchor', 'middle')\n .call(wrap, node.width);\n const bbox = txt.node().getBBox();\n const fontSize =\n conf.fontSize && conf.fontSize.replace ? conf.fontSize.replace('px', '') : conf.fontSize;\n node.height = bbox.height + fontSize * 1.1 * 0.5 + node.padding;\n node.height = Math.max(node.height, node.maxHeight);\n node.width = node.width + 2 * node.padding;\n\n textElem.attr('transform', 'translate(' + node.width / 2 + ', ' + node.padding / 2 + ')');\n\n // Create the background element\n defaultBkg(bkgElem, node, section, conf);\n\n return node;\n};\n\nexport const getVirtualNodeHeight = function (elem, node, conf) {\n const textElem = elem.append('g');\n const txt = textElem\n .append('text')\n .text(node.descr)\n .attr('dy', '1em')\n .attr('alignment-baseline', 'middle')\n .attr('dominant-baseline', 'middle')\n .attr('text-anchor', 'middle')\n .call(wrap, node.width);\n const bbox = txt.node().getBBox();\n const fontSize =\n conf.fontSize && conf.fontSize.replace ? conf.fontSize.replace('px', '') : conf.fontSize;\n textElem.remove();\n return bbox.height + fontSize * 1.1 * 0.5 + node.padding;\n};\n\nconst defaultBkg = function (elem, node, section) {\n const rd = 5;\n elem\n .append('path')\n .attr('id', 'node-' + node.id)\n .attr('class', 'node-bkg node-' + node.type)\n .attr(\n 'd',\n `M0 ${node.height - rd} v${-node.height + 2 * rd} q0,-5 5,-5 h${\n node.width - 2 * rd\n } q5,0 5,5 v${node.height - rd} H0 Z`\n );\n\n elem\n .append('line')\n .attr('class', 'node-line-' + section)\n .attr('x1', 0)\n .attr('y1', node.height)\n .attr('x2', node.width)\n .attr('y2', node.height);\n};\n\nexport default {\n drawRect,\n drawCircle,\n drawSection,\n drawText,\n drawLabel,\n drawTask,\n drawBackgroundRect,\n getTextObj,\n getNoteRect,\n initGraphics,\n drawNode,\n getVirtualNodeHeight,\n};\n","// @ts-ignore - db not typed yet\nimport { select, Selection } from 'd3';\nimport svgDraw from './svgDraw';\nimport { log } from '../../logger';\nimport { getConfig } from '../../config';\nimport { setupGraphViewbox } from '../../setupGraphViewbox';\nimport { Diagram } from '../../Diagram';\nimport { MermaidConfig } from '../../config.type';\n\ninterface Block<TDesc, TSection> {\n number: number;\n descr: TDesc;\n section: TSection;\n width: number;\n padding: number;\n maxHeight: number;\n}\n\ninterface TimelineTask {\n id: number;\n section: string;\n type: string;\n task: string;\n score: number;\n events: string[];\n}\nexport const draw = function (text: string, id: string, version: string, diagObj: Diagram) {\n //1. Fetch the configuration\n const conf = getConfig();\n // @ts-expect-error - wrong config?\n const LEFT_MARGIN = conf.leftMargin ?? 50;\n\n //2. Clear the diagram db before parsing\n diagObj.db.clear?.();\n\n //3. Parse the diagram text\n diagObj.parser.parse(text + '\\n');\n\n log.debug('timeline', diagObj.db);\n\n const securityLevel = conf.securityLevel;\n // Handle root and Document for when rendering in sandbox mode\n let sandboxElement;\n if (securityLevel === 'sandbox') {\n sandboxElement = select('#i' + id);\n }\n const root =\n securityLevel === 'sandbox'\n ? // @ts-ignore d3 types are wrong\n select(sandboxElement.nodes()[0].contentDocument.body)\n : select('body');\n\n // @ts-ignore d3 types are wrong\n const svg = root.select('#' + id);\n\n svg.append('g');\n\n //4. Fetch the diagram data\n // @ts-expect-error - db not typed yet\n const tasks: TimelineTask[] = diagObj.db.getTasks();\n // @ts-expect-error - db not typed yet\n const title = diagObj.db.getCommonDb().getDiagramTitle();\n log.debug('task', tasks);\n\n //5. Initialize the diagram\n svgDraw.initGraphics(svg);\n\n // fetch Sections\n // @ts-expect-error - db not typed yet\n const sections: string[] = diagObj.db.getSections();\n log.debug('sections', sections);\n\n let maxSectionHeight = 0;\n let maxTaskHeight = 0;\n //let sectionBeginX = 0;\n let depthY = 0;\n let sectionBeginY = 0;\n let masterX = 50 + LEFT_MARGIN;\n //sectionBeginX = masterX;\n let masterY = 50;\n sectionBeginY = 50;\n //draw sections\n let sectionNumber = 0;\n let hasSections = true;\n\n //Calculate the max height of the sections\n sections.forEach(function (section: string) {\n const sectionNode: Block<string, number> = {\n number: sectionNumber,\n descr: section,\n section: sectionNumber,\n width: 150,\n padding: 20,\n maxHeight: maxSectionHeight,\n };\n const sectionHeight = svgDraw.getVirtualNodeHeight(svg, sectionNode, conf);\n log.debug('sectionHeight before draw', sectionHeight);\n maxSectionHeight = Math.max(maxSectionHeight, sectionHeight + 20);\n });\n\n //tasks length and maxEventCount\n let maxEventCount = 0;\n let maxEventLineLength = 0;\n log.debug('tasks.length', tasks.length);\n //calculate max task height\n // for loop till tasks.length\n\n for (const [i, task] of tasks.entries()) {\n const taskNode: Block<TimelineTask, string> = {\n number: i,\n descr: task,\n section: task.section,\n width: 150,\n padding: 20,\n maxHeight: maxTaskHeight,\n };\n const taskHeight = svgDraw.getVirtualNodeHeight(svg, taskNode, conf);\n log.debug('taskHeight before draw', taskHeight);\n maxTaskHeight = Math.max(maxTaskHeight, taskHeight + 20);\n\n //calculate maxEventCount\n maxEventCount = Math.max(maxEventCount, task.events.length);\n //calculate maxEventLineLength\n let maxEventLineLengthTemp = 0;\n for (let j = 0; j < task.events.length; j++) {\n const event = task.events[j];\n const eventNode = {\n descr: event,\n section: task.section,\n number: task.section,\n width: 150,\n padding: 20,\n maxHeight: 50,\n };\n maxEventLineLengthTemp += svgDraw.getVirtualNodeHeight(svg, eventNode, conf);\n }\n maxEventLineLength = Math.max(maxEventLineLength, maxEventLineLengthTemp);\n }\n\n log.debug('maxSectionHeight before draw', maxSectionHeight);\n log.debug('maxTaskHeight before draw', maxTaskHeight);\n\n if (sections && sections.length > 0) {\n sections.forEach((section) => {\n //filter task where tasks.section == section\n const tasksForSection = tasks.filter((task) => task.section === section);\n\n const sectionNode: Block<string, number> = {\n number: sectionNumber,\n descr: section,\n section: sectionNumber,\n width: 200 * Math.max(tasksForSection.length, 1) - 50,\n padding: 20,\n maxHeight: maxSectionHeight,\n };\n log.debug('sectionNode', sectionNode);\n const sectionNodeWrapper = svg.append('g');\n const node = svgDraw.drawNode(sectionNodeWrapper, sectionNode, sectionNumber, conf);\n log.debug('sectionNode output', node);\n\n sectionNodeWrapper.attr('transform', `translate(${masterX}, ${sectionBeginY})`);\n\n masterY += maxSectionHeight + 50;\n\n //draw tasks for this section\n if (tasksForSection.length > 0) {\n drawTasks(\n svg,\n tasksForSection,\n sectionNumber,\n masterX,\n masterY,\n maxTaskHeight,\n conf,\n maxEventCount,\n maxEventLineLength,\n maxSectionHeight,\n false\n );\n }\n // todo replace with total width of section and its tasks\n masterX += 200 * Math.max(tasksForSection.length, 1);\n\n masterY = sectionBeginY;\n sectionNumber++;\n });\n } else {\n //draw tasks\n hasSections = false;\n drawTasks(\n svg,\n tasks,\n sectionNumber,\n masterX,\n masterY,\n maxTaskHeight,\n conf,\n maxEventCount,\n maxEventLineLength,\n maxSectionHeight,\n true\n );\n }\n\n // Get BBox of the diagram\n const box = svg.node().getBBox();\n log.debug('bounds', box);\n\n if (title) {\n svg\n .append('text')\n .text(title)\n .attr('x', box.width / 2 - LEFT_MARGIN)\n .attr('font-size', '4ex')\n .attr('font-weight', 'bold')\n .attr('y', 20);\n }\n //5. Draw the diagram\n depthY = hasSections ? maxSectionHeight + maxTaskHeight + 150 : maxTaskHeight + 100;\n\n const lineWrapper = svg.append('g').attr('class', 'lineWrapper');\n // Draw activity line\n lineWrapper\n .append('line')\n .attr('x1', LEFT_MARGIN)\n .attr('y1', depthY) // One section head + one task + margins\n .attr('x2', box.width + 3 * LEFT_MARGIN) // Subtract stroke width so arrow point is retained\n .attr('y2', depthY)\n .attr('stroke-width', 4)\n .attr('stroke', 'black')\n .attr('marker-end', 'url(#arrowhead)');\n\n // Setup the view box and size of the svg element\n setupGraphViewbox(\n undefined,\n svg,\n conf.timeline?.padding ?? 50,\n conf.timeline?.useMaxWidth ?? false\n );\n\n // addSVGAccessibilityFields(diagObj.db, diagram, id);\n};\n\nexport const drawTasks = function (\n diagram: Selection<SVGElement, unknown, null, undefined>,\n tasks: TimelineTask[],\n sectionColor: number,\n masterX: number,\n masterY: number,\n maxTaskHeight: number,\n conf: MermaidConfig,\n maxEventCount: number,\n maxEventLineLength: number,\n maxSectionHeight: number,\n isWithoutSections: boolean\n) {\n // Draw the tasks\n for (const task of tasks) {\n // create node from task\n const taskNode = {\n descr: task.task,\n section: sectionColor,\n number: sectionColor,\n width: 150,\n padding: 20,\n maxHeight: maxTaskHeight,\n };\n\n log.debug('taskNode', taskNode);\n // create task wrapper\n\n const taskWrapper = diagram.append('g').attr('class', 'taskWrapper');\n const node = svgDraw.drawNode(taskWrapper, taskNode, sectionColor, conf);\n const taskHeight = node.height;\n //log task height\n log.debug('taskHeight after draw', taskHeight);\n taskWrapper.attr('transform', `translate(${masterX}, ${masterY})`);\n\n // update max task height\n maxTaskHeight = Math.max(maxTaskHeight, taskHeight);\n\n // if task has events, draw them\n if (task.events) {\n // draw a line between the task and the events\n const lineWrapper = diagram.append('g').attr('class', 'lineWrapper');\n let lineLength = maxTaskHeight;\n //add margin to task\n masterY += 100;\n lineLength =\n lineLength + drawEvents(diagram, task.events, sectionColor, masterX, masterY, conf);\n masterY -= 100;\n\n lineWrapper\n .append('line')\n .attr('x1', masterX + 190 / 2)\n .attr('y1', masterY + maxTaskHeight) // One section head + one task + margins\n .attr('x2', masterX + 190 / 2) // Subtract stroke width so arrow point is retained\n .attr(\n 'y2',\n masterY +\n maxTaskHeight +\n (isWithoutSections ? maxTaskHeight : maxSectionHeight) +\n maxEventLineLength +\n 120\n )\n .attr('stroke-width', 2)\n .attr('stroke', 'black')\n .attr('marker-end', 'url(#arrowhead)')\n .attr('stroke-dasharray', '5,5');\n }\n\n masterX = masterX + 200;\n if (isWithoutSections && !conf.timeline?.disableMulticolor) {\n sectionColor++;\n }\n }\n\n // reset Y coordinate for next section\n masterY = masterY - 10;\n};\n\nexport const drawEvents = function (\n diagram: Selection<SVGElement, unknown, null, undefined>,\n events: string[],\n sectionColor: number,\n masterX: number,\n masterY: number,\n conf: MermaidConfig\n) {\n let maxEventHeight = 0;\n const eventBeginY = masterY;\n masterY = masterY + 100;\n // Draw the events\n for (const event of events) {\n // create node from event\n const eventNode: Block<string, number> = {\n descr: event,\n section: sectionColor,\n number: sectionColor,\n width: 150,\n padding: 20,\n maxHeight: 50,\n };\n\n //log task node\n log.debug('eventNode', eventNode);\n // create event wrapper\n const eventWrapper = diagram.append('g').attr('class', 'eventWrapper');\n const node = svgDraw.drawNode(eventWrapper, eventNode, sectionColor, conf);\n const eventHeight = node.height;\n maxEventHeight = maxEventHeight + eventHeight;\n eventWrapper.attr('transform', `translate(${masterX}, ${masterY})`);\n masterY = masterY + 10 + eventHeight;\n }\n // set masterY back to eventBeginY\n masterY = eventBeginY;\n return maxEventHeight;\n};\n\nexport default {\n setConf: () => {\n // no-op\n },\n draw,\n};\n","import { darken, lighten, isDark } from 'khroma';\n\nconst genSections = (options) => {\n let sections = '';\n\n for (let i = 0; i < options.THEME_COLOR_LIMIT; i++) {\n options['lineColor' + i] = options['lineColor' + i] || options['cScaleInv' + i];\n if (isDark(options['lineColor' + i])) {\n options['lineColor' + i] = lighten(options['lineColor' + i], 20);\n } else {\n options['lineColor' + i] = darken(options['lineColor' + i], 20);\n }\n }\n\n for (let i = 0; i < options.THEME_COLOR_LIMIT; i++) {\n const sw = '' + (17 - 3 * i);\n sections += `\n .section-${i - 1} rect, .section-${i - 1} path, .section-${i - 1} circle, .section-${\n i - 1\n } path {\n fill: ${options['cScale' + i]};\n }\n .section-${i - 1} text {\n fill: ${options['cScaleLabel' + i]};\n }\n .node-icon-${i - 1} {\n font-size: 40px;\n color: ${options['cScaleLabel' + i]};\n }\n .section-edge-${i - 1}{\n stroke: ${options['cScale' + i]};\n }\n .edge-depth-${i - 1}{\n stroke-width: ${sw};\n }\n .section-${i - 1} line {\n stroke: ${options['cScaleInv' + i]} ;\n stroke-width: 3;\n }\n\n .lineWrapper line{\n stroke: ${options['cScaleLabel' + i]} ;\n }\n\n .disabled, .disabled circle, .disabled text {\n fill: lightgray;\n }\n .disabled text {\n fill: #efefef;\n }\n `;\n }\n return sections;\n};\n\nconst getStyles = (options) =>\n `\n .edge {\n stroke-width: 3;\n }\n ${genSections(options)}\n .section-root rect, .section-root path, .section-root circle {\n fill: ${options.git0};\n }\n .section-root text {\n fill: ${options.gitBranchLabel0};\n }\n .icon-container {\n height:100%;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n .edge {\n fill: none;\n }\n .eventWrapper {\n filter: brightness(120%);\n }\n`;\nexport default getStyles;\n","// @ts-ignore: TODO Fix ts errors\nimport parser from './parser/timeline.jison';\nimport * as db from './timelineDb';\nimport renderer from './timelineRenderer';\nimport styles from './styles';\n\nexport const diagram = {\n db,\n renderer,\n parser,\n styles,\n};\n"],"names":["parser","o","v","l","$V0","$V1","$V2","$V3","$V4","$V5","$V6","$V7","$V8","$V9","$Va","$Vb","yytext","yyleng","yylineno","yy","yystate","$$","_$","$0","str","hash","error","input","self","stack","tstack","vstack","lstack","table","TERROR","EOF","args","lexer","sharedState","k","yyloc","ranges","lex","token","symbol","state","action","r","yyval","p","len","newState","expected","errStr","ch","lines","oldLines","n","past","next","pre","c","match","indexed_rule","backup","tempMatch","index","rules","i","condition","yy_","$avoiding_name_collisions","YY_START","Parser","currentSection","currentTaskId","sections","tasks","rawTasks","getCommonDb","commonDb","parseDirective","statement","context","type","_parseDirective","this","clear","commonDb.clear","addSection","txt","getSections","getTasks","allItemsProcessed","compileTasks","maxDepth","iterationCount","addTask","period","length","event","rawTask","addEvent","task","addTaskOrg","descr","newTask","compileTask","pos","allProcessed","timelineDb","MAX_SECTIONS","drawRect","elem","rectData","rectElem","drawFace","element","faceData","circleElement","face","smile","arc","d3arc","sad","ambivalent","drawCircle","circleData","drawText","textData","nText","textElem","span","drawLabel","txtObject","genPoints","x","y","width","height","cut","polygon","drawSection","section","conf","g","rect","getNoteRect","_drawTextCandidateFunc","taskCount","drawTask","center","maxHeight","drawBackgroundRect","bounds","getTextObj","byText","content","textAttrs","colour","text","_setTextAttrs","byTspan","taskFontSize","taskFontFamily","dy","byFo","body","toText","fromTextAttrsDict","key","initGraphics","graphics","wrap","select","words","word","line","lineHeight","tspan","j","drawNode","node","fullSection","nodeElem","bkgElem","bbox","fontSize","defaultBkg","getVirtualNodeHeight","svgDraw","draw","id","version","diagObj","getConfig","LEFT_MARGIN","_b","_a","log","securityLevel","sandboxElement","svg","title","maxSectionHeight","maxTaskHeight","depthY","sectionBeginY","masterX","masterY","sectionNumber","hasSections","sectionNode","sectionHeight","maxEventCount","maxEventLineLength","taskNode","taskHeight","maxEventLineLengthTemp","eventNode","tasksForSection","sectionNodeWrapper","drawTasks","box","setupGraphViewbox","_c","_d","diagram","sectionColor","isWithoutSections","taskWrapper","lineWrapper","lineLength","drawEvents","events","maxEventHeight","eventBeginY","eventWrapper","eventHeight","renderer","genSections","options","isDark","lighten","darken","sw","getStyles","styles","db"],"mappings":";;;;;;;AAyEA,IAAIA,IAAU,WAAU;AACxB,MAAIC,IAAE,SAAS,GAAEC,GAAED,GAAEE,GAAE;AAAC,SAAIF,IAAEA,KAAG,IAAGE,IAAE,EAAE,QAAOA,KAAIF,EAAE,EAA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