首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >不支持在DynamicMap中嵌套DynamicMap

不支持在DynamicMap中嵌套DynamicMap
EN

Stack Overflow用户
提问于 2019-09-20 15:17:28
回答 2查看 311关注 0票数 1

我为不同的时间序列绘制了不同的时间序列图,我制作了全息图,现在我正在绘制不同的经度范围全息图,然后我得到了异常:-异常:不支持在DynamicMap中嵌套DynamicMap。确保DynamicMap回调返回一个元素或(Nd)覆盖。如果已应用某个操作,请通过设置dynamic=False来确保该操作不是动态的。

:DynamicMap Lat and Lon::DynamicMap Date and Time :I not Lat as not of dynamicmap,

我试着在最后的图中进行栅格化。它不起作用

代码语言:javascript
运行
复制
    latlon_selPLot={f'lat:{k[0]} lon:{k[1]}':finalplot(k) for k in 
    [[(12,15),(80,85)],[(13,18),(81,95)]]}
    dd=df_div.opts(width=200, height=100)
    hmap11 = hv.HoloMap(latlon_selPLot, kdims='Lat and Lon :' )
    tiles*rasterize(hmap11)



 # Below is the code i am using , where i have to make change , 
 # so that i get holomap of lat_lon_selPlot when i select one 
 #lat_lon range then that particular area plot is shown .


 allplot={k.strftime("%Y-%m-%d %H:%M:%S"):plotthis(k)for k in 
 perdelta(strt, strt + timedelta(days=1), timedelta(hours=18))}
 allplot2={k.strftime("%Y-%m-%d %H:%M:%S"):plotsecond(k)for k in 
 perdelta(strt, strt + timedelta(days=1), timedelta(hours=18))}
 ....

 tiles = gv.tile_sources.Wikipedia
 hmap1 = hv.HoloMap(allplot, kdims='Date and Time :' )
 hmap2 = hv.HoloMap(allplot2, kdims='Date and Time :')

def finalplot(rng):

        finalplot=rasterize(hmap1.redim.range(Latitude=rng[0], 
        Longitude=rng[1])).options(**opts)*hmap2
        return finalplot

latlon_selPLot={f'lat:{k[0]} lon:{k[1]}':finalplot(k) for k in 
[[(12,15),(80,85)],[(13,18),(81,95)]]}
dd=df_div.opts(width=200, height=100)
hmap11 = hv.HoloMap(latlon_selPLot, kdims='Lat and Lon :' )
tiles*hmap11

我希望我的lat_lon_selPlot全息图也能工作。

EN

Stack Overflow用户

发布于 2019-09-20 20:59:26

为了只选择选定的经度范围,我正在执行另一个panel.select过程。但是首先选择了select.value,当我更改另一个的select.value时,绘图不会改变。如何连接jlink,我的jlink正确吗?

代码语言:javascript
运行
复制
tiles = gv.tile_sources.Wikipedia
hmap1 = hv.HoloMap(allplot, kdims='Date and Time :' )
hmap2 = hv.HoloMap(allplot2, kdims='Date and Time :')
finalplot=tiles*rasterize(hmap1).options(**opts)*hmap2
dd=df_div.opts(width=200, height=100)

select = pn.widgets.Select(name='States', options=['TN','AP', 'Odisha'])
 latmin = [7, 13, 19]
 latmax = [14, 19, 22]
 longmin = [77, 79, 85]
 longmax = [83, 85, 88]
if (select.value=='TN'):
    hhmap = rasterize(hmap1.redim.range(Latitude=(latmin[0],latmax[0]), Longitude= 
 (longmin[0], longmax[0])))
   select.jslink(finalplot, value='object')
    finalplot=tiles*hhmap*hmap2

 elif (select.value=='AP'):
      hhmap =rasterize(hmap1.redim.range(Latitude=(latmin[1],latmax[1]), Longitude= 
 (longmin[1], longmax[1]))).options(**opts)
   select.jslink(finalplot, value='object')
    finalplot=tiles*rasterize(hhmap)*hmap2

else:
    hhmap = rasterize(hmap1.redim.range(Latitude=(latmin[2],latmax[2]), Longitude= 
   (longmin[2], longmax[2]))).options(**opts)
    select.jslink(finalplot, value='Odisha')
    finalplot=tiles*rasterize(hhmap)*hmap2
 # else:
 #     tiles*rasterize(hmap1).options(**opts)*hmap2

 finalplot=tiles*rasterize(hhmap).options(**opts)*hmap2
  finalplot=pn.Column(dd, finalplot, select).servable()    
  # finalplot=pn.Column(dd, finalplot).servable()
 finalplot

如何链接另一个select.value选项,以便在select.value更改时出现不同绘图?

票数 1
EN
查看全部 2 条回答
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/58023542

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档