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

Allow overlay on a dynamicmap nested in a dynamicmap #4089

wants to merge 1 commit into
base: master


Copy link

jsignell commented Nov 8, 2019

This came up on gitter. The following:

import xarray as xr
import hvplot.xarray

dz = xr.tutorial.open_dataset('air_temperature')
dz2 = xr.concat([dz.assign_coords({'group': "exp1"}), dz.assign_coords({'group': "exp2"})], 'group')
dz2.hvplot('lon', 'lat', frame_width=200, coastline=True).layout('group')

was failing with the error:

~/holoviews/holoviews/plotting/ in split_dmap_overlay(obj, depth)
    217     layers = []
    218     if isinstance(obj, DynamicMap):
--> 219         if issubclass(obj.type, NdOverlay) and not depth:
    220             for v in obj.last.values():
    221                 layers.append(obj)

TypeError: issubclass() arg 1 must be a class

:NdLayout   [group]
   :DynamicMap   [time]
         .Image.I     :Image   [lon,lat]   (air)
         .Coastline.I :Feature   [Longitude,Latitude]

With this PR, overlaying on a dynamicmap inside a dynamicmap now works.

for inp in obj.callback.inputs:
layers += split_dmap_overlay(inp, depth+1)
if obj.type is not None:

This comment has been minimized.

Copy link

philippjfr Nov 8, 2019


I had looked at this at some point and didn't understand why obj.type would ever be None at this point. Do you have any idea?

This comment has been minimized.

Copy link

jsignell Nov 8, 2019

Author Collaborator

I assumed it was because it is a DynamicMap and not yet computed or something, but I honestly have no idea. The depth was 2 on that if that provides any insight.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
2 participants
You can’t perform that action at this time.