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

Fixed subgroup and add rank #43

Open
wants to merge 1 commit into
base: 1.x
Choose a base branch
from
Open

Conversation

Yahasana
Copy link

@Yahasana Yahasana commented Apr 7, 2020

subgroup should include edges and rank

`subgroup` should include `edges` and `rank`
Copy link
Member

@clue clue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @Yahasana, thanks for taking the time to file this PR! 👍

Unfortunately, the PR does not contain any documentation or tests, so it's a bit unclear what you're trying to achieve from the snippet you've posted.

May I ask you provide a simple gist of what you're trying to achieve and how this looks from a consumer perspective? Thanks!

@Yahasana
Copy link
Author

Yahasana commented Apr 16, 2020

@clue group and rank can create a table like vertexes graph, which are align in rows and column 🆒

$i0 = $graph->createVertex(['graphviz.group' => 'g0']);
$i1 = $graph->createVertex(['graphviz.group' => 'g0']);
$i2 = $graph->createVertex(['graphviz.group' => 'g0']);
$j0 = $graph->createVertex(['graphviz.group' => 'g1']);
$j1 = $graph->createVertex(['graphviz.group' => 'g1']);
$j2 = $graph->createVertex(['graphviz.group' => 'g1']);

$graphviz->setRanks(0, [$i0, $i1, $i2])
    ->setRanks(1, [$j0, $j1, $j2]);

@Yahasana
Copy link
Author

One more thing, there is a fail test case because of i make escape id simple for better performance. people want to use special chars in the id get trouble themselves. i'll not be goin to fix it

@clue
Copy link
Member

clue commented Apr 21, 2020

@Yahasana Thanks for the background info!

This is definitely an interesting feature addition and I would love to see this supported in this project. That being said, I'm not sure about the best API. In particular, this seems to be somewhat related to #38, so I wonder if we can come up with a consistent API.

What do you think?

@Yahasana
Copy link
Author

Yahasana commented May 3, 2020

How about to change API look like this one?

$i0 = $graph->createVertex(['graphviz.group' => 'g0', 'graphviz.rank' => 0]);
$i1 = $graph->createVertex(['graphviz.group' => 'g0', 'graphviz.rank' => 0]);
$i2 = $graph->createVertex(['graphviz.group' => 'g0', 'graphviz.rank' => 0]);
$j0 = $graph->createVertex(['graphviz.group' => 'g1', 'graphviz.rank' => 1]);
$j1 = $graph->createVertex(['graphviz.group' => 'g1', 'graphviz.rank' => 1]);
$j2 = $graph->createVertex(['graphviz.group' => 'g1', 'graphviz.rank' => 1]);

the same as

$v = $graph->createVertex();
$v->setAttribute('graphviz.group', 'g0');
$v->setAttribute('graphviz.rank', 0);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants