From d996babb94af47894154a46cfe689824143ce654 Mon Sep 17 00:00:00 2001 From: Poruri Sai Rahul Date: Fri, 16 Apr 2021 16:06:48 +0530 Subject: [PATCH 1/2] FIX : Listen to the right trait in MultiLinePlot.amplitude_scale previously we were listening to the non-existent "data" trait which should have been "value._data". Once this change is made, the multi_line_plot.py and multi_line_plot_demo.py demos work as expected and without this change, they both crash with a traits observe error modified: chaco/multi_line_plot.py --- chaco/multi_line_plot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chaco/multi_line_plot.py b/chaco/multi_line_plot.py index 6b47476e4..8eb113038 100644 --- a/chaco/multi_line_plot.py +++ b/chaco/multi_line_plot.py @@ -143,7 +143,7 @@ class MultiLinePlot(BaseXYPlot): observe=[ "global_min", "global_max", - "data", + "value._data", "use_global_bounds", "yindex", ], From e5f4d9df952cbc7ad2a22d12fa861278845f082a Mon Sep 17 00:00:00 2001 From: Poruri Sai Rahul Date: Fri, 16 Apr 2021 16:22:09 +0530 Subject: [PATCH 2/2] FIX : load as bytes and store to bytes for image data this fixes the javascript hover tools advanced example modified: examples/demo/advanced/javascript_hover_tools.py --- examples/demo/advanced/javascript_hover_tools.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/demo/advanced/javascript_hover_tools.py b/examples/demo/advanced/javascript_hover_tools.py index 681be3ba8..ef5792ea2 100644 --- a/examples/demo/advanced/javascript_hover_tools.py +++ b/examples/demo/advanced/javascript_hover_tools.py @@ -531,11 +531,11 @@ def make_palettized_png_str(gc): format = gc.format()[:-2].upper() if format != "RGBA": gc = gc.convert_pixel_format("rgba32") - img = Image.fromstring( + img = Image.frombytes( "RGBA", (gc.width(), gc.height()), gc.bmp_array.tostring() ) img2 = img.convert("P") - output_buf = io.StringIO() + output_buf = io.BytesIO() img2.save(output_buf, "png") output = encodestring(output_buf.getvalue()) output_buf.close()