Skip to content
New issue

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

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

Already on GitHub? # to your account

Lists of nodes doesn't work. #46

Open
pbsds opened this issue Mar 22, 2022 · 4 comments
Open

Lists of nodes doesn't work. #46

pbsds opened this issue Mar 22, 2022 · 4 comments

Comments

@pbsds
Copy link

pbsds commented Mar 22, 2022

This graph doesn't seem to work. Edotor wasn't even able to export a link to that graph. It seems to dislike the comma separated list if nodes.

@nikeee
Copy link
Owner

nikeee commented Mar 22, 2022

Thanks for your feedback! I've taken a look into the grammar of graphviz:

image
(src)

If I'm not mistaking, according to the grammar, comma-separated node IDs are not valid.
Instead, is says in that page:

Semicolons and commas aid readability but are not required. Also, any amount of whitespace may be inserted between terminals.

So actually, o:a:e, o:b:e -> s01:w, s02:w should be equivalent to o:a:e; o:b:e -> s01:w; s02:w which should be in turn equivalent with o:a:e o:b:e -> s01:w s02:w. That means that - according to that document - it should only connect o:b:e -> s01:w.

You can use sub graphs to get a similar behaviour as you intended:

{o:a:e o:b:e o:c:e f:a:e f:b:e f:c:e f:d:e f:e:e }
    -> {s01:w s02:w s03:w s04:w s05:w}

However, the site you linked uses the same graphivz renderer as edotor, which is actually Graphviz. So it seems that Graphviz itself somehow implements this grammar extension, but the language service that provides auto completion doesn't. If the language service detects an error, no graph is attempted to be rendered (thats why you cannot display/link that graph).

We can address this the following ways / use these workarounds:

  1. Use Subgraph notation (as stated above) as a workaround
  2. Try to render the graph regardless if the language service detects syntactic errors (will keep the document with error markers, but the rendering should work)
  3. Change the parser to recognize that comma separated syntax. This would be the best solution, but we should ask somewhere if this is actually intended syntax.

Whats broken either way is that , is recognized as an error, which seems wrong.

@pbsds
Copy link
Author

pbsds commented Mar 23, 2022

A maintainer of graphviz (author maybe?) adviced me to use lists instead of subgraphs, due to how subgraph discard the port information (this is a good lint warning rule btw). Source. I vote for both 2 and 3

@nikeee
Copy link
Owner

nikeee commented Mar 23, 2022

due to how subgraph discard the port information.

Yeah, I also noticed that after posting. Thanks for your link, I've asked on their forums about that:
https://forum.graphviz.org/t/comma-separated-list-of-node-ids/1085

I've also noticed your comment on the issue. Thanks!

@dosmanak
Copy link

Hello. I also use com,a separated list of nodes to have multiple edges to the same node.
Funny thing is the Edotor refuse to render the graph when editing, but loads well from cache even with commas.
So only the validator complains but the engine is working well.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants