Charts documentation standardization#47363
Conversation
…lines Audited all chart documentation against the established guidelines and templates. The Browser Compatibility section was identified as drift from the settled standard — it appeared in 6 docs but was never part of the required template structure. Changes: - Removed Browser Compatibility sections from: - trend-indicator docs - sparkline docs - leaderboard-chart docs - line-chart docs - line-chart annotation docs - bar-chart docs - Removed browser compatibility checklist item from ai-documentation-guide.md - Removed browser considerations from the Example Analysis section in the guide Typecheck passes cleanly.
|
Cursor Agent can help with this pull request. Just |
|
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 Follow this PR Review Process:
If you have questions about anything, reach out in #jetpack-developers for guidance! |
Move the Safari foreignObject positioning note and Popover API details back into the Interactive Popovers section of annotation docs, where they serve as behavioral documentation rather than browser compatibility info.
Add back the Safari foreignObject positioning note to the Annotations section of the line-chart docs as a behavioral note.
Remove generic performance sections from line-chart, bar-chart, sparkline, and geo-chart docs. These sections contained boilerplate statements about built-in optimizations that aren't useful to consumers. The Performance Considerations section in chart-context (GlobalChartsProvider) is kept as it documents meaningful caching and update behavior. Also removed the performance documentation guidance from the AI documentation guide.
Add Responsive Behavior to the documentation template and AI guide as a required section. Charts are responsive by default and this pattern already appears in 7 chart docs. The section documents parent container sizing, aspectRatio, and fixed dimensions.
Add Interactive Features to the documentation template and AI guide as a required section. This pattern already appears in 5 chart docs covering tooltips, pointer events, and keyboard navigation. Placed after Feature Variations and before Styling, renumbered subsequent guide sections.
Add instructions to only include the Interactive Features section when the chart actually supports interactivity (tooltips, pointer events).
Add Legends to the documentation template and AI guide as a conditional section for charts that support legends. Covers basic legend display, interactive legends with GlobalChartsProvider, and composition API patterns. Renumbered subsequent guide sections.
Move nested ### Responsive Behavior subsections to top-level ## sections in 6 chart docs: line-chart, bar-chart, pie-chart, donut, sparkline, and geo-chart. Each is now positioned after Animation (or Theming if no animation) and before Accessibility, matching the standard section order defined in the guidelines.
Code Coverage SummaryThis PR did not change code coverage! That could be good or bad, depending on the situation. Everything covered before, and still is? Great! Nothing was covered before? Not so great. 🤷 |
Rename non-standard section headers to '## Styling and Customization': - sparkline: Visual Customization - leaderboard-chart: Visual Customization - trend-indicator: Visual Customization - geo-chart: Custom Styling - legend: Customization - donut: Styling and Best Practices - conversion-funnel: Styling and Theming
…derboard docs Move the CSS Custom Properties subsection from the second Styling and Customization section into the first, eliminating the duplicate heading.
- Trend Indicator: Move 'Without Icon' and 'Value Formats' into Basic Usage where they belong as feature configuration, keep only actual styling content under Styling and Customization. - Donut: Move 'Thickness Guidelines', 'Center Content Guidelines', and 'Responsive Center Content' into Basic Usage as usage guidance. Remove the now-empty Styling and Customization section. - Conversion Funnel: Remove empty Styling and Customization heading.
…el chart Create a proper top-level Styling and Customization section covering className/style props and CSS custom properties (--funnel-font-family, --step-font-family). Moved the Custom Styling content out from under Theming Integration where it was misplaced.
- Pie Chart: Move Legend Positioning and Vertical Legend out of Interactive Features into a new top-level ## Legends section. - Donut: Move Donut with Legend out of Interactive Features into a new top-level ## Legends section.
…order - index.docs.mdx: Swap Animation and Responsive Behavior (Responsive before Animation) - donut.docs.mdx: Swap Animation and Responsive Behavior; move Common Use Cases before Accessibility
- Line chart: Overview, API Reference, Basic Usage, chart-specific sections (Curve Types, Multiple Series, Semantic Line Types, Visual Features, Data Formats, Error Handling, Annotations), Interactive Features, Legends, Theming Integration, Responsive Behavior, Animation, Advanced Customization, Accessibility - Bar chart: Overview, API Reference, Basic Usage, chart-specific sections (Chart Orientations, Multiple Series, Visual Features, Data Formats, Zero Value Display, Error Handling), Interactive Features, Legends, Theming Integration, Responsive Behavior, Animation, Advanced Customization, Accessibility
- Leaderboard: Data States, Data Preparation, Legend now before Styling; Examples moved before Accessibility - Geo: Advanced Features early; Loading, Country ID, Interactive before Styling; Styling before Theming; Responsive, Map Projection, Best Practices before Accessibility
Establish consistent section ordering across all chart docs: Overview → API Reference → Basic Usage → [chart-specific sections] → Interactive Features → Legends → Styling and Customization → Theming Integration → Responsive Behavior → Animation → Advanced Usage → Accessibility → Migration Key changes: - Guide: Swap Animation/Responsive to Responsive-first (sections 11/12) - pie-semi-circle: Move Error Handling and Legend Integration earlier, Responsive Behavior later - conversion-funnel: Move Responsive Behavior from position 4 to 9 - bar-list-chart: Swap Animation and Responsive Behavior - sparkline: Move Dashboard Integration before Styling, Edge Cases after Animation - annotation: Move API Reference from near end to position 2
- Clarify documentation standards for public charts, emphasizing the maintenance of paired files and the inclusion of guide-only documents. - Update the Storybook link in README.md to point to the library introduction section. - Add shared chart utility functions to the list of importable components in README.md.
|
@claude review again |
|
Claude finished @adamwoodnz's task in 2m 15s —— View job Code Review
All three issues from the previous review have been addressed:
Remaining issuesLeaderboard chart: missing
|
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 18 out of 18 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…x.docs.mdx Fix code snippet Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
- Rename "Legend Configuration" to "Legends" in leaderboard chart docs for consistency. - Change "Theming" to "Theming Integration" in trend indicator docs to better reflect content focus.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 18 out of 18 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Fixes CHARTS-174
Proposed changes:
This PR standardizes the charts documentation system end-to-end (guide, template, changelog entry, chart docs, and package-level docs metadata) so section coverage and ordering stay consistent.
Guide and template updates
## Responsive Behavioras a standard section.## Interactive Featuresas a conditional section.## Legendsas a conditional section.Chart docs standardization
Responsive Behaviorto top-level##sections where needed.## Styling and Customization.## Legendssections (instead of nesting under Interactive Features).## Accessibility Considerationsheadings to## Accessibility.Package-level docs and agent guidance alignment
projects/js-packages/charts/README.mdStorybook link to the current docs namespace (js-packages-charts-library).@automattic/charts/utils) to the README entry-point list.projects/js-packages/charts/AGENTS.mddocs workflow wording to clarify the standard triplet applies when applicable, and that guide-only/scope-specific docs are valid.Other information:
Jetpack product discussion
N/A
Does this pull request change what data or activity we track or use?
No.
Testing instructions:
projects/js-packages/charts/docs/ai-documentation-guide.mdand confirm:projects/js-packages/charts/docs/feature-documentation.mdx.templateand confirm those sections and ordering are reflected in the template.## Browser Compatibilitysections remain.## Responsive Behavioris a top-level section.## Styling and Customization.## Legendsappears as its own section where applicable.projects/js-packages/charts/README.mdlinks to?path=/docs/js-packages-charts-library.@automattic/charts/utils.projects/js-packages/charts/AGENTS.mdallows guide-only/scope-specific docs where the full triplet is not applicable.pnpm typecheckinprojects/js-packages/chartsand confirm no errors.Changelog
Linear Issue: CHARTS-174