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

Add an option to define the graph ID in dot script #3

Closed
clue opened this issue Jan 30, 2014 · 2 comments · Fixed by #28
Closed

Add an option to define the graph ID in dot script #3

clue opened this issue Jan 30, 2014 · 2 comments · Fixed by #28
Milestone

Comments

@clue
Copy link
Member

clue commented Jan 30, 2014

When generating a Graph its name always is 'G' (in svg output it's the title sometimes showed as a web browser tooltip)

From graphp/graph#90. Originally reported by @clemens-tolboom.

@rhelms
Copy link
Contributor

rhelms commented Apr 5, 2017

I'd like to do something to support this, and the workaround from the linked issue doesn't appear to work.

My suggestion would be to allow setting an id attribute on the Fhaculty\Graph\Graph, which would be used in the graph statement in Graphp\GraphViz\GraphViz.

$graph->setAttribute('graphviz.id', 'My Graph Title'); would result in graph 'My Graph Title' {, which should flow through to the SVG and resulting tooltip.

If not set, we could still default to G. And some extra testing can be done to make sure that an empty string works, even if '' needs to become ' '.

@rhelms
Copy link
Contributor

rhelms commented Apr 5, 2017

I've just done some local code to see how it goes, and looking at the GraphViz doco, it might be better to set an attribute called graphviz.name to set the name of the graph.

I'll submit a pull request for this shortly.

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

Successfully merging a pull request may close this issue.

2 participants