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

How to add columnn titles in a Sankey chart networkD3

I am making a Sankey chart and I would like to add text on top of each column in order to give a brief description of what is shown. Example code taken from the r-graph galery: library(networkD3) # A connection data frame is a list of flows with…
User2321
  • 2,952
  • 23
  • 46
8
votes
1 answer

Clicking a leaflet marker takes you to URL

Within the leaflet package for R, is there a way to click on a marker, and be directed to a URL?* Here's the JS solution. In R, to add a Popup with a URL: library(leaflet) content <- paste(sep = "
", "
Rich Pauloo
  • 7,734
  • 4
  • 37
  • 69
8
votes
2 answers

How to make scatterplot points open a hyperlink using ggplotly - R

I'd like to make my scatterplot points clickable and have each point's respective hyperlink open when clicked. I am trying to do this using ggplotly. There is a simple way to do this when building the plot using plotly()(see first example below).…
Margo
  • 93
  • 4
8
votes
1 answer

Tiny plot output from sankeyNetwork (NetworkD3) in Firefox

As per object, I get a very small plot in Firefox when using sankeyNetwork() from networkd3 in shiny but not in Chrome or RStudio. I have not included any CSS or JS in the script - the code below produces this result for me. Is there any CSS…
Andrea
  • 110
  • 6
8
votes
2 answers

Creating a Sankey Diagram using NetworkD3 package in R

Currently I am trying to create an interactive Sankey with the networkD3 Package following the instructions by Chris Grandrud (https://christophergandrud.github.io/networkD3/). What I don't understand is is table-format, since he just uses two…
Phipsy
  • 81
  • 1
  • 2
8
votes
1 answer

using htmlwidgets::scaffoldWidget to incorporate external js libraries for a new package to go into a shiny app

I have been impressed by the slick javascript library (http://kenwheeler.github.io/slick/) and want to incorporate it into my shiny apps/flexboard pages. I would like to use the htmlwidgets package in R incorporate the slick js library, so have…
h.l.m
  • 13,015
  • 22
  • 82
  • 169
7
votes
1 answer

Fixing the order of a Sankey flow graph in R / networkD3 package

I would like to visualize a rank change (i.e. change of the relative order) of US states using a Sankey flow graph. I'm using the networkd3 package and came up with the following: library(dplyr) library(networkD3) df <-…
Ben
  • 197
  • 1
  • 9
7
votes
1 answer

Shiny & networkD3 responding to node click

I am trying to use networkD3 and shiny to visualize some data. I would like to have an action happen when a node in a graph is clicked. I am using the diagonalNetwork function as shown in the code below. The forceNetwork function has an option to…
Daniel Cole
  • 177
  • 2
  • 8
7
votes
1 answer

Error message about username when using plotly r package offline

I'm trying to begin using plotly for R, but I'm having trouble with an error about username. When I try to execute the following code... test=ggplot(diamonds,aes(x=diamonds$carat,y=diamonds$price))+geom_point() test2=plotly(test) plotly(test) ...I…
user3786999
  • 1,037
  • 3
  • 13
  • 24
7
votes
2 answers

How to arrange HTML Widgets inside of a RMarkdown Document (PDF, HTML)

I'm working in a R notebook and would like use it to create two ouptuts: an HTML document and PDF document. My analysis includes leaflet maps (html widgets), which is causing problems when I knit the notebook to a PDF document. Thanks to the webshot…
Tiernan
  • 828
  • 8
  • 20
6
votes
2 answers

How to set size of rpivotTable in rmarkdown document

I would like to include several rpivotTables in an rmarkdown HTML output (document, flexdashboard, other options that result in a standalone HTML file are ok; I can't use Shiny for this). How can I specify a fixed width and/or height for this…
RyanStochastic
  • 3,963
  • 5
  • 17
  • 24
6
votes
1 answer

'printing' HTML widgets in programmatically generated Rmarkdown

I'm trying to programmatically generate some Rmarkdown and one of the sections contains an HTML widget. These are output fine if they are last in my function. However, if I wrap them in a print so I can put something else after them as you would do…
Richard J. Acton
  • 885
  • 4
  • 17
6
votes
1 answer

How to make hyperlink in tooltip text reachable in ggplotly?

I would like to make a clickable hyperlink in a tooltip text in ggplotly. The hyperlink does seem to appear in the tooltip, but it can't be clicked. Before I can click, the tooltip dissappears. How can I make the tooltip appear long enough for me to…
rdatasculptor
  • 8,112
  • 14
  • 56
  • 81
6
votes
1 answer

Sankey Diagram in R with networkD3 - row number issues

I'd like to focus on the flow highlighted above connecting the blue 'Thermal generation' block to the pink 'Electricity grid' block. You'll notice that the flow is 526 TWh, which is row #62 from Energy$links. Energy$links source target …
Display name
  • 4,153
  • 5
  • 27
  • 75
6
votes
2 answers

How to add title to a networkD3 visualisation when saving as a web page?

I have created a interactive visualisation using the following code: library(networkD3) nodes = data.frame("name" = c("node1", "node2","node3", "node4", "node5", "node6", "node7")) links =…
Callum Smyth
  • 127
  • 2
  • 7
1
2
3
28 29