Skip to content

Commit c76736e

Browse files
committed
Merge branch 'master' into sphinxgallery
2 parents 6433175 + 7cce283 commit c76736e

File tree

240 files changed

+62829
-13202
lines changed

Some content is hidden

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

240 files changed

+62829
-13202
lines changed

.github/FUNDING.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
custom: https://plot.ly/products/consulting-and-oem/

CHANGELOG.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,49 @@
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+
## [3.10.0] - 2019-05-31
6+
7+
### Updated
8+
- Updated Plotly.js to version 1.48.1. See the
9+
[plotly.js CHANGELOG](https://github.com/plotly/plotly.js/blob/master/CHANGELOG.md#1481----2019-05-30)
10+
for more information.
11+
12+
### Added
13+
- Added funnel trace
14+
([plotly/plotly.js#3817](https://github.com/plotly/plotly.js/pull/3817),
15+
[plotly/plotly.js#3911](https://github.com/plotly/plotly.js/pull/3911))
16+
- Added funnelarea traces
17+
([#3876](https://github.com/plotly/plotly.js/pull/3876),
18+
[#3912](https://github.com/plotly/plotly.js/pull/3912))
19+
- Added support for shared color axes via coloraxis attributes in the layout
20+
([#3803](https://github.com/plotly/plotly.js/pull/3803),
21+
[#3786](https://github.com/plotly/plotly.js/pull/3786),
22+
[#3901](https://github.com/plotly/plotly.js/pull/3901),
23+
[#3916](https://github.com/plotly/plotly.js/pull/3916))
24+
- Added support for sorting categorical cartesian axes by value
25+
([#3864](https://github.com/plotly/plotly.js/pull/3864))
26+
- Added `bingroup` to `histogram`, `histogram2d` and `histogram2dcontour`
27+
to group traces to have compatible auto-bin values
28+
([#3845](https://github.com/plotly/plotly.js/pull/3845))
29+
- Add legend `itemclick` and `itemdoubleclick` attributes to set or disable
30+
the legend item click and double-click behavior
31+
([#3862](https://github.com/plotly/plotly.js/pull/3862))
32+
- Added support for calling orca through [Xvfb](https://www.x.org/releases/X11R7.6/doc/man/man1/Xvfb.1.xhtml)
33+
to support static image export on Linux when X11 is not available
34+
([#1523](https://github.com/plotly/plotly.py/pull/1523)).
35+
36+
### Fixed
37+
- Fixed `PlotlyJSONEncoder` encoding error when `simplejson` is installed
38+
([#1556](https://github.com/plotly/plotly.py/issues/1556),
39+
[#1561](https://github.com/plotly/plotly.py/pull/1561))
40+
- HTML export now honors the figure height specified in the figure template
41+
([#1560](https://github.com/plotly/plotly.py/issues/1560))
42+
- Fixed display height of figure displayed in JupyterLab
43+
([#1572](https://github.com/plotly/plotly.py/issues/1572),
44+
[#1571](https://github.com/plotly/plotly.py/pull/1571))
45+
- Fixed honouring of the `validate=False` option for all renderer types
46+
([#1576](https://github.com/plotly/plotly.py/pull/1576))
47+
548
## [3.9.0] - 2019-04-19
649

750
### Updated

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,12 @@ Built on top of [plotly.js](https://github.com/plotly/plotly.js), `plotly.py` is
7878

7979
plotly.py may be installed using pip...
8080
```
81-
pip install plotly==3.9.0
81+
pip install plotly==3.10.0
8282
```
8383

8484
or conda.
8585
```
86-
conda install -c plotly plotly=3.9.0
86+
conda install -c plotly plotly=3.10.0
8787
```
8888

8989
### Jupyter Notebook Support
@@ -126,7 +126,7 @@ set NODE_OPTIONS=--max-old-space-size=4096
126126
jupyter labextension install @jupyter-widgets/[email protected] --no-build
127127
128128
# FigureWidget support
129-
jupyter labextension install plotlywidget@0.10.0 --no-build
129+
jupyter labextension install plotlywidget@0.11.0 --no-build
130130
131131
# offline iplot support
132132
jupyter labextension install @jupyterlab/[email protected] --no-build

_plotly_future_/orca_defaults.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from __future__ import absolute_import
2+
from _plotly_future_ import _future_flags, _assert_plotly_not_imported
3+
4+
_assert_plotly_not_imported()
5+
_future_flags.add('orca_defaults')

_plotly_future_/timezones.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from __future__ import absolute_import
2+
from _plotly_future_ import _future_flags, _assert_plotly_not_imported
3+
4+
_assert_plotly_not_imported()
5+
_future_flags.add('timezones')

_plotly_future_/trace_uids.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from __future__ import absolute_import
2+
from _plotly_future_ import _future_flags, _assert_plotly_not_imported
3+
4+
_assert_plotly_not_imported()
5+
_future_flags.add('trace_uids')

_plotly_future_/v4.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
11
from __future__ import absolute_import
22
from _plotly_future_ import (
3-
renderer_defaults, template_defaults, extract_chart_studio,
4-
remove_deprecations, v4_subplots)
3+
renderer_defaults,
4+
template_defaults,
5+
extract_chart_studio,
6+
remove_deprecations,
7+
v4_subplots,
8+
orca_defaults,
9+
timezones,
10+
trace_uids,
11+
)
12+

_plotly_utils/basevalidators.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1454,14 +1454,9 @@ def __init__(self, plotly_name,
14541454
self.base = dflt
14551455
else:
14561456
# e.g. regex == '/^y([2-9]|[1-9][0-9]+)?$/'
1457-
self.base = re.match('/\^(\w+)',
1458-
regex).group(1)
1457+
self.base = re.match('/\^(\w+)', regex).group(1)
14591458

1460-
if regex is not None:
1461-
# Remove leading/trailing '/' characters
1462-
self.regex = regex[1:-1]
1463-
else:
1464-
self.regex = dflt + "(\d*)"
1459+
self.regex = self.base + "(\d*)"
14651460

14661461
def description(self):
14671462

_plotly_utils/utils.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
import json as _json
44
import sys
55
import re
6-
76
import pytz
7+
from _plotly_future_ import _future_flags
88

99
from _plotly_utils.optional_imports import get_module
1010

@@ -104,7 +104,9 @@ def default(self, obj):
104104
self.encode_as_sage,
105105
self.encode_as_numpy,
106106
self.encode_as_pandas,
107-
self.encode_as_datetime,
107+
(self.encode_as_datetime_v4
108+
if 'timezones' in _future_flags
109+
else self.encode_as_datetime),
108110
self.encode_as_date,
109111
self.encode_as_list, # because some values have `tolist` do last.
110112
self.encode_as_decimal
@@ -170,6 +172,14 @@ def encode_as_numpy(obj):
170172
else:
171173
raise NotEncodable
172174

175+
@staticmethod
176+
def encode_as_datetime_v4(obj):
177+
"""Convert datetime objects to iso-format strings"""
178+
try:
179+
return obj.isoformat()
180+
except AttributeError:
181+
raise NotEncodable
182+
173183
@staticmethod
174184
def encode_as_datetime(obj):
175185
"""Attempt to convert to utc-iso time string using datetime methods."""

chart_studio/api/v1/clientresp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
import warnings
55

6-
from requests.compat import json as _json
6+
import json as _json
77

88

99
from _plotly_utils.utils import PlotlyJSONEncoder

chart_studio/api/v2/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from __future__ import absolute_import
22

33
import requests
4-
from requests.compat import json as _json
4+
import json as _json
55
from requests.exceptions import RequestException
66
from retrying import retry
77

chart_studio/grid_objs/grid_objs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
except ImportError:
1313
from collections import MutableSequence
1414

15-
from requests.compat import json as _json
15+
import json as _json
1616

1717
from _plotly_utils.optional_imports import get_module
1818
from chart_studio import utils, exceptions

chart_studio/plotly/plotly.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
import six
2828
import six.moves
29-
from requests.compat import json as _json
29+
import json as _json
3030

3131
import _plotly_utils.utils
3232
import _plotly_utils.exceptions

chart_studio/tests/test_plot_ly/test_api/test_v1/test_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from __future__ import absolute_import
22

33
from requests import Response
4-
from requests.compat import json as _json
4+
import json as _json
55
from requests.exceptions import ConnectionError
66

77
from chart_studio.api.utils import to_native_utf8_string

chart_studio/tests/test_plot_ly/test_api/test_v2/test_grids.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from __future__ import absolute_import
22

3-
from requests.compat import json as _json
3+
import json as _json
44

55
from chart_studio.api.v2 import grids
66
from chart_studio.tests.test_plot_ly.test_api import PlotlyApiTestCase

chart_studio/tests/test_plot_ly/test_api/test_v2/test_images.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from __future__ import absolute_import
22

3-
from requests.compat import json as _json
3+
import json as _json
44

55
from chart_studio.api.v2 import images
66
from chart_studio.tests.test_plot_ly.test_api import PlotlyApiTestCase

chart_studio/tests/test_plot_ly/test_api/test_v2/test_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from __future__ import absolute_import
22

3-
from requests.compat import json as _json
3+
import json as _json
44
from requests.exceptions import ConnectionError
55

66
from plotly import version

chart_studio/tests/test_plot_ly/test_get_requests/test_get_requests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import requests
1111
import six
1212
from nose.plugins.attrib import attr
13-
from requests.compat import json as _json
13+
import json as _json
1414

1515
from chart_studio.tests.utils import PlotlyTestCase
1616

chart_studio/tests/test_plot_ly/test_plotly/test_plot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import requests
1111
import six
1212
import sys
13-
from requests.compat import json as _json
13+
import json as _json
1414
import warnings
1515

1616
from nose.plugins.attrib import attr

chart_studio/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
import threading
1313
import warnings
1414

15-
from requests.compat import json as _json
15+
import json as _json
1616

1717
from _plotly_utils.exceptions import PlotlyError
1818
from _plotly_utils.optional_imports import get_module

chart_studio/widgets/graph_widget.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from collections import deque
77
import pkgutil
88

9-
from requests.compat import json as _json
9+
import json as _json
1010

1111
# TODO: protected imports?
1212
import ipywidgets as widgets

codegen/datatypes.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -491,11 +491,16 @@ def add_docstring(buffer, node, header, prepend_extras=(), append_extras=()):
491491

492492
# Write any append extras
493493
for p, v in append_extras:
494-
v_wrapped = '\n'.join(textwrap.wrap(
495-
v,
496-
width=79-12,
497-
initial_indent=' ' * 12,
498-
subsequent_indent=' ' * 12))
494+
if '\n' in v:
495+
# If v contains newlines then assume it's already wrapped as
496+
# desired
497+
v_wrapped = v
498+
else:
499+
v_wrapped = '\n'.join(textwrap.wrap(
500+
v,
501+
width=79-12,
502+
initial_indent=' ' * 12,
503+
subsequent_indent=' ' * 12))
499504
buffer.write(f"""
500505
{p}
501506
{v_wrapped}""")

0 commit comments

Comments
 (0)