Skip to content

Commit

Permalink
fix: fix base64 encoding to debug dataflow graphs (#7483)
Browse files Browse the repository at this point in the history
  • Loading branch information
domoritz authored May 19, 2021
1 parent 69e1195 commit e5a5452
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/compile/data/debug.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ 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});
const result = Buffer.from(compressed).toString('base64').replace(/\+/g, '-').replace(/\//g, '_');
const result = btoa(String.fromCharCode.apply(null, compressed)).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 e5a5452

Please sign in to comment.