-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
774d471
commit ace19bd
Showing
10 changed files
with
554 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# Contributing | ||
|
||
## Development install | ||
|
||
Note: You will need `markdownify`, `autodoc-traits`, `sphinx` to generate the code | ||
|
||
The `jlpm` command is JupyterLab's pinned version of | ||
[yarn](https://yarnpkg.com/) that is installed with JupyterLab. You may use | ||
`yarn` or `npm` in lieu of `jlpm` below. | ||
|
||
```bash | ||
# Clone the repo to your local environment | ||
# Change directory to the ipecharts directory | ||
# Install package in development mode | ||
pip install -e "." | ||
# Link your development version of the extension with JupyterLab | ||
jupyter labextension develop . --overwrite | ||
# Rebuild extension Typescript source after making changes | ||
jlpm build | ||
``` | ||
|
||
You can watch the source directory and run JupyterLab at the same time in different terminals to watch for changes in the extension's source and automatically rebuild the extension. | ||
|
||
```bash | ||
# Watch the source directory in one terminal, automatically rebuilding when needed | ||
jlpm watch | ||
# Run JupyterLab in another terminal | ||
jupyter lab | ||
``` | ||
|
||
With the watch command running, every saved change will immediately be built locally and available in your running JupyterLab. Refresh JupyterLab to load the change in your browser (you may need to wait several seconds for the extension to be rebuilt). | ||
|
||
By default, the `jlpm build` command generates the source maps for this extension to make it easier to debug using the browser dev tools. To also generate source maps for the JupyterLab core extensions, you can run the following command: | ||
|
||
```bash | ||
jupyter lab build --minimize=False | ||
``` | ||
|
||
### Development uninstall | ||
|
||
```bash | ||
pip uninstall ipecharts | ||
``` | ||
|
||
In development mode, you will also need to remove the symlink created by `jupyter labextension develop` | ||
command. To find its location, you can run `jupyter labextension list` to figure out where the `labextensions` | ||
folder is located. Then you can remove the symlink named `ipecharts` within that folder. | ||
|
||
### Packaging the extension | ||
|
||
See [RELEASE](RELEASE.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,139 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "e1cb5ebc-28e1-4839-87d6-d0fd9cb6991c", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"from ipecharts.echarts import EChartsWidget, EChartsRawWidget\n", | ||
"import json\n", | ||
"import numpy\n", | ||
"from ipecharts.option import Option, XAxis, YAxis, Legend, Tooltip\n", | ||
"from ipecharts.option.series import Bar\n", | ||
"from ipywidgets.widgets import Button" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "2ae706ab-ae66-49ec-b389-edddea804671", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"line = Bar()\n", | ||
"line2 = Bar()\n", | ||
"option = Option(\n", | ||
" xAxis=XAxis(type=\"category\"),\n", | ||
" yAxis=YAxis(type=\"value\"),\n", | ||
" series=[line, line2],\n", | ||
" tooltip=Tooltip(),\n", | ||
" legend=Legend()\n", | ||
")\n", | ||
"line.data = [1.,4.6,3.,6,4,7,9,3,9,3]\n", | ||
"line2.data = [10.,2.6,13.,4,7,2,5,13,9,5]" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "a83f0754-facd-4e7f-bd91-d2566dfcc77d", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"chart = EChartsWidget(option=option)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "81f3047b-51f2-4975-b81d-99a35373c01e", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"chart" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "530683e3-0386-4262-9df0-460500250dbf", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"def callback(params):\n", | ||
" print('####', params)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "1dbbf62c-84be-4b31-a3ab-ddef9bc5dd84", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"chart.on('click', None, callback)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "089c9319-f8d5-4156-a9b6-3a566be6a407", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"chart.off('click')" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "4b928fa5-1e4c-4c4a-8c6d-8d9e7977315d", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"chart.on('mouseover', {'seriesIndex': 1}, callback)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "05b541b9-470e-499b-97ce-c815e5b43e1e", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"chart.off('mouseover')" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "9b819710-aad2-4294-9d7b-a87c7d116fe4", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3 (ipykernel)", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.10.15" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 5 | ||
} |
Oops, something went wrong.