Skip to content

Commit 815bf87

Browse files
committed
try altair
1 parent 4ef0b9d commit 815bf87

File tree

4 files changed

+39
-3
lines changed

4 files changed

+39
-3
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,4 @@ deploy:
2424
all_branches: true
2525
addons:
2626
artifacts: true
27+
chrome: stable

Examples.ipynb

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"source": [
99
"%matplotlib inline\n",
1010
"\n",
11+
"import altair\n",
1112
"import pandas as pd\n",
1213
"import seaborn as sns\n",
1314
"from matplotlib import pyplot\n",
@@ -302,6 +303,40 @@
302303
"Image(fig.to_image(format=\"png\", width=900, height=900))"
303304
]
304305
},
306+
{
307+
"cell_type": "code",
308+
"execution_count": null,
309+
"metadata": {},
310+
"outputs": [],
311+
"source": [
312+
"from io import BytesIO\n",
313+
"\n",
314+
"def render_altair(chart):\n",
315+
" b = BytesIO()\n",
316+
" chart.save(b, scale_factor=2.0)\n",
317+
" return b"
318+
]
319+
},
320+
{
321+
"cell_type": "code",
322+
"execution_count": null,
323+
"metadata": {
324+
"tags": [
325+
"ex",
326+
"name:bar-counts",
327+
"package:altair"
328+
]
329+
},
330+
"outputs": [],
331+
"source": [
332+
"chart = (\n",
333+
" altair.Chart(mpg, title=\"Number of Cars by Make\")\n",
334+
" .mark_bar()\n",
335+
" .encode(x=\"count()\", y=alt.Y(\"manufacturer\"))\n",
336+
")\n",
337+
"Image(render_altair(chart))"
338+
]
339+
},
305340
{
306341
"cell_type": "markdown",
307342
"metadata": {},

netlify_deploy.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
#!/bin/bash
22

3-
if [ $TRAVIS_BRANCH = "foo" ]; then
3+
if [ $TRAVIS_BRANCH = "master" ]; then
44
netlify deploy \
55
--auth $NETLIFY_AUTH_TOKEN \
66
--site $NETLIFY_SITE_ID \
77
--dir ./web \
88
--prod \
99
--message "Production deploy from Travis CI"
10-
else
10+
else
1111
netlify deploy \
1212
--auth $NETLIFY_AUTH_TOKEN \
1313
--site $NETLIFY_SITE_ID \
1414
--dir ./web \
1515
--message "Preview deploy from Travis CI" \
16-
--prod
1716
fi

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,4 @@ plotly
1919
tzlocal
2020
simplegeneric
2121
altair
22+
selenium

0 commit comments

Comments
 (0)