Skip to content

Commit

Permalink
chore: Fix README.md migration example
Browse files Browse the repository at this point in the history
Signed-off-by: Gordon Smith <GordonJSmith@gmail.com>
  • Loading branch information
GordonSmith committed Dec 8, 2023
1 parent da81597 commit b606dc8
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,15 @@ v2.x.x
```ts
import { Graphviz } from "@hpcc-js/wasm";

async function render() {
const graphviz = await Graphviz.load();
console.log(graphviz.dot('digraph G { Hello -> World }'));
}
const dot = "digraph G { Hello -> World }";

render();
Graphviz.load().then(graphviz => {
const svg = graphviz.dot(dot);
const div = document.getElementById("placeholder");
div.innerHTML = svg;

console.log(graphviz.version());
});
```

Notes:
Expand Down

0 comments on commit b606dc8

Please sign in to comment.