45

GitHub - visjs/vis-network: Display dynamic, automatically organised, customizab...

 5 years ago
source link: https://github.com/visjs/vis-network
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

README.md

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

GitHub contributors GitHub stars

Backers on Open Collective Sponsors on Open Collective

Install

Install via npm:

$ npm install vis-network

Example

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

<!doctype html>
<html>
<head>
  <title>Network</title>
  <script type="text/javascript" src="https://unpkg.com/vis-network@latest/dist/vis-network.min.js"></script>
  <link href="https://unpkg.com/vis-network@latest/dist/vis-network.min.css" rel="stylesheet" type="text/css" />
  <style type="text/css">
    #mynetwork {
      width: 600px;
      height: 400px;
      border: 1px solid lightgray;
    }
</style>
</head>
<body>
<div id="mynetwork"></div>
<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! ?

68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f7669736a732f6261636b6572732e7376673f77696474683d383930

Sponsors

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

68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f7669736a732f73706f6e736f722f302f6176617461722e737667 68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f7669736a732f73706f6e736f722f312f6176617461722e737667 68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f7669736a732f73706f6e736f722f322f6176617461722e737667 68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f7669736a732f73706f6e736f722f332f6176617461722e737667 68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f7669736a732f73706f6e736f722f342f6176617461722e737667 68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f7669736a732f73706f6e736f722f352f6176617461722e737667 68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f7669736a732f73706f6e736f722f362f6176617461722e737667 68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f7669736a732f73706f6e736f722f372f6176617461722e737667 68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f7669736a732f73706f6e736f722f382f6176617461722e737667 68747470733a2f2f6f70656e636f6c6c6563746976652e636f6d2f7669736a732f73706f6e736f722f392f6176617461722e737667

License

Copyright (C) 2010-2018 Almende B.V. and Contributors

Vis.js is dual licensed under both

and

Vis.js may be distributed under either license.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK