本文整理汇总了Python中holoviews.core.spaces.DynamicMap._split_overlays方法的典型用法代码示例。如果您正苦于以下问题:Python DynamicMap._split_overlays方法的具体用法?Python DynamicMap._split_overlays怎么用?Python DynamicMap._split_overlays使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类holoviews.core.spaces.DynamicMap
的用法示例。
在下文中一共展示了DynamicMap._split_overlays方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_dynamic_split_overlays_on_ndoverlay
# 需要导入模块: from holoviews.core.spaces import DynamicMap [as 别名]
# 或者: from holoviews.core.spaces.DynamicMap import _split_overlays [as 别名]
def test_dynamic_split_overlays_on_ndoverlay(self):
dmap = DynamicMap(lambda: NdOverlay({i: Points([i]) for i in range(3)}))
initialize_dynamic(dmap)
keys, dmaps = dmap._split_overlays()
self.assertEqual(keys, [(0,), (1,), (2,)])
self.assertEqual(dmaps[0][()], Points([0]))
self.assertEqual(dmaps[1][()], Points([1]))
self.assertEqual(dmaps[2][()], Points([2]))
示例2: test_dynamic_split_overlays_on_varying_order_overlay
# 需要导入模块: from holoviews.core.spaces import DynamicMap [as 别名]
# 或者: from holoviews.core.spaces.DynamicMap import _split_overlays [as 别名]
def test_dynamic_split_overlays_on_varying_order_overlay(self):
def cb(i):
if i%2 == 0:
return Curve([]) * Points([])
else:
return Points([]) * Curve([])
dmap = DynamicMap(cb, kdims='i').redim.range(i=(0, 4))
initialize_dynamic(dmap)
keys, dmaps = dmap._split_overlays()
self.assertEqual(keys, [('Curve', 'I'), ('Points', 'I')])
self.assertEqual(dmaps[0][0], Curve([]))
self.assertEqual(dmaps[0][1], Curve([]))
self.assertEqual(dmaps[1][0], Points([]))
self.assertEqual(dmaps[1][1], Points([]))
示例3: test_dynamic_split_overlays_on_missing_item_in_overlay
# 需要导入模块: from holoviews.core.spaces import DynamicMap [as 别名]
# 或者: from holoviews.core.spaces.DynamicMap import _split_overlays [as 别名]
def test_dynamic_split_overlays_on_missing_item_in_overlay(self):
def cb(i):
if i%2 == 0:
return Curve([]) * Points([])
else:
return Scatter([]) * Curve([])
dmap = DynamicMap(cb, kdims='i').redim.range(i=(0, 4))
initialize_dynamic(dmap)
keys, dmaps = dmap._split_overlays()
self.assertEqual(keys, [('Curve', 'I'), ('Points', 'I')])
self.assertEqual(dmaps[0][0], Curve([]))
self.assertEqual(dmaps[0][1], Curve([]))
self.assertEqual(dmaps[1][0], Points([]))
with self.assertRaises(KeyError):
dmaps[1][1]