MCPcopy Index your code
hub / github.com/visjs/vis-network

github.com/visjs/vis-network @v10.1.0 sqlite

repository ↗ · DeepWiki ↗ · release v10.1.0 ↗
1,167 symbols 2,681 edges 180 files 785 documented · 67%
README

vis-network

example chart

Network is a visualization to display networks and networks consisting of nodes and edges. The visualization is easy to use and supports custom shapes, styles, colors, sizes, images, and more. The network visualization works smooth on any modern browser for up to a few thousand nodes and edges. To handle a larger amount of nodes, Network has clustering support. Network uses HTML canvas for rendering.

Badges

semantic-release Renovate npm

dependencies Status devDependencies Status peerDependencies Status

GitHub contributors Backers on Open Collective Sponsors on Open Collective

Install

Install via npm:

$ npm install vis-network

Example

A basic example on loading a Network is shown below. More examples can be found in the examples directory of the project.

<!DOCTYPE html>
<html lang="en">
  <head>
    <title>Network</title>
    <script
      type="text/javascript"
      src="https://unpkg.com/vis-network/standalone/umd/vis-network.min.js"
    ></script>
    <style type="text/css">
      #mynetwork {
        width: 600px;
        height: 400px;
        border: 1px solid lightgray;
      }
    </style>
  </head>
  <body>





    <script type="text/javascript">
      // create an array with nodes
      var nodes = new vis.DataSet([
        { id: 1, label: "Node 1" },
        { id: 2, label: "Node 2" },
        { id: 3, label: "Node 3" },
        { id: 4, label: "Node 4" },
        { id: 5, label: "Node 5" },
      ]);

      // create an array with edges
      var edges = new vis.DataSet([
        { from: 1, to: 3 },
        { from: 1, to: 2 },
        { from: 2, to: 4 },
        { from: 2, to: 5 },
        { from: 3, to: 3 },
      ]);

      // create a network
      var container = document.getElementById("mynetwork");
      var data = {
        nodes: nodes,
        edges: edges,
      };
      var options = {};
      var network = new vis.Network(container, data, options);
    </script>
  </body>
</html>

Build

To build the library from source, clone the project from github

$ git clone git://github.com/visjs/vis-network.git

The source code uses the module style of node (require and module.exports) to organize dependencies. To install all dependencies and build the library, run npm install in the root of the project.

$ cd vis-network
$ npm install

Then, the project can be build running:

$ npm run build

Test

To test the library, install the project dependencies once:

$ npm install

Then run the tests:

$ npm run test

Contribute

Contributions to the vis.js library are very welcome! We can't do this alone!

Backers

Thank you to all our backers! 🙏

Sponsors

Support this project by becoming a sponsor. Your logo will show up here with a link to your website.

License

Copyright (C) 2010-2018 Almende B.V. and Contributors Copyright (c) 2018-2021 Vis.js contributors

Vis.js is dual licensed under both

  • The Apache 2.0 License http://www.apache.org/licenses/LICENSE-2.0

and

  • The MIT License http://opensource.org/licenses/MIT

Vis.js may be distributed under either license.

Extension points exported contracts — how you extend this code

Selectable (Interface)
(no doc) [2 implementers]
lib/network/modules/selection/selection-accumulator.ts
FocusOptions (Interface)
(no doc)
types/network/Network.d.ts
TraverseParameters (Interface)
(no doc)
cypress/pages/pollution-detector.ts
Point (Interface)
(no doc)
cypress/e2e/helpers/common.ts
Chainable (Interface)
(no doc)
cypress/support/commands/vis-assert-selection.ts
CachedImage (Interface)
(no doc) [1 implementers]
lib/network/modules/components/edges/util/types.ts
ViewPortOptions (Interface)
(no doc)
types/network/Network.d.ts
Chainable (Interface)
(no doc)
cypress/support/commands/vis-visit-universal.ts

Core symbols most depended-on inside this repo

setOptions
called by 64
lib/network/modules/components/edges/util/types.ts
get
called by 60
lib/network/modules/Groups.js
add
called by 42
lib/network/modules/Groups.js
visRun
called by 38
cypress/support/commands/vis-run.ts
replace
called by 27
lib/network/modules/components/shared/LabelSplitter.js
getToken
called by 26
lib/network/dotparser.js
mockedBody
called by 25
test/edges/helpers.ts
visSnapshotOpenedPage
called by 24
cypress/support/commands/vis-snapshot-opened-page.ts

Shape

Method 718
Function 194
Class 167
Interface 88

Languages

TypeScript100%

Modules by API surface

lib/network/modules/LayoutEngine.js75 symbols
lib/network/modules/ManipulationSystem.js48 symbols
lib/network/modules/components/edges/util/end-points.ts43 symbols
lib/network/modules/SelectionHandler.js37 symbols
lib/network/modules/Clustering.js37 symbols
types/network/Network.d.ts35 symbols
test/Label.test.js31 symbols
lib/network/modules/components/Node.js31 symbols
lib/network/modules/selection/selection-accumulator.ts30 symbols
lib/network/modules/components/shared/LabelSplitter.js30 symbols
lib/network/modules/components/shared/Label.js29 symbols
lib/network/modules/PhysicsEngine.js29 symbols

Dependencies from manifests, versioned

@egjs/hammerjs2.0.17 · 1×
@mdi/font7.4.47 · 1×
@semantic-release/commit-analyzer13.0.1 · 1×
@semantic-release/npm12.0.2 · 1×
@semantic-release/release-notes-generator14.1.0 · 1×
@types/chai5.2.3 · 1×
@types/mocha10.0.10 · 1×
@types/sinon17.0.4 · 1×
compare-versions6.1.1 · 1×
component-emitter1.3.1 · 1×
cross-env10.1.0 · 1×

For agents

$ claude mcp add vis-network \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact