daattali / timevis

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

start/end config options are ignored #115

Closed daattali closed 2 years ago

daattali commented 2 years ago

As reported by @ismirsehregal in https://github.com/daattali/timevis/issues/50#issuecomment-918999349

timevis(data.frame(id=1:3, content=c("a","b","c"), start=c("2020-05-05","2020-05-09","2020-05-18")), options = list(start = "2020-04-09"))
daattali commented 2 years ago

This was happening because of the fit=TRUE parameter of timevis(). If you would have set fit=FALSE or if you would have added %>% setOptions(start=..., end=...) then it would have worked.

I fixed it by setting fit=FALSE if start or end are provided. FYI this wasn't a regression, this never worked previously either.

ismirsehregal commented 2 years ago

Thanks for investigating!

I'm not sure what went wrong regarding my initial test (all items were shown).

Now it's working correctly. However, setting fit=TRUE or fit=FALSE doesn't make a difference neither for the CRAN version nor for the latest dev version. start and end are always respected.

daattali commented 2 years ago

Right, as I said the only way to fix this was to manually override the fix parameter to be FALSE whenever a start or end are provided. You can't respect both fit=TRUE and a start/end.