Skip to content

Commit

Permalink
fix: Raw git demo fails
Browse files Browse the repository at this point in the history
Signed-off-by: Gordon Smith <[email protected]>
  • Loading branch information
GordonSmith committed Nov 26, 2022
1 parent 2ef9ec2 commit 69ec4d5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@
/tmp
/types
/vcpkg
.coveralls.yml
*.tsbuildinfo
4 changes: 2 additions & 2 deletions index-worker.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//import { Graphviz } from "https://cdn.jsdelivr.net/npm/@hpcc-js/wasm/dist/graphviz.js";
import { Graphviz } from "./dist/index.js";
import { Graphviz } from "https://cdn.jsdelivr.net/npm/@hpcc-js/wasm/dist/graphviz.js";
// import { Graphviz } from "./dist/index.js";

onmessage = async e => {
const graphviz = await Graphviz.load();
Expand Down
13 changes: 8 additions & 5 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@
<h3>ESM</h3>
<div id="ESM"></div>
<script type="module">
// import { Graphviz } from "https://cdn.jsdelivr.net/npm/@hpcc-js/wasm/dist/index.js";
import { Graphviz } from "./dist/index.js";
import { Graphviz } from "https://cdn.jsdelivr.net/npm/@hpcc-js/wasm/dist/index.js";
// import { Graphviz } from "./dist/index.js";
if (Graphviz) {
const graphviz = await Graphviz.load();
const svg = graphviz.layout(dot, "svg", "dot");
Expand All @@ -70,7 +70,8 @@ <h3>ESM</h3>
<hr>
<h3>UMD</h3>
<div id="UMD"></div>
<script src="./dist/index.umd.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@hpcc-js/wasm/dist/graphviz.umd.js"></script>
<!-- <script src="./dist/index.umd.js"></script> -->
<script>
var hpccWasm = window["@hpcc-js/wasm"];
hpccWasm.Graphviz.load().then(graphviz => {
Expand All @@ -92,7 +93,8 @@ <h3>Web Worker</h3>
<h3>Image</h3>
<div id="image"></div>
<script type="module">
import { Graphviz } from "./dist/index.js";
import { Graphviz } from "https://cdn.jsdelivr.net/npm/@hpcc-js/wasm/dist/index.js";
// import { Graphviz } from "./dist/index.js";
if (Graphviz) {
const graphviz = await Graphviz.load();
const svg = graphviz.neato('digraph { a[image="https://www.google.com/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png"]; }', "svg", { images: [{ path: "https://www.google.com/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png", width: "272px", height: "92px" }] });
Expand All @@ -103,7 +105,8 @@ <h3>Image</h3>
<h3>Image 2</h3>
<div id="image2"></div>
<script type="module">
import { Graphviz } from "./dist/index.js";
import { Graphviz } from "https://cdn.jsdelivr.net/npm/@hpcc-js/wasm/dist/index.js";
// import { Graphviz } from "./dist/index.js";
if (Graphviz) {
const graphviz = await Graphviz.load();
const svg = graphviz.neato('digraph { a[image="./resources/hpcc-logo.png"]; }', "svg", { images: [{ path: "./resources/hpcc-logo.png", width: "272px", height: "92px" }] });
Expand Down

0 comments on commit 69ec4d5

Please sign in to comment.