daattali / timevis

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

Google Chrome does not render correctly 4000 years bC. #34

Closed OmarGonD closed 7 years ago

OmarGonD commented 7 years ago

Hi daattali,

Thank you for 'timevis'. I just need to make a timeline that goes 4000 years bC. It renders well in RStudio but not in Google Chrome (not tested in other browsers).

You may want to check on this.

Code:

` data <- data.frame( id = 1:4, content = c("4000 years - Before JesusChrist", "History changes" ,"Ranged item", "Item four"), start = c("-4000","0000-01-01", "2016-01-20", "2016-02-14"), end = c(NA , NA, "2016-02-04", NA) )

timevis(data) `

RStudio:

rstudio-timevis

Google Chrome:

googlechrome-timevis

daattali commented 7 years ago

It actually looks fine to me in chrome? The current date is in the center. Cashed you scroll left to get to 4000bc or use the api functions? It doesn't seem broken to me On Jul 6, 2017 20:53, "omar" notifications@github.com wrote:

Hi daattali,

Thank you for 'timevis'. I just need to make a timeline that goes 4000 years bC. It renders well in RStudio but not in Google Chrome (not tested in other browsers).

You may want to check on this.

Code:

` data <- data.frame( id = 1:4, content = c("4000 years - Before JesusChrist", "History changes" ,"Ranged item", "Item four"), start = c("-4000","0000-01-01", "2016-01-20", "2016-02-14"), end = c(NA , NA, "2016-02-04", NA) )

timevis(data) `

RStudio:

[image: rstudio-timevis] https://user-images.githubusercontent.com/7775734/27927726-4d84a202-6252-11e7-88e5-7ee1dadae678.png

Google Chrome:

[image: googlechrome-timevis] https://user-images.githubusercontent.com/7775734/27927735-55b59670-6252-11e7-97c0-14e1a8e66d00.png

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/daattali/timevis/issues/34, or mute the thread https://github.com/notifications/unsubscribe-auth/AA6IFMseGAq1QB876m91lA2xagTgrVqnks5sLS0agaJpZM4OQCoQ .

OmarGonD commented 7 years ago

The thing is that "4000 years - Before JesusChrist" should be to the left of the red line, as in RStudio. In Chrome it appears to the right.

May you share with me a print of what you see on Chrome?

daattali commented 7 years ago

Ah I do see that now. Looking at your code more closely, I'm not surprised that doesn't work. I don't think specifying "-4000" is a correct way to specify year 4000BCE (you're also supposed to use year-month-date, it doesn't have to work without that). The fact that it works inside rstudio is actually strange!

daattali commented 7 years ago

back to your original question - perhaps specifying negative times cannot work.... I suggest you look at http://visjs.org/docs/timeline/ and see if negative times are supported there first (I didn't see any such examples)

So for now my answer is probably not unfortunately!

OmarGonD commented 7 years ago

I was afraid of that. Thanks anyway.

daattali commented 7 years ago

sorry!

grisuf commented 5 years ago

As far as I can see, it should be possible to display dates BCE if the dates are formatted as six digits year notation: https://github.com/almende/vis/issues/307#issuecomment-55759488 Would it be possible to implement this?

daattali commented 5 years ago

@grisuf if the docs show it's possible, then I do suggest you try it out. If it doesn't seem to work, you can post an example here of the visjs code that works and the equivalent timevis code that doesn't and I can look into it

grisuf commented 5 years ago

While

{"content":"Romulus","start":"-753","end":"-716","group":"37","gruppe":"regierung"}

isn't working, padding with zeros as follows works:

{"content":"Romulus","start":"-000753","end":"-000716","group":"37","gruppe":"regierung"}

So for all negative years it would be fine if they could be padded with zeros to six digits.