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
3
votes
1 answer

Shiny reactive value directly in onRender() function of htmlWidgets

I have a Shiny application that has two plots. If a user clicks on a point in the top plot, the x and y coordinate of that point are saved to a reactive Shiny variable (in the code below, it is called pointSel). In the bottom plot, I would like the…
user2808302
3
votes
1 answer

How to use htmltools::tagList such that headers show in RMarkdown table of contents

I need to generate multiple htmlwidgets within a loop in an RMarkdown document. This is accomplished using htmltools::tagList. The following snippet will generate HTML output with 2 level 2 headings and a datatable in each section. The only problem…
Matt Pollock
  • 1,063
  • 10
  • 26
3
votes
0 answers

Problems with simultaneous use Sankey and d3tree htmlwidgets on R Notebook?

I use R notebook for data analysis report. I want to render Sankey and d3tree htmlwidgets on R notebook simultaneously. I put snakey and then d3tree example code in r chunk, output is well printed on rstudio. When I entered preview button,…
Rokmc1050
  • 463
  • 1
  • 6
  • 16
3
votes
1 answer

R networkD3 color node stroke for radialNetwork()

The networkd3 package contains some very nice functions for creating the obvious networks. Different functions have different arguments, so this questions is specifically in regards to the radialNetwork() function. Is it possible to have the color…
New_code
  • 594
  • 1
  • 5
  • 16
3
votes
1 answer

Retrieving R object attributes in JavaScript - Part 2

I posted a similar question earlier (Retrieving R object attributes in JavaScript). In that earlier post, I oversimplified my MWE, and so the answer I rewarded unfortunately does not really apply to my real problem. Here, I am showing why I may need…
user2808302
3
votes
1 answer

Dynamically loop through htmlwidgets and add knitr formatting for RMarkdown

I am trying to dynamically create and loop through htmlwidgets such as DT, plotly, or rbokeh to generate an automated knitr report. Is there a way to add knitr formatting, such as the tabset, into the tagList approach outlined in this github…
vryb
  • 165
  • 1
  • 7
3
votes
1 answer

htmlwidgets side by side in html?

Say I have two htmlwidgets # Load energy projection data # Load energy projection data library(networkD3) URL <- paste0( "https://cdn.rawgit.com/christophergandrud/networkD3/", "master/JSONdata/energy.json") Energy <-…
Scott
  • 642
  • 7
  • 16
3
votes
0 answers

htmlwidget not receiving height from container element

In my package dndTree I use htmlwidgets to render drag-and-drop diagonal trees as implemented here. I changed the original code to be one big function makeTree(treeData,el) where treeData is JSON (created from jsonlite) and el is the element passed…
Mark
  • 4,387
  • 2
  • 28
  • 48
3
votes
1 answer

How can I make a leaflet-popup stay when clicking another popup?

How can a popup stay open when clicking on another? The MWE below show a popup when I click on the markers. Good. But when I click on a second marker I don't want the first popup to disappear. It should only disapear when clicking the close [x]. No…
Chris
  • 2,256
  • 1
  • 19
  • 41
3
votes
4 answers

Going crazy with forceNetwork in R: no edges displayed

I've been trying to plot a network using networkD3 package in R for a week now. The simpleNetwork function works normally, but it doesn't allow much control over the appearance of the graph. The forceNetwork function is there for this purpose:…
Faabiioo
  • 89
  • 1
  • 10
2
votes
0 answers

Add Sparklines to Multiple Columns of R Data Table using Sparkline package

I am trying to add sparklines to multiple columns of a Data Table in R. I am able to get a single Sparkline column to render correctly, but when I try to render a sparkline in a second column based on different underlying data than the first, the…
byarno
  • 21
  • 2
2
votes
1 answer

How to copy screenshot to png from a html_widget

Follow-up question to this R Shiny: Vtree plot not rendering with Shiny With this code I generate a vtree htmlwidget. I would like to take a screenshot and save it in png. For this I use shinyscreenshot. But I only get a screenshot of all the rest…
TarJae
  • 72,363
  • 6
  • 19
  • 66
2
votes
1 answer

'rAmCharts4' graphics perturbed with 'flexdashboard'

I'm doing a 'flexdashboard' containing some graphics constructed with the rAmCharts4 package. These are 'HTML widgets' implemented with 'React'. On the first page, the graphics are nice: but not on the second page, however this is exactly the same…
Stéphane Laurent
  • 75,186
  • 15
  • 119
  • 225
2
votes
1 answer

I used htmlwidgets::onRender to add numbers to a sankey network, but the numbers do not seem to be appear after saving the plot as png

I was following this guide and tried using htmlwidgets::onRender to add numbers next to node labels. It displays the change in an html file with no problem, but then when I tried saving it as png, the numbers seem to disappear. I was using…
nightstand
  • 329
  • 2
  • 11
2
votes
2 answers

Export manually edited htmlwidget to SVG or similar

I often create Sankey-diagrams in R via {sankeyD3}, because it seems to be the package with the most options/features to do so. However, one feature that is missing is the ability to set the order of nodes on the y-axis (although this issue tried to…
Paul Schmidt
  • 1,072
  • 10
  • 23