Shiny and bubbles library


#1

I created the plot using library(bubbles) in shiny application. each plot shows one particular component. If I need to capture the component name at user click how can I achieve this?


#2

ui.r
fluidRow(
box(
width = 8, status = “info”, solidHeader = TRUE,
title = “Comp”,
bubblesOutput(“Plot”, width = “100%”, height = 600)
),
box(
tags$script(‘document.getElementById(“Plot”).onclick = function() {
var number = Math.random();
Shiny.onInputChange(“mydata”, number);
};
’)
)
)

server.r
function(input, output, session) {

wclick <- reactive({
x <- input$mydata
print(x)
})

output$Plot <- renderBubbles({

df <- datadf[,c("Comp","Point")]
df$Point<-as.numeric(df$Point)
bubbles(value=df$Point, label=df$Comp, key = df$Comp,color = rainbow(length(count), alpha=NULL))

})
}

need to capture the user click input and perform some action


#3

the above javascript code is not working…