UNPKG

ccnetviz

Version:

[![Build Status](https://travis-ci.org/HelikarLab/ccNetViz.svg?branch=master)](https://travis-ci.org/HelikarLab/ccNetViz) [![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0) [![semantic-releas

51 lines (46 loc) 1.54 kB
<!DOCTYPE html> <html> <head> <title>Bidirectional graphs example</title> <link rel="stylesheet" type="text/css" href="css/template.css" /> <script src="../lib/ccNetViz.js"></script> </head> <body> <div class="canvas-container"> <h3 class="title">Bidirectional graphs example</h3> <canvas id="canvas"></canvas> <div class="description"> To enter to deeper node, click on node "Hello" or "World". Then use right button on mouse for going back. <br /> More detailed information please visit the <a href="https://helikarlab.github.io/ccNetViz/#doc">documentation</a>. </div> </div> <header id="logo"> <a href="https://helikarlab.github.io/ccNetViz/"> <img src="images/logo.svg" /> </a> </header> <script> var canvas = document.getElementById('canvas'); var graph = new ccNetViz(canvas, { bidirectional: 'overlap', styles: { node: { texture: 'images/node.png', label: { hideSize: 16 } }, edge: { arrow: { texture: 'images/arrow.png' } }, }, }); var nodes = [{ label: 'Hello' }, { label: 'World' }, { label: '!' }]; var edges = [ { source: nodes[0], target: nodes[1] }, { source: nodes[1], target: nodes[0] }, { source: nodes[0], target: nodes[0] }, { source: nodes[1], target: nodes[2] }, ]; graph.set(nodes, edges, 'force').then(() => { graph.draw(); }); </script> </body> </html>