GithubHelp home page GithubHelp logo

combinewidgets's People

Contributors

francoisguillem avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

combinewidgets's Issues

combineWidgets with a list of 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 arguments

When 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!!

Responsive Behavior

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.