Skip to content

Add rejected edges back to the output with undefined value#6

Open
Domajno wants to merge 2 commits into
upphiminn:masterfrom
Domajno:master
Open

Add rejected edges back to the output with undefined value#6
Domajno wants to merge 2 commits into
upphiminn:masterfrom
Domajno:master

Conversation

@Domajno

@Domajno Domajno commented Jun 4, 2015

Copy link
Copy Markdown

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
Copy Markdown

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
Copy Markdown
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