Skip to content

Commit

Permalink
fix: correct dataflow debug vis (#7050)
Browse files Browse the repository at this point in the history
  • Loading branch information
domoritz authored Nov 18, 2020
1 parent fb12778 commit 3467506
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/compile/data/debug.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@ export function printDebugDataflow(node: DataFlowNode) {
export function drawDataflow(roots: readonly DataFlowNode[], size = 500) {
const dot = dotString(roots);
const text = new TextEncoder().encode(dot);
const compressed = pako.deflate(text, {level: 9, to: 'string'});
const result = btoa(compressed).replace(/\+/g, '-').replace(/\//g, '_');
const imageURL = `https://kroki.io/plantuml/png/${result}`;
const compressed = pako.deflate(text, {level: 9});
const result = Buffer.from(compressed).toString('base64').replace(/\+/g, '-').replace(/\//g, '_');
const imageURL = `https://kroki.io/graphviz/png/${result}`;
console.log('Dataflow visualization: ', imageURL);
console.log('%c ', `font-size:${size}px; background:url(${imageURL}) no-repeat; background-size:contain`);
}

Expand Down

0 comments on commit 3467506

Please sign in to comment.