I'm trying to check if this basic HTML code is running in my browser, just to make sure there were no problems. This is my first time working with Sigma.js and still very new to JavaScript in general. The JSON data file is provided by the sigma.js website along with a basic code. The problem occurs when I open the HTML file into the browser and the screen is completely white. I realize this is probably a very basic question, but I could not find any response online that could help so I really appreciate your help!
<html>
<head>
<script src="../src/sigma.min.js"></script>
<script src="../src/sigma.parsers.json.min.js"></script>
<script src="../plugins/sigma.parsers.json/sigma.parsers.json.js"></script>
</head>
<div id="container">
<style type="text/css">
#container {
max-width: 400 px;
height: 400 px;
margin: auto;
}
</style>
<body>
</div>
<script>
sigma.parsers.json('data/data.json', {
container: 'container',
settings: {
defaultNodeColor: '#ec5148'
}
});
</script>
The following is my data file I found on the sigma.js site itself
{
"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"
}
]
}