mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-01-14 06:43:25 +08:00
Merge branch 'mermaid-js-develop' into develop
This commit is contained in:
commit
dba617a7fe
@ -4,10 +4,12 @@
|
|||||||
href="https://fonts.googleapis.com/css?family=Montserrat&display=swap"
|
href="https://fonts.googleapis.com/css?family=Montserrat&display=swap"
|
||||||
rel="stylesheet"
|
rel="stylesheet"
|
||||||
/>
|
/>
|
||||||
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
|
||||||
<link href="https://fonts.googleapis.com/css?family=Noto+Sans+SC&display=swap" rel="stylesheet">
|
<link href="https://fonts.googleapis.com/css?family=Noto+Sans+SC&display=swap" rel="stylesheet">
|
||||||
<style>
|
<style>
|
||||||
body {
|
body {
|
||||||
background: rgb(221, 208, 208);
|
/* background: rgb(221, 208, 208); */
|
||||||
|
background:#333;
|
||||||
font-family: 'Arial';
|
font-family: 'Arial';
|
||||||
}
|
}
|
||||||
h1 { color: white;}
|
h1 { color: white;}
|
||||||
@ -19,17 +21,9 @@
|
|||||||
<body>
|
<body>
|
||||||
<h1>info below</h1>
|
<h1>info below</h1>
|
||||||
<div class="mermaid" style="width: 100%; height: 20%;">
|
<div class="mermaid" style="width: 100%; height: 20%;">
|
||||||
flowchart TD
|
flowchart LR
|
||||||
db[(PostgreSQL<br/>database)]
|
user1[fa:fa-user User 1] -- edit -> folder
|
||||||
broker{RabbitMQ<br/>broker}
|
|
||||||
db --> broker
|
|
||||||
box --> broker
|
|
||||||
</div>
|
</div>
|
||||||
broker --> db
|
|
||||||
broker --> box
|
|
||||||
db --> broker
|
|
||||||
box --> broker
|
|
||||||
|
|
||||||
<div class="mermaid2" style="width: 50%; height: 20%;">
|
<div class="mermaid2" style="width: 50%; height: 20%;">
|
||||||
flowchart LR
|
flowchart LR
|
||||||
A{{A}}-- apa -->B{{B}};
|
A{{A}}-- apa -->B{{B}};
|
||||||
@ -245,12 +239,15 @@ stateDiagram-v2
|
|||||||
</div>
|
</div>
|
||||||
<script src="./mermaid.js"></script>
|
<script src="./mermaid.js"></script>
|
||||||
<script>
|
<script>
|
||||||
|
mermaid.parseError = function (err, hash) {
|
||||||
|
// console.error('Mermaid error: ', err);
|
||||||
|
};
|
||||||
mermaid.initialize({
|
mermaid.initialize({
|
||||||
// theme: 'dark',
|
theme: 'dark',
|
||||||
// arrowMarkerAbsolute: true,
|
// arrowMarkerAbsolute: true,
|
||||||
// themeCSS: '.edgePath .path {stroke: red;} .arrowheadPath {fill: red;}',
|
// themeCSS: '.edgePath .path {stroke: red;} .arrowheadPath {fill: red;}',
|
||||||
logLevel: 0,
|
logLevel: 0,
|
||||||
flowchart: { curve: 'linear', "htmlLabels": true },
|
flowchart: { curve: 'linear', "htmlLabels": false },
|
||||||
// gantt: { axisFormat: '%m/%d/%Y' },
|
// gantt: { axisFormat: '%m/%d/%Y' },
|
||||||
sequence: { actorMargin: 50, showSequenceNumbers: true },
|
sequence: { actorMargin: 50, showSequenceNumbers: true },
|
||||||
// sequenceDiagram: { actorMargin: 300 } // deprecated
|
// sequenceDiagram: { actorMargin: 300 } // deprecated
|
||||||
|
327
dist/mermaid.core.js
vendored
327
dist/mermaid.core.js
vendored
File diff suppressed because one or more lines are too long
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
326
dist/mermaid.js
vendored
326
dist/mermaid.js
vendored
File diff suppressed because one or more lines are too long
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
9
dist_dev/mermaid.core.js
Normal file
9
dist_dev/mermaid.core.js
Normal file
File diff suppressed because one or more lines are too long
1
dist_dev/mermaid.core.js.map
Normal file
1
dist_dev/mermaid.core.js.map
Normal file
File diff suppressed because one or more lines are too long
42
dist_dev/mermaid.js
Normal file
42
dist_dev/mermaid.js
Normal file
File diff suppressed because one or more lines are too long
1
dist_dev/mermaid.js.map
Normal file
1
dist_dev/mermaid.js.map
Normal file
File diff suppressed because one or more lines are too long
42
dist_dev/mermaid.min.js
vendored
Normal file
42
dist_dev/mermaid.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
dist_dev/mermaid.min.js.map
Normal file
1
dist_dev/mermaid.min.js.map
Normal file
File diff suppressed because one or more lines are too long
@ -7,7 +7,7 @@
|
|||||||
<meta name="description" content="Markdownish syntax for generating flowcharts, sequence diagrams, class diagrams, gantt charts and git graphs.">
|
<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">
|
<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="//unpkg.com/docsify/lib/themes/vue.css">
|
||||||
<script src="//cdn.jsdelivr.net/npm/mermaid@8.5.1/dist/mermaid.min.js"></script>
|
<script src="//cdn.jsdelivr.net/npm/mermaid@8.5.2/dist/mermaid.min.js"></script>
|
||||||
<!-- <script src="http://localhost:9000/mermaid.js"></script> -->
|
<!-- <script src="http://localhost:9000/mermaid.js"></script> -->
|
||||||
<script>
|
<script>
|
||||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||||
|
12
img/bomb-svgrepo-com.svg
Normal file
12
img/bomb-svgrepo-com.svg
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<?xml version='1.0' encoding='iso-8859-1'?>
|
||||||
|
<!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'>
|
||||||
|
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" xmlns:xlink="http://www.w3.org/1999/xlink" enable-background="new 0 0 512 512">
|
||||||
|
<g>
|
||||||
|
<path d="m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z"/>
|
||||||
|
<path d="m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z"/>
|
||||||
|
<path d="m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z"/>
|
||||||
|
<path d="m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z"/>
|
||||||
|
<path d="m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z"/>
|
||||||
|
<path d="m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z"/>
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 1.7 KiB |
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "mermaid",
|
"name": "mermaid",
|
||||||
"version": "8.5.1",
|
"version": "8.5.2",
|
||||||
"description": "Markdownish syntax for generating flowcharts, sequence diagrams, class diagrams, gantt charts and git graphs.",
|
"description": "Markdownish syntax for generating flowcharts, sequence diagrams, class diagrams, gantt charts and git graphs.",
|
||||||
"main": "dist/mermaid.core.js",
|
"main": "dist/mermaid.core.js",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
|
@ -268,8 +268,13 @@ export const getClasses = function(text) {
|
|||||||
const parser = flow.parser;
|
const parser = flow.parser;
|
||||||
parser.yy = flowDb;
|
parser.yy = flowDb;
|
||||||
|
|
||||||
// Parse the graph definition
|
try {
|
||||||
parser.parse(text);
|
// Parse the graph definition
|
||||||
|
parser.parse(text);
|
||||||
|
} catch (e) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
return flowDb.getClasses();
|
return flowDb.getClasses();
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -278,6 +283,7 @@ export const getClasses = function(text) {
|
|||||||
* @param text
|
* @param text
|
||||||
* @param id
|
* @param id
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export const draw = function(text, id) {
|
export const draw = function(text, id) {
|
||||||
logger.info('Drawing flowchart');
|
logger.info('Drawing flowchart');
|
||||||
flowDb.clear();
|
flowDb.clear();
|
||||||
@ -285,11 +291,11 @@ export const draw = function(text, id) {
|
|||||||
parser.yy = flowDb;
|
parser.yy = flowDb;
|
||||||
|
|
||||||
// Parse the graph definition
|
// Parse the graph definition
|
||||||
try {
|
// try {
|
||||||
parser.parse(text);
|
parser.parse(text);
|
||||||
} catch (err) {
|
// } catch (err) {
|
||||||
logger.debug('Parsing failed');
|
// logger.debug('Parsing failed');
|
||||||
}
|
// }
|
||||||
|
|
||||||
// Fetch the default direction, use TD if none was found
|
// Fetch the default direction, use TD if none was found
|
||||||
let dir = flowDb.getDirection();
|
let dir = flowDb.getDirection();
|
||||||
|
@ -247,12 +247,16 @@ export const addEdges = function(edges, g) {
|
|||||||
export const getClasses = function(text) {
|
export const getClasses = function(text) {
|
||||||
logger.info('Extracting classes');
|
logger.info('Extracting classes');
|
||||||
flowDb.clear();
|
flowDb.clear();
|
||||||
const parser = flow.parser;
|
try {
|
||||||
parser.yy = flowDb;
|
const parser = flow.parser;
|
||||||
|
parser.yy = flowDb;
|
||||||
|
|
||||||
// Parse the graph definition
|
// Parse the graph definition
|
||||||
parser.parse(text);
|
parser.parse(text);
|
||||||
return flowDb.getClasses();
|
return flowDb.getClasses();
|
||||||
|
} catch (e) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -267,11 +271,11 @@ export const draw = function(text, id) {
|
|||||||
parser.yy = flowDb;
|
parser.yy = flowDb;
|
||||||
|
|
||||||
// Parse the graph definition
|
// Parse the graph definition
|
||||||
try {
|
// try {
|
||||||
parser.parse(text);
|
parser.parse(text);
|
||||||
} catch (err) {
|
// } catch (err) {
|
||||||
logger.debug('Parsing failed');
|
// logger.debug('Parsing failed');
|
||||||
}
|
// }
|
||||||
|
|
||||||
// Fetch the default direction, use TD if none was found
|
// Fetch the default direction, use TD if none was found
|
||||||
let dir = flowDb.getDirection();
|
let dir = flowDb.getDirection();
|
||||||
|
98
src/errorRenderer.js
Normal file
98
src/errorRenderer.js
Normal file
@ -0,0 +1,98 @@
|
|||||||
|
/**
|
||||||
|
* Created by knut on 14-12-11.
|
||||||
|
*/
|
||||||
|
import { select } from 'd3';
|
||||||
|
import { logger } from './logger';
|
||||||
|
|
||||||
|
const conf = {};
|
||||||
|
export const setConf = function(cnf) {
|
||||||
|
const keys = Object.keys(cnf);
|
||||||
|
|
||||||
|
keys.forEach(function(key) {
|
||||||
|
conf[key] = cnf[key];
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Draws a an info picture in the tag with id: id based on the graph definition in text.
|
||||||
|
* @param text
|
||||||
|
* @param id
|
||||||
|
*/
|
||||||
|
export const draw = (id, ver) => {
|
||||||
|
try {
|
||||||
|
logger.debug('Renering svg for syntax error\n');
|
||||||
|
|
||||||
|
const svg = select('#' + id);
|
||||||
|
|
||||||
|
const g = svg.append('g');
|
||||||
|
|
||||||
|
g.append('path')
|
||||||
|
.attr('class', 'error-icon')
|
||||||
|
.attr(
|
||||||
|
'd',
|
||||||
|
'm411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z'
|
||||||
|
);
|
||||||
|
|
||||||
|
g.append('path')
|
||||||
|
.attr('class', 'error-icon')
|
||||||
|
.attr(
|
||||||
|
'd',
|
||||||
|
'm459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z'
|
||||||
|
);
|
||||||
|
|
||||||
|
g.append('path')
|
||||||
|
.attr('class', 'error-icon')
|
||||||
|
.attr(
|
||||||
|
'd',
|
||||||
|
'm340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z'
|
||||||
|
);
|
||||||
|
|
||||||
|
g.append('path')
|
||||||
|
.attr('class', 'error-icon')
|
||||||
|
.attr(
|
||||||
|
'd',
|
||||||
|
'm400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z'
|
||||||
|
);
|
||||||
|
|
||||||
|
g.append('path')
|
||||||
|
.attr('class', 'error-icon')
|
||||||
|
.attr(
|
||||||
|
'd',
|
||||||
|
'm496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z'
|
||||||
|
);
|
||||||
|
|
||||||
|
g.append('path')
|
||||||
|
.attr('class', 'error-icon')
|
||||||
|
.attr(
|
||||||
|
'd',
|
||||||
|
'm436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z'
|
||||||
|
);
|
||||||
|
|
||||||
|
g.append('text') // text label for the x axis
|
||||||
|
.attr('class', 'error-text')
|
||||||
|
.attr('x', 1240)
|
||||||
|
.attr('y', 250)
|
||||||
|
.attr('font-size', '150px')
|
||||||
|
.style('text-anchor', 'middle')
|
||||||
|
.text('Syntax error in graph');
|
||||||
|
g.append('text') // text label for the x axis
|
||||||
|
.attr('class', 'error-text')
|
||||||
|
.attr('x', 1050)
|
||||||
|
.attr('y', 400)
|
||||||
|
.attr('font-size', '100px')
|
||||||
|
.style('text-anchor', 'middle')
|
||||||
|
.text('mermaid version ' + ver);
|
||||||
|
|
||||||
|
svg.attr('height', 100);
|
||||||
|
svg.attr('width', 400);
|
||||||
|
svg.attr('viewBox', '768 0 512 512');
|
||||||
|
} catch (e) {
|
||||||
|
logger.error('Error while rendering info diagram');
|
||||||
|
logger.error(e.message);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
export default {
|
||||||
|
setConf,
|
||||||
|
draw
|
||||||
|
};
|
@ -98,18 +98,26 @@ const init = function() {
|
|||||||
.trim()
|
.trim()
|
||||||
.replace(/<br\s*\/?>/gi, '<br/>');
|
.replace(/<br\s*\/?>/gi, '<br/>');
|
||||||
|
|
||||||
mermaidAPI.render(
|
try {
|
||||||
id,
|
mermaidAPI.render(
|
||||||
txt,
|
id,
|
||||||
(svgCode, bindFunctions) => {
|
txt,
|
||||||
element.innerHTML = svgCode;
|
(svgCode, bindFunctions) => {
|
||||||
if (typeof callback !== 'undefined') {
|
element.innerHTML = svgCode;
|
||||||
callback(id);
|
if (typeof callback !== 'undefined') {
|
||||||
}
|
callback(id);
|
||||||
if (bindFunctions) bindFunctions(element);
|
}
|
||||||
},
|
if (bindFunctions) bindFunctions(element);
|
||||||
element
|
},
|
||||||
);
|
element
|
||||||
|
);
|
||||||
|
} catch (e) {
|
||||||
|
logger.warn('Syntax Error rendering');
|
||||||
|
logger.warn(e);
|
||||||
|
if (this.parseError) {
|
||||||
|
this.parseError(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -37,6 +37,7 @@ import gitGraphRenderer from './diagrams/git/gitGraphRenderer';
|
|||||||
import gitGraphParser from './diagrams/git/parser/gitGraph';
|
import gitGraphParser from './diagrams/git/parser/gitGraph';
|
||||||
import gitGraphAst from './diagrams/git/gitGraphAst';
|
import gitGraphAst from './diagrams/git/gitGraphAst';
|
||||||
import infoRenderer from './diagrams/info/infoRenderer';
|
import infoRenderer from './diagrams/info/infoRenderer';
|
||||||
|
import errorRenderer from './errorRenderer';
|
||||||
import infoParser from './diagrams/info/parser/info';
|
import infoParser from './diagrams/info/parser/info';
|
||||||
import infoDb from './diagrams/info/infoDb';
|
import infoDb from './diagrams/info/infoDb';
|
||||||
import pieRenderer from './diagrams/pie/pieRenderer';
|
import pieRenderer from './diagrams/pie/pieRenderer';
|
||||||
@ -791,73 +792,79 @@ const render = function(id, _txt, cb, container) {
|
|||||||
}`;
|
}`;
|
||||||
svg.insertBefore(style2, firstChild);
|
svg.insertBefore(style2, firstChild);
|
||||||
|
|
||||||
switch (graphType) {
|
try {
|
||||||
case 'git':
|
switch (graphType) {
|
||||||
config.flowchart.arrowMarkerAbsolute = config.arrowMarkerAbsolute;
|
case 'git':
|
||||||
gitGraphRenderer.setConf(config.git);
|
config.flowchart.arrowMarkerAbsolute = config.arrowMarkerAbsolute;
|
||||||
gitGraphRenderer.draw(txt, id, false);
|
gitGraphRenderer.setConf(config.git);
|
||||||
break;
|
gitGraphRenderer.draw(txt, id, false);
|
||||||
case 'flowchart':
|
break;
|
||||||
config.flowchart.arrowMarkerAbsolute = config.arrowMarkerAbsolute;
|
case 'flowchart':
|
||||||
flowRenderer.setConf(config.flowchart);
|
config.flowchart.arrowMarkerAbsolute = config.arrowMarkerAbsolute;
|
||||||
flowRenderer.draw(txt, id, false);
|
flowRenderer.setConf(config.flowchart);
|
||||||
break;
|
flowRenderer.draw(txt, id, false);
|
||||||
case 'flowchart-v2':
|
break;
|
||||||
config.flowchart.arrowMarkerAbsolute = config.arrowMarkerAbsolute;
|
case 'flowchart-v2':
|
||||||
flowRendererV2.setConf(config.flowchart);
|
config.flowchart.arrowMarkerAbsolute = config.arrowMarkerAbsolute;
|
||||||
flowRendererV2.draw(txt, id, false);
|
flowRendererV2.setConf(config.flowchart);
|
||||||
break;
|
flowRendererV2.draw(txt, id, false);
|
||||||
case 'sequence':
|
break;
|
||||||
config.sequence.arrowMarkerAbsolute = config.arrowMarkerAbsolute;
|
case 'sequence':
|
||||||
if (config.sequenceDiagram) {
|
config.sequence.arrowMarkerAbsolute = config.arrowMarkerAbsolute;
|
||||||
// backwards compatibility
|
if (config.sequenceDiagram) {
|
||||||
sequenceRenderer.setConf(Object.assign(config.sequence, config.sequenceDiagram));
|
// backwards compatibility
|
||||||
console.error(
|
sequenceRenderer.setConf(Object.assign(config.sequence, config.sequenceDiagram));
|
||||||
'`mermaid config.sequenceDiagram` has been renamed to `config.sequence`. Please update your mermaid config.'
|
console.error(
|
||||||
);
|
'`mermaid config.sequenceDiagram` has been renamed to `config.sequence`. Please update your mermaid config.'
|
||||||
} else {
|
);
|
||||||
sequenceRenderer.setConf(config.sequence);
|
} else {
|
||||||
}
|
sequenceRenderer.setConf(config.sequence);
|
||||||
sequenceRenderer.draw(txt, id);
|
}
|
||||||
break;
|
sequenceRenderer.draw(txt, id);
|
||||||
case 'gantt':
|
break;
|
||||||
config.gantt.arrowMarkerAbsolute = config.arrowMarkerAbsolute;
|
case 'gantt':
|
||||||
ganttRenderer.setConf(config.gantt);
|
config.gantt.arrowMarkerAbsolute = config.arrowMarkerAbsolute;
|
||||||
ganttRenderer.draw(txt, id);
|
ganttRenderer.setConf(config.gantt);
|
||||||
break;
|
ganttRenderer.draw(txt, id);
|
||||||
case 'class':
|
break;
|
||||||
config.class.arrowMarkerAbsolute = config.arrowMarkerAbsolute;
|
case 'class':
|
||||||
classRenderer.setConf(config.class);
|
config.class.arrowMarkerAbsolute = config.arrowMarkerAbsolute;
|
||||||
classRenderer.draw(txt, id);
|
classRenderer.setConf(config.class);
|
||||||
break;
|
classRenderer.draw(txt, id);
|
||||||
case 'state':
|
break;
|
||||||
// config.class.arrowMarkerAbsolute = config.arrowMarkerAbsolute;
|
case 'state':
|
||||||
stateRenderer.setConf(config.state);
|
// config.class.arrowMarkerAbsolute = config.arrowMarkerAbsolute;
|
||||||
stateRenderer.draw(txt, id);
|
stateRenderer.setConf(config.state);
|
||||||
break;
|
stateRenderer.draw(txt, id);
|
||||||
case 'stateDiagram':
|
break;
|
||||||
// config.class.arrowMarkerAbsolute = config.arrowMarkerAbsolute;
|
case 'stateDiagram':
|
||||||
stateRendererV2.setConf(config.state);
|
// config.class.arrowMarkerAbsolute = config.arrowMarkerAbsolute;
|
||||||
stateRendererV2.draw(txt, id);
|
stateRendererV2.setConf(config.state);
|
||||||
break;
|
stateRendererV2.draw(txt, id);
|
||||||
case 'info':
|
break;
|
||||||
config.class.arrowMarkerAbsolute = config.arrowMarkerAbsolute;
|
case 'info':
|
||||||
infoRenderer.setConf(config.class);
|
config.class.arrowMarkerAbsolute = config.arrowMarkerAbsolute;
|
||||||
infoRenderer.draw(txt, id, pkg.version);
|
infoRenderer.setConf(config.class);
|
||||||
break;
|
infoRenderer.draw(txt, id, pkg.version);
|
||||||
case 'pie':
|
break;
|
||||||
config.class.arrowMarkerAbsolute = config.arrowMarkerAbsolute;
|
case 'pie':
|
||||||
pieRenderer.setConf(config.class);
|
config.class.arrowMarkerAbsolute = config.arrowMarkerAbsolute;
|
||||||
pieRenderer.draw(txt, id, pkg.version);
|
pieRenderer.setConf(config.class);
|
||||||
break;
|
pieRenderer.draw(txt, id, pkg.version);
|
||||||
case 'er':
|
break;
|
||||||
erRenderer.setConf(config.er);
|
case 'er':
|
||||||
erRenderer.draw(txt, id, pkg.version);
|
erRenderer.setConf(config.er);
|
||||||
break;
|
erRenderer.draw(txt, id, pkg.version);
|
||||||
case 'journey':
|
break;
|
||||||
journeyRenderer.setConf(config.journey);
|
case 'journey':
|
||||||
journeyRenderer.draw(txt, id, pkg.version);
|
journeyRenderer.setConf(config.journey);
|
||||||
break;
|
journeyRenderer.draw(txt, id, pkg.version);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
errorRenderer.setConf(config.class);
|
||||||
|
errorRenderer.draw(id, pkg.version);
|
||||||
|
throw e;
|
||||||
}
|
}
|
||||||
|
|
||||||
select(`[id="${id}"]`)
|
select(`[id="${id}"]`)
|
||||||
|
@ -59,4 +59,7 @@ $todayLineColor: #DB5757;
|
|||||||
/* state colors */
|
/* state colors */
|
||||||
$labelColor: black;
|
$labelColor: black;
|
||||||
|
|
||||||
|
$errorBkgColor: #a44141;
|
||||||
|
$errorTextColor: #ddd;
|
||||||
|
|
||||||
@import '../mermaid';
|
@import '../mermaid';
|
||||||
|
@ -57,4 +57,7 @@ $todayLineColor: red;
|
|||||||
/* state colors */
|
/* state colors */
|
||||||
$labelColor: black;
|
$labelColor: black;
|
||||||
|
|
||||||
|
$errorBkgColor: #552222;
|
||||||
|
$errorTextColor: #552222;
|
||||||
|
|
||||||
@import '../mermaid';
|
@import '../mermaid';
|
||||||
|
@ -58,4 +58,7 @@ $todayLineColor: red;
|
|||||||
/* state colors */
|
/* state colors */
|
||||||
$labelColor: black;
|
$labelColor: black;
|
||||||
|
|
||||||
|
$errorBkgColor: #552222;
|
||||||
|
$errorTextColor: #552222;
|
||||||
|
|
||||||
@import '../mermaid';
|
@import '../mermaid';
|
||||||
|
@ -17,3 +17,10 @@
|
|||||||
// --mermaid-alt-font-family: '"Lucida Console", Monaco, monospace';
|
// --mermaid-alt-font-family: '"Lucida Console", Monaco, monospace';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.error-icon {
|
||||||
|
fill: $errorBkgColor;
|
||||||
|
}
|
||||||
|
.error-text {
|
||||||
|
fill: $errorTextColor;
|
||||||
|
stroke: $errorTextColor;
|
||||||
|
}
|
@ -62,4 +62,7 @@ $todayLineColor: $critBkgColor;
|
|||||||
/* state colors */
|
/* state colors */
|
||||||
$labelColor: black;
|
$labelColor: black;
|
||||||
|
|
||||||
|
$errorBkgColor: #552222;
|
||||||
|
$errorTextColor: #552222;
|
||||||
|
|
||||||
@import '../mermaid';
|
@import '../mermaid';
|
||||||
|
@ -11079,9 +11079,9 @@ websocket-driver@>=0.5.1:
|
|||||||
websocket-extensions ">=0.1.1"
|
websocket-extensions ">=0.1.1"
|
||||||
|
|
||||||
websocket-extensions@>=0.1.1:
|
websocket-extensions@>=0.1.1:
|
||||||
version "0.1.3"
|
version "0.1.4"
|
||||||
resolved "https://registry.yarnpkg.com/websocket-extensions/-/websocket-extensions-0.1.3.tgz#5d2ff22977003ec687a4b87073dfbbac146ccf29"
|
resolved "https://registry.yarnpkg.com/websocket-extensions/-/websocket-extensions-0.1.4.tgz#7f8473bc839dfd87608adb95d7eb075211578a42"
|
||||||
integrity sha512-nqHUnMXmBzT0w570r2JpJxfiSD1IzoI+HGVdd3aZ0yNi3ngvQ4jv1dtHt5VGxfI2yj5yqImPhOK4vmIh2xMbGg==
|
integrity sha512-OqedPIGOfsDlo31UNwYbCFMSaO9m9G/0faIHj5/dZFDMFqPTcx6UwqyOy3COEaEOg/9VsGIpdqn62W5KhoKSpg==
|
||||||
|
|
||||||
whatwg-encoding@^1.0.1, whatwg-encoding@^1.0.3:
|
whatwg-encoding@^1.0.1, whatwg-encoding@^1.0.3:
|
||||||
version "1.0.5"
|
version "1.0.5"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user