Pairs each text mark that labels another mark with what it labels.
Plot.text draws a labelled scatter on its own, and it also draws the
labels of another mark -- Plot.tree is four marks, of which two are
text sitting exactly on the dot it drew for each node. Read
independently the second case emits a second and third series at the same
coordinates as the first, so a five-node tree becomes three layers a
reader has to walk separately to learn one thing.
Position is what tells them apart, and it tells them apart exactly:
Plot writes the label's transform from the same channel it writes the
point's, so a label of a mark lands on it. A Plot.text that is its own
series has no mark under it to land on.
The names travel onto the labelled mark rather than the text group
being merely dropped, so a Plot.dot + Plot.text scatter -- the
ordinary way to draw one -- reads as one named series rather than as an
unnamed one beside a nameless duplicate.
Compared facet by facet, through splitFacets, because a faceted mark's
own children are per-facet wrappers rather than the elements it drew.
Reading positions off those compares the facets' offsets, which
coincide between any two marks faceted alike -- so every pairing appears
to succeed, the text group is claimed, and the names are keyed by
wrappers that nothing ever looks up. Measured: a faceted Plot.dot +
Plot.text came out as one unnamed layer per panel, having lost the
names rather than duplicated them.
Pairs each
textmark that labels another mark with what it labels.Plot.textdraws a labelled scatter on its own, and it also draws the labels of another mark --Plot.treeis four marks, of which two aretextsitting exactly on thedotit drew for each node. Read independently the second case emits a second and third series at the same coordinates as the first, so a five-node tree becomes three layers a reader has to walk separately to learn one thing.Position is what tells them apart, and it tells them apart exactly: Plot writes the label's transform from the same channel it writes the point's, so a label of a mark lands on it. A
Plot.textthat is its own series has no mark under it to land on.The names travel onto the labelled mark rather than the
textgroup being merely dropped, so aPlot.dot+Plot.textscatter -- the ordinary way to draw one -- reads as one named series rather than as an unnamed one beside a nameless duplicate.Compared facet by facet, through
splitFacets, because a faceted mark's own children are per-facet wrappers rather than the elements it drew. Reading positions off those compares the facets' offsets, which coincide between any two marks faceted alike -- so every pairing appears to succeed, thetextgroup is claimed, and the names are keyed by wrappers that nothing ever looks up. Measured: a facetedPlot.dot+Plot.textcame out as one unnamed layer per panel, having lost the names rather than duplicated them.