Questions tagged [htmlwidgets]

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.

422 questions
4
votes
0 answers

rpivotTable & Shiny: change column sizes & colors

Using rpivotTable in a Shiny app. It works wonderfully; however, I would like to customize the column widths & background colors/theme within the table itself. Seems it might be possible via CSS, but I presently have no idea where to start. Here's…
4
votes
1 answer

Shiny or just htmlwidgets

I have to use htmlwidgets related packages(plotly and dygraphs) to generate plots which I can then either: 1. save as .html file and link them through an iframe. 2. use in a shiny app. I would prefer creating my own UI instead of using Shiny,…
brijs
  • 525
  • 6
  • 18
4
votes
1 answer

How do I add spacing between dygraphs generated in apply loop in Rmarkdown?

This question is related to For loop over dygraph does not work in R This answer by @Yihui nicely details how to create dygraphs plots in a loop in rmarkdown. But, as you will notice, there is no spacing between the plots. This becomes quite…
danh
  • 618
  • 3
  • 7
4
votes
2 answers

How to color groups in networkD3's sankeyNetwork?

My nodes consists of names and groups yet I can't seem to implement distinct colors for groups in my sankey diagram. The colors are either all blue with defaults or all black using the code below. Here's the code I use: sankeyNetwork( Links…
JnrfL
  • 189
  • 2
  • 8
4
votes
2 answers

Generate formattable widgets in a loop in an R markdown document

I want to put HTML widgets like formattable (from formattable package) in an HTML page generated through RMarkdown. I need the widgets to be generated from within a for loop. How can i do that? With or without print(), both don't work. This is an…
rdatasculptor
  • 8,112
  • 14
  • 56
  • 81
4
votes
1 answer

d3heatmap() after leaflet() in R Markdown causes addLegend() to disappear

I am working on an R Markdown document (*.Rmd) in RStudio with HTML widgets. I have a map created by functions in the leaflet package, including a legend created by the addLegend() function. This is then followed by a heatmap created by the…
Jean V. Adams
  • 4,634
  • 2
  • 29
  • 46
4
votes
4 answers

Sankey Diagram with networkD3 package will not plot

I am using the sankeyNetwork function in the networkD3 package in R using as an example the code found here. However, all I get is a blank screen. The diagram is supposed to show the flow of infections between age groups (by gender). My code is as…
Tumaini Kilimba
  • 195
  • 2
  • 15
3
votes
0 answers

Preserve custom node placement of a sankeyNetwork (networkD3) in R

I wish to customise the horizontal and vertical position of nodes in a sankeyNetwork (networkD3) in R, and export the network as a high-resolution image. I credit and use the reproducible example of CJ Yetman (enable horizontal movement of nodes in…
Cai Ladd
  • 59
  • 8
3
votes
1 answer

Combine different grViz into a single plot

I would like to combine different DiagrammeR plots into a single figure. The plots are generated as the following example: library(DiagrammeR) pDia <- grViz(" digraph boxes_and_circles { # a 'graph' statement graph [overlap = true, fontsize =…
user3091668
  • 2,230
  • 6
  • 25
  • 42
3
votes
1 answer

How can I add images in the nodes of a D3 Sankey diagram, using the rcv and networkD3 packages in R?

I am working with ranked-choice voting data in R, and would like to plot it using a Sankey diagram (here is an example). Sankey diagrams default to color-coded nodes for each candidate, but I would like to place an image of each candidate within the…
Count Orlok
  • 997
  • 4
  • 13
3
votes
2 answers

How do you call a javascript method on a htmlwidget (jsoneditor) in shiny?

I'm trying to use jsonedit from the listviewer package in a shiny app and want to display the tree fully expanded by default. There isn't an option to do this in the jsonedit() function, but the underlying javascript object has an .expandAll()…
pseudospin
  • 2,737
  • 1
  • 4
  • 19
3
votes
1 answer

How to insert saved Leaflet widget into Rmarkdown HTML output

I create a Leaflet widget and save it locally: library(htmlwidgets) library(leaflet) library(sf) shp = st_read("/path/to/some/shapefile.shp") m = shp %>% leaflet() %>% addProviderTiles(providers$CartoDB.Positron) %>% setView(lng = -70, lat =…
ardaar
  • 1,164
  • 9
  • 19
3
votes
1 answer

Unable to run a Shiny App using grVizOutput() and renderGrViz()

I have really been enjoying using and creating graphs in DiagrammeR so far. I am able to create them in RStudio. Recently I was preparing a shiny app to include a graph using DiagrammeR (grViz function), I checked on the github and found examples of…
Shank
  • 63
  • 4
3
votes
0 answers

Filter leaflet map which includes clusters using crosstalk

I am working on a dashboard using Flexdashboard and would like to present a map and datatable that filter together using crosstalk. I have been able to do this using standard or circle markers but it doesn't seem to work when using clusters. I found…
BuckyOH
  • 327
  • 2
  • 8
  • 17
3
votes
0 answers

How to highlight() a lineplot after crosstalk filter

I am making an interactive plotly plot with R using highlight() and crosstalk filter_select() functions. However, when the argument "color" of plotly's lines match highlight_key(), it becomes impossible to highlight any light of the filtered data in…