mirror of
https://github.com/nunocoracao/blowfish.git
synced 2026-11-12 22:19:20 +00:00
final polish
This commit is contained in:
1 parent
fc2351734f
commit
7e41c9cac0
546 files changed
+4
-514376
No files matched your search
@@ -36,13 +36,6 @@ jobs:
|
|||||||
push_options: "--dry-run"
|
push_options: "--dry-run"
|
||||||
file_pattern: "assets/lib/katex/*"
|
file_pattern: "assets/lib/katex/*"
|
||||||
commit_message: "📦 Update packaged KaTeX"
|
commit_message: "📦 Update packaged KaTeX"
|
||||||
- name: Commit Mermaid changes
|
|
||||||
uses: stefanzweifel/git-auto-commit-action@v4
|
|
||||||
with:
|
|
||||||
branch: "${{ github.head_ref }}"
|
|
||||||
push_options: "--dry-run"
|
|
||||||
file_pattern: "assets/lib/mermaid/*"
|
|
||||||
commit_message: "📦 Update packaged Mermaid"
|
|
||||||
- run: npm run build
|
- run: npm run build
|
||||||
- name: Commit CSS changes
|
- name: Commit CSS changes
|
||||||
uses: stefanzweifel/git-auto-commit-action@v4
|
uses: stefanzweifel/git-auto-commit-action@v4
|
||||||
|
|||||||
@@ -1,22 +0,0 @@
|
|||||||
function css(name) {
|
|
||||||
return "rgb(" + getComputedStyle(document.documentElement).getPropertyValue(name) + ")";
|
|
||||||
}
|
|
||||||
|
|
||||||
/*mermaid.initialize({
|
|
||||||
theme: "base",
|
|
||||||
themeVariables: {
|
|
||||||
background: css("--color-neutral"),
|
|
||||||
primaryColor: css("--color-primary-200"),
|
|
||||||
secondaryColor: css("--color-secondary-200"),
|
|
||||||
tertiaryColor: css("--color-neutral-100"),
|
|
||||||
primaryBorderColor: css("--color-primary-400"),
|
|
||||||
secondaryBorderColor: css("--color-secondary-400"),
|
|
||||||
tertiaryBorderColor: css("--color-neutral-400"),
|
|
||||||
lineColor: css("--color-neutral-600"),
|
|
||||||
fontFamily:
|
|
||||||
"ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,segoe ui,Roboto,helvetica neue,Arial,noto sans,sans-serif",
|
|
||||||
fontSize: "16px",
|
|
||||||
},
|
|
||||||
});*/
|
|
||||||
|
|
||||||
mermaid.initialize({ startOnLoad: true });
|
|
||||||
Vendored
BIN
Binary file not shown.
Vendored
-16
@@ -1,16 +0,0 @@
|
|||||||
import { DetailedError } from './utils';
|
|
||||||
export declare type ParseErrorFunction = (err: string | DetailedError | unknown, hash?: any) => void;
|
|
||||||
export declare class Diagram {
|
|
||||||
text: string;
|
|
||||||
type: string;
|
|
||||||
parser: any;
|
|
||||||
renderer: any;
|
|
||||||
db: import("./diagram-api/types").DiagramDb;
|
|
||||||
private detectError?;
|
|
||||||
constructor(text: string);
|
|
||||||
parse(): void;
|
|
||||||
render(id: string, version: string): Promise<void>;
|
|
||||||
getParser(): any;
|
|
||||||
getType(): string;
|
|
||||||
}
|
|
||||||
export declare const getDiagramFromText: (text: string) => Promise<Diagram>;
|
|
||||||
-14
@@ -1,14 +0,0 @@
|
|||||||
export declare const mermaidAPI: {
|
|
||||||
render: import("@vitest/spy").Mock<any[], any>;
|
|
||||||
parse: (text: string, parseOptions?: import("../mermaidAPI").ParseOptions | undefined) => Promise<boolean | void>;
|
|
||||||
parseDirective: import("@vitest/spy").Mock<any[], any>;
|
|
||||||
initialize: import("@vitest/spy").Mock<any[], any>;
|
|
||||||
getConfig: () => import("../config.type").MermaidConfig;
|
|
||||||
setConfig: (conf: import("../config.type").MermaidConfig) => import("../config.type").MermaidConfig;
|
|
||||||
getSiteConfig: () => import("../config.type").MermaidConfig;
|
|
||||||
updateSiteConfig: (conf: import("../config.type").MermaidConfig) => import("../config.type").MermaidConfig;
|
|
||||||
reset: () => void;
|
|
||||||
globalReset: () => void;
|
|
||||||
defaultConfig: import("../config.type").MermaidConfig;
|
|
||||||
};
|
|
||||||
export default mermaidAPI;
|
|
||||||
-27
@@ -1,27 +0,0 @@
|
|||||||
/**
|
|
||||||
* Accessibility (a11y) functions, types, helpers
|
|
||||||
* @see https://www.w3.org/WAI/
|
|
||||||
* @see https://www.w3.org/TR/wai-aria-1.1/
|
|
||||||
* @see https://www.w3.org/TR/svg-aam-1.0/
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
import { D3Element } from './mermaidAPI';
|
|
||||||
/**
|
|
||||||
* Add role and aria-roledescription to the svg element
|
|
||||||
*
|
|
||||||
* @param svg - d3 object that contains the SVG HTML element
|
|
||||||
* @param diagramType - diagram name for to the aria-roledescription
|
|
||||||
*/
|
|
||||||
export declare function setA11yDiagramInfo(svg: D3Element, diagramType: string | null | undefined): void;
|
|
||||||
/**
|
|
||||||
* Add an accessible title and/or description element to a chart.
|
|
||||||
* The title is usually not displayed and the description is never displayed.
|
|
||||||
*
|
|
||||||
* The following charts display their title as a visual and accessibility element: gantt
|
|
||||||
*
|
|
||||||
* @param svg - d3 node to insert the a11y title and desc info
|
|
||||||
* @param a11yTitle - a11y title. null and undefined are meaningful: means to skip it
|
|
||||||
* @param a11yDesc - a11y description. null and undefined are meaningful: means to skip it
|
|
||||||
* @param baseId - id used to construct the a11y title and description id
|
|
||||||
*/
|
|
||||||
export declare function addSVGa11yTitleDescription(svg: D3Element, a11yTitle: string | null | undefined, a11yDesc: string | null | undefined, baseId: string): void;
|
|
||||||
-1
@@ -1 +0,0 @@
|
|||||||
export {};
|
|
||||||
File diff suppressed because it is too large.
Load diff
@@ -1 +0,0 @@
|
|||||||
{"version":3,"file":"add-html-label-3fd8c466.js","sources":["../src/diagrams/flowchart/parser/flow.jison","../src/diagrams/flowchart/flowDb.js","../../../node_modules/.pnpm/dagre-d3-es@7.0.9/node_modules/dagre-d3-es/src/dagre-js/util.js","../../../node_modules/.pnpm/dagre-d3-es@7.0.9/node_modules/dagre-d3-es/src/dagre-js/label/add-html-label.js"],"sourcesContent":["/** mermaid\n * https://mermaidjs.github.io/\n * (c) 2015 Knut Sveidqvist\n * MIT license.\n */\n\n/* lexical grammar */\n%lex\n%x string\n%x acc_title\n%x acc_descr\n%x acc_descr_multiline\n%x dir\n%x vertex\n%x click\n%x href\n%x callbackname\n%x callbackargs\n%x open_directive\n%x type_directive\n%x arg_directive\n%x close_directive\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 */\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// <acc_descr_multiline>.*[^\\n]* { return \"acc_descr_line\"}\n[\"] this.begin(\"string\");\n<string>[\"] this.popState();\n<string>[^\"]* return \"STR\";\n\"style\" return 'STYLE';\n\"default\" return 'DEFAULT';\n\"linkStyle\" return 'LINKSTYLE';\n\"interpolate\" return 'INTERPOLATE';\n\"classDef\" return 'CLASSDEF';\n\"class\" return 'CLASS';\n\n/*\n---interactivity command---\n'href' adds a link to the specified node. 'href' can only be specified when the\nline was introduced with 'click'.\n'href \"<link>\"' attaches the specified link to the node that was specified by 'click'.\n*/\n\"href\"[\\s]+[\"] this.begin(\"href\");\n<href>[\"] this.popState();\n<href>[^\"]* return 'HREF';\n\n/*\n---interactivity command---\n'call' adds a callback to the specified node. 'call' can only be specified when\nthe line was introduced with 'click'.\n'call <callbackname>(<args>)' attaches the function 'callbackname' with the specified\narguments to the node that was specified by 'click'.\nFunction arguments are optional: 'call <callbackname>()' simply executes 'callbackname' without any arguments.\n*/\n\"call\"[\\s]+ this.begin(\"callbackname\");\n<callbackname>\\([\\s]*\\) this.popState();\n<callbackname>\\( this.popState(); this.begin(\"callbackargs\");\n<callbackname>[^(]* return 'CALLBACKNAME';\n<callbackargs>\\) this.popState();\n<callbackargs>[^)]* return 'CALLBACKARGS';\n\n/*\n'click' is the keyword to introduce a line that contains interactivity commands.\n'click' must be followed by an existing node-id. All commands are attached to\nthat id.\n'click <id>' can be followed by href or call commands in any desired order\n*/\n\"click\"[\\s]+ this.begin(\"click\");\n<click>[\\s\\n] this.popState();\n<click>[^\\s\\n]* return 'CLICK';\n\n\"flowchart-elk\" {if(yy.lex.firstGraph()){this.begin(\"dir\");} return 'GRAPH';}\n\"graph\" {if(yy.lex.firstGraph()){this.begin(\"dir\");} return 'GRAPH';}\n\"flowchart\" {if(yy.lex.firstGraph()){this.begin(\"dir\");} return 'GRAPH';}\n\"subgraph\" return 'subgraph';\n\"end\"\\b\\s* return 'end';\n\n\"_self\" return 'LINK_TARGET';\n\"_blank\" return 'LINK_TARGET';\n\"_parent\" return 'LINK_TARGET';\n\"_top\" return 'LINK_TARGET';\n\n<dir>(\\r?\\n)*\\s*\\n { this.popState(); return 'NODIR'; }\n<dir>\\s*\"LR\" { this.popState(); return 'DIR'; }\n<dir>\\s*\"RL\" { this.popState(); return 'DIR'; }\n<dir>\\s*\"TB\" { thisLine truncated
|
|
||||||
File diff suppressed because it is too large.
Load diff
@@ -1 +0,0 @@
|
|||||||
{"version":3,"file":"add-html-label-6e56ed67.js","sources":["../src/diagrams/flowchart/parser/flow.jison","../src/diagrams/flowchart/flowDb.js","../../../node_modules/.pnpm/dagre-d3-es@7.0.9/node_modules/dagre-d3-es/src/dagre-js/util.js","../../../node_modules/.pnpm/dagre-d3-es@7.0.9/node_modules/dagre-d3-es/src/dagre-js/label/add-html-label.js"],"sourcesContent":["/** mermaid\n * https://mermaidjs.github.io/\n * (c) 2015 Knut Sveidqvist\n * MIT license.\n */\n\n/* lexical grammar */\n%lex\n%x string\n%x acc_title\n%x acc_descr\n%x acc_descr_multiline\n%x dir\n%x vertex\n%x click\n%x href\n%x callbackname\n%x callbackargs\n%x open_directive\n%x type_directive\n%x arg_directive\n%x close_directive\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 */\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// <acc_descr_multiline>.*[^\\n]* { return \"acc_descr_line\"}\n[\"] this.begin(\"string\");\n<string>[\"] this.popState();\n<string>[^\"]* return \"STR\";\n\"style\" return 'STYLE';\n\"default\" return 'DEFAULT';\n\"linkStyle\" return 'LINKSTYLE';\n\"interpolate\" return 'INTERPOLATE';\n\"classDef\" return 'CLASSDEF';\n\"class\" return 'CLASS';\n\n/*\n---interactivity command---\n'href' adds a link to the specified node. 'href' can only be specified when the\nline was introduced with 'click'.\n'href \"<link>\"' attaches the specified link to the node that was specified by 'click'.\n*/\n\"href\"[\\s]+[\"] this.begin(\"href\");\n<href>[\"] this.popState();\n<href>[^\"]* return 'HREF';\n\n/*\n---interactivity command---\n'call' adds a callback to the specified node. 'call' can only be specified when\nthe line was introduced with 'click'.\n'call <callbackname>(<args>)' attaches the function 'callbackname' with the specified\narguments to the node that was specified by 'click'.\nFunction arguments are optional: 'call <callbackname>()' simply executes 'callbackname' without any arguments.\n*/\n\"call\"[\\s]+ this.begin(\"callbackname\");\n<callbackname>\\([\\s]*\\) this.popState();\n<callbackname>\\( this.popState(); this.begin(\"callbackargs\");\n<callbackname>[^(]* return 'CALLBACKNAME';\n<callbackargs>\\) this.popState();\n<callbackargs>[^)]* return 'CALLBACKARGS';\n\n/*\n'click' is the keyword to introduce a line that contains interactivity commands.\n'click' must be followed by an existing node-id. All commands are attached to\nthat id.\n'click <id>' can be followed by href or call commands in any desired order\n*/\n\"click\"[\\s]+ this.begin(\"click\");\n<click>[\\s\\n] this.popState();\n<click>[^\\s\\n]* return 'CLICK';\n\n\"flowchart-elk\" {if(yy.lex.firstGraph()){this.begin(\"dir\");} return 'GRAPH';}\n\"graph\" {if(yy.lex.firstGraph()){this.begin(\"dir\");} return 'GRAPH';}\n\"flowchart\" {if(yy.lex.firstGraph()){this.begin(\"dir\");} return 'GRAPH';}\n\"subgraph\" return 'subgraph';\n\"end\"\\b\\s* return 'end';\n\n\"_self\" return 'LINK_TARGET';\n\"_blank\" return 'LINK_TARGET';\n\"_parent\" return 'LINK_TARGET';\n\"_top\" return 'LINK_TARGET';\n\n<dir>(\\r?\\n)*\\s*\\n { this.popState(); return 'NODIR'; }\n<dir>\\s*\"LR\" { this.popState(); return 'DIR'; }\n<dir>\\s*\"RL\" { this.popState(); return 'DIR'; }\n<dir>\\s*\"TB\" { thisLine truncated
|
|
||||||
File diff suppressed because it is too large.
Load diff
@@ -1 +0,0 @@
|
|||||||
{"version":3,"file":"add-html-label-ce7f9292.js","sources":["../src/diagrams/flowchart/parser/flow.jison","../src/diagrams/flowchart/flowDb.js","../../../node_modules/.pnpm/dagre-d3-es@7.0.9/node_modules/dagre-d3-es/src/dagre-js/util.js","../../../node_modules/.pnpm/dagre-d3-es@7.0.9/node_modules/dagre-d3-es/src/dagre-js/label/add-html-label.js"],"sourcesContent":["/** mermaid\n * https://mermaidjs.github.io/\n * (c) 2015 Knut Sveidqvist\n * MIT license.\n */\n\n/* lexical grammar */\n%lex\n%x string\n%x acc_title\n%x acc_descr\n%x acc_descr_multiline\n%x dir\n%x vertex\n%x click\n%x href\n%x callbackname\n%x callbackargs\n%x open_directive\n%x type_directive\n%x arg_directive\n%x close_directive\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 */\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// <acc_descr_multiline>.*[^\\n]* { return \"acc_descr_line\"}\n[\"] this.begin(\"string\");\n<string>[\"] this.popState();\n<string>[^\"]* return \"STR\";\n\"style\" return 'STYLE';\n\"default\" return 'DEFAULT';\n\"linkStyle\" return 'LINKSTYLE';\n\"interpolate\" return 'INTERPOLATE';\n\"classDef\" return 'CLASSDEF';\n\"class\" return 'CLASS';\n\n/*\n---interactivity command---\n'href' adds a link to the specified node. 'href' can only be specified when the\nline was introduced with 'click'.\n'href \"<link>\"' attaches the specified link to the node that was specified by 'click'.\n*/\n\"href\"[\\s]+[\"] this.begin(\"href\");\n<href>[\"] this.popState();\n<href>[^\"]* return 'HREF';\n\n/*\n---interactivity command---\n'call' adds a callback to the specified node. 'call' can only be specified when\nthe line was introduced with 'click'.\n'call <callbackname>(<args>)' attaches the function 'callbackname' with the specified\narguments to the node that was specified by 'click'.\nFunction arguments are optional: 'call <callbackname>()' simply executes 'callbackname' without any arguments.\n*/\n\"call\"[\\s]+ this.begin(\"callbackname\");\n<callbackname>\\([\\s]*\\) this.popState();\n<callbackname>\\( this.popState(); this.begin(\"callbackargs\");\n<callbackname>[^(]* return 'CALLBACKNAME';\n<callbackargs>\\) this.popState();\n<callbackargs>[^)]* return 'CALLBACKARGS';\n\n/*\n'click' is the keyword to introduce a line that contains interactivity commands.\n'click' must be followed by an existing node-id. All commands are attached to\nthat id.\n'click <id>' can be followed by href or call commands in any desired order\n*/\n\"click\"[\\s]+ this.begin(\"click\");\n<click>[\\s\\n] this.popState();\n<click>[^\\s\\n]* return 'CLICK';\n\n\"flowchart-elk\" {if(yy.lex.firstGraph()){this.begin(\"dir\");} return 'GRAPH';}\n\"graph\" {if(yy.lex.firstGraph()){this.begin(\"dir\");} return 'GRAPH';}\n\"flowchart\" {if(yy.lex.firstGraph()){this.begin(\"dir\");} return 'GRAPH';}\n\"subgraph\" return 'subgraph';\n\"end\"\\b\\s* return 'end';\n\n\"_self\" return 'LINK_TARGET';\n\"_blank\" return 'LINK_TARGET';\n\"_parent\" return 'LINK_TARGET';\n\"_top\" return 'LINK_TARGET';\n\n<dir>(\\r?\\n)*\\s*\\n { this.popState(); return 'NODIR'; }\n<dir>\\s*\"LR\" { this.popState(); return 'DIR'; }\n<dir>\\s*\"RL\" { this.popState(); return 'DIR'; }\n<dir>\\s*\"TB\" { thisLine truncated
|
|
||||||
File diff suppressed because it is too large.
Load diff
@@ -1 +0,0 @@
|
|||||||
{"version":3,"file":"add-html-label-f3a0bd34.js","sources":["../src/diagrams/flowchart/parser/flow.jison","../src/diagrams/flowchart/flowDb.js","../../../node_modules/.pnpm/dagre-d3-es@7.0.9/node_modules/dagre-d3-es/src/dagre-js/util.js","../../../node_modules/.pnpm/dagre-d3-es@7.0.9/node_modules/dagre-d3-es/src/dagre-js/label/add-html-label.js"],"sourcesContent":["/** mermaid\n * https://mermaidjs.github.io/\n * (c) 2015 Knut Sveidqvist\n * MIT license.\n */\n\n/* lexical grammar */\n%lex\n%x string\n%x acc_title\n%x acc_descr\n%x acc_descr_multiline\n%x dir\n%x vertex\n%x click\n%x href\n%x callbackname\n%x callbackargs\n%x open_directive\n%x type_directive\n%x arg_directive\n%x close_directive\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 */\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// <acc_descr_multiline>.*[^\\n]* { return \"acc_descr_line\"}\n[\"] this.begin(\"string\");\n<string>[\"] this.popState();\n<string>[^\"]* return \"STR\";\n\"style\" return 'STYLE';\n\"default\" return 'DEFAULT';\n\"linkStyle\" return 'LINKSTYLE';\n\"interpolate\" return 'INTERPOLATE';\n\"classDef\" return 'CLASSDEF';\n\"class\" return 'CLASS';\n\n/*\n---interactivity command---\n'href' adds a link to the specified node. 'href' can only be specified when the\nline was introduced with 'click'.\n'href \"<link>\"' attaches the specified link to the node that was specified by 'click'.\n*/\n\"href\"[\\s]+[\"] this.begin(\"href\");\n<href>[\"] this.popState();\n<href>[^\"]* return 'HREF';\n\n/*\n---interactivity command---\n'call' adds a callback to the specified node. 'call' can only be specified when\nthe line was introduced with 'click'.\n'call <callbackname>(<args>)' attaches the function 'callbackname' with the specified\narguments to the node that was specified by 'click'.\nFunction arguments are optional: 'call <callbackname>()' simply executes 'callbackname' without any arguments.\n*/\n\"call\"[\\s]+ this.begin(\"callbackname\");\n<callbackname>\\([\\s]*\\) this.popState();\n<callbackname>\\( this.popState(); this.begin(\"callbackargs\");\n<callbackname>[^(]* return 'CALLBACKNAME';\n<callbackargs>\\) this.popState();\n<callbackargs>[^)]* return 'CALLBACKARGS';\n\n/*\n'click' is the keyword to introduce a line that contains interactivity commands.\n'click' must be followed by an existing node-id. All commands are attached to\nthat id.\n'click <id>' can be followed by href or call commands in any desired order\n*/\n\"click\"[\\s]+ this.begin(\"click\");\n<click>[\\s\\n] this.popState();\n<click>[^\\s\\n]* return 'CLICK';\n\n\"flowchart-elk\" {if(yy.lex.firstGraph()){this.begin(\"dir\");} return 'GRAPH';}\n\"graph\" {if(yy.lex.firstGraph()){this.begin(\"dir\");} return 'GRAPH';}\n\"flowchart\" {if(yy.lex.firstGraph()){this.begin(\"dir\");} return 'GRAPH';}\n\"subgraph\" return 'subgraph';\n\"end\"\\b\\s* return 'end';\n\n\"_self\" return 'LINK_TARGET';\n\"_blank\" return 'LINK_TARGET';\n\"_parent\" return 'LINK_TARGET';\n\"_top\" return 'LINK_TARGET';\n\n<dir>(\\r?\\n)*\\s*\\n { this.popState(); return 'NODIR'; }\n<dir>\\s*\"LR\" { this.popState(); return 'DIR'; }\n<dir>\\s*\"RL\" { this.popState(); return 'DIR'; }\n<dir>\\s*\"TB\" { thisLine truncated
|
|
||||||
@@ -1,85 +0,0 @@
|
|||||||
import { c as Q, p as sn } from "./constant-2fe7eae5.js";
|
|
||||||
import { J as en, K as X, N as I, O as rn, P as y, I as ln, Q as z, R as b, T as un, V as t, W as an, X as on, Y as tn } from "./utils-aa888deb.js";
|
|
||||||
function fn(l) {
|
|
||||||
return l.innerRadius;
|
|
||||||
}
|
|
||||||
function cn(l) {
|
|
||||||
return l.outerRadius;
|
|
||||||
}
|
|
||||||
function yn(l) {
|
|
||||||
return l.startAngle;
|
|
||||||
}
|
|
||||||
function gn(l) {
|
|
||||||
return l.endAngle;
|
|
||||||
}
|
|
||||||
function mn(l) {
|
|
||||||
return l && l.padAngle;
|
|
||||||
}
|
|
||||||
function pn(l, x, w, O, h, v, S, r) {
|
|
||||||
var s = w - l, n = O - x, m = S - h, i = r - v, u = i * s - m * n;
|
|
||||||
if (!(u * u < y))
|
|
||||||
return u = (m * (x - v) - i * (l - h)) / u, [l + u * s, x + u * n];
|
|
||||||
}
|
|
||||||
function H(l, x, w, O, h, v, S) {
|
|
||||||
var r = l - w, s = x - O, n = (S ? v : -v) / z(r * r + s * s), m = n * s, i = -n * r, u = l + m, f = x + i, c = w + m, D = O + i, o = (u + c) / 2, E = (f + D) / 2, p = c - u, g = D - f, R = p * p + g * g, J = h - v, P = u * D - c * f, K = (g < 0 ? -1 : 1) * z(tn(0, J * J * R - P * P)), N = (P * g - p * K) / R, d = (-P * p - g * K) / R, A = (P * g + p * K) / R, T = (-P * p + g * K) / R, e = N - o, a = d - E, V = A - o, W = T - E;
|
|
||||||
return e * e + a * a > V * V + W * W && (N = A, d = T), {
|
|
||||||
cx: N,
|
|
||||||
cy: d,
|
|
||||||
x01: -m,
|
|
||||||
y01: -i,
|
|
||||||
x11: N * (h / J - 1),
|
|
||||||
y11: d * (h / J - 1)
|
|
||||||
};
|
|
||||||
}
|
|
||||||
function hn() {
|
|
||||||
var l = fn, x = cn, w = Q(0), O = null, h = yn, v = gn, S = mn, r = null;
|
|
||||||
function s() {
|
|
||||||
var n, m, i = +l.apply(this, arguments), u = +x.apply(this, arguments), f = h.apply(this, arguments) - rn, c = v.apply(this, arguments) - rn, D = un(c - f), o = c > f;
|
|
||||||
if (r || (r = n = sn()), u < i && (m = u, u = i, i = m), !(u > y))
|
|
||||||
r.moveTo(0, 0);
|
|
||||||
else if (D > ln - y)
|
|
||||||
r.moveTo(u * X(f), u * I(f)), r.arc(0, 0, u, f, c, !o), i > y && (r.moveTo(i * X(c), i * I(c)), r.arc(0, 0, i, c, f, o));
|
|
||||||
else {
|
|
||||||
var E = f, p = c, g = f, R = c, J = D, P = D, K = S.apply(this, arguments) / 2, N = K > y && (O ? +O.apply(this, arguments) : z(i * i + u * u)), d = b(un(u - i) / 2, +w.apply(this, arguments)), A = d, T = d, e, a;
|
|
||||||
if (N > y) {
|
|
||||||
var V = an(N / i * I(K)), W = an(N / u * I(K));
|
|
||||||
(J -= V * 2) > y ? (V *= o ? 1 : -1, g += V, R -= V) : (J = 0, g = R = (f + c) / 2), (P -= W * 2) > y ? (W *= o ? 1 : -1, E += W, p -= W) : (P = 0, E = p = (f + c) / 2);
|
|
||||||
}
|
|
||||||
var Y = u * X(E), j = u * I(E), B = i * X(R), C = i * I(R);
|
|
||||||
if (d > y) {
|
|
||||||
var F = u * X(p), G = u * I(p), L = i * X(g), M = i * I(g), q;
|
|
||||||
if (D < en && (q = pn(Y, j, L, M, F, G, B, C))) {
|
|
||||||
var U = Y - q[0], Z = j - q[1], $ = F - q[0], k = G - q[1], _ = 1 / I(on((U * $ + Z * k) / (z(U * U + Z * Z) * z($ * $ + k * k))) / 2), nn = z(q[0] * q[0] + q[1] * q[1]);
|
|
||||||
A = b(d, (i - nn) / (_ - 1)), T = b(d, (u - nn) / (_ + 1));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
P > y ? T > y ? (e = H(L, M, Y, j, u, T, o), a = H(F, G, B, C, u, T, o), r.moveTo(e.cx + e.x01, e.cy + e.y01), T < d ? r.arc(e.cx, e.cy, T, t(e.y01, e.x01), t(a.y01, a.x01), !o) : (r.arc(e.cx, e.cy, T, t(e.y01, e.x01), t(e.y11, e.x11), !o), r.arc(0, 0, u, t(e.cy + e.y11, e.cx + e.x11), t(a.cy + a.y11, a.cx + a.x11), !o), r.arc(a.cx, a.cy, T, t(a.y11, a.x11), t(a.y01, a.x01), !o))) : (r.moveTo(Y, j), r.arc(0, 0, u, E, p, !o)) : r.moveTo(Y, j), !(i > y) || !(J > y) ? r.lineTo(B, C) : A > y ? (e = H(B, C, F, G, i, -A, o), a = H(Y, j, L, M, i, -A, o), r.lineTo(e.cx + e.x01, e.cy + e.y01), A < d ? r.arc(e.cx, e.cy, A, t(e.y01, e.x01), t(a.y01, a.x01), !o) : (r.arc(e.cx, e.cy, A, t(e.y01, e.x01), t(e.y11, e.x11), !o), r.arc(0, 0, i, t(e.cy + e.y11, e.cx + e.x11), t(a.cy + a.y11, a.cx + a.x11), o), r.arc(a.cx, a.cy, A, t(a.y11, a.x11), t(a.y01, a.x01), !o))) : r.arc(0, 0, i, R, g, o);
|
|
||||||
}
|
|
||||||
if (r.closePath(), n)
|
|
||||||
return r = null, n + "" || null;
|
|
||||||
}
|
|
||||||
return s.centroid = function() {
|
|
||||||
var n = (+l.apply(this, arguments) + +x.apply(this, arguments)) / 2, m = (+h.apply(this, arguments) + +v.apply(this, arguments)) / 2 - en / 2;
|
|
||||||
return [X(m) * n, I(m) * n];
|
|
||||||
}, s.innerRadius = function(n) {
|
|
||||||
return arguments.length ? (l = typeof n == "function" ? n : Q(+n), s) : l;
|
|
||||||
}, s.outerRadius = function(n) {
|
|
||||||
return arguments.length ? (x = typeof n == "function" ? n : Q(+n), s) : x;
|
|
||||||
}, s.cornerRadius = function(n) {
|
|
||||||
return arguments.length ? (w = typeof n == "function" ? n : Q(+n), s) : w;
|
|
||||||
}, s.padRadius = function(n) {
|
|
||||||
return arguments.length ? (O = n == null ? null : typeof n == "function" ? n : Q(+n), s) : O;
|
|
||||||
}, s.startAngle = function(n) {
|
|
||||||
return arguments.length ? (h = typeof n == "function" ? n : Q(+n), s) : h;
|
|
||||||
}, s.endAngle = function(n) {
|
|
||||||
return arguments.length ? (v = typeof n == "function" ? n : Q(+n), s) : v;
|
|
||||||
}, s.padAngle = function(n) {
|
|
||||||
return arguments.length ? (S = typeof n == "function" ? n : Q(+n), s) : S;
|
|
||||||
}, s.context = function(n) {
|
|
||||||
return arguments.length ? (r = n ?? null, s) : r;
|
|
||||||
}, s;
|
|
||||||
}
|
|
||||||
export {
|
|
||||||
hn as d
|
|
||||||
};
|
|
||||||
//# sourceMappingURL=arc-1bd4335b.js.map
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
{"version":3,"file":"arc-1bd4335b.js","sources":["../../../node_modules/.pnpm/d3-shape@3.1.0/node_modules/d3-shape/src/arc.js"],"sourcesContent":["import {path} from \"d3-path\";\nimport constant from \"./constant.js\";\nimport {abs, acos, asin, atan2, cos, epsilon, halfPi, max, min, pi, sin, sqrt, tau} from \"./math.js\";\n\nfunction arcInnerRadius(d) {\n return d.innerRadius;\n}\n\nfunction arcOuterRadius(d) {\n return d.outerRadius;\n}\n\nfunction arcStartAngle(d) {\n return d.startAngle;\n}\n\nfunction arcEndAngle(d) {\n return d.endAngle;\n}\n\nfunction arcPadAngle(d) {\n return d && d.padAngle; // Note: optional!\n}\n\nfunction intersect(x0, y0, x1, y1, x2, y2, x3, y3) {\n var x10 = x1 - x0, y10 = y1 - y0,\n x32 = x3 - x2, y32 = y3 - y2,\n t = y32 * x10 - x32 * y10;\n if (t * t < epsilon) return;\n t = (x32 * (y0 - y2) - y32 * (x0 - x2)) / t;\n return [x0 + t * x10, y0 + t * y10];\n}\n\n// Compute perpendicular offset line of length rc.\n// http://mathworld.wolfram.com/Circle-LineIntersection.html\nfunction cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n var x01 = x0 - x1,\n y01 = y0 - y1,\n lo = (cw ? rc : -rc) / sqrt(x01 * x01 + y01 * y01),\n ox = lo * y01,\n oy = -lo * x01,\n x11 = x0 + ox,\n y11 = y0 + oy,\n x10 = x1 + ox,\n y10 = y1 + oy,\n x00 = (x11 + x10) / 2,\n y00 = (y11 + y10) / 2,\n dx = x10 - x11,\n dy = y10 - y11,\n d2 = dx * dx + dy * dy,\n r = r1 - rc,\n D = x11 * y10 - x10 * y11,\n d = (dy < 0 ? -1 : 1) * sqrt(max(0, r * r * d2 - D * D)),\n cx0 = (D * dy - dx * d) / d2,\n cy0 = (-D * dx - dy * d) / d2,\n cx1 = (D * dy + dx * d) / d2,\n cy1 = (-D * dx + dy * d) / d2,\n dx0 = cx0 - x00,\n dy0 = cy0 - y00,\n dx1 = cx1 - x00,\n dy1 = cy1 - y00;\n\n // Pick the closer of the two intersection points.\n // TODO Is there a faster way to determine which intersection to use?\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\n return {\n cx: cx0,\n cy: cy0,\n x01: -ox,\n y01: -oy,\n x11: cx0 * (r1 / r - 1),\n y11: cy0 * (r1 / r - 1)\n };\n}\n\nexport default function() {\n var innerRadius = arcInnerRadius,\n outerRadius = arcOuterRadius,\n cornerRadius = constant(0),\n padRadius = null,\n startAngle = arcStartAngle,\n endAngle = arcEndAngle,\n padAngle = arcPadAngle,\n context = null;\n\n function arc() {\n var buffer,\n r,\n r0 = +innerRadius.apply(this, arguments),\n r1 = +outerRadius.apply(this, arguments),\n a0 = startAngle.apply(this, arguments) - halfPi,\n a1 = endAngle.apply(this, arguments) - halfPi,\n da = abs(a1 - a0),\n cw = a1 > a0;\n\n if (!context) context = buffer = path();\n\n // Ensure that the outer radius is always larger than the inner radius.\n if (r1 < r0) r = r1, r1 = r0, r0 = r;\n\n // Is it a point?\n if (!(r1 > epsilon)) context.moveTo(0, 0);\n\n // Or is it a circle or annulus?\n else if (da > tau - epsilon) {\n context.moveTo(r1 * cos(a0), r1 * sin(a0));\n context.arc(0, 0, r1, a0, a1, !cw);\n if (r0 > epsilon) {\n context.moveTo(r0 * cos(a1), r0 * sin(a1));\n context.arc(0, 0, r0, a1, a0, cw);\n }\n }\n\n // Or is it a circular or annular sector?\n else {\n var a01 = a0,\n a11 = a1,\n a00 = a0,\n a10 = a1,\n da0 = da,\n da1 = da,\n ap = padAngle.apply(this, arguments) / 2,\n rp = (ap > epsilon) && (padRadius ? +padRadius.apply(this, arguments) : sqrt(r0 * r0 + r1 * r1)),\n rc = min(abs(r1 - r0) / 2, +cornerRadius.apply(this, arguments)),\n rc0 = rc,\n rc1 = rc,\n t0,\n t1;\n\n // Apply padding? Note that since r1 ≥ r0, da1 ≥ da0.\n if (rp > epsilon) {\n var p0 = asin(rp / r0 * sin(ap)),\n p1 = asin(rp / r1 * sin(ap));\n if ((da0 -= p0 * 2) > epsilon) p0 *= (cw ? 1 : -1), a00 += p0, a10 -= p0;\n else da0 = 0, a00 = a10 = (a0 + a1) / 2;\n if ((da1 -= p1 * 2) > epsilon) p1 *= (cw ? 1 : -1), a01 += p1, a11 -= p1;\n else da1 = 0, a01 = a11 = (a0 + a1) / 2;\n }\n\n var x01 = r1 * cos(a01),\n y01 = r1 * sin(a01),\n x10 = r0 * cos(a10),\n y10 = r0 * sin(a10);\n\n // Apply rounded corners?\n if (rc > epsilon) {\n var x11 = r1 * cos(a11),\n y11 = r1 * sin(a11),\n x00 = r0 * cos(a00),\n y00 = r0 * sin(a00),\n oc;\n\n // Restrict the corner radius according to the sector angle.\n if (da < pi && (oc = intersect(x01, y01, x00, y00, x11, y11, x10, y10))) {\n var ax = x01 - oc[0],\n ay = y01 - oc[1],\n bx = x11 - oc[0],\n by = y11 - oc[1],\n kc = 1 / sin(acos((ax * bx + ay * by) / (sqrt(ax * ax + ay * ay) *Line truncated
|
|
||||||
@@ -1,145 +0,0 @@
|
|||||||
import { c as constant, p as path } from "./constant-b644328d.js";
|
|
||||||
import { J as pi, K as cos, N as sin, O as halfPi, P as epsilon, I as tau, Q as sqrt, R as min, T as abs, V as atan2, W as asin, X as acos, Y as max } from "./utils-872dfc50.js";
|
|
||||||
function arcInnerRadius(d) {
|
|
||||||
return d.innerRadius;
|
|
||||||
}
|
|
||||||
function arcOuterRadius(d) {
|
|
||||||
return d.outerRadius;
|
|
||||||
}
|
|
||||||
function arcStartAngle(d) {
|
|
||||||
return d.startAngle;
|
|
||||||
}
|
|
||||||
function arcEndAngle(d) {
|
|
||||||
return d.endAngle;
|
|
||||||
}
|
|
||||||
function arcPadAngle(d) {
|
|
||||||
return d && d.padAngle;
|
|
||||||
}
|
|
||||||
function intersect(x0, y0, x1, y1, x2, y2, x3, y3) {
|
|
||||||
var x10 = x1 - x0, y10 = y1 - y0, x32 = x3 - x2, y32 = y3 - y2, t = y32 * x10 - x32 * y10;
|
|
||||||
if (t * t < epsilon)
|
|
||||||
return;
|
|
||||||
t = (x32 * (y0 - y2) - y32 * (x0 - x2)) / t;
|
|
||||||
return [x0 + t * x10, y0 + t * y10];
|
|
||||||
}
|
|
||||||
function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {
|
|
||||||
var x01 = x0 - x1, y01 = y0 - y1, lo = (cw ? rc : -rc) / sqrt(x01 * x01 + y01 * y01), ox = lo * y01, oy = -lo * x01, x11 = x0 + ox, y11 = y0 + oy, x10 = x1 + ox, y10 = y1 + oy, x00 = (x11 + x10) / 2, y00 = (y11 + y10) / 2, dx = x10 - x11, dy = y10 - y11, d2 = dx * dx + dy * dy, r = r1 - rc, D = x11 * y10 - x10 * y11, d = (dy < 0 ? -1 : 1) * sqrt(max(0, r * r * d2 - D * D)), cx0 = (D * dy - dx * d) / d2, cy0 = (-D * dx - dy * d) / d2, cx1 = (D * dy + dx * d) / d2, cy1 = (-D * dx + dy * d) / d2, dx0 = cx0 - x00, dy0 = cy0 - y00, dx1 = cx1 - x00, dy1 = cy1 - y00;
|
|
||||||
if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1)
|
|
||||||
cx0 = cx1, cy0 = cy1;
|
|
||||||
return {
|
|
||||||
cx: cx0,
|
|
||||||
cy: cy0,
|
|
||||||
x01: -ox,
|
|
||||||
y01: -oy,
|
|
||||||
x11: cx0 * (r1 / r - 1),
|
|
||||||
y11: cy0 * (r1 / r - 1)
|
|
||||||
};
|
|
||||||
}
|
|
||||||
function d3arc() {
|
|
||||||
var innerRadius = arcInnerRadius, outerRadius = arcOuterRadius, cornerRadius = constant(0), padRadius = null, startAngle = arcStartAngle, endAngle = arcEndAngle, padAngle = arcPadAngle, context = null;
|
|
||||||
function arc() {
|
|
||||||
var buffer, r, r0 = +innerRadius.apply(this, arguments), r1 = +outerRadius.apply(this, arguments), a0 = startAngle.apply(this, arguments) - halfPi, a1 = endAngle.apply(this, arguments) - halfPi, da = abs(a1 - a0), cw = a1 > a0;
|
|
||||||
if (!context)
|
|
||||||
context = buffer = path();
|
|
||||||
if (r1 < r0)
|
|
||||||
r = r1, r1 = r0, r0 = r;
|
|
||||||
if (!(r1 > epsilon))
|
|
||||||
context.moveTo(0, 0);
|
|
||||||
else if (da > tau - epsilon) {
|
|
||||||
context.moveTo(r1 * cos(a0), r1 * sin(a0));
|
|
||||||
context.arc(0, 0, r1, a0, a1, !cw);
|
|
||||||
if (r0 > epsilon) {
|
|
||||||
context.moveTo(r0 * cos(a1), r0 * sin(a1));
|
|
||||||
context.arc(0, 0, r0, a1, a0, cw);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
var a01 = a0, a11 = a1, a00 = a0, a10 = a1, da0 = da, da1 = da, ap = padAngle.apply(this, arguments) / 2, rp = ap > epsilon && (padRadius ? +padRadius.apply(this, arguments) : sqrt(r0 * r0 + r1 * r1)), rc = min(abs(r1 - r0) / 2, +cornerRadius.apply(this, arguments)), rc0 = rc, rc1 = rc, t0, t1;
|
|
||||||
if (rp > epsilon) {
|
|
||||||
var p0 = asin(rp / r0 * sin(ap)), p1 = asin(rp / r1 * sin(ap));
|
|
||||||
if ((da0 -= p0 * 2) > epsilon)
|
|
||||||
p0 *= cw ? 1 : -1, a00 += p0, a10 -= p0;
|
|
||||||
else
|
|
||||||
da0 = 0, a00 = a10 = (a0 + a1) / 2;
|
|
||||||
if ((da1 -= p1 * 2) > epsilon)
|
|
||||||
p1 *= cw ? 1 : -1, a01 += p1, a11 -= p1;
|
|
||||||
else
|
|
||||||
da1 = 0, a01 = a11 = (a0 + a1) / 2;
|
|
||||||
}
|
|
||||||
var x01 = r1 * cos(a01), y01 = r1 * sin(a01), x10 = r0 * cos(a10), y10 = r0 * sin(a10);
|
|
||||||
if (rc > epsilon) {
|
|
||||||
var x11 = r1 * cos(a11), y11 = r1 * sin(a11), x00 = r0 * cos(a00), y00 = r0 * sin(a00), oc;
|
|
||||||
if (da < pi && (oc = intersect(x01, y01, x00, y00, x11, y11, x10, y10))) {
|
|
||||||
var ax = x01 - oc[0], ay = y01 - oc[1], bx = x11 - oc[0], by = y11 - oc[1], kc = 1 / sin(acos((ax * bx + ay * by) / (sqrt(ax * ax + ay * ay) * sqrt(bx * bx + by * by))) / 2), lc = sqrt(oc[0] * oc[0] + oc[1] * oc[1]);
|
|
||||||
rc0 = min(rc, (r0 - lc) / (kc - 1));
|
|
||||||
rc1 = min(rc, (r1 - lc) / (kc + 1));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!(da1 > epsilon))
|
|
||||||
context.moveTo(x01, y01);
|
|
||||||
else if (rc1 > epsilon) {
|
|
||||||
t0 = cornerTangents(x00, y00, x01, y01, r1, rc1, cw);
|
|
||||||
t1 = cornerTangents(x11, y11, x10, y10, r1, rc1, cw);
|
|
||||||
context.moveTo(t0.cx + t0.x01, t0.cy + t0.y01);
|
|
||||||
if (rc1 < rc)
|
|
||||||
context.arc(t0.cx, t0.cy, rc1, atan2(t0.y01, t0.x01), atan2(t1.y01, t1.x01), !cw);
|
|
||||||
else {
|
|
||||||
context.arc(t0.cx, t0.cy, rc1, atan2(t0.y01, t0.x01), atan2(t0.y11, t0.x11), !cw);
|
|
||||||
context.arc(0, 0, r1, atan2(t0.cy + t0.y11, t0.cx + t0.x11), atan2(t1.cy + t1.y11, t1.cx + t1.x11), !cw);
|
|
||||||
context.arc(t1.cx, t1.cy, rc1, atan2(t1.y11, t1.x11), atan2(t1.y01, t1.x01), !cw);
|
|
||||||
}
|
|
||||||
} else
|
|
||||||
context.moveTo(x01, y01), context.arc(0, 0, r1, a01, a11, !cw);
|
|
||||||
if (!(r0 > epsilon) || !(da0 > epsilon))
|
|
||||||
context.lineTo(x10, y10);
|
|
||||||
else if (rc0 > epsilon) {
|
|
||||||
t0 = cornerTangents(x10, y10, x11, y11, r0, -rc0, cw);
|
|
||||||
t1 = cornerTangents(x01, y01, x00, y00, r0, -rc0, cw);
|
|
||||||
context.lineTo(t0.cx + t0.x01, t0.cy + t0.y01);
|
|
||||||
if (rc0 < rc)
|
|
||||||
context.arc(t0.cx, t0.cy, rc0, atan2(t0.y01, t0.x01), atan2(t1.y01, t1.x01), !cw);
|
|
||||||
else {
|
|
||||||
context.arc(t0.cx, t0.cy, rc0, atan2(t0.y01, t0.x01), atan2(t0.y11, t0.x11), !cw);
|
|
||||||
context.arc(0, 0, r0, atan2(t0.cy + t0.y11, t0.cx + t0.x11), atan2(t1.cy + t1.y11, t1.cx + t1.x11), cw);
|
|
||||||
context.arc(t1.cx, t1.cy, rc0, atan2(t1.y11, t1.x11), atan2(t1.y01, t1.x01), !cw);
|
|
||||||
}
|
|
||||||
} else
|
|
||||||
context.arc(0, 0, r0, a10, a00, cw);
|
|
||||||
}
|
|
||||||
context.closePath();
|
|
||||||
if (buffer)
|
|
||||||
return context = null, buffer + "" || null;
|
|
||||||
}
|
|
||||||
arc.centroid = function() {
|
|
||||||
var r = (+innerRadius.apply(this, arguments) + +outerRadius.apply(this, arguments)) / 2, a = (+startAngle.apply(this, arguments) + +endAngle.apply(this, arguments)) / 2 - pi / 2;
|
|
||||||
return [cos(a) * r, sin(a) * r];
|
|
||||||
};
|
|
||||||
arc.innerRadius = function(_) {
|
|
||||||
return arguments.length ? (innerRadius = typeof _ === "function" ? _ : constant(+_), arc) : innerRadius;
|
|
||||||
};
|
|
||||||
arc.outerRadius = function(_) {
|
|
||||||
return arguments.length ? (outerRadius = typeof _ === "function" ? _ : constant(+_), arc) : outerRadius;
|
|
||||||
};
|
|
||||||
arc.cornerRadius = function(_) {
|
|
||||||
return arguments.length ? (cornerRadius = typeof _ === "function" ? _ : constant(+_), arc) : cornerRadius;
|
|
||||||
};
|
|
||||||
arc.padRadius = function(_) {
|
|
||||||
return arguments.length ? (padRadius = _ == null ? null : typeof _ === "function" ? _ : constant(+_), arc) : padRadius;
|
|
||||||
};
|
|
||||||
arc.startAngle = function(_) {
|
|
||||||
return arguments.length ? (startAngle = typeof _ === "function" ? _ : constant(+_), arc) : startAngle;
|
|
||||||
};
|
|
||||||
arc.endAngle = function(_) {
|
|
||||||
return arguments.length ? (endAngle = typeof _ === "function" ? _ : constant(+_), arc) : endAngle;
|
|
||||||
};
|
|
||||||
arc.padAngle = function(_) {
|
|
||||||
return arguments.length ? (padAngle = typeof _ === "function" ? _ : constant(+_), arc) : padAngle;
|
|
||||||
};
|
|
||||||
arc.context = function(_) {
|
|
||||||
return arguments.length ? (context = _ == null ? null : _, arc) : context;
|
|
||||||
};
|
|
||||||
return arc;
|
|
||||||
}
|
|
||||||
export {
|
|
||||||
d3arc as d
|
|
||||||
};
|
|
||||||
//# sourceMappingURL=arc-7c943a40.js.map
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
{"version":3,"file":"arc-7c943a40.js","sources":["../../../node_modules/.pnpm/d3-shape@3.1.0/node_modules/d3-shape/src/arc.js"],"sourcesContent":["import {path} from \"d3-path\";\nimport constant from \"./constant.js\";\nimport {abs, acos, asin, atan2, cos, epsilon, halfPi, max, min, pi, sin, sqrt, tau} from \"./math.js\";\n\nfunction arcInnerRadius(d) {\n return d.innerRadius;\n}\n\nfunction arcOuterRadius(d) {\n return d.outerRadius;\n}\n\nfunction arcStartAngle(d) {\n return d.startAngle;\n}\n\nfunction arcEndAngle(d) {\n return d.endAngle;\n}\n\nfunction arcPadAngle(d) {\n return d && d.padAngle; // Note: optional!\n}\n\nfunction intersect(x0, y0, x1, y1, x2, y2, x3, y3) {\n var x10 = x1 - x0, y10 = y1 - y0,\n x32 = x3 - x2, y32 = y3 - y2,\n t = y32 * x10 - x32 * y10;\n if (t * t < epsilon) return;\n t = (x32 * (y0 - y2) - y32 * (x0 - x2)) / t;\n return [x0 + t * x10, y0 + t * y10];\n}\n\n// Compute perpendicular offset line of length rc.\n// http://mathworld.wolfram.com/Circle-LineIntersection.html\nfunction cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n var x01 = x0 - x1,\n y01 = y0 - y1,\n lo = (cw ? rc : -rc) / sqrt(x01 * x01 + y01 * y01),\n ox = lo * y01,\n oy = -lo * x01,\n x11 = x0 + ox,\n y11 = y0 + oy,\n x10 = x1 + ox,\n y10 = y1 + oy,\n x00 = (x11 + x10) / 2,\n y00 = (y11 + y10) / 2,\n dx = x10 - x11,\n dy = y10 - y11,\n d2 = dx * dx + dy * dy,\n r = r1 - rc,\n D = x11 * y10 - x10 * y11,\n d = (dy < 0 ? -1 : 1) * sqrt(max(0, r * r * d2 - D * D)),\n cx0 = (D * dy - dx * d) / d2,\n cy0 = (-D * dx - dy * d) / d2,\n cx1 = (D * dy + dx * d) / d2,\n cy1 = (-D * dx + dy * d) / d2,\n dx0 = cx0 - x00,\n dy0 = cy0 - y00,\n dx1 = cx1 - x00,\n dy1 = cy1 - y00;\n\n // Pick the closer of the two intersection points.\n // TODO Is there a faster way to determine which intersection to use?\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\n return {\n cx: cx0,\n cy: cy0,\n x01: -ox,\n y01: -oy,\n x11: cx0 * (r1 / r - 1),\n y11: cy0 * (r1 / r - 1)\n };\n}\n\nexport default function() {\n var innerRadius = arcInnerRadius,\n outerRadius = arcOuterRadius,\n cornerRadius = constant(0),\n padRadius = null,\n startAngle = arcStartAngle,\n endAngle = arcEndAngle,\n padAngle = arcPadAngle,\n context = null;\n\n function arc() {\n var buffer,\n r,\n r0 = +innerRadius.apply(this, arguments),\n r1 = +outerRadius.apply(this, arguments),\n a0 = startAngle.apply(this, arguments) - halfPi,\n a1 = endAngle.apply(this, arguments) - halfPi,\n da = abs(a1 - a0),\n cw = a1 > a0;\n\n if (!context) context = buffer = path();\n\n // Ensure that the outer radius is always larger than the inner radius.\n if (r1 < r0) r = r1, r1 = r0, r0 = r;\n\n // Is it a point?\n if (!(r1 > epsilon)) context.moveTo(0, 0);\n\n // Or is it a circle or annulus?\n else if (da > tau - epsilon) {\n context.moveTo(r1 * cos(a0), r1 * sin(a0));\n context.arc(0, 0, r1, a0, a1, !cw);\n if (r0 > epsilon) {\n context.moveTo(r0 * cos(a1), r0 * sin(a1));\n context.arc(0, 0, r0, a1, a0, cw);\n }\n }\n\n // Or is it a circular or annular sector?\n else {\n var a01 = a0,\n a11 = a1,\n a00 = a0,\n a10 = a1,\n da0 = da,\n da1 = da,\n ap = padAngle.apply(this, arguments) / 2,\n rp = (ap > epsilon) && (padRadius ? +padRadius.apply(this, arguments) : sqrt(r0 * r0 + r1 * r1)),\n rc = min(abs(r1 - r0) / 2, +cornerRadius.apply(this, arguments)),\n rc0 = rc,\n rc1 = rc,\n t0,\n t1;\n\n // Apply padding? Note that since r1 ≥ r0, da1 ≥ da0.\n if (rp > epsilon) {\n var p0 = asin(rp / r0 * sin(ap)),\n p1 = asin(rp / r1 * sin(ap));\n if ((da0 -= p0 * 2) > epsilon) p0 *= (cw ? 1 : -1), a00 += p0, a10 -= p0;\n else da0 = 0, a00 = a10 = (a0 + a1) / 2;\n if ((da1 -= p1 * 2) > epsilon) p1 *= (cw ? 1 : -1), a01 += p1, a11 -= p1;\n else da1 = 0, a01 = a11 = (a0 + a1) / 2;\n }\n\n var x01 = r1 * cos(a01),\n y01 = r1 * sin(a01),\n x10 = r0 * cos(a10),\n y10 = r0 * sin(a10);\n\n // Apply rounded corners?\n if (rc > epsilon) {\n var x11 = r1 * cos(a11),\n y11 = r1 * sin(a11),\n x00 = r0 * cos(a00),\n y00 = r0 * sin(a00),\n oc;\n\n // Restrict the corner radius according to the sector angle.\n if (da < pi && (oc = intersect(x01, y01, x00, y00, x11, y11, x10, y10))) {\n var ax = x01 - oc[0],\n ay = y01 - oc[1],\n bx = x11 - oc[0],\n by = y11 - oc[1],\n kc = 1 / sin(acos((ax * bx + ay * by) / (sqrt(ax * ax + ay * ay) *Line truncated
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
function t(r) {
|
|
||||||
return typeof r == "object" && "length" in r ? r : Array.from(r);
|
|
||||||
}
|
|
||||||
export {
|
|
||||||
t as a
|
|
||||||
};
|
|
||||||
//# sourceMappingURL=array-2ff2c7a6.js.map
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
{"version":3,"file":"array-2ff2c7a6.js","sources":["../../../node_modules/.pnpm/d3-shape@3.1.0/node_modules/d3-shape/src/array.js"],"sourcesContent":["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"],"names":["array","x"],"mappings":"AAEe,SAAQA,EAACC,GAAG;AACzB,SAAO,OAAOA,KAAM,YAAY,YAAYA,IACxCA,IACA,MAAM,KAAKA,CAAC;AAClB;"}
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
function array(x) {
|
|
||||||
return typeof x === "object" && "length" in x ? x : Array.from(x);
|
|
||||||
}
|
|
||||||
export {
|
|
||||||
array as a
|
|
||||||
};
|
|
||||||
//# sourceMappingURL=array-b7dcf730.js.map
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
{"version":3,"file":"array-b7dcf730.js","sources":["../../../node_modules/.pnpm/d3-shape@3.1.0/node_modules/d3-shape/src/array.js"],"sourcesContent":["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"],"names":[],"mappings":"AAEe,SAAQ,MAAC,GAAG;AACzB,SAAO,OAAO,MAAM,YAAY,YAAY,IACxC,IACA,MAAM,KAAK,CAAC;AAClB;"}
|
|
||||||
-31
@@ -1,31 +0,0 @@
|
|||||||
export default assignWithDepth;
|
|
||||||
/**
|
|
||||||
* @function assignWithDepth Extends the functionality of {@link ObjectConstructor.assign} with the
|
|
||||||
* ability to merge arbitrary-depth objects For each key in src with path `k` (recursively)
|
|
||||||
* performs an Object.assign(dst[`k`], src[`k`]) with a slight change from the typical handling of
|
|
||||||
* undefined for dst[`k`]: instead of raising an error, dst[`k`] is auto-initialized to {} and
|
|
||||||
* effectively merged with src[`k`]<p> Additionally, dissimilar types will not clobber unless the
|
|
||||||
* config.clobber parameter === true. Example:
|
|
||||||
*
|
|
||||||
* ```js
|
|
||||||
* let config_0 = { foo: { bar: 'bar' }, bar: 'foo' };
|
|
||||||
* let config_1 = { foo: 'foo', bar: 'bar' };
|
|
||||||
* let result = assignWithDepth(config_0, config_1);
|
|
||||||
* console.log(result);
|
|
||||||
* //-> result: { foo: { bar: 'bar' }, bar: 'bar' }
|
|
||||||
* ```
|
|
||||||
*
|
|
||||||
* Traditional Object.assign would have clobbered foo in config_0 with foo in config_1. If src is a
|
|
||||||
* destructured array of objects and dst is not an array, assignWithDepth will apply each element
|
|
||||||
* of src to dst in order.
|
|
||||||
* @param {any} dst - The destination of the merge
|
|
||||||
* @param {any} src - The source object(s) to merge into destination
|
|
||||||
* @param {{ depth: number; clobber: boolean }} [config={ depth: 2, clobber: false }] - Depth: depth
|
|
||||||
* to traverse within src and dst for merging - clobber: should dissimilar types clobber (default:
|
|
||||||
* { depth: 2, clobber: false }). Default is `{ depth: 2, clobber: false }`
|
|
||||||
* @returns {any}
|
|
||||||
*/
|
|
||||||
declare function assignWithDepth(dst: any, src: any, config?: {
|
|
||||||
depth: number;
|
|
||||||
clobber: boolean;
|
|
||||||
} | undefined): any;
|
|
||||||
File diff suppressed because it is too large.
Load diff
@@ -1 +0,0 @@
|
|||||||
{"version":3,"file":"c4Diagram-03ae1c00.js","sources":["../src/diagrams/c4/parser/c4Diagram.jison","../src/diagrams/c4/c4Db.js","../src/diagrams/c4/svgDraw.js","../src/diagrams/c4/c4Renderer.js","../src/diagrams/c4/styles.js","../src/diagrams/c4/c4Diagram.ts"],"sourcesContent":["/** mermaid\n * https://mermaidjs.github.io/\n * (c) 2022 mzhx.meng@gmail.com\n * MIT license.\n */\n\n/* lexical grammar */\n%lex\n\n/* context */\n%x person\n%x person_ext\n%x system\n%x system_db\n%x system_queue\n%x system_ext\n%x system_ext_db\n%x system_ext_queue\n%x boundary\n%x enterprise_boundary\n%x system_boundary\n%x rel\n%x birel\n%x rel_u\n%x rel_d\n%x rel_l\n%x rel_r\n\n/* container */\n%x container\n%x container_db\n%x container_queue\n%x container_ext\n%x container_ext_db\n%x container_ext_queue\n%x container_boundary\n\n/* component */\n%x component\n%x component_db\n%x component_queue\n%x component_ext\n%x component_ext_db\n%x component_ext_queue\n\n/* Dynamic diagram */\n%x rel_index\n%x index\n\n/* Deployment diagram */\n%x node\n%x node_l\n%x node_r\n\n/* Relationship Types */\n%x rel\n%x rel_bi\n%x rel_u\n%x rel_d\n%x rel_l\n%x rel_r\n%x rel_b\n\n/* Custom tags/stereotypes */\n%x update_el_style\n%x update_rel_style\n%x update_layout_config\n\n%x attribute\n%x string\n%x string_kv\n%x string_kv_key\n%x string_kv_value\n\n%x open_directive\n%x type_directive\n%x arg_directive\n%x close_directive\n%x acc_title\n%x acc_descr\n%x acc_descr_multiline\n\n%%\n\n\\%\\%\\{ { this.begin('open_directive'); return 'open_directive'; }\n.*direction\\s+TB[^\\n]* return 'direction_tb';\n.*direction\\s+BT[^\\n]* return 'direction_bt';\n.*direction\\s+RL[^\\n]* return 'direction_rl';\n.*direction\\s+LR[^\\n]* return 'direction_lr';\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\n\"title\"\\s[^#\\n;]+ return 'title';\n\"accDescription\"\\s[^#\\n;]+ return 'accDescription';\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\n\n\\%\\%(?!\\{)*[^\\n]*(\\r?\\n?)+ /* skip comments */\n\\%\\%[^\\n]*(\\r?\\n)* c /* skip comments */\n\n\\s*(\\r?\\n)+ return 'NEWLINE';\n\\s+ /* skip whitespace */\n\"C4Context\" return 'C4_CONTEXT';\n\"C4Container\" return 'C4_CONTAINER';\n\"C4Component\" return 'C4_COMPONENT';\n\"C4Dynamic\" return 'C4_DYNAMIC';\n\"C4Deployment\" return 'C4_DEPLOYMENT';\n\n\"Person_Ext\" { this.begin(\"person_ext\"); return 'PERSON_EXT';}\n\"Person\" { this.begin(\"person\"); return 'PERSON';}\n\"SystemQueue_Ext\" { this.begin(\"system_ext_queue\"); return 'SYSTEM_EXT_QUEUE';}\n\"SystemDb_Ext\" { this.begin(\"system_ext_db\"); return 'SYSTEM_EXT_DB';}\n\"System_Ext\" { this.begin(\"system_ext\"); return 'SYSTEM_EXT';}\n\"SystemQueue\" { this.begin(\"system_queue\"); return 'SYSTEM_QUEUE';}\n\"SystemDb\" { this.begin(\"system_db\"); return 'SYSTEM_DB';}\n\"System\" { this.begin(\"system\"); return 'SYSTEM';}\n\n\"Boundary\" { this.begin(\"boundary\"); return 'BOUNDARY';}\n\"Enterprise_Boundary\" { this.begin(\"enterprise_boundary\"); return 'ENTERPRISE_BOUNDARY';}\n\"System_Boundary\" { this.begin(\"system_boundary\"); return 'SYSTEM_BOUNDARY';}\n\n\"ContainerQueue_Ext\" { this.begin(\"container_ext_queue\"); return 'CONTAINER_EXT_QUEUE';}\n\"ContainerDb_Ext\" { this.begin(\"container_ext_db\"); return 'CONTAINER_EXT_DB';}\n\"Container_Ext\" { thisLine truncated
|
|
||||||
File diff suppressed because it is too large.
Load diff
@@ -1 +0,0 @@
|
|||||||
{"version":3,"file":"c4Diagram-8889d224.js","sources":["../src/diagrams/c4/parser/c4Diagram.jison","../src/diagrams/c4/c4Db.js","../src/diagrams/c4/svgDraw.js","../src/diagrams/c4/c4Renderer.js","../src/diagrams/c4/styles.js","../src/diagrams/c4/c4Diagram.ts"],"sourcesContent":["/** mermaid\n * https://mermaidjs.github.io/\n * (c) 2022 mzhx.meng@gmail.com\n * MIT license.\n */\n\n/* lexical grammar */\n%lex\n\n/* context */\n%x person\n%x person_ext\n%x system\n%x system_db\n%x system_queue\n%x system_ext\n%x system_ext_db\n%x system_ext_queue\n%x boundary\n%x enterprise_boundary\n%x system_boundary\n%x rel\n%x birel\n%x rel_u\n%x rel_d\n%x rel_l\n%x rel_r\n\n/* container */\n%x container\n%x container_db\n%x container_queue\n%x container_ext\n%x container_ext_db\n%x container_ext_queue\n%x container_boundary\n\n/* component */\n%x component\n%x component_db\n%x component_queue\n%x component_ext\n%x component_ext_db\n%x component_ext_queue\n\n/* Dynamic diagram */\n%x rel_index\n%x index\n\n/* Deployment diagram */\n%x node\n%x node_l\n%x node_r\n\n/* Relationship Types */\n%x rel\n%x rel_bi\n%x rel_u\n%x rel_d\n%x rel_l\n%x rel_r\n%x rel_b\n\n/* Custom tags/stereotypes */\n%x update_el_style\n%x update_rel_style\n%x update_layout_config\n\n%x attribute\n%x string\n%x string_kv\n%x string_kv_key\n%x string_kv_value\n\n%x open_directive\n%x type_directive\n%x arg_directive\n%x close_directive\n%x acc_title\n%x acc_descr\n%x acc_descr_multiline\n\n%%\n\n\\%\\%\\{ { this.begin('open_directive'); return 'open_directive'; }\n.*direction\\s+TB[^\\n]* return 'direction_tb';\n.*direction\\s+BT[^\\n]* return 'direction_bt';\n.*direction\\s+RL[^\\n]* return 'direction_rl';\n.*direction\\s+LR[^\\n]* return 'direction_lr';\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\n\"title\"\\s[^#\\n;]+ return 'title';\n\"accDescription\"\\s[^#\\n;]+ return 'accDescription';\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\n\n\\%\\%(?!\\{)*[^\\n]*(\\r?\\n?)+ /* skip comments */\n\\%\\%[^\\n]*(\\r?\\n)* c /* skip comments */\n\n\\s*(\\r?\\n)+ return 'NEWLINE';\n\\s+ /* skip whitespace */\n\"C4Context\" return 'C4_CONTEXT';\n\"C4Container\" return 'C4_CONTAINER';\n\"C4Component\" return 'C4_COMPONENT';\n\"C4Dynamic\" return 'C4_DYNAMIC';\n\"C4Deployment\" return 'C4_DEPLOYMENT';\n\n\"Person_Ext\" { this.begin(\"person_ext\"); return 'PERSON_EXT';}\n\"Person\" { this.begin(\"person\"); return 'PERSON';}\n\"SystemQueue_Ext\" { this.begin(\"system_ext_queue\"); return 'SYSTEM_EXT_QUEUE';}\n\"SystemDb_Ext\" { this.begin(\"system_ext_db\"); return 'SYSTEM_EXT_DB';}\n\"System_Ext\" { this.begin(\"system_ext\"); return 'SYSTEM_EXT';}\n\"SystemQueue\" { this.begin(\"system_queue\"); return 'SYSTEM_QUEUE';}\n\"SystemDb\" { this.begin(\"system_db\"); return 'SYSTEM_DB';}\n\"System\" { this.begin(\"system\"); return 'SYSTEM';}\n\n\"Boundary\" { this.begin(\"boundary\"); return 'BOUNDARY';}\n\"Enterprise_Boundary\" { this.begin(\"enterprise_boundary\"); return 'ENTERPRISE_BOUNDARY';}\n\"System_Boundary\" { this.begin(\"system_boundary\"); return 'SYSTEM_BOUNDARY';}\n\n\"ContainerQueue_Ext\" { this.begin(\"container_ext_queue\"); return 'CONTAINER_EXT_QUEUE';}\n\"ContainerDb_Ext\" { this.begin(\"container_ext_db\"); return 'CONTAINER_EXT_DB';}\n\"Container_Ext\" { thisLine truncated
|
|
||||||
File diff suppressed because it is too large.
Load diff
@@ -1 +0,0 @@
|
|||||||
{"version":3,"file":"c4Diagram-a7af8508.js","sources":["../src/diagrams/c4/parser/c4Diagram.jison","../src/diagrams/c4/c4Db.js","../src/diagrams/c4/svgDraw.js","../src/diagrams/c4/c4Renderer.js","../src/diagrams/c4/styles.js","../src/diagrams/c4/c4Diagram.ts"],"sourcesContent":["/** mermaid\n * https://mermaidjs.github.io/\n * (c) 2022 mzhx.meng@gmail.com\n * MIT license.\n */\n\n/* lexical grammar */\n%lex\n\n/* context */\n%x person\n%x person_ext\n%x system\n%x system_db\n%x system_queue\n%x system_ext\n%x system_ext_db\n%x system_ext_queue\n%x boundary\n%x enterprise_boundary\n%x system_boundary\n%x rel\n%x birel\n%x rel_u\n%x rel_d\n%x rel_l\n%x rel_r\n\n/* container */\n%x container\n%x container_db\n%x container_queue\n%x container_ext\n%x container_ext_db\n%x container_ext_queue\n%x container_boundary\n\n/* component */\n%x component\n%x component_db\n%x component_queue\n%x component_ext\n%x component_ext_db\n%x component_ext_queue\n\n/* Dynamic diagram */\n%x rel_index\n%x index\n\n/* Deployment diagram */\n%x node\n%x node_l\n%x node_r\n\n/* Relationship Types */\n%x rel\n%x rel_bi\n%x rel_u\n%x rel_d\n%x rel_l\n%x rel_r\n%x rel_b\n\n/* Custom tags/stereotypes */\n%x update_el_style\n%x update_rel_style\n%x update_layout_config\n\n%x attribute\n%x string\n%x string_kv\n%x string_kv_key\n%x string_kv_value\n\n%x open_directive\n%x type_directive\n%x arg_directive\n%x close_directive\n%x acc_title\n%x acc_descr\n%x acc_descr_multiline\n\n%%\n\n\\%\\%\\{ { this.begin('open_directive'); return 'open_directive'; }\n.*direction\\s+TB[^\\n]* return 'direction_tb';\n.*direction\\s+BT[^\\n]* return 'direction_bt';\n.*direction\\s+RL[^\\n]* return 'direction_rl';\n.*direction\\s+LR[^\\n]* return 'direction_lr';\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\n\"title\"\\s[^#\\n;]+ return 'title';\n\"accDescription\"\\s[^#\\n;]+ return 'accDescription';\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\n\n\\%\\%(?!\\{)*[^\\n]*(\\r?\\n?)+ /* skip comments */\n\\%\\%[^\\n]*(\\r?\\n)* c /* skip comments */\n\n\\s*(\\r?\\n)+ return 'NEWLINE';\n\\s+ /* skip whitespace */\n\"C4Context\" return 'C4_CONTEXT';\n\"C4Container\" return 'C4_CONTAINER';\n\"C4Component\" return 'C4_COMPONENT';\n\"C4Dynamic\" return 'C4_DYNAMIC';\n\"C4Deployment\" return 'C4_DEPLOYMENT';\n\n\"Person_Ext\" { this.begin(\"person_ext\"); return 'PERSON_EXT';}\n\"Person\" { this.begin(\"person\"); return 'PERSON';}\n\"SystemQueue_Ext\" { this.begin(\"system_ext_queue\"); return 'SYSTEM_EXT_QUEUE';}\n\"SystemDb_Ext\" { this.begin(\"system_ext_db\"); return 'SYSTEM_EXT_DB';}\n\"System_Ext\" { this.begin(\"system_ext\"); return 'SYSTEM_EXT';}\n\"SystemQueue\" { this.begin(\"system_queue\"); return 'SYSTEM_QUEUE';}\n\"SystemDb\" { this.begin(\"system_db\"); return 'SYSTEM_DB';}\n\"System\" { this.begin(\"system\"); return 'SYSTEM';}\n\n\"Boundary\" { this.begin(\"boundary\"); return 'BOUNDARY';}\n\"Enterprise_Boundary\" { this.begin(\"enterprise_boundary\"); return 'ENTERPRISE_BOUNDARY';}\n\"System_Boundary\" { this.begin(\"system_boundary\"); return 'SYSTEM_BOUNDARY';}\n\n\"ContainerQueue_Ext\" { this.begin(\"container_ext_queue\"); return 'CONTAINER_EXT_QUEUE';}\n\"ContainerDb_Ext\" { this.begin(\"container_ext_db\"); return 'CONTAINER_EXT_DB';}\n\"Container_Ext\" { thisLine truncated
|
|
||||||
File diff suppressed because it is too large.
Load diff
@@ -1 +0,0 @@
|
|||||||
{"version":3,"file":"c4Diagram-adf7b82c.js","sources":["../src/diagrams/c4/parser/c4Diagram.jison","../src/diagrams/c4/c4Db.js","../src/diagrams/c4/svgDraw.js","../src/diagrams/c4/c4Renderer.js","../src/diagrams/c4/styles.js","../src/diagrams/c4/c4Diagram.ts"],"sourcesContent":["/** mermaid\n * https://mermaidjs.github.io/\n * (c) 2022 mzhx.meng@gmail.com\n * MIT license.\n */\n\n/* lexical grammar */\n%lex\n\n/* context */\n%x person\n%x person_ext\n%x system\n%x system_db\n%x system_queue\n%x system_ext\n%x system_ext_db\n%x system_ext_queue\n%x boundary\n%x enterprise_boundary\n%x system_boundary\n%x rel\n%x birel\n%x rel_u\n%x rel_d\n%x rel_l\n%x rel_r\n\n/* container */\n%x container\n%x container_db\n%x container_queue\n%x container_ext\n%x container_ext_db\n%x container_ext_queue\n%x container_boundary\n\n/* component */\n%x component\n%x component_db\n%x component_queue\n%x component_ext\n%x component_ext_db\n%x component_ext_queue\n\n/* Dynamic diagram */\n%x rel_index\n%x index\n\n/* Deployment diagram */\n%x node\n%x node_l\n%x node_r\n\n/* Relationship Types */\n%x rel\n%x rel_bi\n%x rel_u\n%x rel_d\n%x rel_l\n%x rel_r\n%x rel_b\n\n/* Custom tags/stereotypes */\n%x update_el_style\n%x update_rel_style\n%x update_layout_config\n\n%x attribute\n%x string\n%x string_kv\n%x string_kv_key\n%x string_kv_value\n\n%x open_directive\n%x type_directive\n%x arg_directive\n%x close_directive\n%x acc_title\n%x acc_descr\n%x acc_descr_multiline\n\n%%\n\n\\%\\%\\{ { this.begin('open_directive'); return 'open_directive'; }\n.*direction\\s+TB[^\\n]* return 'direction_tb';\n.*direction\\s+BT[^\\n]* return 'direction_bt';\n.*direction\\s+RL[^\\n]* return 'direction_rl';\n.*direction\\s+LR[^\\n]* return 'direction_lr';\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\n\"title\"\\s[^#\\n;]+ return 'title';\n\"accDescription\"\\s[^#\\n;]+ return 'accDescription';\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\n\n\\%\\%(?!\\{)*[^\\n]*(\\r?\\n?)+ /* skip comments */\n\\%\\%[^\\n]*(\\r?\\n)* c /* skip comments */\n\n\\s*(\\r?\\n)+ return 'NEWLINE';\n\\s+ /* skip whitespace */\n\"C4Context\" return 'C4_CONTEXT';\n\"C4Container\" return 'C4_CONTAINER';\n\"C4Component\" return 'C4_COMPONENT';\n\"C4Dynamic\" return 'C4_DYNAMIC';\n\"C4Deployment\" return 'C4_DEPLOYMENT';\n\n\"Person_Ext\" { this.begin(\"person_ext\"); return 'PERSON_EXT';}\n\"Person\" { this.begin(\"person\"); return 'PERSON';}\n\"SystemQueue_Ext\" { this.begin(\"system_ext_queue\"); return 'SYSTEM_EXT_QUEUE';}\n\"SystemDb_Ext\" { this.begin(\"system_ext_db\"); return 'SYSTEM_EXT_DB';}\n\"System_Ext\" { this.begin(\"system_ext\"); return 'SYSTEM_EXT';}\n\"SystemQueue\" { this.begin(\"system_queue\"); return 'SYSTEM_QUEUE';}\n\"SystemDb\" { this.begin(\"system_db\"); return 'SYSTEM_DB';}\n\"System\" { this.begin(\"system\"); return 'SYSTEM';}\n\n\"Boundary\" { this.begin(\"boundary\"); return 'BOUNDARY';}\n\"Enterprise_Boundary\" { this.begin(\"enterprise_boundary\"); return 'ENTERPRISE_BOUNDARY';}\n\"System_Boundary\" { this.begin(\"system_boundary\"); return 'SYSTEM_BOUNDARY';}\n\n\"ContainerQueue_Ext\" { this.begin(\"container_ext_queue\"); return 'CONTAINER_EXT_QUEUE';}\n\"ContainerDb_Ext\" { this.begin(\"container_ext_db\"); return 'CONTAINER_EXT_DB';}\n\"Container_Ext\" { thisLine truncated
|
|
||||||
File diff suppressed because it is too large.
Load diff
@@ -1 +0,0 @@
|
|||||||
{"version":3,"file":"c4Diagram-f9e67060.js","sources":["../src/diagrams/c4/parser/c4Diagram.jison","../src/diagrams/c4/c4Db.js","../src/diagrams/c4/svgDraw.js","../src/diagrams/c4/c4Renderer.js","../src/diagrams/c4/styles.js","../src/diagrams/c4/c4Diagram.ts"],"sourcesContent":["/** mermaid\n * https://mermaidjs.github.io/\n * (c) 2022 mzhx.meng@gmail.com\n * MIT license.\n */\n\n/* lexical grammar */\n%lex\n\n/* context */\n%x person\n%x person_ext\n%x system\n%x system_db\n%x system_queue\n%x system_ext\n%x system_ext_db\n%x system_ext_queue\n%x boundary\n%x enterprise_boundary\n%x system_boundary\n%x rel\n%x birel\n%x rel_u\n%x rel_d\n%x rel_l\n%x rel_r\n\n/* container */\n%x container\n%x container_db\n%x container_queue\n%x container_ext\n%x container_ext_db\n%x container_ext_queue\n%x container_boundary\n\n/* component */\n%x component\n%x component_db\n%x component_queue\n%x component_ext\n%x component_ext_db\n%x component_ext_queue\n\n/* Dynamic diagram */\n%x rel_index\n%x index\n\n/* Deployment diagram */\n%x node\n%x node_l\n%x node_r\n\n/* Relationship Types */\n%x rel\n%x rel_bi\n%x rel_u\n%x rel_d\n%x rel_l\n%x rel_r\n%x rel_b\n\n/* Custom tags/stereotypes */\n%x update_el_style\n%x update_rel_style\n%x update_layout_config\n\n%x attribute\n%x string\n%x string_kv\n%x string_kv_key\n%x string_kv_value\n\n%x open_directive\n%x type_directive\n%x arg_directive\n%x close_directive\n%x acc_title\n%x acc_descr\n%x acc_descr_multiline\n\n%%\n\n\\%\\%\\{ { this.begin('open_directive'); return 'open_directive'; }\n.*direction\\s+TB[^\\n]* return 'direction_tb';\n.*direction\\s+BT[^\\n]* return 'direction_bt';\n.*direction\\s+RL[^\\n]* return 'direction_rl';\n.*direction\\s+LR[^\\n]* return 'direction_lr';\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\n\"title\"\\s[^#\\n;]+ return 'title';\n\"accDescription\"\\s[^#\\n;]+ return 'accDescription';\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\n\n\\%\\%(?!\\{)*[^\\n]*(\\r?\\n?)+ /* skip comments */\n\\%\\%[^\\n]*(\\r?\\n)* c /* skip comments */\n\n\\s*(\\r?\\n)+ return 'NEWLINE';\n\\s+ /* skip whitespace */\n\"C4Context\" return 'C4_CONTEXT';\n\"C4Container\" return 'C4_CONTAINER';\n\"C4Component\" return 'C4_COMPONENT';\n\"C4Dynamic\" return 'C4_DYNAMIC';\n\"C4Deployment\" return 'C4_DEPLOYMENT';\n\n\"Person_Ext\" { this.begin(\"person_ext\"); return 'PERSON_EXT';}\n\"Person\" { this.begin(\"person\"); return 'PERSON';}\n\"SystemQueue_Ext\" { this.begin(\"system_ext_queue\"); return 'SYSTEM_EXT_QUEUE';}\n\"SystemDb_Ext\" { this.begin(\"system_ext_db\"); return 'SYSTEM_EXT_DB';}\n\"System_Ext\" { this.begin(\"system_ext\"); return 'SYSTEM_EXT';}\n\"SystemQueue\" { this.begin(\"system_queue\"); return 'SYSTEM_QUEUE';}\n\"SystemDb\" { this.begin(\"system_db\"); return 'SYSTEM_DB';}\n\"System\" { this.begin(\"system\"); return 'SYSTEM';}\n\n\"Boundary\" { this.begin(\"boundary\"); return 'BOUNDARY';}\n\"Enterprise_Boundary\" { this.begin(\"enterprise_boundary\"); return 'ENTERPRISE_BOUNDARY';}\n\"System_Boundary\" { this.begin(\"system_boundary\"); return 'SYSTEM_BOUNDARY';}\n\n\"ContainerQueue_Ext\" { this.begin(\"container_ext_queue\"); return 'CONTAINER_EXT_QUEUE';}\n\"ContainerDb_Ext\" { this.begin(\"container_ext_db\"); return 'CONTAINER_EXT_DB';}\n\"Container_Ext\" { thisLine truncated
|
|
||||||
File diff suppressed because it is too large.
Load diff
@@ -1 +0,0 @@
|
|||||||
{"version":3,"file":"c4Diagram-fa9ef55f.js","sources":["../src/diagrams/c4/parser/c4Diagram.jison","../src/diagrams/c4/c4Db.js","../src/diagrams/c4/svgDraw.js","../src/diagrams/c4/c4Renderer.js","../src/diagrams/c4/styles.js","../src/diagrams/c4/c4Diagram.ts"],"sourcesContent":["/** mermaid\n * https://mermaidjs.github.io/\n * (c) 2022 mzhx.meng@gmail.com\n * MIT license.\n */\n\n/* lexical grammar */\n%lex\n\n/* context */\n%x person\n%x person_ext\n%x system\n%x system_db\n%x system_queue\n%x system_ext\n%x system_ext_db\n%x system_ext_queue\n%x boundary\n%x enterprise_boundary\n%x system_boundary\n%x rel\n%x birel\n%x rel_u\n%x rel_d\n%x rel_l\n%x rel_r\n\n/* container */\n%x container\n%x container_db\n%x container_queue\n%x container_ext\n%x container_ext_db\n%x container_ext_queue\n%x container_boundary\n\n/* component */\n%x component\n%x component_db\n%x component_queue\n%x component_ext\n%x component_ext_db\n%x component_ext_queue\n\n/* Dynamic diagram */\n%x rel_index\n%x index\n\n/* Deployment diagram */\n%x node\n%x node_l\n%x node_r\n\n/* Relationship Types */\n%x rel\n%x rel_bi\n%x rel_u\n%x rel_d\n%x rel_l\n%x rel_r\n%x rel_b\n\n/* Custom tags/stereotypes */\n%x update_el_style\n%x update_rel_style\n%x update_layout_config\n\n%x attribute\n%x string\n%x string_kv\n%x string_kv_key\n%x string_kv_value\n\n%x open_directive\n%x type_directive\n%x arg_directive\n%x close_directive\n%x acc_title\n%x acc_descr\n%x acc_descr_multiline\n\n%%\n\n\\%\\%\\{ { this.begin('open_directive'); return 'open_directive'; }\n.*direction\\s+TB[^\\n]* return 'direction_tb';\n.*direction\\s+BT[^\\n]* return 'direction_bt';\n.*direction\\s+RL[^\\n]* return 'direction_rl';\n.*direction\\s+LR[^\\n]* return 'direction_lr';\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\n\"title\"\\s[^#\\n;]+ return 'title';\n\"accDescription\"\\s[^#\\n;]+ return 'accDescription';\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\n\n\\%\\%(?!\\{)*[^\\n]*(\\r?\\n?)+ /* skip comments */\n\\%\\%[^\\n]*(\\r?\\n)* c /* skip comments */\n\n\\s*(\\r?\\n)+ return 'NEWLINE';\n\\s+ /* skip whitespace */\n\"C4Context\" return 'C4_CONTEXT';\n\"C4Container\" return 'C4_CONTAINER';\n\"C4Component\" return 'C4_COMPONENT';\n\"C4Dynamic\" return 'C4_DYNAMIC';\n\"C4Deployment\" return 'C4_DEPLOYMENT';\n\n\"Person_Ext\" { this.begin(\"person_ext\"); return 'PERSON_EXT';}\n\"Person\" { this.begin(\"person\"); return 'PERSON';}\n\"SystemQueue_Ext\" { this.begin(\"system_ext_queue\"); return 'SYSTEM_EXT_QUEUE';}\n\"SystemDb_Ext\" { this.begin(\"system_ext_db\"); return 'SYSTEM_EXT_DB';}\n\"System_Ext\" { this.begin(\"system_ext\"); return 'SYSTEM_EXT';}\n\"SystemQueue\" { this.begin(\"system_queue\"); return 'SYSTEM_QUEUE';}\n\"SystemDb\" { this.begin(\"system_db\"); return 'SYSTEM_DB';}\n\"System\" { this.begin(\"system\"); return 'SYSTEM';}\n\n\"Boundary\" { this.begin(\"boundary\"); return 'BOUNDARY';}\n\"Enterprise_Boundary\" { this.begin(\"enterprise_boundary\"); return 'ENTERPRISE_BOUNDARY';}\n\"System_Boundary\" { this.begin(\"system_boundary\"); return 'SYSTEM_BOUNDARY';}\n\n\"ContainerQueue_Ext\" { this.begin(\"container_ext_queue\"); return 'CONTAINER_EXT_QUEUE';}\n\"ContainerDb_Ext\" { this.begin(\"container_ext_db\"); return 'CONTAINER_EXT_DB';}\n\"Container_Ext\" { thisLine truncated
|
|
||||||
@@ -1,97 +0,0 @@
|
|||||||
import { p as W, d as M, s as H } from "./styles-55d85316.js";
|
|
||||||
import { g as S, l as d, f as u } from "./config-e567ef17.js";
|
|
||||||
import { G as X, l as Y } from "./layout-d6d8be39.js";
|
|
||||||
import { s as l } from "./svgDraw-c034b55e.js";
|
|
||||||
import { c as Z } from "./setupGraphViewbox-a4603a92.js";
|
|
||||||
import "./utils-aa888deb.js";
|
|
||||||
import "./commonDb-4dc3d465.js";
|
|
||||||
import "./mermaidAPI-04b5c286.js";
|
|
||||||
import "./errorRenderer-a3c4bedb.js";
|
|
||||||
import "./isPlainObject-a5cb4071.js";
|
|
||||||
import "./array-2ff2c7a6.js";
|
|
||||||
import "./constant-2fe7eae5.js";
|
|
||||||
let h = {};
|
|
||||||
const g = 20, p = function(e) {
|
|
||||||
const s = Object.entries(h).find((k) => k[1].label === e);
|
|
||||||
if (s)
|
|
||||||
return s[0];
|
|
||||||
}, D = function(e) {
|
|
||||||
e.append("defs").append("marker").attr("id", "extensionStart").attr("class", "extension").attr("refX", 0).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 1,7 L18,13 V 1 Z"), e.append("defs").append("marker").attr("id", "extensionEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 1,1 V 13 L18,7 Z"), e.append("defs").append("marker").attr("id", "compositionStart").attr("class", "extension").attr("refX", 0).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"), e.append("defs").append("marker").attr("id", "compositionEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"), e.append("defs").append("marker").attr("id", "aggregationStart").attr("class", "extension").attr("refX", 0).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"), e.append("defs").append("marker").attr("id", "aggregationEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"), e.append("defs").append("marker").attr("id", "dependencyStart").attr("class", "extension").attr("refX", 0).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 5,7 L9,13 L1,7 L9,1 Z"), e.append("defs").append("marker").attr("id", "dependencyEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L14,7 L9,1 Z");
|
|
||||||
}, $ = function(e, s, k, a) {
|
|
||||||
const f = S().class;
|
|
||||||
h = {}, d.info("Rendering diagram " + e);
|
|
||||||
const L = S().securityLevel;
|
|
||||||
let y;
|
|
||||||
L === "sandbox" && (y = u("#i" + s));
|
|
||||||
const x = L === "sandbox" ? u(y.nodes()[0].contentDocument.body) : u("body"), n = x.select(`[id='${s}']`);
|
|
||||||
D(n);
|
|
||||||
const r = new X({
|
|
||||||
multigraph: !0
|
|
||||||
});
|
|
||||||
r.setGraph({
|
|
||||||
isMultiGraph: !0
|
|
||||||
}), r.setDefaultEdgeLabel(function() {
|
|
||||||
return {};
|
|
||||||
});
|
|
||||||
const m = a.db.getClasses(), N = Object.keys(m);
|
|
||||||
for (const t of N) {
|
|
||||||
const o = m[t], i = l.drawClass(n, o, f, a);
|
|
||||||
h[i.id] = i, r.setNode(i.id, i), d.info("Org height: " + i.height);
|
|
||||||
}
|
|
||||||
a.db.getRelations().forEach(function(t) {
|
|
||||||
d.info(
|
|
||||||
"tjoho" + p(t.id1) + p(t.id2) + JSON.stringify(t)
|
|
||||||
), r.setEdge(
|
|
||||||
p(t.id1),
|
|
||||||
p(t.id2),
|
|
||||||
{
|
|
||||||
relation: t
|
|
||||||
},
|
|
||||||
t.title || "DEFAULT"
|
|
||||||
);
|
|
||||||
}), a.db.getNotes().forEach(function(t) {
|
|
||||||
d.debug(`Adding note: ${JSON.stringify(t)}`);
|
|
||||||
const o = l.drawNote(n, t, f, a);
|
|
||||||
h[o.id] = o, r.setNode(o.id, o), t.class && t.class in m && r.setEdge(
|
|
||||||
t.id,
|
|
||||||
p(t.class),
|
|
||||||
{
|
|
||||||
relation: {
|
|
||||||
id1: t.id,
|
|
||||||
id2: t.class,
|
|
||||||
relation: {
|
|
||||||
type1: "none",
|
|
||||||
type2: "none",
|
|
||||||
lineType: 10
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"DEFAULT"
|
|
||||||
);
|
|
||||||
}), Y(r), r.nodes().forEach(function(t) {
|
|
||||||
t !== void 0 && r.node(t) !== void 0 && (d.debug("Node " + t + ": " + JSON.stringify(r.node(t))), x.select("#" + (a.db.lookUpDomId(t) || t)).attr(
|
|
||||||
"transform",
|
|
||||||
"translate(" + (r.node(t).x - r.node(t).width / 2) + "," + (r.node(t).y - r.node(t).height / 2) + " )"
|
|
||||||
));
|
|
||||||
}), r.edges().forEach(function(t) {
|
|
||||||
t !== void 0 && r.edge(t) !== void 0 && (d.debug("Edge " + t.v + " -> " + t.w + ": " + JSON.stringify(r.edge(t))), l.drawEdge(n, r.edge(t), r.edge(t).relation, f, a));
|
|
||||||
});
|
|
||||||
const c = n.node().getBBox(), E = c.width + g * 2, b = c.height + g * 2;
|
|
||||||
Z(n, b, E, f.useMaxWidth);
|
|
||||||
const w = `${c.x - g} ${c.y - g} ${E} ${b}`;
|
|
||||||
d.debug(`viewBox ${w}`), n.attr("viewBox", w);
|
|
||||||
}, B = {
|
|
||||||
draw: $
|
|
||||||
}, q = {
|
|
||||||
parser: W,
|
|
||||||
db: M,
|
|
||||||
renderer: B,
|
|
||||||
styles: H,
|
|
||||||
init: (e) => {
|
|
||||||
e.class || (e.class = {}), e.class.arrowMarkerAbsolute = e.arrowMarkerAbsolute, M.clear();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
export {
|
|
||||||
q as diagram
|
|
||||||
};
|
|
||||||
//# sourceMappingURL=classDiagram-17eafd8a.js.map
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
{"version":3,"file":"classDiagram-17eafd8a.js","sources":["../src/diagrams/class/classRenderer.js","../src/diagrams/class/classDiagram.ts"],"sourcesContent":["import { select } from 'd3';\nimport { layout as dagreLayout } from 'dagre-d3-es/src/dagre/index.js';\nimport * as graphlib from 'dagre-d3-es/src/graphlib/index.js';\nimport { log } from '../../logger';\nimport svgDraw from './svgDraw';\nimport { configureSvgSize } from '../../setupGraphViewbox';\nimport { getConfig } from '../../config';\n\nlet idCache = {};\nconst padding = 20;\n\n/**\n * Gets the ID with the same label as in the cache\n *\n * @param {string} label The label to look for\n * @returns {string} The resulting ID\n */\nconst getGraphId = function (label) {\n const foundEntry = Object.entries(idCache).find((entry) => entry[1].label === label);\n\n if (foundEntry) {\n return foundEntry[0];\n }\n};\n\n/**\n * Setup arrow head and define the marker. The result is appended to the svg.\n *\n * @param {SVGSVGElement} elem The SVG element to append to\n */\nconst insertMarkers = function (elem) {\n elem\n .append('defs')\n .append('marker')\n .attr('id', 'extensionStart')\n .attr('class', 'extension')\n .attr('refX', 0)\n .attr('refY', 7)\n .attr('markerWidth', 190)\n .attr('markerHeight', 240)\n .attr('orient', 'auto')\n .append('path')\n .attr('d', 'M 1,7 L18,13 V 1 Z');\n\n elem\n .append('defs')\n .append('marker')\n .attr('id', 'extensionEnd')\n .attr('refX', 19)\n .attr('refY', 7)\n .attr('markerWidth', 20)\n .attr('markerHeight', 28)\n .attr('orient', 'auto')\n .append('path')\n .attr('d', 'M 1,1 V 13 L18,7 Z'); // this is actual shape for arrowhead\n\n elem\n .append('defs')\n .append('marker')\n .attr('id', 'compositionStart')\n .attr('class', 'extension')\n .attr('refX', 0)\n .attr('refY', 7)\n .attr('markerWidth', 190)\n .attr('markerHeight', 240)\n .attr('orient', 'auto')\n .append('path')\n .attr('d', 'M 18,7 L9,13 L1,7 L9,1 Z');\n\n elem\n .append('defs')\n .append('marker')\n .attr('id', 'compositionEnd')\n .attr('refX', 19)\n .attr('refY', 7)\n .attr('markerWidth', 20)\n .attr('markerHeight', 28)\n .attr('orient', 'auto')\n .append('path')\n .attr('d', 'M 18,7 L9,13 L1,7 L9,1 Z');\n\n elem\n .append('defs')\n .append('marker')\n .attr('id', 'aggregationStart')\n .attr('class', 'extension')\n .attr('refX', 0)\n .attr('refY', 7)\n .attr('markerWidth', 190)\n .attr('markerHeight', 240)\n .attr('orient', 'auto')\n .append('path')\n .attr('d', 'M 18,7 L9,13 L1,7 L9,1 Z');\n\n elem\n .append('defs')\n .append('marker')\n .attr('id', 'aggregationEnd')\n .attr('refX', 19)\n .attr('refY', 7)\n .attr('markerWidth', 20)\n .attr('markerHeight', 28)\n .attr('orient', 'auto')\n .append('path')\n .attr('d', 'M 18,7 L9,13 L1,7 L9,1 Z');\n\n elem\n .append('defs')\n .append('marker')\n .attr('id', 'dependencyStart')\n .attr('class', 'extension')\n .attr('refX', 0)\n .attr('refY', 7)\n .attr('markerWidth', 190)\n .attr('markerHeight', 240)\n .attr('orient', 'auto')\n .append('path')\n .attr('d', 'M 5,7 L9,13 L1,7 L9,1 Z');\n\n elem\n .append('defs')\n .append('marker')\n .attr('id', 'dependencyEnd')\n .attr('refX', 19)\n .attr('refY', 7)\n .attr('markerWidth', 20)\n .attr('markerHeight', 28)\n .attr('orient', 'auto')\n .append('path')\n .attr('d', 'M 18,7 L9,13 L14,7 L9,1 Z');\n};\n\n/**\n * Draws a flowchart in the tag with id: id based on the graph definition in text.\n *\n * @param {string} text\n * @param {string} id\n * @param {any} _version\n * @param diagObj\n */\nexport const draw = function (text, id, _version, diagObj) {\n const conf = getConfig().class;\n idCache = {};\n // diagObj.db.clear();\n // diagObj.parser.parse(text);\n\n log.info('Rendering diagram ' + text);\n\n const securityLevel = getConfig().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 ? select(sandboxElement.nodes()[0].contentDocument.body)\n : select('body');\n\n // Fetch the default direction, use TD if none was found\n const diagram = root.select(`[id='${id}']`);\n insertMarkers(diagram);\n\n // Layout graph, Create a new directed graph\n const g = new graphlib.Graph({\n multigraph: true,\n });\n\n // Set an object for the graph label\n g.setGraph({\n isMultiGraph: true,\n });\n\n // Default to assigning a new object as a label for each new edge.\n g.setDefaultEdgeLabel(function () {\n return {};\n });\n\n const classes = diagObj.db.getClasses();\n const keys = Object.keys(classes);\n\n for (const key of keys) {\n const classDef = classes[key];\n const node = svgDraw.drawLine truncated
|
|
||||||
@@ -1,143 +0,0 @@
|
|||||||
import { p as parser, d as db, s as styles } from "./styles-d6ad8edb.js";
|
|
||||||
import { g as getConfig, l as log, f as select } from "./config-b4fa35bb.js";
|
|
||||||
import { G as Graph, l as layout } from "./layout-4663fc19.js";
|
|
||||||
import { s as svgDraw } from "./svgDraw-9e97e6db.js";
|
|
||||||
import { c as configureSvgSize } from "./setupGraphViewbox-16a0ba81.js";
|
|
||||||
import "./utils-872dfc50.js";
|
|
||||||
import "./commonDb-7f40ab5a.js";
|
|
||||||
import "./mermaidAPI-6f22a815.js";
|
|
||||||
import "./errorRenderer-ebf63d74.js";
|
|
||||||
import "./isPlainObject-91dd8bc9.js";
|
|
||||||
import "./array-b7dcf730.js";
|
|
||||||
import "./constant-b644328d.js";
|
|
||||||
let idCache = {};
|
|
||||||
const padding = 20;
|
|
||||||
const getGraphId = function(label) {
|
|
||||||
const foundEntry = Object.entries(idCache).find((entry) => entry[1].label === label);
|
|
||||||
if (foundEntry) {
|
|
||||||
return foundEntry[0];
|
|
||||||
}
|
|
||||||
};
|
|
||||||
const insertMarkers = function(elem) {
|
|
||||||
elem.append("defs").append("marker").attr("id", "extensionStart").attr("class", "extension").attr("refX", 0).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 1,7 L18,13 V 1 Z");
|
|
||||||
elem.append("defs").append("marker").attr("id", "extensionEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 1,1 V 13 L18,7 Z");
|
|
||||||
elem.append("defs").append("marker").attr("id", "compositionStart").attr("class", "extension").attr("refX", 0).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z");
|
|
||||||
elem.append("defs").append("marker").attr("id", "compositionEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z");
|
|
||||||
elem.append("defs").append("marker").attr("id", "aggregationStart").attr("class", "extension").attr("refX", 0).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z");
|
|
||||||
elem.append("defs").append("marker").attr("id", "aggregationEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z");
|
|
||||||
elem.append("defs").append("marker").attr("id", "dependencyStart").attr("class", "extension").attr("refX", 0).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 5,7 L9,13 L1,7 L9,1 Z");
|
|
||||||
elem.append("defs").append("marker").attr("id", "dependencyEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L14,7 L9,1 Z");
|
|
||||||
};
|
|
||||||
const draw = function(text, id, _version, diagObj) {
|
|
||||||
const conf = getConfig().class;
|
|
||||||
idCache = {};
|
|
||||||
log.info("Rendering diagram " + text);
|
|
||||||
const securityLevel = getConfig().securityLevel;
|
|
||||||
let sandboxElement;
|
|
||||||
if (securityLevel === "sandbox") {
|
|
||||||
sandboxElement = select("#i" + id);
|
|
||||||
}
|
|
||||||
const root = securityLevel === "sandbox" ? select(sandboxElement.nodes()[0].contentDocument.body) : select("body");
|
|
||||||
const diagram2 = root.select(`[id='${id}']`);
|
|
||||||
insertMarkers(diagram2);
|
|
||||||
const g = new Graph({
|
|
||||||
multigraph: true
|
|
||||||
});
|
|
||||||
g.setGraph({
|
|
||||||
isMultiGraph: true
|
|
||||||
});
|
|
||||||
g.setDefaultEdgeLabel(function() {
|
|
||||||
return {};
|
|
||||||
});
|
|
||||||
const classes = diagObj.db.getClasses();
|
|
||||||
const keys = Object.keys(classes);
|
|
||||||
for (const key of keys) {
|
|
||||||
const classDef = classes[key];
|
|
||||||
const node = svgDraw.drawClass(diagram2, classDef, conf, diagObj);
|
|
||||||
idCache[node.id] = node;
|
|
||||||
g.setNode(node.id, node);
|
|
||||||
log.info("Org height: " + node.height);
|
|
||||||
}
|
|
||||||
const relations = diagObj.db.getRelations();
|
|
||||||
relations.forEach(function(relation) {
|
|
||||||
log.info(
|
|
||||||
"tjoho" + getGraphId(relation.id1) + getGraphId(relation.id2) + JSON.stringify(relation)
|
|
||||||
);
|
|
||||||
g.setEdge(
|
|
||||||
getGraphId(relation.id1),
|
|
||||||
getGraphId(relation.id2),
|
|
||||||
{
|
|
||||||
relation
|
|
||||||
},
|
|
||||||
relation.title || "DEFAULT"
|
|
||||||
);
|
|
||||||
});
|
|
||||||
const notes = diagObj.db.getNotes();
|
|
||||||
notes.forEach(function(note) {
|
|
||||||
log.debug(`Adding note: ${JSON.stringify(note)}`);
|
|
||||||
const node = svgDraw.drawNote(diagram2, note, conf, diagObj);
|
|
||||||
idCache[node.id] = node;
|
|
||||||
g.setNode(node.id, node);
|
|
||||||
if (note.class && note.class in classes) {
|
|
||||||
g.setEdge(
|
|
||||||
note.id,
|
|
||||||
getGraphId(note.class),
|
|
||||||
{
|
|
||||||
relation: {
|
|
||||||
id1: note.id,
|
|
||||||
id2: note.class,
|
|
||||||
relation: {
|
|
||||||
type1: "none",
|
|
||||||
type2: "none",
|
|
||||||
lineType: 10
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"DEFAULT"
|
|
||||||
);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
layout(g);
|
|
||||||
g.nodes().forEach(function(v) {
|
|
||||||
if (v !== void 0 && g.node(v) !== void 0) {
|
|
||||||
log.debug("Node " + v + ": " + JSON.stringify(g.node(v)));
|
|
||||||
root.select("#" + (diagObj.db.lookUpDomId(v) || v)).attr(
|
|
||||||
"transform",
|
|
||||||
"translate(" + (g.node(v).x - g.node(v).width / 2) + "," + (g.node(v).y - g.node(v).height / 2) + " )"
|
|
||||||
);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
g.edges().forEach(function(e) {
|
|
||||||
if (e !== void 0 && g.edge(e) !== void 0) {
|
|
||||||
log.debug("Edge " + e.v + " -> " + e.w + ": " + JSON.stringify(g.edge(e)));
|
|
||||||
svgDraw.drawEdge(diagram2, g.edge(e), g.edge(e).relation, conf, diagObj);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
const svgBounds = diagram2.node().getBBox();
|
|
||||||
const width = svgBounds.width + padding * 2;
|
|
||||||
const height = svgBounds.height + padding * 2;
|
|
||||||
configureSvgSize(diagram2, height, width, conf.useMaxWidth);
|
|
||||||
const vBox = `${svgBounds.x - padding} ${svgBounds.y - padding} ${width} ${height}`;
|
|
||||||
log.debug(`viewBox ${vBox}`);
|
|
||||||
diagram2.attr("viewBox", vBox);
|
|
||||||
};
|
|
||||||
const renderer = {
|
|
||||||
draw
|
|
||||||
};
|
|
||||||
const diagram = {
|
|
||||||
parser,
|
|
||||||
db,
|
|
||||||
renderer,
|
|
||||||
styles,
|
|
||||||
init: (cnf) => {
|
|
||||||
if (!cnf.class) {
|
|
||||||
cnf.class = {};
|
|
||||||
}
|
|
||||||
cnf.class.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute;
|
|
||||||
db.clear();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
export {
|
|
||||||
diagram
|
|
||||||
};
|
|
||||||
//# sourceMappingURL=classDiagram-3ab3550d.js.map
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
{"version":3,"file":"classDiagram-3ab3550d.js","sources":["../src/diagrams/class/classRenderer.js","../src/diagrams/class/classDiagram.ts"],"sourcesContent":["import { select } from 'd3';\nimport { layout as dagreLayout } from 'dagre-d3-es/src/dagre/index.js';\nimport * as graphlib from 'dagre-d3-es/src/graphlib/index.js';\nimport { log } from '../../logger';\nimport svgDraw from './svgDraw';\nimport { configureSvgSize } from '../../setupGraphViewbox';\nimport { getConfig } from '../../config';\n\nlet idCache = {};\nconst padding = 20;\n\n/**\n * Gets the ID with the same label as in the cache\n *\n * @param {string} label The label to look for\n * @returns {string} The resulting ID\n */\nconst getGraphId = function (label) {\n const foundEntry = Object.entries(idCache).find((entry) => entry[1].label === label);\n\n if (foundEntry) {\n return foundEntry[0];\n }\n};\n\n/**\n * Setup arrow head and define the marker. The result is appended to the svg.\n *\n * @param {SVGSVGElement} elem The SVG element to append to\n */\nconst insertMarkers = function (elem) {\n elem\n .append('defs')\n .append('marker')\n .attr('id', 'extensionStart')\n .attr('class', 'extension')\n .attr('refX', 0)\n .attr('refY', 7)\n .attr('markerWidth', 190)\n .attr('markerHeight', 240)\n .attr('orient', 'auto')\n .append('path')\n .attr('d', 'M 1,7 L18,13 V 1 Z');\n\n elem\n .append('defs')\n .append('marker')\n .attr('id', 'extensionEnd')\n .attr('refX', 19)\n .attr('refY', 7)\n .attr('markerWidth', 20)\n .attr('markerHeight', 28)\n .attr('orient', 'auto')\n .append('path')\n .attr('d', 'M 1,1 V 13 L18,7 Z'); // this is actual shape for arrowhead\n\n elem\n .append('defs')\n .append('marker')\n .attr('id', 'compositionStart')\n .attr('class', 'extension')\n .attr('refX', 0)\n .attr('refY', 7)\n .attr('markerWidth', 190)\n .attr('markerHeight', 240)\n .attr('orient', 'auto')\n .append('path')\n .attr('d', 'M 18,7 L9,13 L1,7 L9,1 Z');\n\n elem\n .append('defs')\n .append('marker')\n .attr('id', 'compositionEnd')\n .attr('refX', 19)\n .attr('refY', 7)\n .attr('markerWidth', 20)\n .attr('markerHeight', 28)\n .attr('orient', 'auto')\n .append('path')\n .attr('d', 'M 18,7 L9,13 L1,7 L9,1 Z');\n\n elem\n .append('defs')\n .append('marker')\n .attr('id', 'aggregationStart')\n .attr('class', 'extension')\n .attr('refX', 0)\n .attr('refY', 7)\n .attr('markerWidth', 190)\n .attr('markerHeight', 240)\n .attr('orient', 'auto')\n .append('path')\n .attr('d', 'M 18,7 L9,13 L1,7 L9,1 Z');\n\n elem\n .append('defs')\n .append('marker')\n .attr('id', 'aggregationEnd')\n .attr('refX', 19)\n .attr('refY', 7)\n .attr('markerWidth', 20)\n .attr('markerHeight', 28)\n .attr('orient', 'auto')\n .append('path')\n .attr('d', 'M 18,7 L9,13 L1,7 L9,1 Z');\n\n elem\n .append('defs')\n .append('marker')\n .attr('id', 'dependencyStart')\n .attr('class', 'extension')\n .attr('refX', 0)\n .attr('refY', 7)\n .attr('markerWidth', 190)\n .attr('markerHeight', 240)\n .attr('orient', 'auto')\n .append('path')\n .attr('d', 'M 5,7 L9,13 L1,7 L9,1 Z');\n\n elem\n .append('defs')\n .append('marker')\n .attr('id', 'dependencyEnd')\n .attr('refX', 19)\n .attr('refY', 7)\n .attr('markerWidth', 20)\n .attr('markerHeight', 28)\n .attr('orient', 'auto')\n .append('path')\n .attr('d', 'M 18,7 L9,13 L14,7 L9,1 Z');\n};\n\n/**\n * Draws a flowchart in the tag with id: id based on the graph definition in text.\n *\n * @param {string} text\n * @param {string} id\n * @param {any} _version\n * @param diagObj\n */\nexport const draw = function (text, id, _version, diagObj) {\n const conf = getConfig().class;\n idCache = {};\n // diagObj.db.clear();\n // diagObj.parser.parse(text);\n\n log.info('Rendering diagram ' + text);\n\n const securityLevel = getConfig().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 ? select(sandboxElement.nodes()[0].contentDocument.body)\n : select('body');\n\n // Fetch the default direction, use TD if none was found\n const diagram = root.select(`[id='${id}']`);\n insertMarkers(diagram);\n\n // Layout graph, Create a new directed graph\n const g = new graphlib.Graph({\n multigraph: true,\n });\n\n // Set an object for the graph label\n g.setGraph({\n isMultiGraph: true,\n });\n\n // Default to assigning a new object as a label for each new edge.\n g.setDefaultEdgeLabel(function () {\n return {};\n });\n\n const classes = diagObj.db.getClasses();\n const keys = Object.keys(classes);\n\n for (const key of keys) {\n const classDef = classes[key];\n const node = svgDraw.drawLine truncated
|
|
||||||
@@ -1,149 +0,0 @@
|
|||||||
import { p as parser, d as db, s as styles } from "./styles-0dd3ba1e.js";
|
|
||||||
import { select } from "d3";
|
|
||||||
import { layout } from "dagre-d3-es/src/dagre/index.js";
|
|
||||||
import * as graphlib from "dagre-d3-es/src/graphlib/index.js";
|
|
||||||
import { g as getConfig, l as log } from "./config-389b86ff.js";
|
|
||||||
import { s as svgDraw } from "./svgDraw-6a237a99.js";
|
|
||||||
import { c as configureSvgSize } from "./setupGraphViewbox-e35e4124.js";
|
|
||||||
import "./utils-d5eeff82.js";
|
|
||||||
import "@braintree/sanitize-url";
|
|
||||||
import "./commonDb-2ace122b.js";
|
|
||||||
import "lodash-es/memoize.js";
|
|
||||||
import "./mermaidAPI-0716c7c2.js";
|
|
||||||
import "stylis";
|
|
||||||
import "./errorRenderer-d05351b9.js";
|
|
||||||
import "dompurify";
|
|
||||||
import "lodash-es/isEmpty.js";
|
|
||||||
import "dayjs";
|
|
||||||
import "khroma";
|
|
||||||
let idCache = {};
|
|
||||||
const padding = 20;
|
|
||||||
const getGraphId = function(label) {
|
|
||||||
const foundEntry = Object.entries(idCache).find((entry) => entry[1].label === label);
|
|
||||||
if (foundEntry) {
|
|
||||||
return foundEntry[0];
|
|
||||||
}
|
|
||||||
};
|
|
||||||
const insertMarkers = function(elem) {
|
|
||||||
elem.append("defs").append("marker").attr("id", "extensionStart").attr("class", "extension").attr("refX", 0).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 1,7 L18,13 V 1 Z");
|
|
||||||
elem.append("defs").append("marker").attr("id", "extensionEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 1,1 V 13 L18,7 Z");
|
|
||||||
elem.append("defs").append("marker").attr("id", "compositionStart").attr("class", "extension").attr("refX", 0).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z");
|
|
||||||
elem.append("defs").append("marker").attr("id", "compositionEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z");
|
|
||||||
elem.append("defs").append("marker").attr("id", "aggregationStart").attr("class", "extension").attr("refX", 0).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z");
|
|
||||||
elem.append("defs").append("marker").attr("id", "aggregationEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z");
|
|
||||||
elem.append("defs").append("marker").attr("id", "dependencyStart").attr("class", "extension").attr("refX", 0).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 5,7 L9,13 L1,7 L9,1 Z");
|
|
||||||
elem.append("defs").append("marker").attr("id", "dependencyEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L14,7 L9,1 Z");
|
|
||||||
};
|
|
||||||
const draw = function(text, id, _version, diagObj) {
|
|
||||||
const conf = getConfig().class;
|
|
||||||
idCache = {};
|
|
||||||
log.info("Rendering diagram " + text);
|
|
||||||
const securityLevel = getConfig().securityLevel;
|
|
||||||
let sandboxElement;
|
|
||||||
if (securityLevel === "sandbox") {
|
|
||||||
sandboxElement = select("#i" + id);
|
|
||||||
}
|
|
||||||
const root = securityLevel === "sandbox" ? select(sandboxElement.nodes()[0].contentDocument.body) : select("body");
|
|
||||||
const diagram2 = root.select(`[id='${id}']`);
|
|
||||||
insertMarkers(diagram2);
|
|
||||||
const g = new graphlib.Graph({
|
|
||||||
multigraph: true
|
|
||||||
});
|
|
||||||
g.setGraph({
|
|
||||||
isMultiGraph: true
|
|
||||||
});
|
|
||||||
g.setDefaultEdgeLabel(function() {
|
|
||||||
return {};
|
|
||||||
});
|
|
||||||
const classes = diagObj.db.getClasses();
|
|
||||||
const keys = Object.keys(classes);
|
|
||||||
for (const key of keys) {
|
|
||||||
const classDef = classes[key];
|
|
||||||
const node = svgDraw.drawClass(diagram2, classDef, conf, diagObj);
|
|
||||||
idCache[node.id] = node;
|
|
||||||
g.setNode(node.id, node);
|
|
||||||
log.info("Org height: " + node.height);
|
|
||||||
}
|
|
||||||
const relations = diagObj.db.getRelations();
|
|
||||||
relations.forEach(function(relation) {
|
|
||||||
log.info(
|
|
||||||
"tjoho" + getGraphId(relation.id1) + getGraphId(relation.id2) + JSON.stringify(relation)
|
|
||||||
);
|
|
||||||
g.setEdge(
|
|
||||||
getGraphId(relation.id1),
|
|
||||||
getGraphId(relation.id2),
|
|
||||||
{
|
|
||||||
relation
|
|
||||||
},
|
|
||||||
relation.title || "DEFAULT"
|
|
||||||
);
|
|
||||||
});
|
|
||||||
const notes = diagObj.db.getNotes();
|
|
||||||
notes.forEach(function(note) {
|
|
||||||
log.debug(`Adding note: ${JSON.stringify(note)}`);
|
|
||||||
const node = svgDraw.drawNote(diagram2, note, conf, diagObj);
|
|
||||||
idCache[node.id] = node;
|
|
||||||
g.setNode(node.id, node);
|
|
||||||
if (note.class && note.class in classes) {
|
|
||||||
g.setEdge(
|
|
||||||
note.id,
|
|
||||||
getGraphId(note.class),
|
|
||||||
{
|
|
||||||
relation: {
|
|
||||||
id1: note.id,
|
|
||||||
id2: note.class,
|
|
||||||
relation: {
|
|
||||||
type1: "none",
|
|
||||||
type2: "none",
|
|
||||||
lineType: 10
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"DEFAULT"
|
|
||||||
);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
layout(g);
|
|
||||||
g.nodes().forEach(function(v) {
|
|
||||||
if (v !== void 0 && g.node(v) !== void 0) {
|
|
||||||
log.debug("Node " + v + ": " + JSON.stringify(g.node(v)));
|
|
||||||
root.select("#" + (diagObj.db.lookUpDomId(v) || v)).attr(
|
|
||||||
"transform",
|
|
||||||
"translate(" + (g.node(v).x - g.node(v).width / 2) + "," + (g.node(v).y - g.node(v).height / 2) + " )"
|
|
||||||
);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
g.edges().forEach(function(e) {
|
|
||||||
if (e !== void 0 && g.edge(e) !== void 0) {
|
|
||||||
log.debug("Edge " + e.v + " -> " + e.w + ": " + JSON.stringify(g.edge(e)));
|
|
||||||
svgDraw.drawEdge(diagram2, g.edge(e), g.edge(e).relation, conf, diagObj);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
const svgBounds = diagram2.node().getBBox();
|
|
||||||
const width = svgBounds.width + padding * 2;
|
|
||||||
const height = svgBounds.height + padding * 2;
|
|
||||||
configureSvgSize(diagram2, height, width, conf.useMaxWidth);
|
|
||||||
const vBox = `${svgBounds.x - padding} ${svgBounds.y - padding} ${width} ${height}`;
|
|
||||||
log.debug(`viewBox ${vBox}`);
|
|
||||||
diagram2.attr("viewBox", vBox);
|
|
||||||
};
|
|
||||||
const renderer = {
|
|
||||||
draw
|
|
||||||
};
|
|
||||||
const diagram = {
|
|
||||||
parser,
|
|
||||||
db,
|
|
||||||
renderer,
|
|
||||||
styles,
|
|
||||||
init: (cnf) => {
|
|
||||||
if (!cnf.class) {
|
|
||||||
cnf.class = {};
|
|
||||||
}
|
|
||||||
cnf.class.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute;
|
|
||||||
db.clear();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
export {
|
|
||||||
diagram
|
|
||||||
};
|
|
||||||
//# sourceMappingURL=classDiagram-4456d403.js.map
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
{"version":3,"file":"classDiagram-4456d403.js","sources":["../src/diagrams/class/classRenderer.js","../src/diagrams/class/classDiagram.ts"],"sourcesContent":["import { select } from 'd3';\nimport { layout as dagreLayout } from 'dagre-d3-es/src/dagre/index.js';\nimport * as graphlib from 'dagre-d3-es/src/graphlib/index.js';\nimport { log } from '../../logger';\nimport svgDraw from './svgDraw';\nimport { configureSvgSize } from '../../setupGraphViewbox';\nimport { getConfig } from '../../config';\n\nlet idCache = {};\nconst padding = 20;\n\n/**\n * Gets the ID with the same label as in the cache\n *\n * @param {string} label The label to look for\n * @returns {string} The resulting ID\n */\nconst getGraphId = function (label) {\n const foundEntry = Object.entries(idCache).find((entry) => entry[1].label === label);\n\n if (foundEntry) {\n return foundEntry[0];\n }\n};\n\n/**\n * Setup arrow head and define the marker. The result is appended to the svg.\n *\n * @param {SVGSVGElement} elem The SVG element to append to\n */\nconst insertMarkers = function (elem) {\n elem\n .append('defs')\n .append('marker')\n .attr('id', 'extensionStart')\n .attr('class', 'extension')\n .attr('refX', 0)\n .attr('refY', 7)\n .attr('markerWidth', 190)\n .attr('markerHeight', 240)\n .attr('orient', 'auto')\n .append('path')\n .attr('d', 'M 1,7 L18,13 V 1 Z');\n\n elem\n .append('defs')\n .append('marker')\n .attr('id', 'extensionEnd')\n .attr('refX', 19)\n .attr('refY', 7)\n .attr('markerWidth', 20)\n .attr('markerHeight', 28)\n .attr('orient', 'auto')\n .append('path')\n .attr('d', 'M 1,1 V 13 L18,7 Z'); // this is actual shape for arrowhead\n\n elem\n .append('defs')\n .append('marker')\n .attr('id', 'compositionStart')\n .attr('class', 'extension')\n .attr('refX', 0)\n .attr('refY', 7)\n .attr('markerWidth', 190)\n .attr('markerHeight', 240)\n .attr('orient', 'auto')\n .append('path')\n .attr('d', 'M 18,7 L9,13 L1,7 L9,1 Z');\n\n elem\n .append('defs')\n .append('marker')\n .attr('id', 'compositionEnd')\n .attr('refX', 19)\n .attr('refY', 7)\n .attr('markerWidth', 20)\n .attr('markerHeight', 28)\n .attr('orient', 'auto')\n .append('path')\n .attr('d', 'M 18,7 L9,13 L1,7 L9,1 Z');\n\n elem\n .append('defs')\n .append('marker')\n .attr('id', 'aggregationStart')\n .attr('class', 'extension')\n .attr('refX', 0)\n .attr('refY', 7)\n .attr('markerWidth', 190)\n .attr('markerHeight', 240)\n .attr('orient', 'auto')\n .append('path')\n .attr('d', 'M 18,7 L9,13 L1,7 L9,1 Z');\n\n elem\n .append('defs')\n .append('marker')\n .attr('id', 'aggregationEnd')\n .attr('refX', 19)\n .attr('refY', 7)\n .attr('markerWidth', 20)\n .attr('markerHeight', 28)\n .attr('orient', 'auto')\n .append('path')\n .attr('d', 'M 18,7 L9,13 L1,7 L9,1 Z');\n\n elem\n .append('defs')\n .append('marker')\n .attr('id', 'dependencyStart')\n .attr('class', 'extension')\n .attr('refX', 0)\n .attr('refY', 7)\n .attr('markerWidth', 190)\n .attr('markerHeight', 240)\n .attr('orient', 'auto')\n .append('path')\n .attr('d', 'M 5,7 L9,13 L1,7 L9,1 Z');\n\n elem\n .append('defs')\n .append('marker')\n .attr('id', 'dependencyEnd')\n .attr('refX', 19)\n .attr('refY', 7)\n .attr('markerWidth', 20)\n .attr('markerHeight', 28)\n .attr('orient', 'auto')\n .append('path')\n .attr('d', 'M 18,7 L9,13 L14,7 L9,1 Z');\n};\n\n/**\n * Draws a flowchart in the tag with id: id based on the graph definition in text.\n *\n * @param {string} text\n * @param {string} id\n * @param {any} _version\n * @param diagObj\n */\nexport const draw = function (text, id, _version, diagObj) {\n const conf = getConfig().class;\n idCache = {};\n // diagObj.db.clear();\n // diagObj.parser.parse(text);\n\n log.info('Rendering diagram ' + text);\n\n const securityLevel = getConfig().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 ? select(sandboxElement.nodes()[0].contentDocument.body)\n : select('body');\n\n // Fetch the default direction, use TD if none was found\n const diagram = root.select(`[id='${id}']`);\n insertMarkers(diagram);\n\n // Layout graph, Create a new directed graph\n const g = new graphlib.Graph({\n multigraph: true,\n });\n\n // Set an object for the graph label\n g.setGraph({\n isMultiGraph: true,\n });\n\n // Default to assigning a new object as a label for each new edge.\n g.setDefaultEdgeLabel(function () {\n return {};\n });\n\n const classes = diagObj.db.getClasses();\n const keys = Object.keys(classes);\n\n for (const key of keys) {\n const classDef = classes[key];\n const node = svgDraw.drawLine truncated
|
|
||||||
@@ -1,149 +0,0 @@
|
|||||||
import { p as parser, d as db, s as styles } from "./styles-b8bd0053.js";
|
|
||||||
import { select } from "d3";
|
|
||||||
import { layout } from "dagre-d3-es/src/dagre/index.js";
|
|
||||||
import * as graphlib from "dagre-d3-es/src/graphlib/index.js";
|
|
||||||
import { g as getConfig, l as log } from "./config-389b86ff.js";
|
|
||||||
import { s as svgDraw } from "./svgDraw-6a237a99.js";
|
|
||||||
import { c as configureSvgSize } from "./setupGraphViewbox-e35e4124.js";
|
|
||||||
import "./utils-d5eeff82.js";
|
|
||||||
import "@braintree/sanitize-url";
|
|
||||||
import "./commonDb-2ace122b.js";
|
|
||||||
import "lodash-es/memoize.js";
|
|
||||||
import "./mermaidAPI-b17c596d.js";
|
|
||||||
import "stylis";
|
|
||||||
import "./errorRenderer-d05351b9.js";
|
|
||||||
import "dompurify";
|
|
||||||
import "lodash-es/isEmpty.js";
|
|
||||||
import "dayjs";
|
|
||||||
import "khroma";
|
|
||||||
let idCache = {};
|
|
||||||
const padding = 20;
|
|
||||||
const getGraphId = function(label) {
|
|
||||||
const foundEntry = Object.entries(idCache).find((entry) => entry[1].label === label);
|
|
||||||
if (foundEntry) {
|
|
||||||
return foundEntry[0];
|
|
||||||
}
|
|
||||||
};
|
|
||||||
const insertMarkers = function(elem) {
|
|
||||||
elem.append("defs").append("marker").attr("id", "extensionStart").attr("class", "extension").attr("refX", 0).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 1,7 L18,13 V 1 Z");
|
|
||||||
elem.append("defs").append("marker").attr("id", "extensionEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 1,1 V 13 L18,7 Z");
|
|
||||||
elem.append("defs").append("marker").attr("id", "compositionStart").attr("class", "extension").attr("refX", 0).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z");
|
|
||||||
elem.append("defs").append("marker").attr("id", "compositionEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z");
|
|
||||||
elem.append("defs").append("marker").attr("id", "aggregationStart").attr("class", "extension").attr("refX", 0).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z");
|
|
||||||
elem.append("defs").append("marker").attr("id", "aggregationEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z");
|
|
||||||
elem.append("defs").append("marker").attr("id", "dependencyStart").attr("class", "extension").attr("refX", 0).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 5,7 L9,13 L1,7 L9,1 Z");
|
|
||||||
elem.append("defs").append("marker").attr("id", "dependencyEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L14,7 L9,1 Z");
|
|
||||||
};
|
|
||||||
const draw = function(text, id, _version, diagObj) {
|
|
||||||
const conf = getConfig().class;
|
|
||||||
idCache = {};
|
|
||||||
log.info("Rendering diagram " + text);
|
|
||||||
const securityLevel = getConfig().securityLevel;
|
|
||||||
let sandboxElement;
|
|
||||||
if (securityLevel === "sandbox") {
|
|
||||||
sandboxElement = select("#i" + id);
|
|
||||||
}
|
|
||||||
const root = securityLevel === "sandbox" ? select(sandboxElement.nodes()[0].contentDocument.body) : select("body");
|
|
||||||
const diagram2 = root.select(`[id='${id}']`);
|
|
||||||
insertMarkers(diagram2);
|
|
||||||
const g = new graphlib.Graph({
|
|
||||||
multigraph: true
|
|
||||||
});
|
|
||||||
g.setGraph({
|
|
||||||
isMultiGraph: true
|
|
||||||
});
|
|
||||||
g.setDefaultEdgeLabel(function() {
|
|
||||||
return {};
|
|
||||||
});
|
|
||||||
const classes = diagObj.db.getClasses();
|
|
||||||
const keys = Object.keys(classes);
|
|
||||||
for (const key of keys) {
|
|
||||||
const classDef = classes[key];
|
|
||||||
const node = svgDraw.drawClass(diagram2, classDef, conf, diagObj);
|
|
||||||
idCache[node.id] = node;
|
|
||||||
g.setNode(node.id, node);
|
|
||||||
log.info("Org height: " + node.height);
|
|
||||||
}
|
|
||||||
const relations = diagObj.db.getRelations();
|
|
||||||
relations.forEach(function(relation) {
|
|
||||||
log.info(
|
|
||||||
"tjoho" + getGraphId(relation.id1) + getGraphId(relation.id2) + JSON.stringify(relation)
|
|
||||||
);
|
|
||||||
g.setEdge(
|
|
||||||
getGraphId(relation.id1),
|
|
||||||
getGraphId(relation.id2),
|
|
||||||
{
|
|
||||||
relation
|
|
||||||
},
|
|
||||||
relation.title || "DEFAULT"
|
|
||||||
);
|
|
||||||
});
|
|
||||||
const notes = diagObj.db.getNotes();
|
|
||||||
notes.forEach(function(note) {
|
|
||||||
log.debug(`Adding note: ${JSON.stringify(note)}`);
|
|
||||||
const node = svgDraw.drawNote(diagram2, note, conf, diagObj);
|
|
||||||
idCache[node.id] = node;
|
|
||||||
g.setNode(node.id, node);
|
|
||||||
if (note.class && note.class in classes) {
|
|
||||||
g.setEdge(
|
|
||||||
note.id,
|
|
||||||
getGraphId(note.class),
|
|
||||||
{
|
|
||||||
relation: {
|
|
||||||
id1: note.id,
|
|
||||||
id2: note.class,
|
|
||||||
relation: {
|
|
||||||
type1: "none",
|
|
||||||
type2: "none",
|
|
||||||
lineType: 10
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"DEFAULT"
|
|
||||||
);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
layout(g);
|
|
||||||
g.nodes().forEach(function(v) {
|
|
||||||
if (v !== void 0 && g.node(v) !== void 0) {
|
|
||||||
log.debug("Node " + v + ": " + JSON.stringify(g.node(v)));
|
|
||||||
root.select("#" + (diagObj.db.lookUpDomId(v) || v)).attr(
|
|
||||||
"transform",
|
|
||||||
"translate(" + (g.node(v).x - g.node(v).width / 2) + "," + (g.node(v).y - g.node(v).height / 2) + " )"
|
|
||||||
);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
g.edges().forEach(function(e) {
|
|
||||||
if (e !== void 0 && g.edge(e) !== void 0) {
|
|
||||||
log.debug("Edge " + e.v + " -> " + e.w + ": " + JSON.stringify(g.edge(e)));
|
|
||||||
svgDraw.drawEdge(diagram2, g.edge(e), g.edge(e).relation, conf, diagObj);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
const svgBounds = diagram2.node().getBBox();
|
|
||||||
const width = svgBounds.width + padding * 2;
|
|
||||||
const height = svgBounds.height + padding * 2;
|
|
||||||
configureSvgSize(diagram2, height, width, conf.useMaxWidth);
|
|
||||||
const vBox = `${svgBounds.x - padding} ${svgBounds.y - padding} ${width} ${height}`;
|
|
||||||
log.debug(`viewBox ${vBox}`);
|
|
||||||
diagram2.attr("viewBox", vBox);
|
|
||||||
};
|
|
||||||
const renderer = {
|
|
||||||
draw
|
|
||||||
};
|
|
||||||
const diagram = {
|
|
||||||
parser,
|
|
||||||
db,
|
|
||||||
renderer,
|
|
||||||
styles,
|
|
||||||
init: (cnf) => {
|
|
||||||
if (!cnf.class) {
|
|
||||||
cnf.class = {};
|
|
||||||
}
|
|
||||||
cnf.class.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute;
|
|
||||||
db.clear();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
export {
|
|
||||||
diagram
|
|
||||||
};
|
|
||||||
//# sourceMappingURL=classDiagram-ef563e47.js.map
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
{"version":3,"file":"classDiagram-ef563e47.js","sources":["../src/diagrams/class/classRenderer.js","../src/diagrams/class/classDiagram.ts"],"sourcesContent":["import { select } from 'd3';\nimport { layout as dagreLayout } from 'dagre-d3-es/src/dagre/index.js';\nimport * as graphlib from 'dagre-d3-es/src/graphlib/index.js';\nimport { log } from '../../logger';\nimport svgDraw from './svgDraw';\nimport { configureSvgSize } from '../../setupGraphViewbox';\nimport { getConfig } from '../../config';\n\nlet idCache = {};\nconst padding = 20;\n\n/**\n * Gets the ID with the same label as in the cache\n *\n * @param {string} label The label to look for\n * @returns {string} The resulting ID\n */\nconst getGraphId = function (label) {\n const foundEntry = Object.entries(idCache).find((entry) => entry[1].label === label);\n\n if (foundEntry) {\n return foundEntry[0];\n }\n};\n\n/**\n * Setup arrow head and define the marker. The result is appended to the svg.\n *\n * @param {SVGSVGElement} elem The SVG element to append to\n */\nconst insertMarkers = function (elem) {\n elem\n .append('defs')\n .append('marker')\n .attr('id', 'extensionStart')\n .attr('class', 'extension')\n .attr('refX', 0)\n .attr('refY', 7)\n .attr('markerWidth', 190)\n .attr('markerHeight', 240)\n .attr('orient', 'auto')\n .append('path')\n .attr('d', 'M 1,7 L18,13 V 1 Z');\n\n elem\n .append('defs')\n .append('marker')\n .attr('id', 'extensionEnd')\n .attr('refX', 19)\n .attr('refY', 7)\n .attr('markerWidth', 20)\n .attr('markerHeight', 28)\n .attr('orient', 'auto')\n .append('path')\n .attr('d', 'M 1,1 V 13 L18,7 Z'); // this is actual shape for arrowhead\n\n elem\n .append('defs')\n .append('marker')\n .attr('id', 'compositionStart')\n .attr('class', 'extension')\n .attr('refX', 0)\n .attr('refY', 7)\n .attr('markerWidth', 190)\n .attr('markerHeight', 240)\n .attr('orient', 'auto')\n .append('path')\n .attr('d', 'M 18,7 L9,13 L1,7 L9,1 Z');\n\n elem\n .append('defs')\n .append('marker')\n .attr('id', 'compositionEnd')\n .attr('refX', 19)\n .attr('refY', 7)\n .attr('markerWidth', 20)\n .attr('markerHeight', 28)\n .attr('orient', 'auto')\n .append('path')\n .attr('d', 'M 18,7 L9,13 L1,7 L9,1 Z');\n\n elem\n .append('defs')\n .append('marker')\n .attr('id', 'aggregationStart')\n .attr('class', 'extension')\n .attr('refX', 0)\n .attr('refY', 7)\n .attr('markerWidth', 190)\n .attr('markerHeight', 240)\n .attr('orient', 'auto')\n .append('path')\n .attr('d', 'M 18,7 L9,13 L1,7 L9,1 Z');\n\n elem\n .append('defs')\n .append('marker')\n .attr('id', 'aggregationEnd')\n .attr('refX', 19)\n .attr('refY', 7)\n .attr('markerWidth', 20)\n .attr('markerHeight', 28)\n .attr('orient', 'auto')\n .append('path')\n .attr('d', 'M 18,7 L9,13 L1,7 L9,1 Z');\n\n elem\n .append('defs')\n .append('marker')\n .attr('id', 'dependencyStart')\n .attr('class', 'extension')\n .attr('refX', 0)\n .attr('refY', 7)\n .attr('markerWidth', 190)\n .attr('markerHeight', 240)\n .attr('orient', 'auto')\n .append('path')\n .attr('d', 'M 5,7 L9,13 L1,7 L9,1 Z');\n\n elem\n .append('defs')\n .append('marker')\n .attr('id', 'dependencyEnd')\n .attr('refX', 19)\n .attr('refY', 7)\n .attr('markerWidth', 20)\n .attr('markerHeight', 28)\n .attr('orient', 'auto')\n .append('path')\n .attr('d', 'M 18,7 L9,13 L14,7 L9,1 Z');\n};\n\n/**\n * Draws a flowchart in the tag with id: id based on the graph definition in text.\n *\n * @param {string} text\n * @param {string} id\n * @param {any} _version\n * @param diagObj\n */\nexport const draw = function (text, id, _version, diagObj) {\n const conf = getConfig().class;\n idCache = {};\n // diagObj.db.clear();\n // diagObj.parser.parse(text);\n\n log.info('Rendering diagram ' + text);\n\n const securityLevel = getConfig().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 ? select(sandboxElement.nodes()[0].contentDocument.body)\n : select('body');\n\n // Fetch the default direction, use TD if none was found\n const diagram = root.select(`[id='${id}']`);\n insertMarkers(diagram);\n\n // Layout graph, Create a new directed graph\n const g = new graphlib.Graph({\n multigraph: true,\n });\n\n // Set an object for the graph label\n g.setGraph({\n isMultiGraph: true,\n });\n\n // Default to assigning a new object as a label for each new edge.\n g.setDefaultEdgeLabel(function () {\n return {};\n });\n\n const classes = diagObj.db.getClasses();\n const keys = Object.keys(classes);\n\n for (const key of keys) {\n const classDef = classes[key];\n const node = svgDraw.drawLine truncated
|
|
||||||
@@ -1,97 +0,0 @@
|
|||||||
import { p as W, d as M, s as H } from "./styles-e9bde71f.js";
|
|
||||||
import { g as S, l as d, f as u } from "./config-e567ef17.js";
|
|
||||||
import { G as X, l as Y } from "./layout-10a68736.js";
|
|
||||||
import { s as l } from "./svgDraw-c2c52520.js";
|
|
||||||
import { c as Z } from "./setupGraphViewbox-a4603a92.js";
|
|
||||||
import "./utils-aa888deb.js";
|
|
||||||
import "./commonDb-4dc3d465.js";
|
|
||||||
import "./mermaidAPI-51c0c26b.js";
|
|
||||||
import "./errorRenderer-a3c4bedb.js";
|
|
||||||
import "./isPlainObject-bb374f45.js";
|
|
||||||
import "./array-2ff2c7a6.js";
|
|
||||||
import "./constant-2fe7eae5.js";
|
|
||||||
let h = {};
|
|
||||||
const g = 20, p = function(e) {
|
|
||||||
const s = Object.entries(h).find((k) => k[1].label === e);
|
|
||||||
if (s)
|
|
||||||
return s[0];
|
|
||||||
}, D = function(e) {
|
|
||||||
e.append("defs").append("marker").attr("id", "extensionStart").attr("class", "extension").attr("refX", 0).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 1,7 L18,13 V 1 Z"), e.append("defs").append("marker").attr("id", "extensionEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 1,1 V 13 L18,7 Z"), e.append("defs").append("marker").attr("id", "compositionStart").attr("class", "extension").attr("refX", 0).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"), e.append("defs").append("marker").attr("id", "compositionEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"), e.append("defs").append("marker").attr("id", "aggregationStart").attr("class", "extension").attr("refX", 0).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"), e.append("defs").append("marker").attr("id", "aggregationEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z"), e.append("defs").append("marker").attr("id", "dependencyStart").attr("class", "extension").attr("refX", 0).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 5,7 L9,13 L1,7 L9,1 Z"), e.append("defs").append("marker").attr("id", "dependencyEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L14,7 L9,1 Z");
|
|
||||||
}, $ = function(e, s, k, a) {
|
|
||||||
const f = S().class;
|
|
||||||
h = {}, d.info("Rendering diagram " + e);
|
|
||||||
const L = S().securityLevel;
|
|
||||||
let y;
|
|
||||||
L === "sandbox" && (y = u("#i" + s));
|
|
||||||
const x = L === "sandbox" ? u(y.nodes()[0].contentDocument.body) : u("body"), n = x.select(`[id='${s}']`);
|
|
||||||
D(n);
|
|
||||||
const r = new X({
|
|
||||||
multigraph: !0
|
|
||||||
});
|
|
||||||
r.setGraph({
|
|
||||||
isMultiGraph: !0
|
|
||||||
}), r.setDefaultEdgeLabel(function() {
|
|
||||||
return {};
|
|
||||||
});
|
|
||||||
const m = a.db.getClasses(), N = Object.keys(m);
|
|
||||||
for (const t of N) {
|
|
||||||
const o = m[t], i = l.drawClass(n, o, f, a);
|
|
||||||
h[i.id] = i, r.setNode(i.id, i), d.info("Org height: " + i.height);
|
|
||||||
}
|
|
||||||
a.db.getRelations().forEach(function(t) {
|
|
||||||
d.info(
|
|
||||||
"tjoho" + p(t.id1) + p(t.id2) + JSON.stringify(t)
|
|
||||||
), r.setEdge(
|
|
||||||
p(t.id1),
|
|
||||||
p(t.id2),
|
|
||||||
{
|
|
||||||
relation: t
|
|
||||||
},
|
|
||||||
t.title || "DEFAULT"
|
|
||||||
);
|
|
||||||
}), a.db.getNotes().forEach(function(t) {
|
|
||||||
d.debug(`Adding note: ${JSON.stringify(t)}`);
|
|
||||||
const o = l.drawNote(n, t, f, a);
|
|
||||||
h[o.id] = o, r.setNode(o.id, o), t.class && t.class in m && r.setEdge(
|
|
||||||
t.id,
|
|
||||||
p(t.class),
|
|
||||||
{
|
|
||||||
relation: {
|
|
||||||
id1: t.id,
|
|
||||||
id2: t.class,
|
|
||||||
relation: {
|
|
||||||
type1: "none",
|
|
||||||
type2: "none",
|
|
||||||
lineType: 10
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"DEFAULT"
|
|
||||||
);
|
|
||||||
}), Y(r), r.nodes().forEach(function(t) {
|
|
||||||
t !== void 0 && r.node(t) !== void 0 && (d.debug("Node " + t + ": " + JSON.stringify(r.node(t))), x.select("#" + (a.db.lookUpDomId(t) || t)).attr(
|
|
||||||
"transform",
|
|
||||||
"translate(" + (r.node(t).x - r.node(t).width / 2) + "," + (r.node(t).y - r.node(t).height / 2) + " )"
|
|
||||||
));
|
|
||||||
}), r.edges().forEach(function(t) {
|
|
||||||
t !== void 0 && r.edge(t) !== void 0 && (d.debug("Edge " + t.v + " -> " + t.w + ": " + JSON.stringify(r.edge(t))), l.drawEdge(n, r.edge(t), r.edge(t).relation, f, a));
|
|
||||||
});
|
|
||||||
const c = n.node().getBBox(), E = c.width + g * 2, b = c.height + g * 2;
|
|
||||||
Z(n, b, E, f.useMaxWidth);
|
|
||||||
const w = `${c.x - g} ${c.y - g} ${E} ${b}`;
|
|
||||||
d.debug(`viewBox ${w}`), n.attr("viewBox", w);
|
|
||||||
}, B = {
|
|
||||||
draw: $
|
|
||||||
}, q = {
|
|
||||||
parser: W,
|
|
||||||
db: M,
|
|
||||||
renderer: B,
|
|
||||||
styles: H,
|
|
||||||
init: (e) => {
|
|
||||||
e.class || (e.class = {}), e.class.arrowMarkerAbsolute = e.arrowMarkerAbsolute, M.clear();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
export {
|
|
||||||
q as diagram
|
|
||||||
};
|
|
||||||
//# sourceMappingURL=classDiagram-f04b3d8f.js.map
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
{"version":3,"file":"classDiagram-f04b3d8f.js","sources":["../src/diagrams/class/classRenderer.js","../src/diagrams/class/classDiagram.ts"],"sourcesContent":["import { select } from 'd3';\nimport { layout as dagreLayout } from 'dagre-d3-es/src/dagre/index.js';\nimport * as graphlib from 'dagre-d3-es/src/graphlib/index.js';\nimport { log } from '../../logger';\nimport svgDraw from './svgDraw';\nimport { configureSvgSize } from '../../setupGraphViewbox';\nimport { getConfig } from '../../config';\n\nlet idCache = {};\nconst padding = 20;\n\n/**\n * Gets the ID with the same label as in the cache\n *\n * @param {string} label The label to look for\n * @returns {string} The resulting ID\n */\nconst getGraphId = function (label) {\n const foundEntry = Object.entries(idCache).find((entry) => entry[1].label === label);\n\n if (foundEntry) {\n return foundEntry[0];\n }\n};\n\n/**\n * Setup arrow head and define the marker. The result is appended to the svg.\n *\n * @param {SVGSVGElement} elem The SVG element to append to\n */\nconst insertMarkers = function (elem) {\n elem\n .append('defs')\n .append('marker')\n .attr('id', 'extensionStart')\n .attr('class', 'extension')\n .attr('refX', 0)\n .attr('refY', 7)\n .attr('markerWidth', 190)\n .attr('markerHeight', 240)\n .attr('orient', 'auto')\n .append('path')\n .attr('d', 'M 1,7 L18,13 V 1 Z');\n\n elem\n .append('defs')\n .append('marker')\n .attr('id', 'extensionEnd')\n .attr('refX', 19)\n .attr('refY', 7)\n .attr('markerWidth', 20)\n .attr('markerHeight', 28)\n .attr('orient', 'auto')\n .append('path')\n .attr('d', 'M 1,1 V 13 L18,7 Z'); // this is actual shape for arrowhead\n\n elem\n .append('defs')\n .append('marker')\n .attr('id', 'compositionStart')\n .attr('class', 'extension')\n .attr('refX', 0)\n .attr('refY', 7)\n .attr('markerWidth', 190)\n .attr('markerHeight', 240)\n .attr('orient', 'auto')\n .append('path')\n .attr('d', 'M 18,7 L9,13 L1,7 L9,1 Z');\n\n elem\n .append('defs')\n .append('marker')\n .attr('id', 'compositionEnd')\n .attr('refX', 19)\n .attr('refY', 7)\n .attr('markerWidth', 20)\n .attr('markerHeight', 28)\n .attr('orient', 'auto')\n .append('path')\n .attr('d', 'M 18,7 L9,13 L1,7 L9,1 Z');\n\n elem\n .append('defs')\n .append('marker')\n .attr('id', 'aggregationStart')\n .attr('class', 'extension')\n .attr('refX', 0)\n .attr('refY', 7)\n .attr('markerWidth', 190)\n .attr('markerHeight', 240)\n .attr('orient', 'auto')\n .append('path')\n .attr('d', 'M 18,7 L9,13 L1,7 L9,1 Z');\n\n elem\n .append('defs')\n .append('marker')\n .attr('id', 'aggregationEnd')\n .attr('refX', 19)\n .attr('refY', 7)\n .attr('markerWidth', 20)\n .attr('markerHeight', 28)\n .attr('orient', 'auto')\n .append('path')\n .attr('d', 'M 18,7 L9,13 L1,7 L9,1 Z');\n\n elem\n .append('defs')\n .append('marker')\n .attr('id', 'dependencyStart')\n .attr('class', 'extension')\n .attr('refX', 0)\n .attr('refY', 7)\n .attr('markerWidth', 190)\n .attr('markerHeight', 240)\n .attr('orient', 'auto')\n .append('path')\n .attr('d', 'M 5,7 L9,13 L1,7 L9,1 Z');\n\n elem\n .append('defs')\n .append('marker')\n .attr('id', 'dependencyEnd')\n .attr('refX', 19)\n .attr('refY', 7)\n .attr('markerWidth', 20)\n .attr('markerHeight', 28)\n .attr('orient', 'auto')\n .append('path')\n .attr('d', 'M 18,7 L9,13 L14,7 L9,1 Z');\n};\n\n/**\n * Draws a flowchart in the tag with id: id based on the graph definition in text.\n *\n * @param {string} text\n * @param {string} id\n * @param {any} _version\n * @param diagObj\n */\nexport const draw = function (text, id, _version, diagObj) {\n const conf = getConfig().class;\n idCache = {};\n // diagObj.db.clear();\n // diagObj.parser.parse(text);\n\n log.info('Rendering diagram ' + text);\n\n const securityLevel = getConfig().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 ? select(sandboxElement.nodes()[0].contentDocument.body)\n : select('body');\n\n // Fetch the default direction, use TD if none was found\n const diagram = root.select(`[id='${id}']`);\n insertMarkers(diagram);\n\n // Layout graph, Create a new directed graph\n const g = new graphlib.Graph({\n multigraph: true,\n });\n\n // Set an object for the graph label\n g.setGraph({\n isMultiGraph: true,\n });\n\n // Default to assigning a new object as a label for each new edge.\n g.setDefaultEdgeLabel(function () {\n return {};\n });\n\n const classes = diagObj.db.getClasses();\n const keys = Object.keys(classes);\n\n for (const key of keys) {\n const classDef = classes[key];\n const node = svgDraw.drawLine truncated
|
|
||||||
@@ -1,143 +0,0 @@
|
|||||||
import { p as parser, d as db, s as styles } from "./styles-ee347520.js";
|
|
||||||
import { g as getConfig, l as log, f as select } from "./config-b4fa35bb.js";
|
|
||||||
import { G as Graph, l as layout } from "./layout-47a4d1ce.js";
|
|
||||||
import { s as svgDraw } from "./svgDraw-aae20718.js";
|
|
||||||
import { c as configureSvgSize } from "./setupGraphViewbox-16a0ba81.js";
|
|
||||||
import "./utils-872dfc50.js";
|
|
||||||
import "./commonDb-7f40ab5a.js";
|
|
||||||
import "./mermaidAPI-a31c2c80.js";
|
|
||||||
import "./errorRenderer-ebf63d74.js";
|
|
||||||
import "./isPlainObject-53794b96.js";
|
|
||||||
import "./array-b7dcf730.js";
|
|
||||||
import "./constant-b644328d.js";
|
|
||||||
let idCache = {};
|
|
||||||
const padding = 20;
|
|
||||||
const getGraphId = function(label) {
|
|
||||||
const foundEntry = Object.entries(idCache).find((entry) => entry[1].label === label);
|
|
||||||
if (foundEntry) {
|
|
||||||
return foundEntry[0];
|
|
||||||
}
|
|
||||||
};
|
|
||||||
const insertMarkers = function(elem) {
|
|
||||||
elem.append("defs").append("marker").attr("id", "extensionStart").attr("class", "extension").attr("refX", 0).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 1,7 L18,13 V 1 Z");
|
|
||||||
elem.append("defs").append("marker").attr("id", "extensionEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 1,1 V 13 L18,7 Z");
|
|
||||||
elem.append("defs").append("marker").attr("id", "compositionStart").attr("class", "extension").attr("refX", 0).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z");
|
|
||||||
elem.append("defs").append("marker").attr("id", "compositionEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z");
|
|
||||||
elem.append("defs").append("marker").attr("id", "aggregationStart").attr("class", "extension").attr("refX", 0).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z");
|
|
||||||
elem.append("defs").append("marker").attr("id", "aggregationEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L1,7 L9,1 Z");
|
|
||||||
elem.append("defs").append("marker").attr("id", "dependencyStart").attr("class", "extension").attr("refX", 0).attr("refY", 7).attr("markerWidth", 190).attr("markerHeight", 240).attr("orient", "auto").append("path").attr("d", "M 5,7 L9,13 L1,7 L9,1 Z");
|
|
||||||
elem.append("defs").append("marker").attr("id", "dependencyEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 18,7 L9,13 L14,7 L9,1 Z");
|
|
||||||
};
|
|
||||||
const draw = function(text, id, _version, diagObj) {
|
|
||||||
const conf = getConfig().class;
|
|
||||||
idCache = {};
|
|
||||||
log.info("Rendering diagram " + text);
|
|
||||||
const securityLevel = getConfig().securityLevel;
|
|
||||||
let sandboxElement;
|
|
||||||
if (securityLevel === "sandbox") {
|
|
||||||
sandboxElement = select("#i" + id);
|
|
||||||
}
|
|
||||||
const root = securityLevel === "sandbox" ? select(sandboxElement.nodes()[0].contentDocument.body) : select("body");
|
|
||||||
const diagram2 = root.select(`[id='${id}']`);
|
|
||||||
insertMarkers(diagram2);
|
|
||||||
const g = new Graph({
|
|
||||||
multigraph: true
|
|
||||||
});
|
|
||||||
g.setGraph({
|
|
||||||
isMultiGraph: true
|
|
||||||
});
|
|
||||||
g.setDefaultEdgeLabel(function() {
|
|
||||||
return {};
|
|
||||||
});
|
|
||||||
const classes = diagObj.db.getClasses();
|
|
||||||
const keys = Object.keys(classes);
|
|
||||||
for (const key of keys) {
|
|
||||||
const classDef = classes[key];
|
|
||||||
const node = svgDraw.drawClass(diagram2, classDef, conf, diagObj);
|
|
||||||
idCache[node.id] = node;
|
|
||||||
g.setNode(node.id, node);
|
|
||||||
log.info("Org height: " + node.height);
|
|
||||||
}
|
|
||||||
const relations = diagObj.db.getRelations();
|
|
||||||
relations.forEach(function(relation) {
|
|
||||||
log.info(
|
|
||||||
"tjoho" + getGraphId(relation.id1) + getGraphId(relation.id2) + JSON.stringify(relation)
|
|
||||||
);
|
|
||||||
g.setEdge(
|
|
||||||
getGraphId(relation.id1),
|
|
||||||
getGraphId(relation.id2),
|
|
||||||
{
|
|
||||||
relation
|
|
||||||
},
|
|
||||||
relation.title || "DEFAULT"
|
|
||||||
);
|
|
||||||
});
|
|
||||||
const notes = diagObj.db.getNotes();
|
|
||||||
notes.forEach(function(note) {
|
|
||||||
log.debug(`Adding note: ${JSON.stringify(note)}`);
|
|
||||||
const node = svgDraw.drawNote(diagram2, note, conf, diagObj);
|
|
||||||
idCache[node.id] = node;
|
|
||||||
g.setNode(node.id, node);
|
|
||||||
if (note.class && note.class in classes) {
|
|
||||||
g.setEdge(
|
|
||||||
note.id,
|
|
||||||
getGraphId(note.class),
|
|
||||||
{
|
|
||||||
relation: {
|
|
||||||
id1: note.id,
|
|
||||||
id2: note.class,
|
|
||||||
relation: {
|
|
||||||
type1: "none",
|
|
||||||
type2: "none",
|
|
||||||
lineType: 10
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"DEFAULT"
|
|
||||||
);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
layout(g);
|
|
||||||
g.nodes().forEach(function(v) {
|
|
||||||
if (v !== void 0 && g.node(v) !== void 0) {
|
|
||||||
log.debug("Node " + v + ": " + JSON.stringify(g.node(v)));
|
|
||||||
root.select("#" + (diagObj.db.lookUpDomId(v) || v)).attr(
|
|
||||||
"transform",
|
|
||||||
"translate(" + (g.node(v).x - g.node(v).width / 2) + "," + (g.node(v).y - g.node(v).height / 2) + " )"
|
|
||||||
);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
g.edges().forEach(function(e) {
|
|
||||||
if (e !== void 0 && g.edge(e) !== void 0) {
|
|
||||||
log.debug("Edge " + e.v + " -> " + e.w + ": " + JSON.stringify(g.edge(e)));
|
|
||||||
svgDraw.drawEdge(diagram2, g.edge(e), g.edge(e).relation, conf, diagObj);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
const svgBounds = diagram2.node().getBBox();
|
|
||||||
const width = svgBounds.width + padding * 2;
|
|
||||||
const height = svgBounds.height + padding * 2;
|
|
||||||
configureSvgSize(diagram2, height, width, conf.useMaxWidth);
|
|
||||||
const vBox = `${svgBounds.x - padding} ${svgBounds.y - padding} ${width} ${height}`;
|
|
||||||
log.debug(`viewBox ${vBox}`);
|
|
||||||
diagram2.attr("viewBox", vBox);
|
|
||||||
};
|
|
||||||
const renderer = {
|
|
||||||
draw
|
|
||||||
};
|
|
||||||
const diagram = {
|
|
||||||
parser,
|
|
||||||
db,
|
|
||||||
renderer,
|
|
||||||
styles,
|
|
||||||
init: (cnf) => {
|
|
||||||
if (!cnf.class) {
|
|
||||||
cnf.class = {};
|
|
||||||
}
|
|
||||||
cnf.class.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute;
|
|
||||||
db.clear();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
export {
|
|
||||||
diagram
|
|
||||||
};
|
|
||||||
//# sourceMappingURL=classDiagram-ffa2ea72.js.map
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
{"version":3,"file":"classDiagram-ffa2ea72.js","sources":["../src/diagrams/class/classRenderer.js","../src/diagrams/class/classDiagram.ts"],"sourcesContent":["import { select } from 'd3';\nimport { layout as dagreLayout } from 'dagre-d3-es/src/dagre/index.js';\nimport * as graphlib from 'dagre-d3-es/src/graphlib/index.js';\nimport { log } from '../../logger';\nimport svgDraw from './svgDraw';\nimport { configureSvgSize } from '../../setupGraphViewbox';\nimport { getConfig } from '../../config';\n\nlet idCache = {};\nconst padding = 20;\n\n/**\n * Gets the ID with the same label as in the cache\n *\n * @param {string} label The label to look for\n * @returns {string} The resulting ID\n */\nconst getGraphId = function (label) {\n const foundEntry = Object.entries(idCache).find((entry) => entry[1].label === label);\n\n if (foundEntry) {\n return foundEntry[0];\n }\n};\n\n/**\n * Setup arrow head and define the marker. The result is appended to the svg.\n *\n * @param {SVGSVGElement} elem The SVG element to append to\n */\nconst insertMarkers = function (elem) {\n elem\n .append('defs')\n .append('marker')\n .attr('id', 'extensionStart')\n .attr('class', 'extension')\n .attr('refX', 0)\n .attr('refY', 7)\n .attr('markerWidth', 190)\n .attr('markerHeight', 240)\n .attr('orient', 'auto')\n .append('path')\n .attr('d', 'M 1,7 L18,13 V 1 Z');\n\n elem\n .append('defs')\n .append('marker')\n .attr('id', 'extensionEnd')\n .attr('refX', 19)\n .attr('refY', 7)\n .attr('markerWidth', 20)\n .attr('markerHeight', 28)\n .attr('orient', 'auto')\n .append('path')\n .attr('d', 'M 1,1 V 13 L18,7 Z'); // this is actual shape for arrowhead\n\n elem\n .append('defs')\n .append('marker')\n .attr('id', 'compositionStart')\n .attr('class', 'extension')\n .attr('refX', 0)\n .attr('refY', 7)\n .attr('markerWidth', 190)\n .attr('markerHeight', 240)\n .attr('orient', 'auto')\n .append('path')\n .attr('d', 'M 18,7 L9,13 L1,7 L9,1 Z');\n\n elem\n .append('defs')\n .append('marker')\n .attr('id', 'compositionEnd')\n .attr('refX', 19)\n .attr('refY', 7)\n .attr('markerWidth', 20)\n .attr('markerHeight', 28)\n .attr('orient', 'auto')\n .append('path')\n .attr('d', 'M 18,7 L9,13 L1,7 L9,1 Z');\n\n elem\n .append('defs')\n .append('marker')\n .attr('id', 'aggregationStart')\n .attr('class', 'extension')\n .attr('refX', 0)\n .attr('refY', 7)\n .attr('markerWidth', 190)\n .attr('markerHeight', 240)\n .attr('orient', 'auto')\n .append('path')\n .attr('d', 'M 18,7 L9,13 L1,7 L9,1 Z');\n\n elem\n .append('defs')\n .append('marker')\n .attr('id', 'aggregationEnd')\n .attr('refX', 19)\n .attr('refY', 7)\n .attr('markerWidth', 20)\n .attr('markerHeight', 28)\n .attr('orient', 'auto')\n .append('path')\n .attr('d', 'M 18,7 L9,13 L1,7 L9,1 Z');\n\n elem\n .append('defs')\n .append('marker')\n .attr('id', 'dependencyStart')\n .attr('class', 'extension')\n .attr('refX', 0)\n .attr('refY', 7)\n .attr('markerWidth', 190)\n .attr('markerHeight', 240)\n .attr('orient', 'auto')\n .append('path')\n .attr('d', 'M 5,7 L9,13 L1,7 L9,1 Z');\n\n elem\n .append('defs')\n .append('marker')\n .attr('id', 'dependencyEnd')\n .attr('refX', 19)\n .attr('refY', 7)\n .attr('markerWidth', 20)\n .attr('markerHeight', 28)\n .attr('orient', 'auto')\n .append('path')\n .attr('d', 'M 18,7 L9,13 L14,7 L9,1 Z');\n};\n\n/**\n * Draws a flowchart in the tag with id: id based on the graph definition in text.\n *\n * @param {string} text\n * @param {string} id\n * @param {any} _version\n * @param diagObj\n */\nexport const draw = function (text, id, _version, diagObj) {\n const conf = getConfig().class;\n idCache = {};\n // diagObj.db.clear();\n // diagObj.parser.parse(text);\n\n log.info('Rendering diagram ' + text);\n\n const securityLevel = getConfig().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 ? select(sandboxElement.nodes()[0].contentDocument.body)\n : select('body');\n\n // Fetch the default direction, use TD if none was found\n const diagram = root.select(`[id='${id}']`);\n insertMarkers(diagram);\n\n // Layout graph, Create a new directed graph\n const g = new graphlib.Graph({\n multigraph: true,\n });\n\n // Set an object for the graph label\n g.setGraph({\n isMultiGraph: true,\n });\n\n // Default to assigning a new object as a label for each new edge.\n g.setDefaultEdgeLabel(function () {\n return {};\n });\n\n const classes = diagObj.db.getClasses();\n const keys = Object.keys(classes);\n\n for (const key of keys) {\n const classDef = classes[key];\n const node = svgDraw.drawLine truncated
|
|
||||||
@@ -1,200 +0,0 @@
|
|||||||
import { p as M, d as k, s as R } from "./styles-55d85316.js";
|
|
||||||
import { l as p, g as r, f as v, e as C } from "./config-e567ef17.js";
|
|
||||||
import { G as B } from "./layout-d6d8be39.js";
|
|
||||||
import { r as G } from "./index-e6caf2ad.js";
|
|
||||||
import { u as I, z as D, x as E, y as _ } from "./utils-aa888deb.js";
|
|
||||||
import { s as z } from "./setupGraphViewbox-a4603a92.js";
|
|
||||||
import "./mermaidAPI-04b5c286.js";
|
|
||||||
import "./errorRenderer-a3c4bedb.js";
|
|
||||||
import "./commonDb-4dc3d465.js";
|
|
||||||
import "./isPlainObject-a5cb4071.js";
|
|
||||||
import "./array-2ff2c7a6.js";
|
|
||||||
import "./constant-2fe7eae5.js";
|
|
||||||
import "./edges-0979260b.js";
|
|
||||||
import "./svgDraw-c034b55e.js";
|
|
||||||
const A = (l) => C.sanitizeText(l, r());
|
|
||||||
let S = {
|
|
||||||
dividerMargin: 10,
|
|
||||||
padding: 5,
|
|
||||||
textHeight: 10,
|
|
||||||
curve: void 0
|
|
||||||
};
|
|
||||||
const $ = function(l, o, b, a) {
|
|
||||||
const e = Object.keys(l);
|
|
||||||
p.info("keys:", e), p.info(l), e.forEach(function(s) {
|
|
||||||
var y, m;
|
|
||||||
const t = l[s];
|
|
||||||
let i = "";
|
|
||||||
t.cssClasses.length > 0 && (i = i + " " + t.cssClasses.join(" "));
|
|
||||||
const n = { labelStyle: "", style: "" }, f = t.label ?? t.id, c = 0, u = "class_box", d = {
|
|
||||||
labelStyle: n.labelStyle,
|
|
||||||
shape: u,
|
|
||||||
labelText: A(f),
|
|
||||||
classData: t,
|
|
||||||
rx: c,
|
|
||||||
ry: c,
|
|
||||||
class: i,
|
|
||||||
style: n.style,
|
|
||||||
id: t.id,
|
|
||||||
domId: t.domId,
|
|
||||||
tooltip: a.db.getTooltip(t.id) || "",
|
|
||||||
haveCallback: t.haveCallback,
|
|
||||||
link: t.link,
|
|
||||||
width: t.type === "group" ? 500 : void 0,
|
|
||||||
type: t.type,
|
|
||||||
// TODO V10: Flowchart ? Keeping flowchart for backwards compatibility. Remove in next major release
|
|
||||||
padding: ((y = r().flowchart) == null ? void 0 : y.padding) ?? ((m = r().class) == null ? void 0 : m.padding)
|
|
||||||
};
|
|
||||||
o.setNode(t.id, d), p.info("setNode", d);
|
|
||||||
});
|
|
||||||
}, q = function(l, o, b, a) {
|
|
||||||
p.info(l), l.forEach(function(e, s) {
|
|
||||||
var x, h;
|
|
||||||
const t = e, i = "", n = { labelStyle: "", style: "" }, f = t.text, c = 0, u = "note", d = {
|
|
||||||
labelStyle: n.labelStyle,
|
|
||||||
shape: u,
|
|
||||||
labelText: A(f),
|
|
||||||
noteData: t,
|
|
||||||
rx: c,
|
|
||||||
ry: c,
|
|
||||||
class: i,
|
|
||||||
style: n.style,
|
|
||||||
id: t.id,
|
|
||||||
domId: t.id,
|
|
||||||
tooltip: "",
|
|
||||||
type: "note",
|
|
||||||
// TODO V10: Flowchart ? Keeping flowchart for backwards compatibility. Remove in next major release
|
|
||||||
padding: ((x = r().flowchart) == null ? void 0 : x.padding) ?? ((h = r().class) == null ? void 0 : h.padding)
|
|
||||||
};
|
|
||||||
if (o.setNode(t.id, d), p.info("setNode", d), !t.class || !(t.class in a))
|
|
||||||
return;
|
|
||||||
const y = b + s, m = {
|
|
||||||
id: `edgeNote${y}`,
|
|
||||||
//Set relationship style and line type
|
|
||||||
classes: "relation",
|
|
||||||
pattern: "dotted",
|
|
||||||
// Set link type for rendering
|
|
||||||
arrowhead: "none",
|
|
||||||
//Set edge extra labels
|
|
||||||
startLabelRight: "",
|
|
||||||
endLabelLeft: "",
|
|
||||||
//Set relation arrow types
|
|
||||||
arrowTypeStart: "none",
|
|
||||||
arrowTypeEnd: "none",
|
|
||||||
style: "fill:none",
|
|
||||||
labelStyle: "",
|
|
||||||
curve: D(S.curve, E)
|
|
||||||
};
|
|
||||||
o.setEdge(t.id, t.class, m, y);
|
|
||||||
});
|
|
||||||
}, F = function(l, o) {
|
|
||||||
const b = r().flowchart;
|
|
||||||
let a = 0;
|
|
||||||
l.forEach(function(e) {
|
|
||||||
var t;
|
|
||||||
a++;
|
|
||||||
const s = {
|
|
||||||
//Set relationship style and line type
|
|
||||||
classes: "relation",
|
|
||||||
pattern: e.relation.lineType == 1 ? "dashed" : "solid",
|
|
||||||
id: "id" + a,
|
|
||||||
// Set link type for rendering
|
|
||||||
arrowhead: e.type === "arrow_open" ? "none" : "normal",
|
|
||||||
//Set edge extra labels
|
|
||||||
startLabelRight: e.relationTitle1 === "none" ? "" : e.relationTitle1,
|
|
||||||
endLabelLeft: e.relationTitle2 === "none" ? "" : e.relationTitle2,
|
|
||||||
//Set relation arrow types
|
|
||||||
arrowTypeStart: L(e.relation.type1),
|
|
||||||
arrowTypeEnd: L(e.relation.type2),
|
|
||||||
style: "fill:none",
|
|
||||||
labelStyle: "",
|
|
||||||
curve: D(b == null ? void 0 : b.curve, E)
|
|
||||||
};
|
|
||||||
if (p.info(s, e), e.style !== void 0) {
|
|
||||||
const i = _(e.style);
|
|
||||||
s.style = i.style, s.labelStyle = i.labelStyle;
|
|
||||||
}
|
|
||||||
e.text = e.title, e.text === void 0 ? e.style !== void 0 && (s.arrowheadStyle = "fill: #333") : (s.arrowheadStyle = "fill: #333", s.labelpos = "c", ((t = r().flowchart) == null ? void 0 : t.htmlLabels) ?? r().htmlLabels ? (s.labelType = "html", s.label = '<span class="edgeLabel">' + e.text + "</span>") : (s.labelType = "text", s.label = e.text.replace(C.lineBreakRegex, `
|
|
||||||
`), e.style === void 0 && (s.style = s.style || "stroke: #333; stroke-width: 1.5px;fill:none"), s.labelStyle = s.labelStyle.replace("color:", "fill:"))), o.setEdge(e.id1, e.id2, s, a);
|
|
||||||
});
|
|
||||||
}, H = function(l) {
|
|
||||||
S = {
|
|
||||||
...S,
|
|
||||||
...l
|
|
||||||
};
|
|
||||||
}, P = function(l, o, b, a) {
|
|
||||||
p.info("Drawing class - ", o);
|
|
||||||
const e = r().flowchart ?? r().class, s = r().securityLevel;
|
|
||||||
p.info("config:", e);
|
|
||||||
const t = (e == null ? void 0 : e.nodeSpacing) ?? 50, i = (e == null ? void 0 : e.rankSpacing) ?? 50, n = new B({
|
|
||||||
multigraph: !0,
|
|
||||||
compound: !0
|
|
||||||
}).setGraph({
|
|
||||||
rankdir: a.db.getDirection(),
|
|
||||||
nodesep: t,
|
|
||||||
ranksep: i,
|
|
||||||
marginx: 8,
|
|
||||||
marginy: 8
|
|
||||||
}).setDefaultEdgeLabel(function() {
|
|
||||||
return {};
|
|
||||||
}), f = a.db.getClasses(), c = a.db.getRelations(), u = a.db.getNotes();
|
|
||||||
p.info(c), $(f, n, o, a), F(c, n), q(u, n, c.length + 1, f);
|
|
||||||
let d;
|
|
||||||
s === "sandbox" && (d = v("#i" + o));
|
|
||||||
const y = s === "sandbox" ? (
|
|
||||||
// @ts-ignore Ignore type error for now
|
|
||||||
v(d.nodes()[0].contentDocument.body)
|
|
||||||
) : v("body"), m = y.select(`[id="${o}"]`), x = y.select("#" + o + " g");
|
|
||||||
if (G(
|
|
||||||
x,
|
|
||||||
n,
|
|
||||||
["aggregation", "extension", "composition", "dependency", "lollipop"],
|
|
||||||
"classDiagram",
|
|
||||||
o
|
|
||||||
), I.insertTitle(m, "classTitleText", (e == null ? void 0 : e.titleTopMargin) ?? 5, a.db.getDiagramTitle()), z(n, m, e == null ? void 0 : e.diagramPadding, e == null ? void 0 : e.useMaxWidth), !(e != null && e.htmlLabels)) {
|
|
||||||
const h = s === "sandbox" ? d.nodes()[0].contentDocument : document, N = h.querySelectorAll('[id="' + o + '"] .edgeLabel .label');
|
|
||||||
for (const w of N) {
|
|
||||||
const T = w.getBBox(), g = h.createElementNS("http://www.w3.org/2000/svg", "rect");
|
|
||||||
g.setAttribute("rx", 0), g.setAttribute("ry", 0), g.setAttribute("width", T.width), g.setAttribute("height", T.height), w.insertBefore(g, w.firstChild);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
function L(l) {
|
|
||||||
let o;
|
|
||||||
switch (l) {
|
|
||||||
case 0:
|
|
||||||
o = "aggregation";
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
o = "extension";
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
o = "composition";
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
o = "dependency";
|
|
||||||
break;
|
|
||||||
case 4:
|
|
||||||
o = "lollipop";
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
o = "none";
|
|
||||||
}
|
|
||||||
return o;
|
|
||||||
}
|
|
||||||
const V = {
|
|
||||||
setConf: H,
|
|
||||||
draw: P
|
|
||||||
}, le = {
|
|
||||||
parser: M,
|
|
||||||
db: k,
|
|
||||||
renderer: V,
|
|
||||||
styles: R,
|
|
||||||
init: (l) => {
|
|
||||||
l.class || (l.class = {}), l.class.arrowMarkerAbsolute = l.arrowMarkerAbsolute, k.clear();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
export {
|
|
||||||
le as diagram
|
|
||||||
};
|
|
||||||
//# sourceMappingURL=classDiagram-v2-146d8a48.js.map
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
{"version":3,"file":"classDiagram-v2-146d8a48.js","sources":["../src/diagrams/class/classRenderer-v2.ts","../src/diagrams/class/classDiagram-v2.ts"],"sourcesContent":["// @ts-ignore d3 types are not available\nimport { select, curveLinear } from 'd3';\nimport * as graphlib from 'dagre-d3-es/src/graphlib/index.js';\nimport { log } from '../../logger';\nimport { getConfig } from '../../config';\nimport { render } from '../../dagre-wrapper/index.js';\nimport utils from '../../utils';\nimport { interpolateToCurve, getStylesFromArray } from '../../utils';\nimport { setupGraphViewbox } from '../../setupGraphViewbox';\nimport common from '../common/common';\nimport { ClassRelation, ClassNote, ClassMap, EdgeData } from './classTypes';\n\nconst sanitizeText = (txt: string) => common.sanitizeText(txt, getConfig());\n\nlet conf = {\n dividerMargin: 10,\n padding: 5,\n textHeight: 10,\n curve: undefined,\n};\n\n/**\n * Function that adds the vertices found during parsing to the graph to be rendered.\n *\n * @param classes - Object containing the vertices.\n * @param g - The graph that is to be drawn.\n * @param _id - id of the graph\n * @param diagObj - The diagram object\n */\nexport const addClasses = function (\n classes: ClassMap,\n g: graphlib.Graph,\n _id: string,\n diagObj: any\n) {\n const keys = Object.keys(classes);\n log.info('keys:', keys);\n log.info(classes);\n\n // Iterate through each item in the vertex object (containing all the vertices found) in the graph definition\n keys.forEach(function (id) {\n const vertex = classes[id];\n\n /**\n * Variable for storing the classes for the vertex\n */\n let cssClassStr = '';\n if (vertex.cssClasses.length > 0) {\n cssClassStr = cssClassStr + ' ' + vertex.cssClasses.join(' ');\n }\n\n const styles = { labelStyle: '', style: '' }; //getStylesFromArray(vertex.styles);\n\n // Use vertex id as text in the box if no text is provided by the graph definition\n const vertexText = vertex.label ?? vertex.id;\n const radius = 0;\n const shape = 'class_box';\n // Add the node\n const node = {\n labelStyle: styles.labelStyle,\n shape: shape,\n labelText: sanitizeText(vertexText),\n classData: vertex,\n rx: radius,\n ry: radius,\n class: cssClassStr,\n style: styles.style,\n id: vertex.id,\n domId: vertex.domId,\n tooltip: diagObj.db.getTooltip(vertex.id) || '',\n haveCallback: vertex.haveCallback,\n link: vertex.link,\n width: vertex.type === 'group' ? 500 : undefined,\n type: vertex.type,\n // TODO V10: Flowchart ? Keeping flowchart for backwards compatibility. Remove in next major release\n padding: getConfig().flowchart?.padding ?? getConfig().class?.padding,\n };\n g.setNode(vertex.id, node);\n log.info('setNode', node);\n });\n};\n\n/**\n * Function that adds the additional vertices (notes) found during parsing to the graph to be rendered.\n *\n * @param notes - Object containing the additional vertices (notes).\n * @param g - The graph that is to be drawn.\n * @param startEdgeId - starting index for note edge\n * @param classes - Classes\n */\nexport const addNotes = function (\n notes: ClassNote[],\n g: graphlib.Graph,\n startEdgeId: number,\n classes: ClassMap\n) {\n log.info(notes);\n\n // Iterate through each item in the vertex object (containing all the vertices found) in the graph definition\n notes.forEach(function (note, i) {\n const vertex = note;\n\n /**\n * Variable for storing the classes for the vertex\n *\n */\n const cssNoteStr = '';\n\n const styles = { labelStyle: '', style: '' };\n\n // Use vertex id as text in the box if no text is provided by the graph definition\n const vertexText = vertex.text;\n\n const radius = 0;\n const shape = 'note';\n // Add the node\n const node = {\n labelStyle: styles.labelStyle,\n shape: shape,\n labelText: sanitizeText(vertexText),\n noteData: vertex,\n rx: radius,\n ry: radius,\n class: cssNoteStr,\n style: styles.style,\n id: vertex.id,\n domId: vertex.id,\n tooltip: '',\n type: 'note',\n // TODO V10: Flowchart ? Keeping flowchart for backwards compatibility. Remove in next major release\n padding: getConfig().flowchart?.padding ?? getConfig().class?.padding,\n };\n g.setNode(vertex.id, node);\n log.info('setNode', node);\n\n if (!vertex.class || !(vertex.class in classes)) {\n return;\n }\n const edgeId = startEdgeId + i;\n\n const edgeData: EdgeData = {\n id: `edgeNote${edgeId}`,\n //Set relationship style and line type\n classes: 'relation',\n pattern: 'dotted',\n // Set link type for rendering\n arrowhead: 'none',\n //Set edge extra labels\n startLabelRight: '',\n endLabelLeft: '',\n //Set relation arrow types\n arrowTypeStart: 'none',\n arrowTypeEnd: 'none'Line truncated
|
|
||||||
@@ -1,279 +0,0 @@
|
|||||||
import { p as parser, d as db, s as styles } from "./styles-0dd3ba1e.js";
|
|
||||||
import { select, curveLinear } from "d3";
|
|
||||||
import * as graphlib from "dagre-d3-es/src/graphlib/index.js";
|
|
||||||
import { l as log, g as getConfig, d as common } from "./config-389b86ff.js";
|
|
||||||
import { r as render } from "./index-f9d09cc9.js";
|
|
||||||
import { u as utils, n as interpolateToCurve, m as getStylesFromArray } from "./utils-d5eeff82.js";
|
|
||||||
import { s as setupGraphViewbox } from "./setupGraphViewbox-e35e4124.js";
|
|
||||||
import "./mermaidAPI-0716c7c2.js";
|
|
||||||
import "stylis";
|
|
||||||
import "./errorRenderer-d05351b9.js";
|
|
||||||
import "dompurify";
|
|
||||||
import "lodash-es/isEmpty.js";
|
|
||||||
import "./commonDb-2ace122b.js";
|
|
||||||
import "dayjs";
|
|
||||||
import "khroma";
|
|
||||||
import "dagre-d3-es/src/dagre/index.js";
|
|
||||||
import "dagre-d3-es/src/graphlib/json.js";
|
|
||||||
import "./edges-65da65dc.js";
|
|
||||||
import "./svgDraw-6a237a99.js";
|
|
||||||
import "@braintree/sanitize-url";
|
|
||||||
import "lodash-es/memoize.js";
|
|
||||||
const sanitizeText = (txt) => common.sanitizeText(txt, getConfig());
|
|
||||||
let conf = {
|
|
||||||
dividerMargin: 10,
|
|
||||||
padding: 5,
|
|
||||||
textHeight: 10,
|
|
||||||
curve: void 0
|
|
||||||
};
|
|
||||||
const addClasses = function(classes, g, _id, diagObj) {
|
|
||||||
const keys = Object.keys(classes);
|
|
||||||
log.info("keys:", keys);
|
|
||||||
log.info(classes);
|
|
||||||
keys.forEach(function(id) {
|
|
||||||
var _a, _b;
|
|
||||||
const vertex = classes[id];
|
|
||||||
let cssClassStr = "";
|
|
||||||
if (vertex.cssClasses.length > 0) {
|
|
||||||
cssClassStr = cssClassStr + " " + vertex.cssClasses.join(" ");
|
|
||||||
}
|
|
||||||
const styles2 = { labelStyle: "", style: "" };
|
|
||||||
const vertexText = vertex.label ?? vertex.id;
|
|
||||||
const radius = 0;
|
|
||||||
const shape = "class_box";
|
|
||||||
const node = {
|
|
||||||
labelStyle: styles2.labelStyle,
|
|
||||||
shape,
|
|
||||||
labelText: sanitizeText(vertexText),
|
|
||||||
classData: vertex,
|
|
||||||
rx: radius,
|
|
||||||
ry: radius,
|
|
||||||
class: cssClassStr,
|
|
||||||
style: styles2.style,
|
|
||||||
id: vertex.id,
|
|
||||||
domId: vertex.domId,
|
|
||||||
tooltip: diagObj.db.getTooltip(vertex.id) || "",
|
|
||||||
haveCallback: vertex.haveCallback,
|
|
||||||
link: vertex.link,
|
|
||||||
width: vertex.type === "group" ? 500 : void 0,
|
|
||||||
type: vertex.type,
|
|
||||||
// TODO V10: Flowchart ? Keeping flowchart for backwards compatibility. Remove in next major release
|
|
||||||
padding: ((_a = getConfig().flowchart) == null ? void 0 : _a.padding) ?? ((_b = getConfig().class) == null ? void 0 : _b.padding)
|
|
||||||
};
|
|
||||||
g.setNode(vertex.id, node);
|
|
||||||
log.info("setNode", node);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
const addNotes = function(notes, g, startEdgeId, classes) {
|
|
||||||
log.info(notes);
|
|
||||||
notes.forEach(function(note, i) {
|
|
||||||
var _a, _b;
|
|
||||||
const vertex = note;
|
|
||||||
const cssNoteStr = "";
|
|
||||||
const styles2 = { labelStyle: "", style: "" };
|
|
||||||
const vertexText = vertex.text;
|
|
||||||
const radius = 0;
|
|
||||||
const shape = "note";
|
|
||||||
const node = {
|
|
||||||
labelStyle: styles2.labelStyle,
|
|
||||||
shape,
|
|
||||||
labelText: sanitizeText(vertexText),
|
|
||||||
noteData: vertex,
|
|
||||||
rx: radius,
|
|
||||||
ry: radius,
|
|
||||||
class: cssNoteStr,
|
|
||||||
style: styles2.style,
|
|
||||||
id: vertex.id,
|
|
||||||
domId: vertex.id,
|
|
||||||
tooltip: "",
|
|
||||||
type: "note",
|
|
||||||
// TODO V10: Flowchart ? Keeping flowchart for backwards compatibility. Remove in next major release
|
|
||||||
padding: ((_a = getConfig().flowchart) == null ? void 0 : _a.padding) ?? ((_b = getConfig().class) == null ? void 0 : _b.padding)
|
|
||||||
};
|
|
||||||
g.setNode(vertex.id, node);
|
|
||||||
log.info("setNode", node);
|
|
||||||
if (!vertex.class || !(vertex.class in classes)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const edgeId = startEdgeId + i;
|
|
||||||
const edgeData = {
|
|
||||||
id: `edgeNote${edgeId}`,
|
|
||||||
//Set relationship style and line type
|
|
||||||
classes: "relation",
|
|
||||||
pattern: "dotted",
|
|
||||||
// Set link type for rendering
|
|
||||||
arrowhead: "none",
|
|
||||||
//Set edge extra labels
|
|
||||||
startLabelRight: "",
|
|
||||||
endLabelLeft: "",
|
|
||||||
//Set relation arrow types
|
|
||||||
arrowTypeStart: "none",
|
|
||||||
arrowTypeEnd: "none",
|
|
||||||
style: "fill:none",
|
|
||||||
labelStyle: "",
|
|
||||||
curve: interpolateToCurve(conf.curve, curveLinear)
|
|
||||||
};
|
|
||||||
g.setEdge(vertex.id, vertex.class, edgeData, edgeId);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
const addRelations = function(relations, g) {
|
|
||||||
const conf2 = getConfig().flowchart;
|
|
||||||
let cnt = 0;
|
|
||||||
relations.forEach(function(edge) {
|
|
||||||
var _a;
|
|
||||||
cnt++;
|
|
||||||
const edgeData = {
|
|
||||||
//Set relationship style and line type
|
|
||||||
classes: "relation",
|
|
||||||
pattern: edge.relation.lineType == 1 ? "dashed" : "solid",
|
|
||||||
id: "id" + cnt,
|
|
||||||
// Set link type for rendering
|
|
||||||
arrowhead: edge.type === "arrow_open" ? "none" : "normal",
|
|
||||||
//Set edge extra labels
|
|
||||||
startLabelRight: edge.relationTitle1 === "none" ? "" : edge.relationTitle1,
|
|
||||||
endLabelLeft: edge.relationTitle2 === "none" ? "" : edge.relationTitle2,
|
|
||||||
//Set relation arrow types
|
|
||||||
arrowTypeStart: getArrowMarker(edge.relation.type1),
|
|
||||||
arrowTypeEnd: getArrowMarker(edge.relation.type2),
|
|
||||||
style: "fill:none",
|
|
||||||
labelStyle: "",
|
|
||||||
curve: interpolateToCurve(conf2 == null ? void 0 : conf2.curve, curveLinear)
|
|
||||||
};
|
|
||||||
log.info(edgeData, edge);
|
|
||||||
if (edge.style !== void 0) {
|
|
||||||
const styles2 = getStylesFromArray(edge.style);
|
|
||||||
edgeData.style = styles2.style;
|
|
||||||
edgeData.labelStyle = styles2.labelStyle;
|
|
||||||
}
|
|
||||||
edge.text = edge.title;
|
|
||||||
if (edge.text === void 0) {
|
|
||||||
if (edge.style !== void 0) {
|
|
||||||
edgeData.arrowheadStyle = "fill: #333";
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
edgeData.arrowheadStyle = "fill: #333";
|
|
||||||
edgeData.labelpos = "c";
|
|
||||||
if (((_a = getConfig().flowchart) == null ? void 0 : _a.htmlLabels) ?? getConfig().htmlLabels) {
|
|
||||||
edgeData.labelType = "html";
|
|
||||||
edgeData.label = '<span class="edgeLabel">' + edge.text + "</span>";
|
|
||||||
} else {
|
|
||||||
edgeData.labelType = "text";
|
|
||||||
edgeData.label = edge.text.replace(common.lineBreakRegex, "\n");
|
|
||||||
if (edge.style === void 0) {
|
|
||||||
edgeData.style = edgeData.style || "stroke: #333; stroke-width: 1.5px;fill:none";
|
|
||||||
}
|
|
||||||
edgeData.labelStyle = edgeData.labelStyle.replace("color:", "fill:");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
g.setEdge(edge.id1, edge.id2, edgeData, cnt);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
const setConf = function(cnf) {
|
|
||||||
conf = {
|
|
||||||
...conf,
|
|
||||||
...cnf
|
|
||||||
};
|
|
||||||
};
|
|
||||||
const draw = function(text, id, _version, diagObj) {
|
|
||||||
log.info("Drawing class - ", id);
|
|
||||||
const conf2 = getConfig().flowchart ?? getConfig().class;
|
|
||||||
const securityLevel = getConfig().securityLevel;
|
|
||||||
log.info("config:", conf2);
|
|
||||||
const nodeSpacing = (conf2 == null ? void 0 : conf2.nodeSpacing) ?? 50;
|
|
||||||
const rankSpacing = (conf2 == null ? void 0 : conf2.rankSpacing) ?? 50;
|
|
||||||
const g = new graphlib.Graph({
|
|
||||||
multigraph: true,
|
|
||||||
compound: true
|
|
||||||
}).setGraph({
|
|
||||||
rankdir: diagObj.db.getDirection(),
|
|
||||||
nodesep: nodeSpacing,
|
|
||||||
ranksep: rankSpacing,
|
|
||||||
marginx: 8,
|
|
||||||
marginy: 8
|
|
||||||
}).setDefaultEdgeLabel(function() {
|
|
||||||
return {};
|
|
||||||
});
|
|
||||||
const classes = diagObj.db.getClasses();
|
|
||||||
const relations = diagObj.db.getRelations();
|
|
||||||
const notes = diagObj.db.getNotes();
|
|
||||||
log.info(relations);
|
|
||||||
addClasses(classes, g, id, diagObj);
|
|
||||||
addRelations(relations, g);
|
|
||||||
addNotes(notes, g, relations.length + 1, classes);
|
|
||||||
let sandboxElement;
|
|
||||||
if (securityLevel === "sandbox") {
|
|
||||||
sandboxElement = select("#i" + id);
|
|
||||||
}
|
|
||||||
const root = securityLevel === "sandbox" ? (
|
|
||||||
// @ts-ignore Ignore type error for now
|
|
||||||
select(sandboxElement.nodes()[0].contentDocument.body)
|
|
||||||
) : select("body");
|
|
||||||
const svg = root.select(`[id="${id}"]`);
|
|
||||||
const element = root.select("#" + id + " g");
|
|
||||||
render(
|
|
||||||
element,
|
|
||||||
g,
|
|
||||||
["aggregation", "extension", "composition", "dependency", "lollipop"],
|
|
||||||
"classDiagram",
|
|
||||||
id
|
|
||||||
);
|
|
||||||
utils.insertTitle(svg, "classTitleText", (conf2 == null ? void 0 : conf2.titleTopMargin) ?? 5, diagObj.db.getDiagramTitle());
|
|
||||||
setupGraphViewbox(g, svg, conf2 == null ? void 0 : conf2.diagramPadding, conf2 == null ? void 0 : conf2.useMaxWidth);
|
|
||||||
if (!(conf2 == null ? void 0 : conf2.htmlLabels)) {
|
|
||||||
const doc = securityLevel === "sandbox" ? sandboxElement.nodes()[0].contentDocument : document;
|
|
||||||
const labels = doc.querySelectorAll('[id="' + id + '"] .edgeLabel .label');
|
|
||||||
for (const label of labels) {
|
|
||||||
const dim = label.getBBox();
|
|
||||||
const rect = doc.createElementNS("http://www.w3.org/2000/svg", "rect");
|
|
||||||
rect.setAttribute("rx", 0);
|
|
||||||
rect.setAttribute("ry", 0);
|
|
||||||
rect.setAttribute("width", dim.width);
|
|
||||||
rect.setAttribute("height", dim.height);
|
|
||||||
label.insertBefore(rect, label.firstChild);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
function getArrowMarker(type) {
|
|
||||||
let marker;
|
|
||||||
switch (type) {
|
|
||||||
case 0:
|
|
||||||
marker = "aggregation";
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
marker = "extension";
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
marker = "composition";
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
marker = "dependency";
|
|
||||||
break;
|
|
||||||
case 4:
|
|
||||||
marker = "lollipop";
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
marker = "none";
|
|
||||||
}
|
|
||||||
return marker;
|
|
||||||
}
|
|
||||||
const renderer = {
|
|
||||||
setConf,
|
|
||||||
draw
|
|
||||||
};
|
|
||||||
const diagram = {
|
|
||||||
parser,
|
|
||||||
db,
|
|
||||||
renderer,
|
|
||||||
styles,
|
|
||||||
init: (cnf) => {
|
|
||||||
if (!cnf.class) {
|
|
||||||
cnf.class = {};
|
|
||||||
}
|
|
||||||
cnf.class.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute;
|
|
||||||
db.clear();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
export {
|
|
||||||
diagram
|
|
||||||
};
|
|
||||||
//# sourceMappingURL=classDiagram-v2-539b00ca.js.map
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
{"version":3,"file":"classDiagram-v2-539b00ca.js","sources":["../src/diagrams/class/classRenderer-v2.ts","../src/diagrams/class/classDiagram-v2.ts"],"sourcesContent":["// @ts-ignore d3 types are not available\nimport { select, curveLinear } from 'd3';\nimport * as graphlib from 'dagre-d3-es/src/graphlib/index.js';\nimport { log } from '../../logger';\nimport { getConfig } from '../../config';\nimport { render } from '../../dagre-wrapper/index.js';\nimport utils from '../../utils';\nimport { interpolateToCurve, getStylesFromArray } from '../../utils';\nimport { setupGraphViewbox } from '../../setupGraphViewbox';\nimport common from '../common/common';\nimport { ClassRelation, ClassNote, ClassMap, EdgeData } from './classTypes';\n\nconst sanitizeText = (txt: string) => common.sanitizeText(txt, getConfig());\n\nlet conf = {\n dividerMargin: 10,\n padding: 5,\n textHeight: 10,\n curve: undefined,\n};\n\n/**\n * Function that adds the vertices found during parsing to the graph to be rendered.\n *\n * @param classes - Object containing the vertices.\n * @param g - The graph that is to be drawn.\n * @param _id - id of the graph\n * @param diagObj - The diagram object\n */\nexport const addClasses = function (\n classes: ClassMap,\n g: graphlib.Graph,\n _id: string,\n diagObj: any\n) {\n const keys = Object.keys(classes);\n log.info('keys:', keys);\n log.info(classes);\n\n // Iterate through each item in the vertex object (containing all the vertices found) in the graph definition\n keys.forEach(function (id) {\n const vertex = classes[id];\n\n /**\n * Variable for storing the classes for the vertex\n */\n let cssClassStr = '';\n if (vertex.cssClasses.length > 0) {\n cssClassStr = cssClassStr + ' ' + vertex.cssClasses.join(' ');\n }\n\n const styles = { labelStyle: '', style: '' }; //getStylesFromArray(vertex.styles);\n\n // Use vertex id as text in the box if no text is provided by the graph definition\n const vertexText = vertex.label ?? vertex.id;\n const radius = 0;\n const shape = 'class_box';\n // Add the node\n const node = {\n labelStyle: styles.labelStyle,\n shape: shape,\n labelText: sanitizeText(vertexText),\n classData: vertex,\n rx: radius,\n ry: radius,\n class: cssClassStr,\n style: styles.style,\n id: vertex.id,\n domId: vertex.domId,\n tooltip: diagObj.db.getTooltip(vertex.id) || '',\n haveCallback: vertex.haveCallback,\n link: vertex.link,\n width: vertex.type === 'group' ? 500 : undefined,\n type: vertex.type,\n // TODO V10: Flowchart ? Keeping flowchart for backwards compatibility. Remove in next major release\n padding: getConfig().flowchart?.padding ?? getConfig().class?.padding,\n };\n g.setNode(vertex.id, node);\n log.info('setNode', node);\n });\n};\n\n/**\n * Function that adds the additional vertices (notes) found during parsing to the graph to be rendered.\n *\n * @param notes - Object containing the additional vertices (notes).\n * @param g - The graph that is to be drawn.\n * @param startEdgeId - starting index for note edge\n * @param classes - Classes\n */\nexport const addNotes = function (\n notes: ClassNote[],\n g: graphlib.Graph,\n startEdgeId: number,\n classes: ClassMap\n) {\n log.info(notes);\n\n // Iterate through each item in the vertex object (containing all the vertices found) in the graph definition\n notes.forEach(function (note, i) {\n const vertex = note;\n\n /**\n * Variable for storing the classes for the vertex\n *\n */\n const cssNoteStr = '';\n\n const styles = { labelStyle: '', style: '' };\n\n // Use vertex id as text in the box if no text is provided by the graph definition\n const vertexText = vertex.text;\n\n const radius = 0;\n const shape = 'note';\n // Add the node\n const node = {\n labelStyle: styles.labelStyle,\n shape: shape,\n labelText: sanitizeText(vertexText),\n noteData: vertex,\n rx: radius,\n ry: radius,\n class: cssNoteStr,\n style: styles.style,\n id: vertex.id,\n domId: vertex.id,\n tooltip: '',\n type: 'note',\n // TODO V10: Flowchart ? Keeping flowchart for backwards compatibility. Remove in next major release\n padding: getConfig().flowchart?.padding ?? getConfig().class?.padding,\n };\n g.setNode(vertex.id, node);\n log.info('setNode', node);\n\n if (!vertex.class || !(vertex.class in classes)) {\n return;\n }\n const edgeId = startEdgeId + i;\n\n const edgeData: EdgeData = {\n id: `edgeNote${edgeId}`,\n //Set relationship style and line type\n classes: 'relation',\n pattern: 'dotted',\n // Set link type for rendering\n arrowhead: 'none',\n //Set edge extra labels\n startLabelRight: '',\n endLabelLeft: '',\n //Set relation arrow types\n arrowTypeStart: 'none',\n arrowTypeEnd: 'none'Line truncated
|
|
||||||
@@ -1,200 +0,0 @@
|
|||||||
import { p as M, d as k, s as R } from "./styles-e9bde71f.js";
|
|
||||||
import { l as p, g as r, f as v, e as C } from "./config-e567ef17.js";
|
|
||||||
import { G as B } from "./layout-10a68736.js";
|
|
||||||
import { r as G } from "./index-f4462e28.js";
|
|
||||||
import { u as I, z as D, x as E, y as _ } from "./utils-aa888deb.js";
|
|
||||||
import { s as z } from "./setupGraphViewbox-a4603a92.js";
|
|
||||||
import "./mermaidAPI-51c0c26b.js";
|
|
||||||
import "./errorRenderer-a3c4bedb.js";
|
|
||||||
import "./commonDb-4dc3d465.js";
|
|
||||||
import "./isPlainObject-bb374f45.js";
|
|
||||||
import "./array-2ff2c7a6.js";
|
|
||||||
import "./constant-2fe7eae5.js";
|
|
||||||
import "./edges-a2733861.js";
|
|
||||||
import "./svgDraw-c2c52520.js";
|
|
||||||
const A = (l) => C.sanitizeText(l, r());
|
|
||||||
let S = {
|
|
||||||
dividerMargin: 10,
|
|
||||||
padding: 5,
|
|
||||||
textHeight: 10,
|
|
||||||
curve: void 0
|
|
||||||
};
|
|
||||||
const $ = function(l, o, b, a) {
|
|
||||||
const e = Object.keys(l);
|
|
||||||
p.info("keys:", e), p.info(l), e.forEach(function(s) {
|
|
||||||
var y, m;
|
|
||||||
const t = l[s];
|
|
||||||
let i = "";
|
|
||||||
t.cssClasses.length > 0 && (i = i + " " + t.cssClasses.join(" "));
|
|
||||||
const n = { labelStyle: "", style: "" }, f = t.label ?? t.id, c = 0, u = "class_box", d = {
|
|
||||||
labelStyle: n.labelStyle,
|
|
||||||
shape: u,
|
|
||||||
labelText: A(f),
|
|
||||||
classData: t,
|
|
||||||
rx: c,
|
|
||||||
ry: c,
|
|
||||||
class: i,
|
|
||||||
style: n.style,
|
|
||||||
id: t.id,
|
|
||||||
domId: t.domId,
|
|
||||||
tooltip: a.db.getTooltip(t.id) || "",
|
|
||||||
haveCallback: t.haveCallback,
|
|
||||||
link: t.link,
|
|
||||||
width: t.type === "group" ? 500 : void 0,
|
|
||||||
type: t.type,
|
|
||||||
// TODO V10: Flowchart ? Keeping flowchart for backwards compatibility. Remove in next major release
|
|
||||||
padding: ((y = r().flowchart) == null ? void 0 : y.padding) ?? ((m = r().class) == null ? void 0 : m.padding)
|
|
||||||
};
|
|
||||||
o.setNode(t.id, d), p.info("setNode", d);
|
|
||||||
});
|
|
||||||
}, q = function(l, o, b, a) {
|
|
||||||
p.info(l), l.forEach(function(e, s) {
|
|
||||||
var x, h;
|
|
||||||
const t = e, i = "", n = { labelStyle: "", style: "" }, f = t.text, c = 0, u = "note", d = {
|
|
||||||
labelStyle: n.labelStyle,
|
|
||||||
shape: u,
|
|
||||||
labelText: A(f),
|
|
||||||
noteData: t,
|
|
||||||
rx: c,
|
|
||||||
ry: c,
|
|
||||||
class: i,
|
|
||||||
style: n.style,
|
|
||||||
id: t.id,
|
|
||||||
domId: t.id,
|
|
||||||
tooltip: "",
|
|
||||||
type: "note",
|
|
||||||
// TODO V10: Flowchart ? Keeping flowchart for backwards compatibility. Remove in next major release
|
|
||||||
padding: ((x = r().flowchart) == null ? void 0 : x.padding) ?? ((h = r().class) == null ? void 0 : h.padding)
|
|
||||||
};
|
|
||||||
if (o.setNode(t.id, d), p.info("setNode", d), !t.class || !(t.class in a))
|
|
||||||
return;
|
|
||||||
const y = b + s, m = {
|
|
||||||
id: `edgeNote${y}`,
|
|
||||||
//Set relationship style and line type
|
|
||||||
classes: "relation",
|
|
||||||
pattern: "dotted",
|
|
||||||
// Set link type for rendering
|
|
||||||
arrowhead: "none",
|
|
||||||
//Set edge extra labels
|
|
||||||
startLabelRight: "",
|
|
||||||
endLabelLeft: "",
|
|
||||||
//Set relation arrow types
|
|
||||||
arrowTypeStart: "none",
|
|
||||||
arrowTypeEnd: "none",
|
|
||||||
style: "fill:none",
|
|
||||||
labelStyle: "",
|
|
||||||
curve: D(S.curve, E)
|
|
||||||
};
|
|
||||||
o.setEdge(t.id, t.class, m, y);
|
|
||||||
});
|
|
||||||
}, F = function(l, o) {
|
|
||||||
const b = r().flowchart;
|
|
||||||
let a = 0;
|
|
||||||
l.forEach(function(e) {
|
|
||||||
var t;
|
|
||||||
a++;
|
|
||||||
const s = {
|
|
||||||
//Set relationship style and line type
|
|
||||||
classes: "relation",
|
|
||||||
pattern: e.relation.lineType == 1 ? "dashed" : "solid",
|
|
||||||
id: "id" + a,
|
|
||||||
// Set link type for rendering
|
|
||||||
arrowhead: e.type === "arrow_open" ? "none" : "normal",
|
|
||||||
//Set edge extra labels
|
|
||||||
startLabelRight: e.relationTitle1 === "none" ? "" : e.relationTitle1,
|
|
||||||
endLabelLeft: e.relationTitle2 === "none" ? "" : e.relationTitle2,
|
|
||||||
//Set relation arrow types
|
|
||||||
arrowTypeStart: L(e.relation.type1),
|
|
||||||
arrowTypeEnd: L(e.relation.type2),
|
|
||||||
style: "fill:none",
|
|
||||||
labelStyle: "",
|
|
||||||
curve: D(b == null ? void 0 : b.curve, E)
|
|
||||||
};
|
|
||||||
if (p.info(s, e), e.style !== void 0) {
|
|
||||||
const i = _(e.style);
|
|
||||||
s.style = i.style, s.labelStyle = i.labelStyle;
|
|
||||||
}
|
|
||||||
e.text = e.title, e.text === void 0 ? e.style !== void 0 && (s.arrowheadStyle = "fill: #333") : (s.arrowheadStyle = "fill: #333", s.labelpos = "c", ((t = r().flowchart) == null ? void 0 : t.htmlLabels) ?? r().htmlLabels ? (s.labelType = "html", s.label = '<span class="edgeLabel">' + e.text + "</span>") : (s.labelType = "text", s.label = e.text.replace(C.lineBreakRegex, `
|
|
||||||
`), e.style === void 0 && (s.style = s.style || "stroke: #333; stroke-width: 1.5px;fill:none"), s.labelStyle = s.labelStyle.replace("color:", "fill:"))), o.setEdge(e.id1, e.id2, s, a);
|
|
||||||
});
|
|
||||||
}, H = function(l) {
|
|
||||||
S = {
|
|
||||||
...S,
|
|
||||||
...l
|
|
||||||
};
|
|
||||||
}, P = function(l, o, b, a) {
|
|
||||||
p.info("Drawing class - ", o);
|
|
||||||
const e = r().flowchart ?? r().class, s = r().securityLevel;
|
|
||||||
p.info("config:", e);
|
|
||||||
const t = (e == null ? void 0 : e.nodeSpacing) ?? 50, i = (e == null ? void 0 : e.rankSpacing) ?? 50, n = new B({
|
|
||||||
multigraph: !0,
|
|
||||||
compound: !0
|
|
||||||
}).setGraph({
|
|
||||||
rankdir: a.db.getDirection(),
|
|
||||||
nodesep: t,
|
|
||||||
ranksep: i,
|
|
||||||
marginx: 8,
|
|
||||||
marginy: 8
|
|
||||||
}).setDefaultEdgeLabel(function() {
|
|
||||||
return {};
|
|
||||||
}), f = a.db.getClasses(), c = a.db.getRelations(), u = a.db.getNotes();
|
|
||||||
p.info(c), $(f, n, o, a), F(c, n), q(u, n, c.length + 1, f);
|
|
||||||
let d;
|
|
||||||
s === "sandbox" && (d = v("#i" + o));
|
|
||||||
const y = s === "sandbox" ? (
|
|
||||||
// @ts-ignore Ignore type error for now
|
|
||||||
v(d.nodes()[0].contentDocument.body)
|
|
||||||
) : v("body"), m = y.select(`[id="${o}"]`), x = y.select("#" + o + " g");
|
|
||||||
if (G(
|
|
||||||
x,
|
|
||||||
n,
|
|
||||||
["aggregation", "extension", "composition", "dependency", "lollipop"],
|
|
||||||
"classDiagram",
|
|
||||||
o
|
|
||||||
), I.insertTitle(m, "classTitleText", (e == null ? void 0 : e.titleTopMargin) ?? 5, a.db.getDiagramTitle()), z(n, m, e == null ? void 0 : e.diagramPadding, e == null ? void 0 : e.useMaxWidth), !(e != null && e.htmlLabels)) {
|
|
||||||
const h = s === "sandbox" ? d.nodes()[0].contentDocument : document, N = h.querySelectorAll('[id="' + o + '"] .edgeLabel .label');
|
|
||||||
for (const w of N) {
|
|
||||||
const T = w.getBBox(), g = h.createElementNS("http://www.w3.org/2000/svg", "rect");
|
|
||||||
g.setAttribute("rx", 0), g.setAttribute("ry", 0), g.setAttribute("width", T.width), g.setAttribute("height", T.height), w.insertBefore(g, w.firstChild);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
function L(l) {
|
|
||||||
let o;
|
|
||||||
switch (l) {
|
|
||||||
case 0:
|
|
||||||
o = "aggregation";
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
o = "extension";
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
o = "composition";
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
o = "dependency";
|
|
||||||
break;
|
|
||||||
case 4:
|
|
||||||
o = "lollipop";
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
o = "none";
|
|
||||||
}
|
|
||||||
return o;
|
|
||||||
}
|
|
||||||
const V = {
|
|
||||||
setConf: H,
|
|
||||||
draw: P
|
|
||||||
}, le = {
|
|
||||||
parser: M,
|
|
||||||
db: k,
|
|
||||||
renderer: V,
|
|
||||||
styles: R,
|
|
||||||
init: (l) => {
|
|
||||||
l.class || (l.class = {}), l.class.arrowMarkerAbsolute = l.arrowMarkerAbsolute, k.clear();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
export {
|
|
||||||
le as diagram
|
|
||||||
};
|
|
||||||
//# sourceMappingURL=classDiagram-v2-6bb7b84a.js.map
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
{"version":3,"file":"classDiagram-v2-6bb7b84a.js","sources":["../src/diagrams/class/classRenderer-v2.ts","../src/diagrams/class/classDiagram-v2.ts"],"sourcesContent":["// @ts-ignore d3 types are not available\nimport { select, curveLinear } from 'd3';\nimport * as graphlib from 'dagre-d3-es/src/graphlib/index.js';\nimport { log } from '../../logger';\nimport { getConfig } from '../../config';\nimport { render } from '../../dagre-wrapper/index.js';\nimport utils from '../../utils';\nimport { interpolateToCurve, getStylesFromArray } from '../../utils';\nimport { setupGraphViewbox } from '../../setupGraphViewbox';\nimport common from '../common/common';\nimport { ClassRelation, ClassNote, ClassMap, EdgeData } from './classTypes';\n\nconst sanitizeText = (txt: string) => common.sanitizeText(txt, getConfig());\n\nlet conf = {\n dividerMargin: 10,\n padding: 5,\n textHeight: 10,\n curve: undefined,\n};\n\n/**\n * Function that adds the vertices found during parsing to the graph to be rendered.\n *\n * @param classes - Object containing the vertices.\n * @param g - The graph that is to be drawn.\n * @param _id - id of the graph\n * @param diagObj - The diagram object\n */\nexport const addClasses = function (\n classes: ClassMap,\n g: graphlib.Graph,\n _id: string,\n diagObj: any\n) {\n const keys = Object.keys(classes);\n log.info('keys:', keys);\n log.info(classes);\n\n // Iterate through each item in the vertex object (containing all the vertices found) in the graph definition\n keys.forEach(function (id) {\n const vertex = classes[id];\n\n /**\n * Variable for storing the classes for the vertex\n */\n let cssClassStr = '';\n if (vertex.cssClasses.length > 0) {\n cssClassStr = cssClassStr + ' ' + vertex.cssClasses.join(' ');\n }\n\n const styles = { labelStyle: '', style: '' }; //getStylesFromArray(vertex.styles);\n\n // Use vertex id as text in the box if no text is provided by the graph definition\n const vertexText = vertex.label ?? vertex.id;\n const radius = 0;\n const shape = 'class_box';\n // Add the node\n const node = {\n labelStyle: styles.labelStyle,\n shape: shape,\n labelText: sanitizeText(vertexText),\n classData: vertex,\n rx: radius,\n ry: radius,\n class: cssClassStr,\n style: styles.style,\n id: vertex.id,\n domId: vertex.domId,\n tooltip: diagObj.db.getTooltip(vertex.id) || '',\n haveCallback: vertex.haveCallback,\n link: vertex.link,\n width: vertex.type === 'group' ? 500 : undefined,\n type: vertex.type,\n // TODO V10: Flowchart ? Keeping flowchart for backwards compatibility. Remove in next major release\n padding: getConfig().flowchart?.padding ?? getConfig().class?.padding,\n };\n g.setNode(vertex.id, node);\n log.info('setNode', node);\n });\n};\n\n/**\n * Function that adds the additional vertices (notes) found during parsing to the graph to be rendered.\n *\n * @param notes - Object containing the additional vertices (notes).\n * @param g - The graph that is to be drawn.\n * @param startEdgeId - starting index for note edge\n * @param classes - Classes\n */\nexport const addNotes = function (\n notes: ClassNote[],\n g: graphlib.Graph,\n startEdgeId: number,\n classes: ClassMap\n) {\n log.info(notes);\n\n // Iterate through each item in the vertex object (containing all the vertices found) in the graph definition\n notes.forEach(function (note, i) {\n const vertex = note;\n\n /**\n * Variable for storing the classes for the vertex\n *\n */\n const cssNoteStr = '';\n\n const styles = { labelStyle: '', style: '' };\n\n // Use vertex id as text in the box if no text is provided by the graph definition\n const vertexText = vertex.text;\n\n const radius = 0;\n const shape = 'note';\n // Add the node\n const node = {\n labelStyle: styles.labelStyle,\n shape: shape,\n labelText: sanitizeText(vertexText),\n noteData: vertex,\n rx: radius,\n ry: radius,\n class: cssNoteStr,\n style: styles.style,\n id: vertex.id,\n domId: vertex.id,\n tooltip: '',\n type: 'note',\n // TODO V10: Flowchart ? Keeping flowchart for backwards compatibility. Remove in next major release\n padding: getConfig().flowchart?.padding ?? getConfig().class?.padding,\n };\n g.setNode(vertex.id, node);\n log.info('setNode', node);\n\n if (!vertex.class || !(vertex.class in classes)) {\n return;\n }\n const edgeId = startEdgeId + i;\n\n const edgeData: EdgeData = {\n id: `edgeNote${edgeId}`,\n //Set relationship style and line type\n classes: 'relation',\n pattern: 'dotted',\n // Set link type for rendering\n arrowhead: 'none',\n //Set edge extra labels\n startLabelRight: '',\n endLabelLeft: '',\n //Set relation arrow types\n arrowTypeStart: 'none',\n arrowTypeEnd: 'none'Line truncated
|
|
||||||
@@ -1,272 +0,0 @@
|
|||||||
import { p as parser, d as db, s as styles } from "./styles-d6ad8edb.js";
|
|
||||||
import { l as log, g as getConfig, f as select, e as common } from "./config-b4fa35bb.js";
|
|
||||||
import { G as Graph } from "./layout-4663fc19.js";
|
|
||||||
import { r as render } from "./index-a1a98052.js";
|
|
||||||
import { u as utils, z as interpolateToCurve, x as curveLinear, y as getStylesFromArray } from "./utils-872dfc50.js";
|
|
||||||
import { s as setupGraphViewbox } from "./setupGraphViewbox-16a0ba81.js";
|
|
||||||
import "./mermaidAPI-6f22a815.js";
|
|
||||||
import "./errorRenderer-ebf63d74.js";
|
|
||||||
import "./commonDb-7f40ab5a.js";
|
|
||||||
import "./isPlainObject-91dd8bc9.js";
|
|
||||||
import "./array-b7dcf730.js";
|
|
||||||
import "./constant-b644328d.js";
|
|
||||||
import "./edges-62a01f73.js";
|
|
||||||
import "./svgDraw-9e97e6db.js";
|
|
||||||
const sanitizeText = (txt) => common.sanitizeText(txt, getConfig());
|
|
||||||
let conf = {
|
|
||||||
dividerMargin: 10,
|
|
||||||
padding: 5,
|
|
||||||
textHeight: 10,
|
|
||||||
curve: void 0
|
|
||||||
};
|
|
||||||
const addClasses = function(classes, g, _id, diagObj) {
|
|
||||||
const keys = Object.keys(classes);
|
|
||||||
log.info("keys:", keys);
|
|
||||||
log.info(classes);
|
|
||||||
keys.forEach(function(id) {
|
|
||||||
var _a, _b;
|
|
||||||
const vertex = classes[id];
|
|
||||||
let cssClassStr = "";
|
|
||||||
if (vertex.cssClasses.length > 0) {
|
|
||||||
cssClassStr = cssClassStr + " " + vertex.cssClasses.join(" ");
|
|
||||||
}
|
|
||||||
const styles2 = { labelStyle: "", style: "" };
|
|
||||||
const vertexText = vertex.label ?? vertex.id;
|
|
||||||
const radius = 0;
|
|
||||||
const shape = "class_box";
|
|
||||||
const node = {
|
|
||||||
labelStyle: styles2.labelStyle,
|
|
||||||
shape,
|
|
||||||
labelText: sanitizeText(vertexText),
|
|
||||||
classData: vertex,
|
|
||||||
rx: radius,
|
|
||||||
ry: radius,
|
|
||||||
class: cssClassStr,
|
|
||||||
style: styles2.style,
|
|
||||||
id: vertex.id,
|
|
||||||
domId: vertex.domId,
|
|
||||||
tooltip: diagObj.db.getTooltip(vertex.id) || "",
|
|
||||||
haveCallback: vertex.haveCallback,
|
|
||||||
link: vertex.link,
|
|
||||||
width: vertex.type === "group" ? 500 : void 0,
|
|
||||||
type: vertex.type,
|
|
||||||
// TODO V10: Flowchart ? Keeping flowchart for backwards compatibility. Remove in next major release
|
|
||||||
padding: ((_a = getConfig().flowchart) == null ? void 0 : _a.padding) ?? ((_b = getConfig().class) == null ? void 0 : _b.padding)
|
|
||||||
};
|
|
||||||
g.setNode(vertex.id, node);
|
|
||||||
log.info("setNode", node);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
const addNotes = function(notes, g, startEdgeId, classes) {
|
|
||||||
log.info(notes);
|
|
||||||
notes.forEach(function(note, i) {
|
|
||||||
var _a, _b;
|
|
||||||
const vertex = note;
|
|
||||||
const cssNoteStr = "";
|
|
||||||
const styles2 = { labelStyle: "", style: "" };
|
|
||||||
const vertexText = vertex.text;
|
|
||||||
const radius = 0;
|
|
||||||
const shape = "note";
|
|
||||||
const node = {
|
|
||||||
labelStyle: styles2.labelStyle,
|
|
||||||
shape,
|
|
||||||
labelText: sanitizeText(vertexText),
|
|
||||||
noteData: vertex,
|
|
||||||
rx: radius,
|
|
||||||
ry: radius,
|
|
||||||
class: cssNoteStr,
|
|
||||||
style: styles2.style,
|
|
||||||
id: vertex.id,
|
|
||||||
domId: vertex.id,
|
|
||||||
tooltip: "",
|
|
||||||
type: "note",
|
|
||||||
// TODO V10: Flowchart ? Keeping flowchart for backwards compatibility. Remove in next major release
|
|
||||||
padding: ((_a = getConfig().flowchart) == null ? void 0 : _a.padding) ?? ((_b = getConfig().class) == null ? void 0 : _b.padding)
|
|
||||||
};
|
|
||||||
g.setNode(vertex.id, node);
|
|
||||||
log.info("setNode", node);
|
|
||||||
if (!vertex.class || !(vertex.class in classes)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const edgeId = startEdgeId + i;
|
|
||||||
const edgeData = {
|
|
||||||
id: `edgeNote${edgeId}`,
|
|
||||||
//Set relationship style and line type
|
|
||||||
classes: "relation",
|
|
||||||
pattern: "dotted",
|
|
||||||
// Set link type for rendering
|
|
||||||
arrowhead: "none",
|
|
||||||
//Set edge extra labels
|
|
||||||
startLabelRight: "",
|
|
||||||
endLabelLeft: "",
|
|
||||||
//Set relation arrow types
|
|
||||||
arrowTypeStart: "none",
|
|
||||||
arrowTypeEnd: "none",
|
|
||||||
style: "fill:none",
|
|
||||||
labelStyle: "",
|
|
||||||
curve: interpolateToCurve(conf.curve, curveLinear)
|
|
||||||
};
|
|
||||||
g.setEdge(vertex.id, vertex.class, edgeData, edgeId);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
const addRelations = function(relations, g) {
|
|
||||||
const conf2 = getConfig().flowchart;
|
|
||||||
let cnt = 0;
|
|
||||||
relations.forEach(function(edge) {
|
|
||||||
var _a;
|
|
||||||
cnt++;
|
|
||||||
const edgeData = {
|
|
||||||
//Set relationship style and line type
|
|
||||||
classes: "relation",
|
|
||||||
pattern: edge.relation.lineType == 1 ? "dashed" : "solid",
|
|
||||||
id: "id" + cnt,
|
|
||||||
// Set link type for rendering
|
|
||||||
arrowhead: edge.type === "arrow_open" ? "none" : "normal",
|
|
||||||
//Set edge extra labels
|
|
||||||
startLabelRight: edge.relationTitle1 === "none" ? "" : edge.relationTitle1,
|
|
||||||
endLabelLeft: edge.relationTitle2 === "none" ? "" : edge.relationTitle2,
|
|
||||||
//Set relation arrow types
|
|
||||||
arrowTypeStart: getArrowMarker(edge.relation.type1),
|
|
||||||
arrowTypeEnd: getArrowMarker(edge.relation.type2),
|
|
||||||
style: "fill:none",
|
|
||||||
labelStyle: "",
|
|
||||||
curve: interpolateToCurve(conf2 == null ? void 0 : conf2.curve, curveLinear)
|
|
||||||
};
|
|
||||||
log.info(edgeData, edge);
|
|
||||||
if (edge.style !== void 0) {
|
|
||||||
const styles2 = getStylesFromArray(edge.style);
|
|
||||||
edgeData.style = styles2.style;
|
|
||||||
edgeData.labelStyle = styles2.labelStyle;
|
|
||||||
}
|
|
||||||
edge.text = edge.title;
|
|
||||||
if (edge.text === void 0) {
|
|
||||||
if (edge.style !== void 0) {
|
|
||||||
edgeData.arrowheadStyle = "fill: #333";
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
edgeData.arrowheadStyle = "fill: #333";
|
|
||||||
edgeData.labelpos = "c";
|
|
||||||
if (((_a = getConfig().flowchart) == null ? void 0 : _a.htmlLabels) ?? getConfig().htmlLabels) {
|
|
||||||
edgeData.labelType = "html";
|
|
||||||
edgeData.label = '<span class="edgeLabel">' + edge.text + "</span>";
|
|
||||||
} else {
|
|
||||||
edgeData.labelType = "text";
|
|
||||||
edgeData.label = edge.text.replace(common.lineBreakRegex, "\n");
|
|
||||||
if (edge.style === void 0) {
|
|
||||||
edgeData.style = edgeData.style || "stroke: #333; stroke-width: 1.5px;fill:none";
|
|
||||||
}
|
|
||||||
edgeData.labelStyle = edgeData.labelStyle.replace("color:", "fill:");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
g.setEdge(edge.id1, edge.id2, edgeData, cnt);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
const setConf = function(cnf) {
|
|
||||||
conf = {
|
|
||||||
...conf,
|
|
||||||
...cnf
|
|
||||||
};
|
|
||||||
};
|
|
||||||
const draw = function(text, id, _version, diagObj) {
|
|
||||||
log.info("Drawing class - ", id);
|
|
||||||
const conf2 = getConfig().flowchart ?? getConfig().class;
|
|
||||||
const securityLevel = getConfig().securityLevel;
|
|
||||||
log.info("config:", conf2);
|
|
||||||
const nodeSpacing = (conf2 == null ? void 0 : conf2.nodeSpacing) ?? 50;
|
|
||||||
const rankSpacing = (conf2 == null ? void 0 : conf2.rankSpacing) ?? 50;
|
|
||||||
const g = new Graph({
|
|
||||||
multigraph: true,
|
|
||||||
compound: true
|
|
||||||
}).setGraph({
|
|
||||||
rankdir: diagObj.db.getDirection(),
|
|
||||||
nodesep: nodeSpacing,
|
|
||||||
ranksep: rankSpacing,
|
|
||||||
marginx: 8,
|
|
||||||
marginy: 8
|
|
||||||
}).setDefaultEdgeLabel(function() {
|
|
||||||
return {};
|
|
||||||
});
|
|
||||||
const classes = diagObj.db.getClasses();
|
|
||||||
const relations = diagObj.db.getRelations();
|
|
||||||
const notes = diagObj.db.getNotes();
|
|
||||||
log.info(relations);
|
|
||||||
addClasses(classes, g, id, diagObj);
|
|
||||||
addRelations(relations, g);
|
|
||||||
addNotes(notes, g, relations.length + 1, classes);
|
|
||||||
let sandboxElement;
|
|
||||||
if (securityLevel === "sandbox") {
|
|
||||||
sandboxElement = select("#i" + id);
|
|
||||||
}
|
|
||||||
const root = securityLevel === "sandbox" ? (
|
|
||||||
// @ts-ignore Ignore type error for now
|
|
||||||
select(sandboxElement.nodes()[0].contentDocument.body)
|
|
||||||
) : select("body");
|
|
||||||
const svg = root.select(`[id="${id}"]`);
|
|
||||||
const element = root.select("#" + id + " g");
|
|
||||||
render(
|
|
||||||
element,
|
|
||||||
g,
|
|
||||||
["aggregation", "extension", "composition", "dependency", "lollipop"],
|
|
||||||
"classDiagram",
|
|
||||||
id
|
|
||||||
);
|
|
||||||
utils.insertTitle(svg, "classTitleText", (conf2 == null ? void 0 : conf2.titleTopMargin) ?? 5, diagObj.db.getDiagramTitle());
|
|
||||||
setupGraphViewbox(g, svg, conf2 == null ? void 0 : conf2.diagramPadding, conf2 == null ? void 0 : conf2.useMaxWidth);
|
|
||||||
if (!(conf2 == null ? void 0 : conf2.htmlLabels)) {
|
|
||||||
const doc = securityLevel === "sandbox" ? sandboxElement.nodes()[0].contentDocument : document;
|
|
||||||
const labels = doc.querySelectorAll('[id="' + id + '"] .edgeLabel .label');
|
|
||||||
for (const label of labels) {
|
|
||||||
const dim = label.getBBox();
|
|
||||||
const rect = doc.createElementNS("http://www.w3.org/2000/svg", "rect");
|
|
||||||
rect.setAttribute("rx", 0);
|
|
||||||
rect.setAttribute("ry", 0);
|
|
||||||
rect.setAttribute("width", dim.width);
|
|
||||||
rect.setAttribute("height", dim.height);
|
|
||||||
label.insertBefore(rect, label.firstChild);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
function getArrowMarker(type) {
|
|
||||||
let marker;
|
|
||||||
switch (type) {
|
|
||||||
case 0:
|
|
||||||
marker = "aggregation";
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
marker = "extension";
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
marker = "composition";
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
marker = "dependency";
|
|
||||||
break;
|
|
||||||
case 4:
|
|
||||||
marker = "lollipop";
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
marker = "none";
|
|
||||||
}
|
|
||||||
return marker;
|
|
||||||
}
|
|
||||||
const renderer = {
|
|
||||||
setConf,
|
|
||||||
draw
|
|
||||||
};
|
|
||||||
const diagram = {
|
|
||||||
parser,
|
|
||||||
db,
|
|
||||||
renderer,
|
|
||||||
styles,
|
|
||||||
init: (cnf) => {
|
|
||||||
if (!cnf.class) {
|
|
||||||
cnf.class = {};
|
|
||||||
}
|
|
||||||
cnf.class.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute;
|
|
||||||
db.clear();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
export {
|
|
||||||
diagram
|
|
||||||
};
|
|
||||||
//# sourceMappingURL=classDiagram-v2-8096aa52.js.map
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
{"version":3,"file":"classDiagram-v2-8096aa52.js","sources":["../src/diagrams/class/classRenderer-v2.ts","../src/diagrams/class/classDiagram-v2.ts"],"sourcesContent":["// @ts-ignore d3 types are not available\nimport { select, curveLinear } from 'd3';\nimport * as graphlib from 'dagre-d3-es/src/graphlib/index.js';\nimport { log } from '../../logger';\nimport { getConfig } from '../../config';\nimport { render } from '../../dagre-wrapper/index.js';\nimport utils from '../../utils';\nimport { interpolateToCurve, getStylesFromArray } from '../../utils';\nimport { setupGraphViewbox } from '../../setupGraphViewbox';\nimport common from '../common/common';\nimport { ClassRelation, ClassNote, ClassMap, EdgeData } from './classTypes';\n\nconst sanitizeText = (txt: string) => common.sanitizeText(txt, getConfig());\n\nlet conf = {\n dividerMargin: 10,\n padding: 5,\n textHeight: 10,\n curve: undefined,\n};\n\n/**\n * Function that adds the vertices found during parsing to the graph to be rendered.\n *\n * @param classes - Object containing the vertices.\n * @param g - The graph that is to be drawn.\n * @param _id - id of the graph\n * @param diagObj - The diagram object\n */\nexport const addClasses = function (\n classes: ClassMap,\n g: graphlib.Graph,\n _id: string,\n diagObj: any\n) {\n const keys = Object.keys(classes);\n log.info('keys:', keys);\n log.info(classes);\n\n // Iterate through each item in the vertex object (containing all the vertices found) in the graph definition\n keys.forEach(function (id) {\n const vertex = classes[id];\n\n /**\n * Variable for storing the classes for the vertex\n */\n let cssClassStr = '';\n if (vertex.cssClasses.length > 0) {\n cssClassStr = cssClassStr + ' ' + vertex.cssClasses.join(' ');\n }\n\n const styles = { labelStyle: '', style: '' }; //getStylesFromArray(vertex.styles);\n\n // Use vertex id as text in the box if no text is provided by the graph definition\n const vertexText = vertex.label ?? vertex.id;\n const radius = 0;\n const shape = 'class_box';\n // Add the node\n const node = {\n labelStyle: styles.labelStyle,\n shape: shape,\n labelText: sanitizeText(vertexText),\n classData: vertex,\n rx: radius,\n ry: radius,\n class: cssClassStr,\n style: styles.style,\n id: vertex.id,\n domId: vertex.domId,\n tooltip: diagObj.db.getTooltip(vertex.id) || '',\n haveCallback: vertex.haveCallback,\n link: vertex.link,\n width: vertex.type === 'group' ? 500 : undefined,\n type: vertex.type,\n // TODO V10: Flowchart ? Keeping flowchart for backwards compatibility. Remove in next major release\n padding: getConfig().flowchart?.padding ?? getConfig().class?.padding,\n };\n g.setNode(vertex.id, node);\n log.info('setNode', node);\n });\n};\n\n/**\n * Function that adds the additional vertices (notes) found during parsing to the graph to be rendered.\n *\n * @param notes - Object containing the additional vertices (notes).\n * @param g - The graph that is to be drawn.\n * @param startEdgeId - starting index for note edge\n * @param classes - Classes\n */\nexport const addNotes = function (\n notes: ClassNote[],\n g: graphlib.Graph,\n startEdgeId: number,\n classes: ClassMap\n) {\n log.info(notes);\n\n // Iterate through each item in the vertex object (containing all the vertices found) in the graph definition\n notes.forEach(function (note, i) {\n const vertex = note;\n\n /**\n * Variable for storing the classes for the vertex\n *\n */\n const cssNoteStr = '';\n\n const styles = { labelStyle: '', style: '' };\n\n // Use vertex id as text in the box if no text is provided by the graph definition\n const vertexText = vertex.text;\n\n const radius = 0;\n const shape = 'note';\n // Add the node\n const node = {\n labelStyle: styles.labelStyle,\n shape: shape,\n labelText: sanitizeText(vertexText),\n noteData: vertex,\n rx: radius,\n ry: radius,\n class: cssNoteStr,\n style: styles.style,\n id: vertex.id,\n domId: vertex.id,\n tooltip: '',\n type: 'note',\n // TODO V10: Flowchart ? Keeping flowchart for backwards compatibility. Remove in next major release\n padding: getConfig().flowchart?.padding ?? getConfig().class?.padding,\n };\n g.setNode(vertex.id, node);\n log.info('setNode', node);\n\n if (!vertex.class || !(vertex.class in classes)) {\n return;\n }\n const edgeId = startEdgeId + i;\n\n const edgeData: EdgeData = {\n id: `edgeNote${edgeId}`,\n //Set relationship style and line type\n classes: 'relation',\n pattern: 'dotted',\n // Set link type for rendering\n arrowhead: 'none',\n //Set edge extra labels\n startLabelRight: '',\n endLabelLeft: '',\n //Set relation arrow types\n arrowTypeStart: 'none',\n arrowTypeEnd: 'none'Line truncated
|
|
||||||
@@ -1,279 +0,0 @@
|
|||||||
import { p as parser, d as db, s as styles } from "./styles-b8bd0053.js";
|
|
||||||
import { select, curveLinear } from "d3";
|
|
||||||
import * as graphlib from "dagre-d3-es/src/graphlib/index.js";
|
|
||||||
import { l as log, g as getConfig, d as common } from "./config-389b86ff.js";
|
|
||||||
import { r as render } from "./index-1dda2409.js";
|
|
||||||
import { u as utils, n as interpolateToCurve, m as getStylesFromArray } from "./utils-d5eeff82.js";
|
|
||||||
import { s as setupGraphViewbox } from "./setupGraphViewbox-e35e4124.js";
|
|
||||||
import "./mermaidAPI-b17c596d.js";
|
|
||||||
import "stylis";
|
|
||||||
import "./errorRenderer-d05351b9.js";
|
|
||||||
import "dompurify";
|
|
||||||
import "lodash-es/isEmpty.js";
|
|
||||||
import "./commonDb-2ace122b.js";
|
|
||||||
import "dayjs";
|
|
||||||
import "khroma";
|
|
||||||
import "dagre-d3-es/src/dagre/index.js";
|
|
||||||
import "dagre-d3-es/src/graphlib/json.js";
|
|
||||||
import "./edges-abc56c75.js";
|
|
||||||
import "./svgDraw-6a237a99.js";
|
|
||||||
import "@braintree/sanitize-url";
|
|
||||||
import "lodash-es/memoize.js";
|
|
||||||
const sanitizeText = (txt) => common.sanitizeText(txt, getConfig());
|
|
||||||
let conf = {
|
|
||||||
dividerMargin: 10,
|
|
||||||
padding: 5,
|
|
||||||
textHeight: 10,
|
|
||||||
curve: void 0
|
|
||||||
};
|
|
||||||
const addClasses = function(classes, g, _id, diagObj) {
|
|
||||||
const keys = Object.keys(classes);
|
|
||||||
log.info("keys:", keys);
|
|
||||||
log.info(classes);
|
|
||||||
keys.forEach(function(id) {
|
|
||||||
var _a, _b;
|
|
||||||
const vertex = classes[id];
|
|
||||||
let cssClassStr = "";
|
|
||||||
if (vertex.cssClasses.length > 0) {
|
|
||||||
cssClassStr = cssClassStr + " " + vertex.cssClasses.join(" ");
|
|
||||||
}
|
|
||||||
const styles2 = { labelStyle: "", style: "" };
|
|
||||||
const vertexText = vertex.label ?? vertex.id;
|
|
||||||
const radius = 0;
|
|
||||||
const shape = "class_box";
|
|
||||||
const node = {
|
|
||||||
labelStyle: styles2.labelStyle,
|
|
||||||
shape,
|
|
||||||
labelText: sanitizeText(vertexText),
|
|
||||||
classData: vertex,
|
|
||||||
rx: radius,
|
|
||||||
ry: radius,
|
|
||||||
class: cssClassStr,
|
|
||||||
style: styles2.style,
|
|
||||||
id: vertex.id,
|
|
||||||
domId: vertex.domId,
|
|
||||||
tooltip: diagObj.db.getTooltip(vertex.id) || "",
|
|
||||||
haveCallback: vertex.haveCallback,
|
|
||||||
link: vertex.link,
|
|
||||||
width: vertex.type === "group" ? 500 : void 0,
|
|
||||||
type: vertex.type,
|
|
||||||
// TODO V10: Flowchart ? Keeping flowchart for backwards compatibility. Remove in next major release
|
|
||||||
padding: ((_a = getConfig().flowchart) == null ? void 0 : _a.padding) ?? ((_b = getConfig().class) == null ? void 0 : _b.padding)
|
|
||||||
};
|
|
||||||
g.setNode(vertex.id, node);
|
|
||||||
log.info("setNode", node);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
const addNotes = function(notes, g, startEdgeId, classes) {
|
|
||||||
log.info(notes);
|
|
||||||
notes.forEach(function(note, i) {
|
|
||||||
var _a, _b;
|
|
||||||
const vertex = note;
|
|
||||||
const cssNoteStr = "";
|
|
||||||
const styles2 = { labelStyle: "", style: "" };
|
|
||||||
const vertexText = vertex.text;
|
|
||||||
const radius = 0;
|
|
||||||
const shape = "note";
|
|
||||||
const node = {
|
|
||||||
labelStyle: styles2.labelStyle,
|
|
||||||
shape,
|
|
||||||
labelText: sanitizeText(vertexText),
|
|
||||||
noteData: vertex,
|
|
||||||
rx: radius,
|
|
||||||
ry: radius,
|
|
||||||
class: cssNoteStr,
|
|
||||||
style: styles2.style,
|
|
||||||
id: vertex.id,
|
|
||||||
domId: vertex.id,
|
|
||||||
tooltip: "",
|
|
||||||
type: "note",
|
|
||||||
// TODO V10: Flowchart ? Keeping flowchart for backwards compatibility. Remove in next major release
|
|
||||||
padding: ((_a = getConfig().flowchart) == null ? void 0 : _a.padding) ?? ((_b = getConfig().class) == null ? void 0 : _b.padding)
|
|
||||||
};
|
|
||||||
g.setNode(vertex.id, node);
|
|
||||||
log.info("setNode", node);
|
|
||||||
if (!vertex.class || !(vertex.class in classes)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const edgeId = startEdgeId + i;
|
|
||||||
const edgeData = {
|
|
||||||
id: `edgeNote${edgeId}`,
|
|
||||||
//Set relationship style and line type
|
|
||||||
classes: "relation",
|
|
||||||
pattern: "dotted",
|
|
||||||
// Set link type for rendering
|
|
||||||
arrowhead: "none",
|
|
||||||
//Set edge extra labels
|
|
||||||
startLabelRight: "",
|
|
||||||
endLabelLeft: "",
|
|
||||||
//Set relation arrow types
|
|
||||||
arrowTypeStart: "none",
|
|
||||||
arrowTypeEnd: "none",
|
|
||||||
style: "fill:none",
|
|
||||||
labelStyle: "",
|
|
||||||
curve: interpolateToCurve(conf.curve, curveLinear)
|
|
||||||
};
|
|
||||||
g.setEdge(vertex.id, vertex.class, edgeData, edgeId);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
const addRelations = function(relations, g) {
|
|
||||||
const conf2 = getConfig().flowchart;
|
|
||||||
let cnt = 0;
|
|
||||||
relations.forEach(function(edge) {
|
|
||||||
var _a;
|
|
||||||
cnt++;
|
|
||||||
const edgeData = {
|
|
||||||
//Set relationship style and line type
|
|
||||||
classes: "relation",
|
|
||||||
pattern: edge.relation.lineType == 1 ? "dashed" : "solid",
|
|
||||||
id: "id" + cnt,
|
|
||||||
// Set link type for rendering
|
|
||||||
arrowhead: edge.type === "arrow_open" ? "none" : "normal",
|
|
||||||
//Set edge extra labels
|
|
||||||
startLabelRight: edge.relationTitle1 === "none" ? "" : edge.relationTitle1,
|
|
||||||
endLabelLeft: edge.relationTitle2 === "none" ? "" : edge.relationTitle2,
|
|
||||||
//Set relation arrow types
|
|
||||||
arrowTypeStart: getArrowMarker(edge.relation.type1),
|
|
||||||
arrowTypeEnd: getArrowMarker(edge.relation.type2),
|
|
||||||
style: "fill:none",
|
|
||||||
labelStyle: "",
|
|
||||||
curve: interpolateToCurve(conf2 == null ? void 0 : conf2.curve, curveLinear)
|
|
||||||
};
|
|
||||||
log.info(edgeData, edge);
|
|
||||||
if (edge.style !== void 0) {
|
|
||||||
const styles2 = getStylesFromArray(edge.style);
|
|
||||||
edgeData.style = styles2.style;
|
|
||||||
edgeData.labelStyle = styles2.labelStyle;
|
|
||||||
}
|
|
||||||
edge.text = edge.title;
|
|
||||||
if (edge.text === void 0) {
|
|
||||||
if (edge.style !== void 0) {
|
|
||||||
edgeData.arrowheadStyle = "fill: #333";
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
edgeData.arrowheadStyle = "fill: #333";
|
|
||||||
edgeData.labelpos = "c";
|
|
||||||
if (((_a = getConfig().flowchart) == null ? void 0 : _a.htmlLabels) ?? getConfig().htmlLabels) {
|
|
||||||
edgeData.labelType = "html";
|
|
||||||
edgeData.label = '<span class="edgeLabel">' + edge.text + "</span>";
|
|
||||||
} else {
|
|
||||||
edgeData.labelType = "text";
|
|
||||||
edgeData.label = edge.text.replace(common.lineBreakRegex, "\n");
|
|
||||||
if (edge.style === void 0) {
|
|
||||||
edgeData.style = edgeData.style || "stroke: #333; stroke-width: 1.5px;fill:none";
|
|
||||||
}
|
|
||||||
edgeData.labelStyle = edgeData.labelStyle.replace("color:", "fill:");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
g.setEdge(edge.id1, edge.id2, edgeData, cnt);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
const setConf = function(cnf) {
|
|
||||||
conf = {
|
|
||||||
...conf,
|
|
||||||
...cnf
|
|
||||||
};
|
|
||||||
};
|
|
||||||
const draw = function(text, id, _version, diagObj) {
|
|
||||||
log.info("Drawing class - ", id);
|
|
||||||
const conf2 = getConfig().flowchart ?? getConfig().class;
|
|
||||||
const securityLevel = getConfig().securityLevel;
|
|
||||||
log.info("config:", conf2);
|
|
||||||
const nodeSpacing = (conf2 == null ? void 0 : conf2.nodeSpacing) ?? 50;
|
|
||||||
const rankSpacing = (conf2 == null ? void 0 : conf2.rankSpacing) ?? 50;
|
|
||||||
const g = new graphlib.Graph({
|
|
||||||
multigraph: true,
|
|
||||||
compound: true
|
|
||||||
}).setGraph({
|
|
||||||
rankdir: diagObj.db.getDirection(),
|
|
||||||
nodesep: nodeSpacing,
|
|
||||||
ranksep: rankSpacing,
|
|
||||||
marginx: 8,
|
|
||||||
marginy: 8
|
|
||||||
}).setDefaultEdgeLabel(function() {
|
|
||||||
return {};
|
|
||||||
});
|
|
||||||
const classes = diagObj.db.getClasses();
|
|
||||||
const relations = diagObj.db.getRelations();
|
|
||||||
const notes = diagObj.db.getNotes();
|
|
||||||
log.info(relations);
|
|
||||||
addClasses(classes, g, id, diagObj);
|
|
||||||
addRelations(relations, g);
|
|
||||||
addNotes(notes, g, relations.length + 1, classes);
|
|
||||||
let sandboxElement;
|
|
||||||
if (securityLevel === "sandbox") {
|
|
||||||
sandboxElement = select("#i" + id);
|
|
||||||
}
|
|
||||||
const root = securityLevel === "sandbox" ? (
|
|
||||||
// @ts-ignore Ignore type error for now
|
|
||||||
select(sandboxElement.nodes()[0].contentDocument.body)
|
|
||||||
) : select("body");
|
|
||||||
const svg = root.select(`[id="${id}"]`);
|
|
||||||
const element = root.select("#" + id + " g");
|
|
||||||
render(
|
|
||||||
element,
|
|
||||||
g,
|
|
||||||
["aggregation", "extension", "composition", "dependency", "lollipop"],
|
|
||||||
"classDiagram",
|
|
||||||
id
|
|
||||||
);
|
|
||||||
utils.insertTitle(svg, "classTitleText", (conf2 == null ? void 0 : conf2.titleTopMargin) ?? 5, diagObj.db.getDiagramTitle());
|
|
||||||
setupGraphViewbox(g, svg, conf2 == null ? void 0 : conf2.diagramPadding, conf2 == null ? void 0 : conf2.useMaxWidth);
|
|
||||||
if (!(conf2 == null ? void 0 : conf2.htmlLabels)) {
|
|
||||||
const doc = securityLevel === "sandbox" ? sandboxElement.nodes()[0].contentDocument : document;
|
|
||||||
const labels = doc.querySelectorAll('[id="' + id + '"] .edgeLabel .label');
|
|
||||||
for (const label of labels) {
|
|
||||||
const dim = label.getBBox();
|
|
||||||
const rect = doc.createElementNS("http://www.w3.org/2000/svg", "rect");
|
|
||||||
rect.setAttribute("rx", 0);
|
|
||||||
rect.setAttribute("ry", 0);
|
|
||||||
rect.setAttribute("width", dim.width);
|
|
||||||
rect.setAttribute("height", dim.height);
|
|
||||||
label.insertBefore(rect, label.firstChild);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
function getArrowMarker(type) {
|
|
||||||
let marker;
|
|
||||||
switch (type) {
|
|
||||||
case 0:
|
|
||||||
marker = "aggregation";
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
marker = "extension";
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
marker = "composition";
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
marker = "dependency";
|
|
||||||
break;
|
|
||||||
case 4:
|
|
||||||
marker = "lollipop";
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
marker = "none";
|
|
||||||
}
|
|
||||||
return marker;
|
|
||||||
}
|
|
||||||
const renderer = {
|
|
||||||
setConf,
|
|
||||||
draw
|
|
||||||
};
|
|
||||||
const diagram = {
|
|
||||||
parser,
|
|
||||||
db,
|
|
||||||
renderer,
|
|
||||||
styles,
|
|
||||||
init: (cnf) => {
|
|
||||||
if (!cnf.class) {
|
|
||||||
cnf.class = {};
|
|
||||||
}
|
|
||||||
cnf.class.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute;
|
|
||||||
db.clear();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
export {
|
|
||||||
diagram
|
|
||||||
};
|
|
||||||
//# sourceMappingURL=classDiagram-v2-b31c380f.js.map
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
{"version":3,"file":"classDiagram-v2-b31c380f.js","sources":["../src/diagrams/class/classRenderer-v2.ts","../src/diagrams/class/classDiagram-v2.ts"],"sourcesContent":["// @ts-ignore d3 types are not available\nimport { select, curveLinear } from 'd3';\nimport * as graphlib from 'dagre-d3-es/src/graphlib/index.js';\nimport { log } from '../../logger';\nimport { getConfig } from '../../config';\nimport { render } from '../../dagre-wrapper/index.js';\nimport utils from '../../utils';\nimport { interpolateToCurve, getStylesFromArray } from '../../utils';\nimport { setupGraphViewbox } from '../../setupGraphViewbox';\nimport common from '../common/common';\nimport { ClassRelation, ClassNote, ClassMap, EdgeData } from './classTypes';\n\nconst sanitizeText = (txt: string) => common.sanitizeText(txt, getConfig());\n\nlet conf = {\n dividerMargin: 10,\n padding: 5,\n textHeight: 10,\n curve: undefined,\n};\n\n/**\n * Function that adds the vertices found during parsing to the graph to be rendered.\n *\n * @param classes - Object containing the vertices.\n * @param g - The graph that is to be drawn.\n * @param _id - id of the graph\n * @param diagObj - The diagram object\n */\nexport const addClasses = function (\n classes: ClassMap,\n g: graphlib.Graph,\n _id: string,\n diagObj: any\n) {\n const keys = Object.keys(classes);\n log.info('keys:', keys);\n log.info(classes);\n\n // Iterate through each item in the vertex object (containing all the vertices found) in the graph definition\n keys.forEach(function (id) {\n const vertex = classes[id];\n\n /**\n * Variable for storing the classes for the vertex\n */\n let cssClassStr = '';\n if (vertex.cssClasses.length > 0) {\n cssClassStr = cssClassStr + ' ' + vertex.cssClasses.join(' ');\n }\n\n const styles = { labelStyle: '', style: '' }; //getStylesFromArray(vertex.styles);\n\n // Use vertex id as text in the box if no text is provided by the graph definition\n const vertexText = vertex.label ?? vertex.id;\n const radius = 0;\n const shape = 'class_box';\n // Add the node\n const node = {\n labelStyle: styles.labelStyle,\n shape: shape,\n labelText: sanitizeText(vertexText),\n classData: vertex,\n rx: radius,\n ry: radius,\n class: cssClassStr,\n style: styles.style,\n id: vertex.id,\n domId: vertex.domId,\n tooltip: diagObj.db.getTooltip(vertex.id) || '',\n haveCallback: vertex.haveCallback,\n link: vertex.link,\n width: vertex.type === 'group' ? 500 : undefined,\n type: vertex.type,\n // TODO V10: Flowchart ? Keeping flowchart for backwards compatibility. Remove in next major release\n padding: getConfig().flowchart?.padding ?? getConfig().class?.padding,\n };\n g.setNode(vertex.id, node);\n log.info('setNode', node);\n });\n};\n\n/**\n * Function that adds the additional vertices (notes) found during parsing to the graph to be rendered.\n *\n * @param notes - Object containing the additional vertices (notes).\n * @param g - The graph that is to be drawn.\n * @param startEdgeId - starting index for note edge\n * @param classes - Classes\n */\nexport const addNotes = function (\n notes: ClassNote[],\n g: graphlib.Graph,\n startEdgeId: number,\n classes: ClassMap\n) {\n log.info(notes);\n\n // Iterate through each item in the vertex object (containing all the vertices found) in the graph definition\n notes.forEach(function (note, i) {\n const vertex = note;\n\n /**\n * Variable for storing the classes for the vertex\n *\n */\n const cssNoteStr = '';\n\n const styles = { labelStyle: '', style: '' };\n\n // Use vertex id as text in the box if no text is provided by the graph definition\n const vertexText = vertex.text;\n\n const radius = 0;\n const shape = 'note';\n // Add the node\n const node = {\n labelStyle: styles.labelStyle,\n shape: shape,\n labelText: sanitizeText(vertexText),\n noteData: vertex,\n rx: radius,\n ry: radius,\n class: cssNoteStr,\n style: styles.style,\n id: vertex.id,\n domId: vertex.id,\n tooltip: '',\n type: 'note',\n // TODO V10: Flowchart ? Keeping flowchart for backwards compatibility. Remove in next major release\n padding: getConfig().flowchart?.padding ?? getConfig().class?.padding,\n };\n g.setNode(vertex.id, node);\n log.info('setNode', node);\n\n if (!vertex.class || !(vertex.class in classes)) {\n return;\n }\n const edgeId = startEdgeId + i;\n\n const edgeData: EdgeData = {\n id: `edgeNote${edgeId}`,\n //Set relationship style and line type\n classes: 'relation',\n pattern: 'dotted',\n // Set link type for rendering\n arrowhead: 'none',\n //Set edge extra labels\n startLabelRight: '',\n endLabelLeft: '',\n //Set relation arrow types\n arrowTypeStart: 'none',\n arrowTypeEnd: 'none'Line truncated
|
|
||||||
@@ -1,272 +0,0 @@
|
|||||||
import { p as parser, d as db, s as styles } from "./styles-ee347520.js";
|
|
||||||
import { l as log, g as getConfig, f as select, e as common } from "./config-b4fa35bb.js";
|
|
||||||
import { G as Graph } from "./layout-47a4d1ce.js";
|
|
||||||
import { r as render } from "./index-70db0a05.js";
|
|
||||||
import { u as utils, z as interpolateToCurve, x as curveLinear, y as getStylesFromArray } from "./utils-872dfc50.js";
|
|
||||||
import { s as setupGraphViewbox } from "./setupGraphViewbox-16a0ba81.js";
|
|
||||||
import "./mermaidAPI-a31c2c80.js";
|
|
||||||
import "./errorRenderer-ebf63d74.js";
|
|
||||||
import "./commonDb-7f40ab5a.js";
|
|
||||||
import "./isPlainObject-53794b96.js";
|
|
||||||
import "./array-b7dcf730.js";
|
|
||||||
import "./constant-b644328d.js";
|
|
||||||
import "./edges-3b4dbffd.js";
|
|
||||||
import "./svgDraw-aae20718.js";
|
|
||||||
const sanitizeText = (txt) => common.sanitizeText(txt, getConfig());
|
|
||||||
let conf = {
|
|
||||||
dividerMargin: 10,
|
|
||||||
padding: 5,
|
|
||||||
textHeight: 10,
|
|
||||||
curve: void 0
|
|
||||||
};
|
|
||||||
const addClasses = function(classes, g, _id, diagObj) {
|
|
||||||
const keys = Object.keys(classes);
|
|
||||||
log.info("keys:", keys);
|
|
||||||
log.info(classes);
|
|
||||||
keys.forEach(function(id) {
|
|
||||||
var _a, _b;
|
|
||||||
const vertex = classes[id];
|
|
||||||
let cssClassStr = "";
|
|
||||||
if (vertex.cssClasses.length > 0) {
|
|
||||||
cssClassStr = cssClassStr + " " + vertex.cssClasses.join(" ");
|
|
||||||
}
|
|
||||||
const styles2 = { labelStyle: "", style: "" };
|
|
||||||
const vertexText = vertex.label ?? vertex.id;
|
|
||||||
const radius = 0;
|
|
||||||
const shape = "class_box";
|
|
||||||
const node = {
|
|
||||||
labelStyle: styles2.labelStyle,
|
|
||||||
shape,
|
|
||||||
labelText: sanitizeText(vertexText),
|
|
||||||
classData: vertex,
|
|
||||||
rx: radius,
|
|
||||||
ry: radius,
|
|
||||||
class: cssClassStr,
|
|
||||||
style: styles2.style,
|
|
||||||
id: vertex.id,
|
|
||||||
domId: vertex.domId,
|
|
||||||
tooltip: diagObj.db.getTooltip(vertex.id) || "",
|
|
||||||
haveCallback: vertex.haveCallback,
|
|
||||||
link: vertex.link,
|
|
||||||
width: vertex.type === "group" ? 500 : void 0,
|
|
||||||
type: vertex.type,
|
|
||||||
// TODO V10: Flowchart ? Keeping flowchart for backwards compatibility. Remove in next major release
|
|
||||||
padding: ((_a = getConfig().flowchart) == null ? void 0 : _a.padding) ?? ((_b = getConfig().class) == null ? void 0 : _b.padding)
|
|
||||||
};
|
|
||||||
g.setNode(vertex.id, node);
|
|
||||||
log.info("setNode", node);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
const addNotes = function(notes, g, startEdgeId, classes) {
|
|
||||||
log.info(notes);
|
|
||||||
notes.forEach(function(note, i) {
|
|
||||||
var _a, _b;
|
|
||||||
const vertex = note;
|
|
||||||
const cssNoteStr = "";
|
|
||||||
const styles2 = { labelStyle: "", style: "" };
|
|
||||||
const vertexText = vertex.text;
|
|
||||||
const radius = 0;
|
|
||||||
const shape = "note";
|
|
||||||
const node = {
|
|
||||||
labelStyle: styles2.labelStyle,
|
|
||||||
shape,
|
|
||||||
labelText: sanitizeText(vertexText),
|
|
||||||
noteData: vertex,
|
|
||||||
rx: radius,
|
|
||||||
ry: radius,
|
|
||||||
class: cssNoteStr,
|
|
||||||
style: styles2.style,
|
|
||||||
id: vertex.id,
|
|
||||||
domId: vertex.id,
|
|
||||||
tooltip: "",
|
|
||||||
type: "note",
|
|
||||||
// TODO V10: Flowchart ? Keeping flowchart for backwards compatibility. Remove in next major release
|
|
||||||
padding: ((_a = getConfig().flowchart) == null ? void 0 : _a.padding) ?? ((_b = getConfig().class) == null ? void 0 : _b.padding)
|
|
||||||
};
|
|
||||||
g.setNode(vertex.id, node);
|
|
||||||
log.info("setNode", node);
|
|
||||||
if (!vertex.class || !(vertex.class in classes)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const edgeId = startEdgeId + i;
|
|
||||||
const edgeData = {
|
|
||||||
id: `edgeNote${edgeId}`,
|
|
||||||
//Set relationship style and line type
|
|
||||||
classes: "relation",
|
|
||||||
pattern: "dotted",
|
|
||||||
// Set link type for rendering
|
|
||||||
arrowhead: "none",
|
|
||||||
//Set edge extra labels
|
|
||||||
startLabelRight: "",
|
|
||||||
endLabelLeft: "",
|
|
||||||
//Set relation arrow types
|
|
||||||
arrowTypeStart: "none",
|
|
||||||
arrowTypeEnd: "none",
|
|
||||||
style: "fill:none",
|
|
||||||
labelStyle: "",
|
|
||||||
curve: interpolateToCurve(conf.curve, curveLinear)
|
|
||||||
};
|
|
||||||
g.setEdge(vertex.id, vertex.class, edgeData, edgeId);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
const addRelations = function(relations, g) {
|
|
||||||
const conf2 = getConfig().flowchart;
|
|
||||||
let cnt = 0;
|
|
||||||
relations.forEach(function(edge) {
|
|
||||||
var _a;
|
|
||||||
cnt++;
|
|
||||||
const edgeData = {
|
|
||||||
//Set relationship style and line type
|
|
||||||
classes: "relation",
|
|
||||||
pattern: edge.relation.lineType == 1 ? "dashed" : "solid",
|
|
||||||
id: "id" + cnt,
|
|
||||||
// Set link type for rendering
|
|
||||||
arrowhead: edge.type === "arrow_open" ? "none" : "normal",
|
|
||||||
//Set edge extra labels
|
|
||||||
startLabelRight: edge.relationTitle1 === "none" ? "" : edge.relationTitle1,
|
|
||||||
endLabelLeft: edge.relationTitle2 === "none" ? "" : edge.relationTitle2,
|
|
||||||
//Set relation arrow types
|
|
||||||
arrowTypeStart: getArrowMarker(edge.relation.type1),
|
|
||||||
arrowTypeEnd: getArrowMarker(edge.relation.type2),
|
|
||||||
style: "fill:none",
|
|
||||||
labelStyle: "",
|
|
||||||
curve: interpolateToCurve(conf2 == null ? void 0 : conf2.curve, curveLinear)
|
|
||||||
};
|
|
||||||
log.info(edgeData, edge);
|
|
||||||
if (edge.style !== void 0) {
|
|
||||||
const styles2 = getStylesFromArray(edge.style);
|
|
||||||
edgeData.style = styles2.style;
|
|
||||||
edgeData.labelStyle = styles2.labelStyle;
|
|
||||||
}
|
|
||||||
edge.text = edge.title;
|
|
||||||
if (edge.text === void 0) {
|
|
||||||
if (edge.style !== void 0) {
|
|
||||||
edgeData.arrowheadStyle = "fill: #333";
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
edgeData.arrowheadStyle = "fill: #333";
|
|
||||||
edgeData.labelpos = "c";
|
|
||||||
if (((_a = getConfig().flowchart) == null ? void 0 : _a.htmlLabels) ?? getConfig().htmlLabels) {
|
|
||||||
edgeData.labelType = "html";
|
|
||||||
edgeData.label = '<span class="edgeLabel">' + edge.text + "</span>";
|
|
||||||
} else {
|
|
||||||
edgeData.labelType = "text";
|
|
||||||
edgeData.label = edge.text.replace(common.lineBreakRegex, "\n");
|
|
||||||
if (edge.style === void 0) {
|
|
||||||
edgeData.style = edgeData.style || "stroke: #333; stroke-width: 1.5px;fill:none";
|
|
||||||
}
|
|
||||||
edgeData.labelStyle = edgeData.labelStyle.replace("color:", "fill:");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
g.setEdge(edge.id1, edge.id2, edgeData, cnt);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
const setConf = function(cnf) {
|
|
||||||
conf = {
|
|
||||||
...conf,
|
|
||||||
...cnf
|
|
||||||
};
|
|
||||||
};
|
|
||||||
const draw = function(text, id, _version, diagObj) {
|
|
||||||
log.info("Drawing class - ", id);
|
|
||||||
const conf2 = getConfig().flowchart ?? getConfig().class;
|
|
||||||
const securityLevel = getConfig().securityLevel;
|
|
||||||
log.info("config:", conf2);
|
|
||||||
const nodeSpacing = (conf2 == null ? void 0 : conf2.nodeSpacing) ?? 50;
|
|
||||||
const rankSpacing = (conf2 == null ? void 0 : conf2.rankSpacing) ?? 50;
|
|
||||||
const g = new Graph({
|
|
||||||
multigraph: true,
|
|
||||||
compound: true
|
|
||||||
}).setGraph({
|
|
||||||
rankdir: diagObj.db.getDirection(),
|
|
||||||
nodesep: nodeSpacing,
|
|
||||||
ranksep: rankSpacing,
|
|
||||||
marginx: 8,
|
|
||||||
marginy: 8
|
|
||||||
}).setDefaultEdgeLabel(function() {
|
|
||||||
return {};
|
|
||||||
});
|
|
||||||
const classes = diagObj.db.getClasses();
|
|
||||||
const relations = diagObj.db.getRelations();
|
|
||||||
const notes = diagObj.db.getNotes();
|
|
||||||
log.info(relations);
|
|
||||||
addClasses(classes, g, id, diagObj);
|
|
||||||
addRelations(relations, g);
|
|
||||||
addNotes(notes, g, relations.length + 1, classes);
|
|
||||||
let sandboxElement;
|
|
||||||
if (securityLevel === "sandbox") {
|
|
||||||
sandboxElement = select("#i" + id);
|
|
||||||
}
|
|
||||||
const root = securityLevel === "sandbox" ? (
|
|
||||||
// @ts-ignore Ignore type error for now
|
|
||||||
select(sandboxElement.nodes()[0].contentDocument.body)
|
|
||||||
) : select("body");
|
|
||||||
const svg = root.select(`[id="${id}"]`);
|
|
||||||
const element = root.select("#" + id + " g");
|
|
||||||
render(
|
|
||||||
element,
|
|
||||||
g,
|
|
||||||
["aggregation", "extension", "composition", "dependency", "lollipop"],
|
|
||||||
"classDiagram",
|
|
||||||
id
|
|
||||||
);
|
|
||||||
utils.insertTitle(svg, "classTitleText", (conf2 == null ? void 0 : conf2.titleTopMargin) ?? 5, diagObj.db.getDiagramTitle());
|
|
||||||
setupGraphViewbox(g, svg, conf2 == null ? void 0 : conf2.diagramPadding, conf2 == null ? void 0 : conf2.useMaxWidth);
|
|
||||||
if (!(conf2 == null ? void 0 : conf2.htmlLabels)) {
|
|
||||||
const doc = securityLevel === "sandbox" ? sandboxElement.nodes()[0].contentDocument : document;
|
|
||||||
const labels = doc.querySelectorAll('[id="' + id + '"] .edgeLabel .label');
|
|
||||||
for (const label of labels) {
|
|
||||||
const dim = label.getBBox();
|
|
||||||
const rect = doc.createElementNS("http://www.w3.org/2000/svg", "rect");
|
|
||||||
rect.setAttribute("rx", 0);
|
|
||||||
rect.setAttribute("ry", 0);
|
|
||||||
rect.setAttribute("width", dim.width);
|
|
||||||
rect.setAttribute("height", dim.height);
|
|
||||||
label.insertBefore(rect, label.firstChild);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
function getArrowMarker(type) {
|
|
||||||
let marker;
|
|
||||||
switch (type) {
|
|
||||||
case 0:
|
|
||||||
marker = "aggregation";
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
marker = "extension";
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
marker = "composition";
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
marker = "dependency";
|
|
||||||
break;
|
|
||||||
case 4:
|
|
||||||
marker = "lollipop";
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
marker = "none";
|
|
||||||
}
|
|
||||||
return marker;
|
|
||||||
}
|
|
||||||
const renderer = {
|
|
||||||
setConf,
|
|
||||||
draw
|
|
||||||
};
|
|
||||||
const diagram = {
|
|
||||||
parser,
|
|
||||||
db,
|
|
||||||
renderer,
|
|
||||||
styles,
|
|
||||||
init: (cnf) => {
|
|
||||||
if (!cnf.class) {
|
|
||||||
cnf.class = {};
|
|
||||||
}
|
|
||||||
cnf.class.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute;
|
|
||||||
db.clear();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
export {
|
|
||||||
diagram
|
|
||||||
};
|
|
||||||
//# sourceMappingURL=classDiagram-v2-cd41be19.js.map
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
{"version":3,"file":"classDiagram-v2-cd41be19.js","sources":["../src/diagrams/class/classRenderer-v2.ts","../src/diagrams/class/classDiagram-v2.ts"],"sourcesContent":["// @ts-ignore d3 types are not available\nimport { select, curveLinear } from 'd3';\nimport * as graphlib from 'dagre-d3-es/src/graphlib/index.js';\nimport { log } from '../../logger';\nimport { getConfig } from '../../config';\nimport { render } from '../../dagre-wrapper/index.js';\nimport utils from '../../utils';\nimport { interpolateToCurve, getStylesFromArray } from '../../utils';\nimport { setupGraphViewbox } from '../../setupGraphViewbox';\nimport common from '../common/common';\nimport { ClassRelation, ClassNote, ClassMap, EdgeData } from './classTypes';\n\nconst sanitizeText = (txt: string) => common.sanitizeText(txt, getConfig());\n\nlet conf = {\n dividerMargin: 10,\n padding: 5,\n textHeight: 10,\n curve: undefined,\n};\n\n/**\n * Function that adds the vertices found during parsing to the graph to be rendered.\n *\n * @param classes - Object containing the vertices.\n * @param g - The graph that is to be drawn.\n * @param _id - id of the graph\n * @param diagObj - The diagram object\n */\nexport const addClasses = function (\n classes: ClassMap,\n g: graphlib.Graph,\n _id: string,\n diagObj: any\n) {\n const keys = Object.keys(classes);\n log.info('keys:', keys);\n log.info(classes);\n\n // Iterate through each item in the vertex object (containing all the vertices found) in the graph definition\n keys.forEach(function (id) {\n const vertex = classes[id];\n\n /**\n * Variable for storing the classes for the vertex\n */\n let cssClassStr = '';\n if (vertex.cssClasses.length > 0) {\n cssClassStr = cssClassStr + ' ' + vertex.cssClasses.join(' ');\n }\n\n const styles = { labelStyle: '', style: '' }; //getStylesFromArray(vertex.styles);\n\n // Use vertex id as text in the box if no text is provided by the graph definition\n const vertexText = vertex.label ?? vertex.id;\n const radius = 0;\n const shape = 'class_box';\n // Add the node\n const node = {\n labelStyle: styles.labelStyle,\n shape: shape,\n labelText: sanitizeText(vertexText),\n classData: vertex,\n rx: radius,\n ry: radius,\n class: cssClassStr,\n style: styles.style,\n id: vertex.id,\n domId: vertex.domId,\n tooltip: diagObj.db.getTooltip(vertex.id) || '',\n haveCallback: vertex.haveCallback,\n link: vertex.link,\n width: vertex.type === 'group' ? 500 : undefined,\n type: vertex.type,\n // TODO V10: Flowchart ? Keeping flowchart for backwards compatibility. Remove in next major release\n padding: getConfig().flowchart?.padding ?? getConfig().class?.padding,\n };\n g.setNode(vertex.id, node);\n log.info('setNode', node);\n });\n};\n\n/**\n * Function that adds the additional vertices (notes) found during parsing to the graph to be rendered.\n *\n * @param notes - Object containing the additional vertices (notes).\n * @param g - The graph that is to be drawn.\n * @param startEdgeId - starting index for note edge\n * @param classes - Classes\n */\nexport const addNotes = function (\n notes: ClassNote[],\n g: graphlib.Graph,\n startEdgeId: number,\n classes: ClassMap\n) {\n log.info(notes);\n\n // Iterate through each item in the vertex object (containing all the vertices found) in the graph definition\n notes.forEach(function (note, i) {\n const vertex = note;\n\n /**\n * Variable for storing the classes for the vertex\n *\n */\n const cssNoteStr = '';\n\n const styles = { labelStyle: '', style: '' };\n\n // Use vertex id as text in the box if no text is provided by the graph definition\n const vertexText = vertex.text;\n\n const radius = 0;\n const shape = 'note';\n // Add the node\n const node = {\n labelStyle: styles.labelStyle,\n shape: shape,\n labelText: sanitizeText(vertexText),\n noteData: vertex,\n rx: radius,\n ry: radius,\n class: cssNoteStr,\n style: styles.style,\n id: vertex.id,\n domId: vertex.id,\n tooltip: '',\n type: 'note',\n // TODO V10: Flowchart ? Keeping flowchart for backwards compatibility. Remove in next major release\n padding: getConfig().flowchart?.padding ?? getConfig().class?.padding,\n };\n g.setNode(vertex.id, node);\n log.info('setNode', node);\n\n if (!vertex.class || !(vertex.class in classes)) {\n return;\n }\n const edgeId = startEdgeId + i;\n\n const edgeData: EdgeData = {\n id: `edgeNote${edgeId}`,\n //Set relationship style and line type\n classes: 'relation',\n pattern: 'dotted',\n // Set link type for rendering\n arrowhead: 'none',\n //Set edge extra labels\n startLabelRight: '',\n endLabelLeft: '',\n //Set relation arrow types\n arrowTypeStart: 'none',\n arrowTypeEnd: 'none'Line truncated
|
|
||||||
@@ -1,59 +0,0 @@
|
|||||||
import { b as sanitizeText$1, g as getConfig } from "./config-389b86ff.js";
|
|
||||||
let title = "";
|
|
||||||
let diagramTitle = "";
|
|
||||||
let description = "";
|
|
||||||
const sanitizeText = (txt) => sanitizeText$1(txt, getConfig());
|
|
||||||
const clear = function() {
|
|
||||||
title = "";
|
|
||||||
description = "";
|
|
||||||
diagramTitle = "";
|
|
||||||
};
|
|
||||||
const setAccTitle = function(txt) {
|
|
||||||
title = sanitizeText(txt).replace(/^\s+/g, "");
|
|
||||||
};
|
|
||||||
const getAccTitle = function() {
|
|
||||||
return title || diagramTitle;
|
|
||||||
};
|
|
||||||
const setAccDescription = function(txt) {
|
|
||||||
description = sanitizeText(txt).replace(/\n\s+/g, "\n");
|
|
||||||
};
|
|
||||||
const getAccDescription = function() {
|
|
||||||
return description;
|
|
||||||
};
|
|
||||||
const setDiagramTitle = function(txt) {
|
|
||||||
diagramTitle = sanitizeText(txt);
|
|
||||||
};
|
|
||||||
const getDiagramTitle = function() {
|
|
||||||
return diagramTitle;
|
|
||||||
};
|
|
||||||
const commonDb = {
|
|
||||||
setAccTitle,
|
|
||||||
getAccTitle,
|
|
||||||
setDiagramTitle,
|
|
||||||
getDiagramTitle,
|
|
||||||
getAccDescription,
|
|
||||||
setAccDescription,
|
|
||||||
clear
|
|
||||||
};
|
|
||||||
const commonDb$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
||||||
__proto__: null,
|
|
||||||
clear,
|
|
||||||
default: commonDb,
|
|
||||||
getAccDescription,
|
|
||||||
getAccTitle,
|
|
||||||
getDiagramTitle,
|
|
||||||
setAccDescription,
|
|
||||||
setAccTitle,
|
|
||||||
setDiagramTitle
|
|
||||||
}, Symbol.toStringTag, { value: "Module" }));
|
|
||||||
export {
|
|
||||||
getAccDescription as a,
|
|
||||||
setAccDescription as b,
|
|
||||||
commonDb$1 as c,
|
|
||||||
setDiagramTitle as d,
|
|
||||||
getDiagramTitle as e,
|
|
||||||
clear as f,
|
|
||||||
getAccTitle as g,
|
|
||||||
setAccTitle as s
|
|
||||||
};
|
|
||||||
//# sourceMappingURL=commonDb-2ace122b.js.map
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
{"version":3,"file":"commonDb-2ace122b.js","sources":["../src/commonDb.ts"],"sourcesContent":["import { sanitizeText as _sanitizeText } from './diagrams/common/common';\nimport { getConfig } from './config';\nlet title = '';\nlet diagramTitle = '';\nlet description = '';\nconst sanitizeText = (txt: string): string => _sanitizeText(txt, getConfig());\n\nexport const clear = function (): void {\n title = '';\n description = '';\n diagramTitle = '';\n};\n\nexport const setAccTitle = function (txt: string): void {\n title = sanitizeText(txt).replace(/^\\s+/g, '');\n};\n\nexport const getAccTitle = function (): string {\n return title || diagramTitle;\n};\n\nexport const setAccDescription = function (txt: string): void {\n description = sanitizeText(txt).replace(/\\n\\s+/g, '\\n');\n};\n\nexport const getAccDescription = function (): string {\n return description;\n};\n\nexport const setDiagramTitle = function (txt: string): void {\n diagramTitle = sanitizeText(txt);\n};\n\nexport const getDiagramTitle = function (): string {\n return diagramTitle;\n};\n\nexport default {\n setAccTitle,\n getAccTitle,\n setDiagramTitle,\n getDiagramTitle: getDiagramTitle,\n getAccDescription,\n setAccDescription,\n clear,\n};\n"],"names":["_sanitizeText"],"mappings":";AAEA,IAAI,QAAQ;AACZ,IAAI,eAAe;AACnB,IAAI,cAAc;AAClB,MAAM,eAAe,CAAC,QAAwBA,eAAc,KAAK,UAAW,CAAA;AAErE,MAAM,QAAQ,WAAkB;AAC7B,UAAA;AACM,gBAAA;AACC,iBAAA;AACjB;AAEa,MAAA,cAAc,SAAU,KAAmB;AACtD,UAAQ,aAAa,GAAG,EAAE,QAAQ,SAAS,EAAE;AAC/C;AAEO,MAAM,cAAc,WAAoB;AAC7C,SAAO,SAAS;AAClB;AAEa,MAAA,oBAAoB,SAAU,KAAmB;AAC5D,gBAAc,aAAa,GAAG,EAAE,QAAQ,UAAU,IAAI;AACxD;AAEO,MAAM,oBAAoB,WAAoB;AAC5C,SAAA;AACT;AAEa,MAAA,kBAAkB,SAAU,KAAmB;AAC1D,iBAAe,aAAa,GAAG;AACjC;AAEO,MAAM,kBAAkB,WAAoB;AAC1C,SAAA;AACT;AAEA,MAAe,WAAA;AAAA,EACb;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;;;;;;;;;;;;"}
|
|
||||||
@@ -1,47 +0,0 @@
|
|||||||
import { b as f, g as m } from "./config-e567ef17.js";
|
|
||||||
let n = "", e = "", c = "";
|
|
||||||
const o = (t) => f(t, m()), s = function() {
|
|
||||||
n = "", c = "", e = "";
|
|
||||||
}, i = function(t) {
|
|
||||||
n = o(t).replace(/^\s+/g, "");
|
|
||||||
}, a = function() {
|
|
||||||
return n || e;
|
|
||||||
}, r = function(t) {
|
|
||||||
c = o(t).replace(/\n\s+/g, `
|
|
||||||
`);
|
|
||||||
}, l = function() {
|
|
||||||
return c;
|
|
||||||
}, g = function(t) {
|
|
||||||
e = o(t);
|
|
||||||
}, u = function() {
|
|
||||||
return e;
|
|
||||||
}, p = {
|
|
||||||
setAccTitle: i,
|
|
||||||
getAccTitle: a,
|
|
||||||
setDiagramTitle: g,
|
|
||||||
getDiagramTitle: u,
|
|
||||||
getAccDescription: l,
|
|
||||||
setAccDescription: r,
|
|
||||||
clear: s
|
|
||||||
}, b = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
||||||
__proto__: null,
|
|
||||||
clear: s,
|
|
||||||
default: p,
|
|
||||||
getAccDescription: l,
|
|
||||||
getAccTitle: a,
|
|
||||||
getDiagramTitle: u,
|
|
||||||
setAccDescription: r,
|
|
||||||
setAccTitle: i,
|
|
||||||
setDiagramTitle: g
|
|
||||||
}, Symbol.toStringTag, { value: "Module" }));
|
|
||||||
export {
|
|
||||||
l as a,
|
|
||||||
r as b,
|
|
||||||
b as c,
|
|
||||||
g as d,
|
|
||||||
u as e,
|
|
||||||
s as f,
|
|
||||||
a as g,
|
|
||||||
i as s
|
|
||||||
};
|
|
||||||
//# sourceMappingURL=commonDb-4dc3d465.js.map
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
{"version":3,"file":"commonDb-4dc3d465.js","sources":["../src/commonDb.ts"],"sourcesContent":["import { sanitizeText as _sanitizeText } from './diagrams/common/common';\nimport { getConfig } from './config';\nlet title = '';\nlet diagramTitle = '';\nlet description = '';\nconst sanitizeText = (txt: string): string => _sanitizeText(txt, getConfig());\n\nexport const clear = function (): void {\n title = '';\n description = '';\n diagramTitle = '';\n};\n\nexport const setAccTitle = function (txt: string): void {\n title = sanitizeText(txt).replace(/^\\s+/g, '');\n};\n\nexport const getAccTitle = function (): string {\n return title || diagramTitle;\n};\n\nexport const setAccDescription = function (txt: string): void {\n description = sanitizeText(txt).replace(/\\n\\s+/g, '\\n');\n};\n\nexport const getAccDescription = function (): string {\n return description;\n};\n\nexport const setDiagramTitle = function (txt: string): void {\n diagramTitle = sanitizeText(txt);\n};\n\nexport const getDiagramTitle = function (): string {\n return diagramTitle;\n};\n\nexport default {\n setAccTitle,\n getAccTitle,\n setDiagramTitle,\n getDiagramTitle: getDiagramTitle,\n getAccDescription,\n setAccDescription,\n clear,\n};\n"],"names":["title","diagramTitle","description","sanitizeText","txt","_sanitizeText","getConfig","clear","setAccTitle","getAccTitle","setAccDescription","getAccDescription","setDiagramTitle","getDiagramTitle","commonDb"],"mappings":";AAEA,IAAIA,IAAQ,IACRC,IAAe,IACfC,IAAc;AAClB,MAAMC,IAAe,CAACC,MAAwBC,EAAcD,GAAKE,EAAW,CAAA,GAE/DC,IAAQ,WAAkB;AAC7B,EAAAP,IAAA,IACME,IAAA,IACCD,IAAA;AACjB,GAEaO,IAAc,SAAUJ,GAAmB;AACtD,EAAAJ,IAAQG,EAAaC,CAAG,EAAE,QAAQ,SAAS,EAAE;AAC/C,GAEaK,IAAc,WAAoB;AAC7C,SAAOT,KAASC;AAClB,GAEaS,IAAoB,SAAUN,GAAmB;AAC5D,EAAAF,IAAcC,EAAaC,CAAG,EAAE,QAAQ,UAAU;AAAA,CAAI;AACxD,GAEaO,IAAoB,WAAoB;AAC5C,SAAAT;AACT,GAEaU,IAAkB,SAAUR,GAAmB;AAC1D,EAAAH,IAAeE,EAAaC,CAAG;AACjC,GAEaS,IAAkB,WAAoB;AAC1C,SAAAZ;AACT,GAEea,IAAA;AAAA,EACb,aAAAN;AAAA,EACA,aAAAC;AAAA,EACA,iBAAAG;AAAA,EACA,iBAAAC;AAAA,EACA,mBAAAF;AAAA,EACA,mBAAAD;AAAA,EACA,OAAAH;AACF;;;;;;;;;;;"}
|
|
||||||
@@ -1,59 +0,0 @@
|
|||||||
import { b as sanitizeText$1, g as getConfig } from "./config-b4fa35bb.js";
|
|
||||||
let title = "";
|
|
||||||
let diagramTitle = "";
|
|
||||||
let description = "";
|
|
||||||
const sanitizeText = (txt) => sanitizeText$1(txt, getConfig());
|
|
||||||
const clear = function() {
|
|
||||||
title = "";
|
|
||||||
description = "";
|
|
||||||
diagramTitle = "";
|
|
||||||
};
|
|
||||||
const setAccTitle = function(txt) {
|
|
||||||
title = sanitizeText(txt).replace(/^\s+/g, "");
|
|
||||||
};
|
|
||||||
const getAccTitle = function() {
|
|
||||||
return title || diagramTitle;
|
|
||||||
};
|
|
||||||
const setAccDescription = function(txt) {
|
|
||||||
description = sanitizeText(txt).replace(/\n\s+/g, "\n");
|
|
||||||
};
|
|
||||||
const getAccDescription = function() {
|
|
||||||
return description;
|
|
||||||
};
|
|
||||||
const setDiagramTitle = function(txt) {
|
|
||||||
diagramTitle = sanitizeText(txt);
|
|
||||||
};
|
|
||||||
const getDiagramTitle = function() {
|
|
||||||
return diagramTitle;
|
|
||||||
};
|
|
||||||
const commonDb = {
|
|
||||||
setAccTitle,
|
|
||||||
getAccTitle,
|
|
||||||
setDiagramTitle,
|
|
||||||
getDiagramTitle,
|
|
||||||
getAccDescription,
|
|
||||||
setAccDescription,
|
|
||||||
clear
|
|
||||||
};
|
|
||||||
const commonDb$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
||||||
__proto__: null,
|
|
||||||
clear,
|
|
||||||
default: commonDb,
|
|
||||||
getAccDescription,
|
|
||||||
getAccTitle,
|
|
||||||
getDiagramTitle,
|
|
||||||
setAccDescription,
|
|
||||||
setAccTitle,
|
|
||||||
setDiagramTitle
|
|
||||||
}, Symbol.toStringTag, { value: "Module" }));
|
|
||||||
export {
|
|
||||||
getAccDescription as a,
|
|
||||||
setAccDescription as b,
|
|
||||||
commonDb$1 as c,
|
|
||||||
setDiagramTitle as d,
|
|
||||||
getDiagramTitle as e,
|
|
||||||
clear as f,
|
|
||||||
getAccTitle as g,
|
|
||||||
setAccTitle as s
|
|
||||||
};
|
|
||||||
//# sourceMappingURL=commonDb-7f40ab5a.js.map
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
{"version":3,"file":"commonDb-7f40ab5a.js","sources":["../src/commonDb.ts"],"sourcesContent":["import { sanitizeText as _sanitizeText } from './diagrams/common/common';\nimport { getConfig } from './config';\nlet title = '';\nlet diagramTitle = '';\nlet description = '';\nconst sanitizeText = (txt: string): string => _sanitizeText(txt, getConfig());\n\nexport const clear = function (): void {\n title = '';\n description = '';\n diagramTitle = '';\n};\n\nexport const setAccTitle = function (txt: string): void {\n title = sanitizeText(txt).replace(/^\\s+/g, '');\n};\n\nexport const getAccTitle = function (): string {\n return title || diagramTitle;\n};\n\nexport const setAccDescription = function (txt: string): void {\n description = sanitizeText(txt).replace(/\\n\\s+/g, '\\n');\n};\n\nexport const getAccDescription = function (): string {\n return description;\n};\n\nexport const setDiagramTitle = function (txt: string): void {\n diagramTitle = sanitizeText(txt);\n};\n\nexport const getDiagramTitle = function (): string {\n return diagramTitle;\n};\n\nexport default {\n setAccTitle,\n getAccTitle,\n setDiagramTitle,\n getDiagramTitle: getDiagramTitle,\n getAccDescription,\n setAccDescription,\n clear,\n};\n"],"names":["_sanitizeText"],"mappings":";AAEA,IAAI,QAAQ;AACZ,IAAI,eAAe;AACnB,IAAI,cAAc;AAClB,MAAM,eAAe,CAAC,QAAwBA,eAAc,KAAK,UAAW,CAAA;AAErE,MAAM,QAAQ,WAAkB;AAC7B,UAAA;AACM,gBAAA;AACC,iBAAA;AACjB;AAEa,MAAA,cAAc,SAAU,KAAmB;AACtD,UAAQ,aAAa,GAAG,EAAE,QAAQ,SAAS,EAAE;AAC/C;AAEO,MAAM,cAAc,WAAoB;AAC7C,SAAO,SAAS;AAClB;AAEa,MAAA,oBAAoB,SAAU,KAAmB;AAC5D,gBAAc,aAAa,GAAG,EAAE,QAAQ,UAAU,IAAI;AACxD;AAEO,MAAM,oBAAoB,WAAoB;AAC5C,SAAA;AACT;AAEa,MAAA,kBAAkB,SAAU,KAAmB;AAC1D,iBAAe,aAAa,GAAG;AACjC;AAEO,MAAM,kBAAkB,WAAoB;AAC1C,SAAA;AACT;AAEA,MAAe,WAAA;AAAA,EACb;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;;;;;;;;;;;;"}
|
|
||||||
Vendored
-17
@@ -1,17 +0,0 @@
|
|||||||
export declare const clear: () => void;
|
|
||||||
export declare const setAccTitle: (txt: string) => void;
|
|
||||||
export declare const getAccTitle: () => string;
|
|
||||||
export declare const setAccDescription: (txt: string) => void;
|
|
||||||
export declare const getAccDescription: () => string;
|
|
||||||
export declare const setDiagramTitle: (txt: string) => void;
|
|
||||||
export declare const getDiagramTitle: () => string;
|
|
||||||
declare const _default: {
|
|
||||||
setAccTitle: (txt: string) => void;
|
|
||||||
getAccTitle: () => string;
|
|
||||||
setDiagramTitle: (txt: string) => void;
|
|
||||||
getDiagramTitle: () => string;
|
|
||||||
getAccDescription: () => string;
|
|
||||||
setAccDescription: (txt: string) => void;
|
|
||||||
clear: () => void;
|
|
||||||
};
|
|
||||||
export default _default;
|
|
||||||
File diff suppressed because it is too large.
Load diff
@@ -1 +0,0 @@
|
|||||||
{"version":3,"file":"config-389b86ff.js","sources":["../src/logger.ts","../src/diagrams/common/common.ts","../src/themes/theme-helpers.js","../src/themes/erDiagram-oldHardcodedValues.ts","../src/themes/theme-base.js","../src/themes/theme-dark.js","../src/themes/theme-default.js","../src/themes/theme-forest.js","../src/themes/theme-neutral.js","../src/themes/index.js","../src/defaultConfig.ts","../src/assignWithDepth.js","../src/config.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable @typescript-eslint/no-unused-vars */\n/* eslint-disable @typescript-eslint/no-empty-function */\n/* eslint-disable no-console */\nimport dayjs from 'dayjs';\n\nexport type LogLevel = 'trace' | 'debug' | 'info' | 'warn' | 'error' | 'fatal';\n\nexport const LEVELS: Record<LogLevel, number> = {\n trace: 0,\n debug: 1,\n info: 2,\n warn: 3,\n error: 4,\n fatal: 5,\n};\n\nexport const log: Record<keyof typeof LEVELS, typeof console.log> = {\n trace: (..._args: any[]) => {},\n debug: (..._args: any[]) => {},\n info: (..._args: any[]) => {},\n warn: (..._args: any[]) => {},\n error: (..._args: any[]) => {},\n fatal: (..._args: any[]) => {},\n};\n\n/**\n * Sets a log level\n *\n * @param level - The level to set the logging to. Default is `\"fatal\"`\n */\nexport const setLogLevel = function (level: keyof typeof LEVELS | number | string = 'fatal') {\n let numericLevel: number = LEVELS.fatal;\n if (typeof level === 'string') {\n level = level.toLowerCase();\n if (level in LEVELS) {\n numericLevel = LEVELS[level as keyof typeof LEVELS];\n }\n } else if (typeof level === 'number') {\n numericLevel = level;\n }\n log.trace = () => {};\n log.debug = () => {};\n log.info = () => {};\n log.warn = () => {};\n log.error = () => {};\n log.fatal = () => {};\n\n if (numericLevel <= LEVELS.fatal) {\n log.fatal = console.error\n ? console.error.bind(console, format('FATAL'), 'color: orange')\n : console.log.bind(console, '\\x1b[35m', format('FATAL'));\n }\n if (numericLevel <= LEVELS.error) {\n log.error = console.error\n ? console.error.bind(console, format('ERROR'), 'color: orange')\n : console.log.bind(console, '\\x1b[31m', format('ERROR'));\n }\n if (numericLevel <= LEVELS.warn) {\n log.warn = console.warn\n ? console.warn.bind(console, format('WARN'), 'color: orange')\n : console.log.bind(console, `\\x1b[33m`, format('WARN'));\n }\n if (numericLevel <= LEVELS.info) {\n log.info = console.info\n ? console.info.bind(console, format('INFO'), 'color: lightblue')\n : console.log.bind(console, '\\x1b[34m', format('INFO'));\n }\n if (numericLevel <= LEVELS.debug) {\n log.debug = console.debug\n ? console.debug.bind(console, format('DEBUG'), 'color: lightgreen')\n : console.log.bind(console, '\\x1b[32m', format('DEBUG'));\n }\n if (numericLevel <= LEVELS.trace) {\n log.trace = console.debug\n ? console.debug.bind(console, format('TRACE'), 'color: lightgreen')\n : console.log.bind(console, '\\x1b[32m', format('TRACE'));\n }\n};\n\n/**\n * Returns a format with the timestamp and the log level\n *\n * @param level - The level for the log format\n * @returns The format with the timestamp and log level\n */\nconst format = (level: Uppercase<LogLevel>): string => {\n const time = dayjs().format('ss.SSS');\n return `%c${time} : ${level} : `;\n};\n","import DOMPurify from 'dompurify';\nimport { MermaidConfig } from '../../config.type';\n\n/**\n * Gets the rows of lines in a string\n *\n * @param s - The string to check the lines for\n * @returns The rows in that string\n */\nexport const getRows = (s?: string): string[] => {\n if (!s) {\n return [''];\n }\n const str = breakToPlaceholder(s).replace(/\\\\n/g, '#br#');\n return str.split('#br#');\n};\n\n/**\n * Removes script tags from a text\n *\n * @param txt - The text to sanitize\n * @returns The safer text\n */\nexport const removeScript = (txt: string): string => {\n return DOMPurify.sanitize(txt);\n};\n\nconst sanitizeMore = (text: string, config: MermaidConfig) => {\n if (config.flowchart?.htmlLabels !== false) {\n const level = config.securityLevel;\n if (level === 'antiscript' || level === 'strict') {\n text = removeScript(text);\n } else if (level !== 'loose') {\n text = breakToPlaceholder(text);\n text = text.replace(/</g, '<').replace(/>/g, '>');\n text = text.replace(/=/g, '=');\n text = placeholderToBreak(text);\n }\n }\n return text;\n};\n\nexport const sanitizeText = (text: string, config: MermaidConfig): string => {\n if (!text) {\n return text;\n }\n if (config.dompurifyConfig) {\n text = DOMPurify.sanitize(sanitizeMore(text, config), config.dompurifyConfig).toString();\n } else {\n text = DOMPurify.sanitize(sanitizeMore(text, config), {\n FORBID_TAGS: ['style'],\n }).toString();\n }\n return text;\n};\n\nexport const sanitizeTextOrALine truncated
|
|
||||||
File diff suppressed because it is too large.
Load diff
@@ -1 +0,0 @@
|
|||||||
{"version":3,"file":"config-b4fa35bb.js","sources":["../../../node_modules/.pnpm/dayjs@1.11.7/node_modules/dayjs/dayjs.min.js","../src/logger.ts","../../../node_modules/.pnpm/d3-dispatch@3.0.1/node_modules/d3-dispatch/src/dispatch.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/namespaces.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/namespace.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/creator.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selector.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/select.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/array.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selectorAll.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/selectAll.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/matcher.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/selectChild.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/selectChildren.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/filter.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/sparse.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/enter.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/constant.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/data.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/exit.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/join.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/merge.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/order.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/sort.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/call.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/nodes.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/node.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/size.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/empty.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/each.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/attr.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/window.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/style.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/property.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/classed.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/text.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/html.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/raise.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/lower.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/append.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/insert.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/remove.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/clone.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/datum.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/on.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/dispatch.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/iterator.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/index.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/select.js","../../../node_modules/.pnpm/d3-color@3.1.0/node_modules/d3-color/src/define.js","../../../node_modules/.pnpm/d3-color@3.1.0/node_modules/d3-color/src/color.js","../../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/constant.js","../../../node_modules/.pnpm/d3-interpolate@3.0.1/nLine truncated
|
|
||||||
File diff suppressed because it is too large.
Load diff
@@ -1 +0,0 @@
|
|||||||
{"version":3,"file":"config-e567ef17.js","sources":["../../../node_modules/.pnpm/dayjs@1.11.7/node_modules/dayjs/dayjs.min.js","../src/logger.ts","../../../node_modules/.pnpm/d3-dispatch@3.0.1/node_modules/d3-dispatch/src/dispatch.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/namespaces.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/namespace.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/creator.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selector.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/select.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/array.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selectorAll.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/selectAll.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/matcher.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/selectChild.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/selectChildren.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/filter.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/sparse.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/enter.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/constant.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/data.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/exit.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/join.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/merge.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/order.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/sort.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/call.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/nodes.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/node.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/size.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/empty.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/each.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/attr.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/window.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/style.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/property.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/classed.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/text.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/html.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/raise.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/lower.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/append.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/insert.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/remove.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/clone.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/datum.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/on.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/dispatch.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/iterator.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/selection/index.js","../../../node_modules/.pnpm/d3-selection@3.0.0/node_modules/d3-selection/src/select.js","../../../node_modules/.pnpm/d3-color@3.1.0/node_modules/d3-color/src/define.js","../../../node_modules/.pnpm/d3-color@3.1.0/node_modules/d3-color/src/color.js","../../../node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/constant.js","../../../node_modules/.pnpm/d3-interpolate@3.0.1/nLine truncated
|
|
||||||
Vendored
-98
@@ -1,98 +0,0 @@
|
|||||||
import type { MermaidConfig } from './config.type';
|
|
||||||
export declare const defaultConfig: MermaidConfig;
|
|
||||||
export declare const updateCurrentConfig: (siteCfg: MermaidConfig, _directives: any[]) => MermaidConfig;
|
|
||||||
/**
|
|
||||||
* ## setSiteConfig
|
|
||||||
*
|
|
||||||
* | Function | Description | Type | Values |
|
|
||||||
* | ------------- | ------------------------------------- | ----------- | --------------------------------------- |
|
|
||||||
* | setSiteConfig | Sets the siteConfig to desired values | Put Request | Any Values, except ones in secure array |
|
|
||||||
*
|
|
||||||
* **Notes:** Sets the siteConfig. The siteConfig is a protected configuration for repeat use. Calls
|
|
||||||
* to reset() will reset the currentConfig to siteConfig. Calls to reset(configApi.defaultConfig)
|
|
||||||
* will reset siteConfig and currentConfig to the defaultConfig Note: currentConfig is set in this
|
|
||||||
* function _Default value: At default, will mirror Global Config_
|
|
||||||
*
|
|
||||||
* @param conf - The base currentConfig to use as siteConfig
|
|
||||||
* @returns The new siteConfig
|
|
||||||
*/
|
|
||||||
export declare const setSiteConfig: (conf: MermaidConfig) => MermaidConfig;
|
|
||||||
export declare const saveConfigFromInitialize: (conf: MermaidConfig) => void;
|
|
||||||
export declare const updateSiteConfig: (conf: MermaidConfig) => MermaidConfig;
|
|
||||||
/**
|
|
||||||
* ## getSiteConfig
|
|
||||||
*
|
|
||||||
* | Function | Description | Type | Values |
|
|
||||||
* | ------------- | ------------------------------------------------- | ----------- | -------------------------------- |
|
|
||||||
* | setSiteConfig | Returns the current siteConfig base configuration | Get Request | Returns Any Values in siteConfig |
|
|
||||||
*
|
|
||||||
* **Notes**: Returns **any** values in siteConfig.
|
|
||||||
*
|
|
||||||
* @returns The siteConfig
|
|
||||||
*/
|
|
||||||
export declare const getSiteConfig: () => MermaidConfig;
|
|
||||||
/**
|
|
||||||
* ## setConfig
|
|
||||||
*
|
|
||||||
* | Function | Description | Type | Values |
|
|
||||||
* | ------------- | ------------------------------------- | ----------- | --------------------------------------- |
|
|
||||||
* | setSiteConfig | Sets the siteConfig to desired values | Put Request | Any Values, except ones in secure array |
|
|
||||||
*
|
|
||||||
* **Notes**: Sets the currentConfig. The parameter conf is sanitized based on the siteConfig.secure
|
|
||||||
* keys. Any values found in conf with key found in siteConfig.secure will be replaced with the
|
|
||||||
* corresponding siteConfig value.
|
|
||||||
*
|
|
||||||
* @param conf - The potential currentConfig
|
|
||||||
* @returns The currentConfig merged with the sanitized conf
|
|
||||||
*/
|
|
||||||
export declare const setConfig: (conf: MermaidConfig) => MermaidConfig;
|
|
||||||
/**
|
|
||||||
* ## getConfig
|
|
||||||
*
|
|
||||||
* | Function | Description | Type | Return Values |
|
|
||||||
* | --------- | ------------------------- | ----------- | ------------------------------ |
|
|
||||||
* | getConfig | Obtains the currentConfig | Get Request | Any Values from current Config |
|
|
||||||
*
|
|
||||||
* **Notes**: Returns **any** the currentConfig
|
|
||||||
*
|
|
||||||
* @returns The currentConfig
|
|
||||||
*/
|
|
||||||
export declare const getConfig: () => MermaidConfig;
|
|
||||||
/**
|
|
||||||
* ## sanitize
|
|
||||||
*
|
|
||||||
* | Function | Description | Type | Values |
|
|
||||||
* | -------- | -------------------------------------- | ----------- | ------ |
|
|
||||||
* | sanitize | Sets the siteConfig to desired values. | Put Request | None |
|
|
||||||
*
|
|
||||||
* Ensures options parameter does not attempt to override siteConfig secure keys **Notes**: modifies
|
|
||||||
* options in-place
|
|
||||||
*
|
|
||||||
* @param options - The potential setConfig parameter
|
|
||||||
*/
|
|
||||||
export declare const sanitize: (options: any) => void;
|
|
||||||
/**
|
|
||||||
* Pushes in a directive to the configuration
|
|
||||||
*
|
|
||||||
* @param directive - The directive to push in
|
|
||||||
*/
|
|
||||||
export declare const addDirective: (directive: any) => void;
|
|
||||||
/**
|
|
||||||
* ## reset
|
|
||||||
*
|
|
||||||
* | Function | Description | Type | Required | Values |
|
|
||||||
* | -------- | ---------------------------- | ----------- | -------- | ------ |
|
|
||||||
* | reset | Resets currentConfig to conf | Put Request | Required | None |
|
|
||||||
*
|
|
||||||
* ## conf
|
|
||||||
*
|
|
||||||
* | Parameter | Description | Type | Required | Values |
|
|
||||||
* | --------- | -------------------------------------------------------------- | ---------- | -------- | -------------------------------------------- |
|
|
||||||
* | conf | base set of values, which currentConfig could be **reset** to. | Dictionary | Required | Any Values, with respect to the secure Array |
|
|
||||||
*
|
|
||||||
* **Notes**: (default: current siteConfig ) (optional, default `getSiteConfig()`)
|
|
||||||
*
|
|
||||||
* @param config - base set of values, which currentConfig could be **reset** to.
|
|
||||||
* Defaults to the current siteConfig (e.g returned by {@link getSiteConfig}).
|
|
||||||
*/
|
|
||||||
export declare const reset: (config?: MermaidConfig) => void;
|
|
||||||
Vendored
-374
@@ -1,374 +0,0 @@
|
|||||||
import DOMPurify from 'dompurify';
|
|
||||||
export interface MermaidConfig {
|
|
||||||
theme?: string;
|
|
||||||
themeVariables?: any;
|
|
||||||
themeCSS?: string;
|
|
||||||
maxTextSize?: number;
|
|
||||||
darkMode?: boolean;
|
|
||||||
htmlLabels?: boolean;
|
|
||||||
fontFamily?: string;
|
|
||||||
altFontFamily?: string;
|
|
||||||
logLevel?: number;
|
|
||||||
securityLevel?: string;
|
|
||||||
startOnLoad?: boolean;
|
|
||||||
arrowMarkerAbsolute?: boolean;
|
|
||||||
secure?: string[];
|
|
||||||
deterministicIds?: boolean;
|
|
||||||
deterministicIDSeed?: string;
|
|
||||||
flowchart?: FlowchartDiagramConfig;
|
|
||||||
sequence?: SequenceDiagramConfig;
|
|
||||||
gantt?: GanttDiagramConfig;
|
|
||||||
journey?: JourneyDiagramConfig;
|
|
||||||
timeline?: TimelineDiagramConfig;
|
|
||||||
class?: ClassDiagramConfig;
|
|
||||||
state?: StateDiagramConfig;
|
|
||||||
er?: ErDiagramConfig;
|
|
||||||
pie?: PieDiagramConfig;
|
|
||||||
requirement?: RequirementDiagramConfig;
|
|
||||||
mindmap?: MindmapDiagramConfig;
|
|
||||||
gitGraph?: GitGraphDiagramConfig;
|
|
||||||
c4?: C4DiagramConfig;
|
|
||||||
dompurifyConfig?: DOMPurify.Config;
|
|
||||||
wrap?: boolean;
|
|
||||||
fontSize?: number;
|
|
||||||
}
|
|
||||||
export interface BaseDiagramConfig {
|
|
||||||
useWidth?: number;
|
|
||||||
useMaxWidth?: boolean;
|
|
||||||
}
|
|
||||||
export interface C4DiagramConfig extends BaseDiagramConfig {
|
|
||||||
diagramMarginX?: number;
|
|
||||||
diagramMarginY?: number;
|
|
||||||
c4ShapeMargin?: number;
|
|
||||||
c4ShapePadding?: number;
|
|
||||||
width?: number;
|
|
||||||
height?: number;
|
|
||||||
boxMargin?: number;
|
|
||||||
c4ShapeInRow?: number;
|
|
||||||
nextLinePaddingX?: number;
|
|
||||||
c4BoundaryInRow?: number;
|
|
||||||
personFontSize?: string | number;
|
|
||||||
personFontFamily?: string;
|
|
||||||
personFontWeight?: string | number;
|
|
||||||
external_personFontSize?: string | number;
|
|
||||||
external_personFontFamily?: string;
|
|
||||||
external_personFontWeight?: string | number;
|
|
||||||
systemFontSize?: string | number;
|
|
||||||
systemFontFamily?: string;
|
|
||||||
systemFontWeight?: string | number;
|
|
||||||
external_systemFontSize?: string | number;
|
|
||||||
external_systemFontFamily?: string;
|
|
||||||
external_systemFontWeight?: string | number;
|
|
||||||
system_dbFontSize?: string | number;
|
|
||||||
system_dbFontFamily?: string;
|
|
||||||
system_dbFontWeight?: string | number;
|
|
||||||
external_system_dbFontSize?: string | number;
|
|
||||||
external_system_dbFontFamily?: string;
|
|
||||||
external_system_dbFontWeight?: string | number;
|
|
||||||
system_queueFontSize?: string | number;
|
|
||||||
system_queueFontFamily?: string;
|
|
||||||
system_queueFontWeight?: string | number;
|
|
||||||
external_system_queueFontSize?: string | number;
|
|
||||||
external_system_queueFontFamily?: string;
|
|
||||||
external_system_queueFontWeight?: string | number;
|
|
||||||
boundaryFontSize?: string | number;
|
|
||||||
boundaryFontFamily?: string;
|
|
||||||
boundaryFontWeight?: string | number;
|
|
||||||
messageFontSize?: string | number;
|
|
||||||
messageFontFamily?: string;
|
|
||||||
messageFontWeight?: string | number;
|
|
||||||
containerFontSize?: string | number;
|
|
||||||
containerFontFamily?: string;
|
|
||||||
containerFontWeight?: string | number;
|
|
||||||
external_containerFontSize?: string | number;
|
|
||||||
external_containerFontFamily?: string;
|
|
||||||
external_containerFontWeight?: string | number;
|
|
||||||
container_dbFontSize?: string | number;
|
|
||||||
container_dbFontFamily?: string;
|
|
||||||
container_dbFontWeight?: string | number;
|
|
||||||
external_container_dbFontSize?: string | number;
|
|
||||||
external_container_dbFontFamily?: string;
|
|
||||||
external_container_dbFontWeight?: string | number;
|
|
||||||
container_queueFontSize?: string | number;
|
|
||||||
container_queueFontFamily?: string;
|
|
||||||
container_queueFontWeight?: string | number;
|
|
||||||
external_container_queueFontSize?: string | number;
|
|
||||||
external_container_queueFontFamily?: string;
|
|
||||||
external_container_queueFontWeight?: string | number;
|
|
||||||
componentFontSize?: string | number;
|
|
||||||
componentFontFamily?: string;
|
|
||||||
componentFontWeight?: string | number;
|
|
||||||
external_componentFontSize?: string | number;
|
|
||||||
external_componentFontFamily?: string;
|
|
||||||
external_componentFontWeight?: string | number;
|
|
||||||
component_dbFontSize?: string | number;
|
|
||||||
component_dbFontFamily?: string;
|
|
||||||
component_dbFontWeight?: string | number;
|
|
||||||
external_component_dbFontSize?: string | number;
|
|
||||||
external_component_dbFontFamily?: string;
|
|
||||||
external_component_dbFontWeight?: string | number;
|
|
||||||
component_queueFontSize?: string | number;
|
|
||||||
component_queueFontFamily?: string;
|
|
||||||
component_queueFontWeight?: string | number;
|
|
||||||
external_component_queueFontSize?: string | number;
|
|
||||||
external_component_queueFontFamily?: string;
|
|
||||||
external_component_queueFontWeight?: string | number;
|
|
||||||
wrap?: boolean;
|
|
||||||
wrapPadding?: number;
|
|
||||||
person_bg_color?: string;
|
|
||||||
person_border_color?: string;
|
|
||||||
external_person_bg_color?: string;
|
|
||||||
external_person_border_color?: string;
|
|
||||||
system_bg_color?: string;
|
|
||||||
system_border_color?: string;
|
|
||||||
system_db_bg_color?: string;
|
|
||||||
system_db_border_color?: string;
|
|
||||||
system_queue_bg_color?: string;
|
|
||||||
system_queue_border_color?: string;
|
|
||||||
external_system_bg_color?: string;
|
|
||||||
external_system_border_color?: string;
|
|
||||||
external_system_db_bg_color?: string;
|
|
||||||
external_system_db_border_color?: string;
|
|
||||||
external_system_queue_bg_color?: string;
|
|
||||||
external_system_queue_border_color?: string;
|
|
||||||
container_bg_color?: string;
|
|
||||||
container_border_color?: string;
|
|
||||||
container_db_bg_color?: string;
|
|
||||||
container_db_border_color?: string;
|
|
||||||
container_queue_bg_color?: string;
|
|
||||||
container_queue_border_color?: string;
|
|
||||||
external_container_bg_color?: string;
|
|
||||||
external_container_border_color?: string;
|
|
||||||
external_container_db_bg_color?: string;
|
|
||||||
external_container_db_border_color?: string;
|
|
||||||
external_container_queue_bg_color?: string;
|
|
||||||
external_container_queue_border_color?: string;
|
|
||||||
component_bg_color?: string;
|
|
||||||
component_border_color?: string;
|
|
||||||
component_db_bg_color?: string;
|
|
||||||
component_db_border_color?: string;
|
|
||||||
component_queue_bg_color?: string;
|
|
||||||
component_queue_border_color?: string;
|
|
||||||
external_component_bg_color?: string;
|
|
||||||
external_component_border_color?: string;
|
|
||||||
external_component_db_bg_color?: string;
|
|
||||||
external_component_db_border_color?: string;
|
|
||||||
external_component_queue_bg_color?: string;
|
|
||||||
external_component_queue_border_color?: string;
|
|
||||||
personFont?: FontCalculator;
|
|
||||||
external_personFont?: FontCalculator;
|
|
||||||
systemFont?: FontCalculator;
|
|
||||||
external_systemFont?: FontCalculator;
|
|
||||||
system_dbFont?: FontCalculator;
|
|
||||||
external_system_dbFont?: FontCalculator;
|
|
||||||
system_queueFont?: FontCalculator;
|
|
||||||
external_system_queueFont?: FontCalculator;
|
|
||||||
containerFont?: FontCalculator;
|
|
||||||
external_containerFont?: FontCalculator;
|
|
||||||
container_dbFont?: FontCalculator;
|
|
||||||
external_container_dbFont?: FontCalculator;
|
|
||||||
container_queueFont?: FontCalculator;
|
|
||||||
external_container_queueFont?: FontCalculator;
|
|
||||||
componentFont?: FontCalculator;
|
|
||||||
external_componentFont?: FontCalculator;
|
|
||||||
component_dbFont?: FontCalculator;
|
|
||||||
external_component_dbFont?: FontCalculator;
|
|
||||||
component_queueFont?: FontCalculator;
|
|
||||||
external_component_queueFont?: FontCalculator;
|
|
||||||
boundaryFont?: FontCalculator;
|
|
||||||
messageFont?: FontCalculator;
|
|
||||||
}
|
|
||||||
export interface GitGraphDiagramConfig extends BaseDiagramConfig {
|
|
||||||
titleTopMargin?: number;
|
|
||||||
diagramPadding?: number;
|
|
||||||
nodeLabel?: NodeLabel;
|
|
||||||
mainBranchName?: string;
|
|
||||||
mainBranchOrder?: number;
|
|
||||||
showCommitLabel?: boolean;
|
|
||||||
showBranches?: boolean;
|
|
||||||
rotateCommitLabel?: boolean;
|
|
||||||
arrowMarkerAbsolute?: boolean;
|
|
||||||
}
|
|
||||||
export interface NodeLabel {
|
|
||||||
width?: number;
|
|
||||||
height?: number;
|
|
||||||
x?: number;
|
|
||||||
y?: number;
|
|
||||||
}
|
|
||||||
export interface RequirementDiagramConfig extends BaseDiagramConfig {
|
|
||||||
rect_fill?: string;
|
|
||||||
text_color?: string;
|
|
||||||
rect_border_size?: string;
|
|
||||||
rect_border_color?: string;
|
|
||||||
rect_min_width?: number;
|
|
||||||
rect_min_height?: number;
|
|
||||||
fontSize?: number;
|
|
||||||
rect_padding?: number;
|
|
||||||
line_height?: number;
|
|
||||||
}
|
|
||||||
export interface MindmapDiagramConfig extends BaseDiagramConfig {
|
|
||||||
useMaxWidth: boolean;
|
|
||||||
padding: number;
|
|
||||||
maxNodeWidth: number;
|
|
||||||
}
|
|
||||||
export declare type PieDiagramConfig = BaseDiagramConfig;
|
|
||||||
export interface ErDiagramConfig extends BaseDiagramConfig {
|
|
||||||
titleTopMargin?: number;
|
|
||||||
diagramPadding?: number;
|
|
||||||
layoutDirection?: string;
|
|
||||||
minEntityWidth?: number;
|
|
||||||
minEntityHeight?: number;
|
|
||||||
entityPadding?: number;
|
|
||||||
stroke?: string;
|
|
||||||
fill?: string;
|
|
||||||
fontSize?: number;
|
|
||||||
}
|
|
||||||
export interface StateDiagramConfig extends BaseDiagramConfig {
|
|
||||||
titleTopMargin?: number;
|
|
||||||
arrowMarkerAbsolute?: boolean;
|
|
||||||
dividerMargin?: number;
|
|
||||||
sizeUnit?: number;
|
|
||||||
padding?: number;
|
|
||||||
textHeight?: number;
|
|
||||||
titleShift?: number;
|
|
||||||
noteMargin?: number;
|
|
||||||
forkWidth?: number;
|
|
||||||
forkHeight?: number;
|
|
||||||
miniPadding?: number;
|
|
||||||
fontSizeFactor?: number;
|
|
||||||
fontSize?: number;
|
|
||||||
labelHeight?: number;
|
|
||||||
edgeLengthFactor?: string;
|
|
||||||
compositTitleSize?: number;
|
|
||||||
radius?: number;
|
|
||||||
defaultRenderer?: string;
|
|
||||||
}
|
|
||||||
export interface ClassDiagramConfig extends BaseDiagramConfig {
|
|
||||||
titleTopMargin?: number;
|
|
||||||
arrowMarkerAbsolute?: boolean;
|
|
||||||
dividerMargin?: number;
|
|
||||||
padding?: number;
|
|
||||||
textHeight?: number;
|
|
||||||
defaultRenderer?: string;
|
|
||||||
nodeSpacing?: number;
|
|
||||||
rankSpacing?: number;
|
|
||||||
diagramPadding?: number;
|
|
||||||
htmlLabels?: boolean;
|
|
||||||
}
|
|
||||||
export interface JourneyDiagramConfig extends BaseDiagramConfig {
|
|
||||||
diagramMarginX?: number;
|
|
||||||
diagramMarginY?: number;
|
|
||||||
leftMargin?: number;
|
|
||||||
width?: number;
|
|
||||||
height?: number;
|
|
||||||
boxMargin?: number;
|
|
||||||
boxTextMargin?: number;
|
|
||||||
noteMargin?: number;
|
|
||||||
messageMargin?: number;
|
|
||||||
messageAlign?: string;
|
|
||||||
bottomMarginAdj?: number;
|
|
||||||
rightAngles?: boolean;
|
|
||||||
taskFontSize?: string | number;
|
|
||||||
taskFontFamily?: string;
|
|
||||||
taskMargin?: number;
|
|
||||||
activationWidth?: number;
|
|
||||||
textPlacement?: string;
|
|
||||||
actorColours?: string[];
|
|
||||||
sectionFills?: string[];
|
|
||||||
sectionColours?: string[];
|
|
||||||
}
|
|
||||||
export interface TimelineDiagramConfig extends BaseDiagramConfig {
|
|
||||||
diagramMarginX?: number;
|
|
||||||
diagramMarginY?: number;
|
|
||||||
leftMargin?: number;
|
|
||||||
width?: number;
|
|
||||||
height?: number;
|
|
||||||
padding?: number;
|
|
||||||
boxMargin?: number;
|
|
||||||
boxTextMargin?: number;
|
|
||||||
noteMargin?: number;
|
|
||||||
messageMargin?: number;
|
|
||||||
messageAlign?: string;
|
|
||||||
bottomMarginAdj?: number;
|
|
||||||
rightAngles?: boolean;
|
|
||||||
taskFontSize?: string | number;
|
|
||||||
taskFontFamily?: string;
|
|
||||||
taskMargin?: number;
|
|
||||||
activationWidth?: number;
|
|
||||||
textPlacement?: string;
|
|
||||||
actorColours?: string[];
|
|
||||||
sectionFills?: string[];
|
|
||||||
sectionColours?: string[];
|
|
||||||
disableMulticolor?: boolean;
|
|
||||||
useMaxWidth?: boolean;
|
|
||||||
}
|
|
||||||
export interface GanttDiagramConfig extends BaseDiagramConfig {
|
|
||||||
titleTopMargin?: number;
|
|
||||||
barHeight?: number;
|
|
||||||
barGap?: number;
|
|
||||||
topPadding?: number;
|
|
||||||
rightPadding?: number;
|
|
||||||
leftPadding?: number;
|
|
||||||
gridLineStartPadding?: number;
|
|
||||||
fontSize?: number;
|
|
||||||
sectionFontSize?: string | number;
|
|
||||||
numberSectionStyles?: number;
|
|
||||||
axisFormat?: string;
|
|
||||||
tickInterval?: string;
|
|
||||||
topAxis?: boolean;
|
|
||||||
}
|
|
||||||
export interface SequenceDiagramConfig extends BaseDiagramConfig {
|
|
||||||
arrowMarkerAbsolute?: boolean;
|
|
||||||
hideUnusedParticipants?: boolean;
|
|
||||||
activationWidth?: number;
|
|
||||||
diagramMarginX?: number;
|
|
||||||
diagramMarginY?: number;
|
|
||||||
actorMargin?: number;
|
|
||||||
width?: number;
|
|
||||||
height?: number;
|
|
||||||
boxMargin?: number;
|
|
||||||
boxTextMargin?: number;
|
|
||||||
noteMargin?: number;
|
|
||||||
messageMargin?: number;
|
|
||||||
messageAlign?: string;
|
|
||||||
mirrorActors?: boolean;
|
|
||||||
forceMenus?: boolean;
|
|
||||||
bottomMarginAdj?: number;
|
|
||||||
rightAngles?: boolean;
|
|
||||||
showSequenceNumbers?: boolean;
|
|
||||||
actorFontSize?: string | number;
|
|
||||||
actorFontFamily?: string;
|
|
||||||
actorFontWeight?: string | number;
|
|
||||||
noteFontSize?: string | number;
|
|
||||||
noteFontFamily?: string;
|
|
||||||
noteFontWeight?: string | number;
|
|
||||||
noteAlign?: string;
|
|
||||||
messageFontSize?: string | number;
|
|
||||||
messageFontFamily?: string;
|
|
||||||
messageFontWeight?: string | number;
|
|
||||||
wrap?: boolean;
|
|
||||||
wrapPadding?: number;
|
|
||||||
labelBoxWidth?: number;
|
|
||||||
labelBoxHeight?: number;
|
|
||||||
messageFont?: FontCalculator;
|
|
||||||
noteFont?: FontCalculator;
|
|
||||||
actorFont?: FontCalculator;
|
|
||||||
}
|
|
||||||
export interface FlowchartDiagramConfig extends BaseDiagramConfig {
|
|
||||||
titleTopMargin?: number;
|
|
||||||
arrowMarkerAbsolute?: boolean;
|
|
||||||
diagramPadding?: number;
|
|
||||||
htmlLabels?: boolean;
|
|
||||||
nodeSpacing?: number;
|
|
||||||
rankSpacing?: number;
|
|
||||||
curve?: string;
|
|
||||||
padding?: number;
|
|
||||||
defaultRenderer?: string;
|
|
||||||
}
|
|
||||||
export interface FontConfig {
|
|
||||||
fontSize?: string | number;
|
|
||||||
fontFamily?: string;
|
|
||||||
fontWeight?: string | number;
|
|
||||||
}
|
|
||||||
export declare type FontCalculator = () => Partial<FontConfig>;
|
|
||||||
export {};
|
|
||||||
@@ -1,64 +0,0 @@
|
|||||||
const p = Math.PI, v = 2 * p, c = 1e-6, q = v - c;
|
|
||||||
function y() {
|
|
||||||
this._x0 = this._y0 = // start of current subpath
|
|
||||||
this._x1 = this._y1 = null, this._ = "";
|
|
||||||
}
|
|
||||||
function C() {
|
|
||||||
return new y();
|
|
||||||
}
|
|
||||||
y.prototype = C.prototype = {
|
|
||||||
constructor: y,
|
|
||||||
moveTo: function(i, s) {
|
|
||||||
this._ += "M" + (this._x0 = this._x1 = +i) + "," + (this._y0 = this._y1 = +s);
|
|
||||||
},
|
|
||||||
closePath: function() {
|
|
||||||
this._x1 !== null && (this._x1 = this._x0, this._y1 = this._y0, this._ += "Z");
|
|
||||||
},
|
|
||||||
lineTo: function(i, s) {
|
|
||||||
this._ += "L" + (this._x1 = +i) + "," + (this._y1 = +s);
|
|
||||||
},
|
|
||||||
quadraticCurveTo: function(i, s, t, h) {
|
|
||||||
this._ += "Q" + +i + "," + +s + "," + (this._x1 = +t) + "," + (this._y1 = +h);
|
|
||||||
},
|
|
||||||
bezierCurveTo: function(i, s, t, h, _, e) {
|
|
||||||
this._ += "C" + +i + "," + +s + "," + +t + "," + +h + "," + (this._x1 = +_) + "," + (this._y1 = +e);
|
|
||||||
},
|
|
||||||
arcTo: function(i, s, t, h, _) {
|
|
||||||
i = +i, s = +s, t = +t, h = +h, _ = +_;
|
|
||||||
var e = this._x1, r = this._y1, f = t - i, a = h - s, n = e - i, u = r - s, o = n * n + u * u;
|
|
||||||
if (_ < 0)
|
|
||||||
throw new Error("negative radius: " + _);
|
|
||||||
if (this._x1 === null)
|
|
||||||
this._ += "M" + (this._x1 = i) + "," + (this._y1 = s);
|
|
||||||
else if (o > c)
|
|
||||||
if (!(Math.abs(u * f - a * n) > c) || !_)
|
|
||||||
this._ += "L" + (this._x1 = i) + "," + (this._y1 = s);
|
|
||||||
else {
|
|
||||||
var M = t - e, l = h - r, d = f * f + a * a, g = M * M + l * l, b = Math.sqrt(d), T = Math.sqrt(o), A = _ * Math.tan((p - Math.acos((d + o - g) / (2 * b * T))) / 2), x = A / T, L = A / b;
|
|
||||||
Math.abs(x - 1) > c && (this._ += "L" + (i + x * n) + "," + (s + x * u)), this._ += "A" + _ + "," + _ + ",0,0," + +(u * M > n * l) + "," + (this._x1 = i + L * f) + "," + (this._y1 = s + L * a);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
arc: function(i, s, t, h, _, e) {
|
|
||||||
i = +i, s = +s, t = +t, e = !!e;
|
|
||||||
var r = t * Math.cos(h), f = t * Math.sin(h), a = i + r, n = s + f, u = 1 ^ e, o = e ? h - _ : _ - h;
|
|
||||||
if (t < 0)
|
|
||||||
throw new Error("negative radius: " + t);
|
|
||||||
this._x1 === null ? this._ += "M" + a + "," + n : (Math.abs(this._x1 - a) > c || Math.abs(this._y1 - n) > c) && (this._ += "L" + a + "," + n), t && (o < 0 && (o = o % v + v), o > q ? this._ += "A" + t + "," + t + ",0,1," + u + "," + (i - r) + "," + (s - f) + "A" + t + "," + t + ",0,1," + u + "," + (this._x1 = a) + "," + (this._y1 = n) : o > c && (this._ += "A" + t + "," + t + ",0," + +(o >= p) + "," + u + "," + (this._x1 = i + t * Math.cos(_)) + "," + (this._y1 = s + t * Math.sin(_))));
|
|
||||||
},
|
|
||||||
rect: function(i, s, t, h) {
|
|
||||||
this._ += "M" + (this._x0 = this._x1 = +i) + "," + (this._y0 = this._y1 = +s) + "h" + +t + "v" + +h + "h" + -t + "Z";
|
|
||||||
},
|
|
||||||
toString: function() {
|
|
||||||
return this._;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
function E(i) {
|
|
||||||
return function() {
|
|
||||||
return i;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
export {
|
|
||||||
E as c,
|
|
||||||
C as p
|
|
||||||
};
|
|
||||||
//# sourceMappingURL=constant-2fe7eae5.js.map
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
{"version":3,"file":"constant-2fe7eae5.js","sources":["../../../node_modules/.pnpm/d3-path@3.0.1/node_modules/d3-path/src/path.js","../../../node_modules/.pnpm/d3-shape@3.1.0/node_modules/d3-shape/src/constant.js"],"sourcesContent":["const pi = Math.PI,\n tau = 2 * pi,\n epsilon = 1e-6,\n tauEpsilon = tau - epsilon;\n\nfunction Path() {\n this._x0 = this._y0 = // start of current subpath\n this._x1 = this._y1 = null; // end of current subpath\n this._ = \"\";\n}\n\nfunction path() {\n return new Path;\n}\n\nPath.prototype = path.prototype = {\n constructor: Path,\n moveTo: function(x, y) {\n this._ += \"M\" + (this._x0 = this._x1 = +x) + \",\" + (this._y0 = this._y1 = +y);\n },\n closePath: function() {\n if (this._x1 !== null) {\n this._x1 = this._x0, this._y1 = this._y0;\n this._ += \"Z\";\n }\n },\n lineTo: function(x, y) {\n this._ += \"L\" + (this._x1 = +x) + \",\" + (this._y1 = +y);\n },\n quadraticCurveTo: function(x1, y1, x, y) {\n this._ += \"Q\" + (+x1) + \",\" + (+y1) + \",\" + (this._x1 = +x) + \",\" + (this._y1 = +y);\n },\n bezierCurveTo: function(x1, y1, x2, y2, x, y) {\n this._ += \"C\" + (+x1) + \",\" + (+y1) + \",\" + (+x2) + \",\" + (+y2) + \",\" + (this._x1 = +x) + \",\" + (this._y1 = +y);\n },\n arcTo: function(x1, y1, x2, y2, r) {\n x1 = +x1, y1 = +y1, x2 = +x2, y2 = +y2, r = +r;\n var x0 = this._x1,\n y0 = this._y1,\n x21 = x2 - x1,\n y21 = y2 - y1,\n x01 = x0 - x1,\n y01 = y0 - y1,\n l01_2 = x01 * x01 + y01 * y01;\n\n // Is the radius negative? Error.\n if (r < 0) throw new Error(\"negative radius: \" + r);\n\n // Is this path empty? Move to (x1,y1).\n if (this._x1 === null) {\n this._ += \"M\" + (this._x1 = x1) + \",\" + (this._y1 = y1);\n }\n\n // Or, is (x1,y1) coincident with (x0,y0)? Do nothing.\n else if (!(l01_2 > epsilon));\n\n // Or, are (x0,y0), (x1,y1) and (x2,y2) collinear?\n // Equivalently, is (x1,y1) coincident with (x2,y2)?\n // Or, is the radius zero? Line to (x1,y1).\n else if (!(Math.abs(y01 * x21 - y21 * x01) > epsilon) || !r) {\n this._ += \"L\" + (this._x1 = x1) + \",\" + (this._y1 = y1);\n }\n\n // Otherwise, draw an arc!\n else {\n var x20 = x2 - x0,\n y20 = y2 - y0,\n l21_2 = x21 * x21 + y21 * y21,\n l20_2 = x20 * x20 + y20 * y20,\n l21 = Math.sqrt(l21_2),\n l01 = Math.sqrt(l01_2),\n l = r * Math.tan((pi - Math.acos((l21_2 + l01_2 - l20_2) / (2 * l21 * l01))) / 2),\n t01 = l / l01,\n t21 = l / l21;\n\n // If the start tangent is not coincident with (x0,y0), line to.\n if (Math.abs(t01 - 1) > epsilon) {\n this._ += \"L\" + (x1 + t01 * x01) + \",\" + (y1 + t01 * y01);\n }\n\n this._ += \"A\" + r + \",\" + r + \",0,0,\" + (+(y01 * x20 > x01 * y20)) + \",\" + (this._x1 = x1 + t21 * x21) + \",\" + (this._y1 = y1 + t21 * y21);\n }\n },\n arc: function(x, y, r, a0, a1, ccw) {\n x = +x, y = +y, r = +r, ccw = !!ccw;\n var dx = r * Math.cos(a0),\n dy = r * Math.sin(a0),\n x0 = x + dx,\n y0 = y + dy,\n cw = 1 ^ ccw,\n da = ccw ? a0 - a1 : a1 - a0;\n\n // Is the radius negative? Error.\n if (r < 0) throw new Error(\"negative radius: \" + r);\n\n // Is this path empty? Move to (x0,y0).\n if (this._x1 === null) {\n this._ += \"M\" + x0 + \",\" + y0;\n }\n\n // Or, is (x0,y0) not coincident with the previous point? Line to (x0,y0).\n else if (Math.abs(this._x1 - x0) > epsilon || Math.abs(this._y1 - y0) > epsilon) {\n this._ += \"L\" + x0 + \",\" + y0;\n }\n\n // Is this arc empty? We’re done.\n if (!r) return;\n\n // Does the angle go the wrong way? Flip the direction.\n if (da < 0) da = da % tau + tau;\n\n // Is this a complete circle? Draw two arcs to complete the circle.\n if (da > tauEpsilon) {\n this._ += \"A\" + r + \",\" + r + \",0,1,\" + cw + \",\" + (x - dx) + \",\" + (y - dy) + \"A\" + r + \",\" + r + \",0,1,\" + cw + \",\" + (this._x1 = x0) + \",\" + (this._y1 = y0);\n }\n\n // Is this arc non-empty? Draw an arc!\n else if (da > epsilon) {\n this._ += \"A\" + r + \",\" + r + \",0,\" + (+(da >= pi)) + \",\" + cw + \",\" + (this._x1 = x + r * Math.cos(a1)) + \",\" + (this._y1 = y + r * Math.sin(a1));\n }\n },\n rect: function(x, y, w, h) {\n this._ += \"M\" + (this._x0 = this._x1 = +x) + \",\" + (this._y0 = this._y1 = +y) + \"h\" + (+w) + \"v\" + (+h) + \"h\" + (-w) + \"Z\";\n },\n toString: function() {\n return this._;\n }\n};\n\nexport default path;\n","export default function(x) {\n return function constant() {\n return x;\n };\n}\n"],"names":["pi","tau","epsilon","tauEpsilon","Path","path","x","y","x1","y1","x2","y2","r","x0","y0","x21","y21","x01","y01","l01_2","x20","y20","l21_2","l20_2","l21","l01","l","t01","t21","a0","a1","ccw","dx","dy","cw","da","w","constant"],"maLine truncated
|
|
||||||
@@ -1,85 +0,0 @@
|
|||||||
const pi = Math.PI, tau = 2 * pi, epsilon = 1e-6, tauEpsilon = tau - epsilon;
|
|
||||||
function Path() {
|
|
||||||
this._x0 = this._y0 = // start of current subpath
|
|
||||||
this._x1 = this._y1 = null;
|
|
||||||
this._ = "";
|
|
||||||
}
|
|
||||||
function path() {
|
|
||||||
return new Path();
|
|
||||||
}
|
|
||||||
Path.prototype = path.prototype = {
|
|
||||||
constructor: Path,
|
|
||||||
moveTo: function(x, y) {
|
|
||||||
this._ += "M" + (this._x0 = this._x1 = +x) + "," + (this._y0 = this._y1 = +y);
|
|
||||||
},
|
|
||||||
closePath: function() {
|
|
||||||
if (this._x1 !== null) {
|
|
||||||
this._x1 = this._x0, this._y1 = this._y0;
|
|
||||||
this._ += "Z";
|
|
||||||
}
|
|
||||||
},
|
|
||||||
lineTo: function(x, y) {
|
|
||||||
this._ += "L" + (this._x1 = +x) + "," + (this._y1 = +y);
|
|
||||||
},
|
|
||||||
quadraticCurveTo: function(x1, y1, x, y) {
|
|
||||||
this._ += "Q" + +x1 + "," + +y1 + "," + (this._x1 = +x) + "," + (this._y1 = +y);
|
|
||||||
},
|
|
||||||
bezierCurveTo: function(x1, y1, x2, y2, x, y) {
|
|
||||||
this._ += "C" + +x1 + "," + +y1 + "," + +x2 + "," + +y2 + "," + (this._x1 = +x) + "," + (this._y1 = +y);
|
|
||||||
},
|
|
||||||
arcTo: function(x1, y1, x2, y2, r) {
|
|
||||||
x1 = +x1, y1 = +y1, x2 = +x2, y2 = +y2, r = +r;
|
|
||||||
var x0 = this._x1, y0 = this._y1, x21 = x2 - x1, y21 = y2 - y1, x01 = x0 - x1, y01 = y0 - y1, l01_2 = x01 * x01 + y01 * y01;
|
|
||||||
if (r < 0)
|
|
||||||
throw new Error("negative radius: " + r);
|
|
||||||
if (this._x1 === null) {
|
|
||||||
this._ += "M" + (this._x1 = x1) + "," + (this._y1 = y1);
|
|
||||||
} else if (!(l01_2 > epsilon))
|
|
||||||
;
|
|
||||||
else if (!(Math.abs(y01 * x21 - y21 * x01) > epsilon) || !r) {
|
|
||||||
this._ += "L" + (this._x1 = x1) + "," + (this._y1 = y1);
|
|
||||||
} else {
|
|
||||||
var x20 = x2 - x0, y20 = y2 - y0, l21_2 = x21 * x21 + y21 * y21, l20_2 = x20 * x20 + y20 * y20, l21 = Math.sqrt(l21_2), l01 = Math.sqrt(l01_2), l = r * Math.tan((pi - Math.acos((l21_2 + l01_2 - l20_2) / (2 * l21 * l01))) / 2), t01 = l / l01, t21 = l / l21;
|
|
||||||
if (Math.abs(t01 - 1) > epsilon) {
|
|
||||||
this._ += "L" + (x1 + t01 * x01) + "," + (y1 + t01 * y01);
|
|
||||||
}
|
|
||||||
this._ += "A" + r + "," + r + ",0,0," + +(y01 * x20 > x01 * y20) + "," + (this._x1 = x1 + t21 * x21) + "," + (this._y1 = y1 + t21 * y21);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
arc: function(x, y, r, a0, a1, ccw) {
|
|
||||||
x = +x, y = +y, r = +r, ccw = !!ccw;
|
|
||||||
var dx = r * Math.cos(a0), dy = r * Math.sin(a0), x0 = x + dx, y0 = y + dy, cw = 1 ^ ccw, da = ccw ? a0 - a1 : a1 - a0;
|
|
||||||
if (r < 0)
|
|
||||||
throw new Error("negative radius: " + r);
|
|
||||||
if (this._x1 === null) {
|
|
||||||
this._ += "M" + x0 + "," + y0;
|
|
||||||
} else if (Math.abs(this._x1 - x0) > epsilon || Math.abs(this._y1 - y0) > epsilon) {
|
|
||||||
this._ += "L" + x0 + "," + y0;
|
|
||||||
}
|
|
||||||
if (!r)
|
|
||||||
return;
|
|
||||||
if (da < 0)
|
|
||||||
da = da % tau + tau;
|
|
||||||
if (da > tauEpsilon) {
|
|
||||||
this._ += "A" + r + "," + r + ",0,1," + cw + "," + (x - dx) + "," + (y - dy) + "A" + r + "," + r + ",0,1," + cw + "," + (this._x1 = x0) + "," + (this._y1 = y0);
|
|
||||||
} else if (da > epsilon) {
|
|
||||||
this._ += "A" + r + "," + r + ",0," + +(da >= pi) + "," + cw + "," + (this._x1 = x + r * Math.cos(a1)) + "," + (this._y1 = y + r * Math.sin(a1));
|
|
||||||
}
|
|
||||||
},
|
|
||||||
rect: function(x, y, w, h) {
|
|
||||||
this._ += "M" + (this._x0 = this._x1 = +x) + "," + (this._y0 = this._y1 = +y) + "h" + +w + "v" + +h + "h" + -w + "Z";
|
|
||||||
},
|
|
||||||
toString: function() {
|
|
||||||
return this._;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
function constant(x) {
|
|
||||||
return function constant2() {
|
|
||||||
return x;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
export {
|
|
||||||
constant as c,
|
|
||||||
path as p
|
|
||||||
};
|
|
||||||
//# sourceMappingURL=constant-b644328d.js.map
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
{"version":3,"file":"constant-b644328d.js","sources":["../../../node_modules/.pnpm/d3-path@3.0.1/node_modules/d3-path/src/path.js","../../../node_modules/.pnpm/d3-shape@3.1.0/node_modules/d3-shape/src/constant.js"],"sourcesContent":["const pi = Math.PI,\n tau = 2 * pi,\n epsilon = 1e-6,\n tauEpsilon = tau - epsilon;\n\nfunction Path() {\n this._x0 = this._y0 = // start of current subpath\n this._x1 = this._y1 = null; // end of current subpath\n this._ = \"\";\n}\n\nfunction path() {\n return new Path;\n}\n\nPath.prototype = path.prototype = {\n constructor: Path,\n moveTo: function(x, y) {\n this._ += \"M\" + (this._x0 = this._x1 = +x) + \",\" + (this._y0 = this._y1 = +y);\n },\n closePath: function() {\n if (this._x1 !== null) {\n this._x1 = this._x0, this._y1 = this._y0;\n this._ += \"Z\";\n }\n },\n lineTo: function(x, y) {\n this._ += \"L\" + (this._x1 = +x) + \",\" + (this._y1 = +y);\n },\n quadraticCurveTo: function(x1, y1, x, y) {\n this._ += \"Q\" + (+x1) + \",\" + (+y1) + \",\" + (this._x1 = +x) + \",\" + (this._y1 = +y);\n },\n bezierCurveTo: function(x1, y1, x2, y2, x, y) {\n this._ += \"C\" + (+x1) + \",\" + (+y1) + \",\" + (+x2) + \",\" + (+y2) + \",\" + (this._x1 = +x) + \",\" + (this._y1 = +y);\n },\n arcTo: function(x1, y1, x2, y2, r) {\n x1 = +x1, y1 = +y1, x2 = +x2, y2 = +y2, r = +r;\n var x0 = this._x1,\n y0 = this._y1,\n x21 = x2 - x1,\n y21 = y2 - y1,\n x01 = x0 - x1,\n y01 = y0 - y1,\n l01_2 = x01 * x01 + y01 * y01;\n\n // Is the radius negative? Error.\n if (r < 0) throw new Error(\"negative radius: \" + r);\n\n // Is this path empty? Move to (x1,y1).\n if (this._x1 === null) {\n this._ += \"M\" + (this._x1 = x1) + \",\" + (this._y1 = y1);\n }\n\n // Or, is (x1,y1) coincident with (x0,y0)? Do nothing.\n else if (!(l01_2 > epsilon));\n\n // Or, are (x0,y0), (x1,y1) and (x2,y2) collinear?\n // Equivalently, is (x1,y1) coincident with (x2,y2)?\n // Or, is the radius zero? Line to (x1,y1).\n else if (!(Math.abs(y01 * x21 - y21 * x01) > epsilon) || !r) {\n this._ += \"L\" + (this._x1 = x1) + \",\" + (this._y1 = y1);\n }\n\n // Otherwise, draw an arc!\n else {\n var x20 = x2 - x0,\n y20 = y2 - y0,\n l21_2 = x21 * x21 + y21 * y21,\n l20_2 = x20 * x20 + y20 * y20,\n l21 = Math.sqrt(l21_2),\n l01 = Math.sqrt(l01_2),\n l = r * Math.tan((pi - Math.acos((l21_2 + l01_2 - l20_2) / (2 * l21 * l01))) / 2),\n t01 = l / l01,\n t21 = l / l21;\n\n // If the start tangent is not coincident with (x0,y0), line to.\n if (Math.abs(t01 - 1) > epsilon) {\n this._ += \"L\" + (x1 + t01 * x01) + \",\" + (y1 + t01 * y01);\n }\n\n this._ += \"A\" + r + \",\" + r + \",0,0,\" + (+(y01 * x20 > x01 * y20)) + \",\" + (this._x1 = x1 + t21 * x21) + \",\" + (this._y1 = y1 + t21 * y21);\n }\n },\n arc: function(x, y, r, a0, a1, ccw) {\n x = +x, y = +y, r = +r, ccw = !!ccw;\n var dx = r * Math.cos(a0),\n dy = r * Math.sin(a0),\n x0 = x + dx,\n y0 = y + dy,\n cw = 1 ^ ccw,\n da = ccw ? a0 - a1 : a1 - a0;\n\n // Is the radius negative? Error.\n if (r < 0) throw new Error(\"negative radius: \" + r);\n\n // Is this path empty? Move to (x0,y0).\n if (this._x1 === null) {\n this._ += \"M\" + x0 + \",\" + y0;\n }\n\n // Or, is (x0,y0) not coincident with the previous point? Line to (x0,y0).\n else if (Math.abs(this._x1 - x0) > epsilon || Math.abs(this._y1 - y0) > epsilon) {\n this._ += \"L\" + x0 + \",\" + y0;\n }\n\n // Is this arc empty? We’re done.\n if (!r) return;\n\n // Does the angle go the wrong way? Flip the direction.\n if (da < 0) da = da % tau + tau;\n\n // Is this a complete circle? Draw two arcs to complete the circle.\n if (da > tauEpsilon) {\n this._ += \"A\" + r + \",\" + r + \",0,1,\" + cw + \",\" + (x - dx) + \",\" + (y - dy) + \"A\" + r + \",\" + r + \",0,1,\" + cw + \",\" + (this._x1 = x0) + \",\" + (this._y1 = y0);\n }\n\n // Is this arc non-empty? Draw an arc!\n else if (da > epsilon) {\n this._ += \"A\" + r + \",\" + r + \",0,\" + (+(da >= pi)) + \",\" + cw + \",\" + (this._x1 = x + r * Math.cos(a1)) + \",\" + (this._y1 = y + r * Math.sin(a1));\n }\n },\n rect: function(x, y, w, h) {\n this._ += \"M\" + (this._x0 = this._x1 = +x) + \",\" + (this._y0 = this._y1 = +y) + \"h\" + (+w) + \"v\" + (+h) + \"h\" + (-w) + \"Z\";\n },\n toString: function() {\n return this._;\n }\n};\n\nexport default path;\n","export default function(x) {\n return function constant() {\n return x;\n };\n}\n"],"names":["constant"],"mappings":"AAAA,MAAM,KAAK,KAAK,IACZ,MAAM,IAAI,IACV,UAAU,MACV,aAAa,MAAM;AAEvB,SAAS,OAAO;AACd,OAAK,MAAM,KAAK;AAAA,EAChB,KAAK,MAAM,KAAK,MAAM;AACtB,OAAK,IAAI;AACX;AAEA,SAAS,OAAO;AACd,SAAO,IAAI;AACb;AAEA,KAAK,YAAY,KAAK,YAAY;ALine truncated
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
export function insertCluster(elem: any, node: any): void;
|
|
||||||
export function getClusterTitleWidth(elem: any, node: any): number;
|
|
||||||
export function clear(): void;
|
|
||||||
export function positionCluster(node: any): void;
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
export default createLabel;
|
|
||||||
declare function createLabel(_vertexText: any, style: any, isTitle: any, isNode: any): SVGForeignObjectElement | SVGTextElement;
|
|
||||||
-14
@@ -1,14 +0,0 @@
|
|||||||
export function clear(): void;
|
|
||||||
export function insertEdgeLabel(elem: any, edge: any): SVGForeignObjectElement | SVGTextElement;
|
|
||||||
export function positionEdgeLabel(edge: any, paths: any): void;
|
|
||||||
export function intersection(node: any, outsidePoint: any, insidePoint: any): {
|
|
||||||
x: any;
|
|
||||||
y: number;
|
|
||||||
} | {
|
|
||||||
x: number;
|
|
||||||
y: any;
|
|
||||||
};
|
|
||||||
export function insertEdge(elem: any, e: any, edge: any, clusterDb: any, diagramType: any, graph: any): {
|
|
||||||
updatedPath: any;
|
|
||||||
originalPath: any;
|
|
||||||
};
|
|
||||||
-1
@@ -1 +0,0 @@
|
|||||||
export function render(elem: any, graph: any, markers: any, diagramtype: any, id: any): void;
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
declare namespace _default {
|
|
||||||
export { node };
|
|
||||||
export { circle };
|
|
||||||
export { ellipse };
|
|
||||||
export { polygon };
|
|
||||||
export { rect };
|
|
||||||
}
|
|
||||||
export default _default;
|
|
||||||
import node from "./intersect-node.js";
|
|
||||||
import circle from "./intersect-circle.js";
|
|
||||||
import ellipse from "./intersect-ellipse.js";
|
|
||||||
import polygon from "./intersect-polygon.js";
|
|
||||||
import rect from "./intersect-rect.js";
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
export default intersectCircle;
|
|
||||||
/**
|
|
||||||
* @param node
|
|
||||||
* @param rx
|
|
||||||
* @param point
|
|
||||||
*/
|
|
||||||
declare function intersectCircle(node: any, rx: any, point: any): {
|
|
||||||
x: any;
|
|
||||||
y: any;
|
|
||||||
};
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
export default intersectEllipse;
|
|
||||||
/**
|
|
||||||
* @param node
|
|
||||||
* @param rx
|
|
||||||
* @param ry
|
|
||||||
* @param point
|
|
||||||
*/
|
|
||||||
declare function intersectEllipse(node: any, rx: any, ry: any, point: any): {
|
|
||||||
x: any;
|
|
||||||
y: any;
|
|
||||||
};
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
export default intersectLine;
|
|
||||||
/**
|
|
||||||
* Returns the point at which two lines, p and q, intersect or returns undefined if they do not intersect.
|
|
||||||
*
|
|
||||||
* @param p1
|
|
||||||
* @param p2
|
|
||||||
* @param q1
|
|
||||||
* @param q2
|
|
||||||
*/
|
|
||||||
declare function intersectLine(p1: any, p2: any, q1: any, q2: any): {
|
|
||||||
x: number;
|
|
||||||
y: number;
|
|
||||||
} | undefined;
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
export default intersectNode;
|
|
||||||
/**
|
|
||||||
* @param node
|
|
||||||
* @param point
|
|
||||||
*/
|
|
||||||
declare function intersectNode(node: any, point: any): any;
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
export default intersectPolygon;
|
|
||||||
/**
|
|
||||||
* Returns the point ({x, y}) at which the point argument intersects with the node argument assuming
|
|
||||||
* that it has the shape specified by polygon.
|
|
||||||
*
|
|
||||||
* @param node
|
|
||||||
* @param polyPoints
|
|
||||||
* @param point
|
|
||||||
*/
|
|
||||||
declare function intersectPolygon(node: any, polyPoints: any, point: any): any;
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
export default intersectRect;
|
|
||||||
declare function intersectRect(node: any, point: any): {
|
|
||||||
x: any;
|
|
||||||
y: any;
|
|
||||||
};
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
export default insertMarkers;
|
|
||||||
declare function insertMarkers(elem: any, markerArray: any, type: any, id: any): void;
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
export let clusterDb: {};
|
|
||||||
export function clear(): void;
|
|
||||||
export function extractDescendants(id: any, graph: any): any[];
|
|
||||||
export function validate(graph: any): boolean;
|
|
||||||
export function findNonClusterChild(id: any, graph: any): any;
|
|
||||||
export function adjustClustersAndEdges(graph: any, depth: any): void;
|
|
||||||
export function extractor(graph: any, depth: any): void;
|
|
||||||
export function sortNodesByHierarchy(graph: any): any;
|
|
||||||
-4
@@ -1,4 +0,0 @@
|
|||||||
export function insertNode(elem: any, node: any, dir: any): any;
|
|
||||||
export function setNodeElem(elem: any, node: any): void;
|
|
||||||
export function clear(): void;
|
|
||||||
export function positionNode(node: any): any;
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
export default note;
|
|
||||||
declare function note(parent: any, node: any): any;
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
/**
|
|
||||||
* @param parent
|
|
||||||
* @param w
|
|
||||||
* @param h
|
|
||||||
* @param points
|
|
||||||
*/
|
|
||||||
export function insertPolygonShape(parent: any, w: any, h: any, points: any): any;
|
|
||||||
export function labelHelper(parent: any, node: any, _classes: any, isNode: any): {
|
|
||||||
shapeSvg: any;
|
|
||||||
bbox: any;
|
|
||||||
halfPadding: number;
|
|
||||||
label: any;
|
|
||||||
};
|
|
||||||
export function updateNodeBounds(node: any, element: any): void;
|
|
||||||
-34
@@ -1,34 +0,0 @@
|
|||||||
import { MermaidConfig } from './config.type';
|
|
||||||
/**
|
|
||||||
* **Configuration methods in Mermaid version 8.6.0 have been updated, to learn more[[click
|
|
||||||
* here](8.6.0_docs.md)].**
|
|
||||||
*
|
|
||||||
* ## **What follows are config instructions for older versions**
|
|
||||||
*
|
|
||||||
* These are the default options which can be overridden with the initialization call like so:
|
|
||||||
*
|
|
||||||
* **Example 1:**
|
|
||||||
*
|
|
||||||
* ```js
|
|
||||||
* mermaid.initialize({ flowchart:{ htmlLabels: false } });
|
|
||||||
* ```
|
|
||||||
*
|
|
||||||
* **Example 2:**
|
|
||||||
*
|
|
||||||
* ```html
|
|
||||||
* <script>
|
|
||||||
* const config = {
|
|
||||||
* startOnLoad:true,
|
|
||||||
* flowchart:{ useMaxWidth:true, htmlLabels:true, curve:'cardinal'},
|
|
||||||
* securityLevel:'loose',
|
|
||||||
* };
|
|
||||||
* mermaid.initialize(config);
|
|
||||||
* </script>
|
|
||||||
* ```
|
|
||||||
*
|
|
||||||
* A summary of all options and their defaults is found [here](#mermaidapi-configuration-defaults).
|
|
||||||
* A description of each option follows below.
|
|
||||||
*/
|
|
||||||
declare const config: Partial<MermaidConfig>;
|
|
||||||
export declare const configKeys: string[];
|
|
||||||
export default config;
|
|
||||||
-42
@@ -1,42 +0,0 @@
|
|||||||
import { MermaidConfig } from '../config.type';
|
|
||||||
import type { DiagramDetector, DiagramLoader, ExternalDiagramDefinition } from './types';
|
|
||||||
/**
|
|
||||||
* Detects the type of the graph text.
|
|
||||||
*
|
|
||||||
* Takes into consideration the possible existence of an `%%init` directive
|
|
||||||
*
|
|
||||||
* @param text - The text defining the graph. For example:
|
|
||||||
*
|
|
||||||
* ```mermaid
|
|
||||||
* %%{initialize: {"startOnLoad": true, logLevel: "fatal" }}%%
|
|
||||||
* graph LR
|
|
||||||
* a-->b
|
|
||||||
* b-->c
|
|
||||||
* c-->d
|
|
||||||
* d-->e
|
|
||||||
* e-->f
|
|
||||||
* f-->g
|
|
||||||
* g-->h
|
|
||||||
* ```
|
|
||||||
*
|
|
||||||
* @param config - The mermaid config.
|
|
||||||
* @returns A graph definition key
|
|
||||||
*/
|
|
||||||
export declare const detectType: (text: string, config?: MermaidConfig) => string;
|
|
||||||
/**
|
|
||||||
* Registers lazy-loaded diagrams to Mermaid.
|
|
||||||
*
|
|
||||||
* The diagram function is loaded asynchronously, so that diagrams are only loaded
|
|
||||||
* if the diagram is detected.
|
|
||||||
*
|
|
||||||
* @remarks
|
|
||||||
* Please note that the order of diagram detectors is important.
|
|
||||||
* The first detector to return `true` is the diagram that will be loaded
|
|
||||||
* and used, so put more specific detectors at the beginning!
|
|
||||||
*
|
|
||||||
* @param diagrams - Diagrams to lazy load, and their detectors, in order of importance.
|
|
||||||
*/
|
|
||||||
export declare const registerLazyLoadedDiagrams: (...diagrams: ExternalDiagramDefinition[]) => void;
|
|
||||||
export declare const loadRegisteredDiagrams: () => Promise<void>;
|
|
||||||
export declare const addDetector: (key: string, detector: DiagramDetector, loader?: DiagramLoader) => void;
|
|
||||||
export declare const getDiagramLoader: (key: string) => DiagramLoader | undefined;
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
export declare const addDiagrams: () => void;
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
export {};
|
|
||||||
-29
@@ -1,29 +0,0 @@
|
|||||||
import { DiagramDefinition, DiagramDetector } from './types';
|
|
||||||
import * as _commonDb from '../commonDb';
|
|
||||||
export declare const log: Record<import("../logger").LogLevel, {
|
|
||||||
(...data: any[]): void;
|
|
||||||
(message?: any, ...optionalParams: any[]): void;
|
|
||||||
}>;
|
|
||||||
export declare const setLogLevel: (level?: string | number) => void;
|
|
||||||
export declare const getConfig: () => import("../config.type").MermaidConfig;
|
|
||||||
export declare const sanitizeText: (text: string) => string;
|
|
||||||
export declare const setupGraphViewbox: (graph: any, svgElem: any, padding: any, useMaxWidth: any) => void;
|
|
||||||
export declare const getCommonDb: () => typeof _commonDb;
|
|
||||||
export declare const parseDirective: (p: any, statement: string, context: string, type: string) => void;
|
|
||||||
export interface Detectors {
|
|
||||||
[key: string]: DiagramDetector;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Registers the given diagram with Mermaid.
|
|
||||||
*
|
|
||||||
* Can be used for third-party custom diagrams.
|
|
||||||
*
|
|
||||||
* @param id - A unique ID for the given diagram.
|
|
||||||
* @param diagram - The diagram definition.
|
|
||||||
* @param detector - Function that returns `true` if a given mermaid text is this diagram definition.
|
|
||||||
*/
|
|
||||||
export declare const registerDiagram: (id: string, diagram: DiagramDefinition, detector?: DiagramDetector) => void;
|
|
||||||
export declare const getDiagram: (name: string) => DiagramDefinition;
|
|
||||||
export declare class DiagramNotFoundError extends Error {
|
|
||||||
constructor(message: string);
|
|
||||||
}
|
|
||||||
Loaded 100 of 546 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user