-
-
Notifications
You must be signed in to change notification settings - Fork 77
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
Add a Gallery #121
Merged
+2,322
−170
Merged
Add a Gallery #121
Changes from all commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
04b14de
WIP: beginning to add gallery.
ceball 8c10a38
Syntax fixup
ceball 551d0f3
Added missing dependencies for bokeh png export.
ceball 7d39e35
Upload website to preview location.
ceball b63b395
Whitespace fix
ceball 9ba8fca
Syntax fixup.
ceball 17ebe30
Added initial gallery examples
philippjfr c9f5a26
Added and fixed gallery examples
philippjfr de22dc7
Generate only matplotlib and bokeh galleries. Also, newer nbsite_gall…
ceball 995567a
Allow us to see gallery during this PR.
ceball 54ddfd9
Fix syntax.
ceball 2355dd6
Fixed katrina_track example legend
philippjfr 8e891a8
Download bokeh sampledata
philippjfr 99ade65
Skip apps for now.
ceball 4748161
One or more gallery notebooks depend on user guide assets.
ceball b3bb13e
Add world_population gallery example
philippjfr 327f427
Add transparent favicon
philippjfr 7898716
Set orthographic_vectorfield example options
philippjfr a4e2312
Add xarray Image example
philippjfr 38ac20c
Cropped favicon
philippjfr b3cc3c6
Added great_circle example
philippjfr b2fe65d
Fixed bad merge
philippjfr 2d21e67
Use nbsite conda package.
ceball 8e54f32
Fixed fixed bad merge.
ceball 79f35e3
Fixed bugs in Shape
philippjfr 1ee32b4
Simplified orthographic_vectorfield example
philippjfr 251cc6c
Minor fix for bokeh filled_contours example
philippjfr ec23e5c
Added Resampling Grids notebook to user guide
philippjfr 2003ae0
Rewrote projection user guide
philippjfr b0832ca
Updated Homepage
philippjfr d42035d
Move assets to correct location on travis
philippjfr 3c90ba4
Fixed Gridded dataset notebooks
philippjfr c9fd070
Removed TriMesh resampling section
philippjfr 54a3baa
Attempt to simplify travis.yml
philippjfr 97d3578
Simplified Gridded Datasets notebook
philippjfr de77ee5
Build docs on commits to master
philippjfr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Binary file not shown.
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 |
---|---|---|
|
@@ -20,6 +20,7 @@ | |
|
||
_NAV = ( | ||
('User Guide', 'user_guide/index'), | ||
('Gallery', 'gallery/index'), | ||
('About', 'about') | ||
) | ||
|
||
|
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
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,88 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"import pandas as pd\n", | ||
"import holoviews as hv\n", | ||
"import geoviews as gv\n", | ||
"from bokeh.sampledata.airport_routes import airports, routes\n", | ||
"\n", | ||
"hv.extension('bokeh')" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"## Define data" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"# Count the number of connections from each airport\n", | ||
"counts = routes.groupby('SourceID')[['Stops']].count().reset_index().rename(columns={'Stops': 'Connections'})\n", | ||
"airports_df = pd.merge(airports, counts, left_on='AirportID', right_on='SourceID', how='left')\n", | ||
"\n", | ||
"# Select only US mainland airports & convert from Mercator to Latitudes/Longitudes\n", | ||
"airport_points = gv.Points(airports_df, ['Longitude', 'Latitude']).select(Longitude=(-170, -50), Latitude=(0, 50))\n", | ||
"\n", | ||
"# Declare nodes, graph and tiles\n", | ||
"nodes = gv.Nodes(airport_points, ['Longitude', 'Latitude', 'AirportID'],\n", | ||
" ['Name', 'City', 'Connections'])\n", | ||
"graph = gv.Graph((routes, nodes), ['SourceID', 'DestinationID'], ['Source', 'Destination'])\n", | ||
"tiles = gv.WMTS('https://maps.wikimedia.org/osm-intl/{Z}/{X}/{Y}@2x.png')\n", | ||
"\n", | ||
"# Select 50 busiest airports\n", | ||
"busiest = list(routes.groupby('SourceID').count().sort_values('Stops').iloc[-50:].index.values)\n", | ||
"busiest_airports = graph.select(AirportID=busiest, selection_mode='nodes')" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"## Plot" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"%%opts Graph [width=800 height=600] (edge_selection_line_color='black' edge_hover_line_color='red')\n", | ||
"%%opts Graph (edge_line_width=1 edge_line_alpha=0.01 edge_nonselection_line_alpha=0.01)\n", | ||
"tiles * busiest_airports" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.6.3" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 2 | ||
} |
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,75 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"import pandas as pd\n", | ||
"import geopandas as gpd\n", | ||
"import holoviews as hv\n", | ||
"import geoviews as gv\n", | ||
"\n", | ||
"hv.extension('bokeh')" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"## Declaring data" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"geometries = gpd.read_file('../../user_guide/assets/boundaries/boundaries.shp')\n", | ||
"referendum = pd.read_csv('../../user_guide/assets/referendum.csv')\n", | ||
"gdf = gpd.GeoDataFrame(pd.merge(geometries, referendum))" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"## Plot" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"plot_opts = dict(tools=['hover'], width=550, height=700, color_index='leaveVoteshare',\n", | ||
" colorbar=True, toolbar='above', xaxis=None, yaxis=None)\n", | ||
"gv.Polygons(gdf, vdims=['name', 'leaveVoteshare'], label='Brexit Referendum Vote').opts(plot=plot_opts)" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.6.3" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 2 | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something went wrong for you in a rebase and/or merge? This should be a comment (
# TODO: ...
).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bizarre, no idea how that could possibly happen. That said, master seem to have been building okay. Will fix it some time today.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Presumably manual error during merge? Anyway, I like the idea of travis having a TODO key, which you use to tell it what to do in the future. But evidently they haven't implemented that yet...