scverse / napari-spatialdata

Interactive visualization of spatial omics data
https://spatialdata.scverse.org/projects/napari/en/latest/
BSD 3-Clause "New" or "Revised" License
36 stars 15 forks source link

Coordinate systems widget not sorted #284

Open aeisenbarth opened 1 month ago

aeisenbarth commented 1 month ago

Coordinate systems are displayed non-alphabetically. With a large number of coordinate systems, this makes it hard to find and select a specific one. Screenshot

If things are unordered, it usually can be caused by the order of file loading (glob on Unix is unordered / inode order, but alphabetical on Windows).

Although elements display alphabetically, there is nothing in the source code that sorts them (they are ordered just by chance, probably order of insertion to the dictionary).

Suggestion

aeisenbarth commented 1 month ago

SpatialData returns coordinate systems as a set, which has no order and probably also does not preserve insertion order.

aeisenbarth commented 1 month ago

Tables should also be ordered. Like elements, they have no inherent order on disk.

However, table columns have an inherent order and should be preserved.

melonora commented 1 month ago

hmm regarding the list widgets used, if you have the widget selected you only have to type the first letter and it will actually jump to the first value encountered starting with that letter, this could be documented (isn't at the moment I believe). Also one thing to note with global first is that this will change as it is not intuitive to have every element in a coordinate system called global as this implies that all the different images live in one coordinate system which is not the case.

melonora commented 1 month ago

I do see your point with long coordinate system names though where the first parts of the names are really similar.

LucaMarconato commented 1 month ago

Sounds good to me. We don't have indeed any specific order for the shapes and tables, so any can be set in the UI.