| 258 | ]; |
| 259 | |
| 260 | const run = i => { |
| 261 | const pass = insightPasses[i]; |
| 262 | if (!pass) { |
| 263 | console.log('complete'); |
| 264 | return; |
| 265 | } |
| 266 | |
| 267 | const { insight, name } = pass; |
| 268 | const context = { specColumns: getSpecColumns(insight, columns), insight, specViewOptions }; |
| 269 | const specResult = build(context, data); |
| 270 | |
| 271 | if (specResult.errors) { |
| 272 | console.log(errors); |
| 273 | } else { |
| 274 | const runtime = vega.parse(specResult.vegaSpec); |
| 275 | const vegaView = new vega.View(runtime); |
| 276 | const startTime = new Date(); |
| 277 | vegaView.runAsync().then(() => { |
| 278 | const stopTime = new Date(); |
| 279 | console.log(`${name} done in ${stopTime - startTime}`); |
| 280 | |
| 281 | // const d0 = specResult.vegaSpec.data[0]; |
| 282 | // delete d0.values; |
| 283 | // d0.url = "https://sanddance.js.org/sample-data/demovote.tsv"; |
| 284 | // d0.format = { |
| 285 | // "parse": "auto", |
| 286 | // "type": "tsv" |
| 287 | // }; |
| 288 | //writeFileSync(`${name}.vg.json`, JSON.stringify(specResult.vegaSpec, null, 2), 'utf8'); |
| 289 | |
| 290 | run(++i); |
| 291 | }).catch(e => { |
| 292 | console.log(`${name} error ${e}`); |
| 293 | }); |
| 294 | } |
| 295 | }; |
| 296 | |
| 297 | run(0); |
| 298 | }); |
no test coverage detected