Repository navigation
spec: write each fill property only for the marks that draw it - #100
Merged
Merged
Conversation
writeMarkProps wrote the whole fill group — fill, opacity, hatch, gradient, corner, inset — for every mark that fills, so a document could name a corner on a scatter or a gradient on a band, neither of which is drawn. It now writes per part, and a part counts as drawn when it changes the picture, the legend's swatch included: a violin rounds no corner of its own but its swatch does. Narrowed: scatter (fill, opacity), hexbin and qq (fill), bar and rect (no opacity), candle (no fill colour or opacity — a body takes its direction's), venn and the bands and region (no gradient or inset), horizon and beeswarm (none). The same reading found four marks that draw a fill property the encoder never wrote, so a round trip lost it: survival's confidence band takes the fill like an area, set-matrix's box swatch takes the hatch and the corner, a text layer's fill picks its ink, and a tree's branches fade by the opacity. Those are written now. internal/markprops follows, the option matrix in geom's doc is regenerated, and the caveat about the fill group is replaced by the rule. Fixes #98 Claude-Session: https://claude.ai/code/session_015BfhXWEPyCFY4fZhg5nzsh
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.
Fixes #98.
fill()inwriteMarkPropsis split into parts (colour, opacity, hatch, gradient, corner, inset); each case writes the parts its mark draws. Rule: a part counts as drawn when it changes the output, legend swatch included (e.g. a violin rounds no corner, but itsSwatchBoxlegend does — dropping it would change the legend after a round trip).Determined per geom type by tracing every read of the fill fields and helpers (
fillMark→ gradient+hatch+inset,paint,hatchingOf,insetOf,fillOf/fillFor,boxSwatchandlegends(SwatchBox)→ hatch+corner,nodeLegends/oneNodeLegend); marker and line swatches carry no hatch or corner.Narrowed (over-reports removed):
Added (under-reports — a round trip lost them): Survival (confidence band: all but Corner), SetMatrix (Hatch, Corner — its box swatch), Text (Fill — picks the label ink), Tree (Opacity).
Decoding is unchanged and lenient: an older document with
corneron a scatter still reads, and the property is ignored as before.internal/markpropsand the matrix ingeom's doc are regenerated; the doc's caveat about the fill group is replaced by the rule. All spec round-trip and golden tests unchanged.https://claude.ai/code/session_015BfhXWEPyCFY4fZhg5nzsh