francoisguillem / combinewidgets Goto Github PK
View Code? Open in Web Editor NEWAn R packages to combine htmlwidgets
An R packages to combine htmlwidgets
This is more of a discussion than an issue, so feel free to close whenever.
I think a common use case with combineWidgets
will involve a list of htmlwidgets as the ...
argument.
For instance, here is a made-up example for reproducibility.
library(combineWidgets)
library(sparkline)
combineWidgets(
lapply(1:10, function(x){sparkline(runif(50,0,10))})
)
which of course gives us an error since the generally useful pattern list(...)
is used to get the ellipsis.
I don't think there is an easy solution for dealing with this in combineWidgets
without some troublesome assumptions. For those that run into this issue and are not as familiar with R programming, here are some ways to deal with the "problem".
do.call
do.call
is our friend here, so we can do this.
do.call(
combineWidgets,
lapply(1:10, function(x){sparkline(runif(50,0,10))})
)
do.call
with argumentsWhen we want to provide other arguments, the solution is a little trickier but not insurmountable.
do.call(
combineWidgets,
# note wrap the arguments with c() and not list()
c(
lapply(1:10, function(x){sparkline(runif(50,0,10))}),
nrow = 2,
ncol = 5
)
)
Thanks for this really useful widget of widgets!!
Hi @cuche27 !
Great package!
I think it's better place to keep the discussion here.
About the question in ramnathv/htmlwidgets/pull/245. Yes, I'm referencing to change automatically the layout if the screen size change.
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.