Use draw_marker_at_points if possible otherwise use draw_path_at_points in ColormappedScatterPlot#672
Conversation
| # regression test for enthought/chaco#425 | ||
| def test_non_kiva_marker(self): | ||
| self.scatterplot.marker = "star" | ||
|
|
||
| self.gc.render_component(self.scatterplot) | ||
| actual = self.gc.bmp_array[:, :, :] | ||
| self.assertFalse(alltrue(actual == 255)) |
There was a problem hiding this comment.
I was being dumb before, it was trivial to write this regression test...
There was a problem hiding this comment.
Note this PR also fixes the test test_scatter_custom above once enthought/enable#782 is pushed through that test can be unskipped.
| mode = marker_cls.draw_mode | ||
|
|
||
| if marker_cls != "custom": | ||
| if self.marker != "custom": |
There was a problem hiding this comment.
marker_cls is not a string, but the actual class e.g. <class 'enable.markers.CustomMarker'>
|
|
||
| else: | ||
| path = marker_cls.custom_symbol | ||
| path = self.custom_symbol |
There was a problem hiding this comment.
custom_symbol is a trait on the ColormappedScatterPlot, not the marker. For example use, see test test_scatter_custom.
|
|
||
| else: | ||
| path = marker_cls.custom_symbol | ||
| path = self.custom_symbol |
There was a problem hiding this comment.
custom_symbol is a trait on the ColormappedScatterPlot, not the marker. For example use, see test test_scatter_custom.
rahulporuri
left a comment
There was a problem hiding this comment.
LGTM. Do you want to open a separate issue about removing the test skip once we have a new enable?
|
I've opened #686 |
fixes #425
This can close issue #232 as well after enthought/enable#782 is merged
In enable:
https://github.com/enthought/enable/blob/master/enable/markers.py
some markers have a defined
kiva_markerwhile others simply define an_add_to_pathmethod detailing how to draw the marker manually. If the marker haskiva_markerwe can usedraw_marker_at_points, but if it doesn't we need to fall back to manually drawing the path via the_add_to_pathmethod and callingdraw_path_at_points.