mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-01-28 07:03:17 +08:00
Merge pull request #2078 from mermaid-js/2072_cluster_positioning
2072 cluster positioning
This commit is contained in:
commit
9f9fb7d043
@ -1,16 +1,10 @@
|
||||
# mermaid [![Build Status](https://travis-ci.org/mermaid-js/mermaid.svg?branch=master)](https://travis-ci.org/mermaid-js/mermaid) [![NPM](https://img.shields.io/npm/v/mermaid)](https://www.npmjs.com/package/mermaid) [![Coverage Status](https://coveralls.io/repos/github/mermaid-js/mermaid/badge.svg?branch=master)](https://coveralls.io/github/mermaid-js/mermaid?branch=master) [![Join our Slack!](https://img.shields.io/static/v1?message=join%20chat&color=9cf&logo=slack&label=slack)](https://join.slack.com/t/mermaid-talk/shared_invite/enQtNzc4NDIyNzk4OTAyLWVhYjQxOTI2OTg4YmE1ZmJkY2Y4MTU3ODliYmIwOTY3NDJlYjA0YjIyZTdkMDMyZTUwOGI0NjEzYmEwODcwOTE) [![This project is using Percy.io for visual regression testing.](https://percy.io/static/images/percy-badge.svg)](https://percy.io/Mermaid/mermaid)
|
||||
|
||||
<p align="center">
|
||||
<a href="https://www.buymeacoffee.com/knsv" rel="nofollow">
|
||||
<img src="https://user-images.githubusercontent.com/30767528/63641973-9d301680-c6b7-11e9-9d29-2ad1da50fdce.png" style="max-width:100%;" />
|
||||
</a>
|
||||
</p>
|
||||
|
||||
![banner](./img/header.png)
|
||||
|
||||
:trophy: **Mermaid was nominated and won the [JS Open Source Awards (2019)](https://osawards.com/javascript/2019) in the category "The most exciting use of technology"!!!**
|
||||
|
||||
**Thanks to all involved, people committing pull requests, people answering questions and special thanks to Tyler Long who is helping me maintain the project 🙏**
|
||||
**Thanks to all involved, people committing pull requests, people answering questions! 🙏**
|
||||
|
||||
## About
|
||||
|
||||
|
@ -371,25 +371,25 @@ flowchart TD
|
||||
E[(red text)] -->|default style| F((blue text))
|
||||
G>red text] -->|default style| H{blue text}
|
||||
I{{red text}} -->|default style| J[/blue text/]
|
||||
K[\ red text\] -->|default style| L[/blue text\]
|
||||
M[\ red text/] -->|default style| N[blue text]
|
||||
K[\\ red text\\] -->|default style| L[/blue text\\]
|
||||
M[\\ red text/] -->|default style| N[blue text];
|
||||
linkStyle default color:Sienna;
|
||||
style A stroke:#ff0000,fill:#ffcccc,color:#ff0000
|
||||
style B stroke:#0000ff,fill:#ccccff,color:#0000ff
|
||||
style C stroke:#ff0000,fill:#ffcccc,color:#ff0000
|
||||
style D stroke:#0000ff,fill:#ccccff,color:#0000ff
|
||||
style E stroke:#ff0000,fill:#ffcccc,color:#ff0000
|
||||
style F stroke:#0000ff,fill:#ccccff,color:#0000ff
|
||||
style G stroke:#ff0000,fill:#ffcccc,color:#ff0000
|
||||
style H stroke:#0000ff,fill:#ccccff,color:#0000ff
|
||||
style I stroke:#ff0000,fill:#ffcccc,color:#ff0000
|
||||
style J stroke:#0000ff,fill:#ccccff,color:#0000ff
|
||||
style K stroke:#ff0000,fill:#ffcccc,color:#ff0000
|
||||
style L stroke:#0000ff,fill:#ccccff,color:#0000ff
|
||||
style M stroke:#ff0000,fill:#ffcccc,color:#ff0000
|
||||
style N stroke:#0000ff,fill:#ccccff,color:#0000ff
|
||||
style A stroke:#ff0000,fill:#ffcccc,color:#ff0000;
|
||||
style B stroke:#0000ff,fill:#ccccff,color:#0000ff;
|
||||
style C stroke:#ff0000,fill:#ffcccc,color:#ff0000;
|
||||
style D stroke:#0000ff,fill:#ccccff,color:#0000ff;
|
||||
style E stroke:#ff0000,fill:#ffcccc,color:#ff0000;
|
||||
style F stroke:#0000ff,fill:#ccccff,color:#0000ff;
|
||||
style G stroke:#ff0000,fill:#ffcccc,color:#ff0000;
|
||||
style H stroke:#0000ff,fill:#ccccff,color:#0000ff;
|
||||
style I stroke:#ff0000,fill:#ffcccc,color:#ff0000;
|
||||
style J stroke:#0000ff,fill:#ccccff,color:#0000ff;
|
||||
style K stroke:#ff0000,fill:#ffcccc,color:#ff0000;
|
||||
style L stroke:#0000ff,fill:#ccccff,color:#0000ff;
|
||||
style M stroke:#ff0000,fill:#ffcccc,color:#ff0000;
|
||||
style N stroke:#0000ff,fill:#ccccff,color:#0000ff;
|
||||
`,
|
||||
{htmlLabels: true, flowchart: {htmlLabels: true}, securityLevel: 'loose'}
|
||||
{htmlLabels: true, flowchart: {htmlLabels: true}, securityLevel: 'loose', logLevel:2}
|
||||
);
|
||||
});
|
||||
it('61: fontawesome icons in edge labels', () => {
|
||||
|
@ -401,7 +401,7 @@ stateDiagram-v2
|
||||
it('v2 should handle different rendering directions in composite states', () => {
|
||||
imgSnapshotTest(
|
||||
`
|
||||
stateDiagram
|
||||
stateDiagram-v2
|
||||
direction LR
|
||||
state A {
|
||||
direction BT
|
||||
|
@ -15,7 +15,7 @@
|
||||
/* font-size: 18px !important; */
|
||||
}
|
||||
h1 { color: grey;}
|
||||
.mermaid2 {
|
||||
.mermaid2,.mermaid3 {
|
||||
display: none;
|
||||
}
|
||||
.mermaid svg {
|
||||
@ -28,46 +28,52 @@
|
||||
<div class="flex">
|
||||
|
||||
<div class="mermaid" style="width: 100%; height: 20%;">
|
||||
stateDiagram
|
||||
direction LR
|
||||
state A {
|
||||
direction BT
|
||||
a --> b
|
||||
stateDiagram-v2
|
||||
state S1 {
|
||||
sub1 -->sub2
|
||||
}
|
||||
state C {
|
||||
direction RL
|
||||
c --> d
|
||||
|
||||
state S2 {
|
||||
sub4
|
||||
}
|
||||
A --> C
|
||||
</div>
|
||||
<div class="mermaid2" style="width: 100%; height: 20%;">
|
||||
%%{int:{
|
||||
"themeVariables": {
|
||||
"transitionColor":"red",
|
||||
"labelColor":"yellow",
|
||||
"transitionLabelColor":"blue",
|
||||
"stateBkg":"green",
|
||||
"compositeBackground":"pink",
|
||||
"altBackground":"purple",
|
||||
"clusterTitleBackground":"blue",
|
||||
"compositeBorder":"red"
|
||||
}}}%%
|
||||
stateDiagram
|
||||
state CompositeState {
|
||||
state AnotherCompositeState {
|
||||
AnotherState --> YetANotherState:a label
|
||||
}
|
||||
}
|
||||
S1 --> S2
|
||||
sub1 --> sub4
|
||||
|
||||
</div>
|
||||
<div class="mermaid2" style="width: 100%; height: 20%;">
|
||||
sequenceDiagram
|
||||
Alice->>+John: Hello John, how are you?
|
||||
Alice->>+John: John, can you hear me?
|
||||
John-->>-Alice: Hi Alice, I can hear you!
|
||||
John-->>-Alice: I feel great!
|
||||
note right of John: Hello note reader
|
||||
<div class="mermaid3" style="width: 100%; height: 20%;">
|
||||
stateDiagram
|
||||
state CompositeState {
|
||||
YourState123456789012345123456789123456789012345123456789123456789012345123456789123456789012345123456789 --> MyState:a label
|
||||
}
|
||||
|
||||
</div>
|
||||
<div class="mermaid3" style="width: 100%; height: 20%;">
|
||||
flowchart
|
||||
subgraph CompositeState
|
||||
subgraph AnotherCompositeStateCompositeStateCompositeStateCompositeState
|
||||
YourState --a label--> MyState
|
||||
end
|
||||
|
||||
end
|
||||
</div>
|
||||
<div class="mermaid3" style="width: 100%; height: 20%;">
|
||||
stateDiagram-v2
|
||||
state CompositeState {
|
||||
state AnotherCompositeState1234567890 {
|
||||
YourState
|
||||
}
|
||||
}
|
||||
|
||||
</div>
|
||||
<div class="mermaid3" style="width: 100%; height: 20%;">
|
||||
%%{init:{"theme":"base", "themeVariables": {"primaryColor":"#411d4e", "titleColor":"white", "darkMode":true}}}%%
|
||||
flowchart LR
|
||||
|
||||
subgraph B1
|
||||
i -->f
|
||||
end
|
||||
A --> B1 --> B --> B1
|
||||
</div>
|
||||
<script src="./mermaid.js"></script>
|
||||
<script>
|
||||
mermaid.parseError = function (err, hash) {
|
||||
@ -77,7 +83,7 @@ sequenceDiagram
|
||||
theme: 'default',
|
||||
arrowMarkerAbsolute: true,
|
||||
// themeCSS: '.edgePath .path {stroke: red;} .arrowheadPath {fill: red;}',
|
||||
logLevel: 5,
|
||||
logLevel: 2,
|
||||
flowchart: { nodeSpacing: 10, curve: 'cardinal', htmlLabels: true },
|
||||
htmlLabels: true,
|
||||
// gantt: { axisFormat: '%m/%d/%Y' },
|
||||
|
368
dist/mermaid.core.js
vendored
368
dist/mermaid.core.js
vendored
@ -656,7 +656,7 @@ module.exports = function(module) {
|
||||
/*! exports provided: name, version, description, main, keywords, scripts, repository, author, license, standard, dependencies, devDependencies, files, yarn-upgrade-all, sideEffects, husky, default */
|
||||
/***/ (function(module) {
|
||||
|
||||
module.exports = JSON.parse("{\"name\":\"mermaid\",\"version\":\"8.9.2\",\"description\":\"Markdownish syntax for generating flowcharts, sequence diagrams, class diagrams, gantt charts and git graphs.\",\"main\":\"dist/mermaid.core.js\",\"keywords\":[\"diagram\",\"markdown\",\"flowchart\",\"sequence diagram\",\"gantt\",\"class diagram\",\"git graph\"],\"scripts\":{\"build:development\":\"webpack --progress --colors\",\"build:production\":\"yarn build:development -p --config webpack.config.prod.babel.js\",\"build\":\"yarn build:development && yarn build:production\",\"postbuild\":\"documentation build src/mermaidAPI.js src/config.js src/defaultConfig.js --shallow -f md --markdown-toc false > docs/Setup.md\",\"build:watch\":\"yarn build --watch\",\"minify\":\"minify ./dist/mermaid.js > ./dist/mermaid.min.js\",\"release\":\"yarn build\",\"lint\":\"eslint src\",\"e2e:depr\":\"yarn lint && jest e2e --config e2e/jest.config.js\",\"cypress\":\"percy exec -- cypress run\",\"e2e\":\"start-server-and-test dev http://localhost:9000/ cypress\",\"e2e-upd\":\"yarn lint && jest e2e -u --config e2e/jest.config.js\",\"dev\":\"webpack-dev-server --config webpack.config.e2e.js\",\"test\":\"yarn lint && jest src/.*\",\"test:watch\":\"jest --watch src\",\"prepublishOnly\":\"yarn build && yarn test\",\"prepare\":\"yarn build\"},\"repository\":{\"type\":\"git\",\"url\":\"https://github.com/knsv/mermaid\"},\"author\":\"Knut Sveidqvist\",\"license\":\"MIT\",\"standard\":{\"ignore\":[\"**/parser/*.js\",\"dist/**/*.js\",\"cypress/**/*.js\"],\"globals\":[\"page\"]},\"dependencies\":{\"@braintree/sanitize-url\":\"^3.1.0\",\"d3\":\"^5.7.0\",\"dagre\":\"^0.8.4\",\"dagre-d3\":\"^0.6.4\",\"entity-decode\":\"^2.0.2\",\"graphlib\":\"^2.1.7\",\"he\":\"^1.2.0\",\"khroma\":\"^1.1.0\",\"minify\":\"^4.1.1\",\"moment-mini\":\"^2.22.1\",\"stylis\":\"^3.5.2\"},\"devDependencies\":{\"@babel/core\":\"^7.2.2\",\"@babel/preset-env\":\"^7.8.4\",\"@babel/register\":\"^7.0.0\",\"@percy/cypress\":\"*\",\"babel-core\":\"7.0.0-bridge.0\",\"babel-eslint\":\"^10.1.0\",\"babel-jest\":\"^24.9.0\",\"babel-loader\":\"^8.0.4\",\"coveralls\":\"^3.0.2\",\"css-loader\":\"^2.0.1\",\"css-to-string-loader\":\"^0.1.3\",\"cypress\":\"4.0.1\",\"documentation\":\"^12.0.1\",\"eslint\":\"^6.3.0\",\"eslint-config-prettier\":\"^6.3.0\",\"eslint-plugin-prettier\":\"^3.1.0\",\"husky\":\"^1.2.1\",\"identity-obj-proxy\":\"^3.0.0\",\"jest\":\"^24.9.0\",\"jison\":\"^0.4.18\",\"moment\":\"^2.23.0\",\"node-sass\":\"^5.0.0\",\"prettier\":\"^1.18.2\",\"puppeteer\":\"^1.17.0\",\"sass-loader\":\"^7.1.0\",\"start-server-and-test\":\"^1.10.6\",\"terser-webpack-plugin\":\"^2.2.2\",\"webpack\":\"^4.41.2\",\"webpack-bundle-analyzer\":\"^3.7.0\",\"webpack-cli\":\"^3.1.2\",\"webpack-dev-server\":\"^3.4.1\",\"webpack-node-externals\":\"^1.7.2\",\"yarn-upgrade-all\":\"^0.5.0\"},\"files\":[\"dist\"],\"yarn-upgrade-all\":{\"ignore\":[\"babel-core\"]},\"sideEffects\":[\"**/*.css\",\"**/*.scss\"],\"husky\":{\"hooks\":{\"pre-push\":\"yarn test\"}}}");
|
||||
module.exports = JSON.parse("{\"name\":\"mermaid\",\"version\":\"8.10.1\",\"description\":\"Markdownish syntax for generating flowcharts, sequence diagrams, class diagrams, gantt charts and git graphs.\",\"main\":\"dist/mermaid.core.js\",\"keywords\":[\"diagram\",\"markdown\",\"flowchart\",\"sequence diagram\",\"gantt\",\"class diagram\",\"git graph\"],\"scripts\":{\"build:development\":\"webpack --progress --colors\",\"build:production\":\"yarn build:development -p --config webpack.config.prod.babel.js\",\"build\":\"yarn build:development && yarn build:production\",\"postbuild\":\"documentation build src/mermaidAPI.js src/config.js src/defaultConfig.js --shallow -f md --markdown-toc false > docs/Setup.md\",\"build:watch\":\"yarn build --watch\",\"minify\":\"minify ./dist/mermaid.js > ./dist/mermaid.min.js\",\"release\":\"yarn build\",\"lint\":\"eslint src\",\"e2e:depr\":\"yarn lint && jest e2e --config e2e/jest.config.js\",\"cypress\":\"percy exec -- cypress run\",\"e2e\":\"start-server-and-test dev http://localhost:9000/ cypress\",\"e2e-upd\":\"yarn lint && jest e2e -u --config e2e/jest.config.js\",\"dev\":\"webpack-dev-server --config webpack.config.e2e.js\",\"test\":\"yarn lint && jest src/.*\",\"test:watch\":\"jest --watch src\",\"prepublishOnly\":\"yarn build && yarn test\",\"prepare\":\"yarn build\"},\"repository\":{\"type\":\"git\",\"url\":\"https://github.com/knsv/mermaid\"},\"author\":\"Knut Sveidqvist\",\"license\":\"MIT\",\"standard\":{\"ignore\":[\"**/parser/*.js\",\"dist/**/*.js\",\"cypress/**/*.js\"],\"globals\":[\"page\"]},\"dependencies\":{\"@braintree/sanitize-url\":\"^3.1.0\",\"d3\":\"^5.7.0\",\"dagre\":\"^0.8.4\",\"dagre-d3\":\"^0.6.4\",\"entity-decode\":\"^2.0.2\",\"graphlib\":\"^2.1.7\",\"he\":\"^1.2.0\",\"khroma\":\"^1.1.0\",\"minify\":\"^4.1.1\",\"moment-mini\":\"^2.22.1\",\"stylis\":\"^3.5.2\"},\"devDependencies\":{\"@babel/core\":\"^7.2.2\",\"@babel/preset-env\":\"^7.8.4\",\"@babel/register\":\"^7.0.0\",\"@percy/cypress\":\"*\",\"babel-core\":\"7.0.0-bridge.0\",\"babel-eslint\":\"^10.1.0\",\"babel-jest\":\"^24.9.0\",\"babel-loader\":\"^8.0.4\",\"coveralls\":\"^3.0.2\",\"css-loader\":\"^2.0.1\",\"css-to-string-loader\":\"^0.1.3\",\"cypress\":\"4.0.1\",\"documentation\":\"^12.0.1\",\"eslint\":\"^6.3.0\",\"eslint-config-prettier\":\"^6.3.0\",\"eslint-plugin-prettier\":\"^3.1.0\",\"husky\":\"^1.2.1\",\"identity-obj-proxy\":\"^3.0.0\",\"jest\":\"^24.9.0\",\"jison\":\"^0.4.18\",\"moment\":\"^2.23.0\",\"node-sass\":\"^5.0.0\",\"prettier\":\"^1.18.2\",\"puppeteer\":\"^1.17.0\",\"sass-loader\":\"^7.1.0\",\"start-server-and-test\":\"^1.10.6\",\"terser-webpack-plugin\":\"^2.2.2\",\"webpack\":\"^4.41.2\",\"webpack-bundle-analyzer\":\"^3.7.0\",\"webpack-cli\":\"^3.1.2\",\"webpack-dev-server\":\"^3.4.1\",\"webpack-node-externals\":\"^1.7.2\",\"yarn-upgrade-all\":\"^0.5.0\"},\"files\":[\"dist\"],\"yarn-upgrade-all\":{\"ignore\":[\"babel-core\"]},\"sideEffects\":[\"**/*.css\",\"**/*.scss\"],\"husky\":{\"hooks\":{\"pre-push\":\"yarn test\"}}}");
|
||||
|
||||
/***/ }),
|
||||
|
||||
@ -16052,42 +16052,45 @@ var getStyles = function getStyles() {
|
||||
}
|
||||
*/
|
||||
var parser = (function(){
|
||||
var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,4],$V1=[1,5],$V2=[1,6],$V3=[1,7],$V4=[1,9],$V5=[1,10,12,19,20,21,22],$V6=[1,6,10,12,19,20,21,22],$V7=[19,20,21],$V8=[1,22],$V9=[6,19,20,21,22];
|
||||
var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,4],$V1=[1,5],$V2=[1,6],$V3=[1,7],$V4=[1,9],$V5=[1,11,13,20,21,22,23],$V6=[2,5],$V7=[1,6,11,13,20,21,22,23],$V8=[20,21,22],$V9=[2,8],$Va=[1,18],$Vb=[1,19],$Vc=[1,24],$Vd=[6,20,21,22,23];
|
||||
var parser = {trace: function trace () { },
|
||||
yy: {},
|
||||
symbols_: {"error":2,"start":3,"eol":4,"directive":5,"PIE":6,"document":7,"line":8,"statement":9,"txt":10,"value":11,"title":12,"title_value":13,"openDirective":14,"typeDirective":15,"closeDirective":16,":":17,"argDirective":18,"NEWLINE":19,";":20,"EOF":21,"open_directive":22,"type_directive":23,"arg_directive":24,"close_directive":25,"$accept":0,"$end":1},
|
||||
terminals_: {2:"error",6:"PIE",10:"txt",11:"value",12:"title",13:"title_value",17:":",19:"NEWLINE",20:";",21:"EOF",22:"open_directive",23:"type_directive",24:"arg_directive",25:"close_directive"},
|
||||
productions_: [0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[9,0],[9,2],[9,2],[9,1],[5,3],[5,5],[4,1],[4,1],[4,1],[14,1],[15,1],[18,1],[16,1]],
|
||||
symbols_: {"error":2,"start":3,"eol":4,"directive":5,"PIE":6,"document":7,"showData":8,"line":9,"statement":10,"txt":11,"value":12,"title":13,"title_value":14,"openDirective":15,"typeDirective":16,"closeDirective":17,":":18,"argDirective":19,"NEWLINE":20,";":21,"EOF":22,"open_directive":23,"type_directive":24,"arg_directive":25,"close_directive":26,"$accept":0,"$end":1},
|
||||
terminals_: {2:"error",6:"PIE",8:"showData",11:"txt",12:"value",13:"title",14:"title_value",18:":",20:"NEWLINE",21:";",22:"EOF",23:"open_directive",24:"type_directive",25:"arg_directive",26:"close_directive"},
|
||||
productions_: [0,[3,2],[3,2],[3,2],[3,3],[7,0],[7,2],[9,2],[10,0],[10,2],[10,2],[10,1],[5,3],[5,5],[4,1],[4,1],[4,1],[15,1],[16,1],[19,1],[17,1]],
|
||||
performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) {
|
||||
/* this == yyval */
|
||||
|
||||
var $0 = $$.length - 1;
|
||||
switch (yystate) {
|
||||
case 6:
|
||||
case 4:
|
||||
yy.setShowData(true);
|
||||
break;
|
||||
case 7:
|
||||
this.$ = $$[$0-1]
|
||||
break;
|
||||
case 8:
|
||||
case 9:
|
||||
yy.addSection($$[$0-1],yy.cleanupValue($$[$0]));
|
||||
break;
|
||||
case 9:
|
||||
case 10:
|
||||
this.$=$$[$0].trim();yy.setTitle(this.$);
|
||||
break;
|
||||
case 16:
|
||||
case 17:
|
||||
yy.parseDirective('%%{', 'open_directive');
|
||||
break;
|
||||
case 17:
|
||||
case 18:
|
||||
yy.parseDirective($$[$0], 'type_directive');
|
||||
break;
|
||||
case 18:
|
||||
case 19:
|
||||
$$[$0] = $$[$0].trim().replace(/'/g, '"'); yy.parseDirective($$[$0], 'arg_directive');
|
||||
break;
|
||||
case 19:
|
||||
case 20:
|
||||
yy.parseDirective('}%%', 'close_directive', 'pie');
|
||||
break;
|
||||
}
|
||||
},
|
||||
table: [{3:1,4:2,5:3,6:$V0,14:8,19:$V1,20:$V2,21:$V3,22:$V4},{1:[3]},{3:10,4:2,5:3,6:$V0,14:8,19:$V1,20:$V2,21:$V3,22:$V4},{3:11,4:2,5:3,6:$V0,14:8,19:$V1,20:$V2,21:$V3,22:$V4},o($V5,[2,4],{7:12}),o($V6,[2,13]),o($V6,[2,14]),o($V6,[2,15]),{15:13,23:[1,14]},{23:[2,16]},{1:[2,1]},{1:[2,2]},o($V7,[2,7],{14:8,8:15,9:16,5:19,1:[2,3],10:[1,17],12:[1,18],22:$V4}),{16:20,17:[1,21],25:$V8},o([17,25],[2,17]),o($V5,[2,5]),{4:23,19:$V1,20:$V2,21:$V3},{11:[1,24]},{13:[1,25]},o($V7,[2,10]),o($V9,[2,11]),{18:26,24:[1,27]},o($V9,[2,19]),o($V5,[2,6]),o($V7,[2,8]),o($V7,[2,9]),{16:28,25:$V8},{25:[2,18]},o($V9,[2,12])],
|
||||
defaultActions: {9:[2,16],10:[2,1],11:[2,2],27:[2,18]},
|
||||
table: [{3:1,4:2,5:3,6:$V0,15:8,20:$V1,21:$V2,22:$V3,23:$V4},{1:[3]},{3:10,4:2,5:3,6:$V0,15:8,20:$V1,21:$V2,22:$V3,23:$V4},{3:11,4:2,5:3,6:$V0,15:8,20:$V1,21:$V2,22:$V3,23:$V4},o($V5,$V6,{7:12,8:[1,13]}),o($V7,[2,14]),o($V7,[2,15]),o($V7,[2,16]),{16:14,24:[1,15]},{24:[2,17]},{1:[2,1]},{1:[2,2]},o($V8,$V9,{15:8,9:16,10:17,5:20,1:[2,3],11:$Va,13:$Vb,23:$V4}),o($V5,$V6,{7:21}),{17:22,18:[1,23],26:$Vc},o([18,26],[2,18]),o($V5,[2,6]),{4:25,20:$V1,21:$V2,22:$V3},{12:[1,26]},{14:[1,27]},o($V8,[2,11]),o($V8,$V9,{15:8,9:16,10:17,5:20,1:[2,4],11:$Va,13:$Vb,23:$V4}),o($Vd,[2,12]),{19:28,25:[1,29]},o($Vd,[2,20]),o($V5,[2,7]),o($V8,[2,9]),o($V8,[2,10]),{17:30,26:$Vc},{26:[2,19]},o($Vd,[2,13])],
|
||||
defaultActions: {9:[2,17],10:[2,1],11:[2,2],29:[2,19]},
|
||||
parseError: function parseError (str, hash) {
|
||||
if (hash.recoverable) {
|
||||
this.trace(str);
|
||||
@ -16566,27 +16569,27 @@ options: {"case-insensitive":true},
|
||||
performAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) {
|
||||
var YYSTATE=YY_START;
|
||||
switch($avoiding_name_collisions) {
|
||||
case 0: this.begin('open_directive'); return 22;
|
||||
case 0: this.begin('open_directive'); return 23;
|
||||
break;
|
||||
case 1: this.begin('type_directive'); return 23;
|
||||
case 1: this.begin('type_directive'); return 24;
|
||||
break;
|
||||
case 2: this.popState(); this.begin('arg_directive'); return 17;
|
||||
case 2: this.popState(); this.begin('arg_directive'); return 18;
|
||||
break;
|
||||
case 3: this.popState(); this.popState(); return 25;
|
||||
case 3: this.popState(); this.popState(); return 26;
|
||||
break;
|
||||
case 4:return 24;
|
||||
case 4:return 25;
|
||||
break;
|
||||
case 5:/* skip comments */
|
||||
break;
|
||||
case 6:/* skip comments */{ /*console.log('');*/ }
|
||||
break;
|
||||
case 7:return 19;
|
||||
case 7:return 20;
|
||||
break;
|
||||
case 8:/* do nothing */
|
||||
break;
|
||||
case 9:/* ignore */
|
||||
break;
|
||||
case 10: this.begin("title");return 12;
|
||||
case 10: this.begin("title");return 13;
|
||||
break;
|
||||
case 11: this.popState(); return "title_value";
|
||||
break;
|
||||
@ -16598,14 +16601,16 @@ case 14: return "txt";
|
||||
break;
|
||||
case 15:return 6;
|
||||
break;
|
||||
case 16:return "value";
|
||||
case 16:return 8;
|
||||
break;
|
||||
case 17:return 21;
|
||||
case 17:return "value";
|
||||
break;
|
||||
case 18:return 22;
|
||||
break;
|
||||
}
|
||||
},
|
||||
rules: [/^(?:%%\{)/i,/^(?:((?:(?!\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\}%%)/i,/^(?:((?:(?!\}%%).|\n)*))/i,/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:[\s]+)/i,/^(?:title\b)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:pie\b)/i,/^(?::[\s]*[\d]+(?:\.[\d]+)?)/i,/^(?:$)/i],
|
||||
conditions: {"close_directive":{"rules":[],"inclusive":false},"arg_directive":{"rules":[3,4],"inclusive":false},"type_directive":{"rules":[2,3],"inclusive":false},"open_directive":{"rules":[1],"inclusive":false},"title":{"rules":[11],"inclusive":false},"string":{"rules":[13,14],"inclusive":false},"INITIAL":{"rules":[0,5,6,7,8,9,10,12,15,16,17],"inclusive":true}}
|
||||
rules: [/^(?:%%\{)/i,/^(?:((?:(?!\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\}%%)/i,/^(?:((?:(?!\}%%).|\n)*))/i,/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:[\s]+)/i,/^(?:title\b)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:pie\b)/i,/^(?:showData\b)/i,/^(?::[\s]*[\d]+(?:\.[\d]+)?)/i,/^(?:$)/i],
|
||||
conditions: {"close_directive":{"rules":[],"inclusive":false},"arg_directive":{"rules":[3,4],"inclusive":false},"type_directive":{"rules":[2,3],"inclusive":false},"open_directive":{"rules":[1],"inclusive":false},"title":{"rules":[11],"inclusive":false},"string":{"rules":[13,14],"inclusive":false},"INITIAL":{"rules":[0,5,6,7,8,9,10,12,15,16,17,18],"inclusive":true}}
|
||||
});
|
||||
return lexer;
|
||||
})();
|
||||
@ -16659,6 +16664,7 @@ __webpack_require__.r(__webpack_exports__);
|
||||
|
||||
var sections = {};
|
||||
var title = '';
|
||||
var showData = false;
|
||||
var parseDirective = function parseDirective(statement, context, type) {
|
||||
_mermaidAPI__WEBPACK_IMPORTED_MODULE_1__["default"].parseDirective(this, statement, context, type);
|
||||
};
|
||||
@ -16678,6 +16684,14 @@ var setTitle = function setTitle(txt) {
|
||||
title = txt;
|
||||
};
|
||||
|
||||
var setShowData = function setShowData(toggle) {
|
||||
showData = toggle;
|
||||
};
|
||||
|
||||
var getShowData = function getShowData() {
|
||||
return showData;
|
||||
};
|
||||
|
||||
var getTitle = function getTitle() {
|
||||
return title;
|
||||
};
|
||||
@ -16694,6 +16708,7 @@ var cleanupValue = function cleanupValue(value) {
|
||||
var clear = function clear() {
|
||||
sections = {};
|
||||
title = '';
|
||||
showData = false;
|
||||
}; // export const parseError = (err, hash) => {
|
||||
// global.mermaidAPI.parseError(err, hash)
|
||||
// }
|
||||
@ -16709,7 +16724,9 @@ var clear = function clear() {
|
||||
cleanupValue: cleanupValue,
|
||||
clear: clear,
|
||||
setTitle: setTitle,
|
||||
getTitle: getTitle // parseError
|
||||
getTitle: getTitle,
|
||||
setShowData: setShowData,
|
||||
getShowData: getShowData // parseError
|
||||
|
||||
});
|
||||
|
||||
@ -16768,10 +16785,14 @@ var draw = function draw(txt, id) {
|
||||
width = 1200;
|
||||
}
|
||||
|
||||
if (typeof conf.pie.useWidth !== 'undefined') {
|
||||
if (typeof conf.useWidth !== 'undefined') {
|
||||
width = conf.useWidth;
|
||||
}
|
||||
|
||||
if (typeof conf.pie.useWidth !== 'undefined') {
|
||||
width = conf.pie.useWidth;
|
||||
}
|
||||
|
||||
var diagram = Object(d3__WEBPACK_IMPORTED_MODULE_0__["select"])('#' + id);
|
||||
Object(_utils__WEBPACK_IMPORTED_MODULE_4__["configureSvgSize"])(diagram, height, width, conf.pie.useMaxWidth); // Set viewBox
|
||||
|
||||
@ -16801,7 +16822,7 @@ var draw = function draw(txt, id) {
|
||||
|
||||
svg.selectAll('mySlices').data(dataReady).enter().append('path').attr('d', arcGenerator).attr('fill', function (d) {
|
||||
return color(d.data.key);
|
||||
}).attr('stroke', 'black').style('stroke-width', '2px').style('opacity', 0.7); // Now add the percentage.
|
||||
}).attr('class', 'pieCircle'); // Now add the percentage.
|
||||
// Use the centroid method to get the best coordinates.
|
||||
|
||||
svg.selectAll('mySlices').data(dataReady.filter(function (value) {
|
||||
@ -16810,7 +16831,7 @@ var draw = function draw(txt, id) {
|
||||
return (d.data.value / sum * 100).toFixed(0) + '%';
|
||||
}).attr('transform', function (d) {
|
||||
return 'translate(' + arcGenerator.centroid(d) + ')';
|
||||
}).style('text-anchor', 'middle').attr('class', 'slice').style('font-size', 17);
|
||||
}).style('text-anchor', 'middle').attr('class', 'slice');
|
||||
svg.append('text').text(parser.yy.getTitle()).attr('x', 0).attr('y', -(height - 50) / 2).attr('class', 'pieTitleText'); // Add the legends/annotations for each section
|
||||
|
||||
var legend = svg.selectAll('.legend').data(color.domain()).enter().append('g').attr('class', 'legend').attr('transform', function (d, i) {
|
||||
@ -16821,8 +16842,14 @@ var draw = function draw(txt, id) {
|
||||
return 'translate(' + horz + ',' + vert + ')';
|
||||
});
|
||||
legend.append('rect').attr('width', legendRectSize).attr('height', legendRectSize).style('fill', color).style('stroke', color);
|
||||
legend.append('text').attr('x', legendRectSize + legendSpacing).attr('y', legendRectSize - legendSpacing).text(function (d) {
|
||||
return d;
|
||||
legend.data(dataReady.filter(function (value) {
|
||||
return value.data.value !== 0;
|
||||
})).append('text').attr('x', legendRectSize + legendSpacing).attr('y', legendRectSize - legendSpacing).text(function (d) {
|
||||
if (parser.yy.getShowData() || conf.showData || conf.pie.showData) {
|
||||
return d.data.key + ' [' + d.data.value + ']';
|
||||
} else {
|
||||
return d.data.key;
|
||||
}
|
||||
});
|
||||
} catch (e) {
|
||||
_logger__WEBPACK_IMPORTED_MODULE_3__["log"].error('Error while rendering info diagram');
|
||||
@ -16845,7 +16872,7 @@ var draw = function draw(txt, id) {
|
||||
"use strict";
|
||||
__webpack_require__.r(__webpack_exports__);
|
||||
var getStyles = function getStyles(options) {
|
||||
return ".pieTitleText {\n text-anchor: middle;\n font-size: 25px;\n fill: ".concat(options.taskTextDarkColor, ";\n font-family: ").concat(options.fontFamily, ";\n }\n .slice {\n font-family: ").concat(options.fontFamily, ";\n fill: ").concat(options.textColor, ";\n // fill: white;\n }\n .legend text {\n fill: ").concat(options.taskTextDarkColor, ";\n font-family: ").concat(options.fontFamily, ";\n font-size: 17px;\n }\n");
|
||||
return "\n .pieCircle{\n stroke: ".concat(options.pieStrokeColor, ";\n stroke-width : ").concat(options.pieStrokeWidth, ";\n opacity : ").concat(options.pieOpacity, ";\n }\n .pieTitleText {\n text-anchor: middle;\n font-size: ").concat(options.pieTitleTextSize, ";\n fill: ").concat(options.pieTitleTextColor, ";\n font-family: ").concat(options.fontFamily, ";\n }\n .slice {\n font-family: ").concat(options.fontFamily, ";\n fill: ").concat(options.pieSectionTextColor, ";\n font-size:").concat(options.pieSectionTextSize, ";\n // fill: white;\n }\n .legend text {\n fill: ").concat(options.pieLegendTextColor, ";\n font-family: ").concat(options.fontFamily, ";\n font-size: ").concat(options.pieLegendTextSize, ";\n }\n");
|
||||
};
|
||||
|
||||
/* harmony default export */ __webpack_exports__["default"] = (getStyles);
|
||||
@ -18027,7 +18054,6 @@ var drawReqs = function drawReqs(reqs, graph, svgNode) {
|
||||
Object.keys(reqs).forEach(function (reqName) {
|
||||
var req = reqs[reqName];
|
||||
reqName = elementString(reqName);
|
||||
console.log('reqName: ', reqName);
|
||||
_logger__WEBPACK_IMPORTED_MODULE_3__["log"].info('Added new requirement: ', reqName);
|
||||
var groupNode = svgNode.append('g').attr('id', reqName);
|
||||
var textId = 'req-' + reqName;
|
||||
@ -18057,7 +18083,7 @@ var drawElements = function drawElements(els, graph, svgNode) {
|
||||
var nodes = [];
|
||||
var titleNodeInfo = newTitleNode(groupNode, textId + '_title', ["<<Element>>", "".concat(elName)]);
|
||||
nodes.push(titleNodeInfo.titleNode);
|
||||
var bodyNode = newBodyNode(groupNode, textId + '_body', ["Type: ".concat(el.type || 'Not Specified'), "Doc Ref: ".concat(el.docref || 'None')], titleNodeInfo.y);
|
||||
var bodyNode = newBodyNode(groupNode, textId + '_body', ["Type: ".concat(el.type || 'Not Specified'), "Doc Ref: ".concat(el.docRef || 'None')], titleNodeInfo.y);
|
||||
nodes.push(bodyNode);
|
||||
var rectBBox = rectNode.node().getBBox(); // Add the entity to the graph
|
||||
|
||||
@ -18097,6 +18123,7 @@ var elementString = function elementString(str) {
|
||||
|
||||
var draw = function draw(text, id) {
|
||||
_parser_requirementDiagram__WEBPACK_IMPORTED_MODULE_6__["parser"].yy = _requirementDb__WEBPACK_IMPORTED_MODULE_7__["default"];
|
||||
_parser_requirementDiagram__WEBPACK_IMPORTED_MODULE_6__["parser"].yy.clear();
|
||||
_parser_requirementDiagram__WEBPACK_IMPORTED_MODULE_6__["parser"].parse(text);
|
||||
var svg = Object(d3__WEBPACK_IMPORTED_MODULE_0__["select"])("[id='".concat(id, "']"));
|
||||
_requirementMarkers__WEBPACK_IMPORTED_MODULE_8__["default"].insertLineEndings(svg, conf);
|
||||
@ -18150,7 +18177,7 @@ var draw = function draw(text, id) {
|
||||
"use strict";
|
||||
__webpack_require__.r(__webpack_exports__);
|
||||
var getStyles = function getStyles(options) {
|
||||
return "\n\n marker {\n fill: ".concat(options.relationColor, ";\n stroke: ").concat(options.relationColor, ";\n }\n\n marker.cross {\n stroke: ").concat(options.lineColor, ";\n }\n\n svg {\n font-family: ").concat(options.fontFamily, ";\n font-size: ").concat(options.fontSize, ";\n }\n\n .reqBox {\n fill: ").concat(options.requirementBackground, ";\n fill-opacity: 100%;\n stroke: ").concat(options.requirementBorderColor, ";\n stroke-size: ").concat(options.requirementBorderSize, ";\n }\n .reqLabelBox {\n fill: ").concat(options.relationLabelBackground, ";\n fill-opacity: 100%;\n }\n\n .req-title-line {\n stroke: ").concat(options.requirementBorderColor, ";\n stroke-width: 1;\n }\n .relationshipLine {\n stroke: ").concat(options.relationColor, ";\n stroke-width: 1;\n }\n .relationshipLabel {\n fill: ").concat(options.relationLabelColor, ";\n }\n\n");
|
||||
return "\n\n marker {\n fill: ".concat(options.relationColor, ";\n stroke: ").concat(options.relationColor, ";\n }\n\n marker.cross {\n stroke: ").concat(options.lineColor, ";\n }\n\n svg {\n font-family: ").concat(options.fontFamily, ";\n font-size: ").concat(options.fontSize, ";\n }\n\n .reqBox {\n fill: ").concat(options.requirementBackground, ";\n fill-opacity: 100%;\n stroke: ").concat(options.requirementBorderColor, ";\n stroke-width: ").concat(options.requirementBorderSize, ";\n }\n \n .reqTitle, .reqLabel{\n fill: ").concat(options.requirementTextColor, ";\n }\n .reqLabelBox {\n fill: ").concat(options.relationLabelBackground, ";\n fill-opacity: 100%;\n }\n\n .req-title-line {\n stroke: ").concat(options.requirementBorderColor, ";\n stroke-width: ").concat(options.requirementBorderSize, ";\n }\n .relationshipLine {\n stroke: ").concat(options.relationColor, ";\n stroke-width: 1;\n }\n .relationshipLabel {\n fill: ").concat(options.relationLabelColor, ";\n }\n\n");
|
||||
}; // fill', conf.rect_fill)
|
||||
|
||||
|
||||
@ -20982,12 +21009,12 @@ var size = function size() {
|
||||
}
|
||||
*/
|
||||
var parser = (function(){
|
||||
var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,2],$V1=[1,3],$V2=[1,5],$V3=[1,7],$V4=[2,5],$V5=[1,15],$V6=[1,17],$V7=[1,19],$V8=[1,20],$V9=[1,21],$Va=[1,22],$Vb=[1,29],$Vc=[1,23],$Vd=[1,24],$Ve=[1,25],$Vf=[1,26],$Vg=[1,27],$Vh=[1,30],$Vi=[1,33],$Vj=[1,4,5,14,15,17,19,20,22,23,24,25,26,27,37,40],$Vk=[1,4,5,12,13,14,15,17,19,20,22,23,24,25,26,27,37,40],$Vl=[1,4,5,7,14,15,17,19,20,22,23,24,25,26,27,37,40],$Vm=[4,5,14,15,17,19,20,22,23,24,25,26,27,37,40];
|
||||
var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,2],$V1=[1,3],$V2=[1,5],$V3=[1,7],$V4=[2,5],$V5=[1,15],$V6=[1,17],$V7=[1,19],$V8=[1,20],$V9=[1,21],$Va=[1,22],$Vb=[1,30],$Vc=[1,23],$Vd=[1,24],$Ve=[1,25],$Vf=[1,26],$Vg=[1,27],$Vh=[1,32],$Vi=[1,33],$Vj=[1,34],$Vk=[1,35],$Vl=[1,31],$Vm=[1,38],$Vn=[1,4,5,14,15,17,19,20,22,23,24,25,26,27,36,37,38,39,42,45],$Vo=[1,4,5,12,13,14,15,17,19,20,22,23,24,25,26,27,36,37,38,39,42,45],$Vp=[1,4,5,7,14,15,17,19,20,22,23,24,25,26,27,36,37,38,39,42,45],$Vq=[4,5,14,15,17,19,20,22,23,24,25,26,27,36,37,38,39,42,45];
|
||||
var parser = {trace: function trace () { },
|
||||
yy: {},
|
||||
symbols_: {"error":2,"start":3,"SPACE":4,"NL":5,"directive":6,"SD":7,"document":8,"line":9,"statement":10,"idStatement":11,"DESCR":12,"-->":13,"HIDE_EMPTY":14,"scale":15,"WIDTH":16,"COMPOSIT_STATE":17,"STRUCT_START":18,"STRUCT_STOP":19,"STATE_DESCR":20,"AS":21,"ID":22,"FORK":23,"JOIN":24,"CHOICE":25,"CONCURRENT":26,"note":27,"notePosition":28,"NOTE_TEXT":29,"openDirective":30,"typeDirective":31,"closeDirective":32,":":33,"argDirective":34,"eol":35,";":36,"EDGE_STATE":37,"left_of":38,"right_of":39,"open_directive":40,"type_directive":41,"arg_directive":42,"close_directive":43,"$accept":0,"$end":1},
|
||||
terminals_: {2:"error",4:"SPACE",5:"NL",7:"SD",12:"DESCR",13:"-->",14:"HIDE_EMPTY",15:"scale",16:"WIDTH",17:"COMPOSIT_STATE",18:"STRUCT_START",19:"STRUCT_STOP",20:"STATE_DESCR",21:"AS",22:"ID",23:"FORK",24:"JOIN",25:"CHOICE",26:"CONCURRENT",27:"note",29:"NOTE_TEXT",33:":",36:";",37:"EDGE_STATE",38:"left_of",39:"right_of",40:"open_directive",41:"type_directive",42:"arg_directive",43:"close_directive"},
|
||||
productions_: [0,[3,2],[3,2],[3,2],[3,2],[8,0],[8,2],[9,2],[9,1],[9,1],[10,1],[10,2],[10,3],[10,4],[10,1],[10,2],[10,1],[10,4],[10,3],[10,6],[10,1],[10,1],[10,1],[10,1],[10,4],[10,4],[10,1],[6,3],[6,5],[35,1],[35,1],[11,1],[11,1],[28,1],[28,1],[30,1],[31,1],[34,1],[32,1]],
|
||||
symbols_: {"error":2,"start":3,"SPACE":4,"NL":5,"directive":6,"SD":7,"document":8,"line":9,"statement":10,"idStatement":11,"DESCR":12,"-->":13,"HIDE_EMPTY":14,"scale":15,"WIDTH":16,"COMPOSIT_STATE":17,"STRUCT_START":18,"STRUCT_STOP":19,"STATE_DESCR":20,"AS":21,"ID":22,"FORK":23,"JOIN":24,"CHOICE":25,"CONCURRENT":26,"note":27,"notePosition":28,"NOTE_TEXT":29,"direction":30,"openDirective":31,"typeDirective":32,"closeDirective":33,":":34,"argDirective":35,"direction_tb":36,"direction_bt":37,"direction_rl":38,"direction_lr":39,"eol":40,";":41,"EDGE_STATE":42,"left_of":43,"right_of":44,"open_directive":45,"type_directive":46,"arg_directive":47,"close_directive":48,"$accept":0,"$end":1},
|
||||
terminals_: {2:"error",4:"SPACE",5:"NL",7:"SD",12:"DESCR",13:"-->",14:"HIDE_EMPTY",15:"scale",16:"WIDTH",17:"COMPOSIT_STATE",18:"STRUCT_START",19:"STRUCT_STOP",20:"STATE_DESCR",21:"AS",22:"ID",23:"FORK",24:"JOIN",25:"CHOICE",26:"CONCURRENT",27:"note",29:"NOTE_TEXT",34:":",36:"direction_tb",37:"direction_bt",38:"direction_rl",39:"direction_lr",41:";",42:"EDGE_STATE",43:"left_of",44:"right_of",45:"open_directive",46:"type_directive",47:"arg_directive",48:"close_directive"},
|
||||
productions_: [0,[3,2],[3,2],[3,2],[3,2],[8,0],[8,2],[9,2],[9,1],[9,1],[10,1],[10,2],[10,3],[10,4],[10,1],[10,2],[10,1],[10,4],[10,3],[10,6],[10,1],[10,1],[10,1],[10,1],[10,4],[10,4],[10,1],[10,1],[6,3],[6,5],[30,1],[30,1],[30,1],[30,1],[40,1],[40,1],[11,1],[11,1],[28,1],[28,1],[31,1],[32,1],[35,1],[33,1]],
|
||||
performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) {
|
||||
/* this == yyval */
|
||||
|
||||
@ -21033,7 +21060,6 @@ case 13:
|
||||
break;
|
||||
case 17:
|
||||
|
||||
|
||||
/* console.warn('Adding document for state without id ', $$[$0-3]);*/
|
||||
this.$={ stmt: 'state', id: $$[$0-3], type: 'default', description: '', doc: $$[$0-1] }
|
||||
|
||||
@ -21053,7 +21079,7 @@ case 18:
|
||||
break;
|
||||
case 19:
|
||||
|
||||
//console.warn('Adding document for state with id ', $$[$0-3], $$[$0-2]); yy.addDocument($$[$0-3]);
|
||||
// console.warn('Adding document for state with id zxzx', $$[$0-3], $$[$0-2], yy.getDirection()); yy.addDocument($$[$0-3]);
|
||||
this.$={ stmt: 'state', id: $$[$0-3], type: 'default', description: $$[$0-5], doc: $$[$0-1] }
|
||||
|
||||
break;
|
||||
@ -21079,29 +21105,41 @@ case 23:
|
||||
break;
|
||||
case 24:
|
||||
|
||||
/*console.warn('got NOTE, position: ', $$[$0-2].trim(), 'id = ', $$[$0-1].trim(), 'note: ', $$[$0]);*/
|
||||
/* console.warn('got NOTE, position: ', $$[$0-2].trim(), 'id = ', $$[$0-1].trim(), 'note: ', $$[$0]);*/
|
||||
this.$={ stmt: 'state', id: $$[$0-1].trim(), note:{position: $$[$0-2].trim(), text: $$[$0].trim()}};
|
||||
|
||||
break;
|
||||
case 31: case 32:
|
||||
case 30:
|
||||
yy.setDirection('TB');this.$={stmt:'dir', value:'TB'};
|
||||
break;
|
||||
case 31:
|
||||
yy.setDirection('BT');this.$={stmt:'dir', value:'BT'};
|
||||
break;
|
||||
case 32:
|
||||
yy.setDirection('RL'); this.$={stmt:'dir', value:'RL'};
|
||||
break;
|
||||
case 33:
|
||||
yy.setDirection('LR');this.$={stmt:'dir', value:'LR'};
|
||||
break;
|
||||
case 36: case 37:
|
||||
this.$=$$[$0];
|
||||
break;
|
||||
case 35:
|
||||
case 40:
|
||||
yy.parseDirective('%%{', 'open_directive');
|
||||
break;
|
||||
case 36:
|
||||
case 41:
|
||||
yy.parseDirective($$[$0], 'type_directive');
|
||||
break;
|
||||
case 37:
|
||||
case 42:
|
||||
$$[$0] = $$[$0].trim().replace(/'/g, '"'); yy.parseDirective($$[$0], 'arg_directive');
|
||||
break;
|
||||
case 38:
|
||||
case 43:
|
||||
yy.parseDirective('}%%', 'close_directive', 'state');
|
||||
break;
|
||||
}
|
||||
},
|
||||
table: [{3:1,4:$V0,5:$V1,6:4,7:$V2,30:6,40:$V3},{1:[3]},{3:8,4:$V0,5:$V1,6:4,7:$V2,30:6,40:$V3},{3:9,4:$V0,5:$V1,6:4,7:$V2,30:6,40:$V3},{3:10,4:$V0,5:$V1,6:4,7:$V2,30:6,40:$V3},o([1,4,5,14,15,17,20,22,23,24,25,26,27,37,40],$V4,{8:11}),{31:12,41:[1,13]},{41:[2,35]},{1:[2,1]},{1:[2,2]},{1:[2,3]},{1:[2,4],4:$V5,5:$V6,6:28,9:14,10:16,11:18,14:$V7,15:$V8,17:$V9,20:$Va,22:$Vb,23:$Vc,24:$Vd,25:$Ve,26:$Vf,27:$Vg,30:6,37:$Vh,40:$V3},{32:31,33:[1,32],43:$Vi},o([33,43],[2,36]),o($Vj,[2,6]),{6:28,10:34,11:18,14:$V7,15:$V8,17:$V9,20:$Va,22:$Vb,23:$Vc,24:$Vd,25:$Ve,26:$Vf,27:$Vg,30:6,37:$Vh,40:$V3},o($Vj,[2,8]),o($Vj,[2,9]),o($Vj,[2,10],{12:[1,35],13:[1,36]}),o($Vj,[2,14]),{16:[1,37]},o($Vj,[2,16],{18:[1,38]}),{21:[1,39]},o($Vj,[2,20]),o($Vj,[2,21]),o($Vj,[2,22]),o($Vj,[2,23]),{28:40,29:[1,41],38:[1,42],39:[1,43]},o($Vj,[2,26]),o($Vk,[2,31]),o($Vk,[2,32]),o($Vl,[2,27]),{34:44,42:[1,45]},o($Vl,[2,38]),o($Vj,[2,7]),o($Vj,[2,11]),{11:46,22:$Vb,37:$Vh},o($Vj,[2,15]),o($Vm,$V4,{8:47}),{22:[1,48]},{22:[1,49]},{21:[1,50]},{22:[2,33]},{22:[2,34]},{32:51,43:$Vi},{43:[2,37]},o($Vj,[2,12],{12:[1,52]}),{4:$V5,5:$V6,6:28,9:14,10:16,11:18,14:$V7,15:$V8,17:$V9,19:[1,53],20:$Va,22:$Vb,23:$Vc,24:$Vd,25:$Ve,26:$Vf,27:$Vg,30:6,37:$Vh,40:$V3},o($Vj,[2,18],{18:[1,54]}),{29:[1,55]},{22:[1,56]},o($Vl,[2,28]),o($Vj,[2,13]),o($Vj,[2,17]),o($Vm,$V4,{8:57}),o($Vj,[2,24]),o($Vj,[2,25]),{4:$V5,5:$V6,6:28,9:14,10:16,11:18,14:$V7,15:$V8,17:$V9,19:[1,58],20:$Va,22:$Vb,23:$Vc,24:$Vd,25:$Ve,26:$Vf,27:$Vg,30:6,37:$Vh,40:$V3},o($Vj,[2,19])],
|
||||
defaultActions: {7:[2,35],8:[2,1],9:[2,2],10:[2,3],42:[2,33],43:[2,34],45:[2,37]},
|
||||
table: [{3:1,4:$V0,5:$V1,6:4,7:$V2,31:6,45:$V3},{1:[3]},{3:8,4:$V0,5:$V1,6:4,7:$V2,31:6,45:$V3},{3:9,4:$V0,5:$V1,6:4,7:$V2,31:6,45:$V3},{3:10,4:$V0,5:$V1,6:4,7:$V2,31:6,45:$V3},o([1,4,5,14,15,17,20,22,23,24,25,26,27,36,37,38,39,42,45],$V4,{8:11}),{32:12,46:[1,13]},{46:[2,40]},{1:[2,1]},{1:[2,2]},{1:[2,3]},{1:[2,4],4:$V5,5:$V6,6:28,9:14,10:16,11:18,14:$V7,15:$V8,17:$V9,20:$Va,22:$Vb,23:$Vc,24:$Vd,25:$Ve,26:$Vf,27:$Vg,30:29,31:6,36:$Vh,37:$Vi,38:$Vj,39:$Vk,42:$Vl,45:$V3},{33:36,34:[1,37],48:$Vm},o([34,48],[2,41]),o($Vn,[2,6]),{6:28,10:39,11:18,14:$V7,15:$V8,17:$V9,20:$Va,22:$Vb,23:$Vc,24:$Vd,25:$Ve,26:$Vf,27:$Vg,30:29,31:6,36:$Vh,37:$Vi,38:$Vj,39:$Vk,42:$Vl,45:$V3},o($Vn,[2,8]),o($Vn,[2,9]),o($Vn,[2,10],{12:[1,40],13:[1,41]}),o($Vn,[2,14]),{16:[1,42]},o($Vn,[2,16],{18:[1,43]}),{21:[1,44]},o($Vn,[2,20]),o($Vn,[2,21]),o($Vn,[2,22]),o($Vn,[2,23]),{28:45,29:[1,46],43:[1,47],44:[1,48]},o($Vn,[2,26]),o($Vn,[2,27]),o($Vo,[2,36]),o($Vo,[2,37]),o($Vn,[2,30]),o($Vn,[2,31]),o($Vn,[2,32]),o($Vn,[2,33]),o($Vp,[2,28]),{35:49,47:[1,50]},o($Vp,[2,43]),o($Vn,[2,7]),o($Vn,[2,11]),{11:51,22:$Vb,42:$Vl},o($Vn,[2,15]),o($Vq,$V4,{8:52}),{22:[1,53]},{22:[1,54]},{21:[1,55]},{22:[2,38]},{22:[2,39]},{33:56,48:$Vm},{48:[2,42]},o($Vn,[2,12],{12:[1,57]}),{4:$V5,5:$V6,6:28,9:14,10:16,11:18,14:$V7,15:$V8,17:$V9,19:[1,58],20:$Va,22:$Vb,23:$Vc,24:$Vd,25:$Ve,26:$Vf,27:$Vg,30:29,31:6,36:$Vh,37:$Vi,38:$Vj,39:$Vk,42:$Vl,45:$V3},o($Vn,[2,18],{18:[1,59]}),{29:[1,60]},{22:[1,61]},o($Vp,[2,29]),o($Vn,[2,13]),o($Vn,[2,17]),o($Vq,$V4,{8:62}),o($Vn,[2,24]),o($Vn,[2,25]),{4:$V5,5:$V6,6:28,9:14,10:16,11:18,14:$V7,15:$V8,17:$V9,19:[1,63],20:$Va,22:$Vb,23:$Vc,24:$Vd,25:$Ve,26:$Vf,27:$Vg,30:29,31:6,36:$Vh,37:$Vi,38:$Vj,39:$Vk,42:$Vl,45:$V3},o($Vn,[2,19])],
|
||||
defaultActions: {7:[2,40],8:[2,1],9:[2,2],10:[2,3],47:[2,38],48:[2,39],50:[2,42]},
|
||||
parseError: function parseError (str, hash) {
|
||||
if (hash.recoverable) {
|
||||
this.trace(str);
|
||||
@ -21580,116 +21618,132 @@ options: {"case-insensitive":true},
|
||||
performAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) {
|
||||
var YYSTATE=YY_START;
|
||||
switch($avoiding_name_collisions) {
|
||||
case 0: this.begin('open_directive'); return 40;
|
||||
case 0:return 36;
|
||||
break;
|
||||
case 1: this.begin('type_directive'); return 41;
|
||||
case 1:return 37;
|
||||
break;
|
||||
case 2: this.popState(); this.begin('arg_directive'); return 33;
|
||||
case 2:return 38;
|
||||
break;
|
||||
case 3: this.popState(); this.popState(); return 43;
|
||||
case 3:return 39;
|
||||
break;
|
||||
case 4:return 42;
|
||||
case 4: this.begin('open_directive'); return 45;
|
||||
break;
|
||||
case 5:/* skip comments */
|
||||
case 5: this.begin('type_directive'); return 46;
|
||||
break;
|
||||
case 6:/* skip comments */{ console.log('Crap after close'); }
|
||||
case 6: this.popState(); this.begin('arg_directive'); return 34;
|
||||
break;
|
||||
case 7:return 5;
|
||||
case 7: this.popState(); this.popState(); return 48;
|
||||
break;
|
||||
case 8:/* skip all whitespace */
|
||||
case 8:return 47;
|
||||
break;
|
||||
case 9:/* skip same-line whitespace */
|
||||
case 9:/* skip comments */
|
||||
break;
|
||||
case 10:/* skip comments */
|
||||
case 10:/* skip comments */{ /*console.log('Crap after close');*/ }
|
||||
break;
|
||||
case 11:/* skip comments */
|
||||
case 11:return 5;
|
||||
break;
|
||||
case 12: this.pushState('SCALE'); /* console.log('Got scale', yy_.yytext);*/ return 15;
|
||||
case 12:/* skip all whitespace */
|
||||
break;
|
||||
case 13:return 16;
|
||||
case 13:/* skip same-line whitespace */
|
||||
break;
|
||||
case 14:this.popState();
|
||||
case 14:/* skip comments */
|
||||
break;
|
||||
case 15: console.log('Starting STATE');this.pushState('STATE');
|
||||
case 15:/* skip comments */
|
||||
break;
|
||||
case 16:this.popState();yy_.yytext=yy_.yytext.slice(0,-8).trim(); /*console.warn('Fork Fork: ',yy_.yytext);*/return 23;
|
||||
case 16: this.pushState('SCALE'); /* console.log('Got scale', yy_.yytext);*/ return 15;
|
||||
break;
|
||||
case 17:this.popState();yy_.yytext=yy_.yytext.slice(0,-8).trim();/*console.warn('Fork Join: ',yy_.yytext);*/return 24;
|
||||
case 17:return 16;
|
||||
break;
|
||||
case 18:this.popState();yy_.yytext=yy_.yytext.slice(0,-10).trim();/*console.warn('Fork Join: ',yy_.yytext);*/return 25;
|
||||
case 18:this.popState();
|
||||
break;
|
||||
case 19:this.popState();yy_.yytext=yy_.yytext.slice(0,-8).trim();/*console.warn('Fork Fork: ',yy_.yytext);*/return 23;
|
||||
case 19: /*console.log('Starting STATE zxzx'+yy.getDirection());*/this.pushState('STATE');
|
||||
break;
|
||||
case 20:this.popState();yy_.yytext=yy_.yytext.slice(0,-8).trim();/*console.warn('Fork Join: ',yy_.yytext);*/return 24;
|
||||
case 20:this.popState();yy_.yytext=yy_.yytext.slice(0,-8).trim(); /*console.warn('Fork Fork: ',yy_.yytext);*/return 23;
|
||||
break;
|
||||
case 21:this.popState();yy_.yytext=yy_.yytext.slice(0,-10).trim();/*console.warn('Fork Join: ',yy_.yytext);*/return 25;
|
||||
case 21:this.popState();yy_.yytext=yy_.yytext.slice(0,-8).trim();/*console.warn('Fork Join: ',yy_.yytext);*/return 24;
|
||||
break;
|
||||
case 22: console.log('Starting STATE_STRING');this.begin("STATE_STRING");
|
||||
case 22:this.popState();yy_.yytext=yy_.yytext.slice(0,-10).trim();/*console.warn('Fork Join: ',yy_.yytext);*/return 25;
|
||||
break;
|
||||
case 23:this.popState();this.pushState('STATE_ID');return "AS";
|
||||
case 23:this.popState();yy_.yytext=yy_.yytext.slice(0,-8).trim();/*console.warn('Fork Fork: ',yy_.yytext);*/return 23;
|
||||
break;
|
||||
case 24:this.popState();/* console.log('STATE_ID', yy_.yytext);*/return "ID";
|
||||
case 24:this.popState();yy_.yytext=yy_.yytext.slice(0,-8).trim();/*console.warn('Fork Join: ',yy_.yytext);*/return 24;
|
||||
break;
|
||||
case 25:this.popState();
|
||||
case 25:this.popState();yy_.yytext=yy_.yytext.slice(0,-10).trim();/*console.warn('Fork Join: ',yy_.yytext);*/return 25;
|
||||
break;
|
||||
case 26: console.log('Long description:', yy_.yytext);return "STATE_DESCR";
|
||||
case 26: return 36;
|
||||
break;
|
||||
case 27:/*console.log('COMPOSIT_STATE', yy_.yytext);*/return 17;
|
||||
case 27: return 37;
|
||||
break;
|
||||
case 28:this.popState();
|
||||
case 28: return 38;
|
||||
break;
|
||||
case 29:this.popState();this.pushState('struct'); /*console.log('begin struct', yy_.yytext);*/return 18;
|
||||
case 29: return 39;
|
||||
break;
|
||||
case 30: /*console.log('Ending struct');*/ this.popState(); return 19;
|
||||
case 30: /*console.log('Starting STATE_STRING zxzx');*/this.begin("STATE_STRING");
|
||||
break;
|
||||
case 31:/* nothing */
|
||||
case 31:this.popState();this.pushState('STATE_ID');return "AS";
|
||||
break;
|
||||
case 32: this.begin('NOTE'); return 27;
|
||||
case 32:this.popState();/* console.log('STATE_ID', yy_.yytext);*/return "ID";
|
||||
break;
|
||||
case 33: this.popState();this.pushState('NOTE_ID');return 38;
|
||||
case 33:this.popState();
|
||||
break;
|
||||
case 34: this.popState();this.pushState('NOTE_ID');return 39;
|
||||
case 34: /*console.log('Long description:', yy_.yytext);*/return "STATE_DESCR";
|
||||
break;
|
||||
case 35: this.popState();this.pushState('FLOATING_NOTE');
|
||||
case 35:/*console.log('COMPOSIT_STATE', yy_.yytext);*/return 17;
|
||||
break;
|
||||
case 36:this.popState();this.pushState('FLOATING_NOTE_ID');return "AS";
|
||||
case 36:this.popState();
|
||||
break;
|
||||
case 37:/**/
|
||||
case 37:this.popState();this.pushState('struct'); /*console.log('begin struct', yy_.yytext);*/return 18;
|
||||
break;
|
||||
case 38: /*console.log('Floating note text: ', yy_.yytext);*/return "NOTE_TEXT";
|
||||
case 38: /*console.log('Ending struct');*/ this.popState(); return 19;
|
||||
break;
|
||||
case 39:this.popState();/*console.log('Floating note ID', yy_.yytext);*/return "ID";
|
||||
case 39:/* nothing */
|
||||
break;
|
||||
case 40: this.popState();this.pushState('NOTE_TEXT');/*console.log('Got ID for note', yy_.yytext);*/return 22;
|
||||
case 40: this.begin('NOTE'); return 27;
|
||||
break;
|
||||
case 41: this.popState();/*console.log('Got NOTE_TEXT for note',yy_.yytext);*/yy_.yytext = yy_.yytext.substr(2).trim();return 29;
|
||||
case 41: this.popState();this.pushState('NOTE_ID');return 43;
|
||||
break;
|
||||
case 42: this.popState();/*console.log('Got NOTE_TEXT for note',yy_.yytext);*/yy_.yytext = yy_.yytext.slice(0,-8).trim();return 29;
|
||||
case 42: this.popState();this.pushState('NOTE_ID');return 44;
|
||||
break;
|
||||
case 43: /*console.log('Got state diagram', yy_.yytext,'#');*/return 7;
|
||||
case 43: this.popState();this.pushState('FLOATING_NOTE');
|
||||
break;
|
||||
case 44: /*console.log('Got state diagram', yy_.yytext,'#');*/return 7;
|
||||
case 44:this.popState();this.pushState('FLOATING_NOTE_ID');return "AS";
|
||||
break;
|
||||
case 45: /*console.log('HIDE_EMPTY', yy_.yytext,'#');*/return 14;
|
||||
case 45:/**/
|
||||
break;
|
||||
case 46: /*console.log('EDGE_STATE=',yy_.yytext);*/ return 37;
|
||||
case 46: /*console.log('Floating note text: ', yy_.yytext);*/return "NOTE_TEXT";
|
||||
break;
|
||||
case 47: /*console.log('=>ID=',yy_.yytext);*/ return 22;
|
||||
case 47:this.popState();/*console.log('Floating note ID', yy_.yytext);*/return "ID";
|
||||
break;
|
||||
case 48: yy_.yytext = yy_.yytext.trim(); /*console.log('Descr = ', yy_.yytext);*/ return 12;
|
||||
case 48: this.popState();this.pushState('NOTE_TEXT');/*console.log('Got ID for note', yy_.yytext);*/return 22;
|
||||
break;
|
||||
case 49:return 13;
|
||||
case 49: this.popState();/*console.log('Got NOTE_TEXT for note',yy_.yytext);*/yy_.yytext = yy_.yytext.substr(2).trim();return 29;
|
||||
break;
|
||||
case 50:return 26;
|
||||
case 50: this.popState();/*console.log('Got NOTE_TEXT for note',yy_.yytext);*/yy_.yytext = yy_.yytext.slice(0,-8).trim();return 29;
|
||||
break;
|
||||
case 51:return 5;
|
||||
case 51: /*console.log('Got state diagram', yy_.yytext,'#');*/return 7;
|
||||
break;
|
||||
case 52:return 'INVALID';
|
||||
case 52: /*console.log('Got state diagram', yy_.yytext,'#');*/return 7;
|
||||
break;
|
||||
case 53: /*console.log('HIDE_EMPTY', yy_.yytext,'#');*/return 14;
|
||||
break;
|
||||
case 54: /*console.log('EDGE_STATE=',yy_.yytext);*/ return 42;
|
||||
break;
|
||||
case 55: /*console.log('=>ID=',yy_.yytext);*/ return 22;
|
||||
break;
|
||||
case 56: yy_.yytext = yy_.yytext.trim(); /*console.log('Descr = ', yy_.yytext);*/ return 12;
|
||||
break;
|
||||
case 57:return 13;
|
||||
break;
|
||||
case 58:return 26;
|
||||
break;
|
||||
case 59:return 5;
|
||||
break;
|
||||
case 60:return 'INVALID';
|
||||
break;
|
||||
}
|
||||
},
|
||||
rules: [/^(?:%%\{)/i,/^(?:((?:(?!\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\}%%)/i,/^(?:((?:(?!\}%%).|\n)*))/i,/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:state\s+)/i,/^(?:.*<<fork>>)/i,/^(?:.*<<join>>)/i,/^(?:.*<<choice>>)/i,/^(?:.*\[\[fork\]\])/i,/^(?:.*\[\[join\]\])/i,/^(?:.*\[\[choice\]\])/i,/^(?:["])/i,/^(?:\s*as\s+)/i,/^(?:[^\n\{]*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n\s\{]+)/i,/^(?:\n)/i,/^(?:\{)/i,/^(?:\})/i,/^(?:[\n])/i,/^(?:note\s+)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:")/i,/^(?:\s*as\s*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n]*)/i,/^(?:\s*[^:\n\s\-]+)/i,/^(?:\s*:[^:\n;]+)/i,/^(?:[\s\S]*?end note\b)/i,/^(?:stateDiagram\s+)/i,/^(?:stateDiagram-v2\s+)/i,/^(?:hide empty description\b)/i,/^(?:\[\*\])/i,/^(?:[^:\n\s\-\{]+)/i,/^(?:\s*:[^:\n;]+)/i,/^(?:-->)/i,/^(?:--)/i,/^(?:$)/i,/^(?:.)/i],
|
||||
conditions: {"LINE":{"rules":[9,10],"inclusive":false},"close_directive":{"rules":[9,10],"inclusive":false},"arg_directive":{"rules":[3,4,9,10],"inclusive":false},"type_directive":{"rules":[2,3,9,10],"inclusive":false},"open_directive":{"rules":[1,9,10],"inclusive":false},"struct":{"rules":[9,10,15,30,31,32,46,47,48,49,50],"inclusive":false},"FLOATING_NOTE_ID":{"rules":[39],"inclusive":false},"FLOATING_NOTE":{"rules":[36,37,38],"inclusive":false},"NOTE_TEXT":{"rules":[41,42],"inclusive":false},"NOTE_ID":{"rules":[40],"inclusive":false},"NOTE":{"rules":[33,34,35],"inclusive":false},"SCALE":{"rules":[13,14],"inclusive":false},"ALIAS":{"rules":[],"inclusive":false},"STATE_ID":{"rules":[24],"inclusive":false},"STATE_STRING":{"rules":[25,26],"inclusive":false},"FORK_STATE":{"rules":[],"inclusive":false},"STATE":{"rules":[9,10,16,17,18,19,20,21,22,23,27,28,29],"inclusive":false},"ID":{"rules":[9,10],"inclusive":false},"INITIAL":{"rules":[0,5,6,7,8,10,11,12,15,29,32,43,44,45,46,47,48,49,51,52],"inclusive":true}}
|
||||
rules: [/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:%%\{)/i,/^(?:((?:(?!\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\}%%)/i,/^(?:((?:(?!\}%%).|\n)*))/i,/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:state\s+)/i,/^(?:.*<<fork>>)/i,/^(?:.*<<join>>)/i,/^(?:.*<<choice>>)/i,/^(?:.*\[\[fork\]\])/i,/^(?:.*\[\[join\]\])/i,/^(?:.*\[\[choice\]\])/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:["])/i,/^(?:\s*as\s+)/i,/^(?:[^\n\{]*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n\s\{]+)/i,/^(?:\n)/i,/^(?:\{)/i,/^(?:\})/i,/^(?:[\n])/i,/^(?:note\s+)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:")/i,/^(?:\s*as\s*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n]*)/i,/^(?:\s*[^:\n\s\-]+)/i,/^(?:\s*:[^:\n;]+)/i,/^(?:[\s\S]*?end note\b)/i,/^(?:stateDiagram\s+)/i,/^(?:stateDiagram-v2\s+)/i,/^(?:hide empty description\b)/i,/^(?:\[\*\])/i,/^(?:[^:\n\s\-\{]+)/i,/^(?:\s*:[^:\n;]+)/i,/^(?:-->)/i,/^(?:--)/i,/^(?:$)/i,/^(?:.)/i],
|
||||
conditions: {"LINE":{"rules":[13,14],"inclusive":false},"close_directive":{"rules":[13,14],"inclusive":false},"arg_directive":{"rules":[7,8,13,14],"inclusive":false},"type_directive":{"rules":[6,7,13,14],"inclusive":false},"open_directive":{"rules":[5,13,14],"inclusive":false},"struct":{"rules":[13,14,19,26,27,28,29,38,39,40,54,55,56,57,58],"inclusive":false},"FLOATING_NOTE_ID":{"rules":[47],"inclusive":false},"FLOATING_NOTE":{"rules":[44,45,46],"inclusive":false},"NOTE_TEXT":{"rules":[49,50],"inclusive":false},"NOTE_ID":{"rules":[48],"inclusive":false},"NOTE":{"rules":[41,42,43],"inclusive":false},"SCALE":{"rules":[17,18],"inclusive":false},"ALIAS":{"rules":[],"inclusive":false},"STATE_ID":{"rules":[32],"inclusive":false},"STATE_STRING":{"rules":[33,34],"inclusive":false},"FORK_STATE":{"rules":[],"inclusive":false},"STATE":{"rules":[13,14,20,21,22,23,24,25,30,31,35,36,37],"inclusive":false},"ID":{"rules":[13,14],"inclusive":false},"INITIAL":{"rules":[0,1,2,3,4,9,10,11,12,14,15,16,19,37,40,51,52,53,54,55,56,57,59,60],"inclusive":true}}
|
||||
});
|
||||
return lexer;
|
||||
})();
|
||||
@ -22258,7 +22312,7 @@ var getRootDocV2 = function getRootDocV2() {
|
||||
return {
|
||||
id: 'root',
|
||||
doc: rootDoc
|
||||
};
|
||||
}; // Here
|
||||
};
|
||||
|
||||
var extract = function extract(_doc) {
|
||||
@ -22430,8 +22484,14 @@ var getClasses = function getClasses() {
|
||||
return classes;
|
||||
};
|
||||
|
||||
var direction = 'TB';
|
||||
|
||||
var getDirection = function getDirection() {
|
||||
return 'TB';
|
||||
return direction;
|
||||
};
|
||||
|
||||
var setDirection = function setDirection(dir) {
|
||||
direction = dir;
|
||||
};
|
||||
|
||||
var relationType = {
|
||||
@ -22459,6 +22519,7 @@ var trimColon = function trimColon(str) {
|
||||
getDirection: getDirection,
|
||||
addRelation: addRelation,
|
||||
getDividerId: getDividerId,
|
||||
setDirection: setDirection,
|
||||
// addDescription,
|
||||
cleanupLabel: cleanupLabel,
|
||||
lineType: lineType,
|
||||
@ -22582,8 +22643,9 @@ var setupNode = function setupNode(g, parent, node, altFlag) {
|
||||
|
||||
|
||||
if (!nodeDb[node.id].type && node.doc) {
|
||||
_logger__WEBPACK_IMPORTED_MODULE_6__["log"].info('Setting cluser for ', node.id);
|
||||
_logger__WEBPACK_IMPORTED_MODULE_6__["log"].info('Setting cluster for ', node.id, getDir(node));
|
||||
nodeDb[node.id].type = 'group';
|
||||
nodeDb[node.id].dir = getDir(node);
|
||||
nodeDb[node.id].shape = node.type === 'divider' ? 'divider' : 'roundedWithTitle';
|
||||
nodeDb[node.id].classes = nodeDb[node.id].classes + ' ' + (altFlag ? 'statediagram-cluster statediagram-cluster-alt' : 'statediagram-cluster');
|
||||
}
|
||||
@ -22600,7 +22662,7 @@ var setupNode = function setupNode(g, parent, node, altFlag) {
|
||||
style: '',
|
||||
//styles.style,
|
||||
id: node.id,
|
||||
dir: altFlag ? 'LR' : 'TB',
|
||||
dir: nodeDb[node.id].dir,
|
||||
domId: 'state-' + node.id + '-' + cnt,
|
||||
type: nodeDb[node.id].type,
|
||||
padding: 15 //getConfig().flowchart.padding
|
||||
@ -22617,7 +22679,7 @@ var setupNode = function setupNode(g, parent, node, altFlag) {
|
||||
//classStr,
|
||||
style: '',
|
||||
//styles.style,
|
||||
id: node.id + '----note',
|
||||
id: node.id + '----note-' + cnt,
|
||||
domId: 'state-' + node.id + '----note-' + cnt,
|
||||
type: nodeDb[node.id].type,
|
||||
padding: 15 //getConfig().flowchart.padding
|
||||
@ -22711,6 +22773,22 @@ var setupDoc = function setupDoc(g, parent, doc, altFlag) {
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
var getDir = function getDir(nodes, defaultDir) {
|
||||
var dir = defaultDir || 'TB';
|
||||
|
||||
if (nodes.doc) {
|
||||
for (var i = 0; i < nodes.doc.length; i++) {
|
||||
var node = nodes.doc[i];
|
||||
|
||||
if (node.stmt === 'dir') {
|
||||
dir = node.value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return dir;
|
||||
};
|
||||
/**
|
||||
* Draws a flowchart in the tag with id: id based on the graph definition in text.
|
||||
* @param text
|
||||
@ -22735,13 +22813,16 @@ var draw = function draw(text, id) {
|
||||
|
||||
var conf = Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state;
|
||||
var nodeSpacing = conf.nodeSpacing || 50;
|
||||
var rankSpacing = conf.rankSpacing || 50; // Create the input mermaid.graph
|
||||
var rankSpacing = conf.rankSpacing || 50;
|
||||
_logger__WEBPACK_IMPORTED_MODULE_6__["log"].info(_stateDb__WEBPACK_IMPORTED_MODULE_2__["default"].getRootDocV2());
|
||||
_stateDb__WEBPACK_IMPORTED_MODULE_2__["default"].extract(_stateDb__WEBPACK_IMPORTED_MODULE_2__["default"].getRootDocV2());
|
||||
_logger__WEBPACK_IMPORTED_MODULE_6__["log"].info(_stateDb__WEBPACK_IMPORTED_MODULE_2__["default"].getRootDocV2()); // Create the input mermaid.graph
|
||||
|
||||
var g = new graphlib__WEBPACK_IMPORTED_MODULE_0___default.a.Graph({
|
||||
multigraph: true,
|
||||
compound: true
|
||||
}).setGraph({
|
||||
rankdir: 'TB',
|
||||
rankdir: getDir(_stateDb__WEBPACK_IMPORTED_MODULE_2__["default"].getRootDocV2()),
|
||||
nodesep: nodeSpacing,
|
||||
ranksep: rankSpacing,
|
||||
marginx: 8,
|
||||
@ -22749,9 +22830,6 @@ var draw = function draw(text, id) {
|
||||
}).setDefaultEdgeLabel(function () {
|
||||
return {};
|
||||
});
|
||||
_logger__WEBPACK_IMPORTED_MODULE_6__["log"].info(_stateDb__WEBPACK_IMPORTED_MODULE_2__["default"].getRootDocV2());
|
||||
_stateDb__WEBPACK_IMPORTED_MODULE_2__["default"].extract(_stateDb__WEBPACK_IMPORTED_MODULE_2__["default"].getRootDocV2());
|
||||
_logger__WEBPACK_IMPORTED_MODULE_6__["log"].info(_stateDb__WEBPACK_IMPORTED_MODULE_2__["default"].getRootDocV2());
|
||||
setupNode(g, undefined, _stateDb__WEBPACK_IMPORTED_MODULE_2__["default"].getRootDocV2(), true); // Set up an SVG group so that we can translate the final graph.
|
||||
|
||||
var svg = Object(d3__WEBPACK_IMPORTED_MODULE_1__["select"])("[id=\"".concat(id, "\"]")); // Run the renderer. This is what draws the final graph.
|
||||
@ -23081,7 +23159,7 @@ var renderDoc = function renderDoc(doc, diagram, parentId, altBkg) {
|
||||
"use strict";
|
||||
__webpack_require__.r(__webpack_exports__);
|
||||
var getStyles = function getStyles(options) {
|
||||
return "\ndefs #statediagram-barbEnd {\n fill: ".concat(options.transitionColor, ";\n stroke: ").concat(options.transitionColor, ";\n }\ng.stateGroup text {\n fill: ").concat(options.nodeBorder, ";\n stroke: none;\n font-size: 10px;\n}\ng.stateGroup text {\n fill: ").concat(options.textColor, ";\n stroke: none;\n font-size: 10px;\n\n}\ng.stateGroup .state-title {\n font-weight: bolder;\n fill: ").concat(options.stateLabelColor, ";\n}\n\ng.stateGroup rect {\n fill: ").concat(options.mainBkg, ";\n stroke: ").concat(options.nodeBorder, ";\n}\n\ng.stateGroup line {\n stroke: ").concat(options.lineColor, ";\n stroke-width: 1;\n}\n\n.transition {\n stroke: ").concat(options.transitionColor, ";\n stroke-width: 1;\n fill: none;\n}\n\n.stateGroup .composit {\n fill: ").concat(options.background, ";\n border-bottom: 1px\n}\n\n.stateGroup .alt-composit {\n fill: #e0e0e0;\n border-bottom: 1px\n}\n\n.state-note {\n stroke: ").concat(options.noteBorderColor, ";\n fill: ").concat(options.noteBkgColor, ";\n\n text {\n fill: ").concat(options.noteTextColor, ";\n stroke: none;\n font-size: 10px;\n }\n}\n\n.stateLabel .box {\n stroke: none;\n stroke-width: 0;\n fill: ").concat(options.mainBkg, ";\n opacity: 0.5;\n}\n\n.edgeLabel .label rect {\n fill: ").concat(options.labelBackgroundColor, ";\n opacity: 0.5;\n}\n.edgeLabel .label text {\n fill: ").concat(options.transitionLabelColor || options.tertiaryTextColor, ";\n}\n.label div .edgeLabel {\n color: ").concat(options.transitionLabelColor || options.tertiaryTextColor, ";\n}\n\n.stateLabel text {\n fill: ").concat(options.stateLabelColor, ";\n font-size: 10px;\n font-weight: bold;\n}\n\n.node circle.state-start {\n fill: ").concat(options.lineColor, ";\n stroke: black;\n}\n.node circle.state-end {\n fill: ").concat(options.primaryBorderColor, ";\n stroke: ").concat(options.background, ";\n stroke-width: 1.5\n}\n.end-state-inner {\n fill: ").concat(options.compositeBackground || options.background, ";\n // stroke: ").concat(options.background, ";\n stroke-width: 1.5\n}\n\n.node rect {\n fill: ").concat(options.stateBkg || options.mainBkg, ";\n stroke: ").concat(options.stateBorder || options.nodeBorder, ";\n stroke-width: 1px;\n}\n.node polygon {\n fill: ").concat(options.mainBkg, ";\n stroke: ").concat(options.nodeBorder, ";\n stroke-width: 1px;\n}\n#statediagram-barbEnd {\n fill: ").concat(options.lineColor, ";\n}\n\n.statediagram-cluster rect {\n fill: ").concat(options.compositeTitleBackground, ";\n stroke: ").concat(options.stateBorder || options.nodeBorder, ";\n stroke-width: 1px;\n}\n\n.cluster-label, .nodeLabel {\n color: ").concat(options.stateLabelColor, ";\n}\n\n.statediagram-cluster rect.outer {\n rx: 5px;\n ry: 5px;\n}\n.statediagram-state .divider {\n stroke: ").concat(options.stateBorder || options.nodeBorder, ";\n}\n\n.statediagram-state .title-state {\n rx: 5px;\n ry: 5px;\n}\n.statediagram-cluster.statediagram-cluster .inner {\n fill: ").concat(options.compositeBackground || options.background, ";\n}\n.statediagram-cluster.statediagram-cluster-alt .inner {\n fill: ").concat(options.altBackground ? options.altBackground : '#efefef', ";\n}\n\n.statediagram-cluster .inner {\n rx:0;\n ry:0;\n}\n\n.statediagram-state rect.basic {\n rx: 5px;\n ry: 5px;\n}\n.statediagram-state rect.divider {\n stroke-dasharray: 10,10;\n fill: ").concat(options.altBackground ? options.altBackground : '#efefef', ";\n}\n\n.note-edge {\n stroke-dasharray: 5;\n}\n\n.statediagram-note rect {\n fill: ").concat(options.noteBkgColor, ";\n stroke: ").concat(options.noteBorderColor, ";\n stroke-width: 1px;\n rx: 0;\n ry: 0;\n}\n.statediagram-note rect {\n fill: ").concat(options.noteBkgColor, ";\n stroke: ").concat(options.noteBorderColor, ";\n stroke-width: 1px;\n rx: 0;\n ry: 0;\n}\n\n.statediagram-note text {\n fill: ").concat(options.noteTextColor, ";\n}\n\n.statediagram-note .nodeLabel {\n color: ").concat(options.noteTextColor, ";\n}\n.statediagram .edgeLabel {\n color: red; // ").concat(options.noteTextColor, ";\n}\n\n#dependencyStart, #dependencyEnd {\n fill: ").concat(options.lineColor, ";\n stroke: ").concat(options.lineColor, ";\n stroke-width: 1;\n}\n");
|
||||
return "\ndefs #statediagram-barbEnd {\n fill: ".concat(options.transitionColor, ";\n stroke: ").concat(options.transitionColor, ";\n }\ng.stateGroup text {\n fill: ").concat(options.nodeBorder, ";\n stroke: none;\n font-size: 10px;\n}\ng.stateGroup text {\n fill: ").concat(options.textColor, ";\n stroke: none;\n font-size: 10px;\n\n}\ng.stateGroup .state-title {\n font-weight: bolder;\n fill: ").concat(options.stateLabelColor, ";\n}\n\ng.stateGroup rect {\n fill: ").concat(options.mainBkg, ";\n stroke: ").concat(options.nodeBorder, ";\n}\n\ng.stateGroup line {\n stroke: ").concat(options.lineColor, ";\n stroke-width: 1;\n}\n\n.transition {\n stroke: ").concat(options.transitionColor, ";\n stroke-width: 1;\n fill: none;\n}\n\n.stateGroup .composit {\n fill: ").concat(options.background, ";\n border-bottom: 1px\n}\n\n.stateGroup .alt-composit {\n fill: #e0e0e0;\n border-bottom: 1px\n}\n\n.state-note {\n stroke: ").concat(options.noteBorderColor, ";\n fill: ").concat(options.noteBkgColor, ";\n\n text {\n fill: ").concat(options.noteTextColor, ";\n stroke: none;\n font-size: 10px;\n }\n}\n\n.stateLabel .box {\n stroke: none;\n stroke-width: 0;\n fill: ").concat(options.mainBkg, ";\n opacity: 0.5;\n}\n\n.edgeLabel .label rect {\n fill: ").concat(options.labelBackgroundColor, ";\n opacity: 0.5;\n}\n.edgeLabel .label text {\n fill: ").concat(options.transitionLabelColor || options.tertiaryTextColor, ";\n}\n.label div .edgeLabel {\n color: ").concat(options.transitionLabelColor || options.tertiaryTextColor, ";\n}\n\n.stateLabel text {\n fill: ").concat(options.stateLabelColor, ";\n font-size: 10px;\n font-weight: bold;\n}\n\n.node circle.state-start {\n fill: ").concat(options.lineColor, ";\n stroke: black;\n}\n.node circle.state-end {\n fill: ").concat(options.primaryBorderColor, ";\n stroke: ").concat(options.background, ";\n stroke-width: 1.5\n}\n.end-state-inner {\n fill: ").concat(options.compositeBackground || options.background, ";\n // stroke: ").concat(options.background, ";\n stroke-width: 1.5\n}\n\n.node rect {\n fill: ").concat(options.stateBkg || options.mainBkg, ";\n stroke: ").concat(options.stateBorder || options.nodeBorder, ";\n stroke-width: 1px;\n}\n.node polygon {\n fill: ").concat(options.mainBkg, ";\n stroke: ").concat(options.stateBorder || options.nodeBorder, ";;\n stroke-width: 1px;\n}\n#statediagram-barbEnd {\n fill: ").concat(options.lineColor, ";\n}\n\n.statediagram-cluster rect {\n fill: ").concat(options.compositeTitleBackground, ";\n stroke: ").concat(options.stateBorder || options.nodeBorder, ";\n stroke-width: 1px;\n}\n\n.cluster-label, .nodeLabel {\n color: ").concat(options.stateLabelColor, ";\n}\n\n.statediagram-cluster rect.outer {\n rx: 5px;\n ry: 5px;\n}\n.statediagram-state .divider {\n stroke: ").concat(options.stateBorder || options.nodeBorder, ";\n}\n\n.statediagram-state .title-state {\n rx: 5px;\n ry: 5px;\n}\n.statediagram-cluster.statediagram-cluster .inner {\n fill: ").concat(options.compositeBackground || options.background, ";\n}\n.statediagram-cluster.statediagram-cluster-alt .inner {\n fill: ").concat(options.altBackground ? options.altBackground : '#efefef', ";\n}\n\n.statediagram-cluster .inner {\n rx:0;\n ry:0;\n}\n\n.statediagram-state rect.basic {\n rx: 5px;\n ry: 5px;\n}\n.statediagram-state rect.divider {\n stroke-dasharray: 10,10;\n fill: ").concat(options.altBackground ? options.altBackground : '#efefef', ";\n}\n\n.note-edge {\n stroke-dasharray: 5;\n}\n\n.statediagram-note rect {\n fill: ").concat(options.noteBkgColor, ";\n stroke: ").concat(options.noteBorderColor, ";\n stroke-width: 1px;\n rx: 0;\n ry: 0;\n}\n.statediagram-note rect {\n fill: ").concat(options.noteBkgColor, ";\n stroke: ").concat(options.noteBorderColor, ";\n stroke-width: 1px;\n rx: 0;\n ry: 0;\n}\n\n.statediagram-note text {\n fill: ").concat(options.noteTextColor, ";\n}\n\n.statediagram-note .nodeLabel {\n color: ").concat(options.noteTextColor, ";\n}\n.statediagram .edgeLabel {\n color: red; // ").concat(options.noteTextColor, ";\n}\n\n#dependencyStart, #dependencyEnd {\n fill: ").concat(options.lineColor, ";\n stroke: ").concat(options.lineColor, ";\n stroke-width: 1;\n}\n");
|
||||
};
|
||||
|
||||
/* harmony default export */ __webpack_exports__["default"] = (getStyles);
|
||||
@ -25080,7 +25158,6 @@ function parse(text) {
|
||||
|
||||
case 'requirement':
|
||||
case 'requirementDiagram':
|
||||
console.log('RequirementDiagram');
|
||||
_logger__WEBPACK_IMPORTED_MODULE_41__["log"].debug('RequirementDiagram');
|
||||
parser = _diagrams_requirement_parser_requirementDiagram__WEBPACK_IMPORTED_MODULE_27___default.a;
|
||||
parser.parser.yy = _diagrams_requirement_requirementDb__WEBPACK_IMPORTED_MODULE_28__["default"];
|
||||
@ -25951,6 +26028,15 @@ function () {
|
||||
h: 120,
|
||||
l: -10
|
||||
});
|
||||
this.pieTitleTextSize = this.pieTitleTextSize || '25px';
|
||||
this.pieTitleTextColor = this.pieTitleTextColor || this.taskTextDarkColor;
|
||||
this.pieSectionTextSize = this.pieSectionTextSize || '17px';
|
||||
this.pieSectionTextColor = this.pieSectionTextColor || this.textColor;
|
||||
this.pieLegendTextSize = this.pieLegendTextSize || '17px';
|
||||
this.pieLegendTextColor = this.pieLegendTextColor || this.taskTextDarkColor;
|
||||
this.pieStrokeColor = this.pieStrokeColor || 'black';
|
||||
this.pieStrokeWidth = this.pieStrokeWidth || '2px';
|
||||
this.pieOpacity = this.pieOpacity || '0.7';
|
||||
/* requirement-diagram */
|
||||
|
||||
this.requirementBackground = this.requirementBackground || this.primaryColor;
|
||||
@ -26182,18 +26268,6 @@ function () {
|
||||
h: 128
|
||||
});
|
||||
/* pie */
|
||||
// this.pie1 = this.pie1 || this.primaryColor;
|
||||
// this.pie2 = this.pie2 || this.secondaryColor;
|
||||
// this.pie3 = this.pie3 || this.tertiaryColor;
|
||||
// this.pie4 = this.pie4 || adjust(this.primaryColor, { l: -10 });
|
||||
// this.pie5 = this.pie5 || adjust(this.secondaryColor, { l: -10 });
|
||||
// this.pie6 = this.pie6 || adjust(this.tertiaryColor, { l: -10 });
|
||||
// this.pie7 = this.pie7 || adjust(this.primaryColor, { h: +60, l: -10 });
|
||||
// this.pie8 = this.pie8 || adjust(this.primaryColor, { h: -60, l: -10 });
|
||||
// this.pie9 = this.pie9 || adjust(this.primaryColor, { h: 120, l: 0 });
|
||||
// this.pie10 = this.pie10 || adjust(this.primaryColor, { h: +60, l: -20 });
|
||||
// this.pie11 = this.pie11 || adjust(this.primaryColor, { h: -60, l: -20 });
|
||||
// this.pie12 = this.pie12 || adjust(this.primaryColor, { h: 120, l: -10 });
|
||||
|
||||
this.pie1 = this.pie1 || '#0b0000';
|
||||
this.pie2 = this.pie2 || '#4d1037';
|
||||
@ -26207,6 +26281,15 @@ function () {
|
||||
this.pie10 = this.pie10 || '#00296f';
|
||||
this.pie11 = this.pie11 || '#01629c';
|
||||
this.pie12 = this.pie12 || '#010029';
|
||||
this.pieTitleTextSize = this.pieTitleTextSize || '25px';
|
||||
this.pieTitleTextColor = this.pieTitleTextColor || this.taskTextDarkColor;
|
||||
this.pieSectionTextSize = this.pieSectionTextSize || '17px';
|
||||
this.pieSectionTextColor = this.pieSectionTextColor || this.textColor;
|
||||
this.pieLegendTextSize = this.pieLegendTextSize || '17px';
|
||||
this.pieLegendTextColor = this.pieLegendTextColor || this.taskTextDarkColor;
|
||||
this.pieStrokeColor = this.pieStrokeColor || 'black';
|
||||
this.pieStrokeWidth = this.pieStrokeWidth || '2px';
|
||||
this.pieOpacity = this.pieOpacity || '0.7';
|
||||
/* class */
|
||||
|
||||
this.classText = this.primaryTextColor;
|
||||
@ -26497,6 +26580,15 @@ function () {
|
||||
h: 120,
|
||||
l: -30
|
||||
});
|
||||
this.pieTitleTextSize = this.pieTitleTextSize || '25px';
|
||||
this.pieTitleTextColor = this.pieTitleTextColor || this.taskTextDarkColor;
|
||||
this.pieSectionTextSize = this.pieSectionTextSize || '17px';
|
||||
this.pieSectionTextColor = this.pieSectionTextColor || this.textColor;
|
||||
this.pieLegendTextSize = this.pieLegendTextSize || '17px';
|
||||
this.pieLegendTextColor = this.pieLegendTextColor || this.taskTextDarkColor;
|
||||
this.pieStrokeColor = this.pieStrokeColor || 'black';
|
||||
this.pieStrokeWidth = this.pieStrokeWidth || '2px';
|
||||
this.pieOpacity = this.pieOpacity || '0.7';
|
||||
/* requirement-diagram */
|
||||
|
||||
this.requirementBackground = this.requirementBackground || this.primaryColor;
|
||||
@ -26752,6 +26844,15 @@ function () {
|
||||
h: 120,
|
||||
l: -50
|
||||
});
|
||||
this.pieTitleTextSize = this.pieTitleTextSize || '25px';
|
||||
this.pieTitleTextColor = this.pieTitleTextColor || this.taskTextDarkColor;
|
||||
this.pieSectionTextSize = this.pieSectionTextSize || '17px';
|
||||
this.pieSectionTextColor = this.pieSectionTextColor || this.textColor;
|
||||
this.pieLegendTextSize = this.pieLegendTextSize || '17px';
|
||||
this.pieLegendTextColor = this.pieLegendTextColor || this.taskTextDarkColor;
|
||||
this.pieStrokeColor = this.pieStrokeColor || 'black';
|
||||
this.pieStrokeWidth = this.pieStrokeWidth || '2px';
|
||||
this.pieOpacity = this.pieOpacity || '0.7';
|
||||
/* requirement-diagram */
|
||||
|
||||
this.requirementBackground = this.requirementBackground || this.primaryColor;
|
||||
@ -27033,7 +27134,16 @@ function () {
|
||||
this.pie9 = this.pie9 || '#BBB';
|
||||
this.pie10 = this.pie10 || '#999';
|
||||
this.pie11 = this.pie11 || '#777';
|
||||
this.pie12 = this.pie12 || '#555'; // this.pie1 = this.pie1 || '#212529';
|
||||
this.pie12 = this.pie12 || '#555';
|
||||
this.pieTitleTextSize = this.pieTitleTextSize || '25px';
|
||||
this.pieTitleTextColor = this.pieTitleTextColor || this.taskTextDarkColor;
|
||||
this.pieSectionTextSize = this.pieSectionTextSize || '17px';
|
||||
this.pieSectionTextColor = this.pieSectionTextColor || this.textColor;
|
||||
this.pieLegendTextSize = this.pieLegendTextSize || '17px';
|
||||
this.pieLegendTextColor = this.pieLegendTextColor || this.taskTextDarkColor;
|
||||
this.pieStrokeColor = this.pieStrokeColor || 'black';
|
||||
this.pieStrokeWidth = this.pieStrokeWidth || '2px';
|
||||
this.pieOpacity = this.pieOpacity || '0.7'; // this.pie1 = this.pie1 || '#212529';
|
||||
// this.pie2 = this.pie2 || '#343A40';
|
||||
// this.pie3 = this.pie3 || '#495057';
|
||||
// this.pie4 = this.pie4 || '#6C757D';
|
||||
|
2
dist/mermaid.core.js.map
vendored
2
dist/mermaid.core.js.map
vendored
File diff suppressed because one or more lines are too long
368
dist/mermaid.js
vendored
368
dist/mermaid.js
vendored
@ -49035,7 +49035,7 @@ module.exports = function(module) {
|
||||
/*! exports provided: name, version, description, main, keywords, scripts, repository, author, license, standard, dependencies, devDependencies, files, yarn-upgrade-all, sideEffects, husky, default */
|
||||
/***/ (function(module) {
|
||||
|
||||
module.exports = JSON.parse("{\"name\":\"mermaid\",\"version\":\"8.9.2\",\"description\":\"Markdownish syntax for generating flowcharts, sequence diagrams, class diagrams, gantt charts and git graphs.\",\"main\":\"dist/mermaid.core.js\",\"keywords\":[\"diagram\",\"markdown\",\"flowchart\",\"sequence diagram\",\"gantt\",\"class diagram\",\"git graph\"],\"scripts\":{\"build:development\":\"webpack --progress --colors\",\"build:production\":\"yarn build:development -p --config webpack.config.prod.babel.js\",\"build\":\"yarn build:development && yarn build:production\",\"postbuild\":\"documentation build src/mermaidAPI.js src/config.js src/defaultConfig.js --shallow -f md --markdown-toc false > docs/Setup.md\",\"build:watch\":\"yarn build --watch\",\"minify\":\"minify ./dist/mermaid.js > ./dist/mermaid.min.js\",\"release\":\"yarn build\",\"lint\":\"eslint src\",\"e2e:depr\":\"yarn lint && jest e2e --config e2e/jest.config.js\",\"cypress\":\"percy exec -- cypress run\",\"e2e\":\"start-server-and-test dev http://localhost:9000/ cypress\",\"e2e-upd\":\"yarn lint && jest e2e -u --config e2e/jest.config.js\",\"dev\":\"webpack-dev-server --config webpack.config.e2e.js\",\"test\":\"yarn lint && jest src/.*\",\"test:watch\":\"jest --watch src\",\"prepublishOnly\":\"yarn build && yarn test\",\"prepare\":\"yarn build\"},\"repository\":{\"type\":\"git\",\"url\":\"https://github.com/knsv/mermaid\"},\"author\":\"Knut Sveidqvist\",\"license\":\"MIT\",\"standard\":{\"ignore\":[\"**/parser/*.js\",\"dist/**/*.js\",\"cypress/**/*.js\"],\"globals\":[\"page\"]},\"dependencies\":{\"@braintree/sanitize-url\":\"^3.1.0\",\"d3\":\"^5.7.0\",\"dagre\":\"^0.8.4\",\"dagre-d3\":\"^0.6.4\",\"entity-decode\":\"^2.0.2\",\"graphlib\":\"^2.1.7\",\"he\":\"^1.2.0\",\"khroma\":\"^1.1.0\",\"minify\":\"^4.1.1\",\"moment-mini\":\"^2.22.1\",\"stylis\":\"^3.5.2\"},\"devDependencies\":{\"@babel/core\":\"^7.2.2\",\"@babel/preset-env\":\"^7.8.4\",\"@babel/register\":\"^7.0.0\",\"@percy/cypress\":\"*\",\"babel-core\":\"7.0.0-bridge.0\",\"babel-eslint\":\"^10.1.0\",\"babel-jest\":\"^24.9.0\",\"babel-loader\":\"^8.0.4\",\"coveralls\":\"^3.0.2\",\"css-loader\":\"^2.0.1\",\"css-to-string-loader\":\"^0.1.3\",\"cypress\":\"4.0.1\",\"documentation\":\"^12.0.1\",\"eslint\":\"^6.3.0\",\"eslint-config-prettier\":\"^6.3.0\",\"eslint-plugin-prettier\":\"^3.1.0\",\"husky\":\"^1.2.1\",\"identity-obj-proxy\":\"^3.0.0\",\"jest\":\"^24.9.0\",\"jison\":\"^0.4.18\",\"moment\":\"^2.23.0\",\"node-sass\":\"^5.0.0\",\"prettier\":\"^1.18.2\",\"puppeteer\":\"^1.17.0\",\"sass-loader\":\"^7.1.0\",\"start-server-and-test\":\"^1.10.6\",\"terser-webpack-plugin\":\"^2.2.2\",\"webpack\":\"^4.41.2\",\"webpack-bundle-analyzer\":\"^3.7.0\",\"webpack-cli\":\"^3.1.2\",\"webpack-dev-server\":\"^3.4.1\",\"webpack-node-externals\":\"^1.7.2\",\"yarn-upgrade-all\":\"^0.5.0\"},\"files\":[\"dist\"],\"yarn-upgrade-all\":{\"ignore\":[\"babel-core\"]},\"sideEffects\":[\"**/*.css\",\"**/*.scss\"],\"husky\":{\"hooks\":{\"pre-push\":\"yarn test\"}}}");
|
||||
module.exports = JSON.parse("{\"name\":\"mermaid\",\"version\":\"8.10.1\",\"description\":\"Markdownish syntax for generating flowcharts, sequence diagrams, class diagrams, gantt charts and git graphs.\",\"main\":\"dist/mermaid.core.js\",\"keywords\":[\"diagram\",\"markdown\",\"flowchart\",\"sequence diagram\",\"gantt\",\"class diagram\",\"git graph\"],\"scripts\":{\"build:development\":\"webpack --progress --colors\",\"build:production\":\"yarn build:development -p --config webpack.config.prod.babel.js\",\"build\":\"yarn build:development && yarn build:production\",\"postbuild\":\"documentation build src/mermaidAPI.js src/config.js src/defaultConfig.js --shallow -f md --markdown-toc false > docs/Setup.md\",\"build:watch\":\"yarn build --watch\",\"minify\":\"minify ./dist/mermaid.js > ./dist/mermaid.min.js\",\"release\":\"yarn build\",\"lint\":\"eslint src\",\"e2e:depr\":\"yarn lint && jest e2e --config e2e/jest.config.js\",\"cypress\":\"percy exec -- cypress run\",\"e2e\":\"start-server-and-test dev http://localhost:9000/ cypress\",\"e2e-upd\":\"yarn lint && jest e2e -u --config e2e/jest.config.js\",\"dev\":\"webpack-dev-server --config webpack.config.e2e.js\",\"test\":\"yarn lint && jest src/.*\",\"test:watch\":\"jest --watch src\",\"prepublishOnly\":\"yarn build && yarn test\",\"prepare\":\"yarn build\"},\"repository\":{\"type\":\"git\",\"url\":\"https://github.com/knsv/mermaid\"},\"author\":\"Knut Sveidqvist\",\"license\":\"MIT\",\"standard\":{\"ignore\":[\"**/parser/*.js\",\"dist/**/*.js\",\"cypress/**/*.js\"],\"globals\":[\"page\"]},\"dependencies\":{\"@braintree/sanitize-url\":\"^3.1.0\",\"d3\":\"^5.7.0\",\"dagre\":\"^0.8.4\",\"dagre-d3\":\"^0.6.4\",\"entity-decode\":\"^2.0.2\",\"graphlib\":\"^2.1.7\",\"he\":\"^1.2.0\",\"khroma\":\"^1.1.0\",\"minify\":\"^4.1.1\",\"moment-mini\":\"^2.22.1\",\"stylis\":\"^3.5.2\"},\"devDependencies\":{\"@babel/core\":\"^7.2.2\",\"@babel/preset-env\":\"^7.8.4\",\"@babel/register\":\"^7.0.0\",\"@percy/cypress\":\"*\",\"babel-core\":\"7.0.0-bridge.0\",\"babel-eslint\":\"^10.1.0\",\"babel-jest\":\"^24.9.0\",\"babel-loader\":\"^8.0.4\",\"coveralls\":\"^3.0.2\",\"css-loader\":\"^2.0.1\",\"css-to-string-loader\":\"^0.1.3\",\"cypress\":\"4.0.1\",\"documentation\":\"^12.0.1\",\"eslint\":\"^6.3.0\",\"eslint-config-prettier\":\"^6.3.0\",\"eslint-plugin-prettier\":\"^3.1.0\",\"husky\":\"^1.2.1\",\"identity-obj-proxy\":\"^3.0.0\",\"jest\":\"^24.9.0\",\"jison\":\"^0.4.18\",\"moment\":\"^2.23.0\",\"node-sass\":\"^5.0.0\",\"prettier\":\"^1.18.2\",\"puppeteer\":\"^1.17.0\",\"sass-loader\":\"^7.1.0\",\"start-server-and-test\":\"^1.10.6\",\"terser-webpack-plugin\":\"^2.2.2\",\"webpack\":\"^4.41.2\",\"webpack-bundle-analyzer\":\"^3.7.0\",\"webpack-cli\":\"^3.1.2\",\"webpack-dev-server\":\"^3.4.1\",\"webpack-node-externals\":\"^1.7.2\",\"yarn-upgrade-all\":\"^0.5.0\"},\"files\":[\"dist\"],\"yarn-upgrade-all\":{\"ignore\":[\"babel-core\"]},\"sideEffects\":[\"**/*.css\",\"**/*.scss\"],\"husky\":{\"hooks\":{\"pre-push\":\"yarn test\"}}}");
|
||||
|
||||
/***/ }),
|
||||
|
||||
@ -64415,42 +64415,45 @@ var getStyles = function getStyles() {
|
||||
}
|
||||
*/
|
||||
var parser = (function(){
|
||||
var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,4],$V1=[1,5],$V2=[1,6],$V3=[1,7],$V4=[1,9],$V5=[1,10,12,19,20,21,22],$V6=[1,6,10,12,19,20,21,22],$V7=[19,20,21],$V8=[1,22],$V9=[6,19,20,21,22];
|
||||
var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,4],$V1=[1,5],$V2=[1,6],$V3=[1,7],$V4=[1,9],$V5=[1,11,13,20,21,22,23],$V6=[2,5],$V7=[1,6,11,13,20,21,22,23],$V8=[20,21,22],$V9=[2,8],$Va=[1,18],$Vb=[1,19],$Vc=[1,24],$Vd=[6,20,21,22,23];
|
||||
var parser = {trace: function trace () { },
|
||||
yy: {},
|
||||
symbols_: {"error":2,"start":3,"eol":4,"directive":5,"PIE":6,"document":7,"line":8,"statement":9,"txt":10,"value":11,"title":12,"title_value":13,"openDirective":14,"typeDirective":15,"closeDirective":16,":":17,"argDirective":18,"NEWLINE":19,";":20,"EOF":21,"open_directive":22,"type_directive":23,"arg_directive":24,"close_directive":25,"$accept":0,"$end":1},
|
||||
terminals_: {2:"error",6:"PIE",10:"txt",11:"value",12:"title",13:"title_value",17:":",19:"NEWLINE",20:";",21:"EOF",22:"open_directive",23:"type_directive",24:"arg_directive",25:"close_directive"},
|
||||
productions_: [0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[9,0],[9,2],[9,2],[9,1],[5,3],[5,5],[4,1],[4,1],[4,1],[14,1],[15,1],[18,1],[16,1]],
|
||||
symbols_: {"error":2,"start":3,"eol":4,"directive":5,"PIE":6,"document":7,"showData":8,"line":9,"statement":10,"txt":11,"value":12,"title":13,"title_value":14,"openDirective":15,"typeDirective":16,"closeDirective":17,":":18,"argDirective":19,"NEWLINE":20,";":21,"EOF":22,"open_directive":23,"type_directive":24,"arg_directive":25,"close_directive":26,"$accept":0,"$end":1},
|
||||
terminals_: {2:"error",6:"PIE",8:"showData",11:"txt",12:"value",13:"title",14:"title_value",18:":",20:"NEWLINE",21:";",22:"EOF",23:"open_directive",24:"type_directive",25:"arg_directive",26:"close_directive"},
|
||||
productions_: [0,[3,2],[3,2],[3,2],[3,3],[7,0],[7,2],[9,2],[10,0],[10,2],[10,2],[10,1],[5,3],[5,5],[4,1],[4,1],[4,1],[15,1],[16,1],[19,1],[17,1]],
|
||||
performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) {
|
||||
/* this == yyval */
|
||||
|
||||
var $0 = $$.length - 1;
|
||||
switch (yystate) {
|
||||
case 6:
|
||||
case 4:
|
||||
yy.setShowData(true);
|
||||
break;
|
||||
case 7:
|
||||
this.$ = $$[$0-1]
|
||||
break;
|
||||
case 8:
|
||||
case 9:
|
||||
yy.addSection($$[$0-1],yy.cleanupValue($$[$0]));
|
||||
break;
|
||||
case 9:
|
||||
case 10:
|
||||
this.$=$$[$0].trim();yy.setTitle(this.$);
|
||||
break;
|
||||
case 16:
|
||||
case 17:
|
||||
yy.parseDirective('%%{', 'open_directive');
|
||||
break;
|
||||
case 17:
|
||||
case 18:
|
||||
yy.parseDirective($$[$0], 'type_directive');
|
||||
break;
|
||||
case 18:
|
||||
case 19:
|
||||
$$[$0] = $$[$0].trim().replace(/'/g, '"'); yy.parseDirective($$[$0], 'arg_directive');
|
||||
break;
|
||||
case 19:
|
||||
case 20:
|
||||
yy.parseDirective('}%%', 'close_directive', 'pie');
|
||||
break;
|
||||
}
|
||||
},
|
||||
table: [{3:1,4:2,5:3,6:$V0,14:8,19:$V1,20:$V2,21:$V3,22:$V4},{1:[3]},{3:10,4:2,5:3,6:$V0,14:8,19:$V1,20:$V2,21:$V3,22:$V4},{3:11,4:2,5:3,6:$V0,14:8,19:$V1,20:$V2,21:$V3,22:$V4},o($V5,[2,4],{7:12}),o($V6,[2,13]),o($V6,[2,14]),o($V6,[2,15]),{15:13,23:[1,14]},{23:[2,16]},{1:[2,1]},{1:[2,2]},o($V7,[2,7],{14:8,8:15,9:16,5:19,1:[2,3],10:[1,17],12:[1,18],22:$V4}),{16:20,17:[1,21],25:$V8},o([17,25],[2,17]),o($V5,[2,5]),{4:23,19:$V1,20:$V2,21:$V3},{11:[1,24]},{13:[1,25]},o($V7,[2,10]),o($V9,[2,11]),{18:26,24:[1,27]},o($V9,[2,19]),o($V5,[2,6]),o($V7,[2,8]),o($V7,[2,9]),{16:28,25:$V8},{25:[2,18]},o($V9,[2,12])],
|
||||
defaultActions: {9:[2,16],10:[2,1],11:[2,2],27:[2,18]},
|
||||
table: [{3:1,4:2,5:3,6:$V0,15:8,20:$V1,21:$V2,22:$V3,23:$V4},{1:[3]},{3:10,4:2,5:3,6:$V0,15:8,20:$V1,21:$V2,22:$V3,23:$V4},{3:11,4:2,5:3,6:$V0,15:8,20:$V1,21:$V2,22:$V3,23:$V4},o($V5,$V6,{7:12,8:[1,13]}),o($V7,[2,14]),o($V7,[2,15]),o($V7,[2,16]),{16:14,24:[1,15]},{24:[2,17]},{1:[2,1]},{1:[2,2]},o($V8,$V9,{15:8,9:16,10:17,5:20,1:[2,3],11:$Va,13:$Vb,23:$V4}),o($V5,$V6,{7:21}),{17:22,18:[1,23],26:$Vc},o([18,26],[2,18]),o($V5,[2,6]),{4:25,20:$V1,21:$V2,22:$V3},{12:[1,26]},{14:[1,27]},o($V8,[2,11]),o($V8,$V9,{15:8,9:16,10:17,5:20,1:[2,4],11:$Va,13:$Vb,23:$V4}),o($Vd,[2,12]),{19:28,25:[1,29]},o($Vd,[2,20]),o($V5,[2,7]),o($V8,[2,9]),o($V8,[2,10]),{17:30,26:$Vc},{26:[2,19]},o($Vd,[2,13])],
|
||||
defaultActions: {9:[2,17],10:[2,1],11:[2,2],29:[2,19]},
|
||||
parseError: function parseError (str, hash) {
|
||||
if (hash.recoverable) {
|
||||
this.trace(str);
|
||||
@ -64929,27 +64932,27 @@ options: {"case-insensitive":true},
|
||||
performAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) {
|
||||
var YYSTATE=YY_START;
|
||||
switch($avoiding_name_collisions) {
|
||||
case 0: this.begin('open_directive'); return 22;
|
||||
case 0: this.begin('open_directive'); return 23;
|
||||
break;
|
||||
case 1: this.begin('type_directive'); return 23;
|
||||
case 1: this.begin('type_directive'); return 24;
|
||||
break;
|
||||
case 2: this.popState(); this.begin('arg_directive'); return 17;
|
||||
case 2: this.popState(); this.begin('arg_directive'); return 18;
|
||||
break;
|
||||
case 3: this.popState(); this.popState(); return 25;
|
||||
case 3: this.popState(); this.popState(); return 26;
|
||||
break;
|
||||
case 4:return 24;
|
||||
case 4:return 25;
|
||||
break;
|
||||
case 5:/* skip comments */
|
||||
break;
|
||||
case 6:/* skip comments */{ /*console.log('');*/ }
|
||||
break;
|
||||
case 7:return 19;
|
||||
case 7:return 20;
|
||||
break;
|
||||
case 8:/* do nothing */
|
||||
break;
|
||||
case 9:/* ignore */
|
||||
break;
|
||||
case 10: this.begin("title");return 12;
|
||||
case 10: this.begin("title");return 13;
|
||||
break;
|
||||
case 11: this.popState(); return "title_value";
|
||||
break;
|
||||
@ -64961,14 +64964,16 @@ case 14: return "txt";
|
||||
break;
|
||||
case 15:return 6;
|
||||
break;
|
||||
case 16:return "value";
|
||||
case 16:return 8;
|
||||
break;
|
||||
case 17:return 21;
|
||||
case 17:return "value";
|
||||
break;
|
||||
case 18:return 22;
|
||||
break;
|
||||
}
|
||||
},
|
||||
rules: [/^(?:%%\{)/i,/^(?:((?:(?!\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\}%%)/i,/^(?:((?:(?!\}%%).|\n)*))/i,/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:[\s]+)/i,/^(?:title\b)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:pie\b)/i,/^(?::[\s]*[\d]+(?:\.[\d]+)?)/i,/^(?:$)/i],
|
||||
conditions: {"close_directive":{"rules":[],"inclusive":false},"arg_directive":{"rules":[3,4],"inclusive":false},"type_directive":{"rules":[2,3],"inclusive":false},"open_directive":{"rules":[1],"inclusive":false},"title":{"rules":[11],"inclusive":false},"string":{"rules":[13,14],"inclusive":false},"INITIAL":{"rules":[0,5,6,7,8,9,10,12,15,16,17],"inclusive":true}}
|
||||
rules: [/^(?:%%\{)/i,/^(?:((?:(?!\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\}%%)/i,/^(?:((?:(?!\}%%).|\n)*))/i,/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:[\s]+)/i,/^(?:title\b)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:pie\b)/i,/^(?:showData\b)/i,/^(?::[\s]*[\d]+(?:\.[\d]+)?)/i,/^(?:$)/i],
|
||||
conditions: {"close_directive":{"rules":[],"inclusive":false},"arg_directive":{"rules":[3,4],"inclusive":false},"type_directive":{"rules":[2,3],"inclusive":false},"open_directive":{"rules":[1],"inclusive":false},"title":{"rules":[11],"inclusive":false},"string":{"rules":[13,14],"inclusive":false},"INITIAL":{"rules":[0,5,6,7,8,9,10,12,15,16,17,18],"inclusive":true}}
|
||||
});
|
||||
return lexer;
|
||||
})();
|
||||
@ -65022,6 +65027,7 @@ __webpack_require__.r(__webpack_exports__);
|
||||
|
||||
var sections = {};
|
||||
var title = '';
|
||||
var showData = false;
|
||||
var parseDirective = function parseDirective(statement, context, type) {
|
||||
_mermaidAPI__WEBPACK_IMPORTED_MODULE_1__["default"].parseDirective(this, statement, context, type);
|
||||
};
|
||||
@ -65041,6 +65047,14 @@ var setTitle = function setTitle(txt) {
|
||||
title = txt;
|
||||
};
|
||||
|
||||
var setShowData = function setShowData(toggle) {
|
||||
showData = toggle;
|
||||
};
|
||||
|
||||
var getShowData = function getShowData() {
|
||||
return showData;
|
||||
};
|
||||
|
||||
var getTitle = function getTitle() {
|
||||
return title;
|
||||
};
|
||||
@ -65057,6 +65071,7 @@ var cleanupValue = function cleanupValue(value) {
|
||||
var clear = function clear() {
|
||||
sections = {};
|
||||
title = '';
|
||||
showData = false;
|
||||
}; // export const parseError = (err, hash) => {
|
||||
// global.mermaidAPI.parseError(err, hash)
|
||||
// }
|
||||
@ -65072,7 +65087,9 @@ var clear = function clear() {
|
||||
cleanupValue: cleanupValue,
|
||||
clear: clear,
|
||||
setTitle: setTitle,
|
||||
getTitle: getTitle // parseError
|
||||
getTitle: getTitle,
|
||||
setShowData: setShowData,
|
||||
getShowData: getShowData // parseError
|
||||
|
||||
});
|
||||
|
||||
@ -65130,10 +65147,14 @@ var draw = function draw(txt, id) {
|
||||
width = 1200;
|
||||
}
|
||||
|
||||
if (typeof conf.pie.useWidth !== 'undefined') {
|
||||
if (typeof conf.useWidth !== 'undefined') {
|
||||
width = conf.useWidth;
|
||||
}
|
||||
|
||||
if (typeof conf.pie.useWidth !== 'undefined') {
|
||||
width = conf.pie.useWidth;
|
||||
}
|
||||
|
||||
var diagram = Object(d3__WEBPACK_IMPORTED_MODULE_0__["select"])('#' + id);
|
||||
Object(_utils__WEBPACK_IMPORTED_MODULE_4__["configureSvgSize"])(diagram, height, width, conf.pie.useMaxWidth); // Set viewBox
|
||||
|
||||
@ -65163,7 +65184,7 @@ var draw = function draw(txt, id) {
|
||||
|
||||
svg.selectAll('mySlices').data(dataReady).enter().append('path').attr('d', arcGenerator).attr('fill', function (d) {
|
||||
return color(d.data.key);
|
||||
}).attr('stroke', 'black').style('stroke-width', '2px').style('opacity', 0.7); // Now add the percentage.
|
||||
}).attr('class', 'pieCircle'); // Now add the percentage.
|
||||
// Use the centroid method to get the best coordinates.
|
||||
|
||||
svg.selectAll('mySlices').data(dataReady.filter(function (value) {
|
||||
@ -65172,7 +65193,7 @@ var draw = function draw(txt, id) {
|
||||
return (d.data.value / sum * 100).toFixed(0) + '%';
|
||||
}).attr('transform', function (d) {
|
||||
return 'translate(' + arcGenerator.centroid(d) + ')';
|
||||
}).style('text-anchor', 'middle').attr('class', 'slice').style('font-size', 17);
|
||||
}).style('text-anchor', 'middle').attr('class', 'slice');
|
||||
svg.append('text').text(parser.yy.getTitle()).attr('x', 0).attr('y', -(height - 50) / 2).attr('class', 'pieTitleText'); // Add the legends/annotations for each section
|
||||
|
||||
var legend = svg.selectAll('.legend').data(color.domain()).enter().append('g').attr('class', 'legend').attr('transform', function (d, i) {
|
||||
@ -65183,8 +65204,14 @@ var draw = function draw(txt, id) {
|
||||
return 'translate(' + horz + ',' + vert + ')';
|
||||
});
|
||||
legend.append('rect').attr('width', legendRectSize).attr('height', legendRectSize).style('fill', color).style('stroke', color);
|
||||
legend.append('text').attr('x', legendRectSize + legendSpacing).attr('y', legendRectSize - legendSpacing).text(function (d) {
|
||||
return d;
|
||||
legend.data(dataReady.filter(function (value) {
|
||||
return value.data.value !== 0;
|
||||
})).append('text').attr('x', legendRectSize + legendSpacing).attr('y', legendRectSize - legendSpacing).text(function (d) {
|
||||
if (parser.yy.getShowData() || conf.showData || conf.pie.showData) {
|
||||
return d.data.key + ' [' + d.data.value + ']';
|
||||
} else {
|
||||
return d.data.key;
|
||||
}
|
||||
});
|
||||
} catch (e) {
|
||||
_logger__WEBPACK_IMPORTED_MODULE_3__["log"].error('Error while rendering info diagram');
|
||||
@ -65207,7 +65234,7 @@ var draw = function draw(txt, id) {
|
||||
"use strict";
|
||||
__webpack_require__.r(__webpack_exports__);
|
||||
var getStyles = function getStyles(options) {
|
||||
return ".pieTitleText {\n text-anchor: middle;\n font-size: 25px;\n fill: ".concat(options.taskTextDarkColor, ";\n font-family: ").concat(options.fontFamily, ";\n }\n .slice {\n font-family: ").concat(options.fontFamily, ";\n fill: ").concat(options.textColor, ";\n // fill: white;\n }\n .legend text {\n fill: ").concat(options.taskTextDarkColor, ";\n font-family: ").concat(options.fontFamily, ";\n font-size: 17px;\n }\n");
|
||||
return "\n .pieCircle{\n stroke: ".concat(options.pieStrokeColor, ";\n stroke-width : ").concat(options.pieStrokeWidth, ";\n opacity : ").concat(options.pieOpacity, ";\n }\n .pieTitleText {\n text-anchor: middle;\n font-size: ").concat(options.pieTitleTextSize, ";\n fill: ").concat(options.pieTitleTextColor, ";\n font-family: ").concat(options.fontFamily, ";\n }\n .slice {\n font-family: ").concat(options.fontFamily, ";\n fill: ").concat(options.pieSectionTextColor, ";\n font-size:").concat(options.pieSectionTextSize, ";\n // fill: white;\n }\n .legend text {\n fill: ").concat(options.pieLegendTextColor, ";\n font-family: ").concat(options.fontFamily, ";\n font-size: ").concat(options.pieLegendTextSize, ";\n }\n");
|
||||
};
|
||||
|
||||
/* harmony default export */ __webpack_exports__["default"] = (getStyles);
|
||||
@ -66388,7 +66415,6 @@ var drawReqs = function drawReqs(reqs, graph, svgNode) {
|
||||
Object.keys(reqs).forEach(function (reqName) {
|
||||
var req = reqs[reqName];
|
||||
reqName = elementString(reqName);
|
||||
console.log('reqName: ', reqName);
|
||||
_logger__WEBPACK_IMPORTED_MODULE_3__["log"].info('Added new requirement: ', reqName);
|
||||
var groupNode = svgNode.append('g').attr('id', reqName);
|
||||
var textId = 'req-' + reqName;
|
||||
@ -66418,7 +66444,7 @@ var drawElements = function drawElements(els, graph, svgNode) {
|
||||
var nodes = [];
|
||||
var titleNodeInfo = newTitleNode(groupNode, textId + '_title', ["<<Element>>", "".concat(elName)]);
|
||||
nodes.push(titleNodeInfo.titleNode);
|
||||
var bodyNode = newBodyNode(groupNode, textId + '_body', ["Type: ".concat(el.type || 'Not Specified'), "Doc Ref: ".concat(el.docref || 'None')], titleNodeInfo.y);
|
||||
var bodyNode = newBodyNode(groupNode, textId + '_body', ["Type: ".concat(el.type || 'Not Specified'), "Doc Ref: ".concat(el.docRef || 'None')], titleNodeInfo.y);
|
||||
nodes.push(bodyNode);
|
||||
var rectBBox = rectNode.node().getBBox(); // Add the entity to the graph
|
||||
|
||||
@ -66458,6 +66484,7 @@ var elementString = function elementString(str) {
|
||||
|
||||
var draw = function draw(text, id) {
|
||||
_parser_requirementDiagram__WEBPACK_IMPORTED_MODULE_6__["parser"].yy = _requirementDb__WEBPACK_IMPORTED_MODULE_7__["default"];
|
||||
_parser_requirementDiagram__WEBPACK_IMPORTED_MODULE_6__["parser"].yy.clear();
|
||||
_parser_requirementDiagram__WEBPACK_IMPORTED_MODULE_6__["parser"].parse(text);
|
||||
var svg = Object(d3__WEBPACK_IMPORTED_MODULE_0__["select"])("[id='".concat(id, "']"));
|
||||
_requirementMarkers__WEBPACK_IMPORTED_MODULE_8__["default"].insertLineEndings(svg, conf);
|
||||
@ -66511,7 +66538,7 @@ var draw = function draw(text, id) {
|
||||
"use strict";
|
||||
__webpack_require__.r(__webpack_exports__);
|
||||
var getStyles = function getStyles(options) {
|
||||
return "\n\n marker {\n fill: ".concat(options.relationColor, ";\n stroke: ").concat(options.relationColor, ";\n }\n\n marker.cross {\n stroke: ").concat(options.lineColor, ";\n }\n\n svg {\n font-family: ").concat(options.fontFamily, ";\n font-size: ").concat(options.fontSize, ";\n }\n\n .reqBox {\n fill: ").concat(options.requirementBackground, ";\n fill-opacity: 100%;\n stroke: ").concat(options.requirementBorderColor, ";\n stroke-size: ").concat(options.requirementBorderSize, ";\n }\n .reqLabelBox {\n fill: ").concat(options.relationLabelBackground, ";\n fill-opacity: 100%;\n }\n\n .req-title-line {\n stroke: ").concat(options.requirementBorderColor, ";\n stroke-width: 1;\n }\n .relationshipLine {\n stroke: ").concat(options.relationColor, ";\n stroke-width: 1;\n }\n .relationshipLabel {\n fill: ").concat(options.relationLabelColor, ";\n }\n\n");
|
||||
return "\n\n marker {\n fill: ".concat(options.relationColor, ";\n stroke: ").concat(options.relationColor, ";\n }\n\n marker.cross {\n stroke: ").concat(options.lineColor, ";\n }\n\n svg {\n font-family: ").concat(options.fontFamily, ";\n font-size: ").concat(options.fontSize, ";\n }\n\n .reqBox {\n fill: ").concat(options.requirementBackground, ";\n fill-opacity: 100%;\n stroke: ").concat(options.requirementBorderColor, ";\n stroke-width: ").concat(options.requirementBorderSize, ";\n }\n \n .reqTitle, .reqLabel{\n fill: ").concat(options.requirementTextColor, ";\n }\n .reqLabelBox {\n fill: ").concat(options.relationLabelBackground, ";\n fill-opacity: 100%;\n }\n\n .req-title-line {\n stroke: ").concat(options.requirementBorderColor, ";\n stroke-width: ").concat(options.requirementBorderSize, ";\n }\n .relationshipLine {\n stroke: ").concat(options.relationColor, ";\n stroke-width: 1;\n }\n .relationshipLabel {\n fill: ").concat(options.relationLabelColor, ";\n }\n\n");
|
||||
}; // fill', conf.rect_fill)
|
||||
|
||||
|
||||
@ -69342,12 +69369,12 @@ var size = function size() {
|
||||
}
|
||||
*/
|
||||
var parser = (function(){
|
||||
var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,2],$V1=[1,3],$V2=[1,5],$V3=[1,7],$V4=[2,5],$V5=[1,15],$V6=[1,17],$V7=[1,19],$V8=[1,20],$V9=[1,21],$Va=[1,22],$Vb=[1,29],$Vc=[1,23],$Vd=[1,24],$Ve=[1,25],$Vf=[1,26],$Vg=[1,27],$Vh=[1,30],$Vi=[1,33],$Vj=[1,4,5,14,15,17,19,20,22,23,24,25,26,27,37,40],$Vk=[1,4,5,12,13,14,15,17,19,20,22,23,24,25,26,27,37,40],$Vl=[1,4,5,7,14,15,17,19,20,22,23,24,25,26,27,37,40],$Vm=[4,5,14,15,17,19,20,22,23,24,25,26,27,37,40];
|
||||
var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,2],$V1=[1,3],$V2=[1,5],$V3=[1,7],$V4=[2,5],$V5=[1,15],$V6=[1,17],$V7=[1,19],$V8=[1,20],$V9=[1,21],$Va=[1,22],$Vb=[1,30],$Vc=[1,23],$Vd=[1,24],$Ve=[1,25],$Vf=[1,26],$Vg=[1,27],$Vh=[1,32],$Vi=[1,33],$Vj=[1,34],$Vk=[1,35],$Vl=[1,31],$Vm=[1,38],$Vn=[1,4,5,14,15,17,19,20,22,23,24,25,26,27,36,37,38,39,42,45],$Vo=[1,4,5,12,13,14,15,17,19,20,22,23,24,25,26,27,36,37,38,39,42,45],$Vp=[1,4,5,7,14,15,17,19,20,22,23,24,25,26,27,36,37,38,39,42,45],$Vq=[4,5,14,15,17,19,20,22,23,24,25,26,27,36,37,38,39,42,45];
|
||||
var parser = {trace: function trace () { },
|
||||
yy: {},
|
||||
symbols_: {"error":2,"start":3,"SPACE":4,"NL":5,"directive":6,"SD":7,"document":8,"line":9,"statement":10,"idStatement":11,"DESCR":12,"-->":13,"HIDE_EMPTY":14,"scale":15,"WIDTH":16,"COMPOSIT_STATE":17,"STRUCT_START":18,"STRUCT_STOP":19,"STATE_DESCR":20,"AS":21,"ID":22,"FORK":23,"JOIN":24,"CHOICE":25,"CONCURRENT":26,"note":27,"notePosition":28,"NOTE_TEXT":29,"openDirective":30,"typeDirective":31,"closeDirective":32,":":33,"argDirective":34,"eol":35,";":36,"EDGE_STATE":37,"left_of":38,"right_of":39,"open_directive":40,"type_directive":41,"arg_directive":42,"close_directive":43,"$accept":0,"$end":1},
|
||||
terminals_: {2:"error",4:"SPACE",5:"NL",7:"SD",12:"DESCR",13:"-->",14:"HIDE_EMPTY",15:"scale",16:"WIDTH",17:"COMPOSIT_STATE",18:"STRUCT_START",19:"STRUCT_STOP",20:"STATE_DESCR",21:"AS",22:"ID",23:"FORK",24:"JOIN",25:"CHOICE",26:"CONCURRENT",27:"note",29:"NOTE_TEXT",33:":",36:";",37:"EDGE_STATE",38:"left_of",39:"right_of",40:"open_directive",41:"type_directive",42:"arg_directive",43:"close_directive"},
|
||||
productions_: [0,[3,2],[3,2],[3,2],[3,2],[8,0],[8,2],[9,2],[9,1],[9,1],[10,1],[10,2],[10,3],[10,4],[10,1],[10,2],[10,1],[10,4],[10,3],[10,6],[10,1],[10,1],[10,1],[10,1],[10,4],[10,4],[10,1],[6,3],[6,5],[35,1],[35,1],[11,1],[11,1],[28,1],[28,1],[30,1],[31,1],[34,1],[32,1]],
|
||||
symbols_: {"error":2,"start":3,"SPACE":4,"NL":5,"directive":6,"SD":7,"document":8,"line":9,"statement":10,"idStatement":11,"DESCR":12,"-->":13,"HIDE_EMPTY":14,"scale":15,"WIDTH":16,"COMPOSIT_STATE":17,"STRUCT_START":18,"STRUCT_STOP":19,"STATE_DESCR":20,"AS":21,"ID":22,"FORK":23,"JOIN":24,"CHOICE":25,"CONCURRENT":26,"note":27,"notePosition":28,"NOTE_TEXT":29,"direction":30,"openDirective":31,"typeDirective":32,"closeDirective":33,":":34,"argDirective":35,"direction_tb":36,"direction_bt":37,"direction_rl":38,"direction_lr":39,"eol":40,";":41,"EDGE_STATE":42,"left_of":43,"right_of":44,"open_directive":45,"type_directive":46,"arg_directive":47,"close_directive":48,"$accept":0,"$end":1},
|
||||
terminals_: {2:"error",4:"SPACE",5:"NL",7:"SD",12:"DESCR",13:"-->",14:"HIDE_EMPTY",15:"scale",16:"WIDTH",17:"COMPOSIT_STATE",18:"STRUCT_START",19:"STRUCT_STOP",20:"STATE_DESCR",21:"AS",22:"ID",23:"FORK",24:"JOIN",25:"CHOICE",26:"CONCURRENT",27:"note",29:"NOTE_TEXT",34:":",36:"direction_tb",37:"direction_bt",38:"direction_rl",39:"direction_lr",41:";",42:"EDGE_STATE",43:"left_of",44:"right_of",45:"open_directive",46:"type_directive",47:"arg_directive",48:"close_directive"},
|
||||
productions_: [0,[3,2],[3,2],[3,2],[3,2],[8,0],[8,2],[9,2],[9,1],[9,1],[10,1],[10,2],[10,3],[10,4],[10,1],[10,2],[10,1],[10,4],[10,3],[10,6],[10,1],[10,1],[10,1],[10,1],[10,4],[10,4],[10,1],[10,1],[6,3],[6,5],[30,1],[30,1],[30,1],[30,1],[40,1],[40,1],[11,1],[11,1],[28,1],[28,1],[31,1],[32,1],[35,1],[33,1]],
|
||||
performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) {
|
||||
/* this == yyval */
|
||||
|
||||
@ -69393,7 +69420,6 @@ case 13:
|
||||
break;
|
||||
case 17:
|
||||
|
||||
|
||||
/* console.warn('Adding document for state without id ', $$[$0-3]);*/
|
||||
this.$={ stmt: 'state', id: $$[$0-3], type: 'default', description: '', doc: $$[$0-1] }
|
||||
|
||||
@ -69413,7 +69439,7 @@ case 18:
|
||||
break;
|
||||
case 19:
|
||||
|
||||
//console.warn('Adding document for state with id ', $$[$0-3], $$[$0-2]); yy.addDocument($$[$0-3]);
|
||||
// console.warn('Adding document for state with id zxzx', $$[$0-3], $$[$0-2], yy.getDirection()); yy.addDocument($$[$0-3]);
|
||||
this.$={ stmt: 'state', id: $$[$0-3], type: 'default', description: $$[$0-5], doc: $$[$0-1] }
|
||||
|
||||
break;
|
||||
@ -69439,29 +69465,41 @@ case 23:
|
||||
break;
|
||||
case 24:
|
||||
|
||||
/*console.warn('got NOTE, position: ', $$[$0-2].trim(), 'id = ', $$[$0-1].trim(), 'note: ', $$[$0]);*/
|
||||
/* console.warn('got NOTE, position: ', $$[$0-2].trim(), 'id = ', $$[$0-1].trim(), 'note: ', $$[$0]);*/
|
||||
this.$={ stmt: 'state', id: $$[$0-1].trim(), note:{position: $$[$0-2].trim(), text: $$[$0].trim()}};
|
||||
|
||||
break;
|
||||
case 31: case 32:
|
||||
case 30:
|
||||
yy.setDirection('TB');this.$={stmt:'dir', value:'TB'};
|
||||
break;
|
||||
case 31:
|
||||
yy.setDirection('BT');this.$={stmt:'dir', value:'BT'};
|
||||
break;
|
||||
case 32:
|
||||
yy.setDirection('RL'); this.$={stmt:'dir', value:'RL'};
|
||||
break;
|
||||
case 33:
|
||||
yy.setDirection('LR');this.$={stmt:'dir', value:'LR'};
|
||||
break;
|
||||
case 36: case 37:
|
||||
this.$=$$[$0];
|
||||
break;
|
||||
case 35:
|
||||
case 40:
|
||||
yy.parseDirective('%%{', 'open_directive');
|
||||
break;
|
||||
case 36:
|
||||
case 41:
|
||||
yy.parseDirective($$[$0], 'type_directive');
|
||||
break;
|
||||
case 37:
|
||||
case 42:
|
||||
$$[$0] = $$[$0].trim().replace(/'/g, '"'); yy.parseDirective($$[$0], 'arg_directive');
|
||||
break;
|
||||
case 38:
|
||||
case 43:
|
||||
yy.parseDirective('}%%', 'close_directive', 'state');
|
||||
break;
|
||||
}
|
||||
},
|
||||
table: [{3:1,4:$V0,5:$V1,6:4,7:$V2,30:6,40:$V3},{1:[3]},{3:8,4:$V0,5:$V1,6:4,7:$V2,30:6,40:$V3},{3:9,4:$V0,5:$V1,6:4,7:$V2,30:6,40:$V3},{3:10,4:$V0,5:$V1,6:4,7:$V2,30:6,40:$V3},o([1,4,5,14,15,17,20,22,23,24,25,26,27,37,40],$V4,{8:11}),{31:12,41:[1,13]},{41:[2,35]},{1:[2,1]},{1:[2,2]},{1:[2,3]},{1:[2,4],4:$V5,5:$V6,6:28,9:14,10:16,11:18,14:$V7,15:$V8,17:$V9,20:$Va,22:$Vb,23:$Vc,24:$Vd,25:$Ve,26:$Vf,27:$Vg,30:6,37:$Vh,40:$V3},{32:31,33:[1,32],43:$Vi},o([33,43],[2,36]),o($Vj,[2,6]),{6:28,10:34,11:18,14:$V7,15:$V8,17:$V9,20:$Va,22:$Vb,23:$Vc,24:$Vd,25:$Ve,26:$Vf,27:$Vg,30:6,37:$Vh,40:$V3},o($Vj,[2,8]),o($Vj,[2,9]),o($Vj,[2,10],{12:[1,35],13:[1,36]}),o($Vj,[2,14]),{16:[1,37]},o($Vj,[2,16],{18:[1,38]}),{21:[1,39]},o($Vj,[2,20]),o($Vj,[2,21]),o($Vj,[2,22]),o($Vj,[2,23]),{28:40,29:[1,41],38:[1,42],39:[1,43]},o($Vj,[2,26]),o($Vk,[2,31]),o($Vk,[2,32]),o($Vl,[2,27]),{34:44,42:[1,45]},o($Vl,[2,38]),o($Vj,[2,7]),o($Vj,[2,11]),{11:46,22:$Vb,37:$Vh},o($Vj,[2,15]),o($Vm,$V4,{8:47}),{22:[1,48]},{22:[1,49]},{21:[1,50]},{22:[2,33]},{22:[2,34]},{32:51,43:$Vi},{43:[2,37]},o($Vj,[2,12],{12:[1,52]}),{4:$V5,5:$V6,6:28,9:14,10:16,11:18,14:$V7,15:$V8,17:$V9,19:[1,53],20:$Va,22:$Vb,23:$Vc,24:$Vd,25:$Ve,26:$Vf,27:$Vg,30:6,37:$Vh,40:$V3},o($Vj,[2,18],{18:[1,54]}),{29:[1,55]},{22:[1,56]},o($Vl,[2,28]),o($Vj,[2,13]),o($Vj,[2,17]),o($Vm,$V4,{8:57}),o($Vj,[2,24]),o($Vj,[2,25]),{4:$V5,5:$V6,6:28,9:14,10:16,11:18,14:$V7,15:$V8,17:$V9,19:[1,58],20:$Va,22:$Vb,23:$Vc,24:$Vd,25:$Ve,26:$Vf,27:$Vg,30:6,37:$Vh,40:$V3},o($Vj,[2,19])],
|
||||
defaultActions: {7:[2,35],8:[2,1],9:[2,2],10:[2,3],42:[2,33],43:[2,34],45:[2,37]},
|
||||
table: [{3:1,4:$V0,5:$V1,6:4,7:$V2,31:6,45:$V3},{1:[3]},{3:8,4:$V0,5:$V1,6:4,7:$V2,31:6,45:$V3},{3:9,4:$V0,5:$V1,6:4,7:$V2,31:6,45:$V3},{3:10,4:$V0,5:$V1,6:4,7:$V2,31:6,45:$V3},o([1,4,5,14,15,17,20,22,23,24,25,26,27,36,37,38,39,42,45],$V4,{8:11}),{32:12,46:[1,13]},{46:[2,40]},{1:[2,1]},{1:[2,2]},{1:[2,3]},{1:[2,4],4:$V5,5:$V6,6:28,9:14,10:16,11:18,14:$V7,15:$V8,17:$V9,20:$Va,22:$Vb,23:$Vc,24:$Vd,25:$Ve,26:$Vf,27:$Vg,30:29,31:6,36:$Vh,37:$Vi,38:$Vj,39:$Vk,42:$Vl,45:$V3},{33:36,34:[1,37],48:$Vm},o([34,48],[2,41]),o($Vn,[2,6]),{6:28,10:39,11:18,14:$V7,15:$V8,17:$V9,20:$Va,22:$Vb,23:$Vc,24:$Vd,25:$Ve,26:$Vf,27:$Vg,30:29,31:6,36:$Vh,37:$Vi,38:$Vj,39:$Vk,42:$Vl,45:$V3},o($Vn,[2,8]),o($Vn,[2,9]),o($Vn,[2,10],{12:[1,40],13:[1,41]}),o($Vn,[2,14]),{16:[1,42]},o($Vn,[2,16],{18:[1,43]}),{21:[1,44]},o($Vn,[2,20]),o($Vn,[2,21]),o($Vn,[2,22]),o($Vn,[2,23]),{28:45,29:[1,46],43:[1,47],44:[1,48]},o($Vn,[2,26]),o($Vn,[2,27]),o($Vo,[2,36]),o($Vo,[2,37]),o($Vn,[2,30]),o($Vn,[2,31]),o($Vn,[2,32]),o($Vn,[2,33]),o($Vp,[2,28]),{35:49,47:[1,50]},o($Vp,[2,43]),o($Vn,[2,7]),o($Vn,[2,11]),{11:51,22:$Vb,42:$Vl},o($Vn,[2,15]),o($Vq,$V4,{8:52}),{22:[1,53]},{22:[1,54]},{21:[1,55]},{22:[2,38]},{22:[2,39]},{33:56,48:$Vm},{48:[2,42]},o($Vn,[2,12],{12:[1,57]}),{4:$V5,5:$V6,6:28,9:14,10:16,11:18,14:$V7,15:$V8,17:$V9,19:[1,58],20:$Va,22:$Vb,23:$Vc,24:$Vd,25:$Ve,26:$Vf,27:$Vg,30:29,31:6,36:$Vh,37:$Vi,38:$Vj,39:$Vk,42:$Vl,45:$V3},o($Vn,[2,18],{18:[1,59]}),{29:[1,60]},{22:[1,61]},o($Vp,[2,29]),o($Vn,[2,13]),o($Vn,[2,17]),o($Vq,$V4,{8:62}),o($Vn,[2,24]),o($Vn,[2,25]),{4:$V5,5:$V6,6:28,9:14,10:16,11:18,14:$V7,15:$V8,17:$V9,19:[1,63],20:$Va,22:$Vb,23:$Vc,24:$Vd,25:$Ve,26:$Vf,27:$Vg,30:29,31:6,36:$Vh,37:$Vi,38:$Vj,39:$Vk,42:$Vl,45:$V3},o($Vn,[2,19])],
|
||||
defaultActions: {7:[2,40],8:[2,1],9:[2,2],10:[2,3],47:[2,38],48:[2,39],50:[2,42]},
|
||||
parseError: function parseError (str, hash) {
|
||||
if (hash.recoverable) {
|
||||
this.trace(str);
|
||||
@ -69940,116 +69978,132 @@ options: {"case-insensitive":true},
|
||||
performAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) {
|
||||
var YYSTATE=YY_START;
|
||||
switch($avoiding_name_collisions) {
|
||||
case 0: this.begin('open_directive'); return 40;
|
||||
case 0:return 36;
|
||||
break;
|
||||
case 1: this.begin('type_directive'); return 41;
|
||||
case 1:return 37;
|
||||
break;
|
||||
case 2: this.popState(); this.begin('arg_directive'); return 33;
|
||||
case 2:return 38;
|
||||
break;
|
||||
case 3: this.popState(); this.popState(); return 43;
|
||||
case 3:return 39;
|
||||
break;
|
||||
case 4:return 42;
|
||||
case 4: this.begin('open_directive'); return 45;
|
||||
break;
|
||||
case 5:/* skip comments */
|
||||
case 5: this.begin('type_directive'); return 46;
|
||||
break;
|
||||
case 6:/* skip comments */{ console.log('Crap after close'); }
|
||||
case 6: this.popState(); this.begin('arg_directive'); return 34;
|
||||
break;
|
||||
case 7:return 5;
|
||||
case 7: this.popState(); this.popState(); return 48;
|
||||
break;
|
||||
case 8:/* skip all whitespace */
|
||||
case 8:return 47;
|
||||
break;
|
||||
case 9:/* skip same-line whitespace */
|
||||
case 9:/* skip comments */
|
||||
break;
|
||||
case 10:/* skip comments */
|
||||
case 10:/* skip comments */{ /*console.log('Crap after close');*/ }
|
||||
break;
|
||||
case 11:/* skip comments */
|
||||
case 11:return 5;
|
||||
break;
|
||||
case 12: this.pushState('SCALE'); /* console.log('Got scale', yy_.yytext);*/ return 15;
|
||||
case 12:/* skip all whitespace */
|
||||
break;
|
||||
case 13:return 16;
|
||||
case 13:/* skip same-line whitespace */
|
||||
break;
|
||||
case 14:this.popState();
|
||||
case 14:/* skip comments */
|
||||
break;
|
||||
case 15: console.log('Starting STATE');this.pushState('STATE');
|
||||
case 15:/* skip comments */
|
||||
break;
|
||||
case 16:this.popState();yy_.yytext=yy_.yytext.slice(0,-8).trim(); /*console.warn('Fork Fork: ',yy_.yytext);*/return 23;
|
||||
case 16: this.pushState('SCALE'); /* console.log('Got scale', yy_.yytext);*/ return 15;
|
||||
break;
|
||||
case 17:this.popState();yy_.yytext=yy_.yytext.slice(0,-8).trim();/*console.warn('Fork Join: ',yy_.yytext);*/return 24;
|
||||
case 17:return 16;
|
||||
break;
|
||||
case 18:this.popState();yy_.yytext=yy_.yytext.slice(0,-10).trim();/*console.warn('Fork Join: ',yy_.yytext);*/return 25;
|
||||
case 18:this.popState();
|
||||
break;
|
||||
case 19:this.popState();yy_.yytext=yy_.yytext.slice(0,-8).trim();/*console.warn('Fork Fork: ',yy_.yytext);*/return 23;
|
||||
case 19: /*console.log('Starting STATE zxzx'+yy.getDirection());*/this.pushState('STATE');
|
||||
break;
|
||||
case 20:this.popState();yy_.yytext=yy_.yytext.slice(0,-8).trim();/*console.warn('Fork Join: ',yy_.yytext);*/return 24;
|
||||
case 20:this.popState();yy_.yytext=yy_.yytext.slice(0,-8).trim(); /*console.warn('Fork Fork: ',yy_.yytext);*/return 23;
|
||||
break;
|
||||
case 21:this.popState();yy_.yytext=yy_.yytext.slice(0,-10).trim();/*console.warn('Fork Join: ',yy_.yytext);*/return 25;
|
||||
case 21:this.popState();yy_.yytext=yy_.yytext.slice(0,-8).trim();/*console.warn('Fork Join: ',yy_.yytext);*/return 24;
|
||||
break;
|
||||
case 22: console.log('Starting STATE_STRING');this.begin("STATE_STRING");
|
||||
case 22:this.popState();yy_.yytext=yy_.yytext.slice(0,-10).trim();/*console.warn('Fork Join: ',yy_.yytext);*/return 25;
|
||||
break;
|
||||
case 23:this.popState();this.pushState('STATE_ID');return "AS";
|
||||
case 23:this.popState();yy_.yytext=yy_.yytext.slice(0,-8).trim();/*console.warn('Fork Fork: ',yy_.yytext);*/return 23;
|
||||
break;
|
||||
case 24:this.popState();/* console.log('STATE_ID', yy_.yytext);*/return "ID";
|
||||
case 24:this.popState();yy_.yytext=yy_.yytext.slice(0,-8).trim();/*console.warn('Fork Join: ',yy_.yytext);*/return 24;
|
||||
break;
|
||||
case 25:this.popState();
|
||||
case 25:this.popState();yy_.yytext=yy_.yytext.slice(0,-10).trim();/*console.warn('Fork Join: ',yy_.yytext);*/return 25;
|
||||
break;
|
||||
case 26: console.log('Long description:', yy_.yytext);return "STATE_DESCR";
|
||||
case 26: return 36;
|
||||
break;
|
||||
case 27:/*console.log('COMPOSIT_STATE', yy_.yytext);*/return 17;
|
||||
case 27: return 37;
|
||||
break;
|
||||
case 28:this.popState();
|
||||
case 28: return 38;
|
||||
break;
|
||||
case 29:this.popState();this.pushState('struct'); /*console.log('begin struct', yy_.yytext);*/return 18;
|
||||
case 29: return 39;
|
||||
break;
|
||||
case 30: /*console.log('Ending struct');*/ this.popState(); return 19;
|
||||
case 30: /*console.log('Starting STATE_STRING zxzx');*/this.begin("STATE_STRING");
|
||||
break;
|
||||
case 31:/* nothing */
|
||||
case 31:this.popState();this.pushState('STATE_ID');return "AS";
|
||||
break;
|
||||
case 32: this.begin('NOTE'); return 27;
|
||||
case 32:this.popState();/* console.log('STATE_ID', yy_.yytext);*/return "ID";
|
||||
break;
|
||||
case 33: this.popState();this.pushState('NOTE_ID');return 38;
|
||||
case 33:this.popState();
|
||||
break;
|
||||
case 34: this.popState();this.pushState('NOTE_ID');return 39;
|
||||
case 34: /*console.log('Long description:', yy_.yytext);*/return "STATE_DESCR";
|
||||
break;
|
||||
case 35: this.popState();this.pushState('FLOATING_NOTE');
|
||||
case 35:/*console.log('COMPOSIT_STATE', yy_.yytext);*/return 17;
|
||||
break;
|
||||
case 36:this.popState();this.pushState('FLOATING_NOTE_ID');return "AS";
|
||||
case 36:this.popState();
|
||||
break;
|
||||
case 37:/**/
|
||||
case 37:this.popState();this.pushState('struct'); /*console.log('begin struct', yy_.yytext);*/return 18;
|
||||
break;
|
||||
case 38: /*console.log('Floating note text: ', yy_.yytext);*/return "NOTE_TEXT";
|
||||
case 38: /*console.log('Ending struct');*/ this.popState(); return 19;
|
||||
break;
|
||||
case 39:this.popState();/*console.log('Floating note ID', yy_.yytext);*/return "ID";
|
||||
case 39:/* nothing */
|
||||
break;
|
||||
case 40: this.popState();this.pushState('NOTE_TEXT');/*console.log('Got ID for note', yy_.yytext);*/return 22;
|
||||
case 40: this.begin('NOTE'); return 27;
|
||||
break;
|
||||
case 41: this.popState();/*console.log('Got NOTE_TEXT for note',yy_.yytext);*/yy_.yytext = yy_.yytext.substr(2).trim();return 29;
|
||||
case 41: this.popState();this.pushState('NOTE_ID');return 43;
|
||||
break;
|
||||
case 42: this.popState();/*console.log('Got NOTE_TEXT for note',yy_.yytext);*/yy_.yytext = yy_.yytext.slice(0,-8).trim();return 29;
|
||||
case 42: this.popState();this.pushState('NOTE_ID');return 44;
|
||||
break;
|
||||
case 43: /*console.log('Got state diagram', yy_.yytext,'#');*/return 7;
|
||||
case 43: this.popState();this.pushState('FLOATING_NOTE');
|
||||
break;
|
||||
case 44: /*console.log('Got state diagram', yy_.yytext,'#');*/return 7;
|
||||
case 44:this.popState();this.pushState('FLOATING_NOTE_ID');return "AS";
|
||||
break;
|
||||
case 45: /*console.log('HIDE_EMPTY', yy_.yytext,'#');*/return 14;
|
||||
case 45:/**/
|
||||
break;
|
||||
case 46: /*console.log('EDGE_STATE=',yy_.yytext);*/ return 37;
|
||||
case 46: /*console.log('Floating note text: ', yy_.yytext);*/return "NOTE_TEXT";
|
||||
break;
|
||||
case 47: /*console.log('=>ID=',yy_.yytext);*/ return 22;
|
||||
case 47:this.popState();/*console.log('Floating note ID', yy_.yytext);*/return "ID";
|
||||
break;
|
||||
case 48: yy_.yytext = yy_.yytext.trim(); /*console.log('Descr = ', yy_.yytext);*/ return 12;
|
||||
case 48: this.popState();this.pushState('NOTE_TEXT');/*console.log('Got ID for note', yy_.yytext);*/return 22;
|
||||
break;
|
||||
case 49:return 13;
|
||||
case 49: this.popState();/*console.log('Got NOTE_TEXT for note',yy_.yytext);*/yy_.yytext = yy_.yytext.substr(2).trim();return 29;
|
||||
break;
|
||||
case 50:return 26;
|
||||
case 50: this.popState();/*console.log('Got NOTE_TEXT for note',yy_.yytext);*/yy_.yytext = yy_.yytext.slice(0,-8).trim();return 29;
|
||||
break;
|
||||
case 51:return 5;
|
||||
case 51: /*console.log('Got state diagram', yy_.yytext,'#');*/return 7;
|
||||
break;
|
||||
case 52:return 'INVALID';
|
||||
case 52: /*console.log('Got state diagram', yy_.yytext,'#');*/return 7;
|
||||
break;
|
||||
case 53: /*console.log('HIDE_EMPTY', yy_.yytext,'#');*/return 14;
|
||||
break;
|
||||
case 54: /*console.log('EDGE_STATE=',yy_.yytext);*/ return 42;
|
||||
break;
|
||||
case 55: /*console.log('=>ID=',yy_.yytext);*/ return 22;
|
||||
break;
|
||||
case 56: yy_.yytext = yy_.yytext.trim(); /*console.log('Descr = ', yy_.yytext);*/ return 12;
|
||||
break;
|
||||
case 57:return 13;
|
||||
break;
|
||||
case 58:return 26;
|
||||
break;
|
||||
case 59:return 5;
|
||||
break;
|
||||
case 60:return 'INVALID';
|
||||
break;
|
||||
}
|
||||
},
|
||||
rules: [/^(?:%%\{)/i,/^(?:((?:(?!\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\}%%)/i,/^(?:((?:(?!\}%%).|\n)*))/i,/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:state\s+)/i,/^(?:.*<<fork>>)/i,/^(?:.*<<join>>)/i,/^(?:.*<<choice>>)/i,/^(?:.*\[\[fork\]\])/i,/^(?:.*\[\[join\]\])/i,/^(?:.*\[\[choice\]\])/i,/^(?:["])/i,/^(?:\s*as\s+)/i,/^(?:[^\n\{]*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n\s\{]+)/i,/^(?:\n)/i,/^(?:\{)/i,/^(?:\})/i,/^(?:[\n])/i,/^(?:note\s+)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:")/i,/^(?:\s*as\s*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n]*)/i,/^(?:\s*[^:\n\s\-]+)/i,/^(?:\s*:[^:\n;]+)/i,/^(?:[\s\S]*?end note\b)/i,/^(?:stateDiagram\s+)/i,/^(?:stateDiagram-v2\s+)/i,/^(?:hide empty description\b)/i,/^(?:\[\*\])/i,/^(?:[^:\n\s\-\{]+)/i,/^(?:\s*:[^:\n;]+)/i,/^(?:-->)/i,/^(?:--)/i,/^(?:$)/i,/^(?:.)/i],
|
||||
conditions: {"LINE":{"rules":[9,10],"inclusive":false},"close_directive":{"rules":[9,10],"inclusive":false},"arg_directive":{"rules":[3,4,9,10],"inclusive":false},"type_directive":{"rules":[2,3,9,10],"inclusive":false},"open_directive":{"rules":[1,9,10],"inclusive":false},"struct":{"rules":[9,10,15,30,31,32,46,47,48,49,50],"inclusive":false},"FLOATING_NOTE_ID":{"rules":[39],"inclusive":false},"FLOATING_NOTE":{"rules":[36,37,38],"inclusive":false},"NOTE_TEXT":{"rules":[41,42],"inclusive":false},"NOTE_ID":{"rules":[40],"inclusive":false},"NOTE":{"rules":[33,34,35],"inclusive":false},"SCALE":{"rules":[13,14],"inclusive":false},"ALIAS":{"rules":[],"inclusive":false},"STATE_ID":{"rules":[24],"inclusive":false},"STATE_STRING":{"rules":[25,26],"inclusive":false},"FORK_STATE":{"rules":[],"inclusive":false},"STATE":{"rules":[9,10,16,17,18,19,20,21,22,23,27,28,29],"inclusive":false},"ID":{"rules":[9,10],"inclusive":false},"INITIAL":{"rules":[0,5,6,7,8,10,11,12,15,29,32,43,44,45,46,47,48,49,51,52],"inclusive":true}}
|
||||
rules: [/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:%%\{)/i,/^(?:((?:(?!\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\}%%)/i,/^(?:((?:(?!\}%%).|\n)*))/i,/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:state\s+)/i,/^(?:.*<<fork>>)/i,/^(?:.*<<join>>)/i,/^(?:.*<<choice>>)/i,/^(?:.*\[\[fork\]\])/i,/^(?:.*\[\[join\]\])/i,/^(?:.*\[\[choice\]\])/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:["])/i,/^(?:\s*as\s+)/i,/^(?:[^\n\{]*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n\s\{]+)/i,/^(?:\n)/i,/^(?:\{)/i,/^(?:\})/i,/^(?:[\n])/i,/^(?:note\s+)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:")/i,/^(?:\s*as\s*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n]*)/i,/^(?:\s*[^:\n\s\-]+)/i,/^(?:\s*:[^:\n;]+)/i,/^(?:[\s\S]*?end note\b)/i,/^(?:stateDiagram\s+)/i,/^(?:stateDiagram-v2\s+)/i,/^(?:hide empty description\b)/i,/^(?:\[\*\])/i,/^(?:[^:\n\s\-\{]+)/i,/^(?:\s*:[^:\n;]+)/i,/^(?:-->)/i,/^(?:--)/i,/^(?:$)/i,/^(?:.)/i],
|
||||
conditions: {"LINE":{"rules":[13,14],"inclusive":false},"close_directive":{"rules":[13,14],"inclusive":false},"arg_directive":{"rules":[7,8,13,14],"inclusive":false},"type_directive":{"rules":[6,7,13,14],"inclusive":false},"open_directive":{"rules":[5,13,14],"inclusive":false},"struct":{"rules":[13,14,19,26,27,28,29,38,39,40,54,55,56,57,58],"inclusive":false},"FLOATING_NOTE_ID":{"rules":[47],"inclusive":false},"FLOATING_NOTE":{"rules":[44,45,46],"inclusive":false},"NOTE_TEXT":{"rules":[49,50],"inclusive":false},"NOTE_ID":{"rules":[48],"inclusive":false},"NOTE":{"rules":[41,42,43],"inclusive":false},"SCALE":{"rules":[17,18],"inclusive":false},"ALIAS":{"rules":[],"inclusive":false},"STATE_ID":{"rules":[32],"inclusive":false},"STATE_STRING":{"rules":[33,34],"inclusive":false},"FORK_STATE":{"rules":[],"inclusive":false},"STATE":{"rules":[13,14,20,21,22,23,24,25,30,31,35,36,37],"inclusive":false},"ID":{"rules":[13,14],"inclusive":false},"INITIAL":{"rules":[0,1,2,3,4,9,10,11,12,14,15,16,19,37,40,51,52,53,54,55,56,57,59,60],"inclusive":true}}
|
||||
});
|
||||
return lexer;
|
||||
})();
|
||||
@ -70617,7 +70671,7 @@ var getRootDocV2 = function getRootDocV2() {
|
||||
return {
|
||||
id: 'root',
|
||||
doc: rootDoc
|
||||
};
|
||||
}; // Here
|
||||
};
|
||||
|
||||
var extract = function extract(_doc) {
|
||||
@ -70789,8 +70843,14 @@ var getClasses = function getClasses() {
|
||||
return classes;
|
||||
};
|
||||
|
||||
var direction = 'TB';
|
||||
|
||||
var getDirection = function getDirection() {
|
||||
return 'TB';
|
||||
return direction;
|
||||
};
|
||||
|
||||
var setDirection = function setDirection(dir) {
|
||||
direction = dir;
|
||||
};
|
||||
|
||||
var relationType = {
|
||||
@ -70818,6 +70878,7 @@ var trimColon = function trimColon(str) {
|
||||
getDirection: getDirection,
|
||||
addRelation: addRelation,
|
||||
getDividerId: getDividerId,
|
||||
setDirection: setDirection,
|
||||
// addDescription,
|
||||
cleanupLabel: cleanupLabel,
|
||||
lineType: lineType,
|
||||
@ -70940,8 +71001,9 @@ var setupNode = function setupNode(g, parent, node, altFlag) {
|
||||
|
||||
|
||||
if (!nodeDb[node.id].type && node.doc) {
|
||||
_logger__WEBPACK_IMPORTED_MODULE_6__["log"].info('Setting cluser for ', node.id);
|
||||
_logger__WEBPACK_IMPORTED_MODULE_6__["log"].info('Setting cluster for ', node.id, getDir(node));
|
||||
nodeDb[node.id].type = 'group';
|
||||
nodeDb[node.id].dir = getDir(node);
|
||||
nodeDb[node.id].shape = node.type === 'divider' ? 'divider' : 'roundedWithTitle';
|
||||
nodeDb[node.id].classes = nodeDb[node.id].classes + ' ' + (altFlag ? 'statediagram-cluster statediagram-cluster-alt' : 'statediagram-cluster');
|
||||
}
|
||||
@ -70958,7 +71020,7 @@ var setupNode = function setupNode(g, parent, node, altFlag) {
|
||||
style: '',
|
||||
//styles.style,
|
||||
id: node.id,
|
||||
dir: altFlag ? 'LR' : 'TB',
|
||||
dir: nodeDb[node.id].dir,
|
||||
domId: 'state-' + node.id + '-' + cnt,
|
||||
type: nodeDb[node.id].type,
|
||||
padding: 15 //getConfig().flowchart.padding
|
||||
@ -70975,7 +71037,7 @@ var setupNode = function setupNode(g, parent, node, altFlag) {
|
||||
//classStr,
|
||||
style: '',
|
||||
//styles.style,
|
||||
id: node.id + '----note',
|
||||
id: node.id + '----note-' + cnt,
|
||||
domId: 'state-' + node.id + '----note-' + cnt,
|
||||
type: nodeDb[node.id].type,
|
||||
padding: 15 //getConfig().flowchart.padding
|
||||
@ -71069,6 +71131,22 @@ var setupDoc = function setupDoc(g, parent, doc, altFlag) {
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
var getDir = function getDir(nodes, defaultDir) {
|
||||
var dir = defaultDir || 'TB';
|
||||
|
||||
if (nodes.doc) {
|
||||
for (var i = 0; i < nodes.doc.length; i++) {
|
||||
var node = nodes.doc[i];
|
||||
|
||||
if (node.stmt === 'dir') {
|
||||
dir = node.value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return dir;
|
||||
};
|
||||
/**
|
||||
* Draws a flowchart in the tag with id: id based on the graph definition in text.
|
||||
* @param text
|
||||
@ -71093,13 +71171,16 @@ var draw = function draw(text, id) {
|
||||
|
||||
var conf = Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state;
|
||||
var nodeSpacing = conf.nodeSpacing || 50;
|
||||
var rankSpacing = conf.rankSpacing || 50; // Create the input mermaid.graph
|
||||
var rankSpacing = conf.rankSpacing || 50;
|
||||
_logger__WEBPACK_IMPORTED_MODULE_6__["log"].info(_stateDb__WEBPACK_IMPORTED_MODULE_2__["default"].getRootDocV2());
|
||||
_stateDb__WEBPACK_IMPORTED_MODULE_2__["default"].extract(_stateDb__WEBPACK_IMPORTED_MODULE_2__["default"].getRootDocV2());
|
||||
_logger__WEBPACK_IMPORTED_MODULE_6__["log"].info(_stateDb__WEBPACK_IMPORTED_MODULE_2__["default"].getRootDocV2()); // Create the input mermaid.graph
|
||||
|
||||
var g = new graphlib__WEBPACK_IMPORTED_MODULE_0___default.a.Graph({
|
||||
multigraph: true,
|
||||
compound: true
|
||||
}).setGraph({
|
||||
rankdir: 'TB',
|
||||
rankdir: getDir(_stateDb__WEBPACK_IMPORTED_MODULE_2__["default"].getRootDocV2()),
|
||||
nodesep: nodeSpacing,
|
||||
ranksep: rankSpacing,
|
||||
marginx: 8,
|
||||
@ -71107,9 +71188,6 @@ var draw = function draw(text, id) {
|
||||
}).setDefaultEdgeLabel(function () {
|
||||
return {};
|
||||
});
|
||||
_logger__WEBPACK_IMPORTED_MODULE_6__["log"].info(_stateDb__WEBPACK_IMPORTED_MODULE_2__["default"].getRootDocV2());
|
||||
_stateDb__WEBPACK_IMPORTED_MODULE_2__["default"].extract(_stateDb__WEBPACK_IMPORTED_MODULE_2__["default"].getRootDocV2());
|
||||
_logger__WEBPACK_IMPORTED_MODULE_6__["log"].info(_stateDb__WEBPACK_IMPORTED_MODULE_2__["default"].getRootDocV2());
|
||||
setupNode(g, undefined, _stateDb__WEBPACK_IMPORTED_MODULE_2__["default"].getRootDocV2(), true); // Set up an SVG group so that we can translate the final graph.
|
||||
|
||||
var svg = Object(d3__WEBPACK_IMPORTED_MODULE_1__["select"])("[id=\"".concat(id, "\"]")); // Run the renderer. This is what draws the final graph.
|
||||
@ -71438,7 +71516,7 @@ var renderDoc = function renderDoc(doc, diagram, parentId, altBkg) {
|
||||
"use strict";
|
||||
__webpack_require__.r(__webpack_exports__);
|
||||
var getStyles = function getStyles(options) {
|
||||
return "\ndefs #statediagram-barbEnd {\n fill: ".concat(options.transitionColor, ";\n stroke: ").concat(options.transitionColor, ";\n }\ng.stateGroup text {\n fill: ").concat(options.nodeBorder, ";\n stroke: none;\n font-size: 10px;\n}\ng.stateGroup text {\n fill: ").concat(options.textColor, ";\n stroke: none;\n font-size: 10px;\n\n}\ng.stateGroup .state-title {\n font-weight: bolder;\n fill: ").concat(options.stateLabelColor, ";\n}\n\ng.stateGroup rect {\n fill: ").concat(options.mainBkg, ";\n stroke: ").concat(options.nodeBorder, ";\n}\n\ng.stateGroup line {\n stroke: ").concat(options.lineColor, ";\n stroke-width: 1;\n}\n\n.transition {\n stroke: ").concat(options.transitionColor, ";\n stroke-width: 1;\n fill: none;\n}\n\n.stateGroup .composit {\n fill: ").concat(options.background, ";\n border-bottom: 1px\n}\n\n.stateGroup .alt-composit {\n fill: #e0e0e0;\n border-bottom: 1px\n}\n\n.state-note {\n stroke: ").concat(options.noteBorderColor, ";\n fill: ").concat(options.noteBkgColor, ";\n\n text {\n fill: ").concat(options.noteTextColor, ";\n stroke: none;\n font-size: 10px;\n }\n}\n\n.stateLabel .box {\n stroke: none;\n stroke-width: 0;\n fill: ").concat(options.mainBkg, ";\n opacity: 0.5;\n}\n\n.edgeLabel .label rect {\n fill: ").concat(options.labelBackgroundColor, ";\n opacity: 0.5;\n}\n.edgeLabel .label text {\n fill: ").concat(options.transitionLabelColor || options.tertiaryTextColor, ";\n}\n.label div .edgeLabel {\n color: ").concat(options.transitionLabelColor || options.tertiaryTextColor, ";\n}\n\n.stateLabel text {\n fill: ").concat(options.stateLabelColor, ";\n font-size: 10px;\n font-weight: bold;\n}\n\n.node circle.state-start {\n fill: ").concat(options.lineColor, ";\n stroke: black;\n}\n.node circle.state-end {\n fill: ").concat(options.primaryBorderColor, ";\n stroke: ").concat(options.background, ";\n stroke-width: 1.5\n}\n.end-state-inner {\n fill: ").concat(options.compositeBackground || options.background, ";\n // stroke: ").concat(options.background, ";\n stroke-width: 1.5\n}\n\n.node rect {\n fill: ").concat(options.stateBkg || options.mainBkg, ";\n stroke: ").concat(options.stateBorder || options.nodeBorder, ";\n stroke-width: 1px;\n}\n.node polygon {\n fill: ").concat(options.mainBkg, ";\n stroke: ").concat(options.nodeBorder, ";\n stroke-width: 1px;\n}\n#statediagram-barbEnd {\n fill: ").concat(options.lineColor, ";\n}\n\n.statediagram-cluster rect {\n fill: ").concat(options.compositeTitleBackground, ";\n stroke: ").concat(options.stateBorder || options.nodeBorder, ";\n stroke-width: 1px;\n}\n\n.cluster-label, .nodeLabel {\n color: ").concat(options.stateLabelColor, ";\n}\n\n.statediagram-cluster rect.outer {\n rx: 5px;\n ry: 5px;\n}\n.statediagram-state .divider {\n stroke: ").concat(options.stateBorder || options.nodeBorder, ";\n}\n\n.statediagram-state .title-state {\n rx: 5px;\n ry: 5px;\n}\n.statediagram-cluster.statediagram-cluster .inner {\n fill: ").concat(options.compositeBackground || options.background, ";\n}\n.statediagram-cluster.statediagram-cluster-alt .inner {\n fill: ").concat(options.altBackground ? options.altBackground : '#efefef', ";\n}\n\n.statediagram-cluster .inner {\n rx:0;\n ry:0;\n}\n\n.statediagram-state rect.basic {\n rx: 5px;\n ry: 5px;\n}\n.statediagram-state rect.divider {\n stroke-dasharray: 10,10;\n fill: ").concat(options.altBackground ? options.altBackground : '#efefef', ";\n}\n\n.note-edge {\n stroke-dasharray: 5;\n}\n\n.statediagram-note rect {\n fill: ").concat(options.noteBkgColor, ";\n stroke: ").concat(options.noteBorderColor, ";\n stroke-width: 1px;\n rx: 0;\n ry: 0;\n}\n.statediagram-note rect {\n fill: ").concat(options.noteBkgColor, ";\n stroke: ").concat(options.noteBorderColor, ";\n stroke-width: 1px;\n rx: 0;\n ry: 0;\n}\n\n.statediagram-note text {\n fill: ").concat(options.noteTextColor, ";\n}\n\n.statediagram-note .nodeLabel {\n color: ").concat(options.noteTextColor, ";\n}\n.statediagram .edgeLabel {\n color: red; // ").concat(options.noteTextColor, ";\n}\n\n#dependencyStart, #dependencyEnd {\n fill: ").concat(options.lineColor, ";\n stroke: ").concat(options.lineColor, ";\n stroke-width: 1;\n}\n");
|
||||
return "\ndefs #statediagram-barbEnd {\n fill: ".concat(options.transitionColor, ";\n stroke: ").concat(options.transitionColor, ";\n }\ng.stateGroup text {\n fill: ").concat(options.nodeBorder, ";\n stroke: none;\n font-size: 10px;\n}\ng.stateGroup text {\n fill: ").concat(options.textColor, ";\n stroke: none;\n font-size: 10px;\n\n}\ng.stateGroup .state-title {\n font-weight: bolder;\n fill: ").concat(options.stateLabelColor, ";\n}\n\ng.stateGroup rect {\n fill: ").concat(options.mainBkg, ";\n stroke: ").concat(options.nodeBorder, ";\n}\n\ng.stateGroup line {\n stroke: ").concat(options.lineColor, ";\n stroke-width: 1;\n}\n\n.transition {\n stroke: ").concat(options.transitionColor, ";\n stroke-width: 1;\n fill: none;\n}\n\n.stateGroup .composit {\n fill: ").concat(options.background, ";\n border-bottom: 1px\n}\n\n.stateGroup .alt-composit {\n fill: #e0e0e0;\n border-bottom: 1px\n}\n\n.state-note {\n stroke: ").concat(options.noteBorderColor, ";\n fill: ").concat(options.noteBkgColor, ";\n\n text {\n fill: ").concat(options.noteTextColor, ";\n stroke: none;\n font-size: 10px;\n }\n}\n\n.stateLabel .box {\n stroke: none;\n stroke-width: 0;\n fill: ").concat(options.mainBkg, ";\n opacity: 0.5;\n}\n\n.edgeLabel .label rect {\n fill: ").concat(options.labelBackgroundColor, ";\n opacity: 0.5;\n}\n.edgeLabel .label text {\n fill: ").concat(options.transitionLabelColor || options.tertiaryTextColor, ";\n}\n.label div .edgeLabel {\n color: ").concat(options.transitionLabelColor || options.tertiaryTextColor, ";\n}\n\n.stateLabel text {\n fill: ").concat(options.stateLabelColor, ";\n font-size: 10px;\n font-weight: bold;\n}\n\n.node circle.state-start {\n fill: ").concat(options.lineColor, ";\n stroke: black;\n}\n.node circle.state-end {\n fill: ").concat(options.primaryBorderColor, ";\n stroke: ").concat(options.background, ";\n stroke-width: 1.5\n}\n.end-state-inner {\n fill: ").concat(options.compositeBackground || options.background, ";\n // stroke: ").concat(options.background, ";\n stroke-width: 1.5\n}\n\n.node rect {\n fill: ").concat(options.stateBkg || options.mainBkg, ";\n stroke: ").concat(options.stateBorder || options.nodeBorder, ";\n stroke-width: 1px;\n}\n.node polygon {\n fill: ").concat(options.mainBkg, ";\n stroke: ").concat(options.stateBorder || options.nodeBorder, ";;\n stroke-width: 1px;\n}\n#statediagram-barbEnd {\n fill: ").concat(options.lineColor, ";\n}\n\n.statediagram-cluster rect {\n fill: ").concat(options.compositeTitleBackground, ";\n stroke: ").concat(options.stateBorder || options.nodeBorder, ";\n stroke-width: 1px;\n}\n\n.cluster-label, .nodeLabel {\n color: ").concat(options.stateLabelColor, ";\n}\n\n.statediagram-cluster rect.outer {\n rx: 5px;\n ry: 5px;\n}\n.statediagram-state .divider {\n stroke: ").concat(options.stateBorder || options.nodeBorder, ";\n}\n\n.statediagram-state .title-state {\n rx: 5px;\n ry: 5px;\n}\n.statediagram-cluster.statediagram-cluster .inner {\n fill: ").concat(options.compositeBackground || options.background, ";\n}\n.statediagram-cluster.statediagram-cluster-alt .inner {\n fill: ").concat(options.altBackground ? options.altBackground : '#efefef', ";\n}\n\n.statediagram-cluster .inner {\n rx:0;\n ry:0;\n}\n\n.statediagram-state rect.basic {\n rx: 5px;\n ry: 5px;\n}\n.statediagram-state rect.divider {\n stroke-dasharray: 10,10;\n fill: ").concat(options.altBackground ? options.altBackground : '#efefef', ";\n}\n\n.note-edge {\n stroke-dasharray: 5;\n}\n\n.statediagram-note rect {\n fill: ").concat(options.noteBkgColor, ";\n stroke: ").concat(options.noteBorderColor, ";\n stroke-width: 1px;\n rx: 0;\n ry: 0;\n}\n.statediagram-note rect {\n fill: ").concat(options.noteBkgColor, ";\n stroke: ").concat(options.noteBorderColor, ";\n stroke-width: 1px;\n rx: 0;\n ry: 0;\n}\n\n.statediagram-note text {\n fill: ").concat(options.noteTextColor, ";\n}\n\n.statediagram-note .nodeLabel {\n color: ").concat(options.noteTextColor, ";\n}\n.statediagram .edgeLabel {\n color: red; // ").concat(options.noteTextColor, ";\n}\n\n#dependencyStart, #dependencyEnd {\n fill: ").concat(options.lineColor, ";\n stroke: ").concat(options.lineColor, ";\n stroke-width: 1;\n}\n");
|
||||
};
|
||||
|
||||
/* harmony default export */ __webpack_exports__["default"] = (getStyles);
|
||||
@ -73432,7 +73510,6 @@ function parse(text) {
|
||||
|
||||
case 'requirement':
|
||||
case 'requirementDiagram':
|
||||
console.log('RequirementDiagram');
|
||||
_logger__WEBPACK_IMPORTED_MODULE_41__["log"].debug('RequirementDiagram');
|
||||
parser = _diagrams_requirement_parser_requirementDiagram__WEBPACK_IMPORTED_MODULE_27___default.a;
|
||||
parser.parser.yy = _diagrams_requirement_requirementDb__WEBPACK_IMPORTED_MODULE_28__["default"];
|
||||
@ -74303,6 +74380,15 @@ function () {
|
||||
h: 120,
|
||||
l: -10
|
||||
});
|
||||
this.pieTitleTextSize = this.pieTitleTextSize || '25px';
|
||||
this.pieTitleTextColor = this.pieTitleTextColor || this.taskTextDarkColor;
|
||||
this.pieSectionTextSize = this.pieSectionTextSize || '17px';
|
||||
this.pieSectionTextColor = this.pieSectionTextColor || this.textColor;
|
||||
this.pieLegendTextSize = this.pieLegendTextSize || '17px';
|
||||
this.pieLegendTextColor = this.pieLegendTextColor || this.taskTextDarkColor;
|
||||
this.pieStrokeColor = this.pieStrokeColor || 'black';
|
||||
this.pieStrokeWidth = this.pieStrokeWidth || '2px';
|
||||
this.pieOpacity = this.pieOpacity || '0.7';
|
||||
/* requirement-diagram */
|
||||
|
||||
this.requirementBackground = this.requirementBackground || this.primaryColor;
|
||||
@ -74534,18 +74620,6 @@ function () {
|
||||
h: 128
|
||||
});
|
||||
/* pie */
|
||||
// this.pie1 = this.pie1 || this.primaryColor;
|
||||
// this.pie2 = this.pie2 || this.secondaryColor;
|
||||
// this.pie3 = this.pie3 || this.tertiaryColor;
|
||||
// this.pie4 = this.pie4 || adjust(this.primaryColor, { l: -10 });
|
||||
// this.pie5 = this.pie5 || adjust(this.secondaryColor, { l: -10 });
|
||||
// this.pie6 = this.pie6 || adjust(this.tertiaryColor, { l: -10 });
|
||||
// this.pie7 = this.pie7 || adjust(this.primaryColor, { h: +60, l: -10 });
|
||||
// this.pie8 = this.pie8 || adjust(this.primaryColor, { h: -60, l: -10 });
|
||||
// this.pie9 = this.pie9 || adjust(this.primaryColor, { h: 120, l: 0 });
|
||||
// this.pie10 = this.pie10 || adjust(this.primaryColor, { h: +60, l: -20 });
|
||||
// this.pie11 = this.pie11 || adjust(this.primaryColor, { h: -60, l: -20 });
|
||||
// this.pie12 = this.pie12 || adjust(this.primaryColor, { h: 120, l: -10 });
|
||||
|
||||
this.pie1 = this.pie1 || '#0b0000';
|
||||
this.pie2 = this.pie2 || '#4d1037';
|
||||
@ -74559,6 +74633,15 @@ function () {
|
||||
this.pie10 = this.pie10 || '#00296f';
|
||||
this.pie11 = this.pie11 || '#01629c';
|
||||
this.pie12 = this.pie12 || '#010029';
|
||||
this.pieTitleTextSize = this.pieTitleTextSize || '25px';
|
||||
this.pieTitleTextColor = this.pieTitleTextColor || this.taskTextDarkColor;
|
||||
this.pieSectionTextSize = this.pieSectionTextSize || '17px';
|
||||
this.pieSectionTextColor = this.pieSectionTextColor || this.textColor;
|
||||
this.pieLegendTextSize = this.pieLegendTextSize || '17px';
|
||||
this.pieLegendTextColor = this.pieLegendTextColor || this.taskTextDarkColor;
|
||||
this.pieStrokeColor = this.pieStrokeColor || 'black';
|
||||
this.pieStrokeWidth = this.pieStrokeWidth || '2px';
|
||||
this.pieOpacity = this.pieOpacity || '0.7';
|
||||
/* class */
|
||||
|
||||
this.classText = this.primaryTextColor;
|
||||
@ -74849,6 +74932,15 @@ function () {
|
||||
h: 120,
|
||||
l: -30
|
||||
});
|
||||
this.pieTitleTextSize = this.pieTitleTextSize || '25px';
|
||||
this.pieTitleTextColor = this.pieTitleTextColor || this.taskTextDarkColor;
|
||||
this.pieSectionTextSize = this.pieSectionTextSize || '17px';
|
||||
this.pieSectionTextColor = this.pieSectionTextColor || this.textColor;
|
||||
this.pieLegendTextSize = this.pieLegendTextSize || '17px';
|
||||
this.pieLegendTextColor = this.pieLegendTextColor || this.taskTextDarkColor;
|
||||
this.pieStrokeColor = this.pieStrokeColor || 'black';
|
||||
this.pieStrokeWidth = this.pieStrokeWidth || '2px';
|
||||
this.pieOpacity = this.pieOpacity || '0.7';
|
||||
/* requirement-diagram */
|
||||
|
||||
this.requirementBackground = this.requirementBackground || this.primaryColor;
|
||||
@ -75104,6 +75196,15 @@ function () {
|
||||
h: 120,
|
||||
l: -50
|
||||
});
|
||||
this.pieTitleTextSize = this.pieTitleTextSize || '25px';
|
||||
this.pieTitleTextColor = this.pieTitleTextColor || this.taskTextDarkColor;
|
||||
this.pieSectionTextSize = this.pieSectionTextSize || '17px';
|
||||
this.pieSectionTextColor = this.pieSectionTextColor || this.textColor;
|
||||
this.pieLegendTextSize = this.pieLegendTextSize || '17px';
|
||||
this.pieLegendTextColor = this.pieLegendTextColor || this.taskTextDarkColor;
|
||||
this.pieStrokeColor = this.pieStrokeColor || 'black';
|
||||
this.pieStrokeWidth = this.pieStrokeWidth || '2px';
|
||||
this.pieOpacity = this.pieOpacity || '0.7';
|
||||
/* requirement-diagram */
|
||||
|
||||
this.requirementBackground = this.requirementBackground || this.primaryColor;
|
||||
@ -75385,7 +75486,16 @@ function () {
|
||||
this.pie9 = this.pie9 || '#BBB';
|
||||
this.pie10 = this.pie10 || '#999';
|
||||
this.pie11 = this.pie11 || '#777';
|
||||
this.pie12 = this.pie12 || '#555'; // this.pie1 = this.pie1 || '#212529';
|
||||
this.pie12 = this.pie12 || '#555';
|
||||
this.pieTitleTextSize = this.pieTitleTextSize || '25px';
|
||||
this.pieTitleTextColor = this.pieTitleTextColor || this.taskTextDarkColor;
|
||||
this.pieSectionTextSize = this.pieSectionTextSize || '17px';
|
||||
this.pieSectionTextColor = this.pieSectionTextColor || this.textColor;
|
||||
this.pieLegendTextSize = this.pieLegendTextSize || '17px';
|
||||
this.pieLegendTextColor = this.pieLegendTextColor || this.taskTextDarkColor;
|
||||
this.pieStrokeColor = this.pieStrokeColor || 'black';
|
||||
this.pieStrokeWidth = this.pieStrokeWidth || '2px';
|
||||
this.pieOpacity = this.pieOpacity || '0.7'; // this.pie1 = this.pie1 || '#212529';
|
||||
// this.pie2 = this.pie2 || '#343A40';
|
||||
// this.pie3 = this.pie3 || '#495057';
|
||||
// this.pie4 = this.pie4 || '#6C757D';
|
||||
|
2
dist/mermaid.js.map
vendored
2
dist/mermaid.js.map
vendored
File diff suppressed because one or more lines are too long
10
dist/mermaid.min.js
vendored
10
dist/mermaid.min.js
vendored
File diff suppressed because one or more lines are too long
2
dist/mermaid.min.js.map
vendored
2
dist/mermaid.min.js.map
vendored
File diff suppressed because one or more lines are too long
@ -1,19 +1,27 @@
|
||||
# Configuration
|
||||
|
||||
Configuration is the second half of Mermaid for one or for many diagrams.
|
||||
Configuration is the second half of Mermaid, after deployment. Together Deployment and Configuration constitute the whole of Mermaid.
|
||||
|
||||
This section will briefly introduce the different methods of configuring of the behaviors and apperances of Mermaid Diagrams.
|
||||
The Following are the most commonly used methods, and are all tied to the [Deployment](./n00b-gettingStarted.md) methods.
|
||||
This section will introduce the different methods of configuring of the behaviors and apperances of Mermaid Diagrams.
|
||||
The Following are the most commonly used methods, and are all tied to Mermaid [Deployment](./n00b-gettingStarted.md) methods.
|
||||
|
||||
## Configuration Section in the [Live Editor](./Live-Editor.md).
|
||||
|
||||
|
||||
## The `initialize()` call, for when Mermaid is called via an API, or through a <script> tag.
|
||||
|
||||
|
||||
## [Directives](./directives.md),
|
||||
|
||||
allows the limited reconfiguration of a diagram just before it is rendered. It can alter the font style, color and other aesthetic aspects of the diagram. you can pass a directive alongside your defintion inside `%%{ }%%`, either above or below your diagram defintion.
|
||||
|
||||
## Theme Creation:
|
||||
An application of using Directives to change [Themes](./theming.md). `Theme` is an value within mermaid's configuration that dictates the color scheme for diagrams.
|
||||
|
||||
|
||||
If you are interested in altering and customizing your Mermaid Diagrams, you will find the methods and values available for [Configuration](./Setup.md) here. It includes themes
|
||||
|
||||
1. Configuration Section in the [Live Editor](./Live-Editor.md).
|
||||
|
||||
|
||||
2. The [Initialize call](), for when Mermaid is called via an API, or through a <script> tag.
|
||||
|
||||
|
||||
3. [Directives](./directives.md), these are perhaps the most accessible of all, as they can be used by the
|
||||
|
||||
a. [Themes](./theming.md) are set up using `%%{init}%%` Directives and happen to be the fastest way of changing
|
||||
|
||||
|
||||
If you are interested in altering and customizing your Mermaid Diagrams, this list of [Configurations](./Setup.md) would be helpful.
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
This is list of publicly available Tutorials for using Mermaid.JS . This is intended as a basic introduction for the use of the Live Editor for generating diagrams, and deploying Mermaid.JS through HTML.
|
||||
|
||||
**Note that these tutorials might display an older interface, but the usage of the live-editor will largely be the same.
|
||||
**Note that these tutorials might display an older interface, but the usage of the live-editor will largely be the same.**
|
||||
|
||||
For most purposes, you can use the [Live Editor](https://mermaid-js.github.io/mermaid-live-editor), to quickly and easily render a diagram.
|
||||
|
||||
@ -10,6 +10,8 @@ For most purposes, you can use the [Live Editor](https://mermaid-js.github.io/me
|
||||
## Live-Editor Tutorials
|
||||
The definitions that can be generated the Live-Editor are also backwards-compatible as of version 8.7.0.
|
||||
|
||||
[Chris Chinchilla: Hands on - Text-based diagrams with Mermaid](https://www.youtube.com/watch?v=4_LdV1cs2sA)
|
||||
|
||||
[GitLab Unfiltered: How to Create Mermaid Diagrams](https://www.youtube.com/watch?v=SQ9QmuTHuSI&t=438s)
|
||||
|
||||
[GitLab Unfiltered: Emilie adds a mermaid diagram to the handbook](https://www.youtube.com/watch?v=5RQqht3NNSE)
|
||||
|
@ -1,12 +1,10 @@
|
||||
- Introduction 📔
|
||||
|
||||
- [About mermaid](README.md)
|
||||
- [Simple start to write diagrams](n00b-gettingStarted.md)
|
||||
- [Overview for Beginners](n00b-overview.md)
|
||||
- [About Mermaid](README.md)
|
||||
- [Deployment](n00b-gettingStarted.md)
|
||||
- [Syntax and Configuration](n00b-syntaxReference.md)
|
||||
|
||||
- Diagram Syntax 📊
|
||||
|
||||
- [Diagram syntax intro](n00b-syntaxReference.md)
|
||||
- [Flowchart](flowchart.md)
|
||||
- [Sequence diagram](sequenceDiagram.md)
|
||||
- [Class Diagram](classDiagram.md)
|
||||
@ -18,7 +16,7 @@
|
||||
- [Requirement Diagram](requirementDiagram.md)
|
||||
- [Other Examples](examples.md)
|
||||
|
||||
- Deployment and Configuration⚙️
|
||||
- Deployment and Configuration ⚙️
|
||||
|
||||
- [Tutorials](Tutorials.md)
|
||||
- [API-Usage](usage.md)
|
||||
@ -33,7 +31,7 @@
|
||||
- [FAQ](faq.md)
|
||||
|
||||
- Contributions and Community 🙌
|
||||
|
||||
- [Overview for Beginners](n00b-overview.md)
|
||||
- [Development and Contribution ](development.md)
|
||||
- [Changelog](CHANGELOG.md)
|
||||
- [Adding Diagrams ](newDiagram.md)
|
||||
|
@ -2,6 +2,41 @@
|
||||
|
||||
**Edit this Page** [![N|Solid](img/GitHub-Mark-32px.png)](https://github.com/mermaid-js/mermaid/blob/develop/docs/flowchart.md)
|
||||
|
||||
All Flowcharts are composed of **nodes**, the geometric shapes and **edges**, the arrows or lines. The mermaid code defines the way that these **nodes** and **edges** are made and interact.
|
||||
|
||||
It can also accomodate different arrow types, multi directional arrows, and linking to and from subgraphs.
|
||||
|
||||
> **Important note**: Do not type the word "end" as a Flowchart node. Capitalize all or any one the letters to keep the flowchart from breaking, i.e, "End" or "END". Or you can apply this [workaround](https://github.com/mermaid-js/mermaid/issues/1444#issuecomment-639528897).**
|
||||
Node
|
||||
### A node (default)
|
||||
|
||||
```
|
||||
graph LR
|
||||
id
|
||||
```
|
||||
|
||||
```mermaid
|
||||
graph LR
|
||||
id
|
||||
```
|
||||
|
||||
> **Note** The id is what is displayed in the box.
|
||||
|
||||
### A node with text
|
||||
|
||||
It is also possible to set text in the box that differs from the id. If this is done several times, it is the last text
|
||||
found for the node that will be used. Also if you define edges for the node later on, you can omit text definitions. The
|
||||
one previously defined will be used when rendering the box.
|
||||
|
||||
```
|
||||
graph LR
|
||||
id1[This is the text in the box]
|
||||
```
|
||||
```mermaid
|
||||
graph LR
|
||||
id1[This is the text in the box]
|
||||
```
|
||||
|
||||
## Graph
|
||||
|
||||
This statement declares the direction of the Flowchart.
|
||||
@ -38,48 +73,7 @@ Possible FlowChart orientations are:
|
||||
* RL - right to left
|
||||
* LR - left to right
|
||||
|
||||
|
||||
|
||||
## Flowcharts
|
||||
|
||||
This renders a flowchart that allows for features such as: more arrow types, multi directional arrows, and linking to and from subgraphs.
|
||||
|
||||
Apart from the graph type, the syntax is the same. This is currently experimental but when the beta period is over, both the graph and flowchart keywords will render in the new way. This means it is ok to start beta testing flowcharts.
|
||||
|
||||
> **Important note** Do not type the word "end" as a Flowchart node. Capitalize all or any one the letters to keep the flowchart from breaking, i.e, "End" or "END". Or you can apply this [workaround](https://github.com/mermaid-js/mermaid/issues/1444#issuecomment-639528897).**
|
||||
|
||||
## Nodes & shapes
|
||||
|
||||
### A node (default)
|
||||
|
||||
```
|
||||
graph LR
|
||||
id
|
||||
```
|
||||
|
||||
```mermaid
|
||||
graph LR
|
||||
id
|
||||
```
|
||||
|
||||
> **Note** The id is what is displayed in the box.
|
||||
|
||||
### A node with text
|
||||
|
||||
It is also possible to set text in the box that differs from the id. If this is done several times, it is the last text
|
||||
found for the node that will be used. Also if you define edges for the node later on, you can omit text definitions. The
|
||||
one previously defined will be used when rendering the box.
|
||||
|
||||
```
|
||||
graph LR
|
||||
id1[This is the text in the box]
|
||||
```
|
||||
```mermaid
|
||||
graph LR
|
||||
id1[This is the text in the box]
|
||||
```
|
||||
|
||||
## Node Shapes
|
||||
## Node shapes
|
||||
|
||||
### A node with round edges
|
||||
|
||||
|
BIN
docs/img/Code-Preview-Config.png
Normal file
BIN
docs/img/Code-Preview-Config.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 49 KiB |
BIN
docs/img/Editing-process.png
Normal file
BIN
docs/img/Editing-process.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 20 KiB |
BIN
docs/img/EditingHistory+Links.png
Normal file
BIN
docs/img/EditingHistory+Links.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 33 KiB |
@ -7,7 +7,7 @@
|
||||
<meta name="description" content="Markdownish syntax for generating flowcharts, sequence diagrams, class diagrams, gantt charts and git graphs.">
|
||||
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
|
||||
<!-- <link rel="stylesheet" href="//unpkg.com/docsify/lib/themes/vue.css"> -->
|
||||
<link rel="stylesheet" href="theme.css"> <script src="//cdn.jsdelivr.net/npm/mermaid@8.9.1/dist/mermaid.min.js"></script>
|
||||
<link rel="stylesheet" href="theme.css"> <script src="//cdn.jsdelivr.net/npm/mermaid@8.10.1/dist/mermaid.min.js"></script>
|
||||
<!-- <script src="http://localhost:9000/mermaid.js"></script> -->
|
||||
<script>
|
||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||
|
@ -127,18 +127,24 @@ They also serve as proof of concept, for the variety of things that can be built
|
||||
- [typedoc-plugin-mermaid](https://www.npmjs.com/package/typedoc-plugin-mermaid)
|
||||
- [Docsy Hugo Theme](https://www.docsy.dev/docs/adding-content/lookandfeel/#diagrams-with-mermaid) (Native support in theme)
|
||||
|
||||
## Chrome Extensions
|
||||
## Browser Extensions
|
||||
|
||||
## Browser Extensions
|
||||
| Name | Chrome Web Store | Firefox Add-ons | Opera | Edge | Source/Repository |
|
||||
| -- | -- | -- | -- | -- | -- |
|
||||
| GitHub + Mermaid | [🎡🔗](https://chrome.google.com/webstore/detail/github-%20-mermaid/goiiopgdnkogdbjmncgedmgpoajilohe) | [🦊🔗](https://addons.mozilla.org/firefox/addon/github-mermaid/) | - | - | [🐙🔗](https://github.com/BackMarket/github-mermaid-extension)
|
||||
| Asciidoctor Live Preview | [🎡🔗](https://chrome.google.com/webstore/detail/asciidoctorjs-live-previe/iaalpfgpbocpdfblpnhhgllgbdbchmia) | - | - | [🌀🔗](https://microsoftedge.microsoft.com/addons/detail/asciidoctorjs-live-previ/pefkelkanablhjdekgdahplkccnbdggd?hl=en-US) | -|
|
||||
| Diagram Tab| -| - | - | - | [🐙🔗](https://github.com/khafast/diagramtab) |
|
||||
| Markdown Diagrams| - | [🦊🔗](https://addons.mozilla.org/en-US/firefox/addon/markdown-diagrams/) | [🔴🔗](https://addons.opera.com/en/extensions/details/markdown-diagrams/) | [🌀🔗](https://microsoftedge.microsoft.com/addons/detail/markdown-diagrams/hceenoomhhdkjjijnmlclkpenkapfihe) | [🐙🔗](https://github.com/marcozaccari/markdown-diagrams-browser-extension/tree/master/doc/examples) |
|
||||
| Markdown Viewer| - | [🦊🔗](https://addons.mozilla.org/en-US/firefox/addon/markdown-viewer-chrome/) | - | - | [🐙🔗](https://github.com/simov/markdown-viewer)|
|
||||
| Extensions for Mermaid| - | [🦊🔗](https://addons.mozilla.org/en-US/firefox/addon/markdown-viewer-chrome/) | [🔴🔗](https://addons.opera.com/en/extensions/details/extensions-for-mermaid/)| - | [🐙🔗](https://github.com/Stefan-S/mermaid-extension) |
|
||||
| Chrome Diagrammer| [🎡🔗](https://chrome.google.com/webstore/detail/chrome-diagrammer/bkpbgjmkomfoakfklcjeoegkklgjnnpk) | - |- | - | - |
|
||||
| Mermaid Diagrams | [🎡🔗](https://chrome.google.com/webstore/detail/mermaid-diagrams/phfcghedmopjadpojhmmaffjmfiakfil) | - | - | - | - |
|
||||
|Mermaid Markdown | [🎡🔗](https://chrome.google.com/webstore/detail/mermaid-markdown/mboeoikjijmjcjgpccghbcoegikliijg) | - | - | - | - |
|
||||
| Monkeys | [🎡🔗](https://chrome.google.com/webstore/detail/monkeys-mermaid-for-githu/cplfdpoajbclbgphaphphcldamfkjlgi) | - | - | - | - |
|
||||
|
||||
- [Mermaid Diagrams](https://chrome.google.com/webstore/detail/mermaid-diagrams/phfcghedmopjadpojhmmaffjmfiakfil)
|
||||
- [GitHub + Mermaid](https://chrome.google.com/webstore/detail/github-%2B-mermaid/goiiopgdnkogdbjmncgedmgpoajilohe)
|
||||
- [Mermaid Markdown](https://chrome.google.com/webstore/detail/mermaid-markdown/mboeoikjijmjcjgpccghbcoegikliijg)
|
||||
- [Monkeys](https://chrome.google.com/webstore/detail/monkeys-mermaid-for-githu/cplfdpoajbclbgphaphphcldamfkjlgi)
|
||||
- [Asciidoctor Live Preview](https://chrome.google.com/webstore/detail/asciidoctorjs-live-previe/iaalpfgpbocpdfblpnhhgllgbdbchmia) __works in the new IE as well__
|
||||
- [Chrome Diagrammer](https://chrome.google.com/webstore/detail/chrome-diagrammer/bkpbgjmkomfoakfklcjeoegkklgjnnpk)
|
||||
- [Diagram Tab](https://github.com/khafast/diagramtab)
|
||||
|
||||
## Other
|
||||
|
||||
- [Jekyll](https://jekyllrb.com/)
|
||||
- [jekyll-mermaid](https://rubygems.org/gems/jekyll-mermaid)
|
||||
- [jekyll-mermaid-diagrams](https://github.com/fuzhibo/jekyll-mermaid-diagrams)
|
||||
|
@ -1,17 +1,17 @@
|
||||
# A Mermaid User-Guide for Beginners
|
||||
Mermaid is composed of three parts, Deployment, Syntax and Configuration.
|
||||
|
||||
Creating diagrams and charts using mermaid code is simple.
|
||||
This section talks about the different ways to deploy Mermaid. Learning the [Syntax](./n00b-syntaxReference.md) ahead of time would be more helpful to the beginner.
|
||||
|
||||
>Generally the live editor is enough for most general uses of mermaid, and is a good place to start learning.
|
||||
|
||||
>The live editor is enough for most general uses of mermaid
|
||||
**Absolute beginners are recommended to view the Video [Tutorials](./Tutorials.md) on the Live Editor, to gain a better understanding of mermaid.**
|
||||
|
||||
|
||||
## Four ways of using mermaid:
|
||||
1. Using the mermaid [Live Editor](https://mermaid-js.github.io/mermaid-live-editor/).
|
||||
- Learning the [Syntax](./n00b-syntaxReference) would be helpful.
|
||||
1. Using the mermaid [Live Editor](https://mermaid-js.github.io/mermaid-live-editor/).
|
||||
2. Using [mermaid plugins](./integrations.md) with programs you are familiar with.
|
||||
3. Hosting mermaid on a webpage, with an absolute link.
|
||||
4. Downloading mermaid and hosting it on your Web Page.
|
||||
3. Calling the Mermaid Javascript API.
|
||||
4. Deploying Mermaid as a dependency.
|
||||
|
||||
**Note: It is our recommendation that you review all approaches, and choose the one that is best for your project.**
|
||||
|
||||
@ -19,22 +19,24 @@ Creating diagrams and charts using mermaid code is simple.
|
||||
|
||||
## 1. Using [The Live Editor](https://mermaidjs.github.io/mermaid-live-editor).
|
||||
|
||||
![Flowchart](./img/Live-Editor-Usage.png)
|
||||
![EditingProcess](./img/Editing-process.png )
|
||||
|
||||
In the `Code` section one can write or edit raw mermaid code, and instantly `Preview` the rendered result on the panel beside it.
|
||||
In the `Code` section one can write or edit raw mermaid code, and instantly `Preview` the rendered result on the panel beside it.
|
||||
|
||||
![Flowchart](./img/DiagramDefinition.png)
|
||||
The `Configuration` Section is for changing the appearance and behavior of mermaid diagrams. An easy introduction to mermaid configuration is found in the [Advanced usage](./n00b-advanced.md) section. A complete configuration reference cataloguing default values is found on the [mermaidAPI](Setup.md) page.
|
||||
|
||||
**Saving a Diagram:**
|
||||
|
||||
![Code,Config and Preview](./img/Code-Preview-Config.png)
|
||||
|
||||
### Saving a Diagram:
|
||||
You may choose any of the methods below, to save it
|
||||
|
||||
**We recommend that you save your diagram code on top of any method you choose, in order to make edits and modifications further down the line.**
|
||||
|
||||
![Flowchart](./img/Live-Editor-Choices.png)
|
||||
|
||||
**Configuration**
|
||||
|
||||
*The Mermaid configuration* is for configuring the appearance and behavior of mermaid diagrams. An easy introduction to mermaid configuration is found in the [Advanced usage](./n00b-advanced.md) section. A complete configuration reference cataloguing default values is found on the [mermaidAPI](Setup.md) page.
|
||||
|
||||
![Flowchart](./img/Configuration.png)
|
||||
### Editing your diagrams
|
||||
Editing is as easy as pasting your **Diagram code**, into the `code` section of the `Live Editor`.
|
||||
|
||||
|
||||
## 2. Using Mermaid Plugins:
|
||||
@ -43,27 +45,26 @@ Using plug-ins you can generate mermaid diagrams from within popular application
|
||||
|
||||
**This is covered in greater detail in the [Usage section](usage.md)**
|
||||
|
||||
## 3. Mermaid with Inline JavaScript
|
||||
## 3. Calling the Javascript API
|
||||
|
||||
This method can be used with any common web server. Apache, IIS, nginx, node express [...], you pick your favourite.
|
||||
This method can be used with any common web server. Apache, IIS, nginx, node express, you are free to choose.
|
||||
|
||||
You will need a text editting tool like Notepad++, to generate an html file. It is then deployed by a web browser (such as Firefox, Chrome, Safari, but not Internet Explorer).
|
||||
You will also need a text editting tool like Notepad++, to generate an html file. It is then deployed by a web browser (such as Firefox, Chrome, Safari, but not Internet Explorer).
|
||||
|
||||
Just create an HTML file locally and open it using a desired browser.
|
||||
The API works by pulling rendering instructions from a source from `mermaid.js` to render diagrams in the page.
|
||||
|
||||
### Written in the html `<body>` section of the web page.
|
||||
|
||||
### Requirements for the Mermaid API.
|
||||
|
||||
When writing the html file, we give the web browser three instructions inside the html code:
|
||||
|
||||
a. A reference for fetching the online mermaid renderer, which is written in Javascript.
|
||||
a. A reference for fetching the online mermaid renderer, through the `mermaid.js` or `mermaid.min.js`.
|
||||
|
||||
b. The mermaid code for the diagram we want to create.
|
||||
|
||||
c. The `mermaid.initialize()` call to start the rendering process.
|
||||
c. The `mermaid.initialize()` call, which can dictate the appreance of diagrams and also start the rendering process .
|
||||
|
||||
|
||||
## Requirements for mermaidAPI to render a diagram:
|
||||
|
||||
**a. A reference to the external CDN in a `<script src>` tag, or a reference to mermaid.js as a separate file.:**
|
||||
|
||||
```html
|
||||
@ -89,7 +90,7 @@ c. The `mermaid.initialize()` call to start the rendering process.
|
||||
|
||||
**c. The `mermaid.initialize()` call.**
|
||||
|
||||
`mermaid.initialize()` calls take all the definitions contained in `<div class="mermaid">` tags it can find in the html body and render. Example:
|
||||
`mermaid.initialize()` calls take all the definitions contained in `<div class="mermaid">` tags it can find in the html body and renders them into diagrams. Example:
|
||||
```html
|
||||
<body>
|
||||
<script>mermaid.initialize({startOnLoad:true});</script>
|
||||
@ -105,6 +106,8 @@ Mermaid rendering is initalized with `mermaid.initialize()`.You can place `merma
|
||||
| --------- | --------------- | ------ | ---------------------------------------------------- |
|
||||
|startOnLoad| Toggle for Rendering upon loading | Boolean | true, false |
|
||||
|
||||
### Working Examples
|
||||
|
||||
**Here is a full working example of the mermaidAPI being called through the CDN:**
|
||||
|
||||
```html
|
||||
|
@ -1,33 +1,57 @@
|
||||
## Diagram syntax
|
||||
# Diagram Syntax
|
||||
Mermaid's syntax is used to create diagrams.The next section dives deep into the syntax of each type,
|
||||
|
||||
Syntax, together with Deployment and Configuration constitute the whole of Mermaid.
|
||||
|
||||
Use the next section for reference and the [Mermaid Live Editor](https://mermaid-js.github.io/mermaid-live-editor) as apractice area. Adittionally, the [Getting Started](./n00b-gettingStarted.md) section can also provide some practical examples of mermaid syntax.
|
||||
|
||||
You'll find that Mermaid's Syntax is not too tricky and it can be learned in a day.
|
||||
|
||||
|
||||
## Diagram Breaking
|
||||
|
||||
One should beware the use of some words or symbols that can break diagrams. These words or symbols are few and often only affect specific types of diagrams. The table below will continuously be updated.
|
||||
|
||||
|
||||
| Diagram Breakers | Reason |Solution|
|
||||
| --- | --- |---|
|
||||
| **Comments** | | |
|
||||
|[`%%{``}%%`](https://github.com/mermaid-js/mermaid/issues/1968) | Similar to [Directives](./directives.md) confuses the renderer.|In comments using `%%`, avoid using "{}".|
|
||||
| **Flow-Charts** | | |
|
||||
|'end' | The word "End" can cause Flowcharts and Sequence diagrams to break | Wrap them in quotation marks to prevent breakage.|
|
||||
| [Nodes inside Nodes](https://mermaid-js.github.io/mermaid/#/flowchart?id=special-characters-that-break-syntax)| Mermaid gets confused with nested shapes | wrap them in quotation marks to prevent breaking|
|
||||
|
||||
|
||||
|
||||
### Mermaid Live Editor
|
||||
Now, that you've seen what you should not add to your diagrams, you can play around with them in the [Mermaid Live Editor](https://mermaid-js.github.io/mermaid-live-editor).
|
||||
|
||||
# Configuration
|
||||
|
||||
Configuration is the third part of Mermaid, after deployment and syntax. It deals with the different ways that Mermaid can be customized across different deployments.
|
||||
|
||||
If you are interested in altering and customizing your Mermaid Diagrams, you will find the methods and values available for [Configuration](./Setup.md) here. It includes themes
|
||||
This section will introduce the different methods of configuring of the behaviors and apperances of Mermaid Diagrams.
|
||||
The Following are the most commonly used methods, and are all tied to Mermaid [Deployment](./n00b-gettingStarted.md) methods.
|
||||
|
||||
### Configuration Section in the [Live Editor](./Live-Editor.md).
|
||||
Here you can edit certain values to change the behavior and appearance of the diagram.
|
||||
|
||||
### [The initialize() call](https://mermaid-js.github.io/mermaid/#/n00b-gettingStarted?id=_3-calling-the-javascript-api),
|
||||
Used when Mermaid is called via an API, or through a `<script>` tag.
|
||||
|
||||
|
||||
### [Directives](./directives.md),
|
||||
Allows for the limited reconfiguration of a diagram just before it is rendered. It can alter the font style, color and other aesthetic aspects of the diagram. you can pass a directive alongside your defintion inside `%%{ }%%`, either above or below your diagram defintion.
|
||||
|
||||
### [Theme Manipulation](./theming.md):
|
||||
An application of using Directives to change [Themes](./theming.md). `Theme` is an value within mermaid's configuration that dictates the color scheme for diagrams.
|
||||
|
||||
|
||||
|
||||
If you are new to mermaid, read the [Getting Started](n00b-gettingStarted.md) and [Overview](n00b-overview.md) sections, to learn the basics of mermaid.
|
||||
Video Tutorials can be found at the bottom of the Overview Section.
|
||||
|
||||
Below is a list of diagram types supported by mermaid and how they can be defined.
|
||||
|
||||
## mermaid tag
|
||||
These Diagram Definitions can be entered within a \<div class=mermaid> tag.
|
||||
like so :
|
||||
```html
|
||||
<div class="mermaid">
|
||||
graph LR
|
||||
A --- B
|
||||
B-->C[fa:fa-ban forbidden]
|
||||
B-->D(fa:fa-spinner);
|
||||
</div>
|
||||
```
|
||||
## Mermaid Live Editor
|
||||
You can proofread or render and download your definitions in real-time with the [Mermaid Live Editor](https://mermaid-js.github.io/mermaid-live-editor).
|
||||
This would then offer you the following choices to download the diagram:
|
||||
|
||||
![Flowchart](./img/DownloadChoices.png)
|
||||
|
||||
**Note:** Copying the markdown will allow you to link to your unique diagram from anywhere online.
|
||||
|
||||
## Directives:
|
||||
[Directives](./directives.md) allows the limited reconfiguration of a diagram just before it is rendered. It can alter the font style, color and other aesthetic aspects of the diagram.
|
||||
|
||||
## Theme Creation:
|
||||
Mermaid allows you to change [Themes](./theming.md). This is also done using [Directives](./directives.md).
|
||||
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
**Edit this Page** [![N|Solid](img/GitHub-Mark-32px.png)](https://github.com/mermaid-js/mermaid/blob/develop/docs/requirementDiagram.md)
|
||||
|
||||
> A Requirement diagram provides a visualization for requirements and their connections, to each other and other documented elements. The modeling specs follow those defined by SysML v1.6.
|
||||
> A Requirement diagram provides a visualization for requirements and their connections, to each other and other documented elements. The modeling specs follow those defined by SysML v1.6.
|
||||
|
||||
Rendering requirements is straightforward.
|
||||
|
||||
@ -64,8 +64,8 @@ Type, risk, and method are enumerations defined in SysML.
|
||||
|
||||
| Keyword | Options |
|
||||
| Type | requirement, functionalRequirement, interfaceRequirement, performanceRequirement, physicalRequirement, designConstraint |
|
||||
| Risk | Low, Medium, High |
|
||||
| VerifcationMethod | Analysis, Inspection, Test, Demonstration |
|
||||
| Risk | Low, Medium, High |
|
||||
| VerifcationMethod | Analysis, Inspection, Test, Demonstration |
|
||||
|
||||
### Element
|
||||
An element definition contains an element name, type, and document reference. These three are all user defined. The element feature is intended to be lightweight but allow requirements to be connected to portions of other documents.
|
||||
@ -87,7 +87,7 @@ Each follows the definition format of
|
||||
{name of source} - <type> -> {name of destination}
|
||||
```
|
||||
|
||||
or
|
||||
or
|
||||
|
||||
```
|
||||
{name of destination} <- <type> - {name of source}
|
||||
@ -169,5 +169,5 @@ This example uses all features of the diagram.
|
||||
test_req4 - derives -> test_req5
|
||||
test_req5 - refines -> test_req6
|
||||
test_entity3 - verifies -> test_req5
|
||||
test_req <- copies - test_entity2 </div>
|
||||
test_req <- copies - test_entity2
|
||||
```
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "mermaid",
|
||||
"version": "8.9.2",
|
||||
"version": "8.10.1",
|
||||
"description": "Markdownish syntax for generating flowcharts, sequence diagrams, class diagrams, gantt charts and git graphs.",
|
||||
"main": "dist/mermaid.core.js",
|
||||
"keywords": [
|
||||
|
@ -37,15 +37,22 @@ const rect = (parent, node) => {
|
||||
const padding = 0 * node.padding;
|
||||
const halfPadding = padding / 2;
|
||||
|
||||
const width = node.width <= bbox.width + padding ? bbox.width + padding : node.width;
|
||||
if (node.width <= bbox.width + padding) {
|
||||
node.diff = (bbox.width - node.width) / 2;
|
||||
} else {
|
||||
node.diff = -node.padding / 2;
|
||||
}
|
||||
|
||||
log.trace('Data ', node, JSON.stringify(node));
|
||||
// center the rect around its coordinate
|
||||
rect
|
||||
.attr('style', node.style)
|
||||
.attr('rx', node.rx)
|
||||
.attr('ry', node.ry)
|
||||
.attr('x', node.x - node.width / 2 - halfPadding)
|
||||
.attr('x', node.x - width / 2)
|
||||
.attr('y', node.y - node.height / 2 - halfPadding)
|
||||
.attr('width', node.width + padding)
|
||||
.attr('width', width)
|
||||
.attr('height', node.height + padding);
|
||||
|
||||
// Center the label
|
||||
@ -136,7 +143,12 @@ const roundedWithTitle = (parent, node) => {
|
||||
const padding = 0 * node.padding;
|
||||
const halfPadding = padding / 2;
|
||||
|
||||
const width = node.width > bbox.width ? node.width : bbox.width + node.padding;
|
||||
const width = node.width <= bbox.width + node.padding ? bbox.width + node.padding : node.width;
|
||||
if (node.width <= bbox.width + node.padding) {
|
||||
node.diff = (bbox.width + node.padding - node.width) / 2;
|
||||
} else {
|
||||
node.diff = -node.padding / 2;
|
||||
}
|
||||
|
||||
// center the rect around its coordinate
|
||||
rect
|
||||
@ -163,7 +175,6 @@ const roundedWithTitle = (parent, node) => {
|
||||
);
|
||||
|
||||
const rectBox = rect.node().getBBox();
|
||||
node.width = rectBox.width;
|
||||
node.height = rectBox.height;
|
||||
|
||||
node.intersect = function(point) {
|
||||
@ -227,7 +238,7 @@ export const clear = () => {
|
||||
};
|
||||
|
||||
export const positionCluster = node => {
|
||||
log.info('Position cluster');
|
||||
log.info('Position cluster (' + node.id + ', ' + node.x + ', ' + node.y + ')');
|
||||
const el = clusterElems[node.id];
|
||||
|
||||
el.attr('transform', 'translate(' + node.x + ', ' + node.y + ')');
|
||||
|
@ -50,12 +50,15 @@ const recursiveRender = (_elem, graph, diagramtype, parentCluster) => {
|
||||
log.info('(Insert) Node XXX' + v + ': ' + JSON.stringify(graph.node(v)));
|
||||
if (node && node.clusterNode) {
|
||||
// const children = graph.children(v);
|
||||
log.info('Cluster identified', v, node, graph.node(v));
|
||||
const newEl = recursiveRender(nodes, node.graph, diagramtype, graph.node(v));
|
||||
log.info('Cluster identified', v, node.width, graph.node(v));
|
||||
const o = recursiveRender(nodes, node.graph, diagramtype, graph.node(v));
|
||||
const newEl = o.elem;
|
||||
updateNodeBounds(node, newEl);
|
||||
node.diff = o.diff || 0;
|
||||
log.info('Node bounds (abc123)', v, node, node.width, node.x, node.y);
|
||||
setNodeElem(newEl, node);
|
||||
|
||||
log.warn('Recursive render complete', newEl, node);
|
||||
log.warn('Recursive render complete ', newEl, node);
|
||||
} else {
|
||||
if (graph.children(v).length > 0) {
|
||||
// This is a cluster but not to be rendered recusively
|
||||
@ -95,6 +98,7 @@ const recursiveRender = (_elem, graph, diagramtype, parentCluster) => {
|
||||
dagre.layout(graph);
|
||||
log.info('Graph after layout:', graphlib.json.write(graph));
|
||||
// Move the nodes to the correct place
|
||||
let diff = 0;
|
||||
sortNodesByHierarchy(graph).forEach(function(v) {
|
||||
const node = graph.node(v);
|
||||
log.info('Position ' + v + ': ' + JSON.stringify(graph.node(v)));
|
||||
@ -132,7 +136,14 @@ const recursiveRender = (_elem, graph, diagramtype, parentCluster) => {
|
||||
positionEdgeLabel(edge, paths);
|
||||
});
|
||||
|
||||
return elem;
|
||||
graph.nodes().forEach(function(v) {
|
||||
const n = graph.node(v);
|
||||
log.info(v, n.type, n.diff);
|
||||
if (n.type === 'group') {
|
||||
diff = n.diff;
|
||||
}
|
||||
});
|
||||
return { elem, diff };
|
||||
};
|
||||
|
||||
export const render = (elem, graph, markers, diagramtype, id) => {
|
||||
|
@ -935,15 +935,17 @@ export const positionNode = node => {
|
||||
const el = nodeElems[node.id];
|
||||
log.trace(
|
||||
'Transforming node',
|
||||
node.diff,
|
||||
node,
|
||||
'translate(' + (node.x - node.width / 2 - 5) + ', ' + (node.y - node.height / 2 - 5) + ')'
|
||||
'translate(' + (node.x - node.width / 2 - 5) + ', ' + node.width / 2 + ')'
|
||||
);
|
||||
const padding = 8;
|
||||
const diff = node.diff || 0;
|
||||
if (node.clusterNode) {
|
||||
el.attr(
|
||||
'transform',
|
||||
'translate(' +
|
||||
(node.x - node.width / 2 - padding) +
|
||||
(node.x + diff - node.width / 2) +
|
||||
', ' +
|
||||
(node.y - node.height / 2 - padding) +
|
||||
')'
|
||||
@ -951,4 +953,5 @@ export const positionNode = node => {
|
||||
} else {
|
||||
el.attr('transform', 'translate(' + node.x + ', ' + node.y + ')');
|
||||
}
|
||||
return diff;
|
||||
};
|
||||
|
@ -211,7 +211,6 @@ export const drawReqs = (reqs, graph, svgNode) => {
|
||||
Object.keys(reqs).forEach(reqName => {
|
||||
let req = reqs[reqName];
|
||||
reqName = elementString(reqName);
|
||||
console.log('reqName: ', reqName);
|
||||
log.info('Added new requirement: ', reqName);
|
||||
|
||||
const groupNode = svgNode.append('g').attr('id', reqName);
|
||||
|
@ -71,7 +71,6 @@ export const draw = function(text, id) {
|
||||
|
||||
drawActorLegend(diagram);
|
||||
bounds.insert(0, 0, LEFT_MARGIN, Object.keys(actors).length * 50);
|
||||
console.log(bounds);
|
||||
drawTasks(diagram, tasks, 0);
|
||||
|
||||
const box = bounds.getBounds();
|
||||
|
@ -140,7 +140,6 @@ function parse(text) {
|
||||
break;
|
||||
case 'requirement':
|
||||
case 'requirementDiagram':
|
||||
console.log('RequirementDiagram');
|
||||
log.debug('RequirementDiagram');
|
||||
parser = requirementParser;
|
||||
parser.parser.yy = requirementDb;
|
||||
|
Loading…
x
Reference in New Issue
Block a user