Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jupyter Frame Selector component #1738

Open
wants to merge 20 commits into
base: master
Choose a base branch
from
Open

Conversation

annehaley
Copy link
Collaborator

@annehaley annehaley commented Dec 6, 2024

This PR moves and refactors the component files for the Frame Selector such that the widget can be used in the Girder/Backbone context as well as the Jupyter context, using the same source code.

frame_selector.mp4

@annehaley annehaley changed the base branch from master to zarr-sink-improvements-1 December 6, 2024 18:28
@annehaley annehaley force-pushed the jupyter-frame-selector branch 2 times, most recently from ed08d58 to ba22d9c Compare December 6, 2024 18:58
@annehaley annehaley force-pushed the jupyter-frame-selector branch 2 times, most recently from ccc83cb to fd41910 Compare December 20, 2024 17:21
@annehaley annehaley force-pushed the jupyter-frame-selector branch 2 times, most recently from aa6bca8 to b9a13d9 Compare January 2, 2025 16:40
@annehaley annehaley changed the base branch from zarr-sink-improvements-1 to master January 2, 2025 16:41
@annehaley annehaley force-pushed the jupyter-frame-selector branch 2 times, most recently from cfd5191 to 6d65b1f Compare January 3, 2025 17:15
@annehaley annehaley force-pushed the jupyter-frame-selector branch from 6d65b1f to 51783f3 Compare January 14, 2025 18:21
@annehaley annehaley force-pushed the jupyter-frame-selector branch from d3377c5 to dadab11 Compare January 14, 2025 21:08
@annehaley annehaley force-pushed the jupyter-frame-selector branch from dadab11 to 82dcb36 Compare January 14, 2025 21:15
@annehaley annehaley marked this pull request as ready for review January 16, 2025 17:48
@annehaley annehaley requested a review from manthey January 16, 2025 17:48
@annehaley annehaley force-pushed the jupyter-frame-selector branch from 9d4705a to 724c7f9 Compare January 17, 2025 16:21
def get_frame_histogram(self, query):
if self._layer is not None:
frame = query.get('frame')
frame_histograms = self.frame_selector.frameHistograms or {}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you copy this and modify the copy? If there are concurrent histogram requests, won't this end up just keeping the last one?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The copy is done so that we set self.frame_selector.frame_histograms to a new object to trigger the Vue watcher that detects changes to that object. Without the copy statement, only the first histogram will be shown and Vue cannot detect subsequent updates. I haven't encountered a case where concurrent requests overwrite one another, but maybe some extra bookkeeping on this class could resolve that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants