diff options
author | Christoph Cullmann <christoph@cullmann.io> | 2024-07-15 22:27:55 +0200 |
---|---|---|
committer | Christoph Cullmann <christoph@cullmann.io> | 2024-07-15 22:27:55 +0200 |
commit | 3be5285488090ab70254b3080e33e64e6c702d2c (patch) | |
tree | 1e54462f560fd759b5be13d5ecfe1fa5c2c832ed /themes/blowfish/assets/lib/mermaid/svgDrawCommon-5ccd53ef.js | |
parent | 69075c6fb15ae660fc3d78eb2a4dfcde1c5fba1c (diff) |
sync theme
Diffstat (limited to 'themes/blowfish/assets/lib/mermaid/svgDrawCommon-5ccd53ef.js')
-rw-r--r-- | themes/blowfish/assets/lib/mermaid/svgDrawCommon-5ccd53ef.js | 101 |
1 files changed, 0 insertions, 101 deletions
diff --git a/themes/blowfish/assets/lib/mermaid/svgDrawCommon-5ccd53ef.js b/themes/blowfish/assets/lib/mermaid/svgDrawCommon-5ccd53ef.js deleted file mode 100644 index 9a1ce48..0000000 --- a/themes/blowfish/assets/lib/mermaid/svgDrawCommon-5ccd53ef.js +++ /dev/null @@ -1,101 +0,0 @@ -import { sanitizeUrl } from "@braintree/sanitize-url"; -import { J as lineBreakRegex } from "./mermaid-f47111a7.js"; -const drawRect = (element, rectData) => { - const rectElement = element.append("rect"); - rectElement.attr("x", rectData.x); - rectElement.attr("y", rectData.y); - rectElement.attr("fill", rectData.fill); - rectElement.attr("stroke", rectData.stroke); - rectElement.attr("width", rectData.width); - rectElement.attr("height", rectData.height); - if (rectData.name) { - rectElement.attr("name", rectData.name); - } - rectData.rx !== void 0 && rectElement.attr("rx", rectData.rx); - rectData.ry !== void 0 && rectElement.attr("ry", rectData.ry); - if (rectData.attrs !== void 0) { - for (const attrKey in rectData.attrs) { - rectElement.attr(attrKey, rectData.attrs[attrKey]); - } - } - rectData.class !== void 0 && rectElement.attr("class", rectData.class); - return rectElement; -}; -const drawBackgroundRect = (element, bounds) => { - const rectData = { - x: bounds.startx, - y: bounds.starty, - width: bounds.stopx - bounds.startx, - height: bounds.stopy - bounds.starty, - fill: bounds.fill, - stroke: bounds.stroke, - class: "rect" - }; - const rectElement = drawRect(element, rectData); - rectElement.lower(); -}; -const drawText = (element, textData) => { - const nText = textData.text.replace(lineBreakRegex, " "); - const textElem = element.append("text"); - textElem.attr("x", textData.x); - textElem.attr("y", textData.y); - textElem.attr("class", "legend"); - textElem.style("text-anchor", textData.anchor); - textData.class !== void 0 && textElem.attr("class", textData.class); - const tspan = textElem.append("tspan"); - tspan.attr("x", textData.x + textData.textMargin * 2); - tspan.text(nText); - return textElem; -}; -const drawImage = (elem, x, y, link) => { - const imageElement = elem.append("image"); - imageElement.attr("x", x); - imageElement.attr("y", y); - const sanitizedLink = sanitizeUrl(link); - imageElement.attr("xlink:href", sanitizedLink); -}; -const drawEmbeddedImage = (element, x, y, link) => { - const imageElement = element.append("use"); - imageElement.attr("x", x); - imageElement.attr("y", y); - const sanitizedLink = sanitizeUrl(link); - imageElement.attr("xlink:href", `#${sanitizedLink}`); -}; -const getNoteRect = () => { - const noteRectData = { - x: 0, - y: 0, - width: 100, - height: 100, - fill: "#EDF2AE", - stroke: "#666", - anchor: "start", - rx: 0, - ry: 0 - }; - return noteRectData; -}; -const getTextObj = () => { - const testObject = { - x: 0, - y: 0, - width: 100, - height: 100, - "text-anchor": "start", - style: "#666", - textMargin: 0, - rx: 0, - ry: 0, - tspan: true - }; - return testObject; -}; -export { - drawBackgroundRect as a, - drawEmbeddedImage as b, - drawImage as c, - drawRect as d, - getTextObj as e, - drawText as f, - getNoteRect as g -}; |