Skip to content

Commit

Permalink
Fix GraphViz, pin version
Browse files Browse the repository at this point in the history
  • Loading branch information
pamelafox committed Aug 3, 2024
1 parent 16c1779 commit 1b015f0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ <h1>Visualize a recursive function</h1>

</div>
<!-- GraphViz WASM -->
<script src="https://cdn.jsdelivr.net/npm/@hpcc-js/wasm/dist/graphviz.umd.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@hpcc-js/wasm@2.18.0/dist/graphviz.umd.js"></script>
<!-- Python WASM -->
<script src="https://cdn.jsdelivr.net/pyodide/v0.19.0/full/pyodide.js"></script>
<!-- Form functionality-->
Expand Down Expand Up @@ -140,7 +140,7 @@ <h1>Visualize a recursive function</h1>
<script type="module">
import {RecursiveTreeViz} from './javascript/recursive_tree_viz.js';

var hpccWasm = window["@hpcc-js/wasm"];
var GraphViz = window["Graphviz"];
var pyodide;

function computeVisualization() {
Expand All @@ -149,7 +149,7 @@ <h1>Visualize a recursive function</h1>
const functionCall = document.getElementById('function-call-input').value;
const dotGraph = pyodide.runPython(`visualize('''${functionDef}''', '''${functionCall}''')`);
document.getElementById("visualize-status").innerHTML = "Rendering call graph...";
hpccWasm.Graphviz.load().then(graphviz => {
GraphViz.load().then(graphviz => {
const div = document.getElementById("placeholder");
div.innerHTML = graphviz.layout(dotGraph, "svg", "dot");
new RecursiveTreeViz(div.querySelector('svg')).draw()
Expand Down

0 comments on commit 1b015f0

Please sign in to comment.