Using Cytoscape.js for network visualization in Shiny - r

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
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.
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 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
It looks like Shiny has a predefined set of widgets it supports, so there are a few options here:
(1) Shiny adds support for Cytoscape.js (e.g. https://github.com/cytoscape/r-cytoscape.js),
(2) A Cytoscape.js plugin is written for Shiny.
(3) You use JS for at least part of your app.
(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.
For very flexible and general interaction between R and Cytoscape.js, see the RCyjs project (docs)

Related

Gephi automation: how to make multiple graphs at once

I am looking for a tool to automate making graphs with Gephi. I have dozens of similar graphs to prepare (only labels and figures in data differ), so need something able to automatically:
load nodes and edges from a file (e.g., csv)
set up layout (e.g., "type='force atlas 2', iterations=n, threads=m, scaling=p, gravity=q...")
apply selected laoyut
tune appearance (ranking: color, size)
export graph
I am aware of Gephi Toolkit, but it is for Java. Maybe there is some other way to automate Gephi? (or I will have to learn Java, which is not bad, but requires time)
I've also found Gephi Scripting Plugin, which is good but lacks some features, e.g. can't set up layout (only runs it with default settings).
Thanks in advance!
It is a bit tricky and haven't tried myself but if you don't want to get your feet wet with Java then you could try one of the automation frameworks that allow you to control a GUI application, e.g. Robot, PyAutoGUI or if you use Windows you can use pywinauto.
I know it not a complete answer but it might give you a lead.

How to build tree diagrams in bokeh

What would it take to implement a tree diagram in bokeh? Something similar to this DS example would be nice --
http://bl.ocks.org/robschmuecker/7880033
I'm just looking to visualize a data structure, so only need the pan, zoom, and collapse functionality.
Thanks!
- AH
There is nothing in Bokeh to do this automatically. Bokeh does now support network/graph support, which it did not at the time the question was originally posted:
https://docs.bokeh.org/en/latest/docs/user_guide/graph.html
However, it would take some work to use this to reproduce the link above:
non straight-line edges would need to be computed explicitly
nodes/edges would have to be hidden manually based on TapTool events
Additionally there is no "smooth animation" option yet (as of Bokeh 0.13.0) so the transitions would be instant.
If the idea is to have this sort of capability along side other Bokeh plots, or to connect it to Python backend code, then another option is to write a custom extension for Bokeh:
https://docs.bokeh.org/en/latest/docs/user_guide/extensions.html
This would take some up-front work, but doing this, you could integrate the fancy D3 widget directly into Bokeh documents, and use it like, and connect it to, any other Bokeh component or widget.

Knowledge Graph (Demo) UI using sigma.js?

Are there any beginner-friendly tutorials to display graphs in the way Knowledge graph has been done?
I have the data is JSON format presented from a graphdb
For eg:
The closest I have found so far is Gelphi. Which also can be integrated with unity to produce a 3d Graph like this one https://www.youtube.com/watch?v=h_arRCf73Kg.
Then there is https://cayley.io/
https://n0where.net/opengraphiti-data-visualization-engine/
There is also https://www.maana.io/knowledge-platform/platform-capabilities/#maana-knowledge-graph . However, i have not tried to use/download their platform.
https://en.wikipedia.org/wiki/Force-directed_graph_drawing
Finally, I am working myself on learning unity to build a simple GUI which a user can identify nodes and edges and entities easily and move them around. So instead of just reading from a data base, also write to it through a UI.

How do I create a Treemap and depict it through flex?

So basically what I'm trying to do is make something like this:
http://store.kapit.biz/demo/treemap/prod/index.html#
I've searched long and hard to find a site that would show me some pseudocode (at least) or an algorithm as to how to implement this type of application. But everything I find are only applications that take in data and do all the work for me to create the graph. I need to actually create it for myself, just a simple one for now. Does anyone know where I can find this? What I want it to do is take data from a database and use it to create the treemap, then express it in a GUI like in the link above. If any specifics are needed I can provide it. I'm trying to do this in Flash Builder using Flex and using ColdFusion as the backend. Thanks!
Check this out
Axiis is a open source library based on Degrafa that enables you to make complex data visualizations.
Cheers

Does anyone know how to create a interactive graphs using flare or other visualisation classes?

Does anyone know of software or flex/flash/as3 source or visualisation software that could be used to make interactive graphs, where the user would enter a query that would pull data from a MySQL database and the user would build a sunburst or icicle graph by dragging and dropping items into a tree-like structure and they would be able to view the graph? i have attempted to use flare but my programming skills are pretty bad. So far from what i gather, flare only allows the graphing of defined datasets rather than allowing a user to modify the dataset and thus creating a new dataset.
Help?
This is far too big for the scope of a single question. You're going to need to write at least a few different pieces.
1.) Access to the database and a way to view datasets
2.) Control handlers to drag and drop datasets onto your chart object
3.) A chart object that can handle receiving dropped dataset items and render itself accordingly.
There are lots of good charting frameworks out there including Flare, Axiis, Flex charting, Fusion Charts, iLog Elixir. I'm not sure what you're trying to do but any one of those should be able to serve as your charting piece.
We worked on a project that used Flare and Flex. We had to provide the data to Flare in an XML format called GraphML, so we had code to convert the data into the required format in our C# backend, and then we passed it to Flex. There were naff all tutorials for it though, so took some time to figure it out.
There is a properly cool graphing tool (although its commercial) called Kapit. Check out their Diagrammer and Visualizer demos. It could be the case that its worth the spend.
But I agree with Mr Owen, theres some mad scope in that question:)

Resources