我可以找回以下信息吗:“悬停位置",“画笔位置"或“点击位置" [英] Can I get back info like: "hover location", "Brush location" or "click location"

查看:106
本文介绍了我可以找回以下信息吗:“悬停位置",“画笔位置"或“点击位置"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想建立一个互动的图表,该图表具有光泽和情节. Shiny具有内置功能,可获取有关用户交互的信息.像: input $ plot_click input $ plot_dblclick input $ plot_hover input $ plot_brush . 看: http://shiny.rstudio.com/articles/plot-interaction.html

I want to set up an interactive graph with shiny and plotly. Shiny has a build in feature to get info about the user interaction. Like: input$plot_click, input$plot_dblclick, input$plot_hover and input$plot_brush. See: http://shiny.rstudio.com/articles/plot-interaction.html

是否可以通过Plotly API获得此选项?还是API只能处理一个方向?

Is there any option to get this over the Plotly API? Or can the API just handle one direction?

Plotly真的很酷.很想在我闪亮的应用程序中使用它.

Plotly is really cool. Would love to use it in my shiny apps.

感谢和问候

Nico

推荐答案

是的,通过postMessage API,有单击和悬停绑定到Plotly图: https://github.com/plotly/postMessage-API

Yes, there are click and hover bindings to Plotly graphs through the postMessage API: https://github.com/plotly/postMessage-API

有关如何在Shiny中使用postMessage API的草图在这里: http://moderndata.plot.ly/dashboards-in-r- with-shiny-plotly/

A sketch of how to use the postMessage API with Shiny is here: http://moderndata.plot.ly/dashboards-in-r-with-shiny-plotly/

代码在这里: https://github.com/chriddyp/plotly-shiny

这篇关于我可以找回以下信息吗:“悬停位置",“画笔位置"或“点击位置"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆