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

Uncaught error at extendBasis #100

Closed
garytokyo opened this issue Nov 9, 2017 · 3 comments
Closed

Uncaught error at extendBasis #100

garytokyo opened this issue Nov 9, 2017 · 3 comments

Comments

@garytokyo
Copy link

Could someone tell me what would cause this error? Uncaught Error at extendBasis (enclose.js:46). Not sure if this is a bug with d3-hierarchy or just the way I am using it.

I am using a React component based on this which uses d3 (I have updated it to use v4). I am also using React Router to create an SPA. My Bubble chart is on the home route all works fine apart from when navigating to another route and then back again. Once one navigates back to the home route this error occurs.

Any help appreciated.

@mbostock
Copy link
Member

That is probably a numerical issue in computing the basis. I would love to investigate this issue further, but I won’t be able to do so without knowing the inputs to packEnclose (or whatever pack methods you are using) so that I can reproduce the error. Please post a reduced test case that exhibits the error and I will reopen and investigate. Thank you!

@dheygere
Copy link

FYI I had the same Error thrown. In my case it was because I supplied a width and height of zero to pack().size([width, height]).

Ultimately that was a cross-browser issue: in Firefox getting the width and height of a container with code such as svg.node().clientWidth returned 0. I fixed my issue by using svg.node().getBoundingClientRect().width instead.

@aarthi0808
Copy link

Facing same kind of issue in using d3-hierarchy for pack layout. Please check the data i am using,
["a",5.473061352023348e+21], ["b", 1.1729457180068344e+21], ["c", 1023, 1]

Checkout the error stack messages

main-constructor.js:1357 Error
at extendBasis (d3-hierarchy.v1.js:353)
at enclose (d3-hierarchy.v1.js:321)
at packEnclose (d3-hierarchy.v1.js:536)
at d3-hierarchy.v1.js:626
at Node.node_eachAfter [as eachAfter] (d3-hierarchy.v1.js:140)
at pack (d3-hierarchy.v1.js:586)
at getPackNodeDescendants (packedbubblechart.js:476)
at SVGGElement. (packedbubblechart.js:137)
at Selection.selection_each [as each] (d3.js:1215)
at chart (packedbubblechart.js:46)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants