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

Improve Graph Output #30

Merged
merged 1 commit into from
Jan 13, 2017
Merged

Improve Graph Output #30

merged 1 commit into from
Jan 13, 2017

Conversation

DannyBen
Copy link
Collaborator

@DannyBen DannyBen commented Jan 13, 2017

This PR comes to fix some obvious issues with the #graph method, in the least intrusive way possible,

Issue 1: Graph too small

The graph size too small for wide or tall trees - see #29
This is caused since they decided to set a size of "9,11" as the default for some reason, instead of letting dot do its thing naturally.

Fixed by providing an empty size to the DotGraphPrinter

Issue 2: Graphr dependency error

Since the graphr gem is not in the dependency list, a non friendly error was thrown when it was not found.

Fixed by rescuing LoadError and printing a friendly error message to STDERR

Issue 3: ID in node labels

The node labels included the object ID, which was necessary to distinguish between nodes, but not necessary for viewing.

Fixed by providing an alternative node_labeler proc to the DotGraphPrinter

Issue 4: Empty quotes in discrete labels

In discrete cases, the label included empty '' - for example, January ''. Not sure what it was there for, so I changed it (without changing how it behaves on continuous properties).

@igrigorik
Copy link
Owner

LGTM, and thank you!

@igrigorik igrigorik merged commit 1f5b596 into igrigorik:master Jan 13, 2017
@DannyBen DannyBen mentioned this pull request Jan 13, 2017
@DannyBen DannyBen deleted the graph branch January 14, 2017 06:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants