Fix Sigma
This commit is contained in:
parent
1e37577b17
commit
4f4fabce54
2 changed files with 9 additions and 9 deletions
|
|
@ -1,5 +1,5 @@
|
|||
import graphology from 'https://cdn.jsdelivr.net/npm/graphology/+esm';
|
||||
import sigma from 'https://cdn.jsdelivr.net/npm/sigma/+esm';
|
||||
import Sigma from 'https://cdn.jsdelivr.net/npm/sigma/+esm';
|
||||
import forceAtlas2 from 'https://cdn.jsdelivr.net/npm/graphology-layout-forceatlas2/+esm';
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
|
|
@ -13,10 +13,7 @@ async function main(){
|
|||
graph = addLayout(graph);
|
||||
console.log("Graph data:", network_graph_json);
|
||||
console.log("Graph object:", graph);
|
||||
let sigmaInstance = new sigma.Sigma(
|
||||
graph,
|
||||
document.getElementById('container')
|
||||
);
|
||||
new Sigma(graph, document.getElementById('container'));
|
||||
} catch (error) {
|
||||
console.error('Failed to load or create the graph:', error);
|
||||
}
|
||||
|
|
@ -58,7 +55,7 @@ function addLayout(graph){
|
|||
iterations: 100,
|
||||
settings: {
|
||||
gravity: 0.5,
|
||||
scalingRatio: 2.0
|
||||
scalingRatio: 1.0
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,12 @@
|
|||
body {
|
||||
html, body {
|
||||
height: 100%;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
background: lightgrey;
|
||||
}
|
||||
|
||||
#container {
|
||||
height: auto;
|
||||
width: auto;
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
background: white;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue