Skip to content

dwillmer/jupyter-js-output-area

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jupyter-js-output-area

Javascript APIs for Jupyter output areas

Demo

Run from /demo/data directory:

python server.py

Then load ./demo/demo.html.

Install

Stable (npm):

npm install jupyter-js-output-area

Dev install

git clone https://github.com/jupyter/jupyter-js-output-area.git
cd jupyter-js-output-area

To build

npm install
npm run build

API

Consumer

To display a Jupyter output area, you need to instantiate an output model and an output view, in that order.

import {OutputModel, OutputView} from 'jupyter-js-output-area';
let model = new OutputModel();
let view = new OutputView(model, document);

You can then display the output by appending it to your document.

document.querySelector('body').appendChild(view.el);

To have the output area display actual outputs, you can either pass it full Jupyter msgs

model.consumeMessage(msg);

or set the state directly

model.state = state;

You can save the state by accessing the same property

state = model.state;

Dev

TODO: Describe how to write custom models and views.

About

Javascript APIs for Jupyter output areas

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 69.0%
  • Python 17.2%
  • HTML 13.8%