Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
31 changed files
with
763 additions
and
706 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Minimal makefile for Sphinx documentation | ||
# | ||
|
||
# You can set these variables from the command line. | ||
SPHINXOPTS = | ||
SPHINXBUILD = sphinx-build | ||
SOURCEDIR = . | ||
BUILDDIR = _build | ||
|
||
# Put it first so that "make" without argument is like "make help". | ||
help: | ||
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) | ||
|
||
.PHONY: help Makefile | ||
|
||
# Catch-all target: route all unknown targets to Sphinx using the new | ||
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). | ||
%: Makefile | ||
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# -*- coding: utf-8 -*- | ||
# Point Sphinx autodoc at our source | ||
import sys | ||
import os | ||
|
||
sys.path.insert(0, os.path.abspath('../')) | ||
|
||
project = u'pydeck' | ||
copyright = u'2019, Uber Technologies, Inc.' | ||
author = u'Andrew Duberstein' | ||
# The short X.Y version | ||
version = u'' | ||
# The full version, including alpha/beta/rc tags | ||
release = u'0.1.dev4' | ||
# Extensions to generate documents from our docstrings here | ||
extensions = [ | ||
'sphinx.ext.autodoc', | ||
'sphinx.ext.napoleon' | ||
] | ||
templates_path = ['_templates'] | ||
source_suffix = '.rst' | ||
master_doc = 'index' | ||
language = None | ||
exclude_patterns = [u'_build'] | ||
pygments_style = None | ||
html_theme = 'alabaster' | ||
html_static_path = ['_static'] | ||
htmlhelp_basename = 'pydeckdoc' | ||
man_pages = [ | ||
(master_doc, 'pydeck', u'pydeck Documentation', | ||
[author], 1) | ||
] | ||
texinfo_documents = [ | ||
(master_doc, 'pydeck', u'pydeck Documentation', | ||
author, 'pydeck', 'One line description of project.', | ||
'Miscellaneous'), | ||
] | ||
epub_title = project | ||
epub_exclude_files = ['search.html'] | ||
autoclass_content = "both" |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
Data utilities | ||
============== | ||
|
||
These items are convenience functions for common data processing work done for pydeck maps. | ||
|
||
.. autofunction:: pydeck.data_utils.viewport_helpers.compute_view | ||
|
||
For example, suppose you have 100 points, most of which are centered | ||
around London and ten of which are distributed a few 100 kilometers away | ||
from it. If you set ``view_proportion=0.9``, pydeck will attempt to fit | ||
to the middle 90% of the data, aiming to exclude the points furthest | ||
from the core of the visualization. Suppose your ten points | ||
are in the Americas in this example--they would be excluded. | ||
|
||
.. autofunction:: pydeck.data_utils.color_scales.assign_random_colors | ||
|
||
|
||
Examples | ||
-------- | ||
|
||
Below is an illustration of :func:`pydeck.data_utils.color_scales.assign_random_colors`, | ||
using a small data set of two classes (here, 'Palace' and 'Clock Tower) | ||
and three obervations ('Big Ben', 'Kensington Palace', and 'Buckingham Palace'). | ||
Our goal is to quickly color the data by category. | ||
|
||
>>> import pydeck | ||
>>> import pandas | ||
>>> data = pandas.DataFrame([ | ||
>>> { | ||
>>> 'site': 'Big Ben', | ||
>>> 'attraction_type': 'Clock Tower', | ||
>>> 'lat': 51.5006958, | ||
>>> 'lng': -0.1266639 | ||
>>> }, | ||
>>> { | ||
>>> 'site': 'Kensington Palace', | ||
>>> 'attraction_type': 'Palace': | ||
>>> 'lat': 51.5046188, | ||
>>> 'lng': -0.1839472 | ||
>>> }, | ||
>>> { | ||
>>> 'attraction_type': 'Palace', | ||
>>> 'site': 'Buckingham Palace', | ||
>>> 'lat': 51.501364, | ||
>>> 'lng': -0.14189 | ||
>>> } | ||
>>> ]) | ||
>>> color_lookup = pydeck.data_utils.assign_random_colors(data['attraction_type']) | ||
>>> # Assign a color based on attraction_type | ||
>>> data['color'] = data.apply(lambda row: color_lookup.get(row['attraction_type']), axis=1) | ||
>>> # Data now has an RGB color by attraction type: | ||
[ | ||
{ | ||
'site': 'Big Ben', | ||
'attraction_type': 'Clock Tower', | ||
'lat': 51.5006958, | ||
'lng': -0.1266639, | ||
'color': [0, 10, 35] | ||
}, | ||
{ | ||
'site': 'Kensington Palace', | ||
'attraction_type': 'Palace': | ||
'lat': 51.5046188, | ||
'lng': -0.1839472, | ||
'color': [53, 243, 130] | ||
}, | ||
{ | ||
'attraction_type': 'Palace', | ||
'site': 'Buckingham Palace', | ||
'lat': 51.501364, | ||
'lng': -0.14189, | ||
'color': [53, 243, 130] | ||
} | ||
] |
Oops, something went wrong.