Honest numbers
Never type a number the canvas computes. Read it live, so the prose cannot disagree with the picture.
#The rule
A typed number is correct exactly once — at the moment the author read it off the screen. After that, any edit to the data, any change to the model, any reader who moves a slider, and the sentence is asserting something the picture beside it contradicts. The reader cannot tell which one to believe, and they are looking at both.
#Reading a value instead of typing it
In prose, !value takes the reference as its implicit attribute and formats the result: digits for decimal places, format for the presentation, maths to set it in maths type so it matches the surrounding notation.
Right now $k$ = !value:#k.value(maths), and the band holds
!value:#band.value(digits: 3; format: percent) of the distribution.In attribute position the binding is written bare — text(label: slope = #f.slope) — because an attribute already has a declared type to resolve it against. Derived attributes lists what each construct publishes.
#Why substitution refuses live values
{{#fit.slope}} does not fail because the machinery is missing. It fails because a substitution splices text into the source before parsing — a compile-time snapshot of a number that moves at render time is precisely the disagreement this rule exists to prevent, so the compiler refuses it rather than letting it look like it worked.
Dataset columns are substitutable, and the difference is instructive: a dataset is immutable by construction, so its snapshot can never go stale.
#Rounding and formatting
- Choose
digitsdeliberately. An unrounded value reads as spurious precision; too few digits can make two different quantities print identically. - Set
maths: truewhen the number sits in mathematical prose, so it matches the surrounding$…$rather than sitting in body type beside it. - Do not restate a live value in the same sentence as a typed approximation. "about 0.34" beside
!valueis the same disagreement, written more politely.