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
type: bug Something isn't correct or isn't working
Milestone

Comments

@jsignell
Copy link
Member

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)
@jsignell jsignell added the TRIAGE Default label for untriaged issues label Nov 21, 2019
@philippjfr philippjfr added type: bug Something isn't correct or isn't working and removed TRIAGE Default label for untriaged issues labels Nov 22, 2019
@philippjfr philippjfr added this to the v0.7.1 milestone Nov 22, 2019
@philippjfr philippjfr modified the milestones: v0.7.1, v0.8.0 Jan 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't correct or isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants