def test_get_range_from_element(self): dim = Dimension('y', soft_range=(0, 3), range=(0, 2)) element = Scatter([1, 2, 3], vdims=dim) drange, srange, hrange = get_range(element, {}, dim) self.assertEqual(drange, (1, 3)) self.assertEqual(srange, (0, 3)) self.assertEqual(hrange, (0, 2))
def test_get_range_from_ranges(self): dim = Dimension('y', soft_range=(0, 3), range=(0, 2)) element = Scatter([1, 2, 3], vdims=dim) ranges = {'y': {'soft': (-1, 4), 'hard': (-1, 3), 'data': (-0.5, 2.5)}} drange, srange, hrange = get_range(element, ranges, dim) self.assertEqual(drange, (-0.5, 2.5)) self.assertEqual(srange, (-1, 4)) self.assertEqual(hrange, (-1, 3))