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.
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
Configurable graph force strength and link length #104
Configurable graph force strength and link length #104
Changes from 4 commits
29029f4
220e379
90179b3
187f9f1
a1be545
34a4c21
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Can you please check whether some is wrong with this line? Tests for
graph.helper
are breaking in this property fetch, it seems thatnewConfig.d3
is undefined. Check this link for more detail.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.
I've been taking a look at this and it seems that there are some tests in
graph.helper.test.js
whereconfig
is assigned a string instead of an actual config object. This is what's causing the error to occurr in some of them.{ config: 'config' }
Since config is not an object at all in this case,
newConfig.d3
isundefined
, and the same happens with the other two parameters passed down to_createForceSimulation
.Fixing the issue is as simple as checking if
newConfig.d3
before trying to access thegravity
property.const simulation = _createForceSimulation(newConfig.width, newConfig.height, newConfig.d3 && newConfig.d3.gravity);
I'll submit a commit with the change in a bit, but I'm curious... Is there any reason why
config
is taking a string value in these tests? 🤔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.
Yes, so in those particular unit tests I was checking for API compatibility I wasn't particularly interested in checking whether
config
was a string or other data type.