Code Monkey home page Code Monkey logo

Comments (3)

xdiscovery avatar xdiscovery commented on July 28, 2024

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?

from vivagraphjs.

xdiscovery avatar xdiscovery commented on July 28, 2024

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!

from vivagraphjs.

anvaka avatar anvaka commented on July 28, 2024

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

from vivagraphjs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.