Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion chaco/abstract_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ class AbstractController(Interactor):
def __init__(self, component, *args, **kw):
self.component = component
super(AbstractController, self).__init__(*args, **kw)
return

def deactivate(self, component):
""" This method is called by the component when this controller is no
Expand Down
3 changes: 0 additions & 3 deletions chaco/abstract_mapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,12 @@ def map_screen(self, data_array):

Maps values from data space into screen space.
"""
return

def map_data(self, screen_val):
""" map_data(screen_val) -> data_val

Maps values from screen space into data space.
"""
return

def map_data_array(self, screen_vals):
""" map_data_array(screen_vals) -> data_vals
Expand All @@ -63,4 +61,3 @@ def __getstate__(self):
def _post_load(self):
self._cache_valid = False
self._range_changed(None, self.range)
return
2 changes: 0 additions & 2 deletions chaco/abstract_overlay.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,10 @@ def _draw(self, gc, view_bounds=None, mode="normal"):
self.overlay(self.component, gc, view_bounds, mode)
else:
super(AbstractOverlay, self)._draw(gc, view_bounds, mode)
return

def _request_redraw(self):
""" Overrides Enable Component.
"""
if self.component is not None:
self.component.request_redraw()
super(AbstractOverlay, self)._request_redraw()
return
6 changes: 0 additions & 6 deletions chaco/array_data_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ class ArrayDataSource(AbstractDataSource):
def __init__(self, data=array([]), sort_order="none", **kw):
AbstractDataSource.__init__(self, **kw)
self.set_data(data, sort_order)
return

def set_data(self, newdata, sort_order=None):
""" Sets the data, and optionally the sort order, for this data source.
Expand All @@ -125,21 +124,18 @@ def set_data(self, newdata, sort_order=None):
self.sort_order = sort_order
self._compute_bounds()
self.data_changed = True
return

def set_mask(self, mask):
""" Sets the mask for this data source.
"""
self._cached_mask = mask
self.data_changed = True
return

def remove_mask(self):
""" Removes the mask on this data source.
"""
self._cached_mask = None
self.data_changed = True
return

#------------------------------------------------------------------------
# AbstractDataSource interface
Expand Down Expand Up @@ -287,7 +283,6 @@ def _compute_bounds(self, data=None):

self._cached_bounds = (data[self._min_index],
data[self._max_index])
return

#------------------------------------------------------------------------
# Event handlers
Expand Down Expand Up @@ -317,4 +312,3 @@ def _post_load(self):
super(ArrayDataSource, self)._post_load()
self._cached_bounds = ()
self._cached_mask = None
return
29 changes: 0 additions & 29 deletions chaco/axis.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,6 @@ def invalidate(self):
"""
self._reset_cache()
self.invalidate_draw()
return

def traits_view(self):
""" Returns a View instance for use with Traits UI. This method is
Expand All @@ -210,7 +209,6 @@ def _do_layout(self, *args, **kw):
self._layout_as_overlay(*args, **kw)
else:
super(PlotAxis, self)._do_layout(*args, **kw)
return

def overlay(self, component, gc, view_bounds=None, mode='normal'):
""" Draws this component overlaid on another component.
Expand All @@ -220,15 +218,13 @@ def overlay(self, component, gc, view_bounds=None, mode='normal'):
if not self.visible:
return
self._draw_component(gc, view_bounds, mode, component)
return

def _draw_overlay(self, gc, view_bounds=None, mode='normal'):
""" Draws the overlay layer of a component.

Overrides PlotComponent.
"""
self._draw_component(gc, view_bounds, mode)
return

def _draw_component(self, gc, view_bounds=None, mode='normal', component=None):
""" Draws the component.
Expand Down Expand Up @@ -262,8 +258,6 @@ def _draw_component(self, gc, view_bounds=None, mode='normal', component=None):
self._draw_labels(gc)

self._cache_valid = True
return


#------------------------------------------------------------------------
# Private draw routines
Expand Down Expand Up @@ -291,7 +285,6 @@ def _layout_as_overlay(self, size=None, force=False):
elif self.orientation == "top":
self.height = self.component.padding_top
self.y = self.component.y2 + 1
return

def _draw_axis_line(self, gc, startpoint, endpoint):
""" Draws the line for the axis.
Expand All @@ -304,8 +297,6 @@ def _draw_axis_line(self, gc, startpoint, endpoint):
gc.move_to(*around(startpoint))
gc.line_to(*around(endpoint))
gc.stroke_path()
return


def _draw_title(self, gc, label=None, axis_offset=None):
""" Draws the title for the axis.
Expand Down Expand Up @@ -341,8 +332,6 @@ def _draw_title(self, gc, label=None, axis_offset=None):
gc.translate_ctm(*offset)
title_label.draw(gc)
gc.translate_ctm(*(-offset))
return


def _draw_ticks(self, gc):
""" Draws the tick marks for the axis.
Expand All @@ -359,7 +348,6 @@ def _draw_ticks(self, gc):
gc.move_to(*(tick_pos + tick_in_vector))
gc.line_to(*(tick_pos - tick_out_vector))
gc.stroke_path()
return

def _draw_labels(self, gc):
""" Draws the tick labels for the axis.
Expand Down Expand Up @@ -409,8 +397,6 @@ def _draw_labels(self, gc):
gc.translate_ctm(*tlpos)
ticklabel.draw(gc)
gc.translate_ctm(*(-tlpos))
return


#------------------------------------------------------------------------
# Private methods for computing positions and layout
Expand All @@ -422,7 +408,6 @@ def _reset_cache(self):
self._tick_positions = []
self._tick_label_list = []
self._tick_label_positions = []
return

def _compute_tick_positions(self, gc, overlay_component=None):
""" Calculates the positions for the tick marks.
Expand Down Expand Up @@ -498,8 +483,6 @@ def _compute_tick_positions(self, gc, overlay_component=None):
for tickpos in mapped_tick_positions]))
self._tick_label_list = tick_list
self._tick_label_positions = self._tick_positions
return


def _compute_labels(self, gc):
"""Generates the labels for tick marks.
Expand All @@ -522,8 +505,6 @@ def build_label(val):
self.ticklabel_cache = [build_label(val) for val in self._tick_label_list]
self._tick_label_bounding_boxes = [array(ticklabel.get_bounding_box(gc), float)
for ticklabel in self.ticklabel_cache]
return


def _calculate_geometry(self):
origin = self.origin
Expand Down Expand Up @@ -565,8 +546,6 @@ def _calculate_geometry(self):
self._axis_vector = self._end_axis_point - self._origin_point
# This is the vector that represents one unit of data space in terms of screen space.
self._axis_pixel_vector = self._axis_vector/sqrt(dot(self._axis_vector,self._axis_vector))
return


def _calculate_geometry_overlay(self, overlay_component=None):
if overlay_component is None:
Expand Down Expand Up @@ -611,8 +590,6 @@ def _calculate_geometry_overlay(self, overlay_component=None):
self._axis_vector = self._end_axis_point - self._origin_point
# This is the vector that represents one unit of data space in terms of screen space.
self._axis_pixel_vector = self._axis_vector/sqrt(dot(self._axis_vector,self._axis_vector))
return


#------------------------------------------------------------------------
# Event handlers
Expand Down Expand Up @@ -669,14 +646,12 @@ def _origin_changed_for_component(self):
def _updated_fired(self):
"""If the axis bounds changed, redraw."""
self._cache_valid = False
return

def _invalidate(self):
self._cache_valid = False
self.invalidate_draw()
if self.component:
self.component.invalidate_draw()
return

def _component_changed(self):
if self.mapper is not None:
Expand All @@ -699,8 +674,6 @@ def _component_changed(self):

# Keep our origin in sync with the component
self.origin = getattr(component, 'origin', 'bottom left')
return


#------------------------------------------------------------------------
# The following event handlers just invalidate our previously computed
Expand All @@ -712,7 +685,6 @@ def _title_changed(self):
self.invalidate_draw()
if self.component:
self.component.invalidate_draw()
return

def _anytrait_changed(self, name, old, new):
""" For every trait that defines a visual attribute
Expand Down Expand Up @@ -800,7 +772,6 @@ def __setstate__(self, state):
self._mapper_changed(None, self.mapper)
self._reset_cache()
self._cache_valid = False
return


class MinorPlotAxis(PlotAxis):
Expand Down
5 changes: 0 additions & 5 deletions chaco/barplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,6 @@ def _gather_points(self):
self._cached_data_pts = compress(point_mask, points, axis=0)

self._cache_valid = True
return

def _draw_plot(self, gc, view_bounds=None, mode="normal"):
""" Draws the 'plot' layer.
Expand Down Expand Up @@ -320,8 +319,6 @@ def _draw_default_axes(self, gc):
gc.line_to(int(end[0])+0.5, int(end[1])+0.5)
gc.stroke_path()

return

def _render_icon(self, gc, x, y, width, height):
with gc:
gc.set_fill_color(self.effective_fill_color)
Expand All @@ -331,8 +328,6 @@ def _render_icon(self, gc, x, y, width, height):

def _post_load(self):
super(BarPlot, self)._post_load()
return


#------------------------------------------------------------------------
# Properties
Expand Down
3 changes: 0 additions & 3 deletions chaco/base_1d_mapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,11 @@ def _range_changed(self, old, new):

self._cache_valid = False
self.updated = new
return

def _range_change_handler(self, obj, name, new):
"Handles the range changing; dynamically attached to our ranges"
self._cache_valid = False
self.updated = obj
return

def _get_screen_bounds(self):
return (self.low_pos, self.high_pos)
Expand All @@ -103,7 +101,6 @@ def _set_screen_bounds(self, new_bounds):
self._low_bound_initialized = True
self._high_bound_initialized = True
self.updated = True
return

def _adjust_range(self, old_bounds, new_bounds):
initialized = self._low_bound_initialized and \
Expand Down
2 changes: 0 additions & 2 deletions chaco/base_2d_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ def __init__(self, **kwargs):
# so we have to manually update our mappers
if self.resizable == "":
self._update_mappers()
return

#------------------------------------------------------------------------
# AbstractPlotRenderer interface
Expand Down Expand Up @@ -202,7 +201,6 @@ def _draw_image(self, gc, view_bounds=None, mode="normal"):
Used by the PlotComponent interface.
"""
self._render(gc)
return

#------------------------------------------------------------------------
# Abstract methods that subclasses must implement
Expand Down
3 changes: 0 additions & 3 deletions chaco/base_contour_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ def __init__(self, *args, **kwargs):
super(BaseContourPlot, self).__init__(*args, **kwargs)
if self.color_mapper:
self.color_mapper.on_trait_change(self._update_color_mapper, "updated")
return

def _update_levels(self):
""" Updates the levels cache. """
Expand Down Expand Up @@ -129,8 +128,6 @@ def _update_colors(self, numcolors=None):
self._colors.append(self._color_map_trait_)

self._colors_cache_valid = True
return


#------------------------------------------------------------------------
# Event handlers
Expand Down
8 changes: 0 additions & 8 deletions chaco/base_plot_frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,13 @@ class BasePlotFrame(Container, PlotComponent):
def __init__(self, **kw):
self._frame_slots = {}
super(BasePlotFrame, self).__init__(**kw)
return

def add_to_slot(self, slot, component, stack="overlay"):
"""
Adds a component to the named slot using the given stacking mode.
The valid modes are: 'overlay', 'left', 'right', 'top', 'bottom'.
"""
self.frame_slots[slot].add_plot_component(component, stack)
return

def set_slot(self, slotname, container):
"""
Expand All @@ -66,7 +64,6 @@ def set_slot(self, slotname, container):
if container is not None:
self._frame_slots[slotname] = container
Container.add(self, container)
return

def get_slot(self, slotname):
""" Returns the container in the named slot. """
Expand Down Expand Up @@ -94,7 +91,6 @@ def draw(self, gc, view_bounds=None, mode="normal"):
PlotComponent.draw(self, gc, view_bounds, "interactive")
else:
super(BasePlotFrame, self).draw(gc, view_bounds, mode)
return

def do_layout(self, size=None, force=False):
""" Tells this frame to do layout at a given size.
Expand All @@ -117,15 +113,13 @@ def _draw(self, *args, **kw):
PlotComponent version of _draw().
"""
PlotComponent._draw(self, *args, **kw)
return

def _dispatch_to_enable(self, event, suffix):
""" Calls Enable-level event handlers.

Overrides PlotComponent.
"""
Container.dispatch(self, event, suffix)
return

#------------------------------------------------------------------------
# Event handlers, properties
Expand Down Expand Up @@ -156,7 +150,6 @@ def __setattr__(self, name, value):
self.set_slot(name, value)
else:
super(BasePlotFrame, self).__setattr__(name, value)
return

### Persistence ###########################################################
# _pickles = ("_frame_slots", "_components", "fit_components", "fit_window")
Expand All @@ -165,4 +158,3 @@ def post_load(self, path=None):
super(BasePlotFrame, self).post_load(path)
for slot in self._frame_slots.values():
slot.post_load(path)
return
Loading