1 line
23 KiB
Plaintext
1 line
23 KiB
Plaintext
{"version":3,"file":"svgDraw-9e97e6db.js","sources":["../src/diagrams/class/svgDraw.js"],"sourcesContent":["import { line, curveBasis } from 'd3';\nimport utils from '../../utils';\nimport { log } from '../../logger';\nimport { parseGenericTypes } from '../common/common';\n\nlet edgeCount = 0;\nexport const drawEdge = function (elem, path, relation, conf, diagObj) {\n const getRelationType = function (type) {\n switch (type) {\n case diagObj.db.relationType.AGGREGATION:\n return 'aggregation';\n case diagObj.db.relationType.EXTENSION:\n return 'extension';\n case diagObj.db.relationType.COMPOSITION:\n return 'composition';\n case diagObj.db.relationType.DEPENDENCY:\n return 'dependency';\n case diagObj.db.relationType.LOLLIPOP:\n return 'lollipop';\n }\n };\n\n path.points = path.points.filter((p) => !Number.isNaN(p.y));\n\n // The data for our line\n const lineData = path.points;\n\n // This is the accessor function we talked about above\n const lineFunction = line()\n .x(function (d) {\n return d.x;\n })\n .y(function (d) {\n return d.y;\n })\n .curve(curveBasis);\n\n const svgPath = elem\n .append('path')\n .attr('d', lineFunction(lineData))\n .attr('id', 'edge' + edgeCount)\n .attr('class', 'relation');\n let url = '';\n if (conf.arrowMarkerAbsolute) {\n url =\n window.location.protocol +\n '//' +\n window.location.host +\n window.location.pathname +\n window.location.search;\n url = url.replace(/\\(/g, '\\\\(');\n url = url.replace(/\\)/g, '\\\\)');\n }\n\n if (relation.relation.lineType == 1) {\n svgPath.attr('class', 'relation dashed-line');\n }\n if (relation.relation.lineType == 10) {\n svgPath.attr('class', 'relation dotted-line');\n }\n if (relation.relation.type1 !== 'none') {\n svgPath.attr(\n 'marker-start',\n 'url(' + url + '#' + getRelationType(relation.relation.type1) + 'Start' + ')'\n );\n }\n if (relation.relation.type2 !== 'none') {\n svgPath.attr(\n 'marker-end',\n 'url(' + url + '#' + getRelationType(relation.relation.type2) + 'End' + ')'\n );\n }\n\n let x, y;\n const l = path.points.length;\n // Calculate Label position\n let labelPosition = utils.calcLabelPosition(path.points);\n x = labelPosition.x;\n y = labelPosition.y;\n\n let p1_card_x, p1_card_y;\n let p2_card_x, p2_card_y;\n\n if (l % 2 !== 0 && l > 1) {\n let cardinality_1_point = utils.calcCardinalityPosition(\n relation.relation.type1 !== 'none',\n path.points,\n path.points[0]\n );\n let cardinality_2_point = utils.calcCardinalityPosition(\n relation.relation.type2 !== 'none',\n path.points,\n path.points[l - 1]\n );\n\n log.debug('cardinality_1_point ' + JSON.stringify(cardinality_1_point));\n log.debug('cardinality_2_point ' + JSON.stringify(cardinality_2_point));\n\n p1_card_x = cardinality_1_point.x;\n p1_card_y = cardinality_1_point.y;\n p2_card_x = cardinality_2_point.x;\n p2_card_y = cardinality_2_point.y;\n }\n\n if (relation.title !== undefined) {\n const g = elem.append('g').attr('class', 'classLabel');\n const label = g\n .append('text')\n .attr('class', 'label')\n .attr('x', x)\n .attr('y', y)\n .attr('fill', 'red')\n .attr('text-anchor', 'middle')\n .text(relation.title);\n\n window.label = label;\n const bounds = label.node().getBBox();\n\n g.insert('rect', ':first-child')\n .attr('class', 'box')\n .attr('x', bounds.x - conf.padding / 2)\n .attr('y', bounds.y - conf.padding / 2)\n .attr('width', bounds.width + conf.padding)\n .attr('height', bounds.height + conf.padding);\n }\n\n log.info('Rendering relation ' + JSON.stringify(relation));\n if (relation.relationTitle1 !== undefined && relation.relationTitle1 !== 'none') {\n const g = elem.append('g').attr('class', 'cardinality');\n g.append('text')\n .attr('class', 'type1')\n .attr('x', p1_card_x)\n .attr('y', p1_card_y)\n .attr('fill', 'black')\n .attr('font-size', '6')\n .text(relation.relationTitle1);\n }\n if (relation.relationTitle2 !== undefined && relation.relationTitle2 !== 'none') {\n const g = elem.append('g').attr('class', 'cardinality');\n g.append('text')\n .attr('class', 'type2')\n .attr('x', p2_card_x)\n .attr('y', p2_card_y)\n .attr('fill', 'black')\n .attr('font-size', '6')\n .text(relation.relationTitle2);\n }\n\n edgeCount++;\n};\n\n/**\n * Renders a class diagram\n *\n * @param {SVGSVGElement} elem The element to draw it into\n * @param classDef\n * @param conf\n * @param diagObj\n * @todo Add more information in the JSDOC here\n */\nexport const drawClass = function (elem, classDef, conf, diagObj) {\n log.debug('Rendering class ', classDef, conf);\n\n const id = classDef.id;\n const classInfo = {\n id: id,\n label: classDef.id,\n width: 0,\n height: 0,\n };\n\n // add class group\n const g = elem.append('g').attr('id', diagObj.db.lookUpDomId(id)).attr('class', 'classGroup');\n\n // add title\n let title;\n if (classDef.link) {\n title = g\n .append('svg:a')\n .attr('xlink:href', classDef.link)\n .attr('target', classDef.linkTarget)\n .append('text')\n .attr('y', conf.textHeight + conf.padding)\n .attr('x', 0);\n } else {\n title = g\n .append('text')\n .attr('y', conf.textHeight + conf.padding)\n .attr('x', 0);\n }\n\n // add annotations\n let isFirst = true;\n classDef.annotations.forEach(function (member) {\n const titleText2 = title.append('tspan').text('«' + member + '»');\n if (!isFirst) {\n titleText2.attr('dy', conf.textHeight);\n }\n isFirst = false;\n });\n\n let classTitleString = classDef.id;\n\n if (classDef.type !== undefined && classDef.type !== '') {\n classTitleString += '<' + classDef.type + '>';\n }\n\n const classTitle = title.append('tspan').text(classTitleString).attr('class', 'title');\n\n // If class has annotations the title needs to have an offset of the text height\n if (!isFirst) {\n classTitle.attr('dy', conf.textHeight);\n }\n\n const titleHeight = title.node().getBBox().height;\n\n const membersLine = g\n .append('line') // text label for the x axis\n .attr('x1', 0)\n .attr('y1', conf.padding + titleHeight + conf.dividerMargin / 2)\n .attr('y2', conf.padding + titleHeight + conf.dividerMargin / 2);\n\n const members = g\n .append('text') // text label for the x axis\n .attr('x', conf.padding)\n .attr('y', titleHeight + conf.dividerMargin + conf.textHeight)\n .attr('fill', 'white')\n .attr('class', 'classText');\n\n isFirst = true;\n classDef.members.forEach(function (member) {\n addTspan(members, member, isFirst, conf);\n isFirst = false;\n });\n\n const membersBox = members.node().getBBox();\n\n const methodsLine = g\n .append('line') // text label for the x axis\n .attr('x1', 0)\n .attr('y1', conf.padding + titleHeight + conf.dividerMargin + membersBox.height)\n .attr('y2', conf.padding + titleHeight + conf.dividerMargin + membersBox.height);\n\n const methods = g\n .append('text') // text label for the x axis\n .attr('x', conf.padding)\n .attr('y', titleHeight + 2 * conf.dividerMargin + membersBox.height + conf.textHeight)\n .attr('fill', 'white')\n .attr('class', 'classText');\n\n isFirst = true;\n\n classDef.methods.forEach(function (method) {\n addTspan(methods, method, isFirst, conf);\n isFirst = false;\n });\n\n const classBox = g.node().getBBox();\n var cssClassStr = ' ';\n\n if (classDef.cssClasses.length > 0) {\n cssClassStr = cssClassStr + classDef.cssClasses.join(' ');\n }\n\n const rect = g\n .insert('rect', ':first-child')\n .attr('x', 0)\n .attr('y', 0)\n .attr('width', classBox.width + 2 * conf.padding)\n .attr('height', classBox.height + conf.padding + 0.5 * conf.dividerMargin)\n .attr('class', cssClassStr);\n\n const rectWidth = rect.node().getBBox().width;\n\n // Center title\n // We subtract the width of each text element from the class box width and divide it by 2\n title.node().childNodes.forEach(function (x) {\n x.setAttribute('x', (rectWidth - x.getBBox().width) / 2);\n });\n\n if (classDef.tooltip) {\n title.insert('title').text(classDef.tooltip);\n }\n\n membersLine.attr('x2', rectWidth);\n methodsLine.attr('x2', rectWidth);\n\n classInfo.width = rectWidth;\n classInfo.height = classBox.height + conf.padding + 0.5 * conf.dividerMargin;\n\n return classInfo;\n};\n\n/**\n * Renders a note diagram\n *\n * @param {SVGSVGElement} elem The element to draw it into\n * @param {{id: string; text: string; class: string;}} note\n * @param conf\n * @param diagObj\n * @todo Add more information in the JSDOC here\n */\nexport const drawNote = function (elem, note, conf, diagObj) {\n log.debug('Rendering note ', note, conf);\n\n const id = note.id;\n const noteInfo = {\n id: id,\n text: note.text,\n width: 0,\n height: 0,\n };\n\n // add class group\n const g = elem.append('g').attr('id', id).attr('class', 'classGroup');\n\n // add text\n let text = g\n .append('text')\n .attr('y', conf.textHeight + conf.padding)\n .attr('x', 0);\n\n const lines = JSON.parse(`\"${note.text}\"`).split('\\n');\n\n lines.forEach(function (line) {\n log.debug(`Adding line: ${line}`);\n text.append('tspan').text(line).attr('class', 'title').attr('dy', conf.textHeight);\n });\n\n const noteBox = g.node().getBBox();\n\n const rect = g\n .insert('rect', ':first-child')\n .attr('x', 0)\n .attr('y', 0)\n .attr('width', noteBox.width + 2 * conf.padding)\n .attr(\n 'height',\n noteBox.height + lines.length * conf.textHeight + conf.padding + 0.5 * conf.dividerMargin\n );\n\n const rectWidth = rect.node().getBBox().width;\n\n // Center title\n // We subtract the width of each text element from the class box width and divide it by 2\n text.node().childNodes.forEach(function (x) {\n x.setAttribute('x', (rectWidth - x.getBBox().width) / 2);\n });\n\n noteInfo.width = rectWidth;\n noteInfo.height =\n noteBox.height + lines.length * conf.textHeight + conf.padding + 0.5 * conf.dividerMargin;\n\n return noteInfo;\n};\n\nexport const parseMember = function (text) {\n const fieldRegEx = /^([#+~-])?(\\w+)(~\\w+~|\\[])?\\s+(\\w+) *([$*])?$/;\n const methodRegEx = /^([#+|~-])?(\\w+) *\\( *(.*)\\) *([$*])? *(\\w*[[\\]|~]*\\s*\\w*~?)$/;\n\n let fieldMatch = text.match(fieldRegEx);\n let methodMatch = text.match(methodRegEx);\n\n if (fieldMatch && !methodMatch) {\n return buildFieldDisplay(fieldMatch);\n } else if (methodMatch) {\n return buildMethodDisplay(methodMatch);\n } else {\n return buildLegacyDisplay(text);\n }\n};\n\nconst buildFieldDisplay = function (parsedText) {\n let cssStyle = '';\n let displayText = '';\n\n try {\n let visibility = parsedText[1] ? parsedText[1].trim() : '';\n let fieldType = parsedText[2] ? parsedText[2].trim() : '';\n let genericType = parsedText[3] ? parseGenericTypes(parsedText[3].trim()) : '';\n let fieldName = parsedText[4] ? parsedText[4].trim() : '';\n let classifier = parsedText[5] ? parsedText[5].trim() : '';\n\n displayText = visibility + fieldType + genericType + ' ' + fieldName;\n cssStyle = parseClassifier(classifier);\n } catch (err) {\n displayText = parsedText;\n }\n\n return {\n displayText: displayText,\n cssStyle: cssStyle,\n };\n};\n\nconst buildMethodDisplay = function (parsedText) {\n let cssStyle = '';\n let displayText = '';\n\n try {\n let visibility = parsedText[1] ? parsedText[1].trim() : '';\n let methodName = parsedText[2] ? parsedText[2].trim() : '';\n let parameters = parsedText[3] ? parseGenericTypes(parsedText[3].trim()) : '';\n let classifier = parsedText[4] ? parsedText[4].trim() : '';\n let returnType = parsedText[5] ? ' : ' + parseGenericTypes(parsedText[5]).trim() : '';\n\n displayText = visibility + methodName + '(' + parameters + ')' + returnType;\n cssStyle = parseClassifier(classifier);\n } catch (err) {\n displayText = parsedText;\n }\n\n return {\n displayText: displayText,\n cssStyle: cssStyle,\n };\n};\n\nconst buildLegacyDisplay = function (text) {\n // if for some reason we don't have any match, use old format to parse text\n let displayText = '';\n let cssStyle = '';\n let returnType = '';\n let methodStart = text.indexOf('(');\n let methodEnd = text.indexOf(')');\n\n if (methodStart > 1 && methodEnd > methodStart && methodEnd <= text.length) {\n let visibility = '';\n let methodName = '';\n\n let firstChar = text.substring(0, 1);\n if (firstChar.match(/\\w/)) {\n methodName = text.substring(0, methodStart).trim();\n } else {\n if (firstChar.match(/[#+~-]/)) {\n visibility = firstChar;\n }\n\n methodName = text.substring(1, methodStart).trim();\n }\n\n const parameters = text.substring(methodStart + 1, methodEnd);\n const classifier = text.substring(methodEnd + 1, 1);\n cssStyle = parseClassifier(text.substring(methodEnd + 1, methodEnd + 2));\n\n displayText = visibility + methodName + '(' + parseGenericTypes(parameters.trim()) + ')';\n\n if (methodEnd < text.length) {\n returnType = text.substring(methodEnd + 2).trim();\n if (returnType !== '') {\n returnType = ' : ' + parseGenericTypes(returnType);\n displayText += returnType;\n }\n }\n } else {\n // finally - if all else fails, just send the text back as written (other than parsing for generic types)\n displayText = parseGenericTypes(text);\n }\n\n return {\n displayText,\n cssStyle,\n };\n};\n/**\n * Adds a <tspan> for a member in a diagram\n *\n * @param {SVGElement} textEl The element to append to\n * @param {string} txt The member\n * @param {boolean} isFirst\n * @param {{ padding: string; textHeight: string }} conf The configuration for the member\n */\nconst addTspan = function (textEl, txt, isFirst, conf) {\n let member = parseMember(txt);\n\n const tSpan = textEl.append('tspan').attr('x', conf.padding).text(member.displayText);\n\n if (member.cssStyle !== '') {\n tSpan.attr('style', member.cssStyle);\n }\n\n if (!isFirst) {\n tSpan.attr('dy', conf.textHeight);\n }\n};\n\n/**\n * Gives the styles for a classifier\n *\n * @param {'+' | '-' | '#' | '~' | '*' | '$'} classifier The classifier string\n * @returns {string} Styling for the classifier\n */\nconst parseClassifier = function (classifier) {\n switch (classifier) {\n case '*':\n return 'font-style:italic;';\n case '$':\n return 'text-decoration:underline;';\n default:\n return '';\n }\n};\n\nexport default {\n drawClass,\n drawEdge,\n drawNote,\n parseMember,\n};\n"],"names":["line"],"mappings":";;;AAKA,IAAI,YAAY;AACT,MAAM,WAAW,SAAU,MAAM,MAAM,UAAU,MAAM,SAAS;AACrE,QAAM,kBAAkB,SAAU,MAAM;AACtC,YAAQ,MAAI;AAAA,MACV,KAAK,QAAQ,GAAG,aAAa;AAC3B,eAAO;AAAA,MACT,KAAK,QAAQ,GAAG,aAAa;AAC3B,eAAO;AAAA,MACT,KAAK,QAAQ,GAAG,aAAa;AAC3B,eAAO;AAAA,MACT,KAAK,QAAQ,GAAG,aAAa;AAC3B,eAAO;AAAA,MACT,KAAK,QAAQ,GAAG,aAAa;AAC3B,eAAO;AAAA,IACV;AAAA,EACL;AAEE,OAAK,SAAS,KAAK,OAAO,OAAO,CAAC,MAAM,CAAC,OAAO,MAAM,EAAE,CAAC,CAAC;AAG1D,QAAM,WAAW,KAAK;AAGtB,QAAM,eAAe,KAAM,EACxB,EAAE,SAAU,GAAG;AACd,WAAO,EAAE;AAAA,EACf,CAAK,EACA,EAAE,SAAU,GAAG;AACd,WAAO,EAAE;AAAA,EACf,CAAK,EACA,MAAM,UAAU;AAEnB,QAAM,UAAU,KACb,OAAO,MAAM,EACb,KAAK,KAAK,aAAa,QAAQ,CAAC,EAChC,KAAK,MAAM,SAAS,SAAS,EAC7B,KAAK,SAAS,UAAU;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