Skip to content

Conversation

@lentinj
Copy link
Collaborator

@lentinj lentinj commented Aug 7, 2025

The problem in #972 is that we choose the anchor node primarily on a node's bounding box. In a "balanced" tree, the bounding box for one below "Animals" covers most of the insect kingdom, so we don't bother considering any nodes below as an anchor node. Eventually this is too far away and everything goes wrong:

if (node.gvar || !node.has_child || (node.rvar > 2.2 && node.rvar < 22000)) {

As well as a traditional heap of tidy-up (EDIT: Merged in #982), a4be6ed fixes this by insisting on gvar (bounding box on screen) and a tighter range of rvar (node zoom). This fixes the initial issue, as the bounding box now follows you down, but the flight back from "Elephant Hawk-Moth" to "Elephant Seal" is very broken. I suspect this is an unrelated issue, and flight code that hasn't been used before not doing the right thing.

If you want to play with the cut-off @jrosindell / @jaredkhan, 9ec50a4 stashes the anchor node away so you can do things like this in the JS console:

onezoom.config.debug_bounding_box = (node => node === onezoom.tree_state.anchor_node ? 0x03 : 0)

... and watch the anchor node move about as you go.

If I get a chance tomorrow I'll see if I can figure out what's up with the flight.

Base automatically changed from issue-973-flight-promises to main August 8, 2025 14:58
lentinj added 2 commits August 8, 2025 15:14
This is very useful for seeing what's going on here, but is ultimately
useless for real onezoom usage.
…ably sized

In a balanced tree, the node below "Animals" has a bounding box
encompassing most of the insects. Thanks to this anchoring won't
consider anything lower.

Instead, insist that nodes are on-screen *and* of a reasonable size,
decreasing the considered size to more tightly follow the flight.

This fixes the initial problem, but now the flight from the Elephant
Hawk-Moth to Elephant Seal is very messy. This is likely a problem
elsewhere.
@lentinj lentinj force-pushed the issue-972-balanced-anchoring branch from a4be6ed to 80c3b11 Compare August 8, 2025 15:15
@lentinj
Copy link
Collaborator Author

lentinj commented Aug 8, 2025

Giving up on this for now. It seems to be a problem only in the "balanced" view, spiral/polytomy are fine.

A zoom out from elephant hawk moth to complex life seems to, whenever we choose a new anchor node, zoom into the anchor node's bounding box and continue the flight from there as if this never happened. I've not managed to find the point in the animation code this happens though.

If the flight is short enough for the anchor node not to need changing, there's no problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant