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

Increase condition right to top length

Open Emins opened this issue 5 years ago • 6 comments

Hello and thank you for best flowchart solution i found

In vertical structure condition line set right "No" back to the top. Line from right too short, just 3-4px. How to increase it?

Emins avatar Oct 10 '19 11:10 Emins

Can you paste an example?

adrai avatar Oct 10 '19 16:10 adrai

Capture

Emins avatar Oct 11 '19 09:10 Emins

I found the place in the code. Not checked with other options, for official update require to test in the many cases. Diff:

> diff -r flowchart.js flowchart_diff.js
> 283c283
> <             var line, x = this.getCenter().x, y = this.getCenter().y, right = this.getRight(), bottom = this.getBottom(), top = this.getTop(), left = this.getLeft(), symbolX = symbol.getCenter().x, symbolY = symbol.getCenter().y, symbolTop = symbol.getTop(), symbolRight = symbol.getRight(), symbolLeft = symbol.getLeft(), isOnSameColumn = x === symbolX, isOnSameLine = y === symbolY, isUnder = y < symbolY, isUpper = y > symbolY || this === symbol, isLeft = x > symbolX, isRight = x < symbolX, maxX = 0, lineLength = this.getAttr("line-length"), lineWith = this.getAttr("line-width");
> >             var line, x = this.getCenter().x, y = this.getCenter().y, right = this.getRight(), bottom = this.getBottom(), top = this.getTop(), left = this.getLeft(), symbolX = symbol.getCenter().x, symbolY = symbol.getCenter().y, symbolTop = symbol.getTop(), symbolRight = symbol.getRight(), symbolLeft = symbol.getLeft(), isOnSameColumn = x === symbolX, isOnSameLine = y === symbolY, isUnder = y < symbolY, isUpper = y > symbolY || this === symbol, isLeft = x > symbolX, isRight = x < symbolX, maxX = 0, lineLength = this.getAttr("line-length"), lineWith = this.getAttr("line-width"), maxWidth = this.getAttr("maxWidth");
> 414c414
> <                 x: right.x + lineLength / 2,
> >                 x: right.x + lineLength + (maxWidth / 2) / 2,
> 417c417
> <                 x: right.x + lineLength / 2,
> >                 x: right.x + lineLength + (maxWidth / 2) / 2,

Emins avatar Oct 11 '19 11:10 Emins

I have another example of this, where the chart is horizontal aligned a decision return path cuts through the decision box.

image

psychemedia avatar Jun 18 '20 09:06 psychemedia

Feel free to provide a PR.

adrai avatar Jun 18 '20 09:06 adrai

I'm not really familiar with js coding in general or this package in particular, although as a user I do find it very useful.

Trying to think through the immediate issues:

  • in the vertical layout example, the routing line needs to extend past an x- co-ordinate greater than the largest x value for the side of any element with a y value between the y_min and y_max of the routing line (assuming y increases up the screen).;
  • in the horizontal layout, the y value of the routing line needs to be grater than the height of every object with an x co-ordinate between the min_x and max_x of the routing line.

psychemedia avatar Oct 02 '20 18:10 psychemedia