Repository navigation
geom: map the package in its doc, with a matrix of what each mark reads - #99
Merged
Merged
Conversation
The package doc was seven lines for 246 exported declarations. It now lists the 46 marks by family and the 102 options by group, and ends with a table of the options each mark reads as a property of itself. The table is internal/markprops. spec's TestTheMarkTableIsWhatTheEncoderWrites sets every property option to a non-default value, runs writeMarkProps for each mark and fails if what the encoder writes differs from the table; geom's TestTheOptionMatrixIsCurrent renders the table into the doc and fails when it is stale (-update rewrites it), and two more tests fail if a mark or option is missing from the guide or the table. The new test found MarkParallel without a case of its own in writeMarkProps: it fell into the third-party branch and wrote a fill, rows, a curve and a marker for a mark that draws straight strokes. It now writes its stroke and opacity only. The fill options are written as a group, so a filled mark is listed against all of them, Corner included where it does not draw one; the doc says so, and narrowing the group is an encoder change of its own. Refs #86 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 #86 (steps 3 and 4 of ADR 0095 §5; the ADR itself is #96, the split #97).
Package doc — 7 lines → a guide: 46 marks by family, 102 options by group (all as
[Name]links), and Which options a mark reads: per mark, the options it reads as a property.One table, held to the encoder —
internal/markprops.Reads(internal, no API):specTestTheMarkTableIsWhatTheEncoderWritessets every property option to a non-default value, runswriteMarkPropsper mark, maps the written JSON properties back to option names and compares with the table.geomTestTheOptionMatrixIsCurrentrenders the table into the doc (-updaterewrites it);TestThePackageDocNamesEveryMarkAndOptionrequires every mark/option constructor exactly once in the guide;TestTheMarkTableCoversEveryBuiltInMarkparsesdescribe.go.Bug found by the new test:
MarkParallelhad no case inwriteMarkPropsand fell into the third-party branch — writing fill, rows, curve and marker properties for a mark that draws straight strokes. It now writes stroke and opacity only (verified red without the fix).Known limit, said in the doc:
fill()writes the fill properties as a group, so e.g.Corneris listed for Scatter, which never draws one. Narrowing that is an encoder fix of its own: #98.CONTRIBUTING's option checklist and
spec/AGENTS.mdname the new tests. ADR 0095's wording was adjusted in #96: the encoder keeps its switch, a test holds the table to it.https://claude.ai/code/session_015BfhXWEPyCFY4fZhg5nzsh