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 rejected edges back to the output with undefined value #6

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Domajno
Copy link

@Domajno Domajno commented Jun 4, 2015

Hi

I had this example where I had data set of 500 edges containing also weights and additional metadata about them. As the output of d3.ForceBundle I got an array of 478 elements but I didn't know which edges were deleted so I couldn't associate this metadata with the new edges anymore.

What I suggest is to always return an array of the same size as the input edges array but some elements may be undefined - those which were rejected. I guess there are many ways to approach this problem and this is one possible solution.

Cheers
Dominik

When running d3.ForceBundle some of the edges are filtered out but I don't know which edges so I no longer could make a link between the original data set and the results output from d3.ForceBundle. That is why I added those filtered edges back to the d3.ForceBundle output with the undefined value.
@godoorsun
Copy link

Hi, Dominik,

I think the deleted (or filtered) edges may be absolute horizontal or vertical edges, may be you can have a try of this fork version here:
https://github.com/godoorsun/d3.ForceBundle
which is discussed in my yesterday's pull request.
#5

@upphiminn
Copy link
Owner

As Guodao pointed out they might have been filtered because of a bad check. Vertical and horizontal edges mostly likely were removed, otherwise the filtering function should only remove edges with no length. I think you can pre-check the data for that, it's not necessarily hard, but if you update your code I might merge it.

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.

3 participants