ghbore / flowchartjs Goto Github PK
View Code? Open in Web Editor NEWFlowchart Plugin for Dokuwiki
Flowchart Plugin for Dokuwiki
When I do a Flowchart in Dokuwiki the size of the result ist very small.
<flowchartjs default> st=>start: Start|past:>http://www.google.com[blank] e=>end: End|future:>http://www.google.com op1=>operation: My Operation|past op2=>operation: Stuff|current sub1=>subroutine: My Subroutine|invalid cond=>condition: Yes or No?|approved:>http://www.google.com c2=>condition: Good idea|rejected io=>inputoutput: catch something...|future st->op1(right)->cond cond(yes, right)->c2 cond(no)->sub1(left)->op1 c2(yes)->io->e c2(no)->op2->e </flowchartjs>
Thanks for a supernice plugin! I had to make a small edit to it to make it work for me though.
I installed the flowchartjs plugin on Synology Diskstation. Tried your example, and got no styles on diagram (no fills, uniform std font, all black lines). On inspection it turns out I have a 404: Failed to load resource: the server responded with a status of 404 (Not Found).
It tries to access http://mytestsite:9000/lib/plugins/flowchartjs/styles/default.json (9000 is a redirect port I'm using)
this requested URL does indeed not exist on my server.
So I go into your script.js and I find what loads the style:
function draw1style (style, callback){
jQuery.ajax('/lib/plugins/flowchartjs/styles/' + style + '.json', {dataType: 'json'})
.done(function(d){
callback(d);
})
.fail(function(j, s, e){
callback(null);
});
}
I remove the initial slash in the ajax call URL so I now have:
...
jQuery.ajax('lib/plugins/flowchartjs/styles/' + style + '.json', {dataType: 'json'})
...
And now it works like a charm.
I have no idea if or how the current script works on other platforms, but I am absolutely no expert.
Anyway, thought you should know.
regards
Ingvar
Hi,
I'm trying to add an inner link to the flowchart, but it doesn't work.
<flowchartjs default>
st=>start: start:>documentation:start
ed=>end: Acepta
st->ed
</flowchartjs>
I don't know if it's possible or am I doing something wrong.
Thank you,
Franz Jimeno
I upgraded my Dokuwiki installation to Igor and it resulted in flowcharts not loading. I rolled back to Hogfather and flowcharts are working once again. It would be great if whatever adjustments are required for compatibility with Igor could be made.
I installed this plug in for DokuWiki 2020-07-29 "Hogfather" (local installation)
<flowchartjs default>
st=>start: Start|past:>http://www.google.com[blank]
e=>end: End|future:>http://www.google.com
op1=>operation: My Operation|past
op2=>operation: Stuff|current
sub1=>subroutine: My Subroutine|invalid
cond=>condition: Yes
or No?|approved:>http://www.google.com
c2=>condition: Good idea|rejected
io=>inputoutput: catch something...|future
st->op1(right)->cond
cond(yes, right)->c2
cond(no)->sub1(left)->op1
c2(yes)->io->e
c2(no)->op2->e
</flowchartjs>
After safe I got and no flow is rendering:
<p>st⇒start: Start|past:><a class="urlextern" href="http://www.google.com[blank]" rel="ugc nofollow" title="http://www.google.com[blank]">http://www.google.com[blank]</a></p>
<pre class="code">
e=>end: End|future:>http://www.google.com
op1=>operation: My Operation|past
op2=>operation: Stuff|current
sub1=>subroutine: My Subroutine|invalid
cond=>condition: Yes
or No?|approved:>http://www.google.com
c2=>condition: Good idea|rejected
io=>inputoutput: catch something...|future
st->op1(right)->cond
cond(yes, right)->c2
cond(no)->sub1(left)->op1
c2(yes)->io->e
c2(no)->op2->e
</pre>
Also there is no "FC" in the toolbar
Warning: Declaration of syntax_plugin_flowchartjs::handle($match, $state, $pos, $handler) should be compatible with DokuWiki_Syntax_Plugin::handle($match, $state, $pos, Doku_Handler $handler) in /volume1/web/dokuwiki/lib/plugins/flowchartjs/syntax.php on line 0
Warning: Declaration of syntax_plugin_flowchartjs::render($mode, $renderer, $data) should be compatible with DokuWiki_Syntax_Plugin::render($format, Doku_Renderer $renderer, $data) in /volume1/web/dokuwiki/lib/plugins/flowchartjs/syntax.php on line 0
To fix this please change in syntax.php line 30 to:
function handle($match, $state, $pos, Doku_Handler $handler){
and line 41 to:
function render($mode, Doku_Renderer $renderer, $data) {
Not a bug report, but a feature request: Could you make it possible to export the flow chart from dw to pdf for example over dw2pdf?
The plugin is awesome and much appreciated, and does produce the flowchart.
But I can't get the styles from the JSON files to be applied.
I've checked and it is valid json in the .\lib\plugins\flowchartjs\styles folder with, what appear to be, the correct permmissions.
I copied the default and uploaded it as other and it does show in the page editor Fs/c button.
Using the sample below I would expect the nodes to be colour coded, but they are just white.
Changing any of the other.json global entries, e.g. "font-color", has no effect.
<flowchartjs other>
st=>start: Start|past:>http://www.google.com[blank]
e=>end: End|future:>http://www.google.com
op1=>operation: My Operation|past
op2=>operation: Stuff|current
sub1=>subroutine: My Subroutine|invalid
cond=>condition: Yes
or No?|approved:>http://www.google.com
c2=>condition: Good idea|rejected
io=>inputoutput: catch something...|future
st->op1(right)->cond
cond(yes, right)->c2
cond(no)->sub1(left)->op1
c2(yes)->io->e
c2(no)->op2->e
cond@>sub1({"stroke":"Red","stroke-width":2,"arrow-end":"classic-wide-long"})
c2@>op2({"stroke":"Red","stroke-width":2,"arrow-end":"classic-wide-long"})
cond@>c2({"stroke":"Green","stroke-width":2,"arrow-end":"classic-wide-long"})
c2@>io({"stroke":"Green","stroke-width":2,"arrow-end":"classic-wide-long"})
</flowchartjs>
I install the plugin to my dokuwiki successfully. But it dosen't work. I copied the code same as your example. After I submitted, page show a block of source code, not the flowchat view.
Hi
the generated chart does not care about the view width of the surrounding dokuwiki page, so whenever it exceeds the view width, it becomes partly invisible and so lost its sense :-(
Could it be made somehow that the chart is somehow "squeezed" into the available width and becomes fully visible, just smaller?
thanks for your help :-)
I've got a flowchart that renders properly when I paste the text definition in at http://flowchart.js.org/, but when I plug the exact same text in on my Dokuwiki site, one of the direction indicators is being ignored and results in an ugly flowchart.
The relevant connector definition is as follows:
cnPassInspect(yes,left)->opMoveToStock->end
cnPassInspect(no)->opMoveMRB->opNotifyBuyer(left)->end
Below are screenshots showing the relevant node and how the connectors are being rendered in my Dokuwiki (1st image) compared to flowcharts.js.org (2nd image.)
Do you have any ideas as to what the problem is and how I can correct this?
Thanks for building this plugin and for any assistance you can provide with this issue.
I'm getting Warnings when I install your plugin on my Dokuwiki. They appear on other pages too.
`Warning: Declaration of syntax_plugin_flowchartjs::handle($match, $state, $pos, &$handler) should be compatible with DokuWiki_Syntax_Plugin::handle($match, $state, $pos, Doku_Handler $handler) in ...wiki/lib/plugins/flowchartjs/syntax.php on line 59
Warning: Declaration of syntax_plugin_flowchartjs::render($mode, &$renderer, $data) should be compatible with DokuWiki_Syntax_Plugin::render($format, Doku_Renderer $renderer, $data) in ...wiki/lib/plugins/flowchartjs/syntax.php on line 59
Warning: Cannot modify header information - headers already sent by (output started at ...wiki/lib/plugins/flowchartjs/syntax.php:59) in ...wiki/inc/actions.php on line 210
Warning: Cannot modify header information - headers already sent by (output started at ...wiki/lib/plugins/flowchartjs/syntax.php:59) in ...wiki/lib/tpl/dokuwiki/main.php on line 12`
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.