Skip to content

Commit

Permalink
Update flowchart.astro
Browse files Browse the repository at this point in the history
  • Loading branch information
s0u7a authored Nov 24, 2023
1 parent 5da2216 commit 29da5a5
Showing 1 changed file with 1 addition and 57 deletions.
58 changes: 1 addition & 57 deletions src/pages/tools/flowchart.astro
Original file line number Diff line number Diff line change
Expand Up @@ -9,61 +9,5 @@ import Layout from '../../layouts/Layout.astro'
You can parse the text:

<div id="diagram"></div>
<script>
var diagram = flowchart.parse(`st=>start: Start:>http://www.google.com[blank]
e=>end:>http://www.google.com
op1=>operation: My Operation
sub1=>subroutine: My Subroutine
cond=>condition: Yes
or No?:>http://www.google.com
io=>inputoutput: catch something...
para=>parallel: parallel tasks

st->op1->cond
cond(yes)->io->e
cond(no)->para
para(path1, bottom)->sub1(right)->op1
para(path2, top)->op1`);
diagram.drawSVG('diagram');

// you can also try to pass options:

diagram.drawSVG('diagram', {
'x': 0,
'y': 0,
'line-width': 3,
'line-length': 50,
'text-margin': 10,
'font-size': 14,
'font-color': 'black',
'line-color': 'black',
'element-color': 'black',
'fill': 'white',
'yes-text': 'yes',
'no-text': 'no',
'arrow-end': 'block',
'scale': 1,
// style symbol types
'symbols': {
'start': {
'font-color': 'red',
'element-color': 'green',
'fill': 'yellow'
},
'end':{
'class': 'end-element'
}
},
// even flowstate support ;-)
'flowstate' : {
'past' : { 'fill' : '#CCCCCC', 'font-size' : 12},
'current' : {'fill' : 'yellow', 'font-color' : 'red', 'font-weight' : 'bold'},
'future' : { 'fill' : '#FFFF99'},
'request' : { 'fill' : 'blue'},
'invalid': {'fill' : '#444444'},
'approved' : { 'fill' : '#58C4A3', 'font-size' : 12, 'yes-text' : 'APPROVED', 'no-text' : 'n/a' },
'rejected' : { 'fill' : '#C45879', 'font-size' : 12, 'yes-text' : 'n/a', 'no-text' : 'REJECTED' }
}
});
</script>
<script src="/tools/flowchart.js"/>
</Layout>

0 comments on commit 29da5a5

Please sign in to comment.