-
Notifications
You must be signed in to change notification settings - Fork 22
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
Using crosstalk with scatterD3 in a standalone R Markdown HTML Report #95
Comments
Unfortunately no, In fact there doesn't seem to be many crosstalk-compatible html widgets if this page is accurate : |
Could it be an option to modify the code so that the Javascript part could be used inside an R Markdown HTML document? |
What "JavaScript part" are you talking about exactly ? |
I saw this example: https://stackoverflow.com/questions/56361986/zoom-function-in-rmarkdown-html-plot |
You are still talking about crosstalk compatibility ? Because single scatterD3 plots should work fine in HTML document, if I remember correctly. |
My reporting involves a pipeline where many outputs are generated in a for loop. I managed to include scatterD3 in the loop in the following way: print(htmltools::tagList(scatterD3::scatterD3(...))). Recently I came across Quarto, which supports Observable and this could make it fairly easy to go with JS for the front end. Link: https://quarto.org/ |
Is it possible to use crosstalk with scatterD3 in a standalone R Markdown HTML Report?
Running the following code works fine as expected:
library(scatterD3)
scatterD3::scatterD3(data=iris,
x=Sepal.Width,
y=Sepal.Length,
col_var=Species)
Trying to use this example in an R Markdown HTML Report like this:
library(crosstalk)
library(scatterD3)
library(d3scatter)
df <- iris
df$helper_select_all <- T
shared_data <- SharedData$new(df)
crosstalk::filter_select("flower", "Select a flower", shared_data, ~Species, multiple = FALSE)
d3scatter::d3scatter(data=shared_data, x=~Sepal.Width, y=~Sepal.Length, color=~Species)
scatterD3::scatterD3(data=shared_data, x=~Sepal.Width, y=~Sepal.Length, col_var=~Species)
throws this error:
Error in data[, deparse(substitute(x))]: object of type 'environment' is not subsettable
The d3scatter code however works fine.
The text was updated successfully, but these errors were encountered: