Skip to content
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

`value` not updating (on objects with matching hashes?) #808

Closed
jsignell opened this issue Nov 21, 2019 · 0 comments · Fixed by #816
Closed

`value` not updating (on objects with matching hashes?) #808

jsignell opened this issue Nov 21, 2019 · 0 comments · Fixed by #816
Labels
Milestone

Comments

@jsignell
Copy link
Member

@jsignell jsignell commented Nov 21, 2019

value is not updating when a new value is selected for the selection widget. I am fairly confident this is a regression having to do with how panel hashes objects in widget option dicts.

example

import geoviews as gv
import geoviews.tile_sources as gvts
import panel as pn

gv.extension('bokeh')
basemap = pn.widgets.Select(options=gvts.tile_sources)

@pn.depends(basemap=basemap)
def view(basemap):
    return basemap

pn.Row(basemap, view)

context

This is the repr of gvts.tile_sources:

{'CartoDark': :WMTS   [Longitude,Latitude],
 'CartoEco': :WMTS   [Longitude,Latitude],
 'CartoLight': :WMTS   [Longitude,Latitude],
 'CartoMidnight': :WMTS   [Longitude,Latitude],
 'StamenTerrain': :WMTS   [Longitude,Latitude],
 'StamenTerrainRetina': :WMTS   [Longitude,Latitude],
 'StamenWatercolor': :WMTS   [Longitude,Latitude],
 'StamenToner': :WMTS   [Longitude,Latitude],
 'StamenTonerBackground': :WMTS   [Longitude,Latitude],
 'StamenLabels': :WMTS   [Longitude,Latitude],
 'EsriImagery': :WMTS   [Longitude,Latitude],
 'EsriNatGeo': :WMTS   [Longitude,Latitude],
 'EsriUSATopo': :WMTS   [Longitude,Latitude],
 'EsriTerrain': :WMTS   [Longitude,Latitude],
 'EsriReference': :WMTS   [Longitude,Latitude],
 'EsriOceanBase': :WMTS   [Longitude,Latitude],
 'EsriOceanReference': :WMTS   [Longitude,Latitude],
 'OSM': :WMTS   [Longitude,Latitude],
 'Wikipedia': :WMTS   [Longitude,Latitude]}

workaround

basemap = pn.widgets.Select(options=list(gvts.tile_sources.keys()))

@pn.depends(basemap=basemap)
def view(basemap):
    return getattr(gvts, basemap)()

pn.Row(basemap, view)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.