javascriptmethodsconsole.logvis.js-networkneovis

When using Neovis library, how to pass Vis.js' methods to the console?


I use neovis.js to build a graph, which imports vis.js. Vis.js's documentation guides me to pass getSeed() method to the console. How should I do this?

I've tried these to no avail:


Solution

  • If you look at the source at neovis.d.ts, you will see this line:

    /**
     * The vis network object
     * @link https://visjs.github.io/vis-network/docs/network/#methods
     */
    get network(): VisNetwork.Network | undefined;
    

    And in your Neovis script you should have this:

    viz = new NeoVis.default(config)
    

    This is equivalent with var network = new vis.Network(container, data, options) in Vis.js' tutorial. So all you need is to use viz.network.getSeed() in the console.