daattali / timevis

📅 Create interactive timeline visualizations in R
http://daattali.com/shiny/timevis-demo/
Other
655 stars 157 forks source link

vis 4.19.1 #32

Closed WaitNkill closed 5 years ago

WaitNkill commented 7 years ago

May want to update to the js 4.19 Im assuming between their 4.16. and 4.19, they added the group nesting functionality. Spent a while trying to figure out why i couldnt get it to work haha. I did switch out the files in my local lib and ran my nested timeline, that worked, i ran your current sample app and initially World Cup and Groups tab did not work, after looking into it, those were the only 2 tabs that were using your datetime string. I removed the times and now everything works on this this version. So just need to check on the required datetime format.

thanks

daattali commented 7 years ago

Yes you are correct! I've actually had a few people over the past month email me about nested groups and I've had to tell them that unfortunately I released this package just before nested groups were implemented in visjs.

I've been meaning to update to the latest visjs but I'm swamped with work on other projects and can't do this for at least the next few weeks.

I would very happily accept a PR if you have the time and patience to update the version and ensure current code isn't broken :)

daattali commented 7 years ago

@WaitNkill were you able to get nested groups to work with timevis, by providing all the code within R? Or did you use javascript code for nested groups?

I'm looking into updating to visjs 4.19, but there are a couple issues when it runs as an htmlwidget (any item with a time doesn't show up in RStudio Viewer, in order to edit an item you need to double click instead of single click on it). So I want to see if there are benefits to upgrading - if you got nested groups to work that that'd be a nice benefit because several people asked about it

WaitNkill commented 7 years ago

@daattali - sorry i originally thought i got it to work- the timeline does show the nested groups, but the collapse and uncollapse is not working. So far all i changed was some R in order for a list to be passed rather than just a df, I also added listener to track timeline.GroupsData to debug, still couldnt figure out the issue, will play with it today and will let you know

daattali commented 7 years ago

I was also playing with it for an hour last night, I went the other way: instead of changing code on the R side, I took care of the nestedGroups array on the javascript side. You can see my attempt here: https://github.com/daattali/timevis/tree/upgrade-vis4.19.1

Would be interested to see your approach, it's probably cleaner. But I also ran into the same issue - the UI looks ok but you can't actually collapse and uncollapse. Haven't spent too much time debugging though


Dean Attali President & CEO AttaliTech Ltd http://AttaliTech.com http://attalitech.com

On 21 May 2017 at 12:52, WaitNkill notifications@github.com wrote:

@daattali https://github.com/daattali - sorry i originally thought i got it to work- the timeline does show the nested groups, but the collapse and uncollapse is not working. So far all i changed was some R in order for a list to be passed rather than just a df, I also added listener to track timeline.GroupsData to debug, still couldnt figure out the issue, will play with it today and will let you know

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/daattali/timevis/issues/32#issuecomment-302948537, or mute the thread https://github.com/notifications/unsubscribe-auth/AA6IFMetUyH9wDE-dplGSuF163q1IOPhks5r8GuwgaJpZM4NgfG0 .

WaitNkill commented 7 years ago

@daattali - When i originally just swapped viz.js, i did notice 2 tabs on your example wasnt showing any data- i did have to reformat the sampledata.R File, and put back the "T" (2014-07-13 T16:00) within the datasets. I'm at home now, but i'll upload what i did when i get a chance, i also incorporated the listview package that way, i can easily edit the data on the fly.

looking over your changes, you just went and changed the update groups api , am i seeing that right? i went ahead and changed the timevis function that way you can pass a nested list through the main function, ( so had to edit all the dataframe checks you had in place).

daattali commented 7 years ago

What I noticed is that after swapping vis4.16 for 4.19, the tabs with specific times did not work in RStudio Viewer, but if I opened it in Chrome then it did work. No other changes, only swapping the old for the new visjs library, everything still works in Chrome.

I didn't really change the groups API, I just added a "cleanup" function that takes the nestedgroups data and parses it out as JSON so that it'll be an array rather than a string, that's all. Very minimal change, a few lines


Dean Attali President & CEO AttaliTech Ltd http://AttaliTech.com http://attalitech.com

On 21 May 2017 at 13:10, WaitNkill notifications@github.com wrote:

@daattali https://github.com/daattali - When i originally just swapped viz.js, i did notice 2 tabs on your example wasnt showing any data- i did have to reformat the sampledata.R File, and put back the "T" (2014-07-13 T16:00) within the datasets. I'm at home now, but i'll upload what i did when i get a chance, i also incorporated the listview package that way, i can easily edit the data on the fly.

looking over your changes, you just went and changed the update groups api , am i seeing that right? i went ahead and changed the timevis function that way you can pass a nested list through the main function, ( so had to edit all the dataframe checks you had in place).

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/daattali/timevis/issues/32#issuecomment-302949600, or mute the thread https://github.com/notifications/unsubscribe-auth/AA6IFAwkpZKRVms8OQ7VeSHwBdakBMgLks5r8G_pgaJpZM4NgfG0 .

WaitNkill commented 7 years ago

@daattali - Hey sorry never got back to you, i realized vis.js is limited on the amount of nesting. So my focus shifted towards buidling out a widget using https://docs.dhtmlx.com/gantt/.

Also after reading some of the issues in vis 4.19, i was going to say you should hold off on this update until they release 4.20, but then i just saw he pushed out 4.20 yesterday. Im still interested in using vis.js, but not for my current project, I'll let you know if i ever get some free time to contribute on any of your future releases.

Thanks

daattali commented 7 years ago

I'll take a look at 4.20, thanks. That other library seems much more feature rich , good luck

daattali commented 6 years ago

part of https://github.com/daattali/timevis/issues/50

daattali commented 5 years ago

Closing because there's an issue about upgrading to a newer version

strazto commented 5 years ago

I'm wondering, does nestedgroups work in R, then? When passing in a list-col (of S3: Glue objects), they seem to be coreced to the following form: "c(\"Id1\", \"Id2\")"

Is there something I should be doing to make this parse to a JSON array?

WurmPeter commented 1 year ago

Sorry to use this issue: @WaitNkill Were you able to use dhtmlx gantt with R?