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

Documentation: How to add properties to graph #16

Closed
masipila opened this issue Jun 23, 2016 · 2 comments
Closed

Documentation: How to add properties to graph #16

masipila opened this issue Jun 23, 2016 · 2 comments
Labels

Comments

@masipila
Copy link

Hi,

I need to change the rankdir of the graph from the default TB (top-to-bottom) to LR (left-right) but I haven't figured out how to add attributes to the graph itself.

The output that I'm looking for is this:
digraph G { graph [rankdir="LR"] "Hello" "World" "Hello"->"World" }
The example on the readme shows how to add attributes to the elements of the graph but not how to add them to the graph itself. The following didn't work:
$graph = new Graph(); $graph->setAttribute('graphviz.rankdir', 'LR');
Cheers,
Markus

@masipila
Copy link
Author

Read the source, Luke :)

$graph = new Graph(); $graph->setAttribute('graphviz.graph.rankdir', 'LR');

@clue
Copy link
Member

clue commented Jul 7, 2016

Thanks for posting the answer to your own question! :)

I'll make sure this gets added to the readme once we tackle #2 👍

@clue clue added the question label Jul 7, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants