Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accessing Graph Nodes, Links as adjacency matrix #25

Closed
xdiscovery opened this issue Mar 13, 2013 · 3 comments
Closed

Accessing Graph Nodes, Links as adjacency matrix #25

xdiscovery opened this issue Mar 13, 2013 · 3 comments

Comments

@xdiscovery
Copy link

Hi,

I would like to develop an iso-morphic interface to represent a graph.
Basically I would like to exploit the fact that all nodes and links of a session are already contained within the viva.graph.graph object, keeping the session active and reducing the time to download external JS libraries if it was the case.

I don't want to display a force-directed layout.

I just want to access the nodes and links information, without calculating at all their positions.
It is like if I am retrieving data information "hiddenly".

I tried to play around, and I found out that it is the renderer.run() function which actually let all the other code be executed.
That is, no renderer, no "graph" initialization.

var renderer = Viva.Graph.View.renderer(graph, {
container : document.getElementById('graph1')
//layout : layout,
//graphics : svgGraphics,
//prerender: 20,
//renderLinks : true
});
renderer.run(500) // if i remove this, no graph is constructed and no data is pulled

How could I use the graph object of Viva graph to get the nodes and links, but detach the rendered graph layout ?

renderer require a layout, so I wonder if I need to create a layout and pass it to Viva (which means putting my hands deeply into the library but my skills are definately not there)

Smtg simple like calling teh graph objects as:
graph.nodes()
graph.links()

Any suggestion?

@xdiscovery
Copy link
Author

Hello, just to share with the community:
I see it is possible to obtain the details on a node, thus its links and data, with graph.getNode(nodeID)

This is ok if I am within a function where all the code is executed, and it tells that data are stored as Viva.Graph.Node.

I would like to access this data and I tried to make the graph object as global variable, but no success.

Also, I would like to "switch off" the rendering visibility of the nodes, so that I can safe resources.

I have a structure like:

onload () { // excectue it when loading the web page
var graph; // graphs are global
d3sample () {} // create "g" graph pbject, return g
example () {
graph = d3Sample() // graph is a global graph
...
renderer
}

// now I would like to create this function:
interface2 {} {
switch visibility of renderer off
get info from graph (trying with graph.getNode(nodeID)
}
}

Basically I can't read the info of the graph as a "graph database" ..

Could you please help in understanding what I am doing wrong?

@xdiscovery
Copy link
Author

So, I used this solution.
I placed the graph (ViVa.graph object) an a div, and set graph as a global variable.
this way i can assess it also from other functions.

It worked out but it's dirty so please share it if you have a better solution!

@anvaka
Copy link
Owner

anvaka commented Jan 17, 2015

Closing this now. Can't believe it's almost 2 years passed!

@anvaka anvaka closed this as completed Jan 17, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants