alexandresalome / graphviz

PHP Graphviz library
https://alexandresalome.github.io/graphviz/
MIT License
73 stars 20 forks source link

Add parsing function for dot files #18

Open Porlockzzz opened 2 years ago

Porlockzzz commented 2 years ago

Nice work!

But I have a requirement to read the generated .dot, modify the nodes/edges of the .dot file, and then generate a new .dot

It seems like a new parsing function needs to be added.

Looking forward to your reply.

Best wishes, Porlockzzz

alexandresalome commented 1 year ago

Hey, thank you :heart:

To achieve parsing of DOT files, there is some preparation work to be done:

Given that this doable work is done, a parser would still have some limitations:

I don't know what you require exactly for your specific case, but if that's OK for you with those limitations I can maybe work on that in the coming weeks.

Porlockzzz commented 1 year ago

Hey, thank you heart

To achieve parsing of DOT files, there is some preparation work to be done:

  • Implement the comments (//, /* */ and #)
  • Introduce a new Document object, as the comments and spaces can be before or after the graph object.

Given that this doable work is done, a parser would still have some limitations:

  • The graph would be re-formatted (custom spacing lost)
  • New instructions would be added at the end of the graphs

I don't know what you require exactly for your specific case, but if that's OK for you with those limitations I can maybe work on that in the coming weeks.

These restrictions do not affect my needs, thanks for your work!🥰

alexandresalome commented 1 year ago

Comments have been implemented in the model, I need to introduce now a Document class and I'll start working on the parser, properly :-)