flowchart.js icon indicating copy to clipboard operation
flowchart.js copied to clipboard

lines may pass through operation/subroutine blocks

Open Rover-Yu opened this issue 11 years ago • 7 comments

hi,

I used flowchart in stackedit, I found below input could generate some lines pass through operation/subroutines, any solution to solve it?

enter=>start: Start return=>end: End is_lastpkt=>condition: Is it last packet? is_fastpath=>condition: Should it enter fastpath? is_arp=>condition: is it a ARP packet? prepare_one=>subroutine: prepare to receive it process_arp=>operation: handle ARP drop=>operation: drop it! push_them_to_user=>subroutine: call user callback

enter->is_lastpkt is_lastpkt(yes)->push_them_to_user->return is_lastpkt(no,bottom)->is_fastpath is_fastpath(yes)->prepare_one->is_lastpkt prepare_one->drop is_fastpath(no,bottom)->is_arp is_arp(no,bottom)->drop->is_lastpkt is_arp(yes)->process_arp->is_lastpkt

Thanks

Yu

Rover-Yu avatar Nov 10 '14 08:11 Rover-Yu

not really but you can play a bit with the text... https://github.com/adrai/flowchart.js/issues/8

adrai avatar Nov 10 '14 08:11 adrai

I too encounter this, most especially when a line leaves a 'box' from the bottom, and immediately heads UP... when it does this, it seems to always go directly through any other boxes it encounters..

can't that be prevented from happening?

brianAckermann avatar Feb 10 '15 19:02 brianAckermann

This is a really neat piece of software, but I am a bit disappointed by this response.

"Any solution to solve it?"

I realize place and route isn't an easy task, but unfortunately "Not really" isn't an acceptable answer if this code is to be anything besides a toy. My very first attempt to use it with an actual process resulted in the following text which renders a horrible back-line right up the second column which completely overlays the normal forward flow:

st=>start: start e=>end: Done op1=>operation: op1 op2=>operation: op2 io1=>inputoutput: io1 op3=>operation: op3 cond1=>condition: cond1 op4=>operation: op4 sub1=>subroutine: sub1 op5=>operation: op5 op6=>operation: op6 op7=>operation: op7 io2=>inputoutput: io2 cond2=>condition: cond2 cond3=>condition: cond3 io3=>inputoutput: io3 op8=>operation: op8 op9=>operation: op9 cond4=>condition: cond4 cond5=>condition: cond5 sub2=>subroutine: sub2 sub3=>subroutine: sub3

st->op1->cond2 cond2(no)->op2->io1->op3->cond1 cond1(no)->op4->e cond1(yes)->sub1->op5->op6->io2->op8 cond2(yes)->op8->op9->cond5->cond4 cond5(yes)->sub2->cond4 cond4(yes)->sub3->e cond5(no)->cond4 cond4(no)->e

I tried the suggestion to "play a bit with the text" which I assume means to increase or decrease the length of the text. Unfortunately this increases the column width as a whole but keeps the offending line running smack dab down the middle of the whole column of blocks.

It seems in this case that the correct behavior would actually be to insert space vertical space between cond2 and op8 equal to the height of the op2..io2 column.

michael-ts avatar Aug 26 '15 18:08 michael-ts

As a workaround, it appears that I can change

cond1(yes)->sub1->op5->op6->io2->op8

to

cond1(yes)->sub1->op5->op6->io2(left)->op8

and then change

op1=>operation: op1 to op1=>operation: op1...................................

michael-ts avatar Aug 26 '15 19:08 michael-ts

+1,

screen shot 2016-04-22 at 16 05 38

st=>start: Start:>http://www.google.com[blank] idle=>operation: idle request-data=>condition: request-data request-replay=>operation: request-replay evaluate-spin=>operation: evaluate-spin spin=>operation: spin game-over=>operation: game-over bonus-celebration=>operation: bonus-celebration retrigger-celebration=>operation: retrigger-celebration pre-show-footer=>operation: pre-show-footer pre-show-animate=>operation: pre-show-animate pre-show-paylines=>operation: pre-show-paylines win-cycle=>condition: win-cycle tutorial=>operation: tutorial autoplay=>operation: autoplay enter-bonus=>operation: enter-bonus bonus-idle=>operation: bonus-idle bonus-win-cycle=>operation: bonus-win-cycle exit-bonus=>operation: exit-bonus retrigger-bonus=>operation: retrigger-bonus max-spins=>operation: max-spins load-next-spin=>operation: load-next-spin bonus-celebration-check=>condition: bonus-celebration-check bonus-retrigger-celebration-check=>condition: bonus-retrigger-celebration-check is-reality-check=>condition: is-reality-check is-replay=>condition: is-replay is-replay-at-start=>condition: is-replay-at-start is-win-check=>condition: is-win-check is-animate-check=>condition: is-animate-check bonus-active-check=>condition: bonus-active-check bonus-active-no-win-check=>condition: bonus-active-no-win-check win-cycle-slam-bonus-check=>condition: win-cycle-slam-bonus-check game-over-should-autoplay=>condition: game-over-should-autoplay should-autoplay-past-win-cycle=>condition: should-autoplay-past-win-cycle win-cycle-complete-bonus-check=>condition: win-cycle-complete-bonus-check exit-bonus-check=>condition: exit-bonus-check show-retrigger-check=>condition: show-retrigger-check max-spins-check=>condition: max-spins-check pre-show-paylines-check=>condition: pre-show-paylines-check st->is-replay-at-start is-replay-at-start(yes, left)->request-replay->evaluate-spin->spin->bonus-celebration-check is-replay-at-start(no)->tutorial->idle->is-reality-check is-reality-check(yes)->idle is-reality-check(no)->is-replay is-replay(yes)->request-replay is-replay(no)->request-data request-data(yes)->evaluate-spin request-data(no)->idle

hayesmaker avatar Apr 22 '16 15:04 hayesmaker

The problem still the same to this day.

azlinzi avatar Mar 05 '21 07:03 azlinzi

feel free to contribute and create a PR

adrai avatar Mar 05 '21 07:03 adrai