flowchart.js
flowchart.js copied to clipboard
Increase condition right to top length
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?
Can you paste an example?
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,
I have another example of this, where the chart is horizontal aligned a decision return path cuts through the decision box.
Feel free to provide a PR.
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.