-
-
Notifications
You must be signed in to change notification settings - Fork 404
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
Reimplement Path, Contours and Polygons plots #1991
Merged
Merged
Changes from all commits
Commits
Show all changes
39 commits
Select commit
Hold shift + click to select a range
1321c4b
Added scalar validation to interfaces and Contours
philippjfr 8e7e682
Fixed MultiInterface dimension_values expand
philippjfr 68d3605
Improved functionality of Path.split
philippjfr 25c1e22
Reimplemented bokeh PathPlots based on new interface
philippjfr d1c9c01
Rewrote contours operation using new interface
philippjfr 10b6dc8
Small fixes to bokeh path plots
philippjfr 8000134
Fixed Contours levels deprecation warning
philippjfr a5e7411
Rewrote matplotlib path plots
philippjfr 9adf459
Small fixes for mpl path plots
philippjfr 8db534a
Fixes for levels in contours operation
philippjfr 17ea673
Optimized datashader path splitting
philippjfr 115ac00
Added support for passing stacked arrays to DictInterface
philippjfr ea5d64e
Overhauled docs with recent path improvements
philippjfr d0e2f2d
Small fixes for Path constructor
philippjfr a69a622
Fixes for contours operation
philippjfr 4d9f5ee
Fixed Path colorbars
philippjfr 2cc0e42
Improved contours operation
philippjfr 8cdb15b
Fixes for dictionary interface
philippjfr c7493af
Fixed Path comparisons
philippjfr 712d04b
Small fixes for contours operation
philippjfr 7debba1
Updated path comparison tests
philippjfr 343b49a
Updated multi-interface test
philippjfr 39f7a82
Updated contours operation tests
philippjfr a237e85
Minor fix for Path hover opts
philippjfr 9a4c335
Small fix for Path matplotlib plot
philippjfr 5d88475
Updated example notebooks for contours operation changes
philippjfr c2cd257
Simplified texas choropleth examples
philippjfr 93088bb
Minor fix for dictionary interface
philippjfr 13fb334
Prefer dictionary interface as MultiInterface subtype
philippjfr 4027f06
Removed dimension range from filled contours
philippjfr b1b95f2
Small fixes to path tests
philippjfr 96de1b0
Fixed MultiInterface validation
philippjfr 1e75ffa
Optimized graph edgepaths plotting
philippjfr 14a91b1
Small fix for MultiInterface validation
philippjfr 1711099
Add class attribute to denote multi interfaces
philippjfr 1b2602d
Ensure splitting MultiInterface does not expand dictionary data
philippjfr 0a73811
Improved Path.split when not using multi-interface
philippjfr bf217c5
Added static_datasource optimization for bokeh paths
philippjfr 6e9ec29
Addressed various review comments
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
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 |
---|---|---|
|
@@ -38,20 +38,11 @@ | |
"from bokeh.sampledata.us_counties import data as counties\n", | ||
"from bokeh.sampledata.unemployment import data as unemployment\n", | ||
"\n", | ||
"counties = {\n", | ||
" code: county for code, county in counties.items() if county[\"state\"] == \"tx\"\n", | ||
"}\n", | ||
"counties = [dict(county, Unemployment=unemployment[cid])\n", | ||
" for cid, county in counties.items()\n", | ||
" if county[\"state\"] == \"tx\"]\n", | ||
"\n", | ||
"county_xs = [county[\"lons\"] for county in counties.values()]\n", | ||
"county_ys = [county[\"lats\"] for county in counties.values()]\n", | ||
"\n", | ||
"county_names = [county['name'] for county in counties.values()]\n", | ||
"county_rates = [unemployment[county_id] for county_id in counties]\n", | ||
"\n", | ||
"county_polys = {name: hv.Polygons((xs, ys), level=rate, vdims=['Unemployment'])\n", | ||
" for name, xs, ys, rate in zip(county_names, county_xs, county_ys, county_rates)}\n", | ||
"\n", | ||
"choropleth = hv.NdOverlay(county_polys, kdims=['County'])" | ||
"choropleth = hv.Polygons(counties, ['lons', 'lats'], [('detailed name', 'County'), 'Unemployment'])" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I assume the old code still works and the new approach is just more succinct/flexible/efficient. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Right. |
||
] | ||
}, | ||
{ | ||
|
@@ -68,10 +59,11 @@ | |
"outputs": [], | ||
"source": [ | ||
"plot_opts = dict(logz=True, tools=['hover'], xaxis=None, yaxis=None,\n", | ||
" show_grid=False, show_frame=False, width=500, height=500)\n", | ||
" show_grid=False, show_frame=False, width=500, height=500,\n", | ||
" color_index='Unemployment', colorbar=True, toolbar='above')\n", | ||
"style = dict(line_color='white')\n", | ||
"\n", | ||
"choropleth({'Polygons': {'style': style, 'plot': plot_opts}})" | ||
"choropleth.opts(style=style, plot=plot_opts)" | ||
] | ||
} | ||
], | ||
|
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
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
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.
Doesn't this have implications for backwards compatibility?
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.
Guess it has some, it's no longer
overlaid
by default. I could have made it be overlaid again but I generally don't want to.