Skip to content
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

Add list of to-dos with priority #1

Open
timelyportfolio opened this issue Aug 3, 2015 · 40 comments
Open

Add list of to-dos with priority #1

timelyportfolio opened this issue Aug 3, 2015 · 40 comments

Comments

@timelyportfolio
Copy link
Collaborator

Happy to help on this one. Do you have a prioritized list of to-dos?

@hrbrmstr
Copy link
Owner

hrbrmstr commented Aug 3, 2015

TODOs

  • testthat
  • date "stuff" (gosh I wish date stuff between R & javascript were so ugly). dates aren't really working
  • composite charts (http://api.taucharts.com/basic/composite.html) right now only basic charts work. may need to re-write them to use the COORDS… and ELEMENT… format
  • support scatterplot matrices (http://api.taucharts.com/advanced/splom.html) [this may work tho - see Rpubs at the end]
  • rewrite tauCharts.normalize.min.css and uncomment in yaml config so fonts look better again (they were killing Rmd html output)
  • facet guides (http://api.taucharts.com/basic/facet.html scroll down to "Simple way…")
  • other built-in color scales besides manual (like in metricsgraphics)
  • figure out taucharts "plugins"
  • stacked bar chart
  • find docs on parallel coordinate chart
  • find docs on maps (they claim to have support now)
  • better detection of column/object types and auto-creation of scales for them
  • better/more/actual examples in documentation
  • vignette
  • CRAN!

@hrbrmstr
Copy link
Owner

hrbrmstr commented Aug 3, 2015

We can break out each TODO as an issue for separate tracking but the master list can be kept here

@timelyportfolio
Copy link
Collaborator Author

great thanks. I'll get to work on basic factor support even though not in the TODO, and then try to play some with the dates.

@vladminsky
Copy link

Hi! R htmlwidget is a great initiative! I'm developer of taucharts and happy to see this project started.

Just wanted to share with you our nearest project plans. Currently we are:

  • re-working CSS to have good isolation and support different themes as well
  • improve examples and documentation

Next plan is to rework and document legend and tooltip plugins since they were implemented on top of pure D3 before plugins concept was stabilized.

Parallel and geo coordinates are in beta now and have several bugs with resizing and ugly labels positioning. They are in queue to be fixed and documented.

Actually strategic goal for this year is to "squeeze out" full power of cartesian coordinates and avoid any new coordinate types for a while (like polar, pie charts etc).

Please don't hesitate to discuss, ask questions or post issues / pull requests to taucharts.

Thanks again!
Vladimir Petriko

@hrbrmstr
Copy link
Owner

hrbrmstr commented Aug 4, 2015

Thank you for the sweet javascript charting library! Super-helpful &
consistent API for the core feature set. Def let us know if you need us to
beta anything.

On Tue, Aug 4, 2015 at 5:50 AM, Petriko Vladimir [email protected]
wrote:

Hi! R htmlwidget is a great initiative! I'm developer of taucharts and
happy to see this project started.

Just wanted to share with you our nearest project plans. Currently we are:

  • re-working CSS to have good isolation and support different themes
    as well
  • improve examples and documentation

Next plan is to rework and document legend and tooltip plugins since they
were implemented on top of pure D3 before plugins concept was stabilized.

Parallel and geo coordinates are in beta now and have several bugs with
resizing and ugly labels positioning. They are in queue to be fixed and
documented.

Actually strategic goal for this year is to "squeeze out" all power of
cartesian coordinates and avoid any new coordinate types for a while (like
polar, pie charts etc).

Please don't hesitate to discuss, ask questions or post issues / pull
requests to taucharts.
Thanks again!

Vladimir Petriko


Reply to this email directly or view it on GitHub
#1 (comment).

@timelyportfolio
Copy link
Collaborator Author

Guess we can start checking some of this off. I checked off plugins even though I know there are some remaining.

@hrbrmstr
Copy link
Owner

hrbrmstr commented Aug 4, 2015

@timelyportfolio I just made a dev branch to avoid me adding things that may not work into master. You should prbly fork that (I made a cpl changes after you got everything back to working)

@timelyportfolio
Copy link
Collaborator Author

Ok, thanks, sounds good.

@hrbrmstr
Copy link
Owner

hrbrmstr commented Aug 4, 2015

I made a stable release (0.1.0) for master branch and update-merged dev branch. New Rpub (with working trendline!) is up as well.

@timelyportfolio
Copy link
Collaborator Author

Great. Have a pull now to add min/max to tau_guide_? based on TargetProcess/tauCharts#34 and #12. It is in my devel/axis_minmax branch if you want to try it first. Fun to dig out the undocumented behavior :)

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

DF <-
    structure(
        list(
            Ranking = structure(
                1:5, .Label = c("Bottom", "Bellow Average",
                                "Average", "Above Average", "Top"), class = "factor"
            ), Prob = c(20L,
                        20L, 20L, 20L, 20L)/100
        ), .Names = c("Ranking", "Prob"), row.names = c(NA,-5L), class = "data.frame"
    )

tauchart(DF) %>% 
    tau_bar(x="Ranking", y="Prob") %>% 
    tau_guide_y(tick_format="%", min = 0, max = 1) 

@timelyportfolio
Copy link
Collaborator Author

If possible, would like to feature this as the htmlwidget of the week. Let me know if this causes any problems.

@hrbrmstr
Copy link
Owner

hrbrmstr commented Aug 4, 2015

go forth and showcase! 😀

On Tue, Aug 4, 2015 at 3:41 PM, timelyportfolio [email protected]
wrote:

If possible, would like to feature this as the htmlwidget of the week. Let
me know if this causes any problems.


Reply to this email directly or view it on GitHub
#1 (comment).

@hrbrmstr
Copy link
Owner

hrbrmstr commented Aug 4, 2015

re: #12, aye, I think we're definitely full-on headed into "pry the details from the javascript files" vs "read the API docs" territory. good. times.

@hrbrmstr
Copy link
Owner

hrbrmstr commented Aug 4, 2015

You may want to sync the dev branch before doing too much more hacking.

  • fixed bug in tau_guide_gridlines
  • reorganized code into grouped, separate files
  • added examples to everything
  • added a dataset (cars_data)
  • updated version number (0.2.0.9000)

@benporter
Copy link

cool package!

suggested to do item: provide an example of how to use taucharts with shiny

@ThoDuyNguyen
Copy link

The package is so cool.
Shiny example is more than welcome.

@ThoDuyNguyen
Copy link

@benporter : I find an example from another issue and modify it a bit for an example. Here you go

# This is the server logic for a Shiny web application.
# You can find out more about building applications with Shiny here:
#
# http://shiny.rstudio.com
#

library(shiny)
library(htmlwidgets)
library(taucharts)


shinyServer(function(input, output) {
    scatter_dat <-
        structure(
            list(
                team = c("d", "d", "d", "d", "l", "l", "l", "l",
                         "k", "k", "k", "k"), cycleTime = c(1L, 2L, 3L, 4L, 2L, 3L, 4L,
                                                            5L, 2L, 3L, 4L, 5L), effort = c(1L, 2L, 3L, 4L, 1L, 2L, 3L, 4L,
                                                                                            4L, 5L, 6L, 8L), count = c(1L, 5L, 8L, 3L, 1L, 5L, 8L, 3L, 1L,
                                                                                                                       5L, 8L, 3L), priority = c(
                                                                                                                           "low", "low", "medium", "high", "low",
                                                                                                                           "low", "medium", "high", "low", "low", "medium", "high"
                                                                                                                       )
            ), .Names = c("team",
                          "cycleTime", "effort", "count", "priority"), class = "data.frame", row.names = c(NA, 12L)
        )

    line_dat <-
        structure(
            list(
                type = c(
                    "us", "us", "us", "us", "us", "us", "bug",
                    "bug", "bug", "bug", "bug"
                ), count = c(0L, 10L, 15L, 12L, 16L,
                             13L, 21L, 19L, 23L, 26L, 23L), date = c(
                                 "12-2013", "01-2014",
                                 "02-2014", "03-2014", "04-2014", "05-2014", "01-2014", "02-2014",
                                 "03-2014", "04-2014", "05-2014"
                             )
            ), .Names = c("type", "count",
                          "date"), class = "data.frame", row.names = c(NA, 11L)
        )

    bar_dat <-
        structure(
            list(
                team = c("d", "d", "d", "d", "l", "l", "l", "l",
                         "k", "k", "k", "k"), cycleTime = c(1L, 2L, 3L, 4L, 2L, 3L, 4L,
                                                            5L, 2L, 3L, 4L, 5L), effort = c(1L, 2L, 3L, 4L, 1L, 2L, 3L, 4L,
                                                                                            4L, 5L, 6L, 8L), count = c(1L, 5L, 8L, 3L, 1L, 5L, 8L, 3L, 1L,
                                                                                                                       5L, 8L, 3L), priority = c(
                                                                                                                           "low", "low", "medium", "high", "low",
                                                                                                                           "low", "medium", "high", "low", "low", "medium", "high"
                                                                                                                       )
            ), .Names = c("team",
                          "cycleTime", "effort", "count", "priority"), class = "data.frame", row.names = c(NA, 12L)
        )

    car_dat <-
        structure(
            list(
                car = c(
                    "Toyota Prius+", "Volvo S60", "BMV X5",
                    "Infinity FX", "Mercedes Vito", "Peugeot 3008", "Subaru Forester",
                    "Lexus RX", "Bentley Continental"
                ), co2 = c(96L, 135L, 197L,
                           238L, 203L, 155L, 186L, 233L, 246L), hp = c(99L, 150L, 306L,
                                                                       238L, 95L, 120L, 150L, 188L, 507L), euroEco = c(
                                                                           "eco", "eco",
                                                                           "non-eco", "non-eco", "non-eco", "non-eco", "non-eco", "non-eco",
                                                                           "non-eco"
                                                                       ), power = c(
                                                                           "low", "normal", "high", "high", "low",
                                                                           "low", "normal", "normal", "high"
                                                                       )
            ), .Names = c("car", "co2",
                          "hp", "euroEco", "power"), class = "data.frame", row.names = c(NA, 9L)
        )

    splom_dat <-
        structure(
            list(
                param1 = c(
                    "hp", "hp", "hp", "co2", "co2", "co2",
                    "mpg", "mpg", "mpg", "hp", "hp", "hp", "co2", "co2", "co2", "mpg",
                    "mpg", "mpg", "hp", "hp", "hp", "co2", "co2", "co2", "mpg", "mpg",
                    "mpg", "hp", "hp", "hp", "co2", "co2", "co2", "mpg", "mpg", "mpg",
                    "hp", "hp", "hp", "co2", "co2", "co2", "mpg", "mpg", "mpg", "hp",
                    "hp", "hp", "co2", "co2", "co2", "mpg", "mpg", "mpg", "hp", "hp",
                    "hp", "co2", "co2", "co2", "mpg", "mpg", "mpg", "hp", "hp", "hp",
                    "co2", "co2", "co2", "mpg", "mpg", "mpg", "hp", "hp", "hp", "co2",
                    "co2", "co2", "mpg", "mpg", "mpg"
                ), param2 = c(
                    "hp", "co2", "mpg",
                    "hp", "co2", "mpg", "hp", "co2", "mpg", "hp", "co2", "mpg", "hp",
                    "co2", "mpg", "hp", "co2", "mpg", "hp", "co2", "mpg", "hp", "co2",
                    "mpg", "hp", "co2", "mpg", "hp", "co2", "mpg", "hp", "co2", "mpg",
                    "hp", "co2", "mpg", "hp", "co2", "mpg", "hp", "co2", "mpg", "hp",
                    "co2", "mpg", "hp", "co2", "mpg", "hp", "co2", "mpg", "hp", "co2",
                    "mpg", "hp", "co2", "mpg", "hp", "co2", "mpg", "hp", "co2", "mpg",
                    "hp", "co2", "mpg", "hp", "co2", "mpg", "hp", "co2", "mpg", "hp",
                    "co2", "mpg", "hp", "co2", "mpg", "hp", "co2", "mpg"
                ), value1 = c(
                    99,
                    99, 99, 96, 96, 96, 3.8, 3.8, 3.8, 150, 150, 150, 135, 135, 135,
                    7.4, 7.4, 7.4, 306, 306, 306, 197, 197, 197, 11.2, 11.2, 11.2,
                    238, 238, 238, 238, 238, 238, 11.2, 11.2, 11.2, 95, 95, 95, 203,
                    203, 203, 9.4, 9.4, 9.4, 120, 120, 120, 155, 155, 155, 9.2, 9.2,
                    9.2, 150, 150, 150, 186, 186, 186, 10.4, 10.4, 10.4, 188, 188,
                    188, 233, 233, 233, 13.3, 13.3, 13.3, 507, 507, 507, 246, 246,
                    246, 15.4, 15.4, 15.4
                ), value2 = c(
                    99, 96, 3.8, 99, 96, 3.8,
                    99, 96, 3.8, 150, 135, 7.4, 150, 135, 7.4, 150, 135, 7.4, 306,
                    197, 11.2, 306, 197, 11.2, 306, 197, 11.2, 238, 238, 11.2, 238,
                    238, 11.2, 238, 238, 11.2, 95, 203, 9.4, 95, 203, 9.4, 95, 203,
                    9.4, 120, 155, 9.2, 120, 155, 9.2, 120, 155, 9.2, 150, 186, 10.4,
                    150, 186, 10.4, 150, 186, 10.4, 188, 233, 13.3, 188, 233, 13.3,
                    188, 233, 13.3, 507, 246, 15.4, 507, 246, 15.4, 507, 246, 15.4
                )
            ), .Names = c("param1", "param2", "value1", "value2"), class = "data.frame", row.names = c(NA,
                                                                                                       81L)
        )

    output$bar <- renderTaucharts({
        tauchart(bar_dat) %>% tau_bar("team", "effort", color = "priority") %>%
            tau_legend() %>% tau_tooltip()
    })

    output$line <- renderTaucharts({
        tauchart(line_dat) %>% 
            tau_line("date", "count", color = "type") %>% 
            tau_guide_x(label="Month") %>% 
            tau_guide_y(label="Count of completed entities", label_padding=50) %>% 
            tau_guide_padding(70, 70, 10, 10) %>%
            tau_legend() %>%
            tau_tooltip()
    })
})
# This is the user-interface definition of a Shiny web application.
# You can find out more about building applications with Shiny here:
#
# http://shiny.rstudio.com
#

library(shiny)
library(htmlwidgets)
library(taucharts)

shinyUI(fluidPage(

  # Application title
  titlePanel("Old Faithful Geyser Data"),

  # Sidebar with a slider input for number of bins
  sidebarPanel(width = 3,
               selectInput(
                   "data", label = h4("Data available:"),
                   choices = c("none", "little", "some", "lots"),
                   selected = 1
               )),
  mainPanel(
    tabsetPanel(
        tabPanel("bar", tauchartsOutput("bar")),
        tabPanel("line", tauchartsOutput("line"))
    )
  )
))

@hrbrmstr
Copy link
Owner

hrbrmstr commented Aug 5, 2015

@ThoDuyNguyen thx for piecing and example together! I just pushed 0.2.5.9000 to the dev branch. It has a new function run_tau_app(). If run with no parameters it will display a list of available built-in apps to run (which is just this one at the moment) and when run with an app name (e.g. run_tau_app("tau01")) will display the location of the app (so it's easy to find the source files) and then run the app. If you can provide your full name I can add you as a contributor to the DESCRIPTION file.

@ThoDuyNguyen
Copy link

@hrbrmstr : You can use my name: "Thọ Duy Nguyễn".
If you want to make Shiny examples to put into the package, please let me know.
I'm planning to use this library for my Shiny dashboard so I think I will have many demos.
Kind regards .

@happyshows
Copy link

@hrbrmstr just come here to thump up for this package 👍 and maybe add publish to CRAN as to-do item?

@hrbrmstr
Copy link
Owner

hrbrmstr commented Aug 6, 2015

doh! super-good idea. that is def missing and we def need to try to get it
on CRAN

On Wed, Aug 5, 2015 at 9:52 PM, Shows Le [email protected] wrote:

@hrbrmstr https://github.com/hrbrmstr just come here to thump up for
this package [image: 👍] and maybe add publish to CRAN as to-do item?


Reply to this email directly or view it on GitHub
#1 (comment).

@pssguy
Copy link

pssguy commented Aug 10, 2015

Great package

TODO requests

Sort out Dates ( I know!) inc ability to show different in tooltip and axis. eg tt 26 Sep 2003, whilst axis just shows years(once!)

ability to angle legend labels

chart title

same opacity on points and legend - or preferably ability to set as required

encourage taucharts guys to do an equivalent of ggplot geom_rect. Or something that can have
as background a time period eg presidents time in office, basketball managers tenure as backing
to a, say, linechart

More to come(I'm sure)

Keep up the good work

@hrbrmstr
Copy link
Owner

Danke! A cpl quick comments:

  • Dates: YES! (will try to get some more support this week for that)
  • Angled labels: Not sure tauCharts JS supports that…will check into it
  • Title: @timelyportfolio what's the official htmlwidget stance on titles? I keep getting similar reqs for metricsgraphics but when I supported titles in the pkg originally jj (or someone) removed it
  • Opacity: that's a tauCharts thing. we could do it in our pkg but it would not track with the intent of tauCharts (when you actually hover over the legend item the points/lines/etc show up in the non-alpha version). you might want to petition them for a setting for this
  • geom_rect: roger that. i shall submit a req and you shld pile on after that :-)

Keep'em coming!

@pssguy
Copy link

pssguy commented Aug 11, 2015

@hrbrmstr

  • I find Angled labels v useful
  • Title is lower priority for me
  • Opacity was more an observation than a request
  • geom_rect Let me know when you have raised issue and I will +1

hrbrmstr pushed a commit that referenced this issue Aug 17, 2015
@happyshows
Copy link

@hrbrmstr

One key function missing across almost all htmlwidgets (except for visNetwork) is to return value of selected item. It will open a whole lot of opportunities for answering 'what's next' type of questions.
To me this is an extremely important feature for interactive drill down, but somehow it's not mandated by htmlwidgets. Can this be part of to do list?

@hrbrmstr
Copy link
Owner

Return value of which selected item? Back to R? In the JavaScript?

@timelyportfolio
Copy link
Collaborator Author

I'm guessing datastorm-open/visNetwork#14 and the broader discussion ramnathv/htmlwidgets#86. Was just playing with this in taucharts last night using the tasks functionality. I'll try to work up some code, but for now it will be a hack.

@hrbrmstr
Copy link
Owner

is this something taucharts even supports directly (i.e. if they change naming conventions/etc this will break, right?)

@happyshows
Copy link

back to R (shiny), in visNetwork there's an option to fetch node.
visOptions(nodesIdSelection = TRUE), and the selected id is returned via input$visobjectname_selected

@timelyportfolio
Copy link
Collaborator Author

Yes, it will break, and that is why I hesitated to even discuss.

@hrbrmstr
Copy link
Owner

@happyshows If you could, perhaps, put a feature issue request to the TauCharts JS folks to provide this functionality so we could add it officially (and properly) vs a hack, it'd be most appreciated.

@happyshows
Copy link

@hrbrmstr cool, will look into that.

@timelyportfolio
Copy link
Collaborator Author

Alright, @happyshows here is an example using tau_tasks to add an event listener. I'll caution again this is a hack, but it does demonstrate the power of tasks to completely customize behavior. As an example how this is not really generic and difficult to implement on our side, tau_legend() will remove our click handling elements, so we lose click handling when the legend is toggled.

in JavaScript

In this case, you might want to trigger other actions in JavaScript based on a click event on a TauCharts bar. I'm using a bar chart but this should work for the other chart types also, since I kept the CSS selector generic.

library(taucharts)

esoph_tbl <- xtabs( ncases ~ agegp + alcgp, esoph )

tauchart(esoph_tbl) %>%
  tau_bar( "agegp", "Freq", "alcgp" ) %>%
  tau_tasks(
'
function(){
  d3.select(this.el).selectAll(\'[class^="graphical-report"] .i-role-datum\')[0].forEach(
    function(el){
      el.addEventListener( "click", function(e) {
        alert( "clicked " + JSON.stringify(d3.select(e.target).datum().data) );
      })
    })
}
'
  )

in Shiny

Here we can send the clicked data from TauCharts back to R in Shiny. As a simple example, the data for the clicked bar will be output in a textOutput.

library(shiny)
library(htmlwidgets)
library(taucharts)

ui <- list(
  tauchartsOutput( 'mytauchart' )
  ,textOutput( "messages", container = p)
)

server <- function( input, output, session ){
  output$mytauchart <- renderTaucharts({
    tauchart(esoph_tbl) %>%
      tau_bar( "agegp", "Freq", "alcgp" ) %>%
      tau_tasks(
        '
function(){
  var el_id = this.el.id;
  d3.select(this.el).selectAll(\'[class^="graphical-report"] .i-role-datum\')[0].forEach(
    function(el){
      el.addEventListener( "click", function(e) {
        Shiny.onInputChange(
          el_id + "_click",
          {data:d3.select(e.target).datum().data}
        )
      })
    })
}
'
      )
  })

    # from https://github.com/rstudio/leaflet/blob/master/inst/examples/shiny.R
    v <- reactiveValues(msg = "")

    observeEvent(input$mytauchart_click, {
      v$msg <- paste("Clicked ", input$mytauchart_click$data)
    })

    output$messages <- renderText(v$msg)

}

shinyApp(ui,server)

@happyshows
Copy link

@timelyportfolio thanks for the explanation and solution.

@timelyportfolio
Copy link
Collaborator Author

@hrbrmstr , I can try to implement this TargetProcess/tauCharts#68, but I thought you might have ideas, so I didn't want to head down the wrong path. cc @happyshows

@bob-rietveld
Copy link

Hi, thanks for making this great widget, super useful. I have been making some nice charts and wanted to share / export them. Would it be possible to add a save to png function? I found a tauchart implementation here http://blog.taucharts.com/svg-to-png/.

Cheers,

Bob

@timelyportfolio
Copy link
Collaborator Author

@good-marketing svg styles make exporting any svg based chart really tricky. For now, see if http://www.buildingwidgets.com/blog/2015/4/9/week-14-exporting-widget might help. Let me know. I haven't tried it yet with taucharts. Well, actually I just tried it with no luck. I'll try to debug and let you know.

@hrbrmstr
Copy link
Owner

hrbrmstr commented Sep 4, 2015

I still like the phantomjs approach - ramnathv/htmlwidgets#95 and have used widgetThumbnail (https://github.com/hafen/trelliscope/blob/master/R/thumb.R) on more than one occasion (more for streamgraph than this pkg tho). I realize phantomjs is a heavy dependency and would not easily get widgets on CRAN. however, there's nothing stopping folks from using that function w/o it being embedded in a pkg (it works with any widget AFAICanTell).

@happyshows
Copy link

@timelyportfolio just want to follow up with you, any luck so far with the click hanlding update? Or let's just wait till Joe Cheng release the new mechanism via Shiny?

@timelyportfolio
Copy link
Collaborator Author

@happyshows have not had a chance yet, but I do intend to address in the next 3 weeks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants