hrbrmstr / taucharts

:bar_chart: An R htmlwidget interface to the TauCharts javascript library
http://rpubs.com/hrbrmstr/taucharts
Other
65 stars 10 forks source link

Ordered factors do not work. #45

Closed jeremiahpslewis closed 3 years ago

jeremiahpslewis commented 9 years ago

mtcars$gear <- factor(mtcars$gear, levels = c(3,4,5), ordered = TRUE) tauchart(mtcars) %>% tau_point("mpg", "wt", color = "gear") %>% tau_legend()

timelyportfolio commented 9 years ago

Well, they work except on the legend, which I'm tracking in https://github.com/TargetProcess/tauCharts/issues/57. By coincidence, the reworked legend just got pushed to master this morning, so I'm testing it now. I'll wait for an official release before a pull.

timelyportfolio commented 9 years ago

@jlewis91 would love for you to test if possible https://github.com/timelyportfolio/taucharts/tree/devel/tau_legend_update. It seems to work. I have not had a chance to run all the examples to make sure there are no regressions.

3,4,5

devtools::install_github("timelyportfolio/taucharts@devel/tau_legend_update"
library(taucharts)

mtcars$gear <- factor(mtcars$gear, levels = c(3,4,5), ordered = TRUE)
tauchart(mtcars) %>% tau_point("mpg", "wt", color = "gear") %>% tau_legend()

image

4,3,5

# change the order
mtcars$gear <- factor(mtcars$gear, levels = c(4,3,5), ordered = TRUE)
tauchart(mtcars) %>% tau_point("mpg", "wt", color = "gear") %>% tau_legend()

image

jeremiahpslewis commented 9 years ago

devtools::install_github("timelyportfolio/taucharts@devel/tau_legend_update")

jeremiahpslewis commented 9 years ago

Works wonderfully. Thanks!

timelyportfolio commented 9 years ago

I just ran through all the examples from the Readme and what I have local. Everything seems to work fine.

@hrbrmstr, you good with waiting for an official tag bump on taucharts master before I submit a pull request, or do you want me to go ahead and submit?

jeremiahpslewis commented 9 years ago

How do you guys go about testing before a release? Is there a way of standardizing the process? Might be able to pitch in there. Earlier today there was a non-functional version in the master branch...

timelyportfolio commented 9 years ago

I plan to add a bunch of official tests using testthat. Unfortunately on the output side, I think it will be all visual and manual. I know @hrbrmstr also had a task or comment out there to also add tests.

jeremiahpslewis commented 9 years ago

Cool. There is probably a place for some validity tests of the R object that gets passed off to the htmlWidget...those tests could be automatic & would catch the most basic of errors.

timelyportfolio commented 9 years ago

Here is on incomplete example from parcoords https://github.com/timelyportfolio/parcoords/blob/master/tests/testthat/test_options.R and a fairly complete set from leaflet https://github.com/rstudio/leaflet/tree/master/tests/testit.

jeremiahpslewis commented 9 years ago

Cool. I'll see if I can grab a bit of time for that.

hrbrmstr commented 9 years ago

I'm actually hoping to use phantomjs for static & dynamic testing

On Monday, August 17, 2015, timelyportfolio notifications@github.com wrote:

I plan to add a bunch of official tests using testthat. Unfortunately on the output side, I think it will be all visual and manual. I know @hrbrmstr https://github.com/hrbrmstr also had a task or comment out there to do the same.

— Reply to this email directly or view it on GitHub https://github.com/hrbrmstr/taucharts/issues/45#issuecomment-131969384.

hrbrmstr commented 9 years ago

I shld have added that I'm good with waiting for an official release on the JS lib before we incorporate.