I'm trying to put a Graph in a Shiny project I'm working on. I found that the most convenient way to do so is to use the Javascript API and the shinyjs package.
The Javascript API for Tableau is explained in detail here and my script looks like this. According to the instructions it is correct, and according to shinyjs the function name has to be preceded by "shinyjs."
function shinyjs.init() {
var containerDiv document.getElementById("vizContainer"),
url = "https://public.tableau.com/profile/daniel.cuartas#!/vizhome/Indicadores_25/Pregunta";
var viz new tableau.Viz(containerDiv, url);
}
And the chunk of code included in my Shiny ui.R is this
ui = fluidPage(
includeScript("https://public.tableau.com/javascripts/api/tableau-2.js"),
useShinyjs(),
extendShinyjs(script = "C:/Users/Antonia/Downloads/SaberDigital/init.js"),
tags$div(id = 'vizContainer'),
js$init()
)
I get back the next error:
Error : shinyjs: Error parsing the JavaScript file: SyntaxError: Unexpected identifier.
What is it I am doing wrong?