This template repository gets you started with a very simple observable plot that looks like this:
The plot isn't much, but this repository's main job is to set up a typescript environment so that you can start hacking on your graph without any hassle.
- Clone this repo
npm install
make watch
If the install was succesful, make watch
will open a tab in your browser to a
web page showing an observable plot, and it will watch src/index.ts
for
changes and rebuild it if there are any.
- a modern nodejs environment (tested with version 20)
- gnu make
I use make
tasks instead of npm run
commands because tsc builds can get quite slow once your file gets larger.
This repo has three targets you'll want to use:
make all
: build the production file and save it todist/index.js
make watch
:- watches
src/index.ts
for changes and recompiles it when there are changes (using nodemon) - serves
index.html
on a web server using http-server
- watches
make ci
: run eslint. There's a github action that runs this task for you on pushes
- tsc for typechecking
- esbuild for compilation
- eslint for linting
- prettier for formatting
- make for running tasks and managing compilation
- github actions for running lint on code changes
- http-server for serving the site in development
- nodemon for watching files for changes