skranz / shinyevents Goto Github PK
View Code? Open in Web Editor NEWUse shiny with event handlers instead of reactivity
Use shiny with event handlers instead of reactivity
Hi,
I found that addEventHandlerToApp()
may take a noticeable time if executed in a loop and process already existing ids.
My usecase is dynamic creation of 10 buttons. When you press any of them it shall print out the word assigned to button. Then I must recreate all 10 buttons with new random words.
I found that although initial creation of 10 buttons is performed quite fast their recreation takes much more time. And the bottleneck is in addEventHandlerToApp()
. Both if.handler.exists == "add"
and `if.handler.exists == "replace" behave this way.
What would be great to have is a way to replace s_args
of already existing event handler without reevaluation of its code. This could be done with a new if.handler.exists
value or with a new method which allows to get environment associated with handler with specified id (if any of these are technically possible - I was able to detect if handler for id already exists but couldn't reach its environment)
Currently I bypassed this problem by passing a link to the global environment and index of a word in a global list in a callback function.
Hi,
I wonder if it could be used for client\server apps. I mean ui.R\server.R approach. Currently all samples are in one R file and seems to share environment. I've tried to do something like:
ui.R
-----
library(shinyEvents)
app = eventsApp()
app$verbose = T
app$ui = fluidPage(
titlePanel("Word completion test app"),
fluidRow(actionButton("dynBtn0", "starts[i]"))
)
server.R
-----
shinyServer(function(input, output, session) {
buttonHandler("dynBtn0", function(session, value, ...) {warning("df");})
})
And run it with RStudio's run button.
buttonHandler is invoked but when you press a button - nothing happens.
I suspect this is because getApp()$session.env
is NULL in addEventHandlerToApp()
Could shinyEvents be used in that way? If so, could you give a short sample?
Hi,
I am interested in making my ggplot2 interactive and was wondering if we could leverage your package to add event listeners to a particular layer within a ggplot2.
For example, I want to add an event listener to the geoim_point layer in the example below
ggplot() +
geom_point(mapping = aes(y = hwy, x = cty), data = mpg) +
geom_smooth(data = mpg, mapping = aes(cty, hwy))
Regards
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.