mcmiv413 / PS-Diagram

MIT License
24 stars 2 forks source link

Include diagram data in output (Feature Request) #1

Open JohnLBevan opened 7 years ago

JohnLBevan commented 7 years ago

Feature Request

It would be great if the module, as well as creating the PNG file, also output the related data (i.e. shape & coordinate data related to the image). This would allow for the generated images to be displayed on a web page, with a map element overlaid, providing interactivity with the image's components.


Long message.

This module looks awesome; thanks for creating & sharing! FYI: I recently had a similar requirement; representing our CMDB's dependency diagrams, which I met by using mermaid.js to render diagrams on page, such as below, for our CMDB

cmdb_spiratest

The pages themselves are static HTML, generated from the back end database on a daily basis (we were just after a quick fix solution).

Your script looks like a better option, since using PNGs would make the solution browser independent (Mermaid doesn't play well with IE). However, I'd ideally like to add some interactivity which isn't simple with a PNG; i.e. having mouseover effects on the images to show additional data, and making the elements clickable so that you could navigate to a specific component and see its dependency chain. One way to achieve this would be to have PS-Diagram optionally output the coord/shape data used to create the diagram, so that that same data could be used to create a map over the diagram.

This request is probably not high on your list; just wanted to suggest it in case you're creating something with similar requirements to the CMDB I'd worked on / so I could take advantage of your efforts to date if so. I'm hoping to share my solution at some point; but want to get it to a more complete state prior to sharing so it's easy for people to just use.

mcmiv413 commented 7 years ago

Thanks for the input :-) Not sure if this satisfies the request, but there is an -outputgraphtext switch that will output the graph data that is used to pass through graphviz. I think your request is more looking for an output from graphviz to provide coordinate data. These are the formats that graphviz supports for output, http://www.graphviz.org/content/output-formats, I'm sure one or more of them could be added in.

Additionally, I too would love to be able to have hover functionality and clickable links - there are 2 blocking issues I would need to get past first. Graphviz doesn't really allow you to tell it where you want things such as logos, legend info, etc.... Sooo I cheated, the output png with logos and legend is actually 5 different graphs combined into 1. It is something that I am thinking about how to implement since graphviz does support other formats, but is unfortunately a bit low on the list.