aoles / shinyurl Goto Github PK
View Code? Open in Web Editor NEW:link: Save and restore the state of Shiny app's widgets by encoding them in an URL query string
:link: Save and restore the state of Shiny app's widgets by encoding them in an URL query string
Firstly:
While supressing input renderDtOutput_rows_current
using .
: .renderDtOutput_rows_current
package DataTables
(R package DT
) returns error.
Secondly:
shinyURL
catches every input - including currently rendered rows, e.g.:
renderDtOutput_rows_current=1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25
so you can imagine what happens when you render 1000 rows...
Can you add argument to omit specific inputs?
Hi,
Great work on the package, it is really useful.
I have an app which is using shiny modules to generate a load of selectizeInput elements. The normal UI elements are captured and restored by the URL no problem, but the inputs which are modules do not seem to be. I don't know if this is possible for the future?
Hi,
I have a Shiny app with selectInput(multiple = TRUE). When I get the URL, I can see the multiple values for the select input in the URL. But, when I paste the URL into browser again, the restore won't happen. Everything gets reset to the original values.
I am rendering selectInput inside renderUI function. Is that the reason why the state is not restored? Every time the selectInput will be reloaded? The choices for selectInput are dynamic and based on the other input . So, its important that I put it in renderUI(). Can you please help me out here?
On the other hand, I have selectInput without multiple attribute and this is also rendered using renderUI function. The restore works perfectly fine with any value being selected in the select input.
Thanks.
Any clue why shinyURL fails to load in a server environment?
The library loads and the functionality works nicely in my RStudio development environment.
When I deploy to a remote server running shiny, I get the "load failed" error. Log files literally disappear on error, suggesting a crash.
Interactive R on the remote server loads shinyURL just fine.
Hi Aoles,
Thanks for this great package, exactly what I was looking for!
I do seem to have an issue however. If my UI has selectizeInput fields which allow multiple sections (multiple=T), but only one value in the field, then the URL generated by ShinyURL doesn't fully restore the session. I think it's because that for list fields, they require the array reference, even if only one member.
So for example, here is my field definition:
selectizeInput("filter_choices", "Active Filters", filterChoiceList,
options=list(placeholder="Choose fields to filter on"),
multiple = T)
Here is the URL generated if I only have one value in "filter_choices" ...
This doesn't work. However, if I manually edit it to include "[1]" for the list fields with only one value ...
This works perfectly and restores the Shiny session.
Note, that if there are multiple choices in these list fields everything works perfectly, the issue is limited to when there is only one value in a multiple selection list field.
In summary, I think perhaps the generated URL needs the "[1]" when only one value is specified for multiple=T selectInput fields.
Thanks!
Just thought that it might be worth mentioning in the README or elsewhere that some of the functionality of this add-on is available in shiny core, using enableBookmarking = "url" (since version 0.14, released sept 2016)
I have no doubt that this plugin served to inspire :)
Andrzej,
This is not an issue, this is a thank you. I was expecting it to talk all afternoon to get something functional for passing URLs around but with shinyURL it took 15 minutes. Many thanks for sharing a nice tool!
Edward
Hi,
Here is the error:
Warning: Unhandled error in observer: invalid argument type
observe({
inputValues = reactiveValuesToList(session$input, all.names = FALSE)
inputValues = inputValues[!unlist(lapply(inputValues, function(x) inherits(x,
"shinyActionButtonValue")), use.names = FALSE)]
idx = grep("_mouse_(over|out)$", names(inputValues))
if (length(idx) > 0)
inputValues = inputValues[-idx]
names = sort(names(inputValues))
addValues = NULL
i = 1L
while (i <= length(names)) {
n = names[i]
idx = grep(sprintf("^%s[0-9]+", n), names)
if (length(idx) == 0L) {
i = i + 1L
}
else {
value = inputValues[[n]]
names = names[-c(i, idx)]
if (is.null(value))
value = ""
values = as.list(value)
names(values) = sprintf("%s[%s]", n, seq_along(value))
addValues = c(values, addValues)
}
}
inputValues = inputValues[names]
inputValu [... truncated]
ERROR: [on_request_read] connection reset by peer
I am using Rmardkown
Thank you for this nice shiny package. It would be more insteresting to add an option to generate a URL QR code of current status of shiny app.
hi,
the broswers history.replaceState method updates the URL visible in the adressbar of the browser. I think it would be great to simply update the adressbar of the browser, instead of showing an extra UI element with the URL.
My web server developed by shiny. However I found that there are the same url when I choose the different navbar/tabpanel in my web server. Can someone help me please? It's difficult for me to solve this problem. I just need every different url when I choose different panel in my server. Thank you very much!
Hi there,
It appears to be impossible to install this package from a windows workstation.
devtools installed.
R 3.4.3
The resulting message after trying to load and install sources from github is "Installation failed : Timeout was reached: connection timed out after 10015 milliseconds"
As far as I can remember I had strictly no problem during my last installation using an Ubuntu distro.
Any help would be greatly appreciated,
Olivier
I would like to hear if there is any possibility to remove system generated parameters from the URL. I'm getting quite few ss-net-opt-* values which make it hard to read the required URL. I know from the documentation that by putting . in front of the variable it will not be included. In my case I have no idea where the ss-net-opt-* parameters are coming from which makes it hard to exclude them.
Any suggestions are appreciated.
Regards, Sigurgeir
when going to a table the url gets populated with all the contents of the table, is there a way to make the js ignore predetermined objects? or can this bug only be fixed globally?
when running a bigger app with lots of objects the url gets too long
library(shinyURL)
library(DT)
shinyApp(
ui = fluidPage(
titlePanel("Mtcars Data"),
sidebarLayout(
sidebarPanel(
shinyURL.ui(ZeroClipboard.swf = "//cdn.jsdelivr.net/zeroclipboard/2.2.0/ZeroClipboard.swf")
),
mainPanel(
tabsetPanel(id = "tab",
tabPanel("table", DT::dataTableOutput('table'))
)
)
)
),
server = function(input, output) {
shinyURL.server()
output$table=DT::renderDataTable(mtcars,
extensions = c('Buttons',
'Scroller',
'ColReorder',
'FixedColumns'),
filter='top',
options = list( deferRender = TRUE,
dom='t',
scrollX = TRUE,
pageLength = 50,
scrollY = 500,
scroller = TRUE,
dom = 'Bfrtip',
colReorder=TRUE,
fixedColumns = TRUE,
buttons = c('copy', 'csv', 'excel', 'pdf', 'print','colvis')
))
}
)
Just tried this out for first time on one of my apps and works fine but have few comments
I suppose it would sometimes be useful to view the full URL, but only as an option (perhaps with default=TRUE)
The circumstances I would want to use this would include on twitter so a button which opens
a tweet with the tinyurl shown would be an interesting enhancement
Another circumstance I can envisage is that a user would always want to go to some defaults of that app. So a swift way of bookmarking would also be useful
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.