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

Define hoverinfo in htmlwidgets/plotly object from sendCustomMessage()

I have a Shiny application where I create an interactive scatterplot made of hexagons. If the user hovers over a hexagon, a hover will indicate how many points are in that data ("count: x"). I am now trying to send a list variable called "points"…
user2808302
3
votes
1 answer

plot from sankeyNetwork in networkD3 does not show output neither generates any warning/error in R

I want to generate a Sankey plot to visualize movements to different areas using sankeyNetwork() from the package networkd3 in r. I tried to mimic some examples as perfectly as possible. But when I run the function sankeyNetwork, no output is…
Liri
  • 350
  • 3
  • 19
3
votes
1 answer

Sankey Diagrams in R

I am working on making a sankey diagram in R but having trouble with the meaning behind the node names. Below is an example that I found online: library(networkD3) nodes = data.frame("name" = c("Node A", # Node 0 …
nak5120
  • 4,089
  • 4
  • 35
  • 94
3
votes
1 answer

R Leaflet plot ship direction

I have information on the location of vessels/ships and the course they are steering. I'd like to plot them on a leaflet map with a custom icon which looks like a ship. I found the "tags" icon from glyphicons to be most suitable. Here's some data to…
Dhiraj
  • 1,650
  • 1
  • 18
  • 44
3
votes
1 answer

networkD3 Sankey Diagrams - controlling node locations

I wish to create an interactive Sankey diagram using HTML widgets/Javascript within R Markdown, so am looking at using the networkD3 package. The main interactivity I wish to utilise is clicking on the nodes to have the pathways emanating from it…
Nevil
  • 161
  • 1
  • 11
3
votes
3 answers

saving interactive plotly graph to a path using htmlwidget

I am trying to save some interactive figures into extra files. This works fine with htmlwidget::saveWidget. But I get problems by saving them into a different folder, for example into a results folder. results_dir <-…
drmariod
  • 11,106
  • 16
  • 64
  • 110
3
votes
2 answers

ggplotly tooltip with revealjs r markdown presentation

I'm using an rmarkdown .Rmd file to create a revealjs_presentation. However, when I create a chart using ggplotly, the tooltip no longer lines up with the points when hovering. Here is an example: --- title: "" output: …
Tunn
  • 1,506
  • 16
  • 25
3
votes
1 answer

R: add title to networkD3 plot and save

I am interested in adding a title to a forceNetwork graph created with NetworkD3 and exporting the html with magrittr. A solution was found in the R: HTML Tag Object help page in order to add a title. Then I was directed to adding htmltool…
adm
  • 354
  • 5
  • 17
3
votes
2 answers

Interactivity in Sankey chart in R using networkD3

I wish to implement onClick on this sankey diagram such that by clicking on a link, I should see the details of the link between the two nodes. It's like the plotly_click function library(networkD3) nodes = data.frame("name" = …
Ashmin Kaul
  • 860
  • 2
  • 12
  • 37
3
votes
0 answers

r leaflet crosstalk select single marker without shiny

is it possible to create an interactive html document without using shiny, in which I can select one single marker on a map (leaflet htmlwidget), so the corresponding observation is highlighted/selected in another htmlwidget? What I have so far in a…
Nele
  • 31
  • 5
3
votes
1 answer

Add custom js file to R html widget output?

I am using R htmlwidget package, which save plotly graph in the form of html.The function htmlwidget::savewidget()save graph as a html file. Now we need to include a custom js file to the plotly html file generated by htmlwidget::savewidget() for…
Qaiser iqbal
  • 306
  • 1
  • 14
3
votes
1 answer

Formatting DT::datatables based on logical vector

I currently want to use colorformatting for my dataFrames using shiny and the DT package. My table looks roughly like this. | val1 | val2 | | ---------|------ | | a | b | | a | a | | b | b | I want to change…
Gregor de Cillia
  • 7,397
  • 1
  • 26
  • 43
3
votes
1 answer

Conditional formatStyle in DT

I want to color rows in column A by values in column B. The code below is based on the example from the vignette Link, but shows only the condition for two columns: mobile_number by mobile_flag. Data: head(test[, c("EMBG","mobile_number",…
Prometheus
  • 1,977
  • 3
  • 30
  • 57
3
votes
1 answer

Poor text display in rgl output with dark background

When I output an rgl scene using OpenGL that includes text and a dark background, the text does not display properly. Sample code: library(rgl); library(htmlwidgets) open3d() bg3d(color = "black") text3d(0, 0, 0, text = "Text", color =…
hfisch
  • 1,312
  • 4
  • 19
  • 36
3
votes
1 answer

Combine leaflet and markdown in loop

This question shows how to loop over/apply leaflet objects within a markdown file. I'd like to do a similar thing, though I'd like to add additional markdown content. --- title: "Test" output: html_document --- ```{r setup,…
gregmacfarlane
  • 2,121
  • 3
  • 24
  • 53