Add rejected edges back to the output with undefined value#6
Open
Domajno wants to merge 2 commits into
Open
Conversation
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.
|
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: |
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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