mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-01-28 07:03:17 +08:00
New release
This commit is contained in:
parent
c211434c38
commit
074a819ca8
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "mermaid",
|
"name": "mermaid",
|
||||||
"version": "0.3.3",
|
"version": "0.3.4",
|
||||||
"authors": [
|
"authors": [
|
||||||
"knsv <knut@sveido.com>"
|
"knsv <knut@sveido.com>"
|
||||||
],
|
],
|
||||||
|
766
dist/mermaid.full.js
vendored
766
dist/mermaid.full.js
vendored
File diff suppressed because one or more lines are too long
32
dist/mermaid.full.min.js
vendored
32
dist/mermaid.full.min.js
vendored
File diff suppressed because one or more lines are too long
756
dist/mermaid.slim.js
vendored
756
dist/mermaid.slim.js
vendored
File diff suppressed because one or more lines are too long
22
dist/mermaid.slim.min.js
vendored
22
dist/mermaid.slim.min.js
vendored
File diff suppressed because one or more lines are too long
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "mermaid",
|
"name": "mermaid",
|
||||||
"version": "0.3.3",
|
"version": "0.3.4",
|
||||||
"description": "Markdownish syntax for generating flowcharts",
|
"description": "Markdownish syntax for generating flowcharts",
|
||||||
"main": "src/main.js",
|
"main": "src/main.js",
|
||||||
"bin": {
|
"bin": {
|
||||||
@ -32,7 +32,7 @@
|
|||||||
"clone": "^0.2.0",
|
"clone": "^0.2.0",
|
||||||
"codeclimate-test-reporter": "0.0.4",
|
"codeclimate-test-reporter": "0.0.4",
|
||||||
"d3": "~3.4.13",
|
"d3": "~3.4.13",
|
||||||
"dagre-d3": "~0.3.2",
|
"dagre-d3": "~0.3.3",
|
||||||
"event-stream": "^3.2.0",
|
"event-stream": "^3.2.0",
|
||||||
"foundation": "^4.2.1-1",
|
"foundation": "^4.2.1-1",
|
||||||
"front-matter": "^0.2.0",
|
"front-matter": "^0.2.0",
|
||||||
|
@ -32,25 +32,25 @@
|
|||||||
">" return 'TAGEND';
|
">" return 'TAGEND';
|
||||||
"^" return 'UP';
|
"^" return 'UP';
|
||||||
"v" return 'DOWN';
|
"v" return 'DOWN';
|
||||||
\-\-[x] return 'ARROW_CROSS';
|
\s*\-\-[x]\s* return 'ARROW_CROSS';
|
||||||
\-\-\> return 'ARROW_POINT';
|
\s*\-\-\>\s* return 'ARROW_POINT';
|
||||||
\-\-[o] return 'ARROW_CIRCLE';
|
\s*\-\-[o]\s* return 'ARROW_CIRCLE';
|
||||||
\-\-\- return 'ARROW_OPEN';
|
\s*\-\-\-\s* return 'ARROW_OPEN';
|
||||||
\-\.\-[x] return 'DOTTED_ARROW_CROSS';
|
\s*\-\.\-[x]\s* return 'DOTTED_ARROW_CROSS';
|
||||||
\-\.\-\> return 'DOTTED_ARROW_POINT';
|
\s*\-\.\-\>\s* return 'DOTTED_ARROW_POINT';
|
||||||
\-\.\-[o] return 'DOTTED_ARROW_CIRCLE';
|
\s*\-\.\-[o]\s* return 'DOTTED_ARROW_CIRCLE';
|
||||||
\-\.\- return 'DOTTED_ARROW_OPEN';
|
\s*\-\.\-\s* return 'DOTTED_ARROW_OPEN';
|
||||||
.\-[x] return 'DOTTED_ARROW_CROSS';
|
\s*.\-[x]\s* return 'DOTTED_ARROW_CROSS';
|
||||||
\.\-\> return 'DOTTED_ARROW_POINT';
|
\s*\.\-\>\s* return 'DOTTED_ARROW_POINT';
|
||||||
\.\-[o] return 'DOTTED_ARROW_CIRCLE';
|
\s*\.\-[o]\s* return 'DOTTED_ARROW_CIRCLE';
|
||||||
\.\- return 'DOTTED_ARROW_OPEN';
|
\s*\.\-\s* return 'DOTTED_ARROW_OPEN';
|
||||||
\=\=[x] return 'THICK_ARROW_CROSS';
|
\s*\=\=[x]\s* return 'THICK_ARROW_CROSS';
|
||||||
\=\=\> return 'THICK_ARROW_POINT';
|
\s*\=\=\>\s* return 'THICK_ARROW_POINT';
|
||||||
\=\=[o] return 'THICK_ARROW_CIRCLE';
|
\s*\=\=[o]\s* return 'THICK_ARROW_CIRCLE';
|
||||||
\=\=[\=] return 'THICK_ARROW_OPEN';
|
\s*\=\=[\=]\s* return 'THICK_ARROW_OPEN';
|
||||||
\-\- return '--';
|
\s*\-\-\s* return '--';
|
||||||
\-\. return '-.';
|
\s*\-\.\s* return '-.';
|
||||||
\=\= return '==';
|
\s*\=\=\s* return '==';
|
||||||
\- return 'MINUS';
|
\- return 'MINUS';
|
||||||
"." return 'DOT';
|
"." return 'DOT';
|
||||||
\+ return 'PLUS';
|
\+ return 'PLUS';
|
||||||
@ -121,11 +121,11 @@
|
|||||||
return 'ALPHA';
|
return 'ALPHA';
|
||||||
"|" return 'PIPE';
|
"|" return 'PIPE';
|
||||||
"(" return 'PS';
|
"(" return 'PS';
|
||||||
")" return 'PE';
|
")"\s* return 'PE';
|
||||||
"[" return 'SQS';
|
"[" return 'SQS';
|
||||||
"]" return 'SQE';
|
"]"\s* return 'SQE';
|
||||||
"{" return 'DIAMOND_START'
|
"{" return 'DIAMOND_START'
|
||||||
"}" return 'DIAMOND_STOP'
|
"}"\s* return 'DIAMOND_STOP'
|
||||||
"\"" return 'QUOTE';
|
"\"" return 'QUOTE';
|
||||||
\n return 'NEWLINE';
|
\n return 'NEWLINE';
|
||||||
\s return 'SPACE';
|
\s return 'SPACE';
|
||||||
@ -273,8 +273,7 @@ alphaNumStatement
|
|||||||
{$$=$1+'-'+$3;}
|
{$$=$1+'-'+$3;}
|
||||||
;
|
;
|
||||||
|
|
||||||
|
linkOld: linkStatement arrowText
|
||||||
link: linkStatement arrowText
|
|
||||||
{$1.text = $2;$$ = $1;}
|
{$1.text = $2;$$ = $1;}
|
||||||
| linkStatement arrowText SPACE
|
| linkStatement arrowText SPACE
|
||||||
{$1.text = $2;$$ = $1;}
|
{$1.text = $2;$$ = $1;}
|
||||||
@ -282,7 +281,7 @@ link: linkStatement arrowText
|
|||||||
{$$ = $1;}
|
{$$ = $1;}
|
||||||
| linkStatement SPACE
|
| linkStatement SPACE
|
||||||
{$$ = $1;}
|
{$$ = $1;}
|
||||||
| '--' SPACE text SPACE linkStatement
|
| '--' text linkStatement
|
||||||
{$5.text = $3;$$ = $5;}
|
{$5.text = $3;$$ = $5;}
|
||||||
| '--' SPACE text SPACE linkStatement SPACE
|
| '--' SPACE text SPACE linkStatement SPACE
|
||||||
{$5.text = $3;$$ = $5;}
|
{$5.text = $3;$$ = $5;}
|
||||||
@ -296,6 +295,38 @@ link: linkStatement arrowText
|
|||||||
{$5.text = $3;$$ = $5;}
|
{$5.text = $3;$$ = $5;}
|
||||||
;
|
;
|
||||||
|
|
||||||
|
link: linkStatement arrowText
|
||||||
|
{$1.text = $2;$$ = $1;}
|
||||||
|
| linkStatement arrowText SPACE
|
||||||
|
{$1.text = $2;$$ = $1;}
|
||||||
|
| linkStatement
|
||||||
|
{$$ = $1;}
|
||||||
|
| '--' text ARROW_POINT
|
||||||
|
{$$ = {"type":"arrow","stroke":"normal","text":$2};}
|
||||||
|
| '--' text ARROW_CIRCLE
|
||||||
|
{$$ = {"type":"arrow_circle","stroke":"normal","text":$2};}
|
||||||
|
| '--' text ARROW_CROSS
|
||||||
|
{$$ = {"type":"arrow_cross","stroke":"normal","text":$2};}
|
||||||
|
| '--' text ARROW_OPEN
|
||||||
|
{$$ = {"type":"arrow_open","stroke":"normal","text":$2};}
|
||||||
|
| '-.' text DOTTED_ARROW_POINT
|
||||||
|
{$$ = {"type":"arrow","stroke":"dotted","text":$2};}
|
||||||
|
| '-.' text DOTTED_ARROW_CIRCLE
|
||||||
|
{$$ = {"type":"arrow_circle","stroke":"dotted","text":$2};}
|
||||||
|
| '-.' text DOTTED_ARROW_CROSS
|
||||||
|
{$$ = {"type":"arrow_cross","stroke":"dotted","text":$2};}
|
||||||
|
| '-.' text DOTTED_ARROW_OPEN
|
||||||
|
{$$ = {"type":"arrow_open","stroke":"dotted","text":$2};}
|
||||||
|
| '==' text THICK_ARROW_POINT
|
||||||
|
{$$ = {"type":"arrow","stroke":"thick","text":$2};}
|
||||||
|
| '==' text THICK_ARROW_CIRCLE
|
||||||
|
{$$ = {"type":"arrow_circle","stroke":"thick","text":$2};}
|
||||||
|
| '==' text THICK_ARROW_CROSS
|
||||||
|
{$$ = {"type":"arrow_cross","stroke":"thick","text":$2};}
|
||||||
|
| '==' text THICK_ARROW_OPEN
|
||||||
|
{$$ = {"type":"arrow_open","stroke":"thick","text":$2};}
|
||||||
|
;
|
||||||
|
|
||||||
linkStatement: ARROW_POINT
|
linkStatement: ARROW_POINT
|
||||||
{$$ = {"type":"arrow","stroke":"normal"};}
|
{$$ = {"type":"arrow","stroke":"normal"};}
|
||||||
| ARROW_CIRCLE
|
| ARROW_CIRCLE
|
||||||
|
File diff suppressed because one or more lines are too long
@ -393,6 +393,29 @@ describe('when parsing ',function(){
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should handle space and send',function(){
|
||||||
|
var res = flow.parser.parse('graph TD;A--text including URL space and send-->B;');
|
||||||
|
|
||||||
|
var vert = flow.parser.yy.getVertices();
|
||||||
|
var edges = flow.parser.yy.getEdges();
|
||||||
|
|
||||||
|
|
||||||
|
expect(edges[0].type).toBe('arrow');
|
||||||
|
expect(edges[0].text).toBe('text including URL space and send');
|
||||||
|
|
||||||
|
});
|
||||||
|
it('should handle space and send',function(){
|
||||||
|
var res = flow.parser.parse('graph TD;A-- text including URL space and send -->B;');
|
||||||
|
|
||||||
|
var vert = flow.parser.yy.getVertices();
|
||||||
|
var edges = flow.parser.yy.getEdges();
|
||||||
|
|
||||||
|
|
||||||
|
expect(edges[0].type).toBe('arrow');
|
||||||
|
expect(edges[0].text).toBe('text including URL space and send');
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
it('should handle space and dir (TD)',function(){
|
it('should handle space and dir (TD)',function(){
|
||||||
var res = flow.parser.parse('graph TD;A--x|text including R TD space|B;');
|
var res = flow.parser.parse('graph TD;A--x|text including R TD space|B;');
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
<body>
|
<body>
|
||||||
<h1>No line breaks</h1>
|
<h1>No line breaks</h1>
|
||||||
<div class="mermaid">
|
<div class="mermaid">
|
||||||
sequenceDiagram;Alice->>Bob: Hello Bob, how are you?;Bob-->Bob: Hmmm?;Bob-->Alice: Ok;
|
sequenceDiagram;Alice->>Bob: Hello Bob, how are you?;Bob-->Bob: Hmmm?;Bob-->Alice: Ok will send l8r;
|
||||||
</div>
|
</div>
|
||||||
<div class="mermaid">
|
<div class="mermaid">
|
||||||
sequenceDiagram;loop Daily query;Alice->>Bob: Hello Bob, how are you?;alt is sick;Bob->>Alice: Not so good :(;else is well;Bob->>Alice: Feeling fresh like a daisy;end;opt Extra response;Bob->>Alice: Thanks for asking;end;end;
|
sequenceDiagram;loop Daily query;Alice->>Bob: Hello Bob, how are you?;alt is sick;Bob->>Alice: Not so good :(;else is well;Bob->>Alice: Feeling fresh like a daisy;end;opt Extra response;Bob->>Alice: Thanks for asking;end;end;
|
||||||
|
@ -30,10 +30,11 @@
|
|||||||
<h1>Issue 2</h1>
|
<h1>Issue 2</h1>
|
||||||
<div class="mermaid">
|
<div class="mermaid">
|
||||||
graph LR
|
graph LR
|
||||||
A[Square Rect] -- Link text --> B((Circle))
|
A[Square Rect] -- Link text --> B((Circle))
|
||||||
|
A[Square Rect]--Link text2-->D((Circle))
|
||||||
A --> C(Round Rect)
|
A --> C(Round Rect)
|
||||||
B --> D{Rhombus}
|
B == testing ==> D{Rhombus}
|
||||||
C --> D
|
C -.-> D
|
||||||
</div>
|
</div>
|
||||||
<h1>Issue </h1>
|
<h1>Issue </h1>
|
||||||
<div class="mermaid">
|
<div class="mermaid">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user