-
-
Notifications
You must be signed in to change notification settings - Fork 74
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
[WIP] Add consistent Layout + interface #40
Conversation
Updated this PR to reflect the current progress. Instead of cluttering each class with layout attributes and its interface, I'd like to move the layout logic into a new Previous interface: $vertex->setLayoutAttribute('label', 'A');
$edge->setLayoutAttributes(array('a' => 'a')); New, consistent interface: $vertex->getLayout()->setAttribute('label', 'A');
$edge->getLayout()->setAttributes(array('a' => 'a')); Similarly, the I'm not quite happy with the naming "renderer(ererer)" though, so perhaps we can come up with a better name. In particular regarding Ping @clemens-tolboom ? |
Bump :) Anybody? |
I somehow missed the previous ping. Sorry :-/ For me the attributes are used by the application. Which are not necessarily used for Layout. Is may contain a list of files names to Export. We do have a graphviz export settings to use neato, dot or other layout engines. But the attributes are close to the export process. So why not use I do miss If we use |
I think we might have a misunderstand about what "layout attributes" ( GraphViz uses these attributes solely for layouting each node ( The main issue at hand is, should we keep our focus on GraphViz or can we come up with any way to standardize the attribute access somehow? Disclaimer: I'm no d3/thejit expert by any means, this is just from a quick look at the documentation. Perhaps anybody else can shed some light on this matter? |
We have a few puzzles to solve regarding "layout attributes". I think moving this to
|
I understand where you're coming from. We don't really depend on GraphViz. It's merely the recommended way to visualize a given graph, as it's very flexible and unlike d3 / thejit does not require a web browser. That being said, I'm not opposed to moving it to a separate repo (clue/graph-graphviz?). This may clear up this confusion. Also, clue/graph-uml has a very distinct purpose and it makes sense to keep it separate from the core graphing library.
Certainly makes sense for your application where you're interfacing with actual users :) I'm not sure how we should take advantage of this, as this is general purpose graphing library. The actual attributes depend on your GraphViz version, the installed dependencies, your system environment etc. So I don't think we will ever come up with a way to "validate" any of the attributes. And IMHO we don't have to: it's up to the user to fix any errors. Besides, perhaps it makes sense to keep this separate from this ticket?
Not sure what you're trying to say :) This ticket should not limit how this can be used with either thejit or d3. For example, thejit uses a |
How about
|
$superSource = $graphFlow->createVertex()->setLayoutAttribute('label', 's*'); | ||
$superSink = $graphFlow->createVertex()->setLayoutAttribute('label', 't*'); | ||
$superSource = $graphFlow->createVertex()/*->getLayout()->setAttribute('label', 's*')*/; | ||
$superSink = $graphFlow->createVertex()/*->getLayout()->setAttribute('label', 't*')*/; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These lines have commented code which should not be. Maybe add @todo to make sure this gets fixed later on?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for spotting. I've removed them as they were only ever used when this algorithm has been created.
Conflicts: lib/Fhaculty/Graph/Graph.php lib/Fhaculty/Graph/GraphViz.php
Regarding input / output I think that helps. I'm not sure I understand the distinction between input/loader and output/exporter. I guess Maybe use |
IMHO there shouldn't be one :) We should probably work to clean up the mess around
I'm not opposed to the name "dumper", but I generally like "output" because it matches with "input". Any suggestions? |
I have no problem with either way(s). So please go ahead ;) |
As per the discussion in #97, we are working towards moving GraphViz into a separate project (graphp/graphviz) and As such, progressing in this ticket doesn't make much sense anymore, so closing this for now. |
I guess we can delete this branch now can't we? |
This PR aims to streamline accessing / setting layout attributes for each of Graph, Vertex and Edge\Base.
[This is a resurrection of #22 which was closed inadvertently]