Skip to content

docs(charts): keep straight segments for measured data, stated as a rule - #13371

Open
josephfarina wants to merge 1 commit into
mainfrom
josephfarina/chart-straight-lines
Open

josephfarina wants to merge 1 commit into
mainfrom
josephfarina/chart-straight-lines

Conversation

@josephfarina

@josephfarina josephfarina commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Docs only; no record or behavior change.

Why

Agents building a metrics report smooth measured line charts with curve: 'monotone'. The guidance against it was a Don't item that opened with the action itself ("Pass curve: 'monotone' to line() or area() for measured data."), and the curve option's own doc comment, which agents read in the package's type definitions, only said the default is straight.

What changes

  • Chart's best practices: the curve item becomes a Do that states the rule first: keep the default straight segments of line() and area() for measured data; a smoothed curve such as curve: 'monotone' draws values between the points and reads as decoration.
  • line() and area(): the curve option's doc comment says measured data keeps the straight default, and that 'monotone' and 'natural' draw smoothed values between the points.
  • The other Chart Do/Don't items already read correctly under their headings and are unchanged.

Effect on built pages

Three fresh agent-built metrics reports, judged blind in both orders against a hand-written page: no page smooths its line (before, two of six did), and every agent read the new curve comment. One of three now beats the hand-written page; the other two lose on things outside charts (cards around every section, a phone table that clips).

Testing

  • No changeset: the charts package is private and not released. Prettier on the touched source files; check:changesets passes.

Scope

Components: Chart (charts package)

  • Docs only, consumer guidance within the current records.
  • Public text and artifacts contain no internal Meta context.

preflight: pass 3346275

@vercel

vercel Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Nov 21, 2026 3:02pm UTC

Request Review

@astracat-bot

astracat-bot Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 21, 2026, 3:03 PM UTC

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 21, 2026

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved pending CI: CI has not run on this head yet.

The curve guidance in Chart's best practices now reads as a Do that leads with the rule, and the curve JSDoc on line() and area() matches the code's straight default; no API, default or behavior changes.

  • Before CI can run, push a commit whose message does not contain [skip ci]: GitHub skips the CI and Lint workflows when a pull request's head commit carries that marker, even after the draft is marked ready.
  • Optional, here or in a follow-up: the Line story's curve examples still call monotone the default (apps/storybook/stories/charts/Line.stories.tsx, lines 119 and 126), and the Chart playground story starts at curve: 'monotone', which contradicts the new JSDoc.
Claims and files checked

Review mode: full; reason: no-earlier-review

  • Claim: docs only, with no record or behavior change — verified: three text-only hunks, and the marks tests pass.
  • Claim: the old guidance was a Don't item that opened with passing curve: 'monotone' — verified at the base.
  • Claim: the curve doc comment, which reaches the type definitions, only said the default is straight — verified at the base; the package build emits declarations.
  • Claim: agents smooth measured charts with curve: 'monotone' — motivation only; not checkable from the repository.
  • Claim: the curve item becomes a Do that states the rule first — verified in Chart.doc.mjs and in the CLI's best-practices output.
  • Claim: the curve doc comment states the straight default for measured data and that 'monotone' and 'natural' draw smoothed values — verified in both marks; both curves exist in each curve map.
  • Claim: the other Do/Don't items are unchanged — verified; the colour item moved one slot with identical text.
  • Claim: no changeset, because the charts package is private and not released — verified: the package is private and canary-only, and the changeset check rejects unpublished packages.
  • Claim: Prettier is clean on the touched files — verified.
  • Claim: the changeset check passes — verified.
  • Claim: the scope is Chart in the charts package — verified.
  • Claim: the public text carries no internal context — verified.
  • Claim: the guidance stays within current records — verified against the consumer-docs audience rule.
  • File packages/charts/src/Chart.doc.mjs — clear.
  • File packages/charts/src/marks/area.tsx — clear.
  • File packages/charts/src/marks/line.tsx — clear.

Automated review (maintainer link)

This branch was successfully deployed

1 active deployment
Preview — 33462756 Deployed Nov 21, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant