|
1 | 1 | import numpy as np
|
2 | 2 | import pandas as pd
|
3 |
| -from bokeh.models import FactorRange, HoverTool, Range1d |
| 3 | +from bokeh.models import FactorRange, HoverTool, Image as bkImage, Range1d |
4 | 4 |
|
5 | 5 | from holoviews.element import HeatMap, Image, Points
|
6 | 6 |
|
@@ -97,10 +97,15 @@ def test_heatmap_invert_axes(self):
|
97 | 97 | arr = np.array([[0, 1, 2], [3, 4, 5]])
|
98 | 98 | hm = HeatMap(Image(arr)).opts(invert_axes=True)
|
99 | 99 | plot = bokeh_renderer.get_plot(hm)
|
100 |
| - source = plot.handles['source'] |
101 |
| - self.assertEqual(source.data['zvalues'], hm.dimension_values(2, flat=False).T.flatten()) |
102 |
| - self.assertEqual(source.data['x'], hm.dimension_values(1)) |
103 |
| - self.assertEqual(source.data['y'], hm.dimension_values(0)) |
| 100 | + assert plot._is_contiguous_gridded is True |
| 101 | + assert isinstance(plot.handles["glyph"], bkImage) |
| 102 | + |
| 103 | + data = plot.handles['source'].data |
| 104 | + np.testing.assert_equal(data['image'][0], hm.dimension_values(2, flat=False).T) |
| 105 | + assert data["x"] == [-0.5] |
| 106 | + assert data["y"] == [-0.5] |
| 107 | + assert data["dw"] == [1] |
| 108 | + assert data["dh"] == [1] |
104 | 109 |
|
105 | 110 | def test_heatmap_dilate(self):
|
106 | 111 | hmap = HeatMap([('A',1, 1), ('B', 2, 2)]).opts(dilate=True)
|
|
0 commit comments