-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Sunburst chart calculate radius not counted exists of root area and inner radius #1511
Comments
Thanks @moononournation your fix is working. This behavior is actually an issue for us. The arcs of the actual values are beeing "eaten up" by the white inner radius. Or in other words, the radiusses of the value arcs do not adopt to the inner radius (root). Here is a minimal js fiddle : https://jsfiddle.net/the3ver/j1qedybp/14/ (dc.js 3.1.9): Changing the inner radius does not affect the distance of the outer ring from the center. If you set inner radius to 0 the additional space is not distributed to the rings. We are using version 3.x. unfortuanetly and would need a fix there. |
Hi @the3ver, @moononournation. I did look at this when @moononournation filed it (and thought I commented on it, but maybe I got confused and didn't commit my comment). Whenever changing the behavior I like to know:
TBH I'm still rather confused about this. It looks like there are a couple of strategies for how to use a sunburst, and the current code is using the same strategy as this block. However, this tutorial might be closer to the @moononournation solution (?) Just a guess, but it seems like the answers are
Probably the quickest path forward, which wouldn't require any deeper understanding, is to add an option to the chart that allows choosing either behavior. If anyone wants to contribute a PR in that direction (defaulting to the old behavior), it would be easy to merge without worrying about breakage. Thank you. |
Hi @gordonwoodhull, we found a solution for that, which even allows custom "relative ring sizes" and is still quite a small change. We'll post a corresponding pull request soon, hopefully with tests. |
Hi @gordonwoodhull, since our project is still using 3.x, would you rather have a pull request based on the support/3.x branch first and after all is sorted and merged another one to port the changes up to 4? Or the other way round? Cheers! |
… ring sizing; fixes dc-js#1511
Fixed by #1655 in 3.2.0 / 4.0.2 |
Sunburst chart use d3.partition() to calculate the data size. This function reserved first level as root, but this area should not show in sunburst chart. Currently, second level shared this area, so the second level always larger that other level if inner radius is 0. In contrast, if setting inner radius too large, the first few levels cannot show.
So I suggest change the partition size setting to:
And then change radius calculation in buildArcs() to:
The text was updated successfully, but these errors were encountered: