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

Support link IDs #4568

Open
wheeOs opened this issue Jun 30, 2023 · 5 comments
Open

Support link IDs #4568

wheeOs opened this issue Jun 30, 2023 · 5 comments

Comments

@wheeOs
Copy link

wheeOs commented Jun 30, 2023

Proposal

It should be optionally possible to define IDs for links. This will make it it easier to reference links in linkStyle. Currently afaics specific links can only be referenced by index. Imagine a diagram where a lot of links are styled in the current way. You only have to remove or add a link prior to those styled links and all of those styling directives get invalid since the indexes of the targeted links have changed naturally. ID or key references in linkStyle would prevent this inconvenience.

Example

A L-->|link label| B
B "link id with whitespaces"--> C

linkStyle L stroke-width: 3px, stroke:blue
linkStyle "link id with whitespaces" stroke-width: 1px, stroke:red

Screenshots

No response

@wheeOs wheeOs added Status: Triage Needs to be verified, categorized, etc Type: Enhancement New feature or request labels Jun 30, 2023
@sidharthv96
Copy link
Member

sidharthv96 commented Jul 2, 2023

@wheeOs
Copy link
Author

wheeOs commented Jul 3, 2023

@sidharthv96 yes that would be even a better solution in cases of "inlining" (writing the linkStyle close to the link line). But still, I would suggest the ID approach when someone prefers to write style statements in a separate block, similar to my given example.

@sidharthv96
Copy link
Member

The only issue I see is that the syntax becomes more complicated, but as it's optional, we could have it if there's enough interest from the community.
IDs with whitespaces are not supported anywhere else AFAIK, so we can remove that from the proposal, which simplifies it.

@sidharthv96 sidharthv96 added Graph: Flow Area: Development and removed Status: Triage Needs to be verified, categorized, etc labels Jul 3, 2023
@rockmasterflex69
Copy link

I'm not sure about whitespace being super critical, but being able to pre-assign (even numeric only) IDs to a link is crucial to dynamic graph styling. Is that still up for discussion here?

@vincentor
Copy link

I really need this feature too, in my scenario, indexes are difficult to calculate because links are generating dynamically, in particular flow charts with subgraphs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants