Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit aa324df

Browse filesBrowse files
committed
remove lingering older interaction stuff
1 parent aa1e974 commit aa324df
Copy full SHA for aa324df

File tree

Expand file treeCollapse file tree

2 files changed

+0
-87
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+0
-87
lines changed

‎fastplotlib/graphics/line.py

Copy file name to clipboardExpand all lines: fastplotlib/graphics/line.py
-32Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -305,35 +305,3 @@ def _get_linear_selector_init_args(self, padding: float, **kwargs):
305305
bounds_init = (limits[0], int(np.ptp(limits) * 0.2) + offset)
306306

307307
return bounds_init, limits, size, origin, axis, end_points
308-
309-
def set_feature(self, feature: str, new_data: Any, indices: Any = None):
310-
if not hasattr(self, "_previous_data"):
311-
self._previous_data = dict()
312-
elif hasattr(self, "_previous_data"):
313-
self.reset_feature(feature)
314-
315-
feature_instance = getattr(self, feature)
316-
if indices is not None:
317-
previous = feature_instance[indices].copy()
318-
feature_instance[indices] = new_data
319-
else:
320-
previous = feature_instance._data.copy()
321-
feature_instance._set(new_data)
322-
if feature in self._previous_data.keys():
323-
self._previous_data[feature].data = previous
324-
self._previous_data[feature].indices = indices
325-
else:
326-
self._previous_data[feature] = PreviouslyModifiedData(
327-
data=previous, indices=indices
328-
)
329-
330-
def reset_feature(self, feature: str):
331-
if feature not in self._previous_data.keys():
332-
return
333-
334-
prev_ixs = self._previous_data[feature].indices
335-
feature_instance = getattr(self, feature)
336-
if prev_ixs is not None:
337-
feature_instance[prev_ixs] = self._previous_data[feature].data
338-
else:
339-
feature_instance._set(self._previous_data[feature].data)

‎fastplotlib/graphics/line_collection.py

Copy file name to clipboardExpand all lines: fastplotlib/graphics/line_collection.py
-55Lines changed: 0 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -470,61 +470,6 @@ def _get_linear_selector_init_args(self, padding, **kwargs):
470470

471471
return bounds, limits, size, origin, axis, end_points
472472

473-
def _fpl_add_plot_area_hook(self, plot_area):
474-
self._plot_area = plot_area
475-
476-
def set_feature(self, feature: str, new_data: Any, indices: Any):
477-
# if single value force to be an array of size 1
478-
if isinstance(indices, (np.integer, int)):
479-
indices = np.array([indices])
480-
if not hasattr(self, "_previous_data"):
481-
self._previous_data = dict()
482-
elif hasattr(self, "_previous_data"):
483-
if feature in self._previous_data.keys():
484-
# for now assume same index won't be changed with diff data
485-
# I can't think of a usecase where we'd have to check the data too
486-
# so unless there is a bug we keep it like this
487-
if self._previous_data[feature].indices == indices:
488-
return # nothing to change, and this allows bidirectional linking without infinite recursion
489-
490-
self.reset_feature(feature)
491-
492-
# coll_feature = getattr(self[indices], feature)
493-
494-
data = list()
495-
496-
for graphic in self.graphics[indices]:
497-
feature_instance: GraphicFeature = getattr(graphic, feature)
498-
data.append(feature_instance())
499-
500-
# later we can think about multi-index events
501-
previous_data = deepcopy(data[0])
502-
503-
if feature in self._previous_data.keys():
504-
self._previous_data[feature].data = previous_data
505-
self._previous_data[feature].indices = indices
506-
else:
507-
self._previous_data[feature] = PreviouslyModifiedData(
508-
data=previous_data, indices=indices
509-
)
510-
511-
# finally set the new data
512-
# this MUST occur after setting the previous data attribute to prevent recursion
513-
# since calling `feature._set()` triggers all the feature callbacks
514-
feature_instance._set(new_data)
515-
516-
def reset_feature(self, feature: str):
517-
if feature not in self._previous_data.keys():
518-
return
519-
520-
# implemented for a single index at moment
521-
prev_ixs = self._previous_data[feature].indices
522-
coll_feature = getattr(self[prev_ixs], feature)
523-
524-
coll_feature.block_events(True)
525-
coll_feature._set(self._previous_data[feature].data)
526-
coll_feature.block_events(False)
527-
528473

529474
axes = {"x": 0, "y": 1, "z": 2}
530475

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.