8000 merge master in · singleton7/plotly.py@ccf200f · GitHub
[go: up one dir, main page]

Skip to content

Commit ccf200f

Browse files
committed
merge master in
2 parents 2035765 + 7a0ad41 commit ccf200f

30 files changed

+28194
-19536
lines changed

CHANGELOG.md

Lines changed: 49 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,63 @@
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-
## [Unreleased] - TBA
5+
## [2.5.2] - UNRELEASED
6+
### Updated
7+
- error message for `plotly.figure_factory.create_choropleth` is more helpful for Windows users on installing `geopandas` and dependencies including `shapely`.
8+
9+
## [2.5.1] - 2018-03-26
10+
### Fixed
11+
- `plotly.figure_factory.create_choropleth` now works in Windows without raising an OSError. The module now uses cross-platform path tools from `os` to manipulate and manage the shapefiles contained in this package.
12+
13+
## [2.5.0] - 2018-03-12
14+
### Fixed
15+
- `import plotly.figure_factory` does not fail if `pandas` is not installed. See https://github.com/plotly/plotly.py/pull/958
16+
### Added
17+
- New parameter `fill_percent` to the `.insert` method for the dashboards API. You can now insert a box into the dashboard layout and specify what proportion of the original container box it will occupy. Run `help(plotly.dashboard_objs.Dashboard.insert)` for more information on `fill_percent`.
18+
### Updated
19+
- Updated `plotly.min.js` to version 1.35.2.
20+
- New features include adding an `automargin` attribute to cartesian axes and a layout `grids` attribute for easy subplot generation.
21+
- See [the plotly.js CHANGELOG](https://github.com/plotly/plotly.js/blob/master/CHANGELOG.md#1352----2018-03-09) for additional information regarding the updates.
22+
- `plotly.figure_factory.create_choropleth` has changed some of the default plotting options:
23+
- 'offline_mode' param has been removed from call signature.
24+
- Persistent selection api for the centroid points is automatically enabled. See https://plot.ly/python/reference/#scatter-selected and https://plot.ly/python/reference/#scatter-unselected for details
25+
- FIPS values that appear on hover are 0-padded to ensure they are 5 digits.
26+
- `hover_info='none'` is now default for the county lines data.
27+
28+
## [2.4.1] - 2018-02-21
29+
### Fixed
30+
- The required shapefiles to generate the choropleths via `plotly.figure_factory.create_choropleth` are now shipped in the package data.
31+
32+
## [2.4.0] - 2018-02-16
33+
### Added
34+
- County Choropleth figure factory. Call `help(plotly.figure_factory.create_choropleth)` for examples and how to get started making choropleths of US counties with the Python API.
35+
36+
Note: Calling `plotly.figure_factory.create_choropleth` will fail with an IOError due to missing shapefiles see: https://github.com/plotly/plotly.py/blob/master/CHANGELOG.md#241---2018-02-21
37+
38+
## [2.3.0] - 2018-01-25
39+
### Fixed
40+
- Merged [pull request](https://github.com/plotly/plotly.py/commit/a226e07393c158e01c34c050aaf492da9d77679a) that fixes `GraphWidget` for IPython > v6
41+
### Updated
42+
- Updated `plotly.min.js` to version 1.33.1.
43+
- New plot types include a `violin` trace type.
44+
- New features include completely rewritten `scattergl` using `regl` and a completely rewritten polar chart renderer.
45+
- See [the plotly.js CHANGELOG](https://github.com/plotly/plotly.js/blob/master/CHANGELOG.md#1331----2018-01-24) for additional information regarding the updates.
46+
47+
## [2.2.3] - 2017-12-04
648
### Added
749
-`column_width` and `row_width` parameters for `plotly.tools.make_subplots`. Call `help(plotly.tools.make_subplots)` for documentation.
50+
### Updated
51+
- Updated `plotly.min.js` to version 1.31.2.
52+
- Fixes include adjustments to `table` trace for offline plotting.
53+
- See [the plotly.js CHANGELOG](https://github.com/plotly/plotly.js/blob/master/CHANGELOG.md#1312----2017-10-23) for additional information regarding the updates.
854

955
## [2.2.2] - 2017-11-23
1056
### Added
11-
- bullet chart figure factory. Call `help(plotly.figure_factory.create_bullet)` for examples and how to get started making bullet charts with the API.
57+
- Bullet chart figure factory. Call `help(plotly.figure_factory.create_bullet)` for examples and how to get started making bullet charts with the API.
1258

1359
## [2.2.1] - 2017-10-26
1460
### Fixed
15-
- presentation objects now added to setup.py
61+
- Presentation objects now added to setup.py
1662

1763
## [2.2.0] - 2017-10-26
1864
### Added

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# plotly.py
22

3-
> 📢 Announcement!
4-
> Seats are still available for a 2 day, Dash master class in NYC, November 18-19.
5-
> [Registration here](https://plotcon.plot.ly/workshops) 🎚 📈 🗽
3+
> 📢 Announcement!
4+
> Registration is open for a 2 day, Dash master class in Boston, April 14-15.
5+
> [Register online here](https://plotcon.plot.ly/tickets/) 🎚📈⚾️
66
77
***
88

circle.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ machine:
1212

1313
node:
1414
# use a pre-installed version of node so we don't need to download it.
15-
version: 4.2.2
15+
version: 6.0.0
1616

1717
dependencies:
1818

contributing.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ First, you'll need to *get* our project. This is the appropriate *clone* command
2323
**DO THIS (in the directory where you want the repo to live)**
2424

2525
```bash
26-
git clone https://github.com/plotly/python-api.git
26+
git clone https://github.com/your_github_username/plotly.py.git
2727
```
2828

2929
### Submodules
3030

3131
Second, this project uses git submodules! They're both helpful and, at times, difficult to work with. The good news is you probably don't need to think about them! Just run the following shell command to make sure that your local repo is wired properly:
3232

33-
**DO THIS (run this command in your new `plotly-api` directory)**
33+
**DO THIS (run this command in your new `plotly.py` directory)**
3434

3535
```bash
3636
make setup_subs

optional-requirements.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,8 @@ scipy
2828
## jupyter ##
2929
jupyter
3030
ipykernel
31+
32+
## deps for _county_choropleth.py figure factory
33+
pyshp
34+
geopandas
35+
shapely

plotly/colors.py

Lines changed: 51 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,60 @@
1818
floats between 0 and 1 inclusive.
1919
2020
-----
21-
Types of colormap:
21+
Colormaps and Colorscales:
22+
A colormap or a colorscale is a correspondence between values - Pythonic
23+
objects such as strings and floats - to colors.
24+
2225
There are typically two main types of colormaps that exist: numerical and
2326
categorical colormaps.
2427
25-
Numerical colormaps are used when a the coloring column being used takes a
26-
spectrum of values or numbers. Alternatively, a categorical colormap is used
27-
to assign a specific value in a color column to a specific color everytime it
28-
appears in the plot at hand. For instance, a column of strings in a dataframe
29-
would naturally use a categorical colormap. You can choose however to use a
30-
categorical colormap with a column of numbers. Be careful though, as if you
31-
have a large set of unique numbers in your column you'll get a lot of colors.
32-
28+
Numerical:
29+
----------
30+
Numerical colormaps are used when the coloring column being used takes a
31+
spectrum of values or numbers.
32+
33+
A classic example from the Plotly library:
34+
```
35+
rainbow_colorscale = [
36+
[0, 'rgb(150,0,90)'], [0.125, 'rgb(0,0,200)'],
37+
[0.25, 'rgb(0,25,255)'], [0.375, 'rgb(0,152,255)'],
38+
[0.5, 'rgb(44,255,150)'], [0.625, 'rgb(151,255,0)'],
39+
[0.75, 'rgb(255,234,0)'], [0.875, 'rgb(255,111,0)'],
40+
[1, 'rgb(255,0,0)']
41+
]
42+
```
43+
44+
Notice that this colorscale is a list of lists with each inner list containing
45+
a number and a color. These left hand numbers in the nested lists go from 0 to
46+
1, and they are like pointers tell you when a number is mapped to a specific
47+
color.
48+
49+
If you have a column of numbers `col_num` that you want to plot, and you know
50+
51+
```
52+
min(col_num) = 0
53+
max(col_num) = 100
54+
```
55+
56+
then if you pull out the number `12.5` in the list and want to figure out what
57+
color the corresponding chart element (bar, scatter plot, etc) is going to be,
58+
you'll figure out that proportionally 12.5 to 100 is the same as 0.125 to 1.
59+
So, the point will be mapped to 'rgb(0,0,200)'.
60+
61+
All other colors between the pinned values in a colorscale are linearly
62+
interpolated.
63+
64+
Categorical:
65+
------------
66+
Alternatively, a categorical colormap is used to assign a specific value in a
67+
color column to a specific color everytime it appears in the dataset.
68+
69+
A column of strings in a panadas.dataframe that is chosen to serve as the
70+
color index would naturally use a categorical colormap. However, you can
71+
choose to use a categorical colormap with a column of numbers.
72+
73+
Be careful! If you have a lot of unique numbers in your color column you will
74+
end up with a colormap that is massive and may slow down graphing performance.
3375
"""
3476
from __future__ import absolute_import
3577

0 commit comments

Comments
 (0)
0