init household filiation page with hello world visjs graph

This commit is contained in:
2021-10-11 13:28:25 +02:00
parent 0c5e5ac672
commit ae7774ac39
7 changed files with 91 additions and 1 deletions

View File

@@ -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);

View File

@@ -0,0 +1,5 @@
div#graph-relationship {
margin: 2em auto;
height: 500px;
border: 1px solid lightgray;
}