-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Switch to use anywidget #4823
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Switch to use anywidget #4823
Changes from 77 commits
Commits
Show all changes
86 commits
Select commit
Hold shift + click to select a range
8a148f2
Switch to use anywidget
e21e3d7
Merge branch 'master' of github.com:plotly/plotly.py into anywidget
marthacryan d5d245c
Merge branch 'remove-requirejs' of github.com:plotly/plotly.py into a…
marthacryan 6355ee4
Add package.json esbuild command and update test requirements to incl…
marthacryan 3abdc7f
Call bundle command in the CI
marthacryan 88b327e
Fix filepath
marthacryan 70d536f
Move js stuff to plotly
manzt 3b9c192
Cleanup tsconfig and types for build
manzt a338e6f
Ignore bundle
manzt aaefdaf
Keep bundle in MANIFEST.in
manzt ebba1c5
Restore package/* from master
manzt 6d2a372
Update target
manzt b27643d
Add anywidget comment
manzt d4277ac
Merge branch 'master' of github.com:plotly/plotly.py into anywidget
marthacryan e7b6d7a
Add warning message when notebook version < 7 is used
marthacryan 590a4db
Move files under python/plotly
marthacryan cd7d587
remove old javascript and fix install
marthacryan 4f2ce95
Remove nbextension
marthacryan cc77778
Reset changes to circleci
marthacryan 23f387a
Merge branch 'master' of github.com:plotly/plotly.py into anywidget
marthacryan c53835e
Undo changes to CHANGELOG
marthacryan 0c9ffc9
Revert changes to javascript directory
marthacryan 0f16f0c
remove all jupyter extension code
marthacryan d1e24db
Add jsdeps to ci config
marthacryan 5eff0ca
Merge branch 'anywidget' of github.com:marthacryan/plotly.py into dro…
marthacryan 195ea4e
Merge with master
marthacryan ce96898
Add dep on anywidget
marthacryan a3d8650
Update error messages when anywidget isn't installed
marthacryan 3bc3535
Update docstring
marthacryan b5870e8
Update test to rely on installation of anywidget rather than version
marthacryan 9302d29
Rename widget test
marthacryan a60e803
Black
marthacryan 54d9fe4
Update setup.py to include both widget and jupyterlab extension build
marthacryan 204b052
fix filepath of jupyterlab extension root
marthacryan 263ef26
Update circleci config to include both widget and jupyterlab extensio…
marthacryan 846e7b5
Fix formatting of config file
marthacryan 08d8052
Update circleci config to include both widget and jupyterlab extensio…
marthacryan 28b27af
revert changes to pypi build
marthacryan eb70d86
Black
marthacryan a911f53
Remove extra call to setup.py
marthacryan 2a7208f
Add jsdeps call to optional tests
marthacryan 45fca22
Move jsdeps call to core tests
marthacryan cae0088
Reset javascript file
marthacryan 93210e6
Move jsdeps to an earlier step
marthacryan f553634
Move jsdeps to an earlier step
marthacryan 7664ac9
Merge branch 'master' of github.com:plotly/plotly.py into anywidget
marthacryan 3578bac
Call npm run build directly in circle ci config
marthacryan 0920b9d
restore changes to setup.py
marthacryan 2dbdcea
Reset widget version
marthacryan 612ceec
Merge with anywidget branch
marthacryan cb488ff
Remove npm from release instructions
marthacryan 4096595
Remove more references to jupyterlab-plotly
marthacryan 20886ef
Resolve ci failures
marthacryan f8fe306
Merge with anywidget
marthacryan 35f848b
Fix filepath of bundled js
marthacryan 3f6c8f7
Fix filepath to js bundle in setup.py
marthacryan 5b97f05
Install before running npm build in ci
marthacryan 3b94298
Merge branch 'anywidget' of github.com:plotly/plotly.py into drop-not…
marthacryan 513798b
Remove npm pack of jupyterlab extension
marthacryan cede4e1
Remove requirement for ipywidgets
marthacryan a80250d
Move build step of js
marthacryan 99013dc
Move widget bundle to package_data
marthacryan 4ab2a0c
Update path in gitignore
marthacryan 39e65af
Merge branch 'anywidget' of github.com:plotly/plotly.py into drop-not…
marthacryan 25cbf52
Merge branch 'anywidget' of github.com:plotly/plotly.py into drop-not…
marthacryan 8e3354d
Update path of bundle in setup.py
marthacryan 60cc98f
update contributing to include new build instructions
marthacryan ce607bb
Merge branch 'master' of github.com:plotly/plotly.py into anywidget
marthacryan 3d2a234
Merge branch 'anywidget' of github.com:plotly/plotly.py into drop-not…
marthacryan 6d29ba6
Fix issues with vscode
marthacryan 21fa7d0
Update to include lodash-es in package.json
marthacryan 4bb303c
remove unnecessary global define
marthacryan 4759697
Merge with anywidget
marthacryan e399c2d
Pin anywidget version in test requirements
marthacryan f6f2691
Remove more references to old jupyter support from README
marthacryan ee67f2e
Merge pull request #4822 from plotly/drop-notebook-6
marthacryan 97d6cb1
Merge branch 'master' of github.com:plotly/plotly.py into anywidget
marthacryan 7f241f3
Merge branch 'master' of github.com:plotly/plotly.py into anywidget
marthacryan dc87b3c
Create util for display jupyter version warnings and update imports
marthacryan 22d90c4
Remove deprecated code
marthacryan bee13cd
Update jupyter version warnings to import jupyterlab later
marthacryan 946590f
Merge with master
marthacryan 3a85b8a
Switch to npm ci instead of npm i
marthacryan fc8eff2
Move warnings out of utils file to avoid psutils import error
marthacryan c65ca44
Fix import paths for new location of util
marthacryan 6d3f0a7
Remove unused import
marthacryan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 |
---|---|---|
|
@@ -37,13 +37,10 @@ | |
</a> | ||
</div> | ||
|
||
|
||
## Quickstart | ||
|
||
`pip install plotly==5.24.1` | ||
|
||
Inside [Jupyter](https://jupyter.org/install) (installable with `pip install "jupyterlab>=3" "ipywidgets>=7.6"`): | ||
|
||
```python | ||
import plotly.express as px | ||
fig = px.bar(x=["a", "b", "c"], y=[1, 3, 2]) | ||
|
@@ -52,7 +49,6 @@ fig.show() | |
|
||
See the [Python documentation](https://plotly.com/python/) for more examples. | ||
|
||
|
||
## Overview | ||
|
||
[plotly.py](https://plotly.com/python/) is an interactive, open-source, and browser-based graphing library for Python :sparkles: | ||
|
@@ -82,7 +78,7 @@ Built on top of [plotly.js](https://github.com/plotly/plotly.js), `plotly.py` is | |
|
||
## Installation | ||
|
||
plotly.py may be installed using pip... | ||
plotly.py may be installed using pip | ||
|
||
``` | ||
pip install plotly==5.24.1 | ||
|
@@ -94,43 +90,19 @@ or conda. | |
conda install -c plotly plotly=5.24.1 | ||
``` | ||
|
||
### JupyterLab Support | ||
### Jupyter Widget Support | ||
|
||
For use in [JupyterLab](https://jupyterlab.readthedocs.io/en/stable/), install the `jupyterlab` and `ipywidgets` | ||
For use as a Jupyter widget, install `jupyter` and `anywidget` | ||
packages using `pip`: | ||
|
||
``` | ||
pip install "jupyterlab>=3" "ipywidgets>=7.6" | ||
pip install jupyter anywidget | ||
``` | ||
|
||
or `conda`: | ||
|
||
``` | ||
conda install "jupyterlab>=3" "ipywidgets>=7.6" | ||
``` | ||
|
||
The instructions above apply to JupyterLab 3.x. **For JupyterLab 2 or earlier**, run the following commands to install the required JupyterLab extensions (note that this will require [`node`](https://nodejs.org/) to be installed): | ||
|
||
``` | ||
# JupyterLab 2.x renderer support | ||
jupyter labextension install [email protected] @jupyter-widgets/jupyterlab-manager | ||
``` | ||
|
||
Please check out our [Troubleshooting guide](https://plotly.com/python/troubleshooting/) if you run into any problems with JupyterLab. | ||
|
||
### Jupyter Notebook Support | ||
|
||
For use in the Jupyter Notebook, install the `notebook` and `ipywidgets` | ||
packages using `pip`: | ||
|
||
``` | ||
pip install "notebook>=5.3" "ipywidgets>=7.5" | ||
``` | ||
|
||
or `conda`: | ||
|
||
``` | ||
conda install "notebook>=5.3" "ipywidgets>=7.5" | ||
conda install jupyter anywidget | ||
``` | ||
|
||
### Static Image Export | ||
|
@@ -143,41 +115,18 @@ command line utility (legacy as of `plotly` version 4.9). | |
#### Kaleido | ||
|
||
The [`kaleido`](https://github.com/plotly/Kaleido) package has no dependencies and can be installed | ||
using pip... | ||
using pip | ||
|
||
``` | ||
pip install -U kaleido | ||
``` | ||
|
||
or conda. | ||
or conda | ||
|
||
``` | ||
conda install -c conda-forge python-kaleido | ||
``` | ||
|
||
#### Orca | ||
|
||
While Kaleido is now the recommended image export approach because it is easier to install | ||
and more widely compatible, [static image export](https://plotly.com/python/static-image-export/) | ||
can also be supported | ||
by the legacy [orca](https://github.com/plotly/orca) command line utility and the | ||
[`psutil`](https://github.com/giampaolo/psutil) Python package. | ||
|
||
These dependencies can both be installed using conda: | ||
|
||
``` | ||
conda install -c plotly plotly-orca==1.3.1 psutil | ||
``` | ||
|
||
Or, `psutil` can be installed using pip... | ||
|
||
``` | ||
pip install psutil | ||
``` | ||
|
||
and orca can be installed according to the instructions in the [orca README](https://github.com/plotly/orca). | ||
|
||
|
||
### Extended Geo Support | ||
|
||
Some plotly.py features rely on fairly large geographic shape files. The county | ||
|
This file contains hidden or 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 hidden or 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 |
---|---|---|
|
@@ -96,25 +96,16 @@ IFrame(snippet_url + 'getting-started', width='100%', height=1200) | |
|
||
#### JupyterLab Support | ||
|
||
To use `plotly` in [JupyterLab](https://jupyterlab.readthedocs.io/en/stable/), install the `jupyterlab` and `ipywidgets` packages in the same environment as you installed `plotly`, using `pip`: | ||
To use `plotly` in [JupyterLab](https://jupyterlab.readthedocs.io/en/stable/), install the `jupyterlab` and `anywidget` packages in the same environment as you installed `plotly`, using `pip`: | ||
|
||
``` | ||
$ pip install "jupyterlab>=3" "ipywidgets>=7.6" | ||
$ pip install jupyterlab anywidget | ||
``` | ||
|
||
or `conda`: | ||
|
||
``` | ||
$ conda install "jupyterlab>=3" "ipywidgets>=7.6" | ||
``` | ||
|
||
The `plotly` jupyterlab extension is included when you install `plotly` using `pip` or `conda`. When you run Jupyter Lab, ensure you are running it in the same environment that you installed `plotly` in so it has access to the `plotly` jupyterlab extension. | ||
|
||
**JupyterLab 2 or earlier** does not support the prebuilt extensions installed using `pip` and `conda`. If you are using JupyterLab 2, run the following command to install the required JupyterLab extensions (note that this will require [`node`](https://nodejs.org/) to be installed): | ||
|
||
``` | ||
# JupyterLab 2.x renderer support | ||
jupyter labextension install [email protected] @jupyter-widgets/jupyterlab-manager | ||
$ conda install jupyterlab anywidget | ||
``` | ||
|
||
Launch JupyterLab with: | ||
|
This file contains hidden or 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 hidden or 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 was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.