github nteract/nteract v0.0.8
Anaxial Anaximander

latest releases: @nteract/monaco-editor@5.0.7, @nteract/monaco-editor@5.0.6, @nteract/stateful-components@1.7.15...
pre-release7 years ago

Mega Alpha Release!

Support for direct GeoJSON

Python:

import IPython
import json

def geojson(data):
  bundle = {}
  bundle['application/vnd.geo+json'] = data
  IPython.display.display(bundle, raw=True)

import requests
coffee = requests.get("https://bit.ly/coffeeDC").json()

geojson(coffee)

screen shot 2016-09-09 at 10 54 22 am

Direct Plotly support

import IPython
import json

def plotize(data, layout=None):
  """Plot with Plotly.js using the Plotly JSON Chart Schema

  http://help.plot.ly/json-chart-schema/
  """
  if layout is None:
    layout = {}

  bundle = {}
  bundle['application/vnd.plotly.v1+json'] = {
    'data': data,
    'layout': layout,
  }

  IPython.display.display(bundle, raw=True)

data = [
  {'x': [1999, 2000, 2001, 2002], 'y': [10, 15, 13, 17], 'type': 'scatter'},
  {'x': [1999, 2000, 2001, 2002], 'y': [16, 5, 11, 9], 'type': 'scatter'}
]

layout = {
  'title': 'How is Plotting, really?',
  'xaxis': { 'title': 'Year', 'showgrid': False, 'zeroline': False },
  'yaxis': { 'title': 'Percent', 'showline': False }
}

plotize(data, layout)

screen shot 2016-09-09 at 10 57 00 am

If you have plotly.py, you can also use plotly.py data and layout tricks using their encoder:

def plotize(data, layout=None):
  """Plot with Plotly.js using the Plotly JSON Chart Schema

  http://help.plot.ly/json-chart-schema/
  """
  if layout is None:
    layout = {}

  redata = json.loads(json.dumps(data, cls=plotly.utils.PlotlyJSONEncoder))
  relayout = json.loads(json.dumps(layout, cls=plotly.utils.PlotlyJSONEncoder))

  bundle = {}
  bundle['application/vnd.plotly.v1+json'] = {
    'data': redata,
    'layout': relayout,
  }

  IPython.display.display(bundle, raw=True)

Stability fixes

We've got some of those.

Don't miss a new nteract release

NewReleases is sending notifications on new releases.