Skip to content

Sync Fork from Upstream Repo #16

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 37 commits into from
Mar 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
42abe3c
fixed pandas 1.0 pb in sunburst/treemap example
emmanuelle Feb 5, 2020
eca01a6
Update subplots.md
SylwiaOliwia2 Feb 25, 2020
4c2c57c
Update legend.md
SylwiaOliwia2 Feb 25, 2020
a5291db
Merge pull request #2227 from SylwiaOliwia2/patch-2
nicolaskruchten Feb 26, 2020
57cbe57
Update marker-style.md
nicolaskruchten Feb 26, 2020
f7ac0d0
Merge pull request #2233 from plotly/nicolaskruchten-patch-6
nicolaskruchten Feb 26, 2020
ebf4ba5
Update subplots.md
SylwiaOliwia2 Feb 27, 2020
6b0ca58
Update axes.md
SylwiaOliwia2 Feb 27, 2020
2a5b53e
Update facet-plots.md
SylwiaOliwia2 Feb 27, 2020
bdd337f
Update figurewidget.md
nicolaskruchten Feb 28, 2020
c86e0c9
Update figurewidget-app.md
nicolaskruchten Feb 28, 2020
fcab197
Merge pull request #2226 from SylwiaOliwia2/patch-1
emmanuelle Mar 2, 2020
0d4fcc6
Update doc/python/facet-plots.md
SylwiaOliwia2 Mar 3, 2020
e9b45bd
Update facet-plots.md
SylwiaOliwia2 Mar 3, 2020
d83b1b0
Update histograms.md
SylwiaOliwia2 Mar 3, 2020
5d44a09
Update axes.md
SylwiaOliwia2 Mar 3, 2020
235c809
interact html export docs
nicolaskruchten Mar 3, 2020
5bf1530
Merge pull request #2235 from SylwiaOliwia2/patch-4
emmanuelle Mar 4, 2020
8c8d3f6
Merge pull request #2234 from SylwiaOliwia2/patch-3
emmanuelle Mar 4, 2020
3acbd3c
Update histograms.md
SylwiaOliwia2 Mar 6, 2020
d6d6aa3
Merge pull request #2242 from SylwiaOliwia2/patch-5
emmanuelle Mar 6, 2020
51572d2
Support JupyterLab 2.0.0 - plotlywidget
consideRatio Mar 10, 2020
ecded6b
Merge branch 'doc-prod' into pandas-1.0
emmanuelle Mar 10, 2020
e2886e8
Merge pull request #2163 from plotly/pandas-1.0
emmanuelle Mar 10, 2020
a63b38d
python: fix python 3.8 Syntax Warning
sgn Mar 10, 2020
e3a3266
tried to fix default renderer for ipython terminal (#2255)
emmanuelle Mar 11, 2020
262932b
Merge pull request #2262 from sgn/python-3.8-warning
nicolaskruchten Mar 11, 2020
15ab76f
Merge pull request #2261 from consideRatio/jlab2-plotlywidget
nicolaskruchten Mar 11, 2020
307fd73
Px bool (#2127)
emmanuelle Mar 11, 2020
ce4fec8
corrected import bug (#2265)
emmanuelle Mar 11, 2020
30cad0c
Apigen recursive (#2243)
emmanuelle Mar 11, 2020
4c3bf0b
changelog updates
emmanuelle Mar 11, 2020
ca40551
Merge pull request #2268 from plotly/changelog-updates2
nicolaskruchten Mar 11, 2020
1c99b99
release 4.5.4
nicolaskruchten Mar 11, 2020
9e3df43
Merge branch 'doc-prod'
nicolaskruchten Mar 11, 2020
8d7fbce
bump versions for docs
nicolaskruchten Mar 11, 2020
46cd47f
fixed search index graph_objs/graph_objects (#2269)
emmanuelle Mar 12, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ jobs:
cd ../../../doc
fi
echo 'export PATH="/home/circleci/project/doc/node_modules/.bin:$PATH"' >> $BASH_ENV
sudo apt-get install -y poppler-utils libxtst6 xvfb libgtk2.0-0 libgconf-2-4 libnss3 libasound2
sudo apt-get install -y poppler-utils libxtst6 xvfb libgtk2.0-0 libgconf-2-4 libnss3 libasound2 rename
cd ..

- save_cache:
Expand Down
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,23 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## [4.5.4] - 2020-03-11

### Updated

- The documentation of the API https://plot.ly/python-api-reference/ now
documents the full API [#2243](https://github.com/plotly/plotly.py/pull/2243)
- New documentation examples for facets [#2235](https://github.com/plotly/plotly.py/pull/2235), legend [#2227](https://github.com/plotly/plotly.py/pull/2227), subplots [#2226](https://github.com/plotly/plotly.py/pull/2226), axes [#2234](https://github.com/plotly/plotly.py/pull/2234) and histograms [#2242](https://github.com/plotly/plotly.py/pull/2242).
Thanks to [@SylwiaOliwia2](https://github.com/@SylwiaOliwia2) for all these great
examples!

### Fixed

- Jupyterlab extension now compatible with both Jupyterlab 1.2 and 2.0 [#2261](https://github.com/plotly/plotly.py/pull/2261) with thanks to [@consideRatio](https://github.com/consideRatio) for the contribution!
- Fixed a bug when using boolean values for the color argument of px functions [#2127](https://github.com/plotly/plotly.py/pull/2127)
- Corrected import bug which was occuring with old versions of ipywidgets [#2265](https://github.com/plotly/plotly.py/pull/2265)
- Fixed python 3.8 syntax warning [#2262](https://github.com/plotly/plotly.py/pull/2262), with thanks to [@sgn](https://github.com/sgn) for the contribution!

## [4.5.3] - 2020-03-05

### Updated
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

## Quickstart

`pip install plotly==4.5.3`
`pip install plotly==4.5.4`

Inside [Jupyter notebook](https://jupyter.org/install) (installable with `pip install "notebook>=5.3" "ipywidgets>=7.2"`):

Expand Down Expand Up @@ -75,13 +75,13 @@ Built on top of [plotly.js](https://github.com/plotly/plotly.js), `plotly.py` is
plotly.py may be installed using pip...

```
pip install plotly==4.5.3
pip install plotly==4.5.4
```

or conda.

```
conda install -c plotly plotly=4.5.3
conda install -c plotly plotly=4.5.4
```

### Jupyter Notebook Support
Expand Down Expand Up @@ -128,10 +128,10 @@ set NODE_OPTIONS=--max-old-space-size=4096
jupyter labextension install @jupyter-widgets/jupyterlab-manager@1.1 --no-build

# FigureWidget support
jupyter labextension install plotlywidget@1.5.3 --no-build
jupyter labextension install plotlywidget@1.5.4 --no-build

# and jupyterlab renderer support
jupyter labextension install jupyterlab-plotly@1.5.3 --no-build
jupyter labextension install jupyterlab-plotly@1.5.4 --no-build

# Build extensions (must be done to activate extensions since --no-build is used above)
jupyter lab build
Expand Down
2 changes: 1 addition & 1 deletion binder/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
jupytext
plotly==4.5.1
plotly==4.5.4
jupyter
notebook
pandas==0.23.0
Expand Down
23 changes: 15 additions & 8 deletions contributing.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Contributing

Thank you for contributing to plotly.py!
Thank you for contributing to plotly.py!

## Code of Conduct

Expand Down Expand Up @@ -271,10 +271,12 @@ specified below.
+ Update `__frontend_version__` to `^A.B.C-rc.1` (Note the `^` prefix)
- `packages/javascript/plotlywidget/package.json`
+ Update `"version"` to `A.B.C-rc.1`
+ Run `npm install && npm run build`
+ Ensure you're using `node` version 8 and `npm` version 6 to minimize diffs to `package-lock.json`
+ Run `rm -rf node_modules && npm install && npm run build`
- `packages/javascript/jupyterlab-plotly/package.json`
+ Update `"version"` to `A.B.C-rc.1`
+ Run `npm install && npm run build`
+ Ensure you're using `node` version 8 and `npm` version 6 to minimize diffs to `package-lock.json`
+ Run `rm -rf node_modules && npm install && npm run build`

2) Commit the changes

Expand Down Expand Up @@ -375,7 +377,9 @@ Update CHANGELOG with release date and update README with final versions.
In the conda installation instructions, be sure to change the
"-c plotly/label/test" argument to "-c plotly"

Commit updates.
Update the doc/python/getting-started.md file with the same version numbers.

Commit Changelog, README and getting-started updates.

### Finalize versions
When no problems are identified in the release candidate, remove the
Expand All @@ -385,12 +389,15 @@ release candidate suffix from the following version strings:
+ Update `__frontend_version__` to `^A.B.C` (Note the `^` prefix)
- `packages/javascript/plotlywidget/package.json`
+ Update `"version"` to `A.B.C`
+ Run `npm install && npm run build`
+ Ensure you're using `node` version 8 and `npm` version 6 to minimize diffs to `package-lock.json`
+ Run `rm -rf node_modules && npm install && npm run build`
- `packages/javascript/jupyterlab-plotly/package.json`
+ Update `"version"` to `A.B.C`
+ Run `npm install && npm run build`

Commit and push to the release branch.
+ Ensure you're using `node` version 8 and `npm` version 6 to minimize diffs to `package-lock.json`
+ Run `rm -rf node_modules && npm install && npm run build`
- Run `git diff` and ensure that only the files you modified and the build artifacts have changed
- Ensure that the diff in `package-lock.json` seems sane
- Commit and push to the release branch.

### Merge release into master
Make sure the integration tests are passing on the release branch, then merge
Expand Down
9 changes: 9 additions & 0 deletions doc/apidoc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,14 @@ help:

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
# For sphinx-apidoc the first positional path is the module to document
# then all the other ones are paths to exclude for the doc generation
%: Makefile
sphinx-apidoc -o generated ../../packages/python/plotly/plotly ../../packages/python/plotly/plotly/validators ../../packages/python/plotly/plotly/tests ../../packages/python/plotly/plotly/matplotlylib/ ../../packages/python/plotly/plotly/offline ../../packages/python/plotly/plotly/api
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
rename 's/graph_objs/graph_objects/' _build/html/*.html _build/html/generated/*.html
sed -i 's/graph_objs/graph_objects/g' _build/html/*.html
sed -i 's/graph_objs/graph_objects/g' _build/html/*.inv
sed -i 's/graph_objs/graph_objects/g' _build/html/*.js
sed -i 's/graph_objs/graph_objects/g' _build/html/generated/*.html
sed -i 's/graph_objs/graph_objects/g' _build/html/generated/generated/*.html
15 changes: 0 additions & 15 deletions doc/apidoc/_templates/class.rst

This file was deleted.

2 changes: 1 addition & 1 deletion doc/apidoc/_templates/trace.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
.. automethod:: __init__
{% endblock %}


:mod:`{{module}}`.{{objname.lower()}}
{{ underline }}================================

Expand All @@ -20,6 +19,7 @@

.. automodule:: plotly.graph_objects.{{ objname.lower() }}
:members:
:undoc-members:


.. raw:: html
Expand Down
2 changes: 1 addition & 1 deletion doc/apidoc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
# The short X.Y version
version = ""
# The full version, including alpha/beta/rc tags
release = "4.5.1"
release = "4.5.4"


# -- General configuration ---------------------------------------------------
Expand Down
3 changes: 1 addition & 2 deletions doc/apidoc/plotly.graph_objects.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
`plotly.graph_objects`: low-level interface to figures, traces and layout
=========================================

.. currentmodule:: plotly.graph_objects
.. currentmodule:: plotly.graph_objs

:mod:`plotly.graph_objects` contains the building blocks of plotly :class:`Figure`: traces
(:class:`Scatter`, :class:`Bar`, ...) and :class:`Layout`
Expand Down Expand Up @@ -31,7 +31,6 @@ Layout
Layout



Simple charts
--------------

Expand Down
8 changes: 4 additions & 4 deletions doc/python/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@ Thanks to deep integration with the [orca](https://github.com/plotly/orca) image
plotly.py may be installed using pip...

```
$ pip install plotly==4.5.3
$ pip install plotly==4.5.4
```

or conda.

```
$ conda install -c plotly plotly=4.5.3
$ conda install -c plotly plotly=4.5.4
```

This package contains everything you need to write figures to standalone HTML files.
Expand Down Expand Up @@ -144,10 +144,10 @@ set NODE_OPTIONS=--max-old-space-size=4096
jupyter labextension install @jupyter-widgets/jupyterlab-manager@1.1 --no-build

# jupyterlab renderer support
jupyter labextension install jupyterlab-plotly@1.5.3 --no-build
jupyter labextension install jupyterlab-plotly@1.5.4 --no-build

# FigureWidget support
jupyter labextension install plotlywidget@1.5.3 --no-build
jupyter labextension install plotlywidget@1.5.4 --no-build

# Build extensions (must be done to activate extensions since --no-build is used above)
jupyter lab build
Expand Down
17 changes: 17 additions & 0 deletions doc/python/histograms.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,23 @@ fig = px.histogram(df, x="total_bill", nbins=20)
fig.show()
```

#### Accessing the counts (y-axis) values

JavaScript calculates the y-axis (count) values on the fly in the browser, so it's not accessible in the `fig`. You can manually calculate it using `np.histogram`.

```python
import plotly.express as px
import numpy as np

df = px.data.tips()
# create the bins
counts, bins = np.histogram(df.total_bill, bins=range(0, 60, 5))
bins = 0.5 * (bins[:-1] + bins[1:])

fig = px.bar(x=bins, y=counts, labels={'x':'total_bill', 'y':'count'})
fig.show()
```

#### Type of normalization

The default mode is to represent the count of samples in each bin. With the `histnorm` argument, it is also possible to represent the percentage or fraction of samples in each bin (`histnorm='percent'` or `probability`), or a density histogram (the sum of bars is equal to 100, `density`), or a probability density histogram (sum equal to 1, `probability density`).
Expand Down
2 changes: 1 addition & 1 deletion doc/python/sunburst-charts.md
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ def build_hierarchical_dataframe(df, levels, value_column, color_columns=None):
df_all_trees = pd.DataFrame(columns=['id', 'parent', 'value', 'color'])
for i, level in enumerate(levels):
df_tree = pd.DataFrame(columns=['id', 'parent', 'value', 'color'])
dfg = df.groupby(levels[i:]).sum(numerical_only=True)
dfg = df.groupby(levels[i:]).sum()
dfg = dfg.reset_index()
df_tree['id'] = dfg[level].copy()
if i < len(levels) - 1:
Expand Down
2 changes: 1 addition & 1 deletion doc/python/treemaps.md
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ def build_hierarchical_dataframe(df, levels, value_column, color_columns=None):
df_all_trees = pd.DataFrame(columns=['id', 'parent', 'value', 'color'])
for i, level in enumerate(levels):
df_tree = pd.DataFrame(columns=['id', 'parent', 'value', 'color'])
dfg = df.groupby(levels[i:]).sum(numerical_only=True)
dfg = df.groupby(levels[i:]).sum()
dfg = dfg.reset_index()
df_tree['id'] = dfg[level].copy()
if i < len(levels) - 1:
Expand Down
2 changes: 1 addition & 1 deletion doc/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
plotly==4.5.1
plotly==4.5.4
jupytext==1.1.1
jupyter
notebook
Expand Down
2 changes: 1 addition & 1 deletion packages/javascript/jupyterlab-plotly/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/javascript/jupyterlab-plotly/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jupyterlab-plotly",
"version": "1.5.3",
"version": "1.5.4",
"description": "The plotly JupyterLab extension",
"author": "The plotly.py team",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/javascript/plotlywidget/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/javascript/plotlywidget/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "plotlywidget",
"version": "1.5.3",
"version": "1.5.4",
"description": "The plotly JupyterLab extension",
"author": "The plotly.py team",
"license": "MIT",
Expand Down Expand Up @@ -34,7 +34,7 @@
},
"dependencies": {
"plotly.js": "^1.52.2",
"@jupyter-widgets/base": "^2.0.0",
"@jupyter-widgets/base": "^2.0.0 || ^3.0.0",
"lodash": "^4.17.4"
},
"jupyterlab": {
Expand Down
2 changes: 1 addition & 1 deletion packages/python/plotly/_plotly_utils/basevalidators.py
Original file line number Diff line number Diff line change
Expand Up @@ -2421,7 +2421,7 @@ def description(self):
"""\
The '{plotly_name}' property is an instance of {class_str}
that may be specified as:
- An instance of {module_str}.{class_str}
- An instance of :class:`{module_str}.{class_str}`
- A dict of string/value properties that will be passed
to the {class_str} constructor

Expand Down
2 changes: 1 addition & 1 deletion packages/python/plotly/_plotly_utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ class NotEncodable(Exception):
def iso_to_plotly_time_string(iso_string):
"""Remove timezone info and replace 'T' delimeter with ' ' (ws)."""
# make sure we don't send timezone info to plotly
if (iso_string.split("-")[:3] is "00:00") or (iso_string.split("+")[0] is "00:00"):
if (iso_string.split("-")[:3] == "00:00") or (iso_string.split("+")[0] == "00:00"):
raise Exception(
"Plotly won't accept timestrings with timezone info.\n"
"All timestrings are assumed to be in UTC."
Expand Down
2 changes: 1 addition & 1 deletion packages/python/plotly/codegen/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,9 +259,9 @@ def perform_codegen():
from distutils.version import LooseVersion
if LooseVersion(ipywidgets.__version__) >= LooseVersion('7.0.0'):
from ._figurewidget import FigureWidget
__all__.append("FigureWidget")
del LooseVersion
del ipywidgets
__all__.append("FigureWidget")
except ImportError:
pass
"""
Expand Down
4 changes: 2 additions & 2 deletions packages/python/plotly/codegen/datatypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ def __init__(self"""
(
f"arg",
f"dict of properties compatible with this constructor "
f"or an instance of {class_name}",
f"or an instance of :class:`{class_name}`",
)
]

Expand Down Expand Up @@ -321,7 +321,7 @@ def __init__(self"""
raise ValueError(\"\"\"\\
The first argument to the {class_name}
constructor must be a dict or
an instance of {class_name}\"\"\")
an instance of :class:`{class_name}`\"\"\")

# Handle skip_invalid
# -------------------
Expand Down
2 changes: 1 addition & 1 deletion packages/python/plotly/codegen/figure.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class {fig_classname}({base_classname}):\n"""
def __init__(self, data=None, layout=None,
frames=None, skip_invalid=False, **kwargs):
\"\"\"
Create a new {fig_classname} instance
Create a new :class:{fig_classname} instance

Parameters
----------
Expand Down
4 changes: 2 additions & 2 deletions packages/python/plotly/codegen/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -941,7 +941,7 @@ def get_constructor_params_docstring(self, indent=12):
f"{subtype_node.name_datatype_class}"
)
subtype_description = (
f"A tuple of {class_name} instances or "
f"A tuple of :class:`{class_name}` instances or "
"dicts with compatible properties"
)
elif subtype_node.is_compound:
Expand All @@ -958,7 +958,7 @@ def get_constructor_params_docstring(self, indent=12):
)

subtype_description = (
f"{class_name} instance or dict with compatible properties"
f":class:`{class_name}` instance or dict with compatible properties"
)
else:
subtype_description = ""
Expand Down
Loading