mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 23:23:51 +00:00
init household filiation page with hello world visjs graph
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
import vis from 'vis-network/dist/vis-network.min';
|
||||
|
||||
require('./scss/vis.scss');
|
||||
|
||||
// create an array with nodes
|
||||
let 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", cid: 1 },
|
||||
]);
|
||||
|
||||
// create an array with edges
|
||||
let 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
|
||||
let container = document.getElementById("graph-relationship");
|
||||
let data = {
|
||||
nodes: nodes,
|
||||
edges: edges,
|
||||
};
|
||||
let options = {};
|
||||
|
||||
//
|
||||
let network = new vis.Network(container, data, options);
|
@@ -0,0 +1,5 @@
|
||||
div#graph-relationship {
|
||||
margin: 2em auto;
|
||||
height: 500px;
|
||||
border: 1px solid lightgray;
|
||||
}
|
Reference in New Issue
Block a user