Comments (3)
This is because bscols()
does not return an object of class htmlwidget
so it is not seen as an object to add caption too (like #118 fixed).
@yihui How could we handle that ? Should we look maybe into the object when attr(x, "browsable_html") == TRUE
?
Or rather this should be crosstalk that should add a class to the object returned by bscols()
so that it is identified as a crosstalk object we can then handle ?
from bookdown.
Should we look maybe into the object when
attr(x, "browsable_html") == TRUE
?
We could do that.
from bookdown.
Based on your feedback, I've found a workaround. Ugly but effective.
---
title: "A Minimal Book Example"
author: "John Doe"
date: "`r Sys.Date()`"
site: bookdown::bookdown_site
output:
bookdown::gitbook: default
---
```{r crosstalk, fig.cap = "Workaround caption"}
library(crosstalk)
library(plotly)
shared_mtcars <- SharedData$new(mtcars)
x <- bscols(widths = 12,
filter_slider("hp", "Horsepower", shared_mtcars, ~hp, width = "100%"),
plot_ly(shared_mtcars, x = ~wt, y = ~mpg, color = ~factor(cyl)) |>
add_markers()
)
class(x) <- c(class(x), "htmlwidget")
x
```
from bookdown.
Related Issues (20)
- CSS for gitbook output: YAML, length of <embed> elements and indentation of references HOT 5
- [FR] Pandoc 2.19+ allows to opt-out mathml in epub3 format and choose other math method too
- Text references don't work with multiline lines HOT 7
- Search in bs4_book often missing results HOT 6
- [FR] Two-column layout for .docx files HOT 1
- [FR] More flexible table of contents in tufte_html_book HOT 4
- How could I add a link for the "Edit" icon to private Bitbucket repo? HOT 11
- .unlisted and .unnumbered not excluding tagged headers from TOC HOT 5
- [FR] Add support for the YALM setting "language: ui: references_name" to change the title of references section in html output HOT 7
- Image embeded in flextable lost in .docx output HOT 3
- [FR] Typst Support HOT 3
- Equation in book is broken HOT 3
- [FR] Allow to use `$$` for numbering equation in **bookdown**
- R4.3 error if multiple files are passed to `render_book` without an `output_format` specified HOT 2
- html output error with echo=FALSE option HOT 1
- [FR] Multi language support
- Square brackets around citations in text HOT 2
- Cannot generate pdf via "server" but only html despite I tried probably all suggestions. HOT 4
- Use of 'tab.scap.' for tables? (Non kable() users!) HOT 2
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 bookdown.