Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
vincenzocaputo committed Mar 31, 2024
1 parent 70c067a commit 4132e38
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 44 deletions.
1 change: 1 addition & 0 deletions tests/.ipynb_checkpoints/bundle1_graph-checkpoint.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion tests/bundle1_graph.json

Large diffs are not rendered by default.

74 changes: 31 additions & 43 deletions tests/graph.html
Original file line number Diff line number Diff line change
@@ -1,35 +1,20 @@
<html>
<head>
<meta charset="utf-8">

<script src="lib/bindings/utils.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/vis-network/9.1.2/dist/dist/vis-network.min.css" integrity="sha512-WgxfT5LWjfszlPHXRmBWHkV2eceiWTOBvrKCNbdgDYTHrT2AeLCGbF4sZlZw3UMN3WtL0tGUoIAKsu8mllg/XA==" crossorigin="anonymous" referrerpolicy="no-referrer" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/vis-network/9.1.2/dist/vis-network.min.js" integrity="sha512-LnvoEWDFrqGHlHmDD2101OrLcbsfkrzoSpvtSQtxK3RMnRV0eOkhhBN2dXHKRrUU8p2DGRTk35n4O8nWSVe1mQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>


<head>
<meta charset="utf-8"/>
<script src="lib/bindings/utils.js"></script>
<link crossorigin="anonymous" href="https://cdnjs.cloudflare.com/ajax/libs/vis-network/9.1.2/dist/dist/vis-network.min.css" integrity="sha512-WgxfT5LWjfszlPHXRmBWHkV2eceiWTOBvrKCNbdgDYTHrT2AeLCGbF4sZlZw3UMN3WtL0tGUoIAKsu8mllg/XA==" referrerpolicy="no-referrer" rel="stylesheet"/>
<script crossorigin="anonymous" integrity="sha512-LnvoEWDFrqGHlHmDD2101OrLcbsfkrzoSpvtSQtxK3RMnRV0eOkhhBN2dXHKRrUU8p2DGRTk35n4O8nWSVe1mQ==" referrerpolicy="no-referrer" src="https://cdnjs.cloudflare.com/ajax/libs/vis-network/9.1.2/dist/vis-network.min.js"></script>
<center>
<h1></h1>
</center>

<!-- <link rel="stylesheet" href="../node_modules/vis/dist/vis.min.css" type="text/css" />
<script type="text/javascript" src="../node_modules/vis/dist/vis.js"> </script>-->
<link
href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css"
rel="stylesheet"
integrity="sha384-eOJMYsd53ii+scO/bJGFsiCZc+5NDVN2yr8+0RDqr0Ql0h+rP48ckxlpbzKgwra6"
crossorigin="anonymous"
/>
<script
src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"
integrity="sha384-JEW9xMcG8R+pH31jmWH6WWP0WintQrMb4s7ZOdauHnUtxwoG2vI5DkLtS3qm9Ekf"
crossorigin="anonymous"
></script>


<center>
<h1></h1>
</center>
<style type="text/css">
<link crossorigin="anonymous" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" integrity="sha384-eOJMYsd53ii+scO/bJGFsiCZc+5NDVN2yr8+0RDqr0Ql0h+rP48ckxlpbzKgwra6" rel="stylesheet"/>
<script crossorigin="anonymous" integrity="sha384-JEW9xMcG8R+pH31jmWH6WWP0WintQrMb4s7ZOdauHnUtxwoG2vI5DkLtS3qm9Ekf" src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>
<center>
<h1></h1>
</center>
<style type="text/css">

#mynetwork {
width: 100%;
Expand All @@ -52,22 +37,13 @@ <h1></h1>


</style>
</head>


<body>
<div class="card" style="width: 100%">


<div id="mynetwork" class="card-body"></div>
</div>



<div id="config"></div>


<script type="text/javascript">
</head>
<body>
<div class="card" style="width: 100%">
<div class="card-body" id="mynetwork"></div><div id="code_section" style="position: absolute;width: 30%;font-family: monospace;top: 0; left: 0;z-index: 1;font-size: 13;background-color: #fff6a8;font-color: #000000;display: none;border: 1px solid black;resize: both;overflow: auto;"><pre style="width: 100%; height: 100%;white-space: pre;background-color: #fff6a8;"></pre></div>
</div>
<div id="config"></div>
<script type="text/javascript">

// initialize global variables.
var edges;
Expand Down Expand Up @@ -176,5 +152,17 @@ <h1></h1>
}
drawGraph();
</script>
</body>
<script>network.on('select', function(){
document.querySelector("#code_section").style.display="none";
document.querySelector("#code_section pre").textContent = ""
if (network.getSelectedNodes()) {
const selectedNode = network.getSelectedNodes()[0];
if (allNodes[selectedNode]) {
document.querySelector("#code_section").style.display="block";
document.querySelector("#code_section pre").textContent =
JSON.stringify(JSON.parse(allNodes[selectedNode].stix), null, 2);
}
}
})
</script></body>
</html>

0 comments on commit 4132e38

Please sign in to comment.