-
Notifications
You must be signed in to change notification settings - Fork 42
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
dx and dy are NaN in cluster function #39
Comments
@ebrehault I'll give it a look when I have a minute. What version of the |
1.8.0 |
I had a quick look. The primary issue is neither with the service nor d3. The bl.ocks usually start with a an html template which contains an In the process of using When converting such an example, you have to ensure that these dimensions are set, so they can be used e.g. to calculate the tree layout. Your issue disappears, if you change your component template to While this clearly does not yet give you a very data-driven component yet, it allows you to continue exploring the content tree and then iteratively use more Hope this helps. |
Oh ok! Well I was definitely not looking in the right place :) |
Not to worry. Been there done that... 😉 |
I try to reproduce this example:
https://bl.ocks.org/mattgiguere/339843b4622a965048fc9f61598f2d47
in Angular 2 using d3-ng2-service.
Surprisingly, it fails because the
cluster()
function returns badx
andy
(they are allNaN
).It comes from here:
https://github.com/d3/d3-hierarchy/blob/master/src/cluster.js#L62
where
dx
anddy
are bothNaN
even if they are declared here:https://github.com/d3/d3-hierarchy/blob/master/src/cluster.js#L35
Nevertheless I do not think it is a D3 bug (as the example is running fine), so I guess it comes from my usage of d3-ng2-service.
Any hints?
My code is here: https://gist.github.com/ebrehault/d4ef30dcd3d5c21c748efc3afee5d176#file-content-tree-component-ts
and the console.log in line 69 shows x and y NaN values.
The text was updated successfully, but these errors were encountered: