Show and Tell - Dash Pivottable

@Titus1 No worries! Here’s the original announcement:

The current version released to CRAN is v0.5.0, but we’ll soon submit v0.8.0 to CRAN with support for pattern matching callbacks and improvements to the callback graph after it’s released to GitHub (within a few weeks).

As for using dashPivotTable in R, there’s a nice example here – and both examples are available within R using help(dashPivotTable):

If case you want to import your own data.frame into dashPivotTable, you can use the df_to_list helper function from dashTable, e.g.

  library(dash)
  library(dashHtmlComponents)
  library(dashPivottable)
  library(dashTable)

  app <- Dash$new()
  app$title("Summary statistics for iris data")

  app$layout(
    htmlDiv(
      list(
        dashPivotTable(
          id = "table",
          data = df_to_list(Loblolly),
          cols = list("Seed"),
          colOrder = "key_a_to_z",
          rows = list("age"),
          rowOrder = "key_a_to_z",
          rendererName = "Grouped Column Chart",
          aggregatorName = "Average",
          vals = list("height")
        ),
        htmlDiv(
          id = "output"
        )
      )
    )
  )

  app$callback(output = output(id="output", property="children"),
              params = list(input(id="table", property="cols"),
                            input(id="table", property="rows"),
                            input(id="table", property="rowOrder"),
                            input(id="table", property="colOrder"),
                            input(id="table", property="aggregatorName"),
                            input(id="table", property="rendererName")),
              function(cols, rows, row_order, col_order, aggregator, renderer) {
                return(
                  list(
                    htmlP(cols, id="columns"),
                    htmlP(rows, id="rows"),
                    htmlP(row_order, id="row_order"),
                    htmlP(col_order, id="col_order"),
                    htmlP(aggregator, id="aggregator"),
                    htmlP(renderer, id="renderer")
                  )
                )
              }
  )

  app$run_server(debug=TRUE)