Skip to content

📊 Using JSDOM to render Observable Plots on the command line

License

Notifications You must be signed in to change notification settings

hrbrmstr/ojs-plot-jsdom

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ojs-plot-jsdom

How to use server-side Observable Plot with just vanilla Node.js.

The example in index.js adds a title and subtitle to the plot as SVG text elements to keep the whole thing self-contained. Support for auto-adapting to dark mode appearance is also included.

Normal Run

npm run --silent plot > roci.svg

roci

Svgo optimized:

# install svgo if necessary
npm install -g svgo

npm run --silent plot | svgo --pretty --indent 2 -i - -o roci-svgo.svg 

roci

About

📊 Using JSDOM to render Observable Plots on the command line

Topics

Resources

License

Stars

Watchers

Forks