From 843e88636481c6bf2ee5ec2e634bd4320c7d714f Mon Sep 17 00:00:00 2001 From: Kenneth Shaw Date: Tue, 23 Jan 2024 06:09:30 +0700 Subject: [PATCH] Cleaning up vegagoja.js --- vegagoja.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/vegagoja.js b/vegagoja.js index 21c181a..5931c2f 100644 --- a/vegagoja.js +++ b/vegagoja.js @@ -36,7 +36,7 @@ function version() { } function compile(logf, spec) { - var res = {}; + let res; try { res = vegaLite.compile(parse(spec), { logger: logger(logf), @@ -51,7 +51,7 @@ function compile(logf, spec) { function loader(logf, loadf) { return { async load(name, res) { - var s = ""; + let s; try { s = loadf(name, res.response); } catch (e) { @@ -93,8 +93,8 @@ function loader(logf, loadf) { } async function render(logf, spec, loadf) { - var runtime = vega.parse(parse(spec)); - var view = new vega.View(runtime, { + let runtime = vega.parse(parse(spec)); + let view = new vega.View(runtime, { logLevel: vega.Debug, logger: logger(logf), loader: loader(logf, loadf),