使用Cytoscape.js在Shiny中进行网络可视化 [英] Using Cytoscape.js for network visualization in Shiny

查看:128
本文介绍了使用Cytoscape.js在Shiny中进行网络可视化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在研究一个用于网络可视化的Web项目。我正在使用Shiny在R中编写代码。我想使用Cytoscape.js显示图。

I am working on a web project for network visualization. I am writing my code in R using Shiny. And I want to display my graph using Cytoscape.js

我已经在网上搜索了某种源代码来执行此操作。但是我什么也找不到。 Cytoscape.js的网页对我来说还不够,因为我不是js的专家,因此无法使用示例。

I've searched the web for some kind of source code doing this. But I couldn't find anything. The webpage of Cytoscape.js is not enough for me cause I am not expert in js and can't use the examples.

简而言之,我的图表具有邻接矩阵,想与cytoscpae.js一起使用。您知道任何源代码或我应该执行的步骤的教程吗?

Briefly, I have Adjacency matrix of my graph and want to use it with cytoscpae.js. Do you know any source code or a tutorial of the steps I should go through?

推荐答案

Cytoscape.js支持JSON作为输入,因此,只要您的R / Shiny代码可以产生这种效果,您就应该能够使用Cytoscape.js。格式描述如下: http://cytoscape.github.io/cytoscape.js /#notation / elements-json

Cytoscape.js supports JSON for input, so as long as your R/Shiny code can produce that, you should be able to use Cytoscape.js. Here's the format described: http://cytoscape.github.io/cytoscape.js/#notation/elements-json

Shiny似乎具有一组支持的预定义小部件,因此这里有一些选项:

It looks like Shiny has a predefined set of widgets it supports, so there are a few options here:

(1)> Shiny添加了对Cytoscape.js的支持(例如 https://github.com/cytoscape/r-cytoscape.js ),

(1) Shiny adds support for Cytoscape.js (e.g. https://github.com/cytoscape/r-cytoscape.js),

(2) 是为Shiny编写的Cytoscape.js插件。

(2) A Cytoscape.js plugin is written for Shiny.

(3)。您至少在应用程序的一部分中使用了JS。

(3) You use JS for at least part of your app.

(1)和(2)将花费比(3)更多的时间,因此根据您的要求,您可能不得不硬着头皮使用普通的JS。如果在没有自己的JS的情况下使用R / Shiny之类的框架,您将始终被锁定在所支持的范围之内,而错过了任何不受其支持的范围-从而失去灵活性。

(1) and (2) will take more time than (3), so depending on your requirements, you may have to bite the bullet and use normal JS. When using a framework like R/Shiny without your own JS, you'll always be locked into whatever's supported and miss whatever's not -- so you lose on flexibility.

R和Cytoscape.js之间非常灵活的通用交互,请参见 RCyjs项目 docs

For very flexible and general interaction between R and Cytoscape.js, see the RCyjs project (docs)

这篇关于使用Cytoscape.js在Shiny中进行网络可视化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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