Permalink
Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
55 lines (36 sloc) 1.16 KB

jupyterlab-chart-editor

Binder

A JupyterLab extension for creating and editing Plotly charts, based on https://github.com/plotly/react-chart-editor

Prerequisites

  • JupyterLab >= 0.34
  • plotly.py >= 3.3.0

Install

jupyter labextension install jupyterlab-chart-editor

Usage

Create and display a figure

import plotly.graph_objs as go
import plotly.io as pio

fig = go.FigureWidget()
fig.add_scatter(y=[2, 4, 3, 2.5])
fig

Write figure to JSON

pio.write_json(fig, 'scatter.plotly')

Right-click scatter.plotly from the file menu and open with "Plotly Editor". Make some changes to the figure, then use the file menu to save as scatter-styled.plotly.

Then import scatter-styled.plotly back into plotly.py

fig_styled = pio.read_json('scatter-styled.plotly', output_type='FigureWidget')
fig_styled

Uninstall

jupyter labextension uninstall jupyterlab-chart-editor