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 8 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
4 changes: 2 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,7 +22,7 @@ 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
sphinx-apidoc -E -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
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes:

  • remove titles such as "List of modules" which I deemed to be verbose and not helpful.
  • put the module content before the list of submodules

@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
git checkout -- ../../packages/python/plotly/plotly/graph_objs
rename 's/graph_objs/graph_objects/' _build/html/*.html _build/html/generated/*.html
Expand Down
11 changes: 10 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,13 @@ plotly's high-level API for rapid figure generation. ::
imshow


`plotly.express` submodules
---------------------------


.. toctree::
:maxdepth: 1

generated/plotly.express.data.rst
generated/plotly.express.colors.rst

2 changes: 1 addition & 1 deletion doc/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ plotly==4.7.0
jupytext==1.1.1
jupyter
notebook
pandas==0.23.0
pandas
statsmodels==0.10.1
scipy==1.3.1
patsy==0.5.1
Expand Down
8 changes: 8 additions & 0 deletions packages/python/plotly/plotly/colors.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,10 @@
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 @@ -3,7 +3,7 @@
from collections import namedtuple, OrderedDict

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.

17 changes: 17 additions & 0 deletions packages/python/plotly/plotly/express/colors/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
"""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/>`_
"""

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",
]
2 changes: 2 additions & 0 deletions packages/python/plotly/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,8 @@ def run(self):
"plotly.figure_factory",
"plotly.data",
"plotly.express",
"plotly.express.data",
"plotly.express.colors",
"plotly.graph_objects",
"_plotly_utils",
"_plotly_utils.colors",
Expand Down