Version 8.13.4 bundles
This commit is contained in:
parent
09cc0d02f4
commit
95df8fa128
|
@ -28,113 +28,13 @@
|
|||
<div>info below</div>
|
||||
<div class="flex flex-wrap">
|
||||
|
||||
<div class="mermaid2" style="width: 100%; height: 20%;">
|
||||
classDiagram
|
||||
direction TB
|
||||
class Student {
|
||||
-idCard : IdCard
|
||||
}
|
||||
class IdCard{
|
||||
-id : int
|
||||
-name : string
|
||||
}
|
||||
class Bike{
|
||||
-id : int
|
||||
-name : string
|
||||
}
|
||||
Student "1" --o "1" IdCard : carries
|
||||
Student "1" --o "1" Bike : rides
|
||||
|
||||
</div>
|
||||
<div class="mermaid3" style="width: 100%; height: 20%;">
|
||||
stateDiagram
|
||||
state CompositeState {
|
||||
YourState123456789012345123456789123456789012345123456789123456789012345123456789123456789012345123456789 --> MyState:a label
|
||||
}
|
||||
|
||||
</div>
|
||||
<div class="mermaid" style="width: 100%; height: 20%;">
|
||||
sequenceDiagram
|
||||
%%{init: {'config': {'wrap': true }}}%%
|
||||
actor Alice as Extremely utterly long line of longness which had preivously overflown the actor box as it is much longer than what it should be
|
||||
actor Bob
|
||||
participant John as John2
|
||||
participant Mandy
|
||||
Alice->>Bob: Hi Bob
|
||||
Bob->>Alice: Hi Alice
|
||||
Alice->>John: Hi John
|
||||
John->>Mandy: Hi Mandy
|
||||
Mandy ->>Joan: Hi Joan
|
||||
|
||||
</div>
|
||||
<div class="mermaid" style="width: 100%; height: 20%;">
|
||||
%%{int: { "apa":"b", "theme":"forest"}}%%
|
||||
sequenceDiagram
|
||||
Alice->>Bob: Hi Bob
|
||||
Bob->>Alice: Hi Alice
|
||||
</div>
|
||||
<div class="mermaid">
|
||||
sequenceDiagram
|
||||
autonumber
|
||||
par Action 1
|
||||
Alice->>John: Hello John, how are you?
|
||||
and Action 2
|
||||
Alice->>Bob: Hello Bob, how are you?
|
||||
end
|
||||
Alice->>+John: Hello John, how are you?
|
||||
Alice->>+John: John, can you hear me?
|
||||
John-->>-Alice: Hi Alice, I can hear you!
|
||||
Note right of John: John is perceptive
|
||||
John-->>-Alice: I feel great!
|
||||
loop Every minute
|
||||
John-->Alice: Great!
|
||||
end
|
||||
</div>
|
||||
<div class="mermaid">
|
||||
sequenceDiagram
|
||||
%%{init: {'config': {'wrap': true }}}%%
|
||||
actor Alice
|
||||
actor Bob
|
||||
Alice->>Bob: Hi Bob
|
||||
Bob->>Alice: Hi Alice
|
||||
</div>
|
||||
<div class="mermaid" style="width: 100%; height: 20%;">
|
||||
%%{init: {'config': {'wrap': true }}}%%
|
||||
sequenceDiagram
|
||||
participant A as Extremely utterly long line of longness which had preivously overflown the actor box as it is much longer than what it should be
|
||||
A->>Bob: Hola
|
||||
Bob-->A: Pasten !
|
||||
</div>
|
||||
<div class="mermaid2" style="width: 100%; height: 20%;">
|
||||
stateDiagram-v2
|
||||
state CS {
|
||||
state ACS {
|
||||
YourState
|
||||
}
|
||||
}
|
||||
</div>
|
||||
<div class="mermaid2" style="width: 100%; height: 20%;">
|
||||
stateDiagram-v2
|
||||
[*] --> Active
|
||||
[*] --> S1
|
||||
state "Some long name" as S1
|
||||
|
||||
state Active {
|
||||
[*] --> NumLockOff
|
||||
NumLockOff --> NumLockOn : EvNumLockPressed
|
||||
NumLockOn --> NumLockOff : EvNumLockPressed
|
||||
--
|
||||
[*] --> CapsLockOff
|
||||
CapsLockOff --> CapsLockOn : EvCapsLockPressed
|
||||
CapsLockOn --> CapsLockOff : EvCapsLockPressed
|
||||
}
|
||||
state SomethingElse {
|
||||
A --> B
|
||||
B --> A
|
||||
}
|
||||
</div>
|
||||
|
||||
Active --> SomethingElse
|
||||
note right of SomethingElse : This is the note to the right.
|
||||
|
||||
SomethingElse --> [*] </div>
|
||||
<script src="./mermaid.js"></script>
|
||||
<script>
|
||||
mermaid.parseError = function (err, hash) {
|
||||
|
|
|
@ -9179,13 +9179,14 @@ __webpack_require__.r(__webpack_exports__);
|
|||
/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3 */ "d3");
|
||||
/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(d3__WEBPACK_IMPORTED_MODULE_0__);
|
||||
/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../logger */ "./src/logger.js");
|
||||
/* harmony import */ var _diagrams_common_common__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../diagrams/common/common */ "./src/diagrams/common/common.js");
|
||||
/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../config */ "./src/config.js");
|
||||
/* harmony import */ var _diagrams_common_common__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../diagrams/common/common */ "./src/diagrams/common/common.js");
|
||||
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
||||
|
||||
|
||||
// eslint-disable-line
|
||||
|
||||
|
||||
// let vertexNode;
|
||||
// if (evaluate(getConfig().flowchart.htmlLabels)) {
|
||||
// // TODO: addHtmlLabel accepts a labelStyle. Do we possibly have that?
|
||||
|
@ -9209,8 +9210,6 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
|||
// vertexNode = svgLabel;
|
||||
// }
|
||||
|
||||
|
||||
|
||||
function applyStyle(dom, styleFn) {
|
||||
if (styleFn) {
|
||||
dom.attr('style', styleFn);
|
||||
|
@ -13208,9 +13207,9 @@ __webpack_require__.r(__webpack_exports__);
|
|||
/* harmony export */ });
|
||||
/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3 */ "d3");
|
||||
/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(d3__WEBPACK_IMPORTED_MODULE_0__);
|
||||
/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../logger */ "./src/logger.js");
|
||||
/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../logger */ "./src/logger.js");
|
||||
/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../config */ "./src/config.js");
|
||||
/* harmony import */ var _common_common__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../common/common */ "./src/diagrams/common/common.js");
|
||||
/* harmony import */ var _common_common__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/common */ "./src/diagrams/common/common.js");
|
||||
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../utils */ "./src/utils.js");
|
||||
/* harmony import */ var _mermaidAPI__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../mermaidAPI */ "./src/mermaidAPI.js");
|
||||
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
||||
|
@ -13247,7 +13246,7 @@ var splitClassNameAndType = function splitClassNameAndType(id) {
|
|||
if (id.indexOf('~') > 0) {
|
||||
var split = id.split('~');
|
||||
className = split[0];
|
||||
genericType = split[1];
|
||||
genericType = _common_common__WEBPACK_IMPORTED_MODULE_2__["default"].sanitizeText(split[1], _config__WEBPACK_IMPORTED_MODULE_3__.getConfig());
|
||||
}
|
||||
|
||||
return {
|
||||
|
@ -13308,7 +13307,7 @@ var getRelations = function getRelations() {
|
|||
return relations;
|
||||
};
|
||||
var addRelation = function addRelation(relation) {
|
||||
_logger__WEBPACK_IMPORTED_MODULE_2__.log.debug('Adding relation: ' + JSON.stringify(relation));
|
||||
_logger__WEBPACK_IMPORTED_MODULE_4__.log.debug('Adding relation: ' + JSON.stringify(relation));
|
||||
addClass(relation.id1);
|
||||
addClass(relation.id2);
|
||||
relation.id1 = splitClassNameAndType(relation.id1).className;
|
||||
|
@ -13396,7 +13395,7 @@ var setTooltip = function setTooltip(ids, tooltip) {
|
|||
var config = _config__WEBPACK_IMPORTED_MODULE_3__.getConfig();
|
||||
ids.split(',').forEach(function (id) {
|
||||
if (typeof tooltip !== 'undefined') {
|
||||
classes[id].tooltip = _common_common__WEBPACK_IMPORTED_MODULE_4__["default"].sanitizeText(tooltip, config);
|
||||
classes[id].tooltip = _common_common__WEBPACK_IMPORTED_MODULE_2__["default"].sanitizeText(tooltip, config);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
@ -14662,6 +14661,7 @@ __webpack_require__.r(__webpack_exports__);
|
|||
/* harmony export */ "getRows": () => (/* binding */ getRows),
|
||||
/* harmony export */ "removeScript": () => (/* binding */ removeScript),
|
||||
/* harmony export */ "sanitizeText": () => (/* binding */ sanitizeText),
|
||||
/* harmony export */ "sanitizeTextOrArray": () => (/* binding */ sanitizeTextOrArray),
|
||||
/* harmony export */ "lineBreakRegex": () => (/* binding */ lineBreakRegex),
|
||||
/* harmony export */ "hasBreaks": () => (/* binding */ hasBreaks),
|
||||
/* harmony export */ "splitBreaks": () => (/* binding */ splitBreaks),
|
||||
|
@ -14750,6 +14750,15 @@ var sanitizeText = function sanitizeText(text, config) {
|
|||
var txt = dompurify__WEBPACK_IMPORTED_MODULE_0___default().sanitize(sanitizeMore(text, config));
|
||||
return txt;
|
||||
};
|
||||
var sanitizeTextOrArray = function sanitizeTextOrArray(a, config) {
|
||||
if (typeof a === 'string') return sanitizeText(a, config);
|
||||
|
||||
var f = function f(x) {
|
||||
return sanitizeText(x, config);
|
||||
};
|
||||
|
||||
return a.flat().map(f);
|
||||
};
|
||||
var lineBreakRegex = /<br\s*\/?>/gi;
|
||||
/**
|
||||
* Whether or not a text has any linebreaks
|
||||
|
@ -14819,6 +14828,7 @@ var evaluate = function evaluate(val) {
|
|||
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
|
||||
getRows: getRows,
|
||||
sanitizeText: sanitizeText,
|
||||
sanitizeTextOrArray: sanitizeTextOrArray,
|
||||
hasBreaks: hasBreaks,
|
||||
splitBreaks: splitBreaks,
|
||||
lineBreakRegex: lineBreakRegex,
|
||||
|
@ -23758,6 +23768,8 @@ var setupNode = function setupNode(g, parent, node, altFlag) {
|
|||
nodeDb[node.id].description = node.description;
|
||||
}
|
||||
}
|
||||
|
||||
nodeDb[node.id].description = _common_common__WEBPACK_IMPORTED_MODULE_5__["default"].sanitizeTextOrArray(nodeDb[node.id].description, (0,_config__WEBPACK_IMPORTED_MODULE_6__.getConfig)());
|
||||
} // Save data for description and group so that for instance a statement without description overwrites
|
||||
// one with description
|
||||
// group
|
||||
|
@ -23880,7 +23892,7 @@ var setupDoc = function setupDoc(g, parent, doc, altFlag) {
|
|||
arrowTypeEnd: 'arrow_barb',
|
||||
style: 'fill:none',
|
||||
labelStyle: '',
|
||||
label: item.description,
|
||||
label: _common_common__WEBPACK_IMPORTED_MODULE_5__["default"].sanitizeText(item.description, (0,_config__WEBPACK_IMPORTED_MODULE_6__.getConfig)()),
|
||||
arrowheadStyle: 'fill: #333',
|
||||
labelpos: 'c',
|
||||
labelType: 'text',
|
||||
|
@ -25727,7 +25739,7 @@ var decodeEntities = function decodeEntities(text) {
|
|||
/**
|
||||
* Function that renders an svg with a graph from a chart definition. Usage example below.
|
||||
*
|
||||
* ```js
|
||||
* ```javascript
|
||||
* mermaidAPI.initialize({
|
||||
* startOnLoad:true
|
||||
* });
|
||||
|
@ -29649,7 +29661,7 @@ module.exports = require("stylis");
|
|||
/***/ ((module) => {
|
||||
|
||||
"use strict";
|
||||
module.exports = JSON.parse('{"name":"mermaid","version":"8.13.3","description":"Markdownish syntax for generating flowcharts, sequence diagrams, class diagrams, gantt charts and git graphs.","main":"dist/mermaid.core.js","module":"dist/mermaid.esm.min.mjs","exports":{".":{"require":"./dist/mermaid.core.js","import":"./dist/mermaid.esm.min.mjs"},"./*":"./*"},"keywords":["diagram","markdown","flowchart","sequence diagram","gantt","class diagram","git graph"],"scripts":{"build:development":"webpack --progress --color","build:production":"yarn build:development --mode production --config webpack.config.prod.babel.js","build":"concurrently \\"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:development --watch","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 serve --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":"^7.0.0","dagre":"^0.8.5","dagre-d3":"^0.6.4","dompurify":"2.3.3","graphlib":"^2.1.8","khroma":"^1.4.1","moment-mini":"^2.24.0","stylis":"^4.0.10"},"devDependencies":{"@babel/core":"^7.14.6","@babel/eslint-parser":"^7.14.7","@babel/preset-env":"^7.14.7","@babel/register":"^7.14.5","@percy/cli":"^1.0.0-beta.58","@percy/cypress":"^3.1.0","@percy/migrate":"^0.11.0","babel-jest":"^27.0.6","babel-loader":"^8.2.2","concurrently":"^6.2.2","coveralls":"^3.0.2","css-to-string-loader":"^0.1.3","cypress":"8.7.0","documentation":"13.2.0","eslint":"^8.0.0","eslint-config-prettier":"^8.3.0","eslint-plugin-prettier":"^4.0.0","husky":"^7.0.1","identity-obj-proxy":"^3.0.0","jest":"^27.0.6","jison":"^0.4.18","js-base64":"3.7.2","moment":"^2.23.0","path-browserify":"^1.0.1","prettier":"^2.3.2","start-server-and-test":"^1.12.6","terser-webpack-plugin":"^5.2.4","webpack":"^5.53.0","webpack-cli":"^4.7.2","webpack-dev-server":"^4.3.0","webpack-node-externals":"^3.0.0"},"files":["dist"],"sideEffects":["**/*.css","**/*.scss"],"husky":{"hooks":{"pre-push":"yarn test"}}}');
|
||||
module.exports = JSON.parse('{"name":"mermaid","version":"8.13.4","description":"Markdownish syntax for generating flowcharts, sequence diagrams, class diagrams, gantt charts and git graphs.","main":"dist/mermaid.core.js","module":"dist/mermaid.esm.min.mjs","exports":{".":{"require":"./dist/mermaid.core.js","import":"./dist/mermaid.esm.min.mjs"},"./*":"./*"},"keywords":["diagram","markdown","flowchart","sequence diagram","gantt","class diagram","git graph"],"scripts":{"build:development":"webpack --progress --color","build:production":"yarn build:development --mode production --config webpack.config.prod.babel.js","build":"concurrently \\"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:development --watch","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 serve --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":"^7.0.0","dagre":"^0.8.5","dagre-d3":"^0.6.4","dompurify":"2.3.3","graphlib":"^2.1.8","khroma":"^1.4.1","moment-mini":"^2.24.0","stylis":"^4.0.10"},"devDependencies":{"@babel/core":"^7.14.6","@babel/eslint-parser":"^7.14.7","@babel/preset-env":"^7.14.7","@babel/register":"^7.14.5","@percy/cli":"^1.0.0-beta.58","@percy/cypress":"^3.1.0","@percy/migrate":"^0.11.0","babel-jest":"^27.0.6","babel-loader":"^8.2.2","concurrently":"^6.2.2","coveralls":"^3.0.2","css-to-string-loader":"^0.1.3","cypress":"8.7.0","documentation":"13.2.0","eslint":"^8.0.0","eslint-config-prettier":"^8.3.0","eslint-plugin-prettier":"^4.0.0","husky":"^7.0.1","identity-obj-proxy":"^3.0.0","jest":"^27.0.6","jison":"^0.4.18","js-base64":"3.7.2","moment":"^2.23.0","path-browserify":"^1.0.1","prettier":"^2.3.2","start-server-and-test":"^1.12.6","terser-webpack-plugin":"^5.2.4","webpack":"^5.53.0","webpack-cli":"^4.7.2","webpack-dev-server":"^4.3.0","webpack-node-externals":"^3.0.0"},"files":["dist"],"sideEffects":["**/*.css","**/*.scss"],"husky":{"hooks":{"pre-push":"yarn test"}}}');
|
||||
|
||||
/***/ })
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,164 @@
|
|||
import classDb from './diagrams/class/classDb';
|
||||
import classRenderer from './diagrams/class/classRenderer';
|
||||
import classRendererV2 from './diagrams/class/classRenderer-v2';
|
||||
import classParser from './diagrams/class/parser/classDiagram';
|
||||
import erDb from './diagrams/er/erDb';
|
||||
import erRenderer from './diagrams/er/erRenderer';
|
||||
import erParser from './diagrams/er/parser/erDiagram';
|
||||
import flowDb from './diagrams/flowchart/flowDb';
|
||||
import flowRenderer from './diagrams/flowchart/flowRenderer';
|
||||
import flowRendererV2 from './diagrams/flowchart/flowRenderer-v2';
|
||||
import flowParser from './diagrams/flowchart/parser/flow';
|
||||
import ganttDb from './diagrams/gantt/ganttDb';
|
||||
import ganttRenderer from './diagrams/gantt/ganttRenderer';
|
||||
import ganttParser from './diagrams/gantt/parser/gantt';
|
||||
import gitGraphAst from './diagrams/git/gitGraphAst';
|
||||
import gitGraphRenderer from './diagrams/git/gitGraphRenderer';
|
||||
import gitGraphParser from './diagrams/git/parser/gitGraph';
|
||||
import infoDb from './diagrams/info/infoDb';
|
||||
import infoRenderer from './diagrams/info/infoRenderer';
|
||||
import infoParser from './diagrams/info/parser/info';
|
||||
import pieParser from './diagrams/pie/parser/pie';
|
||||
import pieDb from './diagrams/pie/pieDb';
|
||||
import pieRenderer from './diagrams/pie/pieRenderer';
|
||||
import requirementParser from './diagrams/requirement/parser/requirementDiagram';
|
||||
import requirementDb from './diagrams/requirement/requirementDb';
|
||||
import requirementRenderer from './diagrams/requirement/requirementRenderer';
|
||||
import sequenceParser from './diagrams/sequence/parser/sequenceDiagram';
|
||||
import sequenceDb from './diagrams/sequence/sequenceDb';
|
||||
import sequenceRenderer from './diagrams/sequence/sequenceRenderer';
|
||||
import stateParser from './diagrams/state/parser/stateDiagram';
|
||||
import stateDb from './diagrams/state/stateDb';
|
||||
import stateRenderer from './diagrams/state/stateRenderer';
|
||||
import stateRendererV2 from './diagrams/state/stateRenderer-v2';
|
||||
import journeyDb from './diagrams/user-journey/journeyDb';
|
||||
import journeyRenderer from './diagrams/user-journey/journeyRenderer';
|
||||
import journeyParser from './diagrams/user-journey/parser/journey';
|
||||
import utils from './utils';
|
||||
import * as configApi from './config';
|
||||
import { log } from './logger';
|
||||
|
||||
class Diagram {
|
||||
type = 'graph';
|
||||
parser;
|
||||
renderer;
|
||||
db;
|
||||
constructor(txt) {
|
||||
const cnf = configApi.getConfig();
|
||||
this.txt = txt;
|
||||
this.type = utils.detectType(txt, cnf);
|
||||
log.debug('Type ' + this.type);
|
||||
switch (this.type) {
|
||||
case 'git':
|
||||
this.parser = gitGraphParser;
|
||||
this.parser.parser.yy = gitGraphAst;
|
||||
this.db = gitGraphAst;
|
||||
this.renderer = gitGraphRenderer;
|
||||
break;
|
||||
case 'flowchart':
|
||||
flowDb.clear();
|
||||
this.parser = flowParser;
|
||||
this.parser.parser.yy = flowDb;
|
||||
this.db = flowDb;
|
||||
this.renderer = flowRenderer;
|
||||
break;
|
||||
case 'flowchart-v2':
|
||||
flowDb.clear();
|
||||
this.parser = flowParser;
|
||||
this.parser.parser.yy = flowDb;
|
||||
this.db = flowDb;
|
||||
this.renderer = flowRendererV2;
|
||||
break;
|
||||
case 'sequenceDiagram':
|
||||
case 'sequence':
|
||||
this.parser = sequenceParser;
|
||||
this.parser.parser.yy = sequenceDb;
|
||||
this.db = sequenceDb;
|
||||
this.renderer = sequenceRenderer;
|
||||
break;
|
||||
case 'gantt':
|
||||
this.parser = ganttParser;
|
||||
this.parser.parser.yy = ganttDb;
|
||||
this.db = ganttDb;
|
||||
this.renderer = ganttRenderer;
|
||||
break;
|
||||
case 'class':
|
||||
this.parser = classParser;
|
||||
this.parser.parser.yy = classDb;
|
||||
this.db = classDb;
|
||||
this.renderer = classRenderer;
|
||||
break;
|
||||
case 'classDiagram':
|
||||
this.parser = classParser;
|
||||
this.parser.parser.yy = classDb;
|
||||
this.db = classDb;
|
||||
this.renderer = classRendererV2;
|
||||
break;
|
||||
case 'state':
|
||||
this.parser = stateParser;
|
||||
this.parser.parser.yy = stateDb;
|
||||
this.db = stateDb;
|
||||
this.renderer = stateRenderer;
|
||||
break;
|
||||
case 'stateDiagram':
|
||||
this.parser = stateParser;
|
||||
this.parser.parser.yy = stateDb;
|
||||
this.db = stateDb;
|
||||
this.renderer = stateRendererV2;
|
||||
break;
|
||||
case 'info':
|
||||
log.debug('info info info');
|
||||
this.parser = infoParser;
|
||||
this.parser.parser.yy = infoDb;
|
||||
this.db = infoDb;
|
||||
this.renderer = infoRenderer;
|
||||
break;
|
||||
case 'pie':
|
||||
log.debug('pie');
|
||||
this.parser = pieParser;
|
||||
this.parser.parser.yy = pieDb;
|
||||
this.db = pieDb;
|
||||
this.renderer = pieRenderer;
|
||||
break;
|
||||
case 'er':
|
||||
log.debug('er');
|
||||
this.parser = erParser;
|
||||
this.parser.parser.yy = erDb;
|
||||
this.db = erDb;
|
||||
this.renderer = erRenderer;
|
||||
break;
|
||||
case 'journey':
|
||||
log.debug('Journey');
|
||||
this.parser = journeyParser;
|
||||
this.parser.parser.yy = journeyDb;
|
||||
this.db = journeyDb;
|
||||
this.renderer = journeyRenderer;
|
||||
break;
|
||||
case 'requirement':
|
||||
case 'requirementDiagram':
|
||||
log.debug('RequirementDiagram');
|
||||
this.parser = requirementParser;
|
||||
this.parser.parser.yy = requirementDb;
|
||||
this.db = requirementDb;
|
||||
this.renderer = requirementRenderer;
|
||||
break;
|
||||
default:
|
||||
log.error('Unkown graphtype');
|
||||
throw new Error('Unkown graphtype');
|
||||
}
|
||||
this.parser.parser.yy.graphType = this.type;
|
||||
this.parser.parser.yy.parseError = (str, hash) => {
|
||||
const error = { str, hash };
|
||||
throw error;
|
||||
};
|
||||
this.parser.parse(txt);
|
||||
}
|
||||
getParser() {
|
||||
return this.parser;
|
||||
}
|
||||
getType() {
|
||||
return this.type;
|
||||
}
|
||||
}
|
||||
|
||||
export default Diagram;
|
Loading…
Reference in New Issue