I get an error when running this code:
library(dash)
app <- Dash$new()
app$layout(
htmlDiv(
list(
dccGraph("graph"),
dccSlider(
id = "slider",
min = 500, max = 700, step = 50, value = 600,
marks = list(500, 600, 700)
)
)
)
)
Error:
Error in htmlDiv(list(dccGraph("graph"), dccSlider(id = "slider", min = 500, :
could not find function "htmlDiv"
Now I see that htmlDiv is part of dashCoreComponents, but according to https://github.com/plotly/dash-core-components "As of Dash 2, the development of dash-core-components has been moved to the main Dash repo. This package exists for backward compatibility"
So I should not need to load library(dashCoreComponents)
right? But even if I try, I would not be able to, because it is part of the library(dash)
if I understand correctly. So it can't be because of this right?
Interesting problem, exacerbated by the fact that dash
was removed from CRAN last year, and perhaps further confused by the presence of a since-dropped dashR
package. Your code seems legit from that perspective. However, looking at cran/dash/R/dashHtmlComponents.R
and its NAMESPACE
, it is defined but not exported. This seems like a bug-report, though it's not hard to get the idea that the concept of Dash for R is encouraged but not well supported.
The app
can be made to work by :::
-calling it.
library(dash)
app <- Dash$new()
app$layout(
dash:::htmlDiv(
list(
dccGraph("graph"),
dccSlider(
id = "slider",
min = 500, max = 700, step = 50, value = 600,
marks = list(500, 600, 700)
)
)
)
)
# Warning in fn_summary$obj : partial match of 'obj' to 'objs'
# Warning in fn_summary$obj : partial match of 'obj' to 'objs'
# Warning in fn_summary$obj : partial match of 'obj' to 'objs'
# Warning in fn_summary$obj : partial match of 'obj' to 'objs'
# Warning in fn_summary$obj : partial match of 'obj' to 'objs'
# Warning in fn_summary$obj : partial match of 'obj' to 'objs'
# Warning in fn_summary$obj : partial match of 'obj' to 'objs'
# Warning in fn_summary$obj : partial match of 'obj' to 'objs'
app
(This is not a sustainable solution, however, it would be better to fix the package itself.)