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
2 answers
Dynamically name x-node of networkD3 sankey
I am trying to have produce a shiny application in which a Sankey plot, produced using NetworkD3, dynamically produces x-node labels. I think this requires passing a reactive element to onRender, but I am not sure how to do this.
I see an answer…

MorrisseyJ
- 1,191
- 12
- 19
1
vote
1 answer
from ggplotly, open all new hyperlinks in the same new window/tab
I am using the following example code where click on the point opens a link:
data(mtcars)
mtcars$urlD <- paste0("http://google.com/search?q=", gsub(" ", "+", rownames(mtcars)))
p <- ggplot(data=mtcars, aes(x=wt, y=mpg, color=factor(carb),…

Vasily A
- 8,256
- 10
- 42
- 76
1
vote
1 answer
Run javascript code when output is rendered for default render methods (like onRender for widgets)
In shiny apps we can add javascript code to run when a widget has rendered using onRender from library(htmlwidgets). The same does not seem to work for the default render* functions from shiny. Is there a way to achieve something similar for these…

bobbel
- 1,983
- 6
- 21
1
vote
1 answer
Override default networkD3 graph properties
I am trying to set a custom color scheme using sankeyNetwork() from the networkd3 package in r. This is the custom color code I set for the colourScale argument of sankeyNetwork()...
# Give a color for each group:
my_color <-
'd3.scaleOrdinal()
…

Stephen Okiya
- 315
- 1
- 8
1
vote
1 answer
Add x-node titles to networkD3 Sankey plot in correct order
I am trying to label the x-nodes of a Sankey plot created with networkD3.
I see a solution posted here: How to add columnn titles in a Sankey chart networkD3
When I try to set labels manually, however, they show in the wrong order. I posted this as…

MorrisseyJ
- 1,191
- 12
- 19
1
vote
1 answer
how to give different color for the lines in the Sankey plot to show different groups?
I have a question on this Sankey plot in R. So basically I want to give different color for the line that connect the source and target nodes based on the variable group. Below are the codes I found from one of the R platform. Essentially the code…

adR
- 305
- 4
- 14
1
vote
1 answer
How does sankeyNetwork set x axis position
I am looking through the documentation and tutorials for building a sankey plot using networkd3 in r via networkD3::sankeyNetwork().
I can get this working using someone else's code (from here: sankey diagram in R - data preparation - see a…

MorrisseyJ
- 1,191
- 12
- 19
1
vote
1 answer
R twitterwidget package - tweet not cleared when shiny input is updated
Each time my input to renderTwitterwidget() is changed, a new tweet is printed underneath the original tweet on the Shiny UI. Is it possible to clear the old tweet and print a new one each time a new twitterwidget object is passed to…

catlover3000
- 13
- 3
1
vote
1 answer
Power BI: include an htmlwidget other than a plotly graphic
Following this amazing answer and this tutorial, I have been able to include an interactive ggplotly in Power BI:
I'm wondering whether it is possible to include other htmlwidgets. I tried with DT and rAmCharts4 but I got only an empty plot,…

Stéphane Laurent
- 75,186
- 15
- 119
- 225
1
vote
1 answer
How to remove date from a calendar built using toastui in R
I have the created a weekly calendar in R below using toastui:
library(toastui)
calendar(view="week", defaultDate = NULL) %>% cal_week_options(workweek = TRUE, hourStart = 7.5, hourEnd = 24)
This line of the code gives the following output:
How…

anisoleanime
- 409
- 3
- 10
1
vote
1 answer
How to change the font size, color, and style while setting `engine = htmlwidget` as a parameter of plot function?
Background of the Problem
I was trying the plot the rules, found after applying mineCARs of R.
plot(top10subRules, method = "graph", engine='htmlwidget')
However, the default font, and it's color does not become completely visible when I set the…

Md. Sabbir Ahmed
- 850
- 8
- 22
1
vote
1 answer
Saving HTMLWidget with links to HTML dependencies instead of embedding them
I save my ggplotly object using saveWidget() function. If I do it with selfcontained=TRUE option, all HTML dependencies (javascript libraries and CSS styles) are saved inside the HTML file making it very big. If I use selfcontained=FALSE, those…

Vasily A
- 8,256
- 10
- 42
- 76
1
vote
0 answers
Using webshot and robervable
I would like to include screenshots from an observable notebook in an rmarkdown rendered to pdf. Directly including code blocks that call robservable does not work, so I thought I could use the webshot package instead. The example below creates a…

Krisrs1128
- 311
- 4
- 8
1
vote
1 answer
Can I rotate the node labels in a Sankey Plot (networkD3::sankeyNetwork)?
I have long(ish) node labels for my Sankey diagram that I would like to rotate so that they can be read top-to-bottom instead of left-to-right. Ideally, I would be able to place these rotated node labels directly over the nodes (rather than the…

CharismaticChromoFauna
- 55
- 1
- 8
1
vote
1 answer
Assign figure caption to html widget (vtree package) in R markdown output
I need to implement a figure caption in a plot that is generated by the vtree package in R markdown. I learned that this is a htmlwidget and figure captions should now be possible for htmlwidgets used in R markdown with install.packages('webshot')…

TarJae
- 72,363
- 6
- 19
- 66