fixed passing JS func from proxy
This commit is contained in:
parent
3e85bd477a
commit
9efca10228
|
@ -1,5 +1,5 @@
|
|||
Package: apexcharter
|
||||
Version: 0.1.8.910
|
||||
Version: 0.1.8.9100
|
||||
Title: Create Interactive Chart with the JavaScript 'ApexCharts' Library
|
||||
Description: Provides an 'htmlwidgets' interface to 'apexcharts.js'.
|
||||
'Apexcharts' is a modern JavaScript charting library to build interactive charts and visualizations with simple API.
|
||||
|
|
|
@ -86,6 +86,7 @@ importFrom(htmltools,resolveDependencies)
|
|||
importFrom(htmltools,tagList)
|
||||
importFrom(htmltools,tags)
|
||||
importFrom(htmlwidgets,JS)
|
||||
importFrom(htmlwidgets,JSEvals)
|
||||
importFrom(htmlwidgets,createWidget)
|
||||
importFrom(htmlwidgets,getDependency)
|
||||
importFrom(htmlwidgets,shinyRenderWidget)
|
||||
|
|
|
@ -153,6 +153,8 @@ ax_proxy_series <- function(proxy, newSeries, animate = TRUE) {
|
|||
#'
|
||||
#' @export
|
||||
#'
|
||||
#' @importFrom htmlwidgets JSEvals
|
||||
#'
|
||||
#' @examples
|
||||
#'
|
||||
#' if (interactive()) {
|
||||
|
@ -211,7 +213,7 @@ ax_proxy_options <- function(proxy, options) {
|
|||
.ax_proxy2(
|
||||
proxy = proxy,
|
||||
name = "options",
|
||||
l = list(options = options)
|
||||
l = list(options = options, evals = JSEvals(options))
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
@ -332,7 +332,13 @@ if (HTMLWidgets.shinyMode) {
|
|||
Shiny.addCustomMessageHandler("update-apexchart-options", function(obj) {
|
||||
var chart = apexcharter.getWidget(obj.id);
|
||||
if (typeof chart != "undefined") {
|
||||
chart.updateOptions(obj.data.options);
|
||||
var options = obj.data.options;
|
||||
var evals = obj.data.evals;
|
||||
if (!(evals instanceof Array)) evals = [evals];
|
||||
for (var k = 0; evals && k < evals.length; k++) {
|
||||
window.HTMLWidgets.evaluateStringMember(options, evals[k]);
|
||||
}
|
||||
chart.updateOptions(options);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue