mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-01-14 06:43:25 +08:00
Merge branch 'release/8.8.1' into develop
This commit is contained in:
commit
088dd8698e
116
dist/mermaid.core.js
vendored
116
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.7.0\",\"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 --shallow -f md --markdown-toc false | sed '1i---\\\\nsort: 3\\\\ntitle: Configurations\\\\n---\\\\n' > docs/getting-started/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 && yarn e2e\",\"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\",\"babel-eslint\":\"^10.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-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\":\"^4.12.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.8.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 --shallow -f md --markdown-toc false | sed '1i---\\\\nsort: 3\\\\ntitle: Configurations\\\\n---\\\\n' > docs/getting-started/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\",\"xprepublishOnly\":\"yarn build && yarn test && yarn e2e\",\"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\",\"babel-eslint\":\"^10.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-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\":\"^4.12.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\"}}}");
|
||||
|
||||
/***/ }),
|
||||
|
||||
@ -2996,7 +2996,7 @@ var rect = function rect(parent, node) {
|
||||
_logger__WEBPACK_IMPORTED_MODULE_1__["logger"].trace('Classes = ', node.classes); // add the rect
|
||||
|
||||
var rect = shapeSvg.insert('rect', ':first-child');
|
||||
rect.attr('class', 'basic label-container').attr('rx', node.rx).attr('ry', node.ry).attr('x', -bbox.width / 2 - halfPadding).attr('y', -bbox.height / 2 - halfPadding).attr('width', bbox.width + node.padding).attr('height', bbox.height + node.padding);
|
||||
rect.attr('class', 'basic label-container').attr('style', node.style).attr('rx', node.rx).attr('ry', node.ry).attr('x', -bbox.width / 2 - halfPadding).attr('y', -bbox.height / 2 - halfPadding).attr('width', bbox.width + node.padding).attr('height', bbox.height + node.padding);
|
||||
Object(_shapes_util__WEBPACK_IMPORTED_MODULE_2__["updateNodeBounds"])(node, rect);
|
||||
|
||||
node.intersect = function (point) {
|
||||
@ -3466,6 +3466,10 @@ var insertNode = function insertNode(elem, node, dir) {
|
||||
el.attr('title', node.tooltip);
|
||||
}
|
||||
|
||||
if (node.class) {
|
||||
el.attr('class', 'node default ' + node.class);
|
||||
}
|
||||
|
||||
nodeElems[node.id] = newEl;
|
||||
|
||||
if (node.haveCallback) {
|
||||
@ -3563,7 +3567,7 @@ var labelHelper = function labelHelper(parent, node, _classes, isNode) {
|
||||
|
||||
var shapeSvg = parent.insert('g').attr('class', classes).attr('id', node.domId || node.id); // Create the label and insert it after the rect
|
||||
|
||||
var label = shapeSvg.insert('g').attr('class', 'label');
|
||||
var label = shapeSvg.insert('g').attr('class', 'label').attr('style', node.labelStyle);
|
||||
var text = label.node().appendChild(Object(_createLabel__WEBPACK_IMPORTED_MODULE_0__["default"])(node.labelText, node.labelStyle, false, isNode)); // Get the size of the label
|
||||
|
||||
var bbox = text.getBBox();
|
||||
@ -4955,10 +4959,15 @@ var addClasses = function addClasses(classes, g) {
|
||||
* @type {string}
|
||||
*/
|
||||
|
||||
var classStr = 'default'; // if (vertex.classes.length > 0) {
|
||||
var cssClassStr = '';
|
||||
|
||||
if (vertex.cssClasses.length > 0) {
|
||||
cssClassStr = cssClassStr + ' ' + vertex.cssClasses.join(' ');
|
||||
} // if (vertex.classes.length > 0) {
|
||||
// classStr = vertex.classes.join(' ');
|
||||
// }
|
||||
|
||||
|
||||
var styles = {
|
||||
labelStyle: ''
|
||||
}; //getStylesFromArray(vertex.styles);
|
||||
@ -5010,7 +5019,7 @@ var addClasses = function addClasses(classes, g) {
|
||||
classData: vertex,
|
||||
rx: radious,
|
||||
ry: radious,
|
||||
class: classStr,
|
||||
class: cssClassStr,
|
||||
style: styles.style,
|
||||
id: vertex.id,
|
||||
domId: vertex.domId,
|
||||
@ -5026,7 +5035,7 @@ var addClasses = function addClasses(classes, g) {
|
||||
labelText: vertexText,
|
||||
rx: radious,
|
||||
ry: radious,
|
||||
class: classStr,
|
||||
class: cssClassStr,
|
||||
style: styles.style,
|
||||
id: vertex.id,
|
||||
width: vertex.type === 'group' ? 500 : undefined,
|
||||
@ -8402,7 +8411,7 @@ function insertPolygonShape(parent, w, h, points) {
|
||||
/*!******************************************!*\
|
||||
!*** ./src/diagrams/flowchart/flowDb.js ***!
|
||||
\******************************************/
|
||||
/*! exports provided: parseDirective, lookUpDomId, addVertex, addSingleLink, addLink, updateLinkInterpolate, updateLink, addClass, setDirection, setClass, setLink, getTooltip, setClickEvent, bindFunctions, getDirection, getVertices, getEdges, getClasses, clear, defaultStyle, addSubGraph, getDepthFirstPos, indexNodes, getSubGraphs, firstGraph, default */
|
||||
/*! exports provided: parseDirective, lookUpDomId, addVertex, addSingleLink, addLink, updateLinkInterpolate, updateLink, addClass, setDirection, setClass, setLink, getTooltip, setClickEvent, bindFunctions, getDirection, getVertices, getEdges, getClasses, clear, setGen, defaultStyle, addSubGraph, getDepthFirstPos, indexNodes, getSubGraphs, firstGraph, default */
|
||||
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
@ -8426,6 +8435,7 @@ __webpack_require__.r(__webpack_exports__);
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getEdges", function() { return getEdges; });
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getClasses", function() { return getClasses; });
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "clear", function() { return clear; });
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setGen", function() { return setGen; });
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "defaultStyle", function() { return defaultStyle; });
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addSubGraph", function() { return addSubGraph; });
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getDepthFirstPos", function() { return getDepthFirstPos; });
|
||||
@ -8438,13 +8448,14 @@ __webpack_require__.r(__webpack_exports__);
|
||||
/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../config */ "./src/config.js");
|
||||
/* harmony import */ var _common_common__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common/common */ "./src/diagrams/common/common.js");
|
||||
/* harmony import */ var _mermaidAPI__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../mermaidAPI */ "./src/mermaidAPI.js");
|
||||
/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../logger */ "./src/logger.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); }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// const MERMAID_DOM_ID_PREFIX = 'mermaid-dom-id-';
|
||||
|
||||
|
||||
var MERMAID_DOM_ID_PREFIX = 'flowchart-';
|
||||
var vertexCounter = 0;
|
||||
@ -8457,7 +8468,9 @@ var subGraphLookup = {};
|
||||
var tooltips = {};
|
||||
var subCount = 0;
|
||||
var firstGraphFlag = true;
|
||||
var direction; // Functions to be run after graph rendering
|
||||
var direction;
|
||||
var version; // As in graph
|
||||
// Functions to be run after graph rendering
|
||||
|
||||
var funs = [];
|
||||
var parseDirective = function parseDirective(statement, context, type) {
|
||||
@ -8477,6 +8490,8 @@ var lookUpDomId = function lookUpDomId(id) {
|
||||
return vertices[veritceKeys[i]].domId;
|
||||
}
|
||||
}
|
||||
|
||||
return id;
|
||||
};
|
||||
/**
|
||||
* Function called by parser when a node definition has been found
|
||||
@ -8682,6 +8697,7 @@ var setDirection = function setDirection(dir) {
|
||||
|
||||
var setClass = function setClass(ids, className) {
|
||||
ids.split(',').forEach(function (_id) {
|
||||
// let id = version === 'gen-2' ? lookUpDomId(_id) : _id;
|
||||
var id = _id; // if (_id[0].match(/\d/)) id = MERMAID_DOM_ID_PREFIX + id;
|
||||
|
||||
if (typeof vertices[id] !== 'undefined') {
|
||||
@ -8697,7 +8713,7 @@ var setClass = function setClass(ids, className) {
|
||||
var setTooltip = function setTooltip(ids, tooltip) {
|
||||
ids.split(',').forEach(function (id) {
|
||||
if (typeof tooltip !== 'undefined') {
|
||||
tooltips[id] = _common_common__WEBPACK_IMPORTED_MODULE_3__["default"].sanitizeText(tooltip, config);
|
||||
tooltips[version === 'gen-1' ? lookUpDomId(id) : id] = _common_common__WEBPACK_IMPORTED_MODULE_3__["default"].sanitizeText(tooltip, config);
|
||||
}
|
||||
});
|
||||
};
|
||||
@ -8736,8 +8752,6 @@ var setClickFun = function setClickFun(id, functionName) {
|
||||
|
||||
var setLink = function setLink(ids, linkStr, tooltip, target) {
|
||||
ids.split(',').forEach(function (id) {
|
||||
// let domId = lookUpDomId(id);
|
||||
// if (_id[0].match(/\d/)) id = MERMAID_DOM_ID_PREFIX + id;
|
||||
if (typeof vertices[id] !== 'undefined') {
|
||||
vertices[id].link = _utils__WEBPACK_IMPORTED_MODULE_1__["default"].formatUrl(linkStr, config);
|
||||
vertices[id].linkTarget = target;
|
||||
@ -8829,7 +8843,7 @@ funs.push(setupToolTips);
|
||||
* Clears the internal graph db so that a new graph can be parsed.
|
||||
*/
|
||||
|
||||
var clear = function clear() {
|
||||
var clear = function clear(ver) {
|
||||
vertices = {};
|
||||
classes = {};
|
||||
edges = [];
|
||||
@ -8840,6 +8854,10 @@ var clear = function clear() {
|
||||
subCount = 0;
|
||||
tooltips = [];
|
||||
firstGraphFlag = true;
|
||||
version = ver || 'gen-1';
|
||||
};
|
||||
var setGen = function setGen(ver) {
|
||||
version = ver || 'gen-1';
|
||||
};
|
||||
/**
|
||||
*
|
||||
@ -8854,6 +8872,7 @@ var defaultStyle = function defaultStyle() {
|
||||
*/
|
||||
|
||||
var addSubGraph = function addSubGraph(_id, list, _title) {
|
||||
// logger.warn('addSubgraph', _id, list, _title);
|
||||
var id = _id.trim();
|
||||
|
||||
var title = _title;
|
||||
@ -8887,12 +8906,16 @@ var addSubGraph = function addSubGraph(_id, list, _title) {
|
||||
var nodeList = [];
|
||||
nodeList = uniq(nodeList.concat.apply(nodeList, list));
|
||||
|
||||
for (var i = 0; i < nodeList.length; i++) {
|
||||
if (nodeList[i][0].match(/\d/)) nodeList[i] = MERMAID_DOM_ID_PREFIX + nodeList[i];
|
||||
if (version === 'gen-1') {
|
||||
_logger__WEBPACK_IMPORTED_MODULE_5__["logger"].warn('LOOKING UP');
|
||||
|
||||
for (var i = 0; i < nodeList.length; i++) {
|
||||
nodeList[i] = lookUpDomId(nodeList[i]);
|
||||
}
|
||||
}
|
||||
|
||||
id = id || 'subGraph' + subCount;
|
||||
if (id[0].match(/\d/)) id = MERMAID_DOM_ID_PREFIX + id;
|
||||
id = id || 'subGraph' + subCount; // if (id[0].match(/\d/)) id = lookUpDomId(id);
|
||||
|
||||
title = title || '';
|
||||
title = _common_common__WEBPACK_IMPORTED_MODULE_3__["default"].sanitizeText(title, config);
|
||||
subCount = subCount + 1;
|
||||
@ -8911,7 +8934,6 @@ var addSubGraph = function addSubGraph(_id, list, _title) {
|
||||
var pos = sg.nodes.indexOf(_id);
|
||||
|
||||
if (pos >= 0) {
|
||||
console.log(sg.nodes, pos, _id);
|
||||
sg.nodes.splice(pos, 1);
|
||||
}
|
||||
});
|
||||
@ -8921,7 +8943,6 @@ var addSubGraph = function addSubGraph(_id, list, _title) {
|
||||
subGraph.nodes.forEach(function (_id) {
|
||||
return del(_id);
|
||||
});
|
||||
console.log(subGraph.nodes);
|
||||
subGraphs.push(subGraph);
|
||||
subGraphLookup[id] = subGraph;
|
||||
return id;
|
||||
@ -9176,6 +9197,7 @@ var destructLink = function destructLink(_str, _startStr) {
|
||||
getEdges: getEdges,
|
||||
getClasses: getClasses,
|
||||
clear: clear,
|
||||
setGen: setGen,
|
||||
defaultStyle: defaultStyle,
|
||||
addSubGraph: addSubGraph,
|
||||
getDepthFirstPos: getDepthFirstPos,
|
||||
@ -9570,6 +9592,7 @@ var getClasses = function getClasses(text) {
|
||||
var draw = function draw(text, id) {
|
||||
_logger__WEBPACK_IMPORTED_MODULE_7__["logger"].info('Drawing flowchart');
|
||||
_flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].clear();
|
||||
_flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].setGen('gen-2');
|
||||
var parser = _parser_flow__WEBPACK_IMPORTED_MODULE_3___default.a.parser;
|
||||
parser.yy = _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"]; // Parse the graph definition
|
||||
// try {
|
||||
@ -9894,7 +9917,8 @@ var addVertices = function addVertices(vert, g, svgId) {
|
||||
} // Add the node
|
||||
|
||||
|
||||
g.setNode(vertex.id, {
|
||||
_logger__WEBPACK_IMPORTED_MODULE_7__["logger"].warn('Adding node', vertex.id, vertex.domId);
|
||||
g.setNode(_flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].lookUpDomId(vertex.id), {
|
||||
labelType: 'svg',
|
||||
labelStyle: styles.labelStyle,
|
||||
shape: _shape,
|
||||
@ -9903,7 +9927,7 @@ var addVertices = function addVertices(vert, g, svgId) {
|
||||
ry: radious,
|
||||
class: classStr,
|
||||
style: styles.style,
|
||||
id: vertex.id
|
||||
id: _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].lookUpDomId(vertex.id)
|
||||
});
|
||||
});
|
||||
};
|
||||
@ -10008,7 +10032,7 @@ var addEdges = function addEdges(edges, g) {
|
||||
edgeData.class = linkNameStart + ' ' + linkNameEnd;
|
||||
edgeData.minlen = edge.length || 1; // Add the edge to the graph
|
||||
|
||||
g.setEdge(edge.start, edge.end, edgeData, cnt);
|
||||
g.setEdge(_flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].lookUpDomId(edge.start), _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].lookUpDomId(edge.end), edgeData, cnt);
|
||||
});
|
||||
};
|
||||
/**
|
||||
@ -10039,6 +10063,7 @@ var getClasses = function getClasses(text) {
|
||||
var draw = function draw(text, id) {
|
||||
_logger__WEBPACK_IMPORTED_MODULE_7__["logger"].info('Drawing flowchart');
|
||||
_flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].clear();
|
||||
_flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].setGen('gen-1');
|
||||
var parser = _parser_flow__WEBPACK_IMPORTED_MODULE_3___default.a.parser;
|
||||
parser.yy = _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"]; // Parse the graph definition
|
||||
// try {
|
||||
@ -10080,6 +10105,7 @@ var draw = function draw(text, id) {
|
||||
|
||||
|
||||
var vert = _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].getVertices();
|
||||
_logger__WEBPACK_IMPORTED_MODULE_7__["logger"].warn('Get vertices', vert);
|
||||
var edges = _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].getEdges();
|
||||
var i = 0;
|
||||
|
||||
@ -10088,7 +10114,8 @@ var draw = function draw(text, id) {
|
||||
Object(d3__WEBPACK_IMPORTED_MODULE_1__["selectAll"])('cluster').append('text');
|
||||
|
||||
for (var j = 0; j < subG.nodes.length; j++) {
|
||||
g.setParent(subG.nodes[j], subG.id);
|
||||
_logger__WEBPACK_IMPORTED_MODULE_7__["logger"].warn('Setting subgraph', subG.nodes[j], _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].lookUpDomId(subG.nodes[j]), _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].lookUpDomId(subG.id));
|
||||
g.setParent(_flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].lookUpDomId(subG.nodes[j]), _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].lookUpDomId(subG.id));
|
||||
}
|
||||
}
|
||||
|
||||
@ -10114,7 +10141,8 @@ var draw = function draw(text, id) {
|
||||
|
||||
|
||||
var svg = Object(d3__WEBPACK_IMPORTED_MODULE_1__["select"])("[id=\"".concat(id, "\"]"));
|
||||
svg.attr('xmlns:xlink', 'http://www.w3.org/1999/xlink'); // Run the renderer. This is what draws the final graph.
|
||||
svg.attr('xmlns:xlink', 'http://www.w3.org/1999/xlink');
|
||||
_logger__WEBPACK_IMPORTED_MODULE_7__["logger"].warn(g); // Run the renderer. This is what draws the final graph.
|
||||
|
||||
var element = Object(d3__WEBPACK_IMPORTED_MODULE_1__["select"])('#' + id + ' g');
|
||||
render(element, g);
|
||||
@ -10137,8 +10165,8 @@ var draw = function draw(text, id) {
|
||||
subG = subGraphs[i];
|
||||
|
||||
if (subG.title !== 'undefined') {
|
||||
var clusterRects = document.querySelectorAll('#' + id + ' [id="' + subG.id + '"] rect');
|
||||
var clusterEl = document.querySelectorAll('#' + id + ' [id="' + subG.id + '"]');
|
||||
var clusterRects = document.querySelectorAll('#' + id + ' [id="' + _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].lookUpDomId(subG.id) + '"] rect');
|
||||
var clusterEl = document.querySelectorAll('#' + id + ' [id="' + _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].lookUpDomId(subG.id) + '"]');
|
||||
var xPos = clusterRects[0].x.baseVal.value;
|
||||
var yPos = clusterRects[0].y.baseVal.value;
|
||||
var _width = clusterRects[0].width.baseVal.value;
|
||||
@ -10178,7 +10206,7 @@ var draw = function draw(text, id) {
|
||||
var vertex = vert[key];
|
||||
|
||||
if (vertex.link) {
|
||||
var node = Object(d3__WEBPACK_IMPORTED_MODULE_1__["select"])('#' + id + ' [id="' + key + '"]');
|
||||
var node = Object(d3__WEBPACK_IMPORTED_MODULE_1__["select"])('#' + id + ' [id="' + _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].lookUpDomId(key) + '"]');
|
||||
|
||||
if (node) {
|
||||
var link = document.createElementNS('http://www.w3.org/2000/svg', 'a');
|
||||
@ -15796,7 +15824,7 @@ case 4:return 24;
|
||||
break;
|
||||
case 5:/* skip comments */
|
||||
break;
|
||||
case 6:/* skip comments */{ console.log('Crap after close'); }
|
||||
case 6:/* skip comments */{ /*console.log('');*/ }
|
||||
break;
|
||||
case 7:return 19;
|
||||
break;
|
||||
@ -15995,7 +16023,6 @@ var draw = function draw(txt, id) {
|
||||
}
|
||||
|
||||
var diagram = Object(d3__WEBPACK_IMPORTED_MODULE_0__["select"])('#' + id);
|
||||
console.log('conf', conf);
|
||||
Object(_utils__WEBPACK_IMPORTED_MODULE_4__["configureSvgSize"])(diagram, height, width, conf.useMaxWidth); // Set viewBox
|
||||
|
||||
elem.setAttribute('viewBox', '0 0 ' + width + ' ' + height); // Fetch the default direction, use TD if none was found
|
||||
@ -17005,7 +17032,6 @@ var activationCount = function activationCount(part) {
|
||||
var count = 0;
|
||||
|
||||
for (i = 0; i < messages.length; i++) {
|
||||
// console.warn(i, messages[i]);
|
||||
if (messages[i].type === LINETYPE.ACTIVE_START) {
|
||||
if (messages[i].from.actor === part) {
|
||||
count++;
|
||||
@ -17514,7 +17540,6 @@ var bounds = {
|
||||
return this.verticalPos;
|
||||
},
|
||||
getBounds: function getBounds() {
|
||||
console.log('here', this.data);
|
||||
return {
|
||||
bounds: this.data,
|
||||
models: this.models
|
||||
@ -17786,7 +17811,6 @@ function adjustLoopHeightForWrap(loopWidths, msg, preMargin, postMargin, addLoop
|
||||
|
||||
var draw = function draw(text, id) {
|
||||
conf = _config__WEBPACK_IMPORTED_MODULE_6__["getConfig"]().sequence;
|
||||
console.log('there ', conf);
|
||||
_parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.clear();
|
||||
_parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.setWrap(conf.wrap);
|
||||
_parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].parse(text + '\n');
|
||||
@ -19743,8 +19767,7 @@ var addTitleAndBox = function addTitleAndBox(g, stateDef, altBkg) {
|
||||
// .attr('y2', lineY)
|
||||
// .attr('class', 'descr-divider');
|
||||
|
||||
var graphBox = g.node().getBBox(); // console.warn(width / 2, titleWidth / 2, getConfig().state.padding, orgBox);
|
||||
// descrLine.attr('x2', graphBox.width + getConfig().state.padding);
|
||||
var graphBox = g.node().getBBox(); // descrLine.attr('x2', graphBox.width + getConfig().state.padding);
|
||||
|
||||
if (stateDef.doc) {// cnsole.warn(
|
||||
// stateDef.id,
|
||||
@ -19856,8 +19879,7 @@ var _drawLongText = function _drawLongText(_text, x, y, g) {
|
||||
if (tHeight === 0) {
|
||||
var textBounds = span.node().getBBox();
|
||||
tHeight += textBounds.height;
|
||||
} // console.warn('textBounds', textBounds);
|
||||
|
||||
}
|
||||
|
||||
textHeight += tHeight;
|
||||
span.attr('x', x + Object(_config__WEBPACK_IMPORTED_MODULE_5__["getConfig"])().state.noteMargin);
|
||||
@ -19981,8 +20003,7 @@ var drawEdge = function drawEdge(elem, path, relation) {
|
||||
x = _utils$calcLabelPosit.x,
|
||||
y = _utils$calcLabelPosit.y;
|
||||
|
||||
var rows = _common_common__WEBPACK_IMPORTED_MODULE_4__["default"].getRows(relation.title); // console.warn(rows);
|
||||
|
||||
var rows = _common_common__WEBPACK_IMPORTED_MODULE_4__["default"].getRows(relation.title);
|
||||
var titleHeight = 0;
|
||||
var titleRows = [];
|
||||
var maxWidth = 0;
|
||||
@ -24018,10 +24039,6 @@ function () {
|
||||
var getThemeVariables = function getThemeVariables(userOverrides) {
|
||||
var theme = new Theme();
|
||||
theme.calculate(userOverrides);
|
||||
console.info('Theme(dark)', {
|
||||
userOverrides: userOverrides,
|
||||
theme: theme
|
||||
});
|
||||
return theme;
|
||||
};
|
||||
|
||||
@ -24247,8 +24264,7 @@ function () {
|
||||
|
||||
var getThemeVariables = function getThemeVariables(userOverrides) {
|
||||
var theme = new Theme();
|
||||
theme.calculate(userOverrides); // console.info('Theme(default)', { userOverrides, theme });
|
||||
|
||||
theme.calculate(userOverrides);
|
||||
return theme;
|
||||
};
|
||||
|
||||
@ -24444,10 +24460,6 @@ function () {
|
||||
var getThemeVariables = function getThemeVariables(userOverrides) {
|
||||
var theme = new Theme();
|
||||
theme.calculate(userOverrides);
|
||||
console.info('Theme(forest)', {
|
||||
userOverrides: userOverrides,
|
||||
theme: theme
|
||||
});
|
||||
return theme;
|
||||
};
|
||||
|
||||
@ -24516,8 +24528,7 @@ function () {
|
||||
|
||||
this.tertiaryColor = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["adjust"])(this.primaryColor, {
|
||||
h: -160
|
||||
}); // console.log('primary color', this.primaryColor, 'tertiary - color', this.tertiaryColor);
|
||||
|
||||
});
|
||||
this.primaryBorderColor = Object(_theme_helpers__WEBPACK_IMPORTED_MODULE_1__["mkBorder"])(this.primaryColor, this.darkMode);
|
||||
this.secondaryBorderColor = Object(_theme_helpers__WEBPACK_IMPORTED_MODULE_1__["mkBorder"])(this.secondaryColor, this.darkMode);
|
||||
this.tertiaryBorderColor = Object(_theme_helpers__WEBPACK_IMPORTED_MODULE_1__["mkBorder"])(this.tertiaryColor, this.darkMode); // this.noteBorderColor = mkBorder(this.noteBkgColor, this.darkMode);
|
||||
@ -24698,10 +24709,6 @@ function () {
|
||||
var getThemeVariables = function getThemeVariables(userOverrides) {
|
||||
var theme = new Theme();
|
||||
theme.calculate(userOverrides);
|
||||
console.info('Theme(neutral)', {
|
||||
userOverrides: userOverrides,
|
||||
theme: theme
|
||||
});
|
||||
return theme;
|
||||
};
|
||||
|
||||
@ -25650,7 +25657,6 @@ var calculateSvgSizeAttrs = function calculateSvgSizeAttrs(height, width, useMax
|
||||
};
|
||||
var configureSvgSize = function configureSvgSize(svgElem, height, width, useMaxWidth) {
|
||||
var attrs = calculateSvgSizeAttrs(height, width, useMaxWidth);
|
||||
console.log('svgElem', svgElem);
|
||||
d3Attrs(svgElem, attrs);
|
||||
};
|
||||
/* harmony default export */ __webpack_exports__["default"] = ({
|
||||
|
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
116
dist/mermaid.js
vendored
116
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.7.0\",\"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 --shallow -f md --markdown-toc false | sed '1i---\\\\nsort: 3\\\\ntitle: Configurations\\\\n---\\\\n' > docs/getting-started/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 && yarn e2e\",\"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\",\"babel-eslint\":\"^10.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-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\":\"^4.12.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.8.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 --shallow -f md --markdown-toc false | sed '1i---\\\\nsort: 3\\\\ntitle: Configurations\\\\n---\\\\n' > docs/getting-started/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\",\"xprepublishOnly\":\"yarn build && yarn test && yarn e2e\",\"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\",\"babel-eslint\":\"^10.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-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\":\"^4.12.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\"}}}");
|
||||
|
||||
/***/ }),
|
||||
|
||||
@ -51371,7 +51371,7 @@ var rect = function rect(parent, node) {
|
||||
_logger__WEBPACK_IMPORTED_MODULE_1__["logger"].trace('Classes = ', node.classes); // add the rect
|
||||
|
||||
var rect = shapeSvg.insert('rect', ':first-child');
|
||||
rect.attr('class', 'basic label-container').attr('rx', node.rx).attr('ry', node.ry).attr('x', -bbox.width / 2 - halfPadding).attr('y', -bbox.height / 2 - halfPadding).attr('width', bbox.width + node.padding).attr('height', bbox.height + node.padding);
|
||||
rect.attr('class', 'basic label-container').attr('style', node.style).attr('rx', node.rx).attr('ry', node.ry).attr('x', -bbox.width / 2 - halfPadding).attr('y', -bbox.height / 2 - halfPadding).attr('width', bbox.width + node.padding).attr('height', bbox.height + node.padding);
|
||||
Object(_shapes_util__WEBPACK_IMPORTED_MODULE_2__["updateNodeBounds"])(node, rect);
|
||||
|
||||
node.intersect = function (point) {
|
||||
@ -51841,6 +51841,10 @@ var insertNode = function insertNode(elem, node, dir) {
|
||||
el.attr('title', node.tooltip);
|
||||
}
|
||||
|
||||
if (node.class) {
|
||||
el.attr('class', 'node default ' + node.class);
|
||||
}
|
||||
|
||||
nodeElems[node.id] = newEl;
|
||||
|
||||
if (node.haveCallback) {
|
||||
@ -51937,7 +51941,7 @@ var labelHelper = function labelHelper(parent, node, _classes, isNode) {
|
||||
|
||||
var shapeSvg = parent.insert('g').attr('class', classes).attr('id', node.domId || node.id); // Create the label and insert it after the rect
|
||||
|
||||
var label = shapeSvg.insert('g').attr('class', 'label');
|
||||
var label = shapeSvg.insert('g').attr('class', 'label').attr('style', node.labelStyle);
|
||||
var text = label.node().appendChild(Object(_createLabel__WEBPACK_IMPORTED_MODULE_0__["default"])(node.labelText, node.labelStyle, false, isNode)); // Get the size of the label
|
||||
|
||||
var bbox = text.getBBox();
|
||||
@ -53327,10 +53331,15 @@ var addClasses = function addClasses(classes, g) {
|
||||
* @type {string}
|
||||
*/
|
||||
|
||||
var classStr = 'default'; // if (vertex.classes.length > 0) {
|
||||
var cssClassStr = '';
|
||||
|
||||
if (vertex.cssClasses.length > 0) {
|
||||
cssClassStr = cssClassStr + ' ' + vertex.cssClasses.join(' ');
|
||||
} // if (vertex.classes.length > 0) {
|
||||
// classStr = vertex.classes.join(' ');
|
||||
// }
|
||||
|
||||
|
||||
var styles = {
|
||||
labelStyle: ''
|
||||
}; //getStylesFromArray(vertex.styles);
|
||||
@ -53382,7 +53391,7 @@ var addClasses = function addClasses(classes, g) {
|
||||
classData: vertex,
|
||||
rx: radious,
|
||||
ry: radious,
|
||||
class: classStr,
|
||||
class: cssClassStr,
|
||||
style: styles.style,
|
||||
id: vertex.id,
|
||||
domId: vertex.domId,
|
||||
@ -53398,7 +53407,7 @@ var addClasses = function addClasses(classes, g) {
|
||||
labelText: vertexText,
|
||||
rx: radious,
|
||||
ry: radious,
|
||||
class: classStr,
|
||||
class: cssClassStr,
|
||||
style: styles.style,
|
||||
id: vertex.id,
|
||||
width: vertex.type === 'group' ? 500 : undefined,
|
||||
@ -56771,7 +56780,7 @@ function insertPolygonShape(parent, w, h, points) {
|
||||
/*!******************************************!*\
|
||||
!*** ./src/diagrams/flowchart/flowDb.js ***!
|
||||
\******************************************/
|
||||
/*! exports provided: parseDirective, lookUpDomId, addVertex, addSingleLink, addLink, updateLinkInterpolate, updateLink, addClass, setDirection, setClass, setLink, getTooltip, setClickEvent, bindFunctions, getDirection, getVertices, getEdges, getClasses, clear, defaultStyle, addSubGraph, getDepthFirstPos, indexNodes, getSubGraphs, firstGraph, default */
|
||||
/*! exports provided: parseDirective, lookUpDomId, addVertex, addSingleLink, addLink, updateLinkInterpolate, updateLink, addClass, setDirection, setClass, setLink, getTooltip, setClickEvent, bindFunctions, getDirection, getVertices, getEdges, getClasses, clear, setGen, defaultStyle, addSubGraph, getDepthFirstPos, indexNodes, getSubGraphs, firstGraph, default */
|
||||
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
@ -56795,6 +56804,7 @@ __webpack_require__.r(__webpack_exports__);
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getEdges", function() { return getEdges; });
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getClasses", function() { return getClasses; });
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "clear", function() { return clear; });
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setGen", function() { return setGen; });
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "defaultStyle", function() { return defaultStyle; });
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addSubGraph", function() { return addSubGraph; });
|
||||
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getDepthFirstPos", function() { return getDepthFirstPos; });
|
||||
@ -56806,13 +56816,14 @@ __webpack_require__.r(__webpack_exports__);
|
||||
/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../config */ "./src/config.js");
|
||||
/* harmony import */ var _common_common__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common/common */ "./src/diagrams/common/common.js");
|
||||
/* harmony import */ var _mermaidAPI__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../mermaidAPI */ "./src/mermaidAPI.js");
|
||||
/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../logger */ "./src/logger.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); }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// const MERMAID_DOM_ID_PREFIX = 'mermaid-dom-id-';
|
||||
|
||||
|
||||
var MERMAID_DOM_ID_PREFIX = 'flowchart-';
|
||||
var vertexCounter = 0;
|
||||
@ -56825,7 +56836,9 @@ var subGraphLookup = {};
|
||||
var tooltips = {};
|
||||
var subCount = 0;
|
||||
var firstGraphFlag = true;
|
||||
var direction; // Functions to be run after graph rendering
|
||||
var direction;
|
||||
var version; // As in graph
|
||||
// Functions to be run after graph rendering
|
||||
|
||||
var funs = [];
|
||||
var parseDirective = function parseDirective(statement, context, type) {
|
||||
@ -56845,6 +56858,8 @@ var lookUpDomId = function lookUpDomId(id) {
|
||||
return vertices[veritceKeys[i]].domId;
|
||||
}
|
||||
}
|
||||
|
||||
return id;
|
||||
};
|
||||
/**
|
||||
* Function called by parser when a node definition has been found
|
||||
@ -57050,6 +57065,7 @@ var setDirection = function setDirection(dir) {
|
||||
|
||||
var setClass = function setClass(ids, className) {
|
||||
ids.split(',').forEach(function (_id) {
|
||||
// let id = version === 'gen-2' ? lookUpDomId(_id) : _id;
|
||||
var id = _id; // if (_id[0].match(/\d/)) id = MERMAID_DOM_ID_PREFIX + id;
|
||||
|
||||
if (typeof vertices[id] !== 'undefined') {
|
||||
@ -57065,7 +57081,7 @@ var setClass = function setClass(ids, className) {
|
||||
var setTooltip = function setTooltip(ids, tooltip) {
|
||||
ids.split(',').forEach(function (id) {
|
||||
if (typeof tooltip !== 'undefined') {
|
||||
tooltips[id] = _common_common__WEBPACK_IMPORTED_MODULE_3__["default"].sanitizeText(tooltip, config);
|
||||
tooltips[version === 'gen-1' ? lookUpDomId(id) : id] = _common_common__WEBPACK_IMPORTED_MODULE_3__["default"].sanitizeText(tooltip, config);
|
||||
}
|
||||
});
|
||||
};
|
||||
@ -57104,8 +57120,6 @@ var setClickFun = function setClickFun(id, functionName) {
|
||||
|
||||
var setLink = function setLink(ids, linkStr, tooltip, target) {
|
||||
ids.split(',').forEach(function (id) {
|
||||
// let domId = lookUpDomId(id);
|
||||
// if (_id[0].match(/\d/)) id = MERMAID_DOM_ID_PREFIX + id;
|
||||
if (typeof vertices[id] !== 'undefined') {
|
||||
vertices[id].link = _utils__WEBPACK_IMPORTED_MODULE_1__["default"].formatUrl(linkStr, config);
|
||||
vertices[id].linkTarget = target;
|
||||
@ -57197,7 +57211,7 @@ funs.push(setupToolTips);
|
||||
* Clears the internal graph db so that a new graph can be parsed.
|
||||
*/
|
||||
|
||||
var clear = function clear() {
|
||||
var clear = function clear(ver) {
|
||||
vertices = {};
|
||||
classes = {};
|
||||
edges = [];
|
||||
@ -57208,6 +57222,10 @@ var clear = function clear() {
|
||||
subCount = 0;
|
||||
tooltips = [];
|
||||
firstGraphFlag = true;
|
||||
version = ver || 'gen-1';
|
||||
};
|
||||
var setGen = function setGen(ver) {
|
||||
version = ver || 'gen-1';
|
||||
};
|
||||
/**
|
||||
*
|
||||
@ -57222,6 +57240,7 @@ var defaultStyle = function defaultStyle() {
|
||||
*/
|
||||
|
||||
var addSubGraph = function addSubGraph(_id, list, _title) {
|
||||
// logger.warn('addSubgraph', _id, list, _title);
|
||||
var id = _id.trim();
|
||||
|
||||
var title = _title;
|
||||
@ -57255,12 +57274,16 @@ var addSubGraph = function addSubGraph(_id, list, _title) {
|
||||
var nodeList = [];
|
||||
nodeList = uniq(nodeList.concat.apply(nodeList, list));
|
||||
|
||||
for (var i = 0; i < nodeList.length; i++) {
|
||||
if (nodeList[i][0].match(/\d/)) nodeList[i] = MERMAID_DOM_ID_PREFIX + nodeList[i];
|
||||
if (version === 'gen-1') {
|
||||
_logger__WEBPACK_IMPORTED_MODULE_5__["logger"].warn('LOOKING UP');
|
||||
|
||||
for (var i = 0; i < nodeList.length; i++) {
|
||||
nodeList[i] = lookUpDomId(nodeList[i]);
|
||||
}
|
||||
}
|
||||
|
||||
id = id || 'subGraph' + subCount;
|
||||
if (id[0].match(/\d/)) id = MERMAID_DOM_ID_PREFIX + id;
|
||||
id = id || 'subGraph' + subCount; // if (id[0].match(/\d/)) id = lookUpDomId(id);
|
||||
|
||||
title = title || '';
|
||||
title = _common_common__WEBPACK_IMPORTED_MODULE_3__["default"].sanitizeText(title, config);
|
||||
subCount = subCount + 1;
|
||||
@ -57279,7 +57302,6 @@ var addSubGraph = function addSubGraph(_id, list, _title) {
|
||||
var pos = sg.nodes.indexOf(_id);
|
||||
|
||||
if (pos >= 0) {
|
||||
console.log(sg.nodes, pos, _id);
|
||||
sg.nodes.splice(pos, 1);
|
||||
}
|
||||
});
|
||||
@ -57289,7 +57311,6 @@ var addSubGraph = function addSubGraph(_id, list, _title) {
|
||||
subGraph.nodes.forEach(function (_id) {
|
||||
return del(_id);
|
||||
});
|
||||
console.log(subGraph.nodes);
|
||||
subGraphs.push(subGraph);
|
||||
subGraphLookup[id] = subGraph;
|
||||
return id;
|
||||
@ -57544,6 +57565,7 @@ var destructLink = function destructLink(_str, _startStr) {
|
||||
getEdges: getEdges,
|
||||
getClasses: getClasses,
|
||||
clear: clear,
|
||||
setGen: setGen,
|
||||
defaultStyle: defaultStyle,
|
||||
addSubGraph: addSubGraph,
|
||||
getDepthFirstPos: getDepthFirstPos,
|
||||
@ -57937,6 +57959,7 @@ var getClasses = function getClasses(text) {
|
||||
var draw = function draw(text, id) {
|
||||
_logger__WEBPACK_IMPORTED_MODULE_7__["logger"].info('Drawing flowchart');
|
||||
_flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].clear();
|
||||
_flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].setGen('gen-2');
|
||||
var parser = _parser_flow__WEBPACK_IMPORTED_MODULE_3___default.a.parser;
|
||||
parser.yy = _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"]; // Parse the graph definition
|
||||
// try {
|
||||
@ -58260,7 +58283,8 @@ var addVertices = function addVertices(vert, g, svgId) {
|
||||
} // Add the node
|
||||
|
||||
|
||||
g.setNode(vertex.id, {
|
||||
_logger__WEBPACK_IMPORTED_MODULE_7__["logger"].warn('Adding node', vertex.id, vertex.domId);
|
||||
g.setNode(_flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].lookUpDomId(vertex.id), {
|
||||
labelType: 'svg',
|
||||
labelStyle: styles.labelStyle,
|
||||
shape: _shape,
|
||||
@ -58269,7 +58293,7 @@ var addVertices = function addVertices(vert, g, svgId) {
|
||||
ry: radious,
|
||||
class: classStr,
|
||||
style: styles.style,
|
||||
id: vertex.id
|
||||
id: _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].lookUpDomId(vertex.id)
|
||||
});
|
||||
});
|
||||
};
|
||||
@ -58374,7 +58398,7 @@ var addEdges = function addEdges(edges, g) {
|
||||
edgeData.class = linkNameStart + ' ' + linkNameEnd;
|
||||
edgeData.minlen = edge.length || 1; // Add the edge to the graph
|
||||
|
||||
g.setEdge(edge.start, edge.end, edgeData, cnt);
|
||||
g.setEdge(_flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].lookUpDomId(edge.start), _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].lookUpDomId(edge.end), edgeData, cnt);
|
||||
});
|
||||
};
|
||||
/**
|
||||
@ -58405,6 +58429,7 @@ var getClasses = function getClasses(text) {
|
||||
var draw = function draw(text, id) {
|
||||
_logger__WEBPACK_IMPORTED_MODULE_7__["logger"].info('Drawing flowchart');
|
||||
_flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].clear();
|
||||
_flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].setGen('gen-1');
|
||||
var parser = _parser_flow__WEBPACK_IMPORTED_MODULE_3___default.a.parser;
|
||||
parser.yy = _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"]; // Parse the graph definition
|
||||
// try {
|
||||
@ -58446,6 +58471,7 @@ var draw = function draw(text, id) {
|
||||
|
||||
|
||||
var vert = _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].getVertices();
|
||||
_logger__WEBPACK_IMPORTED_MODULE_7__["logger"].warn('Get vertices', vert);
|
||||
var edges = _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].getEdges();
|
||||
var i = 0;
|
||||
|
||||
@ -58454,7 +58480,8 @@ var draw = function draw(text, id) {
|
||||
Object(d3__WEBPACK_IMPORTED_MODULE_1__["selectAll"])('cluster').append('text');
|
||||
|
||||
for (var j = 0; j < subG.nodes.length; j++) {
|
||||
g.setParent(subG.nodes[j], subG.id);
|
||||
_logger__WEBPACK_IMPORTED_MODULE_7__["logger"].warn('Setting subgraph', subG.nodes[j], _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].lookUpDomId(subG.nodes[j]), _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].lookUpDomId(subG.id));
|
||||
g.setParent(_flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].lookUpDomId(subG.nodes[j]), _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].lookUpDomId(subG.id));
|
||||
}
|
||||
}
|
||||
|
||||
@ -58480,7 +58507,8 @@ var draw = function draw(text, id) {
|
||||
|
||||
|
||||
var svg = Object(d3__WEBPACK_IMPORTED_MODULE_1__["select"])("[id=\"".concat(id, "\"]"));
|
||||
svg.attr('xmlns:xlink', 'http://www.w3.org/1999/xlink'); // Run the renderer. This is what draws the final graph.
|
||||
svg.attr('xmlns:xlink', 'http://www.w3.org/1999/xlink');
|
||||
_logger__WEBPACK_IMPORTED_MODULE_7__["logger"].warn(g); // Run the renderer. This is what draws the final graph.
|
||||
|
||||
var element = Object(d3__WEBPACK_IMPORTED_MODULE_1__["select"])('#' + id + ' g');
|
||||
render(element, g);
|
||||
@ -58503,8 +58531,8 @@ var draw = function draw(text, id) {
|
||||
subG = subGraphs[i];
|
||||
|
||||
if (subG.title !== 'undefined') {
|
||||
var clusterRects = document.querySelectorAll('#' + id + ' [id="' + subG.id + '"] rect');
|
||||
var clusterEl = document.querySelectorAll('#' + id + ' [id="' + subG.id + '"]');
|
||||
var clusterRects = document.querySelectorAll('#' + id + ' [id="' + _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].lookUpDomId(subG.id) + '"] rect');
|
||||
var clusterEl = document.querySelectorAll('#' + id + ' [id="' + _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].lookUpDomId(subG.id) + '"]');
|
||||
var xPos = clusterRects[0].x.baseVal.value;
|
||||
var yPos = clusterRects[0].y.baseVal.value;
|
||||
var _width = clusterRects[0].width.baseVal.value;
|
||||
@ -58544,7 +58572,7 @@ var draw = function draw(text, id) {
|
||||
var vertex = vert[key];
|
||||
|
||||
if (vertex.link) {
|
||||
var node = Object(d3__WEBPACK_IMPORTED_MODULE_1__["select"])('#' + id + ' [id="' + key + '"]');
|
||||
var node = Object(d3__WEBPACK_IMPORTED_MODULE_1__["select"])('#' + id + ' [id="' + _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].lookUpDomId(key) + '"]');
|
||||
|
||||
if (node) {
|
||||
var link = document.createElementNS('http://www.w3.org/2000/svg', 'a');
|
||||
@ -64159,7 +64187,7 @@ case 4:return 24;
|
||||
break;
|
||||
case 5:/* skip comments */
|
||||
break;
|
||||
case 6:/* skip comments */{ console.log('Crap after close'); }
|
||||
case 6:/* skip comments */{ /*console.log('');*/ }
|
||||
break;
|
||||
case 7:return 19;
|
||||
break;
|
||||
@ -64357,7 +64385,6 @@ var draw = function draw(txt, id) {
|
||||
}
|
||||
|
||||
var diagram = Object(d3__WEBPACK_IMPORTED_MODULE_0__["select"])('#' + id);
|
||||
console.log('conf', conf);
|
||||
Object(_utils__WEBPACK_IMPORTED_MODULE_4__["configureSvgSize"])(diagram, height, width, conf.useMaxWidth); // Set viewBox
|
||||
|
||||
elem.setAttribute('viewBox', '0 0 ' + width + ' ' + height); // Fetch the default direction, use TD if none was found
|
||||
@ -65367,7 +65394,6 @@ var activationCount = function activationCount(part) {
|
||||
var count = 0;
|
||||
|
||||
for (i = 0; i < messages.length; i++) {
|
||||
// console.warn(i, messages[i]);
|
||||
if (messages[i].type === LINETYPE.ACTIVE_START) {
|
||||
if (messages[i].from.actor === part) {
|
||||
count++;
|
||||
@ -65875,7 +65901,6 @@ var bounds = {
|
||||
return this.verticalPos;
|
||||
},
|
||||
getBounds: function getBounds() {
|
||||
console.log('here', this.data);
|
||||
return {
|
||||
bounds: this.data,
|
||||
models: this.models
|
||||
@ -66147,7 +66172,6 @@ function adjustLoopHeightForWrap(loopWidths, msg, preMargin, postMargin, addLoop
|
||||
|
||||
var draw = function draw(text, id) {
|
||||
conf = _config__WEBPACK_IMPORTED_MODULE_6__["getConfig"]().sequence;
|
||||
console.log('there ', conf);
|
||||
_parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.clear();
|
||||
_parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.setWrap(conf.wrap);
|
||||
_parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].parse(text + '\n');
|
||||
@ -68103,8 +68127,7 @@ var addTitleAndBox = function addTitleAndBox(g, stateDef, altBkg) {
|
||||
// .attr('y2', lineY)
|
||||
// .attr('class', 'descr-divider');
|
||||
|
||||
var graphBox = g.node().getBBox(); // console.warn(width / 2, titleWidth / 2, getConfig().state.padding, orgBox);
|
||||
// descrLine.attr('x2', graphBox.width + getConfig().state.padding);
|
||||
var graphBox = g.node().getBBox(); // descrLine.attr('x2', graphBox.width + getConfig().state.padding);
|
||||
|
||||
if (stateDef.doc) {// cnsole.warn(
|
||||
// stateDef.id,
|
||||
@ -68216,8 +68239,7 @@ var _drawLongText = function _drawLongText(_text, x, y, g) {
|
||||
if (tHeight === 0) {
|
||||
var textBounds = span.node().getBBox();
|
||||
tHeight += textBounds.height;
|
||||
} // console.warn('textBounds', textBounds);
|
||||
|
||||
}
|
||||
|
||||
textHeight += tHeight;
|
||||
span.attr('x', x + Object(_config__WEBPACK_IMPORTED_MODULE_5__["getConfig"])().state.noteMargin);
|
||||
@ -68341,8 +68363,7 @@ var drawEdge = function drawEdge(elem, path, relation) {
|
||||
x = _utils$calcLabelPosit.x,
|
||||
y = _utils$calcLabelPosit.y;
|
||||
|
||||
var rows = _common_common__WEBPACK_IMPORTED_MODULE_4__["default"].getRows(relation.title); // console.warn(rows);
|
||||
|
||||
var rows = _common_common__WEBPACK_IMPORTED_MODULE_4__["default"].getRows(relation.title);
|
||||
var titleHeight = 0;
|
||||
var titleRows = [];
|
||||
var maxWidth = 0;
|
||||
@ -72371,10 +72392,6 @@ function () {
|
||||
var getThemeVariables = function getThemeVariables(userOverrides) {
|
||||
var theme = new Theme();
|
||||
theme.calculate(userOverrides);
|
||||
console.info('Theme(dark)', {
|
||||
userOverrides: userOverrides,
|
||||
theme: theme
|
||||
});
|
||||
return theme;
|
||||
};
|
||||
|
||||
@ -72600,8 +72617,7 @@ function () {
|
||||
|
||||
var getThemeVariables = function getThemeVariables(userOverrides) {
|
||||
var theme = new Theme();
|
||||
theme.calculate(userOverrides); // console.info('Theme(default)', { userOverrides, theme });
|
||||
|
||||
theme.calculate(userOverrides);
|
||||
return theme;
|
||||
};
|
||||
|
||||
@ -72797,10 +72813,6 @@ function () {
|
||||
var getThemeVariables = function getThemeVariables(userOverrides) {
|
||||
var theme = new Theme();
|
||||
theme.calculate(userOverrides);
|
||||
console.info('Theme(forest)', {
|
||||
userOverrides: userOverrides,
|
||||
theme: theme
|
||||
});
|
||||
return theme;
|
||||
};
|
||||
|
||||
@ -72869,8 +72881,7 @@ function () {
|
||||
|
||||
this.tertiaryColor = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["adjust"])(this.primaryColor, {
|
||||
h: -160
|
||||
}); // console.log('primary color', this.primaryColor, 'tertiary - color', this.tertiaryColor);
|
||||
|
||||
});
|
||||
this.primaryBorderColor = Object(_theme_helpers__WEBPACK_IMPORTED_MODULE_1__["mkBorder"])(this.primaryColor, this.darkMode);
|
||||
this.secondaryBorderColor = Object(_theme_helpers__WEBPACK_IMPORTED_MODULE_1__["mkBorder"])(this.secondaryColor, this.darkMode);
|
||||
this.tertiaryBorderColor = Object(_theme_helpers__WEBPACK_IMPORTED_MODULE_1__["mkBorder"])(this.tertiaryColor, this.darkMode); // this.noteBorderColor = mkBorder(this.noteBkgColor, this.darkMode);
|
||||
@ -73051,10 +73062,6 @@ function () {
|
||||
var getThemeVariables = function getThemeVariables(userOverrides) {
|
||||
var theme = new Theme();
|
||||
theme.calculate(userOverrides);
|
||||
console.info('Theme(neutral)', {
|
||||
userOverrides: userOverrides,
|
||||
theme: theme
|
||||
});
|
||||
return theme;
|
||||
};
|
||||
|
||||
@ -74002,7 +74009,6 @@ var calculateSvgSizeAttrs = function calculateSvgSizeAttrs(height, width, useMax
|
||||
};
|
||||
var configureSvgSize = function configureSvgSize(svgElem, height, width, useMaxWidth) {
|
||||
var attrs = calculateSvgSizeAttrs(height, width, useMaxWidth);
|
||||
console.log('svgElem', svgElem);
|
||||
d3Attrs(svgElem, attrs);
|
||||
};
|
||||
/* harmony default export */ __webpack_exports__["default"] = ({
|
||||
|
2
dist/mermaid.js.map
vendored
2
dist/mermaid.js.map
vendored
File diff suppressed because one or more lines are too long
8
dist/mermaid.min.js
vendored
8
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,6 +1,6 @@
|
||||
{
|
||||
"name": "mermaid",
|
||||
"version": "8.7.0",
|
||||
"version": "8.8.1",
|
||||
"description": "Markdownish syntax for generating flowcharts, sequence diagrams, class diagrams, gantt charts and git graphs.",
|
||||
"main": "dist/mermaid.core.js",
|
||||
"keywords": [
|
||||
|
@ -43,8 +43,6 @@ describe('Graphlib decorations', () => {
|
||||
g.setEdge('a', 'b');
|
||||
g.setEdge('C1', 'C2');
|
||||
|
||||
console.log(g.nodes())
|
||||
|
||||
expect(validate(g)).toBe(false);
|
||||
});
|
||||
it('Validate should not detect edges between clusters after adjustment', function () {
|
||||
@ -66,7 +64,6 @@ describe('Graphlib decorations', () => {
|
||||
g.setEdge('a', 'b');
|
||||
g.setEdge('C1', 'C2');
|
||||
|
||||
console.log(g.nodes())
|
||||
adjustClustersAndEdges(g);
|
||||
logger.info(g.edges())
|
||||
expect(validate(g)).toBe(true);
|
||||
|
@ -461,14 +461,12 @@ export const addSubGraph = function(_id, list, _title) {
|
||||
subGraphs.forEach(sg => {
|
||||
const pos = sg.nodes.indexOf(_id);
|
||||
if (pos >= 0) {
|
||||
console.log(sg.nodes, pos, _id);
|
||||
sg.nodes.splice(pos, 1);
|
||||
}
|
||||
});
|
||||
};
|
||||
// Removes the members of this subgraph from any other subgraphs, a node only belong to one subgraph
|
||||
subGraph.nodes.forEach(_id => del(_id));
|
||||
console.log(subGraph.nodes);
|
||||
subGraphs.push(subGraph);
|
||||
subGraphLookup[id] = subGraph;
|
||||
return id;
|
||||
|
@ -21,7 +21,6 @@ describe('[Text] when parsing', () => {
|
||||
|
||||
expect(edges[0].type).toBe('arrow_point');
|
||||
expect(edges.length).toBe(47917);
|
||||
console.log(vert);
|
||||
expect(Object.keys(vert).length).toBe(2);
|
||||
});
|
||||
|
||||
|
@ -121,7 +121,6 @@ describe('when parsing ', function() {
|
||||
|
||||
const res = flow.parser.parse(statement);
|
||||
const vertices = flow.parser.yy.getVertices();
|
||||
console.log(vertices);
|
||||
const classes = flow.parser.yy.getClasses();
|
||||
expect(vertices['node1TB'].id).toBe('node1TB');
|
||||
});
|
||||
@ -132,7 +131,6 @@ describe('when parsing ', function() {
|
||||
statement = statement + 'graph TD;A--x|text including URL space|B;';
|
||||
const res = flow.parser.parse(statement);
|
||||
const vertices = flow.parser.yy.getVertices();
|
||||
console.log(vertices);
|
||||
const classes = flow.parser.yy.getClasses();
|
||||
expect(vertices['A'].id).toBe('A');
|
||||
});
|
||||
@ -142,7 +140,6 @@ describe('when parsing ', function() {
|
||||
statement = statement + 'graph TB;subgraph "number as labels";1;end;';
|
||||
const res = flow.parser.parse(statement);
|
||||
const vertices = flow.parser.yy.getVertices();
|
||||
console.log(vertices);
|
||||
const classes = flow.parser.yy.getClasses();
|
||||
expect(vertices['1'].id).toBe('1');
|
||||
});
|
||||
|
@ -288,7 +288,6 @@ describe('when parsing subgraphs', function() {
|
||||
expect(subgraphA.nodes).not.toContain('c');
|
||||
});
|
||||
it('should handle nested subgraphs 3', function() {
|
||||
console.log('#3');
|
||||
const res = flow.parser.parse(`flowchart TB
|
||||
subgraph B
|
||||
c
|
||||
@ -304,7 +303,6 @@ describe('when parsing subgraphs', function() {
|
||||
|
||||
const subgraphA = filter(subgraphs,o => o.id === 'A')[0];
|
||||
const subgraphB = filter(subgraphs,o => o.id === 'B')[0];
|
||||
console.log(subgraphB.nodes)
|
||||
expect(subgraphB.nodes[0]).toBe('c');
|
||||
expect(subgraphA.nodes).toContain('B');
|
||||
expect(subgraphA.nodes).toContain('b');
|
||||
|
@ -20,7 +20,7 @@
|
||||
<type_directive,arg_directive>\}\%\% { this.popState(); this.popState(); return 'close_directive'; }
|
||||
<arg_directive>((?:(?!\}\%\%).|\n)*) return 'arg_directive';
|
||||
\%\%(?!\{)[^\n]* /* skip comments */
|
||||
[^\}]\%\%[^\n]* /* skip comments */{ console.log('Crap after close'); }
|
||||
[^\}]\%\%[^\n]* /* skip comments */{ /*console.log('');*/ }
|
||||
[\n\r]+ return 'NEWLINE';
|
||||
\%\%[^\n]* /* do nothing */
|
||||
[\s]+ /* ignore */
|
||||
|
@ -17,7 +17,6 @@ describe('when parsing pie', function() {
|
||||
"ash" : 100
|
||||
`);
|
||||
const sections = pieDb.getSections();
|
||||
console.log('sections: ', sections);
|
||||
const section1 = sections['ash'];
|
||||
expect(section1).toBe(100);
|
||||
});
|
||||
@ -27,7 +26,6 @@ describe('when parsing pie', function() {
|
||||
"bat" : 40
|
||||
`);
|
||||
const sections = pieDb.getSections();
|
||||
console.log('sections: ', sections);
|
||||
const section1 = sections['ash'];
|
||||
expect(section1).toBe(60);
|
||||
});
|
||||
@ -38,7 +36,6 @@ describe('when parsing pie', function() {
|
||||
"bat" : 40
|
||||
`);
|
||||
const sections = pieDb.getSections();
|
||||
console.log('sections: ', sections);
|
||||
const section1 = sections['ash'];
|
||||
expect(section1).toBe(60);
|
||||
});
|
||||
@ -50,7 +47,6 @@ pie
|
||||
"bat" : 40
|
||||
`);
|
||||
const sections = pieDb.getSections();
|
||||
console.log('sections: ', sections);
|
||||
const section1 = sections['ash'];
|
||||
expect(section1).toBe(60);
|
||||
});
|
||||
@ -62,7 +58,6 @@ pie
|
||||
`);
|
||||
const sections = pieDb.getSections();
|
||||
const title = pieDb.getTitle();
|
||||
console.log('sections: ', sections);
|
||||
const section1 = sections['ash'];
|
||||
expect(section1).toBe(60);
|
||||
expect(title).toBe('a 60/40 pie');
|
||||
@ -74,7 +69,6 @@ pie
|
||||
"bat" : 40
|
||||
`);
|
||||
const sections = pieDb.getSections();
|
||||
console.log('sections: ', sections);
|
||||
const section1 = sections['ash'];
|
||||
expect(section1).toBe(60.67);
|
||||
});
|
||||
|
@ -44,7 +44,6 @@ export const draw = (txt, id) => {
|
||||
}
|
||||
|
||||
const diagram = select('#' + id);
|
||||
console.log('conf', conf);
|
||||
configureSvgSize(diagram, height, width, conf.useMaxWidth);
|
||||
|
||||
// Set viewBox
|
||||
|
@ -43,7 +43,6 @@ const activationCount = part => {
|
||||
let i;
|
||||
let count = 0;
|
||||
for (i = 0; i < messages.length; i++) {
|
||||
// console.warn(i, messages[i]);
|
||||
if (messages[i].type === LINETYPE.ACTIVE_START) {
|
||||
if (messages[i].from.actor === part) {
|
||||
count++;
|
||||
|
@ -942,7 +942,6 @@ describe('when rendering a sequenceDiagram APA', function() {
|
||||
wrap: false,
|
||||
mirrorActors: false
|
||||
};
|
||||
console.warn('Set site config');
|
||||
configApi.setSiteConfig({ logLevel: 5, sequence: conf });
|
||||
});
|
||||
let conf;
|
||||
@ -1249,7 +1248,6 @@ Bob->>Alice: Fine!`;
|
||||
const { bounds, models } = renderer.bounds.getBounds();
|
||||
const msgs = parser.yy.getMessages();
|
||||
const mermaid = mermaidAPI.getConfig();
|
||||
console.log(mermaid)
|
||||
expect(bounds.startx).toBe(-(conf.width / 2) - conf.actorMargin / 2);
|
||||
expect(bounds.starty).toBe(0);
|
||||
expect(mermaid.theme).toBe('dark');
|
||||
|
@ -169,7 +169,6 @@ export const addTitleAndBox = (g, stateDef, altBkg) => {
|
||||
// .attr('class', 'descr-divider');
|
||||
|
||||
const graphBox = g.node().getBBox();
|
||||
// console.warn(width / 2, titleWidth / 2, getConfig().state.padding, orgBox);
|
||||
// descrLine.attr('x2', graphBox.width + getConfig().state.padding);
|
||||
|
||||
if (stateDef.doc) {
|
||||
@ -328,7 +327,6 @@ const _drawLongText = (_text, x, y, g) => {
|
||||
const textBounds = span.node().getBBox();
|
||||
tHeight += textBounds.height;
|
||||
}
|
||||
// console.warn('textBounds', textBounds);
|
||||
textHeight += tHeight;
|
||||
span.attr('x', x + getConfig().state.noteMargin);
|
||||
span.attr('y', y + textHeight + 1.25 * getConfig().state.noteMargin);
|
||||
@ -456,8 +454,6 @@ export const drawEdge = function(elem, path, relation) {
|
||||
|
||||
const rows = common.getRows(relation.title);
|
||||
|
||||
// console.warn(rows);
|
||||
|
||||
let titleHeight = 0;
|
||||
const titleRows = [];
|
||||
let maxWidth = 0;
|
||||
|
@ -166,6 +166,5 @@ class Theme {
|
||||
export const getThemeVariables = userOverrides => {
|
||||
const theme = new Theme();
|
||||
theme.calculate(userOverrides);
|
||||
// console.info('Theme(dark)', { userOverrides, theme });
|
||||
return theme;
|
||||
};
|
||||
|
@ -177,6 +177,5 @@ class Theme {
|
||||
export const getThemeVariables = userOverrides => {
|
||||
const theme = new Theme();
|
||||
theme.calculate(userOverrides);
|
||||
// console.info('Theme(default)', { userOverrides, theme });
|
||||
return theme;
|
||||
};
|
||||
|
@ -147,6 +147,5 @@ class Theme {
|
||||
export const getThemeVariables = userOverrides => {
|
||||
const theme = new Theme();
|
||||
theme.calculate(userOverrides);
|
||||
// console.info('Theme(forest)', { userOverrides, theme });
|
||||
return theme;
|
||||
};
|
||||
|
@ -13,7 +13,6 @@ class Theme {
|
||||
|
||||
// this.secondaryColor = adjust(this.primaryColor, { h: 120 });
|
||||
this.tertiaryColor = adjust(this.primaryColor, { h: -160 });
|
||||
// console.log('primary color', this.primaryColor, 'tertiary - color', this.tertiaryColor);
|
||||
this.primaryBorderColor = mkBorder(this.primaryColor, this.darkMode);
|
||||
this.secondaryBorderColor = mkBorder(this.secondaryColor, this.darkMode);
|
||||
this.tertiaryBorderColor = mkBorder(this.tertiaryColor, this.darkMode);
|
||||
@ -185,6 +184,5 @@ class Theme {
|
||||
export const getThemeVariables = userOverrides => {
|
||||
const theme = new Theme();
|
||||
theme.calculate(userOverrides);
|
||||
// console.info('Theme(neutral)', { userOverrides, theme });
|
||||
return theme;
|
||||
};
|
||||
|
@ -787,7 +787,6 @@ export const calculateSvgSizeAttrs = function(height, width, useMaxWidth) {
|
||||
|
||||
export const configureSvgSize = function(svgElem, height, width, useMaxWidth) {
|
||||
const attrs = calculateSvgSizeAttrs(height, width, useMaxWidth);
|
||||
console.log('svgElem', svgElem);
|
||||
d3Attrs(svgElem, attrs);
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user