Comments (3)
Hello,
Can you explain why do you want to do this? Using a manipulateWidget inside a shiny app is not documented for now, but you can find some examples here: https://github.com/rte-antares-rpackage/manipulateWidget/tree/master/inst/examples .
With manipulateWidget, you can add modules to a shiny application. The modules can use reactive values from the application but they are not intended to modify other elements of the application.
from manipulatewidget.
Thanks for the quick reply @FrancoisGuillem! Maybe I don't understand the aim of manipulateWidget well enough, but I thought it returned already rendered objects and let you modify them. The reason why I asked the question was that in a Shiny app you can create a leaflet map using leaflet()
and you can further add to that using leafletProxy()
which pushes changes to the rendered map. Unfortunately, you cannot get the map object back in order to save it. I've posed this as a question on StackOverflow after finding that many other R users are trying to figure out a solution to this problem because the typical ways of saving a leaflet map don't work with a proxy object. It needs to be an object of class leaflet, htmlwidget
. I thought this package might return the actual object in some way.
Right now there are two workaround solutions to this problem:
- Build and render the map object, then keep a second object in a parallel with the same updates to the rendered map, then download the second object when needed.
- On click, grab all the rendered HTML from the map element and throw into an HTML file.
Neither solution seems to be ideal, so thought it would be worth posing the question more broadly, but this probably isn't the right place. I'll close this issue now.
from manipulatewidget.
I don't know if it can helps, but with manipulateWidget you can generate a leaflet map, update it and save it into an html file:
Here is the code to generate it:
myMapFun <- function(radius, color, initial, session, output) {
if (initial) {
# Widget has not been rendered
map <- leaflet() %>% addTiles()
} else {
# widget has already been rendered
map <- leafletProxy(output, session) %>% clearMarkers()
}
map %>% addCircleMarkers(lon, lat, radius = radius, color = color)
}
manipulateWidget(myMapFun(radius, color, .initial, .session, .output),
radius = mwSlider(5, 30, 10),
color = mwSelect(c("red", "blue", "green")))
This looks more or less like your first solution: when the user clicks the save button, a new htmlWidget object is created using the current values of the inputs.
from manipulatewidget.
Related Issues (20)
- Add the possibility to modify the output of manipulateWidget HOT 1
- Compare group of inputs
- return a shiny module instead of running a shiny gadget
- Sharding input
- Issue controlling the ncharts, nrow and ncol options of the compareOptions function via shiny input HOT 3
- Bad interaction with `crosstalk` HOT 1
- Manipulating combineWidgets objects HOT 3
- combineWidgets loses class of widgets HOT 1
- combineWidgets from formattable and plotly HOT 2
- Error in dyn.load(file, DLLpath = DLLpath, ...)
- Combine HTML Widgets with DataTables HOT 2
- Issue controlling argument in mwSelectize function via other input HOT 2
- Deploy manipulateWidget using R Plumber
- Pourquoi passer en valeur d'un input une expression ? HOT 5
- Not working for {gt} tables HOT 1
- Specify individual widget height - combineWidgets
- Input to asJSON warning message when using `combineWidgets`
- Example code does not work
- Possible te make combineWidgets mobile friendly?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from manipulatewidget.