Draw the trait sheet on the canvas, in the colours the figure would use - #54
Merged
Conversation
Dropping a sheet put --traits in the exported command and changed nothing on the screen, so the picture a reader was looking at and the figure they were about to save were different pictures. The strips are on the canvas now, and on the disc as the rings the crate draws there, with a key naming every level. The colours are not chosen on the page. TreeTrack::strips hands over what the figure would draw, which level every node is at and which colour that level got, and the wire carries both schemes so a reader who switches to dark still sees the crate's palette rather than one the page invented. Working the levels out again from the sheet would be a second opinion about which blue is which, and two pictures of one tree disagreeing about that is the thing this page exists not to do. A continuous column has no levels of its own, so it is given sixteen bands, which is a choice the canvas makes and the SVG does not, and it is why the bands are named by the range they cover. Where a node lands did not know about the columns, so the hand would have named a branch a little to the right of the one under it.
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.
The last of the four things the Taxonium study said were clearly worth doing.
Dropping a trait sheet put
--traitsin the exported command and changed nothingon the screen, so the picture a reader was looking at and the figure they were
about to save were different pictures.
The crate answers, the page draws
TreeTrack::strips(&theme)hands over the columns resolved the way a figureresolves them: which level every node is at, and which colour that level got.
The wire carries both schemes, so a reader who switches to dark still sees the
crate's palette rather than one the page invented.
Working the levels out again from the sheet would be a second opinion about
which blue is which, and two pictures of one tree disagreeing about that is the
thing this page exists not to do. The resolution is the crate's own, including
the part where a branch takes what its tips agree on, which is how a sheet keyed
by sample name reaches an internal node at all.
A continuous column has no levels of its own, so it is given sixteen bands. That
is a choice the canvas makes and the SVG does not, which is why the bands are
named by the range they cover rather than pretending to be values.
What it looks like
Verified on a sixty tip outbreak with a three column sheet:
placewith fivecategories,
hostwith two, anddepthcontinuous. The rectangular view drawsthree columns of cells beside the tip names, the circular view draws them as
three rings outside the rim, and a key under the plot names every level with its
swatch. All three read the same colours.
A sheet is a thing to ask the program about now rather than a note kept on the
page, so dropping one asks for the layout again, and so does putting it down.
One real bug it turned up
where(node), which is what the hand uses to name what is under it, did not knowthe columns had taken their width. It agreed with the paint before this change
and would have disagreed after it, naming a branch a little to the right of the
one under the pointer. Caught by a check that asks whether the strips took any
room at all.
Checks
51 in
tests/tree-canvas.test.js, five of them new, plus three in the crate andone on the wire. Painting every cell one colour fails one; giving a cell to a
node the sheet says nothing about fails another, which counts exactly the named
rows that carry a value; taking no room for the columns fails a third. In the
crate, giving every level the same colour fails one and stopping a branch
inheriting what its tips agree on fails another. On the wire, the check asserts
the colours that arrive are
Theme::light().color(i)andTheme::dark().color(i)in order, so the bridge cannot invent them.