Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display question: right angles #335

Closed
Jmuccigr opened this issue Mar 25, 2016 · 5 comments
Closed

Display question: right angles #335

Jmuccigr opened this issue Mar 25, 2016 · 5 comments

Comments

@Jmuccigr
Copy link
Contributor

Lots of flow charts (and other similar things) use lines that run only at right angles, up and down, and left and right, like this:
harris_matrix_example

mermaid instead produces lots of lines that run at angles. Any way to get the former rather than the latter?

@AlanHohn
Copy link
Contributor

AlanHohn commented Apr 26, 2016

It appears from the dagre-d3 and d3 documentation that this would be possible if we could pass through the "lineInterpolate" argument to setEdge:

http://cpettitt.github.io/project/dagre-d3/latest/demo/style-attrs.html
https://github.com/mbostock/d3/wiki/SVG-Shapes#line_interpolate

I've been thinking about how to specify this and would like to contribute a PR. I'd appreciate some advice about the best way to integrate this into the flowchart language. There's an existing "linkStyle" construct that could be leveraged if it's done in a way that's backwards-compatible.

I was thinking:

linkStyle 3 interpolate stepBefore stroke:#ff3,stroke-width:4px;

Where the "interpolate stepBefore" would be optional in the grammar.

But that feels a little ugly to me, so another approach would be:

linkInterpolate 3 stepBefore

Which would be a little less compact but could be clearer.

@Jmuccigr
Copy link
Contributor Author

Jmuccigr commented Apr 26, 2016

@AlanHohn, What's ugly?

@AlanHohn
Copy link
Contributor

I was thinking it was a little ugly because there's no explicit "style" keyword before the style section (to preserve backwards compatibility). But I imagine I'm being oversensitive.

I'll work it using the first approach.

@Jmuccigr
Copy link
Contributor Author

Ah, that hadn't occurred to me and I think I lack the knowledge to have an informed opinion. :-)

@knsv
Copy link
Collaborator

knsv commented Apr 27, 2016

@AlanHohn Sounds great! Looking forward to you pull request!

mgenereu pushed a commit to mgenereu/mermaid that referenced this issue Jun 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants