Skip to content

Commit

Permalink
Using sync api instead of async for viz.js. (#108)
Browse files Browse the repository at this point in the history
  • Loading branch information
maziac committed Feb 25, 2023
1 parent 6cb1997 commit b3e68dc
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/disassembler/renderbase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import {SmartDisassembler} from "./smartdisassembler";
import {Subroutine} from "./core/subroutine";

// From: https://github.com/aduh95/viz.js
//const renderGraphviz = require('@aduh95/viz.js/sync'); // I couldn't transfer this into an "import" statement
const dot2svg = require("@aduh95/viz.js/async");
//const dot2svg = require("@aduh95/viz.js/async");
const dot2svg = require("@aduh95/viz.js/sync");


/** Base class with common functions for RenderFlowChart, RenderCallGraph and RenderText (RenderHtml)
Expand Down Expand Up @@ -219,8 +219,10 @@ export class RenderBase {
protected async renderLines(lines: string[]): Promise<string> {
const text = lines.join('\n');

// Render
let rendered = await dot2svg(text);
// Render (the async api has a problem when usin in a vsix, probably because of esbuild)
//let rendered = await dot2svg(text);
let rendered = dot2svg(text);

// Adjust
rendered = this.adjustSvg(rendered);

Expand Down

0 comments on commit b3e68dc

Please sign in to comment.