OneZoom / OZtree

OneZoom Tree of Life Explorer
Other
91 stars 20 forks source link

Far nodes with OTT are chosen for URL over near nodes without OTT #907

Open davidebbo opened 1 week ago

davidebbo commented 1 week ago

Normally, zooming in on a node or searching for it results in the URL changing to that node (e.g. @Panthera_leo=563151), allowing it to be shared. This does not happen when there is no OTT.

lentinj commented 1 week ago

There's 2 related problems to this:

Firstly, there's the problem of deciding what you're looking at. The current algorithm isn't great, and could do with replacing (https://github.com/OneZoom/OZtree/issues/547). We fudge around this by selecting any with an OTT, assuming you're more likely to be looking at a node with an OTT.

Secondly, we'd need to decide how to represent them in the URL. Presumably there is no latin name or OTT in your case, and this falls through, because we can't make a URL for it:

https://github.com/OneZoom/OZtree/blob/7453fdbf7596337da1a04bbe961446beb5c85637/OZprivate/rawJS/OZTreeModule/src/navigation/pinpoint.js#L133-L140

It could generate an OZid / metacode URL instead (the primary key in the leaf/node table), but these aren't going to be permanent anyway. Do we have anything to use in the URL?

The current pinpoint forms we support are documented here, if that's useful:

https://github.com/OneZoom/OZtree/blob/7453fdbf7596337da1a04bbe961446beb5c85637/OZprivate/rawJS/OZTreeModule/src/navigation/pinpoint.js#L5-L23

davidebbo commented 1 week ago

Presumably there is no latin name or OTT in your case

There is no OTT, but there is definitely a latin name (taxon name). Doing some quick debugging, I never see node_to_pinpoint getting called for the node at stake. It always gets called for a neighbor node.

If it worked with a taxon name and no OTT, we wouldn't have a problem at all, since they all have that (at least in the extinct tree).

lentinj commented 1 week ago

Ah, in that case I'm pretty sure the problem is here:

https://github.com/OneZoom/OZtree/blob/7453fdbf7596337da1a04bbe961446beb5c85637/OZprivate/rawJS/OZTreeModule/src/navigation/setup_page.js#L95-L98

We really need a replacement for largest_visible_node with more DWIM, but a half-way house might be to impose a penalty on node/leaves without an OTT, rather than considering any node first.

davidebbo commented 1 week ago

Ah, I see, thanks for tracking it down!

I think we need to carefully evaluate all the options in https://github.com/OneZoom/tree-build/issues/103 before investing too much time in fixing all the various issues when there are no OTTs. If we go with an alternative approach, it becomes a much lower pri issue.