-
Notifications
You must be signed in to change notification settings - Fork 123
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
Zoomable sunburst and underlaying circle #60
Comments
@homer3018, thanks so much for filing the issue and using I used Let me know what you think. |
Hey ! I'll try and go through your examples and translate the relevant piece of code in my shiny apps to give it a try. I understand that you're questionning yourself whether or not give an upgrade of this kind to SunburstR... I'll try it first and i might come back with further insights :) Thanks for the quick reply ! Stay in touch. |
I like a lot the d2b (with vue, if it makes it easier ?) but I don't quite get how to replace my actual Well actually I do get that I need to use How do you suggest I go about this ? Thanks ahead of time for your support. |
I will sketch out a |
Dynamically. my data.r() is reactive based on dates (to filter out the original very large dataset) and in my I just need to figure out how to replace my sunburst function with vue(). Haven't had that one figured out just yet :/ I can share more code if needed. Thank you ! |
@timelyportfolio I was playing with the d2b sunburst example you posted and noticed that the way the data is aggregated and formatted using the
C.1.a + C.1.b + C.1.c = C.1 = C However, the javascript appears to aggregate the data moving down the hierarchy for the sunburst. When you look at the plotted value for C it is displaying as 9; C.1 is displaying as 6. In other words - Where C.1' and C' are the displayed values in the final visualization. I found that aggregating my data then passing it to the hier_json <- df %>%
group_by( index1, index2, index3, index4) %>%
summarise( size = n( ) ) %>%
treepalette( ) %>%
select( index1, index2, index3, index4, size, color = HCL.color) %>%
d3_nest( value_cols = c( "size", "color")) If you are looking for assistance putting together htmlwidgets for the d2b sunburst (and/or the d2b bubble chart) I'm happy to do what I can. |
@jstrin, thanks so much for pointing this out as I have been meaning to clarify, since this can be both confusing and misleading. Your solution is very nice, so I appreciate both taking the time to find a solution and sharing it here. The problem arises when a tree is pre-summed (generally not the case in my experience, but definitely the case with
This would be a potentially breaking change, so I'll let this sit for a while and seek input in case someone has an opinion. Please let me know if you see anything amiss. For testing, we can use the following code.
... and should expect This would be much easier if we can assume all data passed to |
More for testing...
|
I've noticed this as well and wondered why though it does not affect since i do not use any of the hierarchy function and generate it myself. @timelyportfolio in your last example all I'd like to do after all is use Cheers guys, |
@homer3018, so are you saying you got it to work? or are you saying a d2b implementation will do what you want? |
@timelyportfolio I haven't gotten it to work just yet no, but yes a D2B implemantation is exactly what I need. It'd allow me to plot the stuff i need in a simple R script, and using I just don't know how to use |
In more details, I've got this in my ui.R :
and in my server.R :
From my understanding, it now needs to be
and server.R :
It is the |
@homer3018, how much are you customizing the sunburst? I am trying to decide how much customization I need to provide for what is now a barely working
|
@timelyportfolio Sorry for the late reply. Pretty busy these days... Let's make this piece of code working first before talking customization. Thanks for the hard work ! |
@homer3018 sorry I did not push the most recent commit. I will do tonight. |
@timelyportfolio sorry for the delayed response. I ran through a handful of tests including using data with truncated paths (e.g., NA values for one of the indices) and it looks good on my end. I'll re-run my test scripts after you push the updated d2b code. |
@jstrin, @homer3018 I pushed the very rough first draft prototype of |
Huge thank you @timelyportfolio !! Just what I was chasing around ! The zoom is working just fine, and I like a lot better this breadcrumb. As for arguments and customizations maybe the colors arrangements can be a little better e.g. for a blue category make all the children kinda blue as well ? I must admit that I also like in this example the underlaying grey circle, bigger than the outside diameter which make it easier to grasp (from my perspective at least) how much weight this or that category has. The counterpart of this is they have disabled the greyed parts that or not being hovered. Maybe this can be an option ? Also I think they've set the inner diameter to 0, which makes the root a small circle in the middle. But that's all aesthetic stuff. I think really the color management should be a bit better instead of random (is it ?) |
@timelyportfolio I just tested to put the sund2b object in a shiny app using
|
@homer3018 Shiny should now be fixed. I changed color default to |
That's great, thank you very much ! I'll try and test it out later today and of course I'll come back here with feedback :) |
@timelyportfolio I ran through a handful of different data structures both pre-summed and and and it looks good to me |
@timelyportfolio Sorry again for the late response. See the screenshot here : https://imgur.com/a/vKhix |
And said icons do not appear when I use it outside shiny e.g. using |
@homer3018 I see it now, and I am glad that you found that. The issue is that As to why the icons aren't centered in Shiny, bootstrap css conflicts with I have added css to override. |
@timelyportfolio sorry again for the delayed response. Somehow the css does not override and I'm still getting an offset for the icons. Other than that everything is fine with me as I don't bother not getting the icons when not using Shiny. Thanks a lot |
@timelyportfolio hey, did you actually go ahead and deploy this code or is this just a dev version ? In other words will i get the function The icon thing is not too much of an issue although it would be nice. |
@homer3018, yes this is on CRAN now. I will warn that currently |
Happy enough with the results. Thanks. |
Hi there,
I've been using this package for quite a bit of time now, and along with shiny and some input to manually choose which hierarchy you want to see, you can quickly explore your data and that's great.
However I still miss the zoomable feature which could allow to dig deeper in the chosen hierarchy, allowing for deeper hierarchy.
How hard would it be to add the arcTween function, as seen in action here for instance :
https://bl.ocks.org/WangQiru/effe919b93164bca9f59b73d37577ef1
I also like a lot the underlaying grey circle as seen here :
http://www.brain-map.org/api/examples/examples/sunburst/
I've managed to get it done somewhere in a modified version of sunburst.js but I could not find it. I've added things like :
var arcHighlight = d3.svg.arc() .startAngle(function(d) { return Math.max(0, Math.min(2 * Math.PI, x(d.x))); }) .endAngle(function(d) { return Math.max(0, Math.min(2 * Math.PI, x(d.x + d.dx))); }) .innerRadius(function(d) { return !isParent(d) ? r - outerRadius : Math.max(0, y(d.y + d.dy)); }) .outerRadius(function(d) { return r; });
and some animations as well to make it smoother with
path.transition() .duration(750)
in the mouseover function.I've never been able to make the arcTween function do what it's supposed to do, but I'm not a js guru :)
Any help would be appreciated on both topics.
Keep up the good work !
The text was updated successfully, but these errors were encountered: