简体   繁体   English

RStudio和Shiny:服务器和客户端之间的消息

[英]RStudio and Shiny: messages between server and client

I'm trying to create a Shiny application, and I need the messages that the client sends to the server and the answers the server sends back (especially the images). 我正在尝试创建一个Shiny应用程序,我需要客户端发送到服务器的消息以及服务器发回的消息(特别是图像)。 The problem is t I don't know how they communicate with each other. 问题是我不知道他们是如何相互沟通的。 I was trying to get this information from the documentation, but I wasn't able to find it. 我试图从文档中获取此信息,但我无法找到它。 I would prefer to get these server-client messages in Java, but I'm interested in any solution that can work. 我更喜欢用Java获取这些服务器客户端消息,但我对任何可行的解决方案感兴趣。

This is how I would like my app to work: 这就是我希望我的应用程序工作的方式:

We have shiny code which generates a web page that contains an image and a few things the user can change. 我们有闪亮的代码,可以生成一个包含图像和用户可以更改的一些内容的网页。 Whenever the user changes something (a check-box, menu, etc), the current state of the page should be saved. 每当用户更改某些内容(复选框,菜单等)时,应保存页面的当前状态。 Alternatively, we could have aa button that the user clicks to save the state of the page. 或者,我们可以有一个用户单击以保存页面状态的按钮。 We would like to save the whole html, or just the image. 我们想保存整个HTML,或只是图像。 with the current state of the menus as a string. 将菜单的当前状态作为字符串。 I tried to save the html, but it did not contain the image. 我试图保存html,但它不包含图像。 That is why I would like t those messages, because I guess they contain the data I need. 这就是为什么我想要那些消息,因为我猜它们包含我需要的数据。

However, I chose Java, because these states should be saved to a graph showing step-by-step how the final form gained shape. 但是,我选择了Java,因为这些状态应该保存到一个图表中,逐步显示最终形式如何形成。 I would prefer to save this into an Xmind workbook as it has a nice Java API, which I could use to make the needed workbook. 我更喜欢将它保存到Xmind工作簿中,因为它有一个很好的Java API,我可以使用它来制作所需的工作簿。

Try 尝试

options(shiny.trace=TRUE)
runApp("myApp")

The messages between the server and the ui are then printed in the R console. 然后在R控制台中打印服务器和ui之间的消息。 see this question . 看到这个问题 Hope this will help. 希望这会有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM