Selection API #1
Conversation
tomdonaldson
left a comment
There was a problem hiding this comment.
I added a couple questions in the code. I think a high-level summary of the API changes would be helpful in the PR. I actually don't know offhand where the API docs live.
| } | ||
|
|
||
| View.prototype.regionSelection = function(region, callback) { | ||
| this.selector.start(region["selection_type"], callback); |
There was a problem hiding this comment.
With the callback being given to start(), it's not clear to me what its purpose is. Maybe documentation on the Aladin.prototype.selectRegion() could help with that.
Along the same lines, I wonder if the the next line, this.selector.dispatch() should be waiting for the start() to complete.
| view.aladin.removeStatusBarMessage('selector') | ||
| }; | ||
|
|
||
| let api = (params) => { |
There was a problem hiding this comment.
Is there a more informative name for api?
| y: startCooPix[1], | ||
| }; | ||
|
|
||
| this.dispatch('mouseup', { |
There was a problem hiding this comment.
These uses of mouse events to define a selection region are good places to highlight as we discuss the challenges of moving between sky regions and screen coordinates. For these in particular, unless one is zoomed in a centered around the region, it's pretty easy for the sky coordinates needed to not be on the screen.
What is changing?
Why is this needed?
This API will be used by ipyaladin to give users programmatic access to the selection capabilities of aladin-lite. Users will be able to draw a selection in the aladin-lite widget, export that region, and then import it at a later time. This can aid in repeatability of notebook workflows, the saving of complex selections, and the linking of selection events across different tools to enable scientists needs.
Related PRs
ipyaladin
Future work