rstudio / crosstalk

Inter-htmlwidget communication for R (with and without Shiny)
http://rstudio.github.io/crosstalk
Other
286 stars 56 forks source link

How do I handle layout when I do not want to use bscols? #24

Open pssguy opened 7 years ago

pssguy commented 7 years ago
library(crosstalk)
library(d3scatter)
shared_mtcars <- SharedData$new(mtcars)

bscols(
            filter_select("auto", "Automatic", shared_mtcars, ~ifelse(am == 0, "Yes", "No")),
           d3scatter(shared_mtcars, ~wt, ~mpg, ~factor(cyl), width="100%", height=250)
)   

crosstalkissue_2

If I remove bscols() only the plot gets shown. There does not appear to be a bsrows equivalent. If i try list, the filter appears momentarily but is then replaced by plot

pssguy commented 7 years ago

I guess bscols(width=12,....)

is an answer

shapenaji commented 7 years ago

I use flexbox, so wrap the whole thing in tags$div(class = 'flexbox', ...) and then control it via css with something like this: (you do need to load library(shiny) for the tags object though)

there are also many more settings for flexbox

.flexbox {
  display: flex;
  justify-content: space-around;
  flex-direction: row;
  flex-wrap: wrap;
}
pssguy commented 7 years ago

@shapenaji Thanks for suggestion