Переглянути джерело

Add updateFrappeChart()

master
Garrick Aden-Buie 6 роки тому
джерело
коміт
4706d89183
6 змінених файлів з 27 додано та 6 видалено
  1. +1
    -0
      NAMESPACE
  2. +8
    -2
      R/frappeChart.R
  3. +2
    -0
      dev/dev.Rmd
  4. +1
    -1
      dev/shiny/app.R
  5. +3
    -0
      man/frappeChart-shiny.Rd
  6. +12
    -3
      man/frappeChart.Rd

+ 1
- 0
NAMESPACE Переглянути файл

export(frappeChart) export(frappeChart)
export(frappeChartOutput) export(frappeChartOutput)
export(renderFrappeChart) export(renderFrappeChart)
export(updateFrappeChart)
import(htmlwidgets) import(htmlwidgets)

+ 8
- 2
R/frappeChart.R Переглянути файл

#' <Add Title>
#' Create a Frappe Chart
#' #'
#' <Add Description>
#' Creates a Frappe Chart
#' #'
#' @import htmlwidgets #' @import htmlwidgets
#' #'
if (!quoted) { expr <- substitute(expr) } # force quoted if (!quoted) { expr <- substitute(expr) } # force quoted
htmlwidgets::shinyRenderWidget(expr, frappeChartOutput, env, quoted = TRUE) htmlwidgets::shinyRenderWidget(expr, frappeChartOutput, env, quoted = TRUE)
} }

#' @rdname frappeChart-shiny
#' @export
updateFrappeChart <- function(inputId, data, session = shiny::getDefaultReactiveDomain()) {
session$sendCustomMessage("frappeCharts:update", list(id = inputId, data = data))
}

+ 2
- 0
dev/dev.Rmd Переглянути файл

Demo the app, now updates are fast! Demo the app, now updates are fast!


1. Write a user-friendly wrapper around `sendCustomMessage` called `updateFrappeChart()`


+ 1
- 1
dev/shiny/app.R Переглянути файл

}) })


observe({ observe({
session$sendCustomMessage("frappeCharts:update", list(id = "chart", data = data()))
updateFrappeChart("chart", data())
}) })
} }



+ 3
- 0
man/frappeChart-shiny.Rd Переглянути файл

\alias{frappeChart-shiny} \alias{frappeChart-shiny}
\alias{frappeChartOutput} \alias{frappeChartOutput}
\alias{renderFrappeChart} \alias{renderFrappeChart}
\alias{updateFrappeChart}
\title{Shiny bindings for frappeChart} \title{Shiny bindings for frappeChart}
\usage{ \usage{
frappeChartOutput(outputId, width = "100\%", height = "400px") frappeChartOutput(outputId, width = "100\%", height = "400px")


renderFrappeChart(expr, env = parent.frame(), quoted = FALSE) renderFrappeChart(expr, env = parent.frame(), quoted = FALSE)

updateFrappeChart(inputId, data, session = shiny::getDefaultReactiveDomain())
} }
\arguments{ \arguments{
\item{outputId}{output variable to read from} \item{outputId}{output variable to read from}

+ 12
- 3
man/frappeChart.Rd Переглянути файл

% Please edit documentation in R/frappeChart.R % Please edit documentation in R/frappeChart.R
\name{frappeChart} \name{frappeChart}
\alias{frappeChart} \alias{frappeChart}
\title{<Add Title>}
\title{Create a Frappe Chart}
\usage{ \usage{
frappeChart(message, width = NULL, height = NULL, elementId = NULL)
frappeChart(
data,
type = c("line", "bar", "pie", "percentage", "heatmap"),
title = "",
...,
is_navigable = TRUE,
width = NULL,
height = 250,
elementId = NULL
)
} }
\description{ \description{
<Add Description>
Creates a Frappe Chart
} }

Завантаження…
Відмінити
Зберегти