How to show a plot in a tooltip with Shiny - r

I'm building a Shiny app using ggvis, and I need to show a plot (a bar chart, for example) in a tooltip.
So basically, when a user clicks one of the points in the main plot I want a tooltip (or something of the sort) to display a new plot with extra information.
Is it possible to do this with Shiny?

The shiny demo at: http://shiny.rstudio.com/gallery/plot-interaction-selecting-points.html shows code where clicking on (or near) a point produces text output, you could modify that to create the second graph instead. I don't know how to do it like a tool tip, but this would produce the graph next to, or just below the graph being clicked on. The example uses ggplot2 rather than ggvis, so I don't know how that would change things.

Related

Is it possible to show a plot in the hover info using plotly in R?

Suppose I have a plotly graph in which I want to show another plot as hover info. Is it possible using plotly or echart4r? If yes, an example would be really appreciated.
It's certainly not a straightforward solution but this should be achievable using Shiny.
Plotly has the event_data function to allow you to access information about the user's interaction with the plot (such as where they are hovering):
https://rdrr.io/cran/plotly/man/event_data.html
https://plotly-r.com/linking-views-with-shiny.html#shiny-plotly-inputs
You could then tie this to a reactive UI element which contains the plot you are after inside of a tooltip. You will likely need to use a bit of Javascript to move around the tooltip. See example 3 from here for an idea:
https://stackoverflow.com/a/38919892/2947600
Give this a go if you'd like and if you're having a hard time, I might have the time to make a minimal example.

How to display items that make up a slice of a pie chart in Kibana?

I am attempting to create a pie chart that will display the health status of various systems. This is what the chart currently looks like:
Each data point, in addition to the possible errors messages, has a name in its data.
Is it possible to configure the chart so the system names are shown in the pie chart? In the tooltip for each slice would be preferable, but any solution will work.
You can Add (button at the buttom of the configuration) a second visualization, which will then add another layer around your first visualization.
This is an example for log.level and around it labels.url.full:

Interactive plots on local .html via .rmd or Shiny

I'm trying to build a .html file via RStudio in to have following function(simplified).
plot1:a simple time series plot of $y_t$, where user can manually pull/drag each dot to change it's values a each time point.
plot2:a time series dependent on $y_t$, such as $f(y_t)=2*y_t+1$, once the value in plot1 changed, the plot2 will also change accordingly.
I want the .html self contained, not cloud based. I'm thinking of plotly, shininy/knitr, but I'm not sure if I'm in the direction or how to connect the dots. Hope anyone can point me to the right direction.
A self-contained/client-side html report sounds well-suited for flexdashboard. It's based on R Markdown, and therefore can accommodate Shiny elements.
I don't know if you can modify values with a mouse, but you can certainly modify values with sliders and other inputs, as well as have a second plot react to a first plot.
You may see some more possibilities in the gallery.

Get data from mouse events in plot.ly or ggvis within r (not shiny)

I want to use interactive plots in R to be able to select x intervals in plots, i have tried plot.ly and ggvis and it seems that the mouse click on the plot followed by horizontal drag, used for zooming is exactly what i want, but zoom would have to be disabled and the [x start, x end] values must be returned to R. Any ideas if this is possible, and if so, how?
I tried to make tooltip function available with static_output (without shiny).
You can check my fork (https://github.com/lujiacn/ggvis
), enable the tooltip by default, in Rstudio and output html widget.
The way is put tooltip content in one variable called "tooltip". If no "tooltip" variable, wills show the all values linked to the data.

How to show an iplot without opening an additional window into r shiny

I'm trying to build interactive graphs in my shiny app. The user should be able to click on bars and see where the cases are displayed in another graph for example like a scatterplot next to the barplot.
There are different r packages, that are doing a great job: iplot, rggobi, acinonyx. I also found qtlcharts, but it does not exactly what I wanted. The problem is, I can't figure out, how to integrate different iplots into my shiny app boxes. Is there any way preventing iplots from opening separate windows for the graphs?
In acinonyx you can say window=FALSE, which prevents opening the java window of the graph. But the graph isn't displayed in the box as well. You could add/move the iplot into icontainer, iVisual or iWindow, but none of them can be integrated into the shiny boxes in the ui without printing the error: unsupported data frame or doing nothing at all.
I found the answer to my question: building reactive ggplots in shiny and adding coloured layers to one plot if the other plot is clicked will do the job.

Resources