-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #445 from whyzdev/flowchat_text
added tests and fix cli css style selector lowercase problem
- Loading branch information
Showing
9 changed files
with
235 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
graph TD; | ||
A-->B; | ||
A-->C; | ||
B-->D; | ||
C-->D; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"titleTopMargin":25, | ||
"barHeight":20, | ||
"barGap":4, | ||
"topPadding":50, | ||
"sidePadding":75, | ||
"gridLineStartPadding":35, | ||
"fontSize":11, | ||
"numberSectionStyles":3, | ||
"axisFormatter": [["%-m/%-d", "function (d){return d.getDay() == 1;}"]] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
gantt | ||
dateFormat YYYY-MM-DD | ||
title Adding GANTT diagram functionality to mermaid | ||
section A section | ||
Completed task :done, des1, 2014-01-06,2014-01-08 | ||
Active task :active, des2, 2014-01-09, 3d | ||
Future task : des3, after des2, 5d | ||
Future task2 : des4, after des3, 5d |
File renamed without changes.
15 changes: 15 additions & 0 deletions
15
test/fixtures/samples/load_html_save_screenshot_png.phantomjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// usage: ../../../node_modules/.bin/phantomjs <html> <png> | ||
var system = require('system'); | ||
var html = system.args[1]; | ||
var png = system.args[2]; | ||
console.log('png:', png) | ||
var page = require('webpage').create(), | ||
loadInProgress = false, | ||
fs = require('fs'); | ||
|
||
page.open(html); | ||
page.onLoadFinished = function() { | ||
loadInProgress = false; | ||
page.render(png); | ||
phantom.exit(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
<!DOCTYPE html> | ||
<html><head> | ||
<meta charset="UTF-8"> | ||
<link rel="stylesheet" href="../../../dist/mermaid.css"/> | ||
<script src="../../../dist/mermaid.js"></script> | ||
<script> | ||
var config = { | ||
startOnLoad:true, | ||
callback:function(id){ | ||
console.log(id,' rendered'); | ||
}, | ||
flowchart:{ | ||
useMaxWidth:false, | ||
htmlLabels:true | ||
}, | ||
sequenceDiagram: { | ||
"textPlacement": "tspan" | ||
}, | ||
gantt: { | ||
"titleTopMargin":25, | ||
"barHeight":20, | ||
"barGap":4, | ||
"topPadding":50, | ||
"sidePadding":75, | ||
"gridLineStartPadding":35, | ||
"fontSize":11, | ||
"numberSectionStyles":3, | ||
"axisFormatter": [["%-m/%-d", function (d){return d.getDay() == 1;}]] | ||
}, | ||
logLevel:5 | ||
}; | ||
mermaid.initialize(config); | ||
</script> | ||
|
||
</head><body> | ||
|
||
<h3>flow chart</h3> | ||
|
||
<div class="mermaid" id="flow_chart_1"> | ||
graph TD | ||
A[label] | ||
B[very very very long long long long-long-long text] | ||
A--test-->B | ||
</div> | ||
|
||
<div class="mermaid" id="flow_chart_2"> | ||
graph TD; | ||
A-->B; | ||
A-->C; | ||
B-->D; | ||
C-->D; | ||
</div> | ||
|
||
<h3>sequence diagram</h3> | ||
|
||
<div class="mermaid" id="sequence_diagram_1"> | ||
sequenceDiagram | ||
participant A as actor | ||
participant B as very very very long long long long-long-long text | ||
A->>B: hi | ||
B-->A: | ||
B->>A: hello | ||
</div> | ||
|
||
<h3>gantt chart</h3> | ||
|
||
<div class="mermaid" id="gantt_axis_formatter"> | ||
gantt | ||
dateFormat YYYY-MM-DD | ||
title gantt chart | ||
section A section | ||
Completed task :done, des1, 2014-01-06,2014-01-08 | ||
Active task :active, des2, 2014-01-09, 3d | ||
Future task : des3, after des2, 5d | ||
Future task2 : des4, after des3, 5d | ||
</div> | ||
|
||
<h3>git graph</h3> | ||
|
||
<div class="mermaid" id="git_graph_1"> | ||
gitGraph BT: | ||
options | ||
{ | ||
"nodeSpacing": 150 | ||
} | ||
end | ||
commit | ||
branch newbranch | ||
checkout newbranch | ||
commit | ||
commit | ||
checkout master | ||
commit | ||
commit | ||
merge newbranch | ||
reset newbranch^^ | ||
commit | ||
commit | ||
</div> | ||
|
||
|
||
</body></html> | ||
|