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

Graphviz has default graph ID #90

Closed
clemens-tolboom opened this issue Dec 24, 2013 · 3 comments
Closed

Graphviz has default graph ID #90

clemens-tolboom opened this issue Dec 24, 2013 · 3 comments

Comments

@clemens-tolboom
Copy link
Collaborator

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

The code https://github.com/clue/graph/blob/master/lib/Fhaculty/Graph/GraphViz.php#L285

        $script = ($directed ? 'di':'') . 'graph G {' . self::EOL;

could render a proper ID as defined in http://www.graphviz.org/content/dot-language

Trouble is where to set its name as this has no relation to the graph layout.

Ie adding a label layout attribute like

        $script .= ' label = "Awesome graph"' . self::EOL;

adds a label to the output.

Can we do better?

Relates to #84 + #40

@clue
Copy link
Member

clue commented Dec 25, 2013

Indeed, thanks for bringing this to my attention.

Trouble is where to set its name as this has no relation to the graph layout.

See my comment in PR #40 about how I think we might have a misunderstanding about layout attributes.

IMO, once PR #40 lands, it would be desirable to support something along the lines of this:

$graph->getLayout()->setAttribute('id', 'Awesome graph');

@clemens-tolboom
Copy link
Collaborator Author

You are right ... setting the id will fix it.

@clue
Copy link
Member

clue commented Jan 30, 2014

setting the id will fix it.

That's good news :)

I still think we should add an option to change the default graph id nevertheless, so I've added a new ticket for the upcoming graphviz repo: graphp/graphviz#3.

@clue clue closed this as completed Jan 30, 2014
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

2 participants