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
1
vote
0 answers
Is there a way to reset click event data from a htmlwidget inside of a shiny application?
I have a custom htmlwidget embedded in a Shiny application that sends data about a position on the widget whenever the user clicks on a region in the widget. I want to add a "reset"-style button to stop data from being sent from the widget to the…

Cocoa99
- 93
- 7
1
vote
2 answers
networkD3 package: forceNetwork() - setting the linkDistance
I was trying to use the forceNetwork() function for my node plots. However, I can't seem to set the linkDistance. For example, in the attached image, I want to set all the green nodes equidistant from the center. Currently, they appear to be farther…

brian
- 85
- 7
1
vote
2 answers
How to export DT table to html and preserve all functionality?
I'm able to export a DT table generated in R/RStudio to HTML using the htmlWidget:saveWidget method. However, the FixedColumns feature is not preserved and becomes very narrow when a term is entered in the search bar.
xyz_search_dt <- datatable(
…

tjf64
- 11
- 1
1
vote
1 answer
Adding a color legend with JavaScript to a networkD3 sankeyNetwork() in R
I am currently working on an Shiny-App which displays Sankey-Plots. In order to create the Network I use the networkD3::sankeyNetwork() function which has no attribute to show a legend of the colorScale for the LinkGroup in general. Now I am…

weldbild
- 13
- 4
1
vote
1 answer
Select Specific Node NetworkD3
Is there a way to select an specific node using NetworkD3 in order to change its color?
Here is my code. I would like to use the customJS to achieve that!
p <- forceNetwork(Links = links,
Nodes = nodes,
Source =…

Higor Augusto Gomes
- 55
- 3
1
vote
0 answers
R crosstalk: how to set default values in filter_slider() in order to filter date column
My question is similar to this question, which asks how to set default filter selection in crosstalk::filter_select in R. However, I need to do the default select for crosstalk::filter_slider for a date column. I have created a reproducible example…

Jakub.Novotny
- 2,912
- 2
- 6
- 21
1
vote
1 answer
How to use htmltools::attachDependencies?
Here is an example of how I "manually" add a HTML dependency to a datatable. This works fine. When I try with attachDependencies, the dependency is not attached.
library(DT)
library(htmltools)
dep <- htmlDependency(
name = "colResize",
version…

Stéphane Laurent
- 75,186
- 15
- 119
- 225
1
vote
1 answer
Add specific hovering behaviour to R plotly graphic
I am having troubles defining a specific behaviour when hovering an R Plotly graphic. Here is what I would like to do : I would like the full arrow to be responsive, here it is just the tip of the arrow. I would also like, when the users hovers an…

Bambs
- 545
- 4
- 14
1
vote
1 answer
How to resize HTML widget using saveWidget in htmlwidgets R (reopened question)?
I would like to re-open a former topic on StackOverflow, concerning a problem I faced today, which I fixed in the same way as described by matheuscburger, by changing the size of the widget.
Topic of rasyidstat - 2018
Are there new options…

GiacomoDB
- 369
- 1
- 10
1
vote
1 answer
R slideview min example returns blank output
I'm using the CRAN version of slideview but the minimal example (below) only returns blank output on my machine. I've verified that img2000 and img2013 both plot, they just don't work within slideView().
### example taken from
###…

Rich Pauloo
- 7,734
- 4
- 37
- 69
1
vote
1 answer
networkD3 in R -> Set Initial Zoom in forceNetwork()
I am dealing with a big network (1k + nodes, 1M+ connections) and I would like to set a custom initial zoom, since the standard zoom only focusses a few nodes and takes a lot of time to achieve de aimed proportion (where I can see the whole…

Higor Augusto Gomes
- 55
- 3
1
vote
1 answer
networkD3 in R - Freeze forceNetwork()
Is there any way to freeze the layout with forceNetwork() in the {networkD3} lib?
This is taking me a lot of time, because of the number of nodes that my network has. I just need to stop the animation. I found something here, but didn't solve my…

Higor Augusto Gomes
- 55
- 3
1
vote
1 answer
Not saving html interactive file with R
I am trying to design a circos plot using BioCircos R package. BioCircos allows to save the plots as .html interactive files. However, when I run the package using RScript the saved .html file is empty. To save the .html file I used saveWidget…

Kaleb Pretto Gatto
- 41
- 1
1
vote
0 answers
Background tiles are not loaded in saved interactive html maps from leaflet in R
I am creating interactive html maps with leaflet in R and save them as html files with SaveWidget.
It worked fine for months but now the background open street map tiles are no longer shown in the web browser but are still shown in the Viewer panel…

Patrick Plötz
- 11
- 2
1
vote
1 answer
How to force networkD3::sankeyNetwork() to repeat nodes rather than circling back to same node
Hi I am creating a sankey diagram to show migration. One aspect I am facing issues with is how to deal with scenarios when status doesn't change i.e. migration doesn't happen.
In such scenarios, the sankey is circling back to same source, creating a…

LBZR
- 161
- 12