Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <style type="text/css">
- body {
- margin: 0;
- }
- #container {
- position: absolute;
- width: 100%;
- height: 100%;
- }
- </style>
- </head>
- <body>
- <div id="container"></div>
- <script src="./sigma.min.js"></script>
- <script>
- // Let's first initialize sigma:
- var s = new sigma('container');
- // Then, let's add some data to display:
- s.graph.addNode({
- // Main attributes:
- id: 'n0',
- label: 'This is an example of node',
- // Display attributes:
- x: 0,
- y: 0,
- size: 20,
- }).addNode({
- // Main attributes:
- id: 'n1',
- label: 'and this is another node',
- // Display attributes:
- x: 0.1,
- y: 0.1,
- size: 10,
- }).addEdge({
- id: 'e0',
- // Reference extremities:
- source: 'n0',
- target: 'n1'
- });
- // Finally, let's ask our sigma instance to refresh:
- s.refresh();
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement