feature request: no ids in linkStyle
See original GitHub issueit would be great not to have to identify links by ID when writing the text description, because inserting links in the middle gets really messy. So I end up having to put them at the end, and then nothing is organized after a while. It’s also very annoying to have to count links when I’m writing a graph and if I get it off by one, it can be hard to find the node on the flowchart diagram… it’s just needless debugging. Maybe you could allow something like:
graph TD
A --> B style stroke:#a00,stroke-width:2px;
which would be a huge improvement over what I have to do now - I have to keep counting out the links to remember which number a link style goes on (i’m trying to do a flowchart with red and green links). even better would be being able to apply classes to links, which seems like it would be theoretically the same as doing so for nodes, but with the new syntax you could do:
A --> B style .red
OR
A --> B class red
And it would automatically apply a group of styles. I think this is a large usability issue, and if you could fix it that would be awesome.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:6
- Comments:10

Top Related StackOverflow Question
@0dminnimda , open the example page, use developer tools to select the arrow from B (Go shopping) to C (Let me think), you can see its code like below:
add this to styles:
you can see the arrow is red now
Here’s what I mean:
Now say I want one of these to be red links and the other two to be green links
That was easy to do with 3 links, but it’s really hard to do with more than, say, 10. I have to manually count out which link i’m looking at for an id. A much simpler thing would be putting linksyles into the link declarations directly:
now i don’t need to know which number link it is, and if, for example I go back and add another link in the middle:
I don’t have to go renumber all my ids!!