google / neuroglancer

WebGL-based viewer for volumetric data
Apache License 2.0
1.07k stars 295 forks source link

feat(annotation): added keybinds for iterating through annotation list, also pins and jumps to each annotation #624

Open chrisj opened 2 months ago

chrisj commented 2 months ago

Our plan is to have keybinds to iterate through any visible list for the currently selected layer.

I couldn't find any way to access tab instances. Before attempting to make the changes necessary to access, for example, the tabs for a given layer. I tried two alternative approaches. One uses element.dispatchEvent for a custom event. The other adds a similar event model to the UserLayerClass (registerLayerEvent and dispatchLayerEvent).

Currently segmentation lists don't have the same ability to select an annotation other than the pinned segment. I am going to try to get that working as well.

The current issue I have with the layer event model is that I need a way identify if the tab is the primary tab of the currently selected layer. I left some commented out code like this.layer.panels.panels[0].selectedTab.value === "annotations". Otherwise it will iterate every visible list.