Git Product home page Git Product logo

ijs's Introduction

ijs - Interactive JavaScript

An environment for interactive authoring and executing JavaScript code using a notebook metaphor, built on top of IPython.

An ijs notebook is powered by a javascript kernel written in node.js (and replaces the standard python kernel). A kernel runs behind the scenes and executes the code you write in notebooks. The notebook displays the outputs generated by your code.

You can use node.js APIs, as well as the large library of node.js modules in your notebooks. You can also author client-side HTML and JavaScript to run code within the browser. JavaScript is truly universal!

Hello World using node.js APIs and qr-image node module

Getting Started

You can use ijs by installing it as a node module, or via a pre-packaged docker container.

Local Installation

You can install the ijs node module globally and start the notebook environment using the ijs command.

sudo npm install -g ijs
ijs <path to working directory>

Then browse to http://localhost:9999.

The tool will create a notebooks directory within the specified working directory.

Note: If you don't already have node.js and IPython installed, you'll need to do so first. Unfortunately setting these up can be a bit involved. This page might help: http://ipython.org/install.html ... as of right now ijs requires IPython v2.4.1. Support for 3.x is coming.

Docker

This avoids the need to go through the steps of getting a local setup. As long as you've got a working docker setup (using boot2docker on a mac), you're good to go. Just issue the following commands:

docker pull nikhilk/ijs
docker run -i -p 9999:9999 -v <path to working directory>:/data -t nikhilk/ijs

And then browse to http://localhost:9999 and you're on your way.

Screenshots

Authoring Async Code

Lots of node.js APIs are async, and you can write async code in notebook cells too! Hello World - Async Edition

Working with JSON

JSON is everywhere, and you can use a %%json cell to easily declare JSON data. The notebook provides auto-complete functionality which extends to this JSON data. JSON Data

HTTP requests

You can use the notebook interface to experiment with HTTP APIs using the HTTP client provided by request node module. HTTP Requests

Client-script

You can easily add HTML markup to your notebook using an %%html cell and client-script using a %%script block to use a variety of javascript libraries such as d3.js. HTML, JavaScript, d3.js

ijs's People

Contributors

nikhilk avatar

Stargazers

 avatar Albert Rodriguez avatar Michael Szul avatar Aashutosh Rathi avatar Heet Sankesara avatar Aleksei Tcelishchev avatar Abhimanyu Aryan avatar  avatar Anil Nair avatar Jagadeesha avatar  avatar Saul Shanabrook avatar Adrian avatar Egor Rudinsky avatar Ezra Lalonde avatar roll avatar Don Morehouse avatar Pablo Carballo avatar Don Jayamanne avatar マコトサン avatar Quiz Chu avatar Uoc Nguyen avatar Mike Vegeto avatar Manuel Alabor avatar Lailo avatar Cédric Artigue avatar Yufei Li avatar hackrole avatar Hamza Faran avatar Marcel Belledin avatar  avatar Anu Joy avatar Hans Olav Melberg avatar Jas Sohi avatar Felix Fischer avatar javier abanses avatar Will Sahatdjian avatar Mike avatar Angus H. avatar Michael Anthony avatar Ernest He avatar Kane Blueriver avatar LarreaMikel avatar Michael Hart avatar Ronak Raithatha avatar Paul Shahid avatar Guido Vettoretti avatar Georgiy Pankov avatar Nicolas Riesco avatar  avatar Michael Recachinas avatar Jared Forsyth avatar Kevin Burke avatar Travis Swicegood avatar Noam  Vergain avatar

Watchers

Noam  Vergain avatar James Cloos avatar Aleksei Tcelishchev avatar Michael Anthony avatar Athan avatar Guido Vettoretti avatar Nicolas Riesco avatar Jens avatar

ijs's Issues

Render D3 or ECharts

Hi,

Great job!
How I can render json data as: table, bar, pivottable with D3, echarts or pivottable.js ?

May I have to build everything as string setting the "$$html$$" variable?

Thanks in advance.

Update docker image with latest LTS version

I am running ijs as a docker container and found it very useful to explore APIs and show demos. I would like to have the latest node LTS version available there (or multiple tags of the image based on different versions of node). Currently there is v0.10.29, and I would like to use 4.4.0 or 6.9.1.

# node -v
v0.10.29

Add to IPython wiki

Hi @nikhilk, and first thanks to share your project on github. I'm really interested in using ipython notebooks for javascript for my students next year, and your implementation seems quite valuable for my needs with both js on front and backend.

Maybe you know that there is another project implementing a javascript kernel for ipython/jupyter, it's named ijavascript and it is listed in the ipython wiki, maybe you could add you're project to the wiki to give it more visibility.

Console.logging from async mode

hey, thanks for working on this project! it's super neat.

I'm trying to do an async call and then print some data to the terminal, and I'm a little confused by the example. Boiled down, something like this:

setTimeout(function() { console.log("hello!"); }, 3000);

How would I get that console output to show in iPython?

Thanks!
Kevin

shortcuts with %%

When I try to do something like this in a code block:

%%html
<div id="table"></div>

I get an error:

SyntaxError: Unexpected token %
    at Object.exports.runInThisContext (vm.js:53:16)
    at run ([eval]:214:19)
    at doRunRequest ([eval]:122:22)
    at onMessage ([eval]:78:17)
    at emitTwo (events.js:87:13)
    at process.emit (events.js:172:7)
    at handleMessage (internal/child_process.js:689:10)
    at Pipe.channel.onread (internal/child_process.js:440:11)

I tried with node v5.4 and v0.10

Unable to export as JS

First off thanks you very much for this. Its so useful.

When tryin to export the source as a JS file, by doing the below operation,
ijserror

I end up with:
screen shot 2016-07-29 at 9 23 10 am

JSON magic cells not working

I'm using the following code from your JSON notebook and I'm getting the error below. I don't know if this is related to #6 so I thought I'd file a newer issue about it. Versions are listed at the end of the report.

%%json --name data
{
  "text": "foo bar",
  "number": 123,
  "flag": true,
  "items": [
    { "t": 100, "value": 3 },
    { "t": 100, "value": 4 }
  ]
}
evalmachine.<anonymous>:1
%%json --name data
^
SyntaxError: Unexpected token %
    at Object.exports.runInThisContext (vm.js:53:16)
    at run ([eval]:617:19)
    at onRunRequest ([eval]:388:22)
    at onMessage ([eval]:356:17)
    at emitTwo (events.js:106:13)
    at process.emit (events.js:191:7)
    at handleMessage (internal/child_process.js:718:10)
    at Pipe.channel.onread (internal/child_process.js:444:11)
[17:58:15] carlos@rivendell ijs-exp 715$ ijsnotebook --versions
ijavascript 5.0.19
jmp 0.7.5
jp-kernel 0.1.3
nel 0.5.3
uuid 3.0.1
zeromq 4.2.1

Allow/parse // comments

I have to put '#' at the beginning of the line to write a comment, which doesn't seem valid.

cannot find module 'acorn/acorn'

This one is very strange. I keep getting the following error message:

The IPython Notebook is running at: http://[all ip addresses on your system]:9999/
Shutdown this notebook server (y/[n])? WARNING:root:kernel f8e660a0-5f89-462e-911e-65d48ac2aebd restarted

module.js:340
    throw err;
          ^
Error: Cannot find module 'acorn/acorn'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at exports.toString (/home/ge/ijs/node_modules/tern/lib/infer.js:17:25)
    at Object.<anonymous> (/home/ge/ijs/node_modules/tern/lib/infer.js:22:3)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
^C[C 14:23:13.108 NotebookApp] received signal 2, stopping

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.