shosaco / vistime

Pretty timelines in R.
https://shosaco.github.io/vistime
GNU General Public License v3.0
168 stars 11 forks source link

hc_timevis groups inverted #24

Closed dmuijen closed 3 years ago

dmuijen commented 3 years ago

Hello,

Thanks for this package, I like the interoperability between ggplot/ployl/highcharts alot. I was trying to make a timevis visual using hc_timevis, the order of the groups seems to get inverted somewhere along the way. See the example code where phase 1 gets tagged to phase 4 etc. Evident in the president example as well with Washington on the wrong timeline: pres_hc

When I rebuild with y_vals <- names(sort(c(cats, setdiff(seq_len(max(data$y)), cats)), decreasing=TRUE)) in plot_highchart instead of y_vals <- names(sort(c(cats, setdiff(seq_len(max(data$y)), cats)))) its working fine, but this might affect other things, not sure.

shosaco commented 3 years ago

You are absolutely right, how could I miss that. It's even obvious in the vignettes. You fix does the trick and only influences the labelling of the y axis. Fixed in the dev version.