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 configuration options to Graph for usage by a Renderer #10

Closed
clemens-tolboom opened this issue Feb 27, 2013 · 4 comments
Closed

Add configuration options to Graph for usage by a Renderer #10

clemens-tolboom opened this issue Feb 27, 2013 · 4 comments

Comments

@clemens-tolboom
Copy link
Collaborator

As a side note in #6 we need to set some attributes when defining the Graph for later rendering. We have covered this for Vertice and Edge but not for Graph.

Why not mimic the GraphViz way to set global aka Graph level stuff?

$viz->setLayout(GraphViz::LAYOUT_VERTEX, 'style', 'filled');

This way we can define general Vertice and Edge attributes in one go.

@clue
Copy link
Member

clue commented Feb 27, 2013

Copy-pasting the relevant section of my comment in ticket #6:

Due to recent changes in the class hierarchy, there's currently no way to set layout attributes [...], but it used to be controlled via $graph->setLayoutAttribute('layout', 'neato'). Besides being consistent to changing layout attribute on vertices and edges, this is quite obviously a very unfortunate naming.
[...]
In the future we'll probably need to implement Layoutable in Graph again

The Graph used to implement the Layoutable, but that was removed when we added the inheritance for Set, because PHP does not support multi-inheritance and Layoutable was temporarily considered less important. To solve this, we would have to consider adding interfaces and re-implementing the logic in Graph.

Perhaps even better, we should consider a bigger cleanup and move everything to GraphViz instead? Any thoughts?

@clemens-tolboom
Copy link
Collaborator Author

Moving everything to graphviz is a bad idea as we have more output engines: GraphML, Graph API (Drupal) which all need Graph and or global Vertice or Edge (meta) data.

Graph API uses views to get it's Graph data and knows which engine + layout meta data is needed. I want to use Graph for that next hand over the Graph to the right engine GraphViz / D3 / Graph Phyz / The Jit which then process the requested layout (dot/neato/force directed/space tree/etc).

@clue
Copy link
Member

clue commented Mar 16, 2013

Thanks to your input in #12, we now have a temporary working branch graph-graphviz that makes sure all Graph, Vertex and Edge\Base implement a LayoutableInterface in order to provide a consistent interface to add custom layout attributes to each component.

I also added the helpers GraphViz::setLayoutEdgeDefault() and GraphViz::setLayoutVertexDefault() to set default attributes for all components.

IMO the current implementation of GraphViz::setLayoutBy() is now obsolete and probably misleading anyway. So I'm in favor of dropping it.

Other than that, this ticket can probably be considered resolved.

@clue
Copy link
Member

clue commented May 13, 2013

Opened PR #22 to merge the above-mentioned branch.

@clue clue closed this as completed May 13, 2013
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