Questions tagged [ggiraph]

Use this tag for questions relating to ggiraph, an htmlwidget and a ggplot2 extension that allows ggplot graphics to be animated.

ggiraph is an htmlwidget to make ggplot graphics interactive. Further information can be found at ggiraph GitHub and CRAN.

89 questions
2
votes
1 answer

R ggiraph - no plot when running .R file

How do I get the graph when executing a .R file? The file (test.r) looks like this: library(ggplot2) library(ggiraph) gg <- ggplot(data = mtcars, aes(x = mpg, y = wt, color = factor(cyl))) gg1 <- gg + geom_point_interactive(aes(tooltip = gear),…
robot987
  • 45
  • 4
2
votes
1 answer

shiny - how to use ggiraph

My dataset as follows.... fund , sharpe , risk abc , 1.5 , 7 def , 0 , 5 selectInput("n_breaks", label = "Risk Profile:", choices = c(1,2,3,4,5,6,7,8,9,10), selected = 7) # Reactive selectedData <- reactive a <- mydata %>%…
james lim
  • 39
  • 4
1
vote
0 answers

how can I specify the hover options for a segment in ggiraph?

I'm trying to make a workaround with ggiraph to create an interactive network with ggraph. What I want is to be able to highlight the edges upon hovering and display some info. I created a sample graph and managed to get the interactive part for the…
1
vote
1 answer

ggiraph: select points from selection box (by name)

ggiraph creates much less issues converting a ggplot2 graphic to an interactive htmlwidget compared to plotly::ggplotly(). However, there is one key feature of plotly which I am missing in ggiraph: Selecting points by name in a selection box (via…
retodomax
  • 434
  • 3
  • 14
1
vote
0 answers

Unexpected behavior of geom_sf_interactive() when merged data frames

I have the first data frame with geospatial data from .gpkg file loaded into R in usual way: geo_data <- read_sf() Than I have a second data frame from an external excel file containing a number of variables: participantion_2020_raw <-…
sketman
  • 21
  • 1
  • 1
1
vote
1 answer

Interactive ggiraph objects created in a loop does not show in quarto HTML output

I am trying to create a loop that generates +100 interactive graphs using the ggiraph package. The plots appear as expected when I run the loop interactively. However, when I render the .qmd document, the interactive graphs are not showing. A…
Steen Harsted
  • 1,802
  • 2
  • 21
  • 34
1
vote
0 answers

Create interactive ggraph tree with ggiraph package in RShiny app

I am trying to create an interactive ggraph tree plot (or network plot) using the ggiraph package. Previously I used the plotly package but hat didnt work since plotly doesnt support drawing edges. For the ggiraph package I can get the graph to…
MaKo
  • 11
  • 3
1
vote
0 answers

add interactivity to ggplot - having issues with plotly, ggiraph

I have a faceted ggplot, and I'm really struggling to add a tooltip on hover. A sample file is here: https://github.com/rollingstone09/help (edit: have now added a dput output to the bottom of this post). a <- read_excel("a.xlsx") a$Date <-…
1
vote
1 answer

ggiraph, ggplot2, R : How to get ifelse() to work with interactive text?

I want the text labels on the stacked bar chart to be interactive so the bar chart doesn't flicker as you move the mouse over the text. To hide labels that don't fit on the small bars, I am using label=ifelse(Result > 0.06, percent(Result), "").…
Sidders
  • 124
  • 10
1
vote
2 answers

Change the size layout in ggiraph package

In this example below from (from https://walker-data.com/census-r/mapping-census-data-with-r.html#linking-maps-and-charts), i would like to increase the width of the map. How can i do…
Meo
  • 140
  • 1
  • 9
1
vote
1 answer

Easiest way to format table for interactive tooltip for ggiraph

I have this basic example below. As you will see it is an interactive plot. What I am hoping to achieve at the moment is to take the dummy_data and make it a formatted table for the tooltip when you hover over a datapoint. I am going to have…
1
vote
2 answers

Is it possible to use ggiraph interactive functions with ggplots generated using stat_summary

I am using stat_summary to generate a column plot from a dataframe. I would like to report the values to the user via tooltips using geom_col_interactive from ggiraph. I can get the values from the ggplot using ggplot_build and construct a tooltip…
dave adelson
  • 853
  • 9
  • 15
1
vote
0 answers

How do I make an interactive label with ggplot pie chart in R

I currently have a donut chart that shows a count of vessels by length buckets (in feet) and the percentage of the donut these buckets make when you hover over different areas of the chart. However, I would like to make it so the label I have that…
emo1987
  • 11
  • 1
1
vote
1 answer

Linking legend with data points in ggiraph

I'm trying to create a ggiraph plot that I would like to include in a rmarkdown document where hovering the legend will also highlight the corresponding points in the plot. I've tried below code, but while I can hover the points in the plot and the…
Johan
  • 810
  • 6
  • 12
1
vote
1 answer

Positioning legend title on top of horizontal legend causes loss of interactivity in ggiraph

When I used guides() specifications to customise legend appearance, I found that the interactive nature of the legend in the plot is lost. The following code modified from the example in the ggiraph…