Skip to content

Commit 65625d4

Browse files
authored
Merge pull request #1666 from plotly/v4_integration
Version 4 integration
2 parents 3be34f7 + 9b8f4be commit 65625d4

File tree

2,781 files changed

+651008
-665438
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,781 files changed

+651008
-665438
lines changed

Diff for: .circleci/config.yml

+51-31
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,19 @@
11
version: 2
22

33
jobs:
4+
check-code-formatting:
5+
docker:
6+
- image: circleci/python:3.7-stretch-node-browsers
7+
8+
steps:
9+
- checkout
10+
- run:
11+
name: Install black
12+
command: 'sudo pip install black'
13+
- run:
14+
name: Check formatting with black
15+
command: 'black --check .'
16+
417
# Core
518
python-2.7-core:
619
docker:
@@ -15,7 +28,7 @@ jobs:
1528
command: 'sudo pip install tox'
1629
- run:
1730
name: Test with tox
18-
command: 'tox -e py27-core'
31+
command: 'cd packages/python/plotly; tox -e py27-core'
1932
no_output_timeout: 20m
2033

2134
python-3.5-core:
@@ -31,7 +44,7 @@ jobs:
3144
command: 'sudo pip install tox'
3245
- run:
3346
name: Test with tox
34-
command: 'tox -e py35-core'
47+
command: 'cd packages/python/plotly; tox -e py35-core'
3548
no_output_timeout: 20m
3649

3750
python-3.6-core:
@@ -47,7 +60,7 @@ jobs:
4760
command: 'sudo pip install tox'
4861
- run:
4962
name: Test with tox
50-
command: 'tox -e py36-core'
63+
command: 'cd packages/python/plotly; tox -e py36-core'
5164
no_output_timeout: 20m
5265

5366
python-3.7-core:
@@ -63,7 +76,7 @@ jobs:
6376
command: 'sudo pip install tox'
6477
- run:
6578
name: Test with tox
66-
command: 'tox -e py37-core'
79+
command: 'cd packages/python/plotly; tox -e py37-core'
6780
no_output_timeout: 20m
6881

6982
# Optional
@@ -80,11 +93,11 @@ jobs:
8093
command: 'sudo pip install tox'
8194
- run:
8295
name: Install npm dependencies
83-
command: cd plotly/tests/test_optional/test_jupyter && npm install
96+
command: cd packages/python/plotly/plotly/tests/test_optional/test_jupyter && npm install
8497
no_output_timeout: 20m
8598
- run:
8699
name: Test with tox
87-
command: 'tox -e py27-optional'
100+
command: 'cd packages/python/plotly; tox -e py27-optional'
88101
no_output_timeout: 20m
89102

90103
python-3.5-optional:
@@ -100,11 +113,11 @@ jobs:
100113
command: 'sudo pip install tox'
101114
- run:
102115
name: Install npm dependencies
103-
command: cd plotly/tests/test_optional/test_jupyter && npm install
116+
command: cd packages/python/plotly/plotly/tests/test_optional/test_jupyter && npm install
104117
no_output_timeout: 20m
105118
- run:
106119
name: Test with tox
107-
command: 'tox -e py35-optional'
120+
command: 'cd packages/python/plotly; tox -e py35-optional'
108121
no_output_timeout: 20m
109122

110123
python-3.6-optional:
@@ -120,11 +133,11 @@ jobs:
120133
command: 'sudo pip install tox'
121134
- run:
122135
name: Install npm dependencies
123-
command: cd plotly/tests/test_optional/test_jupyter && npm install
136+
command: cd packages/python/plotly/plotly/tests/test_optional/test_jupyter && npm install
124137
no_output_timeout: 20m
125138
- run:
126139
name: Test with tox
127-
command: 'tox -e py36-optional'
140+
command: 'cd packages/python/plotly; tox -e py36-optional'
128141
no_output_timeout: 20m
129142

130143
python-3.7-optional:
@@ -140,11 +153,11 @@ jobs:
140153
command: 'sudo pip install tox'
141154
- run:
142155
name: Install npm dependencies
143-
command: cd plotly/tests/test_optional/test_jupyter && npm install
156+
command: cd packages/python/plotly/plotly/tests/test_optional/test_jupyter && npm install
144157
no_output_timeout: 20m
145158
- run:
146159
name: Test with tox
147-
command: 'tox -e py37-optional'
160+
command: 'cd packages/python/plotly; tox -e py37-optional'
148161
no_output_timeout: 20m
149162

150163
# Plot.ly
@@ -161,7 +174,7 @@ jobs:
161174
command: 'sudo pip install tox'
162175
- run:
163176
name: Test with tox
164-
command: 'tox -e py27-plot_ly'
177+
command: 'cd packages/python/chart-studio; tox -e py27-plot_ly'
165178
no_output_timeout: 20m
166179

167180
python-3.5-plot_ly:
@@ -177,7 +190,7 @@ jobs:
177190
command: 'sudo pip install tox'
178191
- run:
179192
name: Test with tox
180-
command: 'tox -e py35-plot_ly'
193+
command: 'cd packages/python/chart-studio; tox -e py35-plot_ly'
181194
no_output_timeout: 20m
182195

183196
python-3.7-plot_ly:
@@ -193,7 +206,7 @@ jobs:
193206
command: 'sudo pip install tox'
194207
- run:
195208
name: Test with tox
196-
command: 'tox -e py37-plot_ly'
209+
command: 'cd packages/python/chart-studio; tox -e py37-plot_ly'
197210
no_output_timeout: 20m
198211

199212
python-2-7-orca:
@@ -220,8 +233,8 @@ jobs:
220233
command: |
221234
. /home/circleci/miniconda/etc/profile.d/conda.sh
222235
conda activate circle_optional
223-
pytest --disable-warnings plotly/tests/test_core
224-
pytest plotly/tests/test_orca
236+
pytest --disable-warnings packages/python/plotly/plotly/tests/test_core
237+
pytest packages/python/plotly/plotly/tests/test_orca
225238
226239
- store_artifacts:
227240
path: plotly/tests/test_orca/images/linux/failed
@@ -250,8 +263,8 @@ jobs:
250263
command: |
251264
. /home/circleci/miniconda/etc/profile.d/conda.sh
252265
conda activate circle_optional
253-
pytest --disable-warnings plotly/tests/test_core
254-
pytest plotly/tests/test_orca
266+
pytest --disable-warnings packages/python/plotly/plotly/tests/test_core
267+
pytest packages/python/plotly/plotly/tests/test_orca
255268
256269
- store_artifacts:
257270
path: plotly/tests/test_orca/images/linux/failed
@@ -280,8 +293,8 @@ jobs:
280293
command: |
281294
. /home/circleci/miniconda/etc/profile.d/conda.sh
282295
conda activate circle_optional
283-
pytest --disable-warnings plotly/tests/test_core
284-
pytest plotly/tests/test_orca
296+
pytest --disable-warnings packages/python/plotly/plotly/tests/test_core
297+
pytest packages/python/plotly/plotly/tests/test_orca
285298
286299
- store_artifacts:
287300
path: plotly/tests/test_orca/images/linux/failed
@@ -297,47 +310,53 @@ jobs:
297310
- checkout
298311
- run:
299312
name: Install tox
300-
command: 'sudo pip install tox requests yapf pytz decorator retrying inflect'
313+
command: 'sudo pip install retrying tox black inflect'
301314
- run:
302-
name: Update plotlywidget version
303-
command: 'python setup.py updateplotlywidgetversion'
315+
name: Update jupyterlab-plotly version
316+
command: 'cd packages/python/plotly; python setup.py updateplotlywidgetversion'
304317
- run:
305318
name: Update plotly.js to dev
306-
command: 'python setup.py updateplotlyjsdev'
319+
command: 'cd packages/python/plotly; python setup.py updateplotlyjsdev'
307320
- run:
308321
name: Test with tox
309322
command: |
323+
cd packages/python/plotly
310324
locale
311325
tox -e py37-core -- -a '!nodev'
312326
no_output_timeout: 20m
313327
- run:
314328
name: Commit
315329
command: |
330+
cd packages/python/plotly
316331
sudo mkdir /dist
317332
git config --global user.email "[email protected]"
318333
git config --global user.name "Your Name"
319334
git add -A
320335
git commit -m "Codegen"
321336
when: always
322337
- run:
323-
name: Build source distribution package
338+
name: Build source distribution packages
324339
command: |
340+
cd packages/python/plotly
325341
python setup.py sdist
326342
sudo cp dist/* /dist
327343
when: always
328344
- run:
329345
name: npm-pack widget
330346
command: |
331-
cd js/
347+
cd packages/javascript/jupyterlab-plotly/
332348
npm install webpack
333349
npm pack
334-
sudo cp ./plotlywidget* /dist
350+
sudo cp ./jupyterlab-plotly* /dist
335351
when: always
336352
- store_artifacts:
337-
path: /dist
353+
path: packages/python/plotly/dist
338354

339355
workflows:
340356
version: 2
357+
code_formatting:
358+
jobs:
359+
- check-code-formatting
341360
dev_build:
342361
jobs:
343362
- plotlyjs_dev_build
@@ -354,8 +373,9 @@ workflows:
354373
# 3.7 optional disabled due to current shapely incompatibility
355374
# - python-3.7-optional
356375
- python-2.7-plot_ly
357-
- python-3.5-plot_ly
358-
- python-3.7-plot_ly
376+
- python-3.7-plot_ly:
377+
requires:
378+
- python-2.7-plot_ly
359379
- python-2-7-orca
360380
- python-3-5-orca
361381
- python-3-7-orca

Diff for: .circleci/create_conda_optional_env.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ if [ ! -d $HOME/miniconda/envs/circle_optional ]; then
1616
# Create environment
1717
# PYTHON_VERSION=3.6
1818
$HOME/miniconda/bin/conda create -n circle_optional --yes python=$PYTHON_VERSION \
19-
requests six pytz retrying psutil pandas decorator pytest mock nose poppler xarray scikit-image ipython
19+
requests nbformat six retrying psutil pandas decorator pytest mock nose poppler xarray scikit-image ipython
2020

2121
# Install orca into environment
2222
$HOME/miniconda/bin/conda install --yes -n circle_optional -c plotly plotly-orca

Diff for: .gitignore

+6-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44

55
*.gz
66

7+
# Don't ignore dataset files
8+
!*.csv.gz
9+
710
*.ipynb
811

912
*.coverage
@@ -20,7 +23,7 @@ plotly/presentation_objs/
2023

2124
.idea
2225

23-
js/node_modules/
26+
node_modules/
2427

2528
.pytest_cache
2629

@@ -35,3 +38,5 @@ plotly.egg-info/
3538

3639
plotly/tests/test_orca/images/*/failed
3740
plotly/tests/test_orca/images/*/tmp
41+
/plotly-package/plotly/tests/test_core/test_offline/plotly.min.js
42+
temp-plot.html

Diff for: .pre-commit-config.yaml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
repos:
2+
- repo: https://github.com/ambv/black
3+
rev: stable
4+
hooks:
5+
- id: black
6+
language_version: python

Diff for: CHANGELOG.md

+49-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,53 @@
22
All notable changes to this project will be documented in this file.
33
This project adheres to [Semantic Versioning](http://semver.org/).
44

5+
## [4.0.0] - 2019-07-16
6+
7+
This is a major release that includes many new features, and a few breaking changes. See the [version 4 announcement]() for a summary of the important changes.
8+
9+
### Updated
10+
- Updated Plotly.js to version 1.48.3. See the
11+
[plotly.js CHANGELOG](https://github.com/plotly/plotly.js/blob/master/CHANGELOG.md#1483----2019-06-13)
12+
for more information.
13+
14+
### Added
15+
- The Plotly Express tech preview (https://medium.com/@plotlygraphs/introducing-plotly-express-808df010143d) has been integrated as the `plotly.express` module ([#1613](https://github.com/plotly/plotly.py/pull/1613))
16+
- Added a new renderers framework the supports rendering figure in a wide variety of contexts ([#1474](https://github.com/plotly/plotly.py/pull/1474)). See the new [Displaying Plotly Figures](https://plot.ly/python/next/renderers) documentation page for more information.
17+
- Added `plotly.io.write_html` and `plotly.io.to_html` functions for exporting figures to HTML ([1474](https://github.com/plotly/plotly.py/pull/1474)). Also available as `.write_html` and `.to_html` figure methods.
18+
- Added new figure methods for batch updating figure properties (`update_layout`, `update_traces`, `update_xaxes`, etc.) ([#1624](https://github.com/plotly/plotly.py/pull/1624)). See the new [Creating and Updating Figures](https://plot.ly/python/next/creating-and-updating-figures/) documentation page for more details.
19+
- Added support for all trace types in `make_subplots` ([#1528](https://github.com/plotly/plotly.py/pull/1528))
20+
- Added support for secondary y-axes in `make_subplots` ([#1564](https://github.com/plotly/plotly.py/pull/1564))
21+
- Support passing a scalar trace object (rather than a list or tuple of trace objects) as the `data` property to the `Figure` constructor ([#1614](https://github.com/plotly/plotly.py/pull/1614))
22+
- Added dictionary-stule `.pop` method to graph object classes ([#1614](https://github.com/plotly/plotly.py/pull/1614))
23+
- New `jupyterlab-plotly` JupyterLab extension for rendering figures in JupyterLab. Replaces the `@jupyterlab/plotly-extension` extension, and includes JupyterLab 1.0 support.
24+
- Added new suite of built-in colorscales to the `plotly.colors` module, and support for specifying this wide range of colorscales by name. Also added support for specifying colorscales as a list of colors, in which case the color spacing is assumed to be uniform ([#1647](https://github.com/plotly/plotly.py/pull/1647)).
25+
- Added `sphinx-gallery` renderer for embedding plotly figures in [Sphinx-Gallery](https://sphinx-gallery.github.io/) ([#1577](https://github.com/plotly/plotly.py/pull/1577), [plotly/plotly-sphinx-gallery](https://github.com/plotly/plotly-sphinx-gallery)).
26+
27+
### Removed
28+
- The follow modules for interfacing with the Chart Studio cloud service have been removed from plotly.py and moved to the new `chart-studio` distribution package. The following modules have been moved to a new top-level `chart_studio` module:
29+
- `plotly.plotly` -> `chart_studio.plotly`
30+
- `plotly.api` -> `chart_studio.api`
31+
- `plotly.dashboard_objs` -> `chart_studio.dashboard_objs`
32+
- `plotly.grid_objs` -> `chart_studio.grid_objs`
33+
- `plotly.presentation_objs` -> `chart_studio.presentation_objs`
34+
- The legacy `plotly.widgets.GraphWidget` class for displaying online figures hosted by Chart Studio as ipywidgets has been removed. Please use the offline, and much more capable, `plotly.graph_objects.FigureWidget` class instead.
35+
- The `fileopt` argument to `chart_studio.plotly.plot` has been removed, so in-place modifications to previously published figures are no longer supported, and a figure will always overwrite a figure with the same name.
36+
37+
### Changed
38+
- The `'plotly'` template is used as the default theme across all figures.
39+
- In order to reduce the size of the core `plotly` distribution package, the bundled geographic shape files used by the `create_choropleth` figure factory have been moved to a new optional `plotly-geo` distribution package ([1604](https://github.com/plotly/plotly.py/pull/1604))
40+
- For consistency with other figure factories, the `create_choropleth` and `create_gantt` figure factories now always returns `Figure` objects, rather than dictionaries ([#1600](https://github.com/plotly/plotly.py/pull/1600), [#1607](https://github.com/plotly/plotly.py/pull/1607)).
41+
- Figure add trace methods (`.add_trace`, `.add_traces`, `.add_scatter`, etc.) now return a reference to the calling figure, rather than the newly created trace ([#1624](https://github.com/plotly/plotly.py/pull/1624))
42+
- `plotly.tools.make_subplots` has been moved to `plotly.subplots.make_subplots`, though it is still available at the previous location for backward compatibility
43+
- The `plotly.graph_objs` module has been moved to `plotly.graph_objects`, though it is still available at the previous location for backward compatibility ([#1614](https://github.com/plotly/plotly.py/pull/1614))
44+
- Trace `uid` properties are only generated automatically when a trace is added to a `FigureWidget`. When a trace is added to a standard `Figure` graph object the input `uid`, if provided, is accepted as is ([#1580](https://github.com/plotly/plotly.py/pull/1580)).
45+
- `datetime` objects that include timezones are not longer converted to UTC ([#1581](https://github.com/plotly/plotly.py/pull/1581))
46+
- When a tuple property (e.g. `layout.annotations`) is updated with a list/tuple that is longer than the current value, the extra elements are appended to the end of the tuple.
47+
48+
### Fixed
49+
- Fixed visibility of `bar` trace error bars in built-in templates ([1656](https://github.com/plotly/plotly.py/pull/1656))
50+
51+
552
## [3.10.0] - 2019-05-31
653

754
### Updated
@@ -641,7 +688,7 @@ must be installed:
641688
- From here forward, new versions of plotly.py will be published to the [plotly anaconda channel](https://anaconda.org/plotly/)
642689
on the same day they are published to PyPI.
643690
([72ad0e4](https://github.com/plotly/plotly.py/commit/72ad0e4bf54bb8a06445d2ca55488ffc11c836a7))
644-
- The [`README`](README.md) now includes conda installation instructions alongside the pip instructions.
691+
- The [`README`](packages/python/plotly-geo/README.md) now includes conda installation instructions alongside the pip instructions.
645692
- In addition to the existing installation approaches, orca is now also available as a
646693
[conda package](https://anaconda.org/plotly/plotly-orca) from the plotly anaconda channel.
647694

@@ -703,7 +750,7 @@ must be installed:
703750

704751
### JupyterLab Versions
705752
For use with JupyterLab, the following versions of the following packages
706-
must be installed. See [README.md](README.md) for instructions.
753+
must be installed. See [README.md](packages/python/plotly-geo/README.md) for instructions.
707754

708755
- Python Packages
709756
- plotly==3.1.0

0 commit comments

Comments
 (0)