446 questions
1
vote
1
answer
80
views
Plotly R: Annotations showing fixed X values on hover despite recalculating closest points across subplots
I'm working with a Plotly figure in R that has 3 subplots sharing the same Y-axis (using subplot() with shareY = TRUE). I've implemented custom hover behavior using onRender() that:
Draws a ...
1
vote
1
answer
85
views
How to save leaflet to html with same dimensions as mainPanel
I am trying to save a map in html format from a shiny app, however, the map is saved alright but the dimensions from the map displayed on my mainPanel are different than the saved map. I would like to ...
2
votes
1
answer
83
views
How to combine two HTML widgets and keep colour scale in R?
I want to add some text above a interactive plotly in R. I wanted to do this by transforming my text to an html widget and combining two widgets (to have good control of the spacing). I used the code ...
0
votes
0
answers
33
views
multiple plotly objects in dynamic RMarkdown tabsets [duplicate]
I have looked at a few similar questions, and havent quite found the same question that I have.
I want to create an RMarkdown which, for each different factor value, creates a heatmap which shows how ...
3
votes
1
answer
83
views
Using htmlwidgets in litedown
The R markdown package no longer supports htmlwidgets, and is no longer supported itself. It suggests that litedown has superseded it.
Added to clarify: The markdown package is not the same as the ...
0
votes
1
answer
57
views
htmlwidgets with R
I try to create a plot with R and the display it implemented in a website.
My R Code:
library(tidyverse)
library(plotly)
data <- read_csv(...)
plot_temp <- data %>%
ggplot(aes(x = lon, y =...
1
vote
0
answers
43
views
remove horizontal scroll in html document generated from encryptedRmd
I am trying to encrypt an html file using R.
The file is a simple .html with a single reactable() table
Every time I render the file with encryptedRmd, the margins in the .html are huge and reactable()...
0
votes
1
answer
123
views
Making layer-specific legends (hiding the legends of un-activated layers)
I am making a map that needs to have seven base layers on it. There are so many legends that they cannot all fit on the screen- which makes it necessary to add a feature of the map that makes it so ...
2
votes
1
answer
159
views
How can I create zoom functionality for Sankey Networks using networkD3 and htmlwidgets?
As i the title says. I would like to zoom interactively on Sankey networks, as it is for example possible for Force networks. I assume that it would work by adding a htmlwidgets::onRender() call, ...
0
votes
1
answer
56
views
How to make Sankey Images in R?
that is the demo data
data = structure(list(Species = c("Cinachyrella", "Cinachyrella", "Cinachyrella",
"Cinachyrella", "Cinachyrella", "...
0
votes
1
answer
53
views
How do I set some custom colors to link when I use sankeyNetwork?
I used the sankeyNetwork function from the networkD3 R package to draw a sankey plot, aiming to show the changes in the number of cell types at different levels, but my custom colors don't match the ...
0
votes
1
answer
95
views
How to create a Sankey diagram in R where node colors are consistent for providers across different phases of a healthcare pathway?
I am working on a project where I need to visualize the flow of healthcare providers across different phases of a care pathway using a Sankey diagram in R. Each phase represents a step in the care ...
1
vote
0
answers
39
views
Interactive data column selection for plotting using pure html/js (i.e. htmlwidgets) e.g. with checkBoxGroups/radioButtons/selectboxes
My dataset has multiple value columns (of the order of 100) and a time column. The data should be plotted in an independent html-document. Is there some possibility to interactively select the columns ...
1
vote
1
answer
155
views
Adding custom modebar button to allow functionality of a third hovermode by color
This is hopefully my final question for this plot. I received help twice previously, both of which worked in standalone plotly graphs, but my plotly object being present in the context of a shiny app ...
1
vote
1
answer
93
views
Sankey diagram with NetworkD3 [duplicate]
I am working on a sankey diagram in R following some tutorials using networkD3 package.
I do not understand what is not working since when I run my codes, they work but in the Viewer it doesn't appear ...
4
votes
1
answer
108
views
Matching the colors and order of inflow and outflow in a sankeyNetwork diagram
I would like to rearrange the inflow and outflow in the Sankey diagram according to each source. For example, among the 2-year survivors in the localized OP group, some continue to survive into the ...
2
votes
1
answer
53
views
Sizing Plotly Plots Individually in a Loop in RMarkdown (without knitr chunk options)
I'm working on an RMarkdown document where I include multiple Plotly plots, and I need to control their sizes. When rendering a single plot, I can easily use chunk options like out.width and out....
2
votes
1
answer
62
views
Get the URL of the htmlwidgets widget in RStudio viewer panel
I have a package for making interactive plots using htmlwidgets and I would like to expose some of the client-side state so that e.g. the user can highlight some data points and then call a function ...
0
votes
1
answer
139
views
How can I avoid unintended New Lines with customWidgetBuilder in flutter_widget_from_html_core?
I have a problem with the flutter_widget_from_html_core plugin when I use customWidgetBuilder. When I add the custom tag to my HTML and use customWidgetBuilder to build a custom widget with that tag, ...
3
votes
4
answers
215
views
How to reduce the size of R plotly html output by rounding plot values
I am trying to reduce the size of my RMarkdown html report and more importantly, make them faster to open. The html report consists of a large number of R Plotly plots with each plot containing a ...
3
votes
0
answers
472
views
HTML widgets no longer rendering in R Studio Viewer pane after update to R 4.4.0
After updating to R 4.4.0, many different data visualizations that depend on the htmlwidgets library, such as leaflet, echarts4r and highcharter, fail to render in the R Studio Viewer pane. These ...
1
vote
1
answer
146
views
How to stop the double click to unzoom?
I am trying to disable "double-click to unzoom" behavior. I found this parameter in highlight:
highlight(on = NULL, off = "plotly_doubleclick")
but to no avail.
I want to double-...
0
votes
1
answer
44
views
How can I set a single cell to `date` format using rhandsontable?
Usin the {rhandsontable} package it's possible to create a table where date columns include a dropdown for each cell, both providing a slick UI and validation of user inputs.
I want to set a single ...
1
vote
0
answers
59
views
RStudio Viewer slower than browser window
I'm working on a package for interactive visualization in R using htmlwidgets and code I've written in TypeScript/JavaScript.
This works fairly well but I've noticed that the apps are a bit laggy in ...
0
votes
1
answer
133
views
Network D3 Sankey Diagrams link dataframe creation: bypassing nodes with NA, and automatic correction of values?
I am trying to create a Sankey Diagram using NetworkD3 to map out patient flow through an A&E department, with example dataframe:
`First_Contact <- c("UTC", "UTC", "111&...
0
votes
1
answer
36
views
HTML Widget not displaying in nested functions
I'm nesting functions within a function to be able to easily create content in a flexdashboard also generating markdown bits. I have a very abstract example but it does replicate the problem.
I'd be ...
0
votes
1
answer
73
views
Error in init.ts when using jsTreeR's grid parameter
I've already raised the issue here and here. By now a workaround exists however, I still don't understand the root cause.
When running the following app using the latest CRAN version of library(shiny) ...
0
votes
1
answer
60
views
Plot is showing in the viewer pane, not in the plot pane
# install.packages("networkD3")
library("networkD3")
concept <- c("Vulnerability", "Adaptation", "Resilience")
nodes <- data.frame(concept)
...
1
vote
1
answer
94
views
Moving from r2d3 to htmlwidget
I'm trying to get the right workflow to move something i created using {r2d3} to {htmlwidgets}. For example, the following code works in r2d3 and creates a very simple x-axis:
// set up constants used ...
1
vote
1
answer
48
views
Animate line and circle when button is clicked
I'm new to d3.js and I'm struggling to fix a bug on a simple plot. I'm basically trying to create an animated lollipop plot that can be updated by clicking on a button. This is the code I wrote:
// !...
2
votes
0
answers
114
views
Mapbox interactivity where values change in information window based on hover using R mapboxapi and mapboxer
I'm trying to get a mapbox, which changes layers on different zooms, to change values in an information window on mouse hover (like this example) using R's mapboxapi, mapboxer, and htmlwidgets. Kyle ...
0
votes
0
answers
70
views
How to convert a text into clickable link using a networkD3 widget in shiny?
I have created a Forcenetwork and I want when I click on any node it should provide its description along with a hyperlink on the same page. So that anyone can click that link and get more information ...
0
votes
1
answer
226
views
Is it possible to change the link names in sankey plots from networkD3 R package
I have plotted this sankey plot using the networkD3 package in R but want to change the link names so that in each node the #number is removed. So essentially, I only want BV in each node without ...
1
vote
1
answer
1k
views
Move labels to the outside of the Sankey Diagram and order from biggest to smallest in both sides
it's the first time I'm using R so sorry for stupid mistakes. I need to do a Sankey Chart to display flows between cities in a Metropolitan Area, but I am not satisfyied with the how the graph looks. ...
1
vote
0
answers
114
views
In R, how to fit a plot made with plot_ly into an html page
I'm building an html page with a plot made with plot_ly and under it I have some buttons connected to the data of the plot.
Here is the layout so far.
I would like to fit the plot fully in the box.
...
0
votes
0
answers
370
views
Plotly rotation animation and changing camera eye in R
I am having trouble changing the camera eye in my rotating animation of a plotly "scatter3d" plot.
I can specify the camera eye using the layout function in the plotly R package.
fig %>%
...
0
votes
1
answer
122
views
R plumber on DigitalOcean and HTMLWidgets producing "exception" errors
I have deployed my plumber.r API file on DigitalOcean using plumberDeploy::do_deploy_api and I get the resulting Swagger documentation with all the functions contained. The majority of functions work ...
0
votes
1
answer
466
views
How to add a download button for html format on a plotly modebar in R shiny
it is a newby question
I'm making a Shiny app in R and I use Plotly to make my plots interactive.
On the modebar of plotly, there is a button to download on png, and we can change parameter to ...
0
votes
1
answer
70
views
R is not rendering graph in forceDirect
Followed all the suggestions in Stackoverflow and YouTube but still cannot render graphs in networkD3 using R Studio.
Produced Nodes and Links csv files and uploaded same, simpleDirect is rendering ...
0
votes
0
answers
29
views
R html widget: annoying return symbols
I'm converting an R DT table to an html widget.
The widgets have the annoying carriage return symbols. Example of carriage return issue:
The dataframe is all_p_22
My code:
library(htmlwidgets)
...
0
votes
1
answer
571
views
How to move Sankey first node text to left
I am creating a sankey plot (migration form):
library(tidyverse)
library(networkD3)
library(htmlwidgets)
links <- data.frame(source = c("a","b","a","a",&...
10
votes
2
answers
5k
views
Argument "selfcontained" deprecated in htmlwidgets::saveWidget()
I keep getting [WARNING] Deprecated: --self-contained. use --embed-resources --standalone when saving a plotly plot as a self-contained html widget, using htmlwidgets::saveWidget(..., selfcontained = ...
2
votes
1
answer
500
views
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 ...
1
vote
0
answers
343
views
Making Power Bi - R (HTMLwidgets pbiviz based) custom visuals interactive with other Power BI visuals
I have made a pbiviz custom visual using developer tools of Normal distribution curve over a Histogram plot with R - ggplot2 and plotly libraries in a pbiviz.package
The visual works fine. Now I want ...
2
votes
1
answer
314
views
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 ...
0
votes
1
answer
105
views
How to simplify the JS code in this R shiny code?
The below code I found at How to display a scaled up image in an popup window on mouse hover or on click event on an image displayed in a rhandsontable cell in RShiny? (but wrapped in Shiny) almost ...
2
votes
1
answer
82
views
'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 ...
1
vote
0
answers
91
views
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 ...
0
votes
0
answers
492
views
Align nodes horizontally based on group with networkD3 sankeyNetwork in R
I think the answer to this question is "it's not currently supported", which is fine, but I'm hoping to build a sankey diagram with the nodes aligned horizontally based on their group. I ...
0
votes
1
answer
2k
views
How to include a leaflet map into a Word or PowerPoint document?
I teach Leaflet to my students to map and analyze spatial data.
I would like them to present some of their work in PowerPoint, Word, and/or PDF while maintaining the interactive features of the ...