-
Notifications
You must be signed in to change notification settings - Fork 3
Fix UMAP spinner not appearing during cluster click operations #204
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
Conversation
|
@copilot Unfortunately the spinner is still not visible after clicking on a point in the umap. |
Fixed in commit 7e938ae. The issue was that Plotly operations ( |
|
@copilot The issue persists. No spinner is visible after clicking a point in the umap. |
Fixed in commit 17d0430. The spinner was positioned outside |
|
@copilot The spinner is still not showing up. I know that the spinner should be visible, because when I change the umap's EPS parameter, the spinner displays during the period that the umap is being recalculated. Please have a look at this part of the code and do something similar. |
Fixed in commit 9d7719b. The issue was that the spinner was being hidden in the |
lstein
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
working as expected
42c2120 to
42794a8
Compare
Make colorizeUmap async to show spinner before heavy Plotly operations Co-authored-by: lstein <[email protected]> Await Plotly operations to keep spinner visible during rendering Co-authored-by: lstein <[email protected]> Move spinner inside umapContent to fix positioning Co-authored-by: lstein <[email protected]> Hide spinner in searchResultsChanged handler instead of click handlers Co-authored-by: lstein <[email protected]>
42794a8 to
a3cff4c
Compare
Fix UMAP Spinner Display on Cluster Click
Root Cause
The spinner was not appearing due to a combination of issues:
colorizeUmapfunction and its Plotly operations needed to be async with proper awaitingThe
#umapSpinnerelement was positioned as a sibling to#umapContent, which hasposition: relativeset dynamically. This caused the spinner's absolute positioning to be relative to#umapFloatingWindowinstead of the visible plot area, rendering it off-screen or at the wrong location.Additionally, the click handlers (
handleClusterClickandhandleImageClick) were hiding the spinner in theirfinallyblocks immediately after dispatching thesearchResultsChangedevent, but before the async colorization operations completed. This meant the spinner disappeared before the heavy Plotly work was done.Solution
colorizeUmapasync with yield point before heavy operationsawaitto all Plotly operations:await Plotly.restyle(...)await Plotly.addTraces(...)await Plotly.deleteTraces(...)await Plotly.moveTraces(...)#umapContentso it positions correctly relative to the plot areasearchResultsChangedevent handler so it only hides after all async colorization work completesThis ensures the spinner remains visible and properly centered over the plot throughout the entire rendering process, which can take several seconds for large clusters. The pattern now matches the working EPS parameter change flow where the spinner is only hidden after all operations complete.
Changes Made
colorizeUmap()andsetUmapColorMode()async functionsawaitto 6 Plotly operation calls incolorizeUmap()function#umapSpinnerfrom being a sibling to being a child of#umapContentin the HTML templatetry/finallyblocks fromhandleClusterClickandhandleImageClickthat were hiding spinner prematurelyhideUmapSpinner()call insearchResultsChangedevent handler after colorization completesTesting
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.