I have this page
<html>
<head>
<style type="text/css">
#container {
max-width: 800px;
height: 800px;
margin: auto;
}
</style>
</head>
<body>
<div id="container"></div>
<script src="sigma.min.js"></script>
<script src="plugins/sigma.parsers.json.min.js"></script>
<script>
sigma.parsers.json('graph.json', {
container: 'container',
settings: {
defaultNodeColor: '#ec5148'
}
});
</script>
</body>
</html>
which works fine loading the first example graph provided here and below
{
"nodes": [
{
"id": "n0",
"label": "A node",
"x": 0,
"y": 0,
"size": 3
},
{
"id": "n1",
"label": "Another node",
"x": 3,
"y": 1,
"size": 2
},
{
"id": "n2",
"label": "And a last one",
"x": 1,
"y": 3,
"size": 1
}
],
"edges": [
{
"id": "e0",
"source": "n0",
"target": "n1"
},
{
"id": "e1",
"source": "n1",
"target": "n2"
},
{
"id": "e2",
"source": "n2",
"target": "n0"
}
]
}
But when I try to load my JSON
{"nodes":[ {
"id": "chr1",
"label": "Bob",
"size": 8.75
},
{
"id": "chr10",
"label": "Alice",
"size": 14.75
} ],"edges":[ {
"id": "1",
"source": "chr1",
"target": "chr10"
} ]}
I can't get it visualised. The JSON structure seems exactly the same to me...