Skip to content

Commit

Permalink
fix(embeddings): disable transforms switch hides points
Browse files Browse the repository at this point in the history
closes #113
  • Loading branch information
PaulHax committed Sep 30, 2024
1 parent 210d91f commit f624be7
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/nrtk_explorer/app/embeddings.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ def on_server_ready(self, *args, **kwargs):
self.state.change("dataset_ids")(self.update_points)

self.server.controller.apply_transform.add(self.clear_points_transformations)
self.state.change("transform_enabled_switch")(
self.update_points_transformations_visibility
)

def on_feature_extraction_model_change(self, **kwargs):
feature_extraction_model = self.state.feature_extraction_model
Expand Down Expand Up @@ -112,7 +115,15 @@ def compute_points(self, fit_features, features):
)

def clear_points_transformations(self, **kwargs):
self.state.points_transformations = {} # ID to points
self.state.points_transformations = {} # ID to point
self._stashed_points_transformations = {}

def update_points_transformations_visibility(self, **kwargs):
if self.state.transform_enabled_switch:
self.state.points_transformations = self._stashed_points_transformations
else:
self._stashed_points_transformations = self.state.points_transformations
self.state.points_transformations = {}

async def compute_source_points(self):
with self.state:
Expand Down

0 comments on commit f624be7

Please sign in to comment.