-
-
Notifications
You must be signed in to change notification settings - Fork 155
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
Timevis doesn't work with dates Before Common Era (or inferior to 100) #99
Comments
I'm fairly certain this is a limitation of the underlying javascript library, not the R pacakge. If you can verify that you can use these dates with https://visjs.github.io/vis-timeline/docs/timeline/ then I'll have to look at this as a bug. |
I tried the dates on: https://jsfiddle.net/api/post/library/pure/ (I don't know anything in html) ... and it did not work either. It seems indeed to be a problem of the javascript library. The strange thing is that it was working with previous versions of timevis and R: #34. |
Do you have a small reprex that worked in timevis v0.4 but doesn't work in v0.5? If so, post it here and I'll take a look |
Thanks a lot for your time @daattali. you can find a reprex in my first post that worked with 0.4 (this code don't work). I worked around this problem and find a strange solution:
Strange isn't it? Thus, for the previous reprex, the following code works:
|
It looks like your workaround for specifying dates does indeed works. I'm almost certain this is a bug to do with how dates are handled in javascript by the visjs library. I wasn't able to reproduce the regression bug though. The minimal reprex seems to be
And I went all the way back to version 0.2 and it never seemed to have worked. Please show me exact code and a specific version when this was not an issue. |
ok my apologize for my previous post. I checked all my timevis codes and I do manage to find the version that was working (I am still thinking 0.4 but as I have updated my package and my system a few time ago, I cannot be sure of it). As a clue, in this post #34, a very similar reprex was working with BCE dates in Rstudio. |
If it's different behaviour in RStudio's browser vs chrome, it's definitely a javascript issue or an issue with the browser's javascript engine parsing old dates. I don't think there's much I can do on the timevis side, unless you find out that there's a specific format that we can reliably convert old dates to automatically to make them work |
Yes it is what I have done juggling with |
A last precision for people who want to deploy the app on a server, the behavior change a little bit: for dates between 0 and 999 CE, you have to put 4 numbers (400 CE => 0400). |
If there are special ways to get certain dates to work (how do you get negative dates to work?) do you want to add documentation? |
yes of course. In which form ? a reprex ? |
No, I mean literally add a sentence to the timevis function documentation
saying in brief how to make it work with old dates
…On Sat., May 30, 2020, 15:21 K-lone, ***@***.***> wrote:
yes of course. In which form ? a reprex ?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#99 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAHIQFDX2WY4PVNQPLMZPM3RUFMDLANCNFSM4NNRJKSQ>
.
|
I will write something ina fork of the readme file, is it ok ? |
Not in the readme, it should go in the function documentation |
As a rookie user of R and timevis, it was hard to find function documentation. |
The README is for providing an overview of a package, not just into the specific edge cases of functions. It's completely standard to place such details in the function documentation, and it's an essential skill to learn to use the documentation in R. The problem is that this is not even in the function documentation yet, as you can see from the fact that this issue is still open. Feel free to submit a PR to add this info. |
Fixed in 172274f |
Hello,
I attempted to display a data set containing dates before the Common Era (BCE) which are negative (or inferior to 100) and they do not appear in the
timevis
chronology. I made a function to produce negative date usinglubridate
and put it in my column and it did not work. I put values in start/end, for example "-700" and "-700/01/01", with numeric, character, factors classes but it did not work. I have the same behavior with dates between 0 and 100.Could you help me please ? I did not find any answer on internet.
I did a reproducible example of the problem:
I get this timeline :
Capture d’écran 2020-05-28 à 17.17.29.pdf
Thanks !
Matthieu
The text was updated successfully, but these errors were encountered: