-
-
Notifications
You must be signed in to change notification settings - Fork 73
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] Support nested vertex groups (subgraphs) #36
Conversation
I've added a GroupTest as no group === setGroup(0) is bad. As an extended question to "groupID is numeric" it think we can make it a String and then can address hierarchical by define allowed values structured as path like a/b/c which then defines it's hierarchical nature. I don't think that's the best solution and it'll probably break the meaning of Groups.php. |
I agree that the current situation is a bit limited and cumbersome to work with. And your tests highlight those limitations very well 👍 Simply put, the current implementation was easiest to start with and did just what was needed to implement the Instead of extending |
The latest commits makes group string or int and missing group is The rendering of Graphviz format does render the clusters including IDs of containing vertices. Next prints all vertice including their layout. |
@@ -75,7 +75,9 @@ public function getGroups() | |||
{ | |||
$groups = array(); | |||
foreach ($this->graph->getVertices() as $vertex) { | |||
$groups[$vertex->getGroup()] = true; | |||
$group = $vertex->getGroup(); | |||
$group = (is_null($group)? "_NULL_" : $group); |
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.
Minor nitpick regarding code-style:
if ($group === null) {
$group = '_NULL_';
}
Also, if the default group is null
, it should come out as such (if at all possible). We also have to make sure to handle the case when a group with the literal name "_NULL_"
does already exist. We should not merge them with the vertices with no group at all (null
).
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.
When having no group the vertex is not part of any group :)
_NULL_
is arbitrary but the group IDs must follow a pattern A:B:C
that is using a :
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.
$graph = new Graph();
$graph->createVertex(1);
$graph->createVertex(2)->setGroup('A');
$alg = new Groups($graph);
var_dump($alg->getNumberOfGroups());
var_dump($alg->getGroups());
As a user, I'd expect to receive:
(int)2
array(2) {
[0]=>
NULL
[1]=>
string(1) "A"
}
I guess we may a different understanding here?
[edit] fixed invalid format for var_dump()
Now with all my (minor) remarks in place, let me emphasize one thing: thanks for the high quality PR! 👍 |
I'm not so sure a cluster === vertex as http://www.google.nl/search?q=graphviz+subgraph (images) does not give me any cluster object-ness. @clue I'll create a new issue for you (hint) to try adding cluster to Graph.php |
I've commented on the related ticket and I'm very positive about the idea. But afaikt this is not necessarily required for this ticket. Imo, as a first step, we should finish this ticket with the proposed changes and then at a later stage try to introduce some kind of OOP handling for groups/subgraphs (or whatever name we come up with). |
This is quite old :( ... but I ran into a A vertex label can have different edge snap points defined by the fields defined in the label. This patch needs a re-roll ... not sure whether that will work. |
I don't think these features are related at all, so it certainly makes sense to track port definitions in your separate ticket (#92).
I would certainly appreciate that :) |
I tried to rebase but failed. Please help :) Both $vertex->isIsolated() and $vertex->isVertexIsolated() seemed gone. @clue can you try to rebase ... next I can work on the issues mentioned. |
Care to share your results? I'll put this on my TODO list, but expect this to take a while.
Yes, they've been moved with v0.6.0, see changelog. |
I'm not sure why this fails
|
Furthermore I pushed to |
Without this PR we would only accept integer group IDs and hence throw an
No worries, I've just removed that branch. I'm not sure how changing your permissions has an effect on your outstanding PRs, so I'll change it once they're resolved. |
Some recent updates on this repo:
Ping @clemens-tolboom, would you care to give some status on this PR? |
No time left :-( I really hope to help again but not in the foreseeable future. |
No worries and thanks for your continuous support! 👍 I'll close this PR for now and referenced this in a new ticket in the graphviz component. Still looking forward to seeing this in, so let's see :) |
This pull request will not make it yet.
It addresses several failures:
The branch contains a new directory containing fixtures. This is mimicked from https://github.com/symfony/symfony/tree/master/src/Symfony/Component/Translation/Tests
By using fixtures we are able to generate the visual outputs as well (not yet implemented)
The 2 new generate files as output into fixtures/out ... I'm not sure that is the best way but it will let us generated an SVG from the 'real' output.
Please tell how we can address these several issues :)