An example using VS Code for interactive coding and plotting
npm install
# You may also need to do this for the plots...
npx playwright install
demo-overview.mov
demo-interactive-repl.mov
- Open the
index.js
file - Press F5 to launch in debug mode
- Go to
View > Debug Console
to view the output - Step through the debugger to the various steps
- Adjust the arquero query in the REPL and see the result
- View the plot
The .vscode/launch.json
config file will run whatever file is currently in view in debug mode, which means it stops whenever it encounters a debugger
line.
When your script is in a final state, you can simply execute it with node index.js
and it will skip over the debugger
statements.
In this example, we analyze data of Olympic gold medalists, launch a bar chart of the top 10 countries and also write that chart to a PNG.
Tip
If you haven't set up your launch.json
file to use F5, you can also launch a script in debugger mode using the --inspect
flag, e.g. node --inspect index.js
.
The UX of the VS Code REPL is not ideal and does not match the Google Chrome behavior. The issue is tracked here but is in the backlog.
It would also be nice if you could drag the REPL input area to be taller.