Use the this tag for questions regarding the htmlwidgets for R JavaScript visualization library. For questions regarding generic HTML widgets, use the html and widget tags.
Questions tagged [htmlwidgets]
422 questions
6
votes
1 answer
Open hyperlink on click on an ggplot/plotly chart
This is a follow up question on the answer provided for Add onclick open hyperlink event to an html widget created in R. Consider the following example:
library(ggplot2)
library(plotly)
library(htmlwidgets)
library(htmltools)
myData <- data.frame(
…

lukeA
- 53,097
- 5
- 97
- 100
6
votes
2 answers
Include sparkline htmlwidget in datatable cells in a Shiny app, without resorting to (much) JavaScript
I am using the sparkline package to produce bar charts to place into cells of a datatable in a Shiny app. I've managed to produce the desired output in a standalone datatable, but when I place it into the Shiny app it doesn't work. It may have…

Brian Stamper
- 2,143
- 1
- 18
- 41
6
votes
2 answers
Interaction between html widgets in R shiny
I am developing an R shiny application that uses several html widgets, notably networkD3, d3heatmap and chorddiag.
These widgets work fine separately. However, using them in the same page leave a blank space where they are supposed to be.
Here is a…

Yan Holtz
- 115
- 1
- 7
6
votes
2 answers
saving R leaflet map as html: tiles not included
I am trying to save an R leaflet map, using saveWidget() or outputting an rmd-file to html - as described here: Saving leaflet output as html
When generating an html-file with markdown, the map will show fine in the internal rstudio viewer, however…
user7963169
6
votes
0 answers
opening, reading in html widgets?
I saved some graphs from a script as an html object using:
htmlwidgets::saveWidget(p,"graph.html"))
Is it possible to read this object back into R? I can't find anything in the htmlwidgets documentation:…

LoF10
- 1,907
- 1
- 23
- 64
6
votes
2 answers
How to generate an md file from a rmarkdown file containing an htmlwidget
I am creating an html file with this rmd
---
title: "test"
author: "me"
date: '`r Sys.Date()`'
output: html_document
---
```{r}
data(HairEyeColor)
rpivotTable::rpivotTable(data = HairEyeColor
, rows = "Hair"
,cols="Eye"
…

Eduardo Bergel
- 2,685
- 1
- 16
- 21
6
votes
2 answers
Making htmlwidgets in Rmarkdown mobile friendly
The default options of rmarkdown is to set the fig.width = 12. I would like it to auto-adujust for the width of a mobile device if this is possible.
I'm hosting the following Rmarkdown at http://akdata.org/misc/leafletmobile
---
title:…

cylondude
- 1,816
- 1
- 22
- 55
5
votes
1 answer
how to change background and text color of DT Datable header in R Shiny
I have a datatable that I want to show in R Shiny, but I want the header column that has the column names to be red and the text to be in white. With formatStyles(), I can only specify entire columns instead of just the row of header names. How…

J.Sabree
- 2,280
- 19
- 48
5
votes
1 answer
How to filter rows in both parent and nested tables, using reactable?
How to filter rows with a specific Type, which are either in the parent or in any of the nested tables of a reactable, using crosstalk::filter_checkbox, as shown here ?
dat <- structure(list(Manufacturer = c(
"Acura", "Acura", "Audi", "Audi",
…

gd047
- 29,749
- 18
- 107
- 146
5
votes
1 answer
Create nested subgroup with timevis in R
I want to create a timeline like this one using R's timevis package.
I know how to build a group as they do in the demo:
library(timevis)
dataGroups <- data.frame(
id = 1:11,
content = c(
"Open",
"Open",
"Open",
"Open",
…

Jon Nagra
- 1,538
- 1
- 16
- 36
5
votes
1 answer
R : combine and save rgl widgets as a single html file
In R, using the rgl and htmlwidgets libraries, I'm trying to extract an HTML file having a widget with toggle buttons.
The following example does what I want in the RStudio Viewer. The HTML export works without the toggle buttons, but fails when the…

Olivier Delrieu
- 742
- 6
- 16
5
votes
0 answers
Sankey Particles Visualization
I really like the Particle visualization of Sankey diagram
https://bl.ocks.org/micahstubbs/6a366e759f029599678e293521d7e26c
However, i cant replicate the same in R shiny as i have no knowledge on embedding scripts . Below is code for creating a…

EricA
- 403
- 2
- 14
5
votes
0 answers
crosstalk and plotly - ggplotly does not accept shareddata-object
I've been trying to generate interactive linked visualizations with by use of the plotly and crosstalk libraries. As shown in the example below, it seems to be possible to pass ggplot2 a 'shared Dataframe'-Object in order to generate linked views…

tlo
- 86
- 5
5
votes
1 answer
Retrieving R object attributes in JavaScript
I have a bivariate dataset with 100 observations. I used hexagon binning and ended up with 26 hexagon bins. In order to save the rows of the 100 observations that are in each of the 26 hexagon bins, I used the base::attr function in R. In the code…
user2808302
5
votes
1 answer
Rmarkdown overlapping output
I reported an issue https://github.com/rstudio/rmarkdown/issues/967 and am wondering is there a workaround (how to make this work) for this?
Reproducible example below (vary n and nGroup to see the effect - no overlap when n = 100 and…

Samo
- 2,065
- 20
- 41