Let the canvas answer a hand, and the search answer with a set - #53
Merged
Conversation
The picture said nothing about itself. A reader could see a branch and had no way to learn what it was without exporting the figure, so the canvas answers now: what is under the pointer is named, with how many tips lie beyond it and how deep it sits, and a click takes that clade. On a twenty thousand tip tree clicking a branch with thirty two tips beyond it goes from twenty thousand rows in view to thirty six, and each hover costs four hundredths of a millisecond because the search is over what the last paint drew rather than over the tree. The search found one tip and went to it. It answers with every tip that matches now, marks them all, and says how many; Enter again steps to the next and Shift with it steps back. A part of a name works, so does a list pasted in, and case is folded. Reading the names as bytes instead of decoding each of them took a lineage prefix across two million nodes from about two seconds to a hundred and forty four milliseconds, and an exact name to seventeen.
… not got The library could draw a band behind a named clade and nothing outside it could ask for one. highlight_named does nothing when it cannot find the name, which is a choice for a library call and a lie for a command line: the figure comes out with one clade fewer than was asked for and nothing says so. The flag refuses instead, naming what the file has, the way asking who carries a change already does. The viewer carries what a search found into the command it prints, so the figure a reader exports has the tips they went looking for marked on it. Only when there are few enough of them to read: a search that matched six thousand tips stays a thing you look at on the page.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three of the four things the Taxonium study said were clearly worth doing and
that the viewer still did not do. The fourth, carrying trait values over the
layout wire, is a week of work and is not here.
The picture said nothing about itself
A reader could see a branch and had no way to learn what it was short of
exporting the figure. The canvas answers a pointer now: what is under it is
named, with how many tips lie beyond it and how deep it sits, and a click takes
that clade.
Measured on a twenty thousand tip tree: pointing at a branch with 32 tips beyond
it and clicking goes from 20,000 rows in view to 36, with the exported command
following to
--focus L3_10238,L4.9_10273. Each hover costs 0.04 ms, becausethe search is over what the last paint drew rather than over the tree: a reader
can only point at what is on the screen, and what is on the screen is a few
thousand branches however many the tree has.
How many tips lie beyond a branch is worked out once, the first time something
asks, by counting children off rather than by walking, so it does not care what
order the nodes arrived in and cannot run out of stack on a ladder.
The search found one tip and went to it
It answers with every tip that matches now, marks them all, and says how many.
Enter again steps to the next and Shift with it steps back. A part of a name
works, so does a list pasted in with commas or newlines, and case is folded.
Reading the names as bytes rather than decoding each of them is what makes that
affordable. On 1,999,999 nodes:
The before column is what the study measured on the old one-shot search.
And a figure can be exported with them marked
--highlight <NAMES>reaches the clade highlighting the library already had.highlight_nameddoes nothing when it cannot find the name, which is a choicefor a library call and a lie for a command line: the figure comes out with one
clade fewer than was asked for and nothing says so. The flag refuses instead,
naming what the file has, the way
--carryingalready does:The viewer carries what a search found into the command it prints, but only when
there are few enough to read: two names become
--highlight L2_00000,L3_19999,and a search matching 6,392 tips stays a thing you look at on the page.
Checks
46 in
tests/tree-canvas.test.js, five of them new negative controls, plus onein the crate for the refusal. Answering for whatever is nearest however far off
fails one; counting tips wrong fails another; taking a fixed span instead of the
clade fails a third; stopping the search at the first hit, not folding case, and
letting a prefix match the middle of a name each fail one of the search checks;
and letting the unknown clade through fails the Rust one.