Skip to content

Commit d561039

Browse files
authored
Merge pull request tdhopper#7 from tdhopper/richard-muir-plotly
Add Richard Muir's plotly examples
2 parents 988b4a7 + 61e29ac commit d561039

File tree

7 files changed

+828
-161
lines changed

7 files changed

+828
-161
lines changed

.travis/authenticate_plotly.py

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import plotly
2+
import os
3+
plotly.tools.set_credentials_file(username=os.environ.get('PLOTLY_USER'), api_key=os.environ.get('PLOTLY_API_KEY'))

Examples.ipynb

+802-144
Large diffs are not rendered by default.

Makefile

+5-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@ clean:
1010
rm -f *.pyc
1111
rm -f .Rhistory
1212

13-
travis: test render
13+
travis: plotly_auth test render
14+
15+
plotly_auth:
16+
python ./.travis/authenticate_plotly.py
1417

1518
test:
1619
python -m pytest tests/
@@ -34,4 +37,4 @@ dev_environment:
3437
cloudfront_invalidate:
3538
python .travis/invalidate_cloudfront.py
3639

37-
.PHONY: all qrender render s3_upload run_nb travis clean cloudfront_invalidate test dev_environment
40+
.PHONY: all qrender render s3_upload run_nb travis clean cloudfront_invalidate test dev_environment plotly_auth

environment.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ dependencies:
66
- python>=3.6
77
- pip
88
- r-essentials
9-
- r:rpy2
9+
- rpy2

render.py

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"plotnine": "plotnine",
2424
"ggplot": "ggplot2 (R)",
2525
"bokeh": "Bokeh",
26+
"plotly": "plotly",
2627
}
2728

2829
names = {

requirements.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,6 @@ jinja2-highlight
1111
markdown
1212
scikit-misc
1313
boto3
14-
pytest
14+
pytest
15+
plotly
16+
statsmodels

tests/test_plots.py

+13-13
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
import render
22

3-
defined_plots = {'bar-counts': ['pandas', 'plotnine', 'ggplot', ],
4-
'dodged-bar-chart': ['pandas', 'plotnine', 'ggplot', ],
5-
'scatter-plot': ['pandas', 'plotnine', 'ggplot', ],
3+
defined_plots = {'bar-counts': ['pandas', 'plotnine', 'ggplot', 'plotly', ],
4+
'dodged-bar-chart': ['pandas', 'plotnine', 'ggplot', 'plotly', ],
5+
'scatter-plot': ['pandas', 'plotnine', 'ggplot', 'plotly', ],
66
'scatter-plot-with-colors': ['matplotlib',
77
'seaborn',
88
'plotnine',
99
'ggplot',
10-
],
11-
'scatter-plot-with-facet': ['seaborn', 'plotnine', 'ggplot', ],
12-
'scatter-plot-with-facets': ['seaborn', 'plotnine', 'ggplot', ],
13-
'scatter-plot-with-size': ['pandas', 'plotnine', 'ggplot', ],
14-
'scatter-with-regression': ['seaborn', 'plotnine', 'ggplot', ],
15-
'simple-histogram': ['pandas', 'matplotlib', 'plotnine', 'ggplot', ],
16-
'stacked-bar-chart': ['pandas', 'plotnine', 'ggplot', ],
17-
'stacked-kde': ['pandas', 'seaborn', 'plotnine', 'ggplot', ],
18-
'stacked-smooth-line-and-scatter': ['plotnine', 'ggplot', ],
19-
'timeseries': ['pandas', 'plotnine', 'ggplot', ]}
10+
'plotly', ],
11+
'scatter-plot-with-facet': ['seaborn', 'plotnine', 'ggplot', 'plotly', ],
12+
'scatter-plot-with-facets': ['seaborn', 'plotnine', 'ggplot', 'plotly', ],
13+
'scatter-plot-with-size': ['pandas', 'plotnine', 'ggplot', 'plotly', ],
14+
'scatter-with-regression': ['seaborn', 'plotnine', 'ggplot', 'plotly', ],
15+
'simple-histogram': ['pandas', 'matplotlib', 'plotnine', 'ggplot', 'plotly', ],
16+
'stacked-bar-chart': ['pandas', 'plotnine', 'ggplot', 'plotly', ],
17+
'stacked-kde': ['pandas', 'seaborn', 'plotnine', 'ggplot', 'plotly', ],
18+
'stacked-smooth-line-and-scatter': ['plotnine', 'ggplot', 'plotly', ],
19+
'timeseries': ['pandas', 'plotnine', 'ggplot', 'plotly', ]}
2020

2121

2222
def test_exist():

0 commit comments

Comments
 (0)