daattali / timevis

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

Error message #57

Closed arw36 closed 5 years ago

arw36 commented 6 years ago

For the longest time, my data was not showing up when I ran the timevis() function. Instead, I would receive an empty timeline. Finally, I figured out that I did not have fully unique ids in my data. Would have been wonderful if there had been some sort of data error message to help me figure this out.

daattali commented 6 years ago

Thanks for the report!

I didn't know the items don't show up if IDs are provided but are not unique, but it does make 100% sense to me since an ID is by definition supposed to always be unique (not just in timevis but anywhere). It looks like a javascript error is thrown when there are non-unique IDs. I looked at the documentation of visjs, which is the actual implementation of the library, and they also don't mention that IDs have to be unique http://visjs.org/docs/timeline/

If you feel strongly about this, I will accept a PR that checks for uniqueness of IDs and throws an appropriate error