From e88d6885aa792800d3724409b843c34e5fdef5d4 Mon Sep 17 00:00:00 2001 From: Philipp Rudiger Date: Mon, 8 Jun 2020 03:55:49 +0200 Subject: [PATCH] Support datetimes in bokeh RectanglesPlot --- holoviews/plotting/bokeh/geometry.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/holoviews/plotting/bokeh/geometry.py b/holoviews/plotting/bokeh/geometry.py index 407cde9489..7e90993945 100644 --- a/holoviews/plotting/bokeh/geometry.py +++ b/holoviews/plotting/bokeh/geometry.py @@ -61,7 +61,12 @@ def get_data(self, element, ranges, style): x0, y0, x1, y1 = (element.dimension_values(kd) for kd in inds) x0, x1 = np.min([x0, x1], axis=0), np.max([x0, x1], axis=0) y0, y1 = np.min([y0, y1], axis=0), np.max([y0, y1], axis=0) - data = {'x': (x1+x0)/2., 'y': (y1+y0)/2., 'width': x1-x0, 'height': y1-y0} + data = { + 'x': x0+(x1-x0)/2., + 'y': x0+(x1-x0)/2., + 'width': x1-x0, + 'height': y1-y0 + } mapping = {'x': 'x', 'y': 'y', 'width': 'width', 'height': 'height'} self._get_hover_data(data, element) return data, mapping, style