Skip to content

added links to px.data and px.colors in API doc #2493

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 15 commits into from
May 26, 2020
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions doc/apidoc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = python3 -m sphinx
SPHINXBUILD = python -m sphinx
SOURCEDIR = .
BUILDDIR = _build

Expand All @@ -22,9 +22,13 @@ help:
sed -i 's/:class:`plotly.graph_objects/:class:`plotly.graph_objs/g' ../../packages/python/plotly/plotly/graph_objs/*/*.py
sed -i 's/:class:`plotly.graph_objects/:class:`plotly.graph_objs/g' ../../packages/python/plotly/plotly/graph_objs/*/*/*.py
sed -i 's/:class:`plotly.graph_objects/:class:`plotly.graph_objs/g' ../../packages/python/plotly/plotly/graph_objs/*/*/*/*.py
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
cp ../../packages/python/plotly/_plotly_utils/colors/sequential.py ../../packages/python/plotly/_plotly_utils/colors/diverging.py ../../packages/python/plotly/_plotly_utils/colors/qualitative.py ../../packages/python/plotly/_plotly_utils/colors/cyclical.py ../../packages/python/plotly/plotly/colors
cp ../../packages/python/plotly/_plotly_utils/colors/sequential.py ../../packages/python/plotly/_plotly_utils/colors/diverging.py ../../packages/python/plotly/_plotly_utils/colors/qualitative.py ../../packages/python/plotly/_plotly_utils/colors/cyclical.py ../../packages/python/plotly/plotly/express/colors
sphinx-apidoc -M -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)
git checkout -- ../../packages/python/plotly/plotly/graph_objs
rm ../../packages/python/plotly/plotly/colors/diverging.py ../../packages/python/plotly/plotly/colors/sequential.py ../../packages/python/plotly/plotly/colors/qualitative.py ../../packages/python/plotly/plotly/colors/cyclical.py
rm ../../packages/python/plotly/plotly/express/colors/diverging.py ../../packages/python/plotly/plotly/express/colors/sequential.py ../../packages/python/plotly/plotly/express/colors/qualitative.py ../../packages/python/plotly/plotly/express/colors/cyclical.py
rename 's/graph_objs/graph_objects/' _build/html/*.html _build/html/generated/*.html
mv _build/html/generated/plotly.graph_objs.html _build/html/generated/plotly.graph_objects.html
sed -i 's/graph_objs/graph_objects/g' _build/html/*.html
Expand Down
1 change: 1 addition & 0 deletions doc/apidoc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Submodules
* :ref:`Subplots: helper function for layout out multi-plot figures <subplots>`
* :ref:`Figure Factories: helper methods for building specific complex charts <ff>`
* :ref:`I/O: low-level interface for displaying, reading and writing figures <io>`
* :mod:`plotly.colors`: colorscales and utility functions

Full reference list
-------------------
Expand Down
10 changes: 9 additions & 1 deletion doc/apidoc/plotly.express.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.. _px:

`plotly.express`: high-level interface for data visualization
================================
=============================================================

The `plotly.express <https://plot.ly/python/plotly-express/>`_ module is
plotly's high-level API for rapid figure generation. ::
Expand Down Expand Up @@ -49,4 +49,12 @@ plotly's high-level API for rapid figure generation. ::
imshow


`plotly.express` subpackages
---------------------------


.. toctree::
:maxdepth: 1

generated/plotly.express.data.rst
generated/plotly.express.colors.rst
6 changes: 6 additions & 0 deletions packages/python/plotly/_plotly_utils/colors/cyclical.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,3 +185,9 @@ def swatches_cyclical(template=None):
if _k.startswith("_") or _k.startswith("swatches") or _k.endswith("_r"):
continue
globals()[_k + "_r"] = _cols[::-1]


__all__ = [
"swatches",
"swatches_cyclical",
]
3 changes: 3 additions & 0 deletions packages/python/plotly/_plotly_utils/colors/diverging.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,6 @@ def swatches(template=None):
if _k.startswith("_") or _k == "swatches" or _k.endswith("_r"):
continue
globals()[_k + "_r"] = _cols[::-1]


__all__ = ["swatches"]
3 changes: 3 additions & 0 deletions packages/python/plotly/_plotly_utils/colors/qualitative.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,3 +152,6 @@ def swatches(template=None):
if _k.startswith("_") or _k == "swatches" or _k.endswith("_r"):
continue
globals()[_k + "_r"] = _cols[::-1]


__all__ = ["swatches"]
3 changes: 3 additions & 0 deletions packages/python/plotly/_plotly_utils/colors/sequential.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,3 +162,6 @@ def swatches(template=None):
if _k.startswith("_") or _k == "swatches" or _k.endswith("_r"):
continue
globals()[_k + "_r"] = _cols[::-1]


__all__ = ["swatches"]
2 changes: 0 additions & 2 deletions packages/python/plotly/plotly/colors.py

This file was deleted.

23 changes: 23 additions & 0 deletions packages/python/plotly/plotly/colors/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
"""For a list of colors available in `plotly.colors`, please see

* the `tutorial on discrete color sequences <https://plotly.com/python/discrete-color/#color-sequences-in-plotly-express>`_
* the `list of built-in continuous color scales <https://plotly.com/python/builtin-colorscales/>`_

Color scales are available within the following namespaces

* cyclical
* diverging
* qualitative
* sequential
"""

from __future__ import absolute_import
from _plotly_utils.colors import * # noqa: F401

__all__ = [
"named_colorscales",
"cyclical",
"diverging",
"sequential",
"qualitative",
]
2 changes: 1 addition & 1 deletion packages/python/plotly/plotly/express/_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from ._special_inputs import IdentityMap, Constant, Range

from _plotly_utils.basevalidators import ColorscaleValidator
from .colors import qualitative, sequential
from plotly.colors import qualitative, sequential
import math
import pandas as pd
import numpy as np
Expand Down
2 changes: 0 additions & 2 deletions packages/python/plotly/plotly/express/colors.py

This file was deleted.

24 changes: 24 additions & 0 deletions packages/python/plotly/plotly/express/colors/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
"""For a list of colors available in `plotly.express.colors`, please see

* the `tutorial on discrete color sequences <https://plotly.com/python/discrete-color/#color-sequences-in-plotly-express>`_
* the `list of built-in continuous color scales <https://plotly.com/python/builtin-colorscales/>`_

Color scales are available within the following namespaces

* cyclical
* diverging
* qualitative
* sequential
"""

from __future__ import absolute_import
from plotly.colors import *


__all__ = [
"named_colorscales",
"cyclical",
"diverging",
"sequential",
"qualitative",
]
2 changes: 0 additions & 2 deletions packages/python/plotly/plotly/express/data.py

This file was deleted.

12 changes: 12 additions & 0 deletions packages/python/plotly/plotly/express/data/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from __future__ import absolute_import
from plotly.data import *

__all__ = [
"carshare",
"election",
"election_geojson",
"gapminder",
"iris",
"tips",
"wind",
]
3 changes: 3 additions & 0 deletions packages/python/plotly/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,10 @@ def run(self):
"plotly.matplotlylib.mplexporter.renderers",
"plotly.figure_factory",
"plotly.data",
"plotly.colors",
"plotly.express",
"plotly.express.data",
"plotly.express.colors",
"plotly.graph_objects",
"_plotly_utils",
"_plotly_utils.colors",
Expand Down