@mmerterden/multi-agent-pipeline 20.37.0 → 20.38.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (469) hide show
  1. package/CHANGELOG.md +123 -49
  2. package/README.md +12 -10
  3. package/README.tr.md +12 -10
  4. package/docs/adr/0006-skills-core-external-split.md +5 -5
  5. package/docs/adr/0010-own-code-graph.md +6 -7
  6. package/docs/adr/0013-lsp-code-intelligence.md +6 -8
  7. package/docs/adr/0017-change-impact-from-the-graph.md +4 -5
  8. package/docs/adr/0018-cross-repo-links-not-a-global-graph.md +1 -1
  9. package/docs/adr/README.md +1 -1
  10. package/docs/ecosystem.md +53 -41
  11. package/docs/facts.json +15 -13
  12. package/docs/features.md +2 -2
  13. package/docs/recovery-guide.md +1 -1
  14. package/install/_dev-only-files.mjs +3 -0
  15. package/install/_platform-filter.mjs +1 -23
  16. package/install/catalog-history.json +1 -1
  17. package/install/claude.mjs +8 -1
  18. package/install/codex.mjs +0 -2
  19. package/install/copilot.mjs +0 -2
  20. package/install/templates/claude-hooks.json +47 -1
  21. package/manifest.json +455 -332
  22. package/package.json +5 -2
  23. package/pipeline/agents/security-auditor.md +58 -6
  24. package/pipeline/commands/multi-agent/build-optimize/SKILL.md +1 -2
  25. package/pipeline/commands/multi-agent/complaint-analysis/SKILL.md +1 -1
  26. package/pipeline/commands/multi-agent/design-check/SKILL.md +1 -1
  27. package/pipeline/commands/multi-agent/graph/SKILL.md +12 -3
  28. package/pipeline/commands/multi-agent/manual-test/SKILL.md +12 -7
  29. package/pipeline/commands/multi-agent/research/SKILL.md +2 -2
  30. package/pipeline/commands/multi-agent/search/SKILL.md +10 -1
  31. package/pipeline/commands/multi-agent/security-review/SKILL.md +4 -0
  32. package/pipeline/commands/multi-agent/setup/SKILL.md +1 -0
  33. package/pipeline/commands/multi-agent/stack/SKILL.md +8 -0
  34. package/pipeline/commands/multi-agent/store-ready/SKILL.md +1 -1
  35. package/pipeline/commands/sim-test.md +34 -1
  36. package/pipeline/lib/context-budget.mjs +103 -0
  37. package/pipeline/lib/credential-inventory.sh +2 -3
  38. package/pipeline/lib/identifier-scan.mjs +145 -0
  39. package/pipeline/lib/outbound-gate.mjs +28 -1
  40. package/pipeline/lib/unattended-profile-check.mjs +13 -4
  41. package/pipeline/multi-agent-refs/analysis/locked.md +1 -1
  42. package/pipeline/multi-agent-refs/analysis/redesign.md +17 -3
  43. package/pipeline/multi-agent-refs/analysis-template-corporate.md +8 -4
  44. package/pipeline/multi-agent-refs/analysis-template.md +7 -5
  45. package/pipeline/multi-agent-refs/audit-guide.md +20 -0
  46. package/pipeline/multi-agent-refs/complaint-analysis/phases.md +1 -0
  47. package/pipeline/multi-agent-refs/features/autopilot-circuit-breaker.md +1 -1
  48. package/pipeline/multi-agent-refs/features/code-graph.md +25 -0
  49. package/pipeline/multi-agent-refs/features/commit-multi-repo.md +63 -0
  50. package/pipeline/multi-agent-refs/features/design-conformance.md +20 -4
  51. package/pipeline/multi-agent-refs/features/dev-multi-repo.md +51 -0
  52. package/pipeline/multi-agent-refs/features/free-models.md +10 -3
  53. package/pipeline/multi-agent-refs/features/research.md +4 -3
  54. package/pipeline/multi-agent-refs/features/security-audit.md +25 -3
  55. package/pipeline/multi-agent-refs/features/test-gap.md +40 -0
  56. package/pipeline/multi-agent-refs/features/unattended-security.md +20 -0
  57. package/pipeline/multi-agent-refs/features/worktree-finalize.md +1 -1
  58. package/pipeline/multi-agent-refs/help/en.md +15 -9
  59. package/pipeline/multi-agent-refs/help/tr.md +15 -9
  60. package/pipeline/multi-agent-refs/knowledge.md +17 -0
  61. package/pipeline/multi-agent-refs/orchestrator/phase-3-user-test.md +12 -9
  62. package/pipeline/multi-agent-refs/outside-the-pipeline.md +9 -0
  63. package/pipeline/multi-agent-refs/phases/log-format.md +5 -0
  64. package/pipeline/multi-agent-refs/phases/operations.md +3 -5
  65. package/pipeline/multi-agent-refs/phases/phase-1-plan.md +4 -4
  66. package/pipeline/multi-agent-refs/phases/phase-2-dev.md +8 -47
  67. package/pipeline/multi-agent-refs/phases/phase-3-review.md +21 -65
  68. package/pipeline/multi-agent-refs/phases/phase-4-commit.md +9 -59
  69. package/pipeline/multi-agent-refs/phases/phase-5-report.md +0 -31
  70. package/pipeline/multi-agent-refs/picker-contract.md +1 -1
  71. package/pipeline/multi-agent-refs/research/engine.md +2 -1
  72. package/pipeline/multi-agent-refs/rules.md +1 -1
  73. package/pipeline/multi-agent-refs/setup/free-models.md +10 -0
  74. package/pipeline/multi-agent-refs/store-ready/gate-3-policy.md +15 -0
  75. package/pipeline/multi-agent-refs/web-guide.md +2 -1
  76. package/pipeline/office/index.html +8 -9
  77. package/pipeline/office/toolkit.json +1 -1
  78. package/pipeline/rules/figma-pipeline.md +6 -3
  79. package/pipeline/rules/outside-the-pipeline.md +1 -1
  80. package/pipeline/schemas/learnings-ledger.schema.json +7 -2
  81. package/pipeline/schemas/prefs.schema.json +17 -4
  82. package/pipeline/schemas/reviewer-output.schema.json +113 -5
  83. package/pipeline/schemas/secret-patterns.json +49 -0
  84. package/pipeline/schemas/security-finding.schema.json +49 -5
  85. package/pipeline/scripts/_code-graph.mjs +3 -3
  86. package/pipeline/scripts/_graph-analysis.mjs +51 -0
  87. package/pipeline/scripts/_memory-policy.mjs +37 -7
  88. package/pipeline/scripts/_secret-scan.mjs +1 -1
  89. package/pipeline/scripts/_skill-practices.mjs +178 -0
  90. package/pipeline/scripts/_stack-routing.mjs +1 -0
  91. package/pipeline/scripts/autopilot-runner.mjs +8 -3
  92. package/pipeline/scripts/build-stack-plugins.mjs +8 -44
  93. package/pipeline/scripts/capture-resume.sh +19 -0
  94. package/pipeline/scripts/checkpoint-fold.sh +59 -0
  95. package/pipeline/scripts/file-context.mjs +306 -70
  96. package/pipeline/scripts/gate-ledger.mjs +1 -1
  97. package/pipeline/scripts/gen-skills-index.mjs +1 -1
  98. package/pipeline/scripts/graph-hint.mjs +197 -0
  99. package/pipeline/scripts/graph-hint.sh +20 -0
  100. package/pipeline/scripts/graph-query.mjs +306 -11
  101. package/pipeline/scripts/graph-report.mjs +29 -1
  102. package/pipeline/scripts/learnings-ledger.mjs +71 -15
  103. package/pipeline/scripts/note-agent-event.mjs +160 -0
  104. package/pipeline/scripts/note-agent-event.sh +19 -0
  105. package/pipeline/scripts/office-control.mjs +41 -15
  106. package/pipeline/scripts/offload-ref.sh +1 -1
  107. package/pipeline/scripts/parity-score.mjs +139 -0
  108. package/pipeline/scripts/pre-commit-check.sh +25 -4
  109. package/pipeline/scripts/pre-push-check.sh +3 -0
  110. package/pipeline/scripts/repo-recommend.mjs +321 -0
  111. package/pipeline/scripts/rework-rulings.mjs +5 -3
  112. package/pipeline/scripts/scan-agent-config.sh +1 -2
  113. package/pipeline/scripts/scope-check-gate.mjs +15 -2
  114. package/pipeline/scripts/security-evidence-gate.mjs +282 -0
  115. package/pipeline/scripts/unattended_policy.py +3 -2
  116. package/pipeline/scripts/user-test-handoff.sh +203 -0
  117. package/pipeline/scripts/validate-analysis-doc.mjs +17 -1
  118. package/pipeline/scripts/validate-planning.mjs +5 -3
  119. package/pipeline/scripts/validate-triage.mjs +2 -1
  120. package/pipeline/scripts/write-state.mjs +13 -4
  121. package/pipeline/skills/.skill-manifest.json +73 -69
  122. package/pipeline/skills/shared/README.md +41 -40
  123. package/pipeline/skills/shared/core/apple-archive-compliance/SKILL.md +6 -6
  124. package/pipeline/skills/shared/core/apple-archive-compliance/references/examples.md +1 -1
  125. package/pipeline/skills/shared/core/apple-archive-compliance/references/version-history.md +1 -1
  126. package/pipeline/skills/shared/core/google-play-compliance/SKILL.md +1 -1
  127. package/pipeline/skills/shared/core/google-play-compliance/references/notes.md +1 -1
  128. package/pipeline/skills/shared/core/multi-agent/SKILL.md +1 -1
  129. package/pipeline/skills/shared/core/multi-agent-build-optimize/SKILL.md +0 -1
  130. package/pipeline/skills/shared/core/multi-agent-complaint-analysis/SKILL.md +1 -1
  131. package/pipeline/skills/shared/core/multi-agent-design-check/SKILL.md +5 -5
  132. package/pipeline/skills/shared/core/multi-agent-graph/SKILL.md +10 -0
  133. package/pipeline/skills/shared/core/multi-agent-manual-test/SKILL.md +12 -7
  134. package/pipeline/skills/shared/core/multi-agent-research/SKILL.md +2 -2
  135. package/pipeline/skills/shared/core/multi-agent-search/SKILL.md +9 -0
  136. package/pipeline/skills/shared/core/multi-agent-security-review/SKILL.md +3 -2
  137. package/pipeline/skills/shared/core/multi-agent-setup/SKILL.md +1 -0
  138. package/pipeline/skills/shared/core/multi-agent-stack/SKILL.md +8 -0
  139. package/pipeline/skills/shared/core/multi-agent-store-ready/SKILL.md +4 -3
  140. package/pipeline/skills/shared/core/multi-agent-test/SKILL.md +1 -1
  141. package/pipeline/skills/shared/core/multi-agent-test-accessibility/SKILL.md +1 -1
  142. package/pipeline/skills/shared/core/multi-agent-test-dark-mode/SKILL.md +1 -1
  143. package/pipeline/skills/shared/core/multi-agent-test-dynamic-type/SKILL.md +1 -1
  144. package/pipeline/skills/shared/core/multi-agent-test-gen/SKILL.md +1 -1
  145. package/pipeline/skills/shared/core/multi-agent-test-screenshots/SKILL.md +1 -1
  146. package/pipeline/skills/shared/core/multi-agent-testflight-validation/SKILL.md +2 -2
  147. package/pipeline/skills/shared/external/accessibility-compliance-accessibility-audit/evals/evals.json +44 -0
  148. package/pipeline/skills/shared/external/agent-introspection-debugging/evals/evals.json +42 -0
  149. package/pipeline/skills/shared/external/android-architecture/SKILL.md +1 -1
  150. package/pipeline/skills/shared/external/android-architecture/evals/evals.json +45 -0
  151. package/pipeline/skills/shared/external/android-build-quality-gates/evals/evals.json +45 -0
  152. package/pipeline/skills/shared/external/android-datastore/evals/evals.json +45 -0
  153. package/pipeline/skills/shared/external/android-design-tokens-codegen/evals/evals.json +43 -0
  154. package/pipeline/skills/shared/external/android-jetpack-compose-expert/evals/evals.json +43 -0
  155. package/pipeline/skills/shared/external/android-mvi-viewmodel/evals/evals.json +45 -0
  156. package/pipeline/skills/shared/external/android-performance/SKILL.md +1 -1
  157. package/pipeline/skills/shared/external/android-performance/evals/evals.json +44 -0
  158. package/pipeline/skills/shared/external/android-security/SKILL.md +1 -1
  159. package/pipeline/skills/shared/external/android-security/evals/evals.json +45 -0
  160. package/pipeline/skills/shared/external/api-patterns/evals/evals.json +43 -0
  161. package/pipeline/skills/shared/external/api-security-best-practices/evals/evals.json +44 -0
  162. package/pipeline/skills/shared/external/app-store-changelog/SKILL.md +65 -49
  163. package/pipeline/skills/shared/external/app-store-changelog/evals/evals.json +40 -0
  164. package/pipeline/skills/shared/external/app-store-changelog/references/release-notes-guidelines.md +64 -34
  165. package/pipeline/skills/shared/external/app-store-changelog/scripts/collect_release_changes.sh +21 -23
  166. package/pipeline/skills/shared/external/app-store-optimization/SKILL.md +4 -1
  167. package/pipeline/skills/shared/external/app-store-review/SKILL.md +6 -0
  168. package/pipeline/skills/shared/external/architecture/evals/evals.json +42 -0
  169. package/pipeline/skills/shared/external/backlog/evals/evals.json +42 -0
  170. package/pipeline/skills/shared/external/ci-cd-pipelines/evals/evals.json +44 -0
  171. package/pipeline/skills/shared/external/clean-code/evals/evals.json +45 -0
  172. package/pipeline/skills/shared/external/compose-components/SKILL.md +1 -1
  173. package/pipeline/skills/shared/external/compose-components/evals/evals.json +44 -0
  174. package/pipeline/skills/shared/external/compose-navigation/SKILL.md +1 -1
  175. package/pipeline/skills/shared/external/compose-navigation/evals/evals.json +43 -0
  176. package/pipeline/skills/shared/external/compose-testing/SKILL.md +1 -1
  177. package/pipeline/skills/shared/external/compose-testing/evals/evals.json +44 -0
  178. package/pipeline/skills/shared/external/context-compression/evals/evals.json +43 -0
  179. package/pipeline/skills/shared/external/core-data/SKILL.md +1 -1
  180. package/pipeline/skills/shared/external/council/evals/evals.json +41 -0
  181. package/pipeline/skills/shared/external/css-modern/evals/evals.json +44 -0
  182. package/pipeline/skills/shared/external/css-modern/references/code-examples.md +5 -0
  183. package/pipeline/skills/shared/external/database-patterns/evals/evals.json +46 -0
  184. package/pipeline/skills/shared/external/database-patterns/references/orm-examples.md +5 -0
  185. package/pipeline/skills/shared/external/debugging-strategies/evals/evals.json +43 -0
  186. package/pipeline/skills/shared/external/docker-expert/evals/evals.json +45 -0
  187. package/pipeline/skills/shared/external/e2e-testing/SKILL.md +21 -21
  188. package/pipeline/skills/shared/external/e2e-testing/evals/evals.json +44 -0
  189. package/pipeline/skills/shared/external/e2e-testing/references/document-fixtures.md +5 -5
  190. package/pipeline/skills/shared/external/evidence-github/evals/evals.json +41 -0
  191. package/pipeline/skills/shared/external/evidence-registry/SKILL.md +1 -1
  192. package/pipeline/skills/shared/external/evidence-registry/evals/evals.json +41 -0
  193. package/pipeline/skills/shared/external/fastapi-pro/evals/evals.json +57 -0
  194. package/pipeline/skills/shared/external/firebase/SKILL.md +132 -54
  195. package/pipeline/skills/shared/external/firebase/evals/evals.json +42 -0
  196. package/pipeline/skills/shared/external/firebase/references/functions-and-products.md +51 -0
  197. package/pipeline/skills/shared/external/firebase/references/security-rules.md +59 -0
  198. package/pipeline/skills/shared/external/fix-review-verdicts/evals/evals.json +57 -0
  199. package/pipeline/skills/shared/external/free-llm-apis/SKILL.md +70 -0
  200. package/pipeline/skills/shared/external/free-llm-apis/evals/evals.json +44 -0
  201. package/pipeline/skills/shared/external/free-llm-apis/references/providers.md +33 -0
  202. package/pipeline/skills/shared/external/github-actions-templates/evals/evals.json +44 -0
  203. package/pipeline/skills/shared/external/gradle-kotlin-dsl/SKILL.md +1 -1
  204. package/pipeline/skills/shared/external/gradle-kotlin-dsl/evals/evals.json +58 -0
  205. package/pipeline/skills/shared/external/handle-request/SKILL.md +2 -2
  206. package/pipeline/skills/shared/external/handle-request/evals/evals.json +44 -0
  207. package/pipeline/skills/shared/external/hig-app-icons/SKILL.md +2 -2
  208. package/pipeline/skills/shared/external/hig-app-icons/references/icon-workflow.md +1 -1
  209. package/pipeline/skills/shared/external/hig-components-content/evals/evals.json +43 -0
  210. package/pipeline/skills/shared/external/hig-components-status/evals/evals.json +43 -0
  211. package/pipeline/skills/shared/external/hig-components-system/evals/evals.json +43 -0
  212. package/pipeline/skills/shared/external/hig-inputs/evals/evals.json +44 -0
  213. package/pipeline/skills/shared/external/hig-patterns/evals/evals.json +46 -0
  214. package/pipeline/skills/shared/external/hig-platforms/evals/evals.json +45 -0
  215. package/pipeline/skills/shared/external/hig-technologies/evals/evals.json +44 -0
  216. package/pipeline/skills/shared/external/html-semantic/evals/evals.json +46 -0
  217. package/pipeline/skills/shared/external/humanizer/evals/evals.json +46 -0
  218. package/pipeline/skills/shared/external/ios-coding-standard/evals/evals.json +44 -0
  219. package/pipeline/skills/shared/external/ios-debugger-agent/SKILL.md +91 -52
  220. package/pipeline/skills/shared/external/ios-debugger-agent/evals/evals.json +41 -0
  221. package/pipeline/skills/shared/external/ios-design-review/SKILL.md +12 -12
  222. package/pipeline/skills/shared/external/ios-design-review/references/appearance-matrix.md +16 -16
  223. package/pipeline/skills/shared/external/ios-design-review/references/checklist.md +1 -1
  224. package/pipeline/skills/shared/external/ios-iphone-duo/SKILL.md +0 -1
  225. package/pipeline/skills/shared/external/ios-module-structure/evals/evals.json +42 -0
  226. package/pipeline/skills/shared/external/ios-security/SKILL.md +1 -1
  227. package/pipeline/skills/shared/external/ios-security/evals/evals.json +45 -0
  228. package/pipeline/skills/shared/external/kotlin-coroutines-expert/evals/evals.json +43 -0
  229. package/pipeline/skills/shared/external/localization-reuse-map/evals/evals.json +45 -0
  230. package/pipeline/skills/shared/external/macos-menubar-tuist-app/SKILL.md +170 -74
  231. package/pipeline/skills/shared/external/macos-menubar-tuist-app/evals/evals.json +52 -0
  232. package/pipeline/skills/shared/external/macos-spm-app-packaging/SKILL.md +119 -77
  233. package/pipeline/skills/shared/external/macos-spm-app-packaging/assets/templates/bootstrap/Package.swift +5 -5
  234. package/pipeline/skills/shared/external/macos-spm-app-packaging/assets/templates/bootstrap/Sources/MyApp/MyApp.swift +24 -0
  235. package/pipeline/skills/shared/external/macos-spm-app-packaging/assets/templates/bootstrap/version.env +2 -0
  236. package/pipeline/skills/shared/external/macos-spm-app-packaging/assets/templates/build_icon.sh +46 -39
  237. package/pipeline/skills/shared/external/macos-spm-app-packaging/assets/templates/compile_and_run.sh +70 -49
  238. package/pipeline/skills/shared/external/macos-spm-app-packaging/assets/templates/launch.sh +24 -17
  239. package/pipeline/skills/shared/external/macos-spm-app-packaging/assets/templates/make_appcast.sh +74 -59
  240. package/pipeline/skills/shared/external/macos-spm-app-packaging/assets/templates/package_app.sh +201 -170
  241. package/pipeline/skills/shared/external/macos-spm-app-packaging/assets/templates/setup_dev_signing.sh +50 -42
  242. package/pipeline/skills/shared/external/macos-spm-app-packaging/assets/templates/sign-and-notarize.sh +65 -35
  243. package/pipeline/skills/shared/external/macos-spm-app-packaging/assets/templates/version.env +2 -0
  244. package/pipeline/skills/shared/external/macos-spm-app-packaging/evals/evals.json +45 -0
  245. package/pipeline/skills/shared/external/macos-spm-app-packaging/references/packaging.md +49 -17
  246. package/pipeline/skills/shared/external/macos-spm-app-packaging/references/release.md +48 -23
  247. package/pipeline/skills/shared/external/macos-spm-app-packaging/references/scaffold.md +74 -44
  248. package/pipeline/skills/shared/external/monorepo-architect/evals/evals.json +45 -0
  249. package/pipeline/skills/shared/external/nextjs-app-router/SKILL.md +14 -3
  250. package/pipeline/skills/shared/external/nextjs-app-router/evals/evals.json +43 -0
  251. package/pipeline/skills/shared/external/nextjs-app-router/references/app-router-examples.md +3 -0
  252. package/pipeline/skills/shared/external/nodejs-backend-patterns/evals/evals.json +45 -0
  253. package/pipeline/skills/shared/external/observability-engineer/evals/evals.json +45 -0
  254. package/pipeline/skills/shared/external/passkit-wallet/SKILL.md +10 -0
  255. package/pipeline/skills/shared/external/photos-camera-media/evals/evals.json +45 -0
  256. package/pipeline/skills/shared/external/play-store-review/evals/evals.json +45 -0
  257. package/pipeline/skills/shared/external/python-patterns/evals/evals.json +46 -0
  258. package/pipeline/skills/shared/external/react-best-practices/evals/evals.json +43 -0
  259. package/pipeline/skills/shared/external/rest-api-design/evals/evals.json +46 -0
  260. package/pipeline/skills/shared/external/retrofit-networking/SKILL.md +1 -1
  261. package/pipeline/skills/shared/external/retrofit-networking/evals/evals.json +43 -0
  262. package/pipeline/skills/shared/external/room-database/SKILL.md +1 -1
  263. package/pipeline/skills/shared/external/room-database/evals/evals.json +43 -0
  264. package/pipeline/skills/shared/external/scenario-gap-analysis/SKILL.md +1 -1
  265. package/pipeline/skills/shared/external/scenario-gap-analysis/evals/evals.json +43 -0
  266. package/pipeline/skills/shared/external/search-first/evals/evals.json +42 -0
  267. package/pipeline/skills/shared/external/security-review/SKILL.md +14 -3
  268. package/pipeline/skills/shared/external/security-review/evals/evals.json +48 -0
  269. package/pipeline/skills/shared/external/security-review/references/agentic-systems.md +93 -0
  270. package/pipeline/skills/shared/external/security-review/references/firebase-rules.md +100 -0
  271. package/pipeline/skills/shared/external/security-review/references/graphql.md +82 -0
  272. package/pipeline/skills/shared/external/security-review/references/llm-prompt-injection.md +93 -0
  273. package/pipeline/skills/shared/external/security-review/references/oauth-oidc.md +100 -0
  274. package/pipeline/skills/shared/external/security-review/references/owasp-mobile-top10-2024.md +1 -1
  275. package/pipeline/skills/shared/external/security-review/references/owasp-web-api-top10-2021.md +1 -1
  276. package/pipeline/skills/shared/external/security-review/references/supabase.md +73 -0
  277. package/pipeline/skills/shared/external/signal-community/SKILL.md +29 -10
  278. package/pipeline/skills/shared/external/signal-community/evals/evals.json +42 -0
  279. package/pipeline/skills/shared/external/skill-creator/evals/evals.json +43 -0
  280. package/pipeline/skills/shared/external/skill-creator/template.md +1 -3
  281. package/pipeline/skills/shared/external/spm-build-analysis/SKILL.md +80 -61
  282. package/pipeline/skills/shared/external/spm-build-analysis/evals/evals.json +56 -0
  283. package/pipeline/skills/shared/external/spm-build-analysis/references/build-optimization-sources.md +83 -133
  284. package/pipeline/skills/shared/external/spm-build-analysis/references/recommendation-format.md +41 -40
  285. package/pipeline/skills/shared/external/spm-build-analysis/references/spm-analysis-checks.md +89 -87
  286. package/pipeline/skills/shared/external/spm-build-analysis/scripts/check_spm_pins.py +90 -85
  287. package/pipeline/skills/shared/external/swift-concurrency-expert/SKILL.md +78 -69
  288. package/pipeline/skills/shared/external/swift-concurrency-expert/evals/evals.json +54 -0
  289. package/pipeline/skills/shared/external/swift-concurrency-expert/references/approachable-concurrency.md +52 -48
  290. package/pipeline/skills/shared/external/swift-concurrency-expert/references/swift-6-2-concurrency.md +118 -184
  291. package/pipeline/skills/shared/external/swift-concurrency-expert/references/swiftui-concurrency-tour-wwdc.md +68 -22
  292. package/pipeline/skills/shared/external/swift-concurrency-pro/SKILL.md +117 -94
  293. package/pipeline/skills/shared/external/swift-concurrency-pro/evals/evals.json +57 -0
  294. package/pipeline/skills/shared/external/swift-concurrency-pro/references/actors.md +102 -97
  295. package/pipeline/skills/shared/external/swift-concurrency-pro/references/async-streams.md +36 -37
  296. package/pipeline/skills/shared/external/swift-concurrency-pro/references/bridging.md +82 -34
  297. package/pipeline/skills/shared/external/swift-concurrency-pro/references/bug-patterns.md +90 -52
  298. package/pipeline/skills/shared/external/swift-concurrency-pro/references/cancellation.md +55 -55
  299. package/pipeline/skills/shared/external/swift-concurrency-pro/references/diagnostics.md +66 -43
  300. package/pipeline/skills/shared/external/swift-concurrency-pro/references/hotspots.md +39 -23
  301. package/pipeline/skills/shared/external/swift-concurrency-pro/references/interop.md +66 -68
  302. package/pipeline/skills/shared/external/swift-concurrency-pro/references/new-features.md +152 -131
  303. package/pipeline/skills/shared/external/swift-concurrency-pro/references/structured.md +60 -57
  304. package/pipeline/skills/shared/external/swift-concurrency-pro/references/testing.md +131 -118
  305. package/pipeline/skills/shared/external/swift-concurrency-pro/references/unstructured.md +37 -29
  306. package/pipeline/skills/shared/external/swift-formatstyle/evals/evals.json +43 -0
  307. package/pipeline/skills/shared/external/swift-testing-pro/SKILL.md +77 -58
  308. package/pipeline/skills/shared/external/swift-testing-pro/evals/evals.json +59 -0
  309. package/pipeline/skills/shared/external/swift-testing-pro/references/async-tests.md +139 -144
  310. package/pipeline/skills/shared/external/swift-testing-pro/references/core-rules.md +90 -28
  311. package/pipeline/skills/shared/external/swift-testing-pro/references/migrating-from-xctest.md +38 -21
  312. package/pipeline/skills/shared/external/swift-testing-pro/references/new-features.md +139 -156
  313. package/pipeline/skills/shared/external/swift-testing-pro/references/writing-better-tests.md +173 -147
  314. package/pipeline/skills/shared/external/swiftdata-pro/SKILL.md +75 -59
  315. package/pipeline/skills/shared/external/swiftdata-pro/evals/evals.json +50 -0
  316. package/pipeline/skills/shared/external/swiftdata-pro/references/cloudkit.md +34 -7
  317. package/pipeline/skills/shared/external/swiftdata-pro/references/indexing.md +20 -14
  318. package/pipeline/skills/shared/external/swiftdata-pro/references/inheritance.md +127 -0
  319. package/pipeline/skills/shared/external/swiftdata-pro/references/model-rules.md +141 -0
  320. package/pipeline/skills/shared/external/swiftdata-pro/references/predicates.md +37 -44
  321. package/pipeline/skills/shared/external/swiftlint/evals/evals.json +44 -0
  322. package/pipeline/skills/shared/external/swiftui-expert-skill/SKILL.md +89 -88
  323. package/pipeline/skills/shared/external/swiftui-expert-skill/evals/evals.json +55 -0
  324. package/pipeline/skills/shared/external/swiftui-expert-skill/references/accessibility-patterns.md +104 -122
  325. package/pipeline/skills/shared/external/swiftui-expert-skill/references/animation-advanced.md +73 -93
  326. package/pipeline/skills/shared/external/swiftui-expert-skill/references/animation-basics.md +144 -169
  327. package/pipeline/skills/shared/external/swiftui-expert-skill/references/animation-transitions.md +122 -133
  328. package/pipeline/skills/shared/external/swiftui-expert-skill/references/charts-accessibility.md +141 -99
  329. package/pipeline/skills/shared/external/swiftui-expert-skill/references/charts.md +273 -333
  330. package/pipeline/skills/shared/external/swiftui-expert-skill/references/image-optimization.md +105 -128
  331. package/pipeline/skills/shared/external/swiftui-expert-skill/references/latest-apis.md +199 -312
  332. package/pipeline/skills/shared/external/swiftui-expert-skill/references/layout-best-practices.md +129 -169
  333. package/pipeline/skills/shared/external/swiftui-expert-skill/references/liquid-glass.md +17 -30
  334. package/pipeline/skills/shared/external/swiftui-expert-skill/references/list-patterns.md +198 -258
  335. package/pipeline/skills/shared/external/swiftui-expert-skill/references/macos-scenes.md +145 -218
  336. package/pipeline/skills/shared/external/swiftui-expert-skill/references/macos-views.md +150 -249
  337. package/pipeline/skills/shared/external/swiftui-expert-skill/references/macos-window-styling.md +109 -208
  338. package/pipeline/skills/shared/external/swiftui-expert-skill/references/performance-patterns.md +225 -271
  339. package/pipeline/skills/shared/external/swiftui-expert-skill/references/scroll-patterns.md +117 -210
  340. package/pipeline/skills/shared/external/swiftui-expert-skill/references/sheet-navigation-patterns.md +171 -237
  341. package/pipeline/skills/shared/external/swiftui-expert-skill/references/state-management.md +196 -260
  342. package/pipeline/skills/shared/external/swiftui-expert-skill/references/view-structure.md +167 -230
  343. package/pipeline/skills/shared/external/swiftui-gestures/evals/evals.json +43 -0
  344. package/pipeline/skills/shared/external/swiftui-layout-components/evals/evals.json +43 -0
  345. package/pipeline/skills/shared/external/swiftui-navigation/evals/evals.json +44 -0
  346. package/pipeline/skills/shared/external/swiftui-navigation/references/navigationstack.md +1 -2
  347. package/pipeline/skills/shared/external/swiftui-patterns/evals/evals.json +43 -0
  348. package/pipeline/skills/shared/external/swiftui-performance/evals/evals.json +44 -0
  349. package/pipeline/skills/shared/external/swiftui-performance-audit/SKILL.md +71 -79
  350. package/pipeline/skills/shared/external/swiftui-performance-audit/evals/evals.json +55 -0
  351. package/pipeline/skills/shared/external/swiftui-performance-audit/references/audit-layout.md +50 -0
  352. package/pipeline/skills/shared/external/swiftui-performance-audit/references/capture-checklist.md +51 -0
  353. package/pipeline/skills/shared/external/swiftui-performance-audit/references/hangs.md +34 -0
  354. package/pipeline/skills/shared/external/swiftui-performance-audit/references/instruments-guide.md +68 -0
  355. package/pipeline/skills/shared/external/swiftui-performance-audit/references/smell-catalog.md +191 -0
  356. package/pipeline/skills/shared/external/swiftui-performance-audit/references/update-model.md +69 -0
  357. package/pipeline/skills/shared/external/swiftui-pro/SKILL.md +65 -63
  358. package/pipeline/skills/shared/external/swiftui-pro/evals/evals.json +45 -0
  359. package/pipeline/skills/shared/external/swiftui-pro/references/accessibility.md +40 -13
  360. package/pipeline/skills/shared/external/swiftui-pro/references/api.md +74 -29
  361. package/pipeline/skills/shared/external/swiftui-pro/references/data.md +44 -24
  362. package/pipeline/skills/shared/external/swiftui-pro/references/design.md +45 -31
  363. package/pipeline/skills/shared/external/swiftui-pro/references/hygiene.md +17 -8
  364. package/pipeline/skills/shared/external/swiftui-pro/references/navigation.md +19 -9
  365. package/pipeline/skills/shared/external/swiftui-pro/references/performance.md +50 -34
  366. package/pipeline/skills/shared/external/swiftui-pro/references/swift.md +73 -45
  367. package/pipeline/skills/shared/external/swiftui-pro/references/views.md +48 -23
  368. package/pipeline/skills/shared/external/swiftui-ui-patterns/SKILL.md +89 -83
  369. package/pipeline/skills/shared/external/swiftui-ui-patterns/evals/evals.json +44 -0
  370. package/pipeline/skills/shared/external/swiftui-ui-patterns/references/app-wiring.md +119 -114
  371. package/pipeline/skills/shared/external/swiftui-ui-patterns/references/async-state.md +76 -61
  372. package/pipeline/skills/shared/external/swiftui-ui-patterns/references/components-index.md +63 -46
  373. package/pipeline/skills/shared/external/swiftui-ui-patterns/references/controls.md +32 -31
  374. package/pipeline/skills/shared/external/swiftui-ui-patterns/references/deeplinks.md +49 -38
  375. package/pipeline/skills/shared/external/swiftui-ui-patterns/references/focus.md +77 -49
  376. package/pipeline/skills/shared/external/swiftui-ui-patterns/references/form.md +61 -44
  377. package/pipeline/skills/shared/external/swiftui-ui-patterns/references/grids.md +40 -42
  378. package/pipeline/skills/shared/external/swiftui-ui-patterns/references/input-toolbar.md +44 -31
  379. package/pipeline/skills/shared/external/swiftui-ui-patterns/references/lightweight-clients.md +90 -64
  380. package/pipeline/skills/shared/external/swiftui-ui-patterns/references/list.md +48 -49
  381. package/pipeline/skills/shared/external/swiftui-ui-patterns/references/loading-placeholders.md +36 -25
  382. package/pipeline/skills/shared/external/swiftui-ui-patterns/references/macos-settings.md +30 -30
  383. package/pipeline/skills/shared/external/swiftui-ui-patterns/references/matched-transitions.md +49 -32
  384. package/pipeline/skills/shared/external/swiftui-ui-patterns/references/media.md +49 -41
  385. package/pipeline/skills/shared/external/swiftui-ui-patterns/references/menu-bar.md +52 -48
  386. package/pipeline/skills/shared/external/swiftui-ui-patterns/references/navigationstack.md +119 -104
  387. package/pipeline/skills/shared/external/swiftui-ui-patterns/references/overlay.md +30 -27
  388. package/pipeline/skills/shared/external/swiftui-ui-patterns/references/performance.md +33 -31
  389. package/pipeline/skills/shared/external/swiftui-ui-patterns/references/previews.md +27 -27
  390. package/pipeline/skills/shared/external/swiftui-ui-patterns/references/scroll-reveal.md +79 -86
  391. package/pipeline/skills/shared/external/swiftui-ui-patterns/references/scrollview.md +47 -40
  392. package/pipeline/skills/shared/external/swiftui-ui-patterns/references/searchable.md +55 -40
  393. package/pipeline/skills/shared/external/swiftui-ui-patterns/references/sheets.md +113 -84
  394. package/pipeline/skills/shared/external/swiftui-ui-patterns/references/split-views.md +37 -34
  395. package/pipeline/skills/shared/external/swiftui-ui-patterns/references/tabview.md +75 -75
  396. package/pipeline/skills/shared/external/swiftui-ui-patterns/references/theming.md +37 -32
  397. package/pipeline/skills/shared/external/swiftui-ui-patterns/references/title-menus.md +41 -51
  398. package/pipeline/skills/shared/external/swiftui-ui-patterns/references/top-bar.md +46 -30
  399. package/pipeline/skills/shared/external/swiftui-uikit-interop/evals/evals.json +44 -0
  400. package/pipeline/skills/shared/external/swiftui-view-refactor/SKILL.md +152 -121
  401. package/pipeline/skills/shared/external/swiftui-view-refactor/evals/evals.json +56 -0
  402. package/pipeline/skills/shared/external/swiftui-view-refactor/references/mv-patterns.md +107 -98
  403. package/pipeline/skills/shared/external/swiftui-webkit/evals/evals.json +44 -0
  404. package/pipeline/skills/shared/external/tailwind-css/evals/evals.json +43 -0
  405. package/pipeline/skills/shared/external/test-result-triage/SKILL.md +2 -2
  406. package/pipeline/skills/shared/external/test-result-triage/evals/evals.json +44 -0
  407. package/pipeline/skills/shared/external/testing-backend/evals/evals.json +42 -0
  408. package/pipeline/skills/shared/external/tipkit/evals/evals.json +44 -0
  409. package/pipeline/skills/shared/external/typescript-patterns/evals/evals.json +42 -0
  410. package/pipeline/skills/shared/external/valven-rules/evals/evals.json +44 -0
  411. package/pipeline/skills/shared/external/vision-framework/evals/evals.json +44 -0
  412. package/pipeline/skills/shared/external/vue-composition/evals/evals.json +42 -0
  413. package/pipeline/skills/shared/external/weatherkit/evals/evals.json +42 -0
  414. package/pipeline/skills/shared/external/web-accessibility/evals/evals.json +43 -0
  415. package/pipeline/skills/shared/external/web-performance/evals/evals.json +44 -0
  416. package/pipeline/skills/shared/external/web-testing/SKILL.md +2 -2
  417. package/pipeline/skills/shared/external/web-testing/evals/evals.json +43 -0
  418. package/pipeline/skills/shared/external/web-testing/references/testing-examples.md +2 -2
  419. package/pipeline/skills/shared/external/widgetkit/evals/evals.json +44 -0
  420. package/pipeline/skills/shared/external/xcode-build-benchmark/SKILL.md +61 -55
  421. package/pipeline/skills/shared/external/xcode-build-benchmark/evals/evals.json +42 -0
  422. package/pipeline/skills/shared/external/xcode-build-benchmark/references/benchmark-artifacts.md +69 -67
  423. package/pipeline/skills/shared/external/xcode-build-benchmark/references/benchmarking-workflow.md +39 -47
  424. package/pipeline/skills/shared/external/xcode-build-benchmark/schemas/build-benchmark.schema.json +72 -154
  425. package/pipeline/skills/shared/external/xcode-build-benchmark/scripts/benchmark_builds.py +207 -245
  426. package/pipeline/skills/shared/external/xcode-build-fixer/SKILL.md +145 -139
  427. package/pipeline/skills/shared/external/xcode-build-fixer/evals/evals.json +54 -0
  428. package/pipeline/skills/shared/external/xcode-build-fixer/references/build-settings-best-practices.md +81 -175
  429. package/pipeline/skills/shared/external/xcode-build-fixer/references/fix-patterns.md +188 -143
  430. package/pipeline/skills/shared/external/xcode-build-fixer/references/recommendation-format.md +41 -40
  431. package/pipeline/skills/shared/external/xcode-build-fixer/scripts/benchmark_builds.py +207 -245
  432. package/pipeline/skills/shared/external/xcode-build-orchestrator/SKILL.md +107 -98
  433. package/pipeline/skills/shared/external/xcode-build-orchestrator/evals/evals.json +54 -0
  434. package/pipeline/skills/shared/external/xcode-build-orchestrator/references/benchmark-artifacts.md +69 -67
  435. package/pipeline/skills/shared/external/xcode-build-orchestrator/references/build-settings-best-practices.md +81 -175
  436. package/pipeline/skills/shared/external/xcode-build-orchestrator/references/orchestration-report-template.md +81 -69
  437. package/pipeline/skills/shared/external/xcode-build-orchestrator/references/recommendation-format.md +41 -40
  438. package/pipeline/skills/shared/external/xcode-build-orchestrator/scripts/benchmark_builds.py +207 -245
  439. package/pipeline/skills/shared/external/xcode-build-orchestrator/scripts/diagnose_compilation.py +155 -210
  440. package/pipeline/skills/shared/external/xcode-build-orchestrator/scripts/generate_optimization_report.py +355 -480
  441. package/pipeline/skills/shared/external/xcode-compilation-analyzer/SKILL.md +70 -69
  442. package/pipeline/skills/shared/external/xcode-compilation-analyzer/evals/evals.json +54 -0
  443. package/pipeline/skills/shared/external/xcode-compilation-analyzer/references/build-optimization-sources.md +83 -133
  444. package/pipeline/skills/shared/external/xcode-compilation-analyzer/references/code-compilation-checks.md +85 -73
  445. package/pipeline/skills/shared/external/xcode-compilation-analyzer/references/recommendation-format.md +41 -40
  446. package/pipeline/skills/shared/external/xcode-compilation-analyzer/scripts/diagnose_compilation.py +155 -210
  447. package/pipeline/skills/shared/external/xcode-project-analyzer/SKILL.md +54 -52
  448. package/pipeline/skills/shared/external/xcode-project-analyzer/evals/evals.json +54 -0
  449. package/pipeline/skills/shared/external/xcode-project-analyzer/references/build-optimization-sources.md +83 -133
  450. package/pipeline/skills/shared/external/xcode-project-analyzer/references/build-settings-best-practices.md +81 -175
  451. package/pipeline/skills/shared/external/xcode-project-analyzer/references/project-audit-checks.md +115 -83
  452. package/pipeline/skills/shared/external/xcode-project-analyzer/references/recommendation-format.md +41 -40
  453. package/pipeline/scripts/_notices.mjs +0 -171
  454. package/pipeline/skills/shared/external/NOTICE-avdlee-swiftui-agent-skill.md +0 -48
  455. package/pipeline/skills/shared/external/NOTICE-dimillian-skills.md +0 -63
  456. package/pipeline/skills/shared/external/NOTICE-paul-hudson-skills.md +0 -54
  457. package/pipeline/skills/shared/external/NOTICE-vibeship-spawner-skills.md +0 -203
  458. package/pipeline/skills/shared/external/NOTICE-xcode-build-skills.md +0 -60
  459. package/pipeline/skills/shared/external/ios-iphone-duo/NOTICE.md +0 -53
  460. package/pipeline/skills/shared/external/macos-spm-app-packaging/assets/templates/bootstrap/Sources/MyApp/main.swift +0 -11
  461. package/pipeline/skills/shared/external/swiftdata-pro/references/class-inheritance.md +0 -104
  462. package/pipeline/skills/shared/external/swiftdata-pro/references/core-rules.md +0 -20
  463. package/pipeline/skills/shared/external/swiftui-performance-audit/references/code-smells.md +0 -158
  464. package/pipeline/skills/shared/external/swiftui-performance-audit/references/demystify-swiftui-performance-wwdc23.md +0 -46
  465. package/pipeline/skills/shared/external/swiftui-performance-audit/references/optimizing-swiftui-performance-instruments.md +0 -29
  466. package/pipeline/skills/shared/external/swiftui-performance-audit/references/profiling-intake.md +0 -44
  467. package/pipeline/skills/shared/external/swiftui-performance-audit/references/report-template.md +0 -47
  468. package/pipeline/skills/shared/external/swiftui-performance-audit/references/understanding-hangs-in-your-app.md +0 -33
  469. package/pipeline/skills/shared/external/swiftui-performance-audit/references/understanding-improving-swiftui-performance.md +0 -52
@@ -1,161 +1,136 @@
1
- # SwiftUI Charts Reference
1
+ # Swift Charts
2
2
 
3
3
  <!-- toc -->
4
- - [Table of Contents](#table-of-contents)
5
- - [Overview](#overview)
6
- - [Availability](#availability)
7
- - [Core APIs](#core-apis)
8
- - [Chart Types](#chart-types)
9
- - [Axis Tweaks](#axis-tweaks)
10
- - [Selection APIs](#selection-apis)
4
+ - [Version Matrix](#version-matrix)
5
+ - [Setup](#setup)
6
+ - [Marks](#marks)
7
+ - [Chart3D (iOS 26+)](#chart3d-ios-26)
8
+ - [Axes](#axes)
9
+ - [Selection (iOS 17+)](#selection-ios-17)
11
10
  - [Annotations](#annotations)
12
- - [ChartProxy and Custom Touch Handling](#chartproxy-and-custom-touch-handling)
13
- - [Modifier Scope](#modifier-scope)
14
- - [Styling and Visual Channels](#styling-and-visual-channels)
15
- - [Composing Multiple Marks](#composing-multiple-marks)
16
- - [Animating Chart Data](#animating-chart-data)
17
- - [Best Practices](#best-practices)
11
+ - [Custom Gestures with ChartProxy](#custom-gestures-with-chartproxy)
12
+ - [Where Modifiers Go](#where-modifiers-go)
13
+ - [Visual Channels](#visual-channels)
14
+ - [Layering Marks](#layering-marks)
15
+ - [Animating Data Changes](#animating-data-changes)
16
+ - [Guidelines](#guidelines)
18
17
  <!-- /toc -->
19
18
 
20
- ## Table of Contents
19
+ Building 2D charts with Swift Charts: marks, plot types, axes, scales, built-in selection, annotations, `ChartProxy` gestures, styling channels and data animation, plus a section on `Chart3D`. Accessibility, version fallbacks and a final checklist are in `charts-accessibility.md`.
21
20
 
22
- - [Overview](#overview)
23
- - [Availability](#availability)
24
- - [Core APIs](#core-apis)
25
- - [Chart Types](#chart-types)
26
- - [Axis Tweaks](#axis-tweaks)
27
- - [Selection APIs](#selection-apis)
28
- - [Annotations](#annotations)
29
- - [ChartProxy and Custom Touch Handling](#chartproxy-and-custom-touch-handling)
30
- - [Modifier Scope](#modifier-scope)
31
- - [Styling and Visual Channels](#styling-and-visual-channels)
32
- - [Composing Multiple Marks](#composing-multiple-marks)
33
- - [Animating Chart Data](#animating-chart-data)
34
- - [Best Practices](#best-practices)
35
-
36
- ## Overview
21
+ Every chart starts from a `Chart` view that holds marks. Seven mark families exist: sector, rectangle, rule, point, area, line and bar.
37
22
 
38
- Swift Charts is Apple's native charting framework for SwiftUI. Use `Chart` with one or more marks to build bar, line, area, point, rule, rectangle, and sector charts. This reference covers the standard 2D chart APIs, axis customization, built-in selection APIs, annotations, and custom touch handling.
23
+ ## Version Matrix
39
24
 
40
- ## Availability
25
+ | Minimum OS | What becomes available |
26
+ |------------|------------------------|
27
+ | iOS 16 | the `Chart` container with scales and custom axes; `RuleMark`, `PointMark`, `RectangleMark`, `LineMark`, `AreaMark`, `BarMark` |
28
+ | iOS 17 | `SectorMark`, built-in selection modifiers, scrollable chart axes |
29
+ | iOS 18 | plot types (`LinePlot`, `BarPlot` and the rest) that take whole collections |
30
+ | iOS 26 | `Chart3D` and the Z-axis APIs |
41
31
 
42
- Base `Chart`, custom axes, scales, and most marks require iOS 16 or later.
43
-
44
- - `BarMark`, `LineMark`, `AreaMark`, `PointMark`, `RectangleMark`, and `RuleMark` are available on iOS 16+
45
- - `SectorMark`, built-in selection, and scrollable chart axes require iOS 17+
46
- - Data-driven plot types such as `BarPlot` and `LinePlot` require iOS 18+
47
- - Chart3D and Z-axis APIs exist on iOS 26+; this reference is primarily about 2D `Chart`, with a dedicated Chart3D section below
32
+ Gate anything above your deployment target:
48
33
 
49
34
  ```swift
50
35
  if #available(iOS 17, *) {
51
- // Selection, SectorMark, scrollable axes
36
+ // sector marks, selection, scrolling axes
52
37
  } else {
53
- // Base Chart, axes, scales, and core marks
38
+ // iOS 16 chart: core marks, axes, scales
54
39
  }
55
40
  ```
56
41
 
57
- ## Core APIs
42
+ ## Setup
58
43
 
59
- ### Import the Framework
44
+ ### Import Charts
60
45
 
61
- Always check that the file imports `Charts` before using `Chart`, `Chart3D`, `BarMark`, `SectorMark`, or `ChartProxy`.
46
+ A file that uses `Chart`, `Chart3D`, any mark, or `ChartProxy` needs its own import. When chart types fail to resolve, check this first.
62
47
 
63
48
  ```swift
64
49
  import SwiftUI
65
50
  import Charts
66
51
  ```
67
52
 
68
- If chart types are unresolved, the first thing to verify is that `Charts` is imported in that file.
69
-
70
- ### Chart Container
71
-
72
- `Chart` is the root view. Add one or more marks inside it.
73
-
74
- ```swift
75
- Chart(sales) { item in
76
- BarMark(
77
- x: .value("Month", item.month),
78
- y: .value("Revenue", item.revenue)
79
- )
80
- }
81
- ```
82
-
83
- ### Data Models Should Be Identifiable
53
+ ### Give the data stable identity
84
54
 
85
- Prefer `Identifiable` models for chart data so identity stays stable as data changes.
55
+ `Chart(data)` wants `Identifiable` elements so that each point keeps its identity as the collection changes. If the type cannot conform, name the identifying key path with `id:`.
86
56
 
87
57
  ```swift
88
- struct SalesPoint: Identifiable {
58
+ struct FuelReading: Identifiable {
89
59
  let id: UUID
90
- let month: String
91
- let revenue: Double
60
+ let leg: String
61
+ let kilograms: Double
92
62
  }
93
- ```
94
63
 
95
- If your model cannot conform to `Identifiable`, provide an explicit id key path:
64
+ Chart(readings) { reading in
65
+ BarMark(
66
+ x: .value("Leg", reading.leg),
67
+ y: .value("Fuel burned (kg)", reading.kilograms)
68
+ )
69
+ }
96
70
 
97
- ```swift
98
- Chart(sales, id: \.month) { item in
71
+ // Without Identifiable
72
+ Chart(readings, id: \.leg) { reading in
99
73
  BarMark(
100
- x: .value("Month", item.month),
101
- y: .value("Revenue", item.revenue)
74
+ x: .value("Leg", reading.leg),
75
+ y: .value("Fuel burned (kg)", reading.kilograms)
102
76
  )
103
77
  }
104
78
  ```
105
79
 
106
- ### Plottable Values
80
+ ### Plottable values
107
81
 
108
- Use `.value(_, _)` to describe what each axis value means. Those labels are reused by axes, legends, and accessibility.
82
+ Each coordinate is written `.value(label, value)`. The label is not decoration: axes, legends and VoiceOver all reuse it, so make it say what the number means.
109
83
 
110
84
  ```swift
111
85
  LineMark(
112
- x: .value("Day", entry.date),
113
- y: .value("Steps", entry.count)
86
+ x: .value("Departure date", flight.date),
87
+ y: .value("Passengers", flight.passengerCount)
114
88
  )
115
89
  ```
116
90
 
117
- ## Chart Types
91
+ ## Marks
118
92
 
119
93
  ### BarMark
120
94
 
121
95
  ```swift
122
96
  BarMark(
123
- x: .value("Product", product.name),
124
- y: .value("Units", product.units)
97
+ x: .value("Aircraft", fleetEntry.model),
98
+ y: .value("Flights", fleetEntry.flightCount)
125
99
  )
126
100
  ```
127
101
 
128
- Stacking via `MarkStackingMethod`: `.standard`, `.normalized`, `.center`, `.unstacked`.
102
+ Stacking is a `MarkStackingMethod`: `.standard`, `.normalized`, `.center` or `.unstacked`.
129
103
 
130
104
  ### LineMark
131
105
 
132
106
  ```swift
133
107
  LineMark(
134
- x: .value("Day", day.date),
135
- y: .value("Steps", day.count)
108
+ x: .value("Flight hour", sample.hour),
109
+ y: .value("Altitude (ft)", sample.altitude)
136
110
  )
137
- .interpolationMethod(.monotone)
111
+ .interpolationMethod(.catmullRom)
138
112
  ```
139
113
 
140
- Interpolation methods: `.linear`, `.monotone`, `.cardinal`, `.catmullRom`, `.stepStart`, `.stepCenter`, `.stepEnd`. Cardinal and Catmull-Rom accept optional tension/alpha parameters.
114
+ Curves to choose from: `.catmullRom` (optional alpha), `.cardinal` (optional tension), `.monotone`, `.linear`, and the step variants `.stepEnd`, `.stepCenter`, `.stepStart`.
141
115
 
142
116
  ### AreaMark
143
117
 
144
118
  ```swift
145
119
  AreaMark(
146
- x: .value("Hour", sample.hour),
147
- y: .value("Temperature", sample.value),
120
+ x: .value("Minute", reading.minute),
121
+ y: .value("Cabin pressure", reading.pressure),
148
122
  stacking: .unstacked
149
123
  )
124
+ .opacity(0.6)
150
125
  ```
151
126
 
152
- Ranged areas use `yStart`/`yEnd` for bands like min/max or confidence intervals:
127
+ For a band such as a min/max range or a confidence interval, give the mark `yStart` and `yEnd`:
153
128
 
154
129
  ```swift
155
130
  AreaMark(
156
- x: .value("Day", sample.day),
157
- yStart: .value("Low", sample.low),
158
- yEnd: .value("High", sample.high)
131
+ x: .value("Month", forecast.month),
132
+ yStart: .value("Lowest fare", forecast.lowestFare),
133
+ yEnd: .value("Highest fare", forecast.highestFare)
159
134
  )
160
135
  ```
161
136
 
@@ -163,8 +138,8 @@ AreaMark(
163
138
 
164
139
  ```swift
165
140
  PointMark(
166
- x: .value("Time", measurement.time),
167
- y: .value("Value", measurement.value)
141
+ x: .value("Distance (km)", route.distance),
142
+ y: .value("Duration (min)", route.duration)
168
143
  )
169
144
  ```
170
145
 
@@ -172,68 +147,64 @@ PointMark(
172
147
 
173
148
  ```swift
174
149
  RectangleMark(
175
- xStart: .value("Start Day", cell.startDay),
176
- xEnd: .value("End Day", cell.endDay),
177
- yStart: .value("Low", cell.low),
178
- yEnd: .value("High", cell.high)
150
+ xStart: .value("Window opens", slot.opensDay),
151
+ xEnd: .value("Window closes", slot.closesDay),
152
+ yStart: .value("Min load", slot.minLoad),
153
+ yEnd: .value("Max load", slot.maxLoad)
179
154
  )
180
155
  ```
181
156
 
182
157
  ### RuleMark
183
158
 
184
159
  ```swift
185
- RuleMark(y: .value("Goal", 10_000))
160
+ RuleMark(y: .value("On-time target", 85))
186
161
  .foregroundStyle(.red)
187
162
  ```
188
163
 
189
- ### SectorMark
164
+ ### SectorMark (iOS 17+)
190
165
 
191
- Use `SectorMark` for pie and donut-style charts. `SectorMark` requires iOS 17 or later.
166
+ Pie and donut charts. An `innerRadius` hollows the pie into a donut; `angularInset` leaves a gap between slices.
192
167
 
193
168
  ```swift
194
- Chart(expenses) { expense in
169
+ Chart(cabinMix) { cabin in
195
170
  SectorMark(
196
- angle: .value("Amount", expense.amount),
197
- innerRadius: .ratio(0.6),
198
- angularInset: 2
171
+ angle: .value("Seats", cabin.seatCount),
172
+ innerRadius: .ratio(0.55),
173
+ angularInset: 1.5
199
174
  )
200
- .foregroundStyle(by: .value("Category", expense.category))
175
+ .foregroundStyle(by: .value("Cabin", cabin.name))
201
176
  }
202
177
  ```
203
178
 
204
- Use `innerRadius` to turn a pie chart into a donut chart, and `angularInset` to separate slices visually.
205
-
206
- ### Plot Types (iOS 18+)
179
+ ### Plot types (iOS 18+)
207
180
 
208
- iOS 18 adds data-driven plot wrappers: `AreaPlot`, `BarPlot`, `LinePlot`, `PointPlot`, `RectanglePlot`, `RulePlot`, and `SectorPlot`.
209
-
210
- `LinePlot` and `AreaPlot` also accept function closures for plotting mathematical functions without discrete data:
181
+ iOS 18 adds collection-level wrappers over the same families, named after them: `SectorPlot`, `RulePlot`, `RectanglePlot`, `PointPlot`, `LinePlot`, `BarPlot`, `AreaPlot`. Choose them when you prefer a collection-oriented API or want to plot a function. `LinePlot` and `AreaPlot` accept a closure and draw a mathematical function with no discrete data:
211
182
 
212
183
  ```swift
213
184
  if #available(iOS 18, *) {
214
185
  Chart {
215
- LinePlot(x: "x", y: "sin(x)") { x in
216
- sin(x)
186
+ // function plot, no data collection
187
+ LinePlot(x: "t", y: "damped") { t in
188
+ exp(-t / 4) * cos(t)
217
189
  }
218
190
  }
219
- .chartXScale(domain: -Double.pi ... Double.pi)
220
- .chartYScale(domain: -1.5 ... 1.5)
191
+ .chartXScale(domain: 0 ... 12)
192
+ .chartYScale(domain: -1.2 ... 1.2)
221
193
  }
222
194
  ```
223
195
 
224
- Use plot types when you want a data-first API surface or need function plotting. The underlying chart families stay the same.
225
-
226
- ### Chart3D (iOS 26+)
196
+ ## Chart3D (iOS 26+)
227
197
 
228
- `Chart3D` is a separate API for 3D chart content. It supports 3D `PointMark`, `RectangleMark`, `RuleMark`, and `SurfacePlot`.
198
+ `Chart3D` is its own container for three-dimensional content. It accepts 3D `PointMark`, `RectangleMark` and `RuleMark`, plus `SurfacePlot`. It does not exist before iOS 26, so it must always sit behind `#available(iOS 26, *)`.
229
199
 
230
200
  ```swift
231
201
  if #available(iOS 26, *) {
232
- Chart3D(points) { point in
202
+ // scatter in three axes
203
+ Chart3D(sensorSamples) { sample in
233
204
  PointMark(
234
- x: .value("X", point.x),
235
- y: .value("Y", point.y),
236
- z: .value("Z", point.z)
205
+ x: .value("Latitude", sample.latitude),
206
+ y: .value("Altitude", sample.altitude),
207
+ z: .value("Longitude", sample.longitude)
237
208
  )
238
209
  }
239
210
  .chart3DPose(.front)
@@ -241,379 +212,348 @@ if #available(iOS 26, *) {
241
212
  }
242
213
  ```
243
214
 
244
- `SurfacePlot` visualizes mathematical surfaces by evaluating a two-variable function:
215
+ `SurfacePlot` evaluates a function of two variables and draws the resulting surface:
245
216
 
246
217
  ```swift
247
218
  if #available(iOS 26, *) {
248
219
  Chart3D {
249
- SurfacePlot(x: "x", y: "height", z: "z") { x, z in
250
- sin(x) * cos(z)
220
+ // height comes from the closure
221
+ SurfacePlot(x: "x", y: "lift", z: "z") { x, z in
222
+ cos(x) * sin(z)
251
223
  }
252
224
  }
253
- .chartXScale(domain: -Double.pi ... Double.pi)
254
- .chartZScale(domain: -Double.pi ... Double.pi)
225
+ .chartXScale(domain: -3.0 ... 3.0)
226
+ .chartZScale(domain: -3.0 ... 3.0)
255
227
  }
256
228
  ```
257
229
 
258
- Camera and pose configuration:
230
+ Camera options:
259
231
 
260
- - **Projection**: `.chart3DCameraProjection(.orthographic)` (default, precise measurements) or `.perspective` (depth effect)
261
- - **Pose presets**: `.chart3DPose(.default)`, `.front`, `.back`, `.left`, `.right`
262
- - **Custom pose**: `.chart3DPose(azimuth: .degrees(45), inclination: .degrees(30))`
263
- - On visionOS, Chart3D supports natural 3D interaction gestures for rotation and exploration
232
+ - Projection: `.chart3DCameraProjection(.orthographic)` is the default and keeps measurements exact; `.perspective` adds depth.
233
+ - Preset poses: `.front`, `.back`, `.left`, `.right` or `.default`, each passed to `.chart3DPose(_:)`.
234
+ - Arbitrary pose: build a `Chart3DPose` from an azimuth and an inclination and pass it in, for example `.chart3DPose(Chart3DPose(azimuth: .degrees(60), inclination: .degrees(20)))`. A `Binding<Chart3DPose>` overload lets the pose follow state.
235
+ - On visionOS, people can rotate and explore a `Chart3D` with the platform's 3D gestures.
264
236
 
265
- **Always** gate `Chart3D` with `#available(iOS 26, *)` - it is not available on earlier OS versions.
237
+ ## Axes
266
238
 
267
- ## Axis Tweaks
239
+ ### Visibility and titles
268
240
 
269
- ### Axis Visibility and Labels
270
-
271
- Use `chartXAxis`, `chartYAxis`, `chartXAxisLabel`, and `chartYAxisLabel` on the `Chart` container.
272
- Axis visibility supports `.automatic`, `.visible`, and `.hidden`.
241
+ `chartXAxis`, `chartYAxis`, `chartXAxisLabel` and `chartYAxisLabel` go on the `Chart`. Visibility is `.automatic`, `.visible` or `.hidden`.
273
242
 
274
243
  ```swift
275
- Chart(data) { item in
244
+ Chart(monthlyDelays) { month in
276
245
  BarMark(
277
- x: .value("Month", item.month),
278
- y: .value("Revenue", item.revenue)
246
+ x: .value("Month", month.name),
247
+ y: .value("Delayed flights", month.count)
279
248
  )
280
249
  }
281
- .chartXAxis(.visible)
282
- .chartYAxis(.hidden)
250
+ .chartYAxisLabel("Delayed flights")
283
251
  .chartXAxisLabel("Month")
284
- .chartYAxisLabel("Revenue")
252
+ .chartYAxis(.hidden)
253
+ .chartXAxis(.visible)
285
254
  ```
286
255
 
287
- ### Custom Axis Marks
256
+ ### AxisMarks
288
257
 
289
- Use `AxisMarks` to control tick placement, labels, and grid lines.
258
+ `AxisMarks` controls where ticks sit, how values are labelled and whether grid lines show. Inside it, combine `AxisGridLine()`, `AxisTick()` and `AxisValueLabel()` as needed.
290
259
 
291
260
  ```swift
292
- Chart(steps) { day in
261
+ Chart(dailyBookings) { day in
293
262
  LineMark(
294
- x: .value("Day", day.date),
295
- y: .value("Steps", day.count)
263
+ x: .value("Travel date", day.date),
264
+ y: .value("Bookings made", day.count)
296
265
  )
297
266
  }
298
267
  .chartXAxis {
299
268
  AxisMarks(
300
- preset: .aligned,
301
- position: .bottom,
302
- values: .stride(by: .day)
269
+ preset: .inset,
270
+ position: .top,
271
+ values: .stride(by: .weekOfYear)
303
272
  ) {
304
- AxisGridLine()
273
+ AxisValueLabel(format: .dateTime.month(.abbreviated).day())
305
274
  AxisTick(length: .label)
306
- AxisValueLabel(format: .dateTime.weekday(.abbreviated))
275
+ AxisGridLine()
307
276
  }
308
277
  }
309
278
  ```
310
279
 
311
- Useful `AxisMarks` inputs:
312
-
313
- - `preset`: `.automatic`, `.extended`, `.aligned`, `.inset`
314
- - `position`: `.automatic`, `.leading`, `.trailing`, `.top`, `.bottom`
315
- - `values`: `.automatic`, `.automatic(desiredCount:)`, `.stride(by:)`, `.stride(by:count:)`, or an explicit array
280
+ `AxisMarks` parameters:
316
281
 
317
- ### Axis Components
318
-
319
- Within `AxisMarks`, combine the built-in axis components as needed:
320
-
321
- ```swift
322
- AxisGridLine()
323
- AxisTick()
324
- AxisValueLabel()
325
- ```
282
+ | Parameter | Options |
283
+ |-----------|---------|
284
+ | `preset` | `.inset`, `.aligned`, `.extended` or `.automatic` |
285
+ | `position` | edges `.top`, `.bottom`, `.leading`, `.trailing`, or `.automatic` |
286
+ | `values` | an explicit array, `.stride(by:)` and `.stride(by:count:)`, or `.automatic` with or without `desiredCount:` |
326
287
 
327
- `AxisValueLabel` can be tuned for dense axes:
288
+ For crowded axes, tune `AxisValueLabel`:
328
289
 
329
290
  ```swift
330
291
  AxisValueLabel(
331
- collisionResolution: .greedy(minimumSpacing: 8),
332
- orientation: .vertical
292
+ collisionResolution: .greedy(minimumSpacing: 12),
293
+ orientation: .verticalReversed
333
294
  )
334
295
  ```
335
296
 
336
- Label orientations: `.automatic`, `.horizontal`, `.vertical`, `.verticalReversed`.
337
-
338
- Collision strategies: `.automatic`, `.greedy`, `.greedy(priority:minimumSpacing:)`, `.truncate`, `.disabled`.
297
+ - Orientation: `.automatic`, `.horizontal`, `.vertical`, `.verticalReversed`.
298
+ - Collision resolution: `.disabled`, `.truncate`, `.greedy`, the tunable `.greedy(priority:minimumSpacing:)`, or `.automatic`.
339
299
 
340
- ### Axis Domains and Plot Area Tweaks
300
+ ### Scales and the plot area
341
301
 
342
- Use scales when you need explicit axis domains or plot area control.
302
+ Set an explicit domain with `chartXScale` / `chartYScale` and style the plot area with `chartPlotStyle`. Each axis can be fixed independently, for example only `.chartXScale(domain: firstDay...lastDay)`.
343
303
 
344
304
  ```swift
345
- Chart(data) { item in
305
+ Chart(scores) { entry in
346
306
  LineMark(
347
- x: .value("Index", item.index),
348
- y: .value("Score", item.score)
307
+ x: .value("Survey round", entry.round),
308
+ y: .value("Satisfaction", entry.score)
349
309
  )
350
310
  }
351
- .chartXScale(domain: 0...30)
352
- .chartYScale(domain: 0...100)
353
- .chartPlotStyle { plotArea in
354
- plotArea
355
- .background(.gray.opacity(0.08))
311
+ .chartYScale(domain: 0...10)
312
+ .chartXScale(domain: 1...12)
313
+ .chartPlotStyle { plot in
314
+ plot.background(.gray.opacity(0.08))
356
315
  }
357
316
  ```
358
317
 
359
- You can set one axis domain without forcing the other:
360
-
361
- ```swift
362
- .chartXScale(domain: startDate...endDate)
363
- ```
364
-
365
- ### Scrollable Axes (iOS 17+)
318
+ ### Scrolling (iOS 17+)
366
319
 
367
- For larger datasets, make the plot area scroll and control the visible domain.
320
+ For long series, let the plot scroll and choose how much is visible at once.
368
321
 
369
322
  ```swift
370
- @State private var scrollX = 7
323
+ @State private var firstVisibleDay = 0
371
324
 
372
- Chart(data) { item in
325
+ Chart(dailyLoad) { day in
373
326
  BarMark(
374
- x: .value("Day", item.day),
375
- y: .value("Value", item.value)
327
+ x: .value("Day", day.index),
328
+ y: .value("Load factor", day.loadFactor)
376
329
  )
377
330
  }
331
+ .chartScrollPosition(x: $firstVisibleDay)
332
+ .chartXVisibleDomain(length: 14)
378
333
  .chartScrollableAxes(.horizontal)
379
- .chartXVisibleDomain(length: 7)
380
- .chartScrollPosition(x: $scrollX)
381
334
  ```
382
335
 
383
- ## Selection APIs
336
+ ## Selection (iOS 17+)
337
+
338
+ Selection modifiers bind to the **plottable value** under the finger, not to your model element. Look the record up yourself when you need it.
384
339
 
385
- ### Single-Value Selection
340
+ ### One value
386
341
 
387
- Use `chartXSelection(value:)` or `chartYSelection(value:)` for one selected value.
342
+ `chartXSelection(value:)` or `chartYSelection(value:)`:
388
343
 
389
344
  ```swift
390
- @State private var selectedDate: Date?
345
+ @State private var inspectedDate: Date?
391
346
 
392
- Chart(steps) { day in
393
- LineMark(x: .value("Day", day.date), y: .value("Steps", day.count))
347
+ Chart(dailyBookings) { day in
348
+ LineMark(x: .value("Travel date", day.date), y: .value("Bookings made", day.count))
394
349
 
395
- if let selectedDate {
396
- RuleMark(x: .value("Selected Day", selectedDate))
350
+ if let inspectedDate {
351
+ RuleMark(x: .value("Inspected date", inspectedDate))
397
352
  .foregroundStyle(.secondary)
398
353
  }
399
354
  }
400
- .chartXSelection(value: $selectedDate)
355
+ .chartXSelection(value: $inspectedDate)
401
356
  ```
402
357
 
403
- ### Range Selection
358
+ ### A range
404
359
 
405
- Use `chartXSelection(range:)` or `chartYSelection(range:)` for a dragged range. Bind to a `ClosedRange` whose bound type matches the plotted axis value.
360
+ `chartXSelection(range:)` or `chartYSelection(range:)` bind to a `ClosedRange` of the same type as the axis values. Use a range when people should brush a span, for a zoom window, a comparison or a grouped total; use `value:` when one point is enough.
406
361
 
407
362
  ```swift
408
- @State private var selectedWeeks: ClosedRange<Int>?
363
+ @State private var brushedQuarters: ClosedRange<Int>?
409
364
 
410
- Chart(weeks) { week in
411
- BarMark(x: .value("Week", week.index), y: .value("Revenue", week.revenue))
365
+ Chart(quarters) { quarter in
366
+ BarMark(x: .value("Quarter", quarter.index), y: .value("Revenue", quarter.revenue))
412
367
  }
413
- .chartXSelection(range: $selectedWeeks)
368
+ .chartXSelection(range: $brushedQuarters)
414
369
  ```
415
370
 
416
- ### Choosing Single vs Range
371
+ ### An angle
417
372
 
418
- - Use `value:` bindings when only one point or axis value should be selected.
419
- - Use `range:` bindings when users should brush a span (for zoom windows, comparisons, or grouped summaries).
420
-
421
- ### Angle Selection
422
-
423
- Use `chartAngleSelection(value:)` with `SectorMark` charts. No built-in range overload for angle selection.
373
+ Sector charts use `chartAngleSelection(value:)`. There is no range variant for angles; range selection exists only on the X and Y axes.
424
374
 
425
375
  ```swift
426
- @State private var selectedAmount: Double?
376
+ @State private var selectedSeats: Int?
427
377
 
428
- Chart(expenses) { expense in
429
- SectorMark(angle: .value("Amount", expense.amount))
430
- .foregroundStyle(by: .value("Category", expense.category))
378
+ Chart(cabinMix) { cabin in
379
+ SectorMark(angle: .value("Seats", cabin.seatCount))
380
+ .foregroundStyle(by: .value("Cabin", cabin.name))
431
381
  }
432
- .chartAngleSelection(value: $selectedAmount)
382
+ .chartAngleSelection(value: $selectedSeats)
433
383
  ```
434
384
 
435
- **Important**: Selection bindings return the plottable axis value, not the full data element. Map back to your model if you need the selected record.
436
-
437
385
  ## Annotations
438
386
 
439
- Use `annotation(position:)` on a mark when you need labels, callouts, or highlighted values attached to the plotted content.
387
+ Call `annotation(position:)` on a mark to pin a view to it. It suits direct labels, callouts on the selected point, notes on thresholds and summaries. Positions you will use most: `.top`, `.trailing`, `.bottom`, `.leading`, `.overlay`.
440
388
 
441
389
  ```swift
442
390
  BarMark(
443
- x: .value("Month", item.month),
444
- y: .value("Revenue", item.revenue)
391
+ x: .value("Airport", hub.code),
392
+ y: .value("Departures", hub.departures)
445
393
  )
446
394
  .annotation(position: .top) {
447
- Text(item.revenue.formatted())
395
+ Text(hub.departures, format: .number)
448
396
  }
449
397
  ```
450
398
 
451
- This is useful for selected values, thresholds, summaries, and direct labeling. Common positions include `.overlay`, `.top`, `.bottom`, `.leading`, and `.trailing`.
452
-
453
- ## ChartProxy and Custom Touch Handling
399
+ ## Custom Gestures with ChartProxy
454
400
 
455
- Use `chartOverlay`/`chartBackground` (iOS 16+) or `chartGesture` (iOS 17+) with `ChartProxy` when built-in selection modifiers are not enough.
401
+ Go lower than the selection modifiers by reading a `ChartProxy`. You receive one in `chartGesture` (iOS 17+) and in `chartBackground` or `chartOverlay` (iOS 16+). The plot area anchor is `proxy.plotFrame` on iOS 17+ and `proxy.plotAreaFrame` on iOS 16.
456
402
 
457
403
  ```swift
458
404
  .chartOverlay { proxy in
459
- GeometryReader { geometry in
460
- Rectangle().fill(.clear).contentShape(Rectangle())
461
- .gesture(
462
- DragGesture(minimumDistance: 0)
463
- .onChanged { value in
464
- guard let plotFrame = proxy.plotFrame else { return } // iOS 16: use proxy.plotAreaFrame
465
- let frame = geometry[plotFrame]
466
- let x = value.location.x - frame.origin.x
467
- guard x >= 0, x <= frame.size.width else { return }
468
- selectedDate = proxy.value(atX: x, as: Date.self)
469
- }
470
- .onEnded { _ in selectedDate = nil }
471
- )
405
+ GeometryReader { container in
406
+ let scrub = DragGesture(minimumDistance: 0)
407
+ .onChanged { drag in
408
+ // iOS 16: read proxy.plotAreaFrame instead
409
+ guard let anchor = proxy.plotFrame else { return }
410
+ let plotRect = container[anchor]
411
+ let localX = drag.location.x - plotRect.minX
412
+ guard (0...plotRect.width).contains(localX) else { return }
413
+ inspectedDate = proxy.value(atX: localX, as: Date.self)
414
+ }
415
+ .onEnded { _ in inspectedDate = nil }
416
+
417
+ Color.clear
418
+ .contentShape(Rectangle())
419
+ .gesture(scrub)
472
420
  }
473
421
  }
474
422
  ```
475
423
 
476
- Use `proxy.plotFrame` (iOS 17+) or `proxy.plotAreaFrame` (iOS 16) to get the plot area anchor.
424
+ What the proxy offers:
477
425
 
478
- `ChartProxy` gives you lower-level access to:
426
+ | Need | API |
427
+ |------|-----|
428
+ | screen point to data value | `value(at:as:)` for a point, or per axis `value(atX:as:)` / `value(atY:as:)` |
429
+ | data value to screen point, for custom indicators | `position(forX:)`, `position(forY:)`, `position(for:)` |
430
+ | drive built-in selection from your own gesture (iOS 17+) | single values with `selectXValue(at:)` / `selectYValue(at:)`, spans with `selectXRange(from:to:)` / `selectYRange(from:to:)` |
431
+ | plot geometry | `plotSize`, plus the anchor `plotFrame` on iOS 17+ (`plotAreaFrame` on iOS 16) |
479
432
 
480
- - `value(atX:as:)`, `value(atY:as:)`, and `value(at:as:)` for converting gesture coordinates into chart values
481
- - `position(forX:)`, `position(forY:)`, and `position(for:)` for placing custom overlays or indicators
482
- - `selectXValue(at:)`, `selectYValue(at:)`, `selectXRange(from:to:)`, and `selectYRange(from:to:)` for driving built-in selection from custom gestures
483
- - `plotFrame` (iOS 17+) or `plotAreaFrame` (iOS 16) with `plotSize` for converting between gesture coordinates and the plot area
433
+ The `select*` methods and `chartGesture` need iOS 17.
484
434
 
485
- `select*` ChartProxy selection methods and `chartGesture` are available on iOS 17+.
435
+ ## Where Modifiers Go
486
436
 
487
- ## Modifier Scope
488
-
489
- Apply chart-wide modifiers to the `Chart` container and mark-specific modifiers to the individual mark.
437
+ Chart-wide modifiers (axes, scales, selection, plot style, legend) belong on the `Chart`. Mark modifiers (interpolation, symbol, annotation) belong on the mark.
490
438
 
491
439
  ```swift
492
- Chart(data) { item in
440
+ Chart(altitudeSamples) { sample in
493
441
  LineMark(
494
- x: .value("Day", item.date),
495
- y: .value("Value", item.value)
442
+ x: .value("Time", sample.time),
443
+ y: .value("Altitude", sample.altitude)
496
444
  )
497
- .interpolationMethod(.monotone) // Mark-level modifier
445
+ .interpolationMethod(.monotone)
498
446
  }
499
- .chartXAxis { AxisMarks() } // Chart-level modifier
500
- .chartYScale(domain: 0...100) // Chart-level modifier
447
+ .chartXAxis { AxisMarks() }
448
+ .chartYScale(domain: 0...100)
501
449
  .chartPlotStyle { $0.background(.thinMaterial) }
502
450
  ```
503
451
 
504
- ## Styling and Visual Channels
452
+ ## Visual Channels
505
453
 
506
- ### Categorical Coloring
454
+ ### Colour by category
507
455
 
508
- Use `foregroundStyle(by: .value(...))` to color marks by a data property. Swift Charts generates a legend automatically.
456
+ `foregroundStyle(by: .value(...))` assigns colours from a data property and produces the legend for free. Hard-coding `.foregroundStyle(.red)` on each mark for categorical data removes the legend and hurts accessibility.
509
457
 
510
458
  ```swift
511
- Chart(sales) { item in
459
+ Chart(loadByAlliance) { entry in
512
460
  BarMark(
513
- x: .value("Month", item.month),
514
- y: .value("Revenue", item.revenue)
461
+ x: .value("Month", entry.month),
462
+ y: .value("Passengers", entry.passengers)
515
463
  )
516
- .foregroundStyle(by: .value("Region", item.region))
464
+ .foregroundStyle(by: .value("Alliance", entry.alliance))
517
465
  }
518
466
  ```
519
467
 
520
- **Avoid** applying `.foregroundStyle(.red)` per mark for categorical data - this suppresses the automatic legend and breaks accessibility.
521
-
522
- ### Custom Color Scales
468
+ ### Choosing the colours
523
469
 
524
- Use `chartForegroundStyleScale` to control the mapping from data values to colors.
470
+ Map values to colours with `chartForegroundStyleScale`. When series come and go across the data, use the overload that takes a domain and a mapping closure.
525
471
 
526
472
  ```swift
527
473
  .chartForegroundStyleScale([
528
- "North": .blue,
529
- "South": .orange,
530
- "East": .green
474
+ "Economy": .teal,
475
+ "Business": .indigo,
476
+ "First": .orange
531
477
  ])
532
- ```
533
-
534
- For dynamic data where not all series appear at every point, use the mapping overload:
535
478
 
536
- ```swift
537
- .chartForegroundStyleScale(domain: regions, mapping: { region in
538
- colorForRegion(region)
479
+ .chartForegroundStyleScale(domain: cabinNames, mapping: { cabin in
480
+ palette.color(for: cabin)
539
481
  })
540
482
  ```
541
483
 
542
- ### Symbol and Size Channels
484
+ ### Symbol and size
543
485
 
544
- Use `symbol(by:)` and `symbolSize(by:)` to encode additional data dimensions on `PointMark` and `LineMark`.
486
+ On a `PointMark` or a `LineMark`, `symbol(by:)` and `symbolSize(by:)` add further data dimensions as shape and size.
545
487
 
546
488
  ```swift
547
- Chart(measurements) { item in
489
+ Chart(routes) { route in
548
490
  PointMark(
549
- x: .value("Time", item.time),
550
- y: .value("Value", item.value)
491
+ x: .value("Distance", route.distance),
492
+ y: .value("Fare", route.fare)
551
493
  )
552
- .foregroundStyle(by: .value("Category", item.category))
553
- .symbol(by: .value("Category", item.category))
554
- .symbolSize(by: .value("Weight", item.weight))
494
+ .foregroundStyle(by: .value("Carrier", route.carrier))
495
+ .symbol(by: .value("Carrier", route.carrier))
496
+ .symbolSize(by: .value("Weekly frequency", route.frequency))
555
497
  }
556
498
  ```
557
499
 
558
- ### Legend Control
500
+ ### Legend
559
501
 
560
502
  ```swift
561
- .chartLegend(.visible)
503
+ .chartLegend(position: .top, alignment: .leading)
562
504
  .chartLegend(.hidden)
563
- .chartLegend(position: .bottom, alignment: .center)
505
+ .chartLegend(.visible)
564
506
  ```
565
507
 
566
- ## Composing Multiple Marks
508
+ ## Layering Marks
567
509
 
568
- Combine different mark types inside the same `Chart` closure:
510
+ Several mark types can share one `Chart` closure, for example points on top of a line, or a dashed target rule over bars.
569
511
 
570
512
  ```swift
571
- // Line with points
572
- LineMark(x: .value("Day", day.date), y: .value("Steps", day.count))
573
- .interpolationMethod(.monotone)
574
- PointMark(x: .value("Day", day.date), y: .value("Steps", day.count))
513
+ Chart(gateWaits) { wait in
514
+ LineMark(x: .value("Time of day", wait.time), y: .value("Queue minutes", wait.minutes))
515
+ .interpolationMethod(.monotone)
516
+ PointMark(x: .value("Time of day", wait.time), y: .value("Queue minutes", wait.minutes))
517
+ }
575
518
 
576
- // Bars with threshold line
577
- BarMark(x: .value("Month", item.month), y: .value("Revenue", item.revenue))
578
- RuleMark(y: .value("Target", 10_000))
579
- .foregroundStyle(.red)
580
- .lineStyle(StrokeStyle(dash: [5, 3]))
519
+ Chart(monthlyRevenue) { month in
520
+ BarMark(x: .value("Month", month.name), y: .value("Revenue", month.amount))
521
+ RuleMark(y: .value("Budget", 12_000))
522
+ .lineStyle(StrokeStyle(lineWidth: 1.5, dash: [6, 4]))
523
+ .foregroundStyle(.orange)
524
+ }
581
525
  ```
582
526
 
583
- ## Animating Chart Data
527
+ ## Animating Data Changes
584
528
 
585
- Chart marks animate automatically when data identity is stable and changes are wrapped in an animation.
529
+ Marks animate on their own when the change happens inside an animation and the elements keep stable identity, which is why `Identifiable` (or `id:`) is required for animated charts: it lets Swift Charts pair old and new points.
586
530
 
587
531
  ```swift
588
532
  withAnimation(.easeInOut) {
589
- chartData = updatedData
533
+ visibleSeries = filteredSeries
590
534
  }
591
535
  ```
592
536
 
593
- **Always** use `Identifiable` models (or explicit `id:`) so Swift Charts can match old and new data points and animate transitions between them.
594
-
595
- ## Best Practices
596
-
597
- ### Do
598
-
599
- - Use semantic `.value(_, _)` labels so axes and accessibility read clearly
600
- - Prefer `Identifiable` models (or explicit `id:`) for stable chart data identity
601
- - Use `foregroundStyle(by:)` for categorical series to get automatic legends and accessibility
602
- - Use `RuleMark` for goals, thresholds, and selected-value indicators
603
- - Use explicit `AxisMarks(values:)` when automatic tick generation gets crowded
604
- - Use `chartXScale` and `chartYScale` when you need stable visual comparisons
605
- - Use `chartXSelection(range:)` or `chartYSelection(range:)` for brushed selection
606
- - Gate iOS 17+ APIs such as `SectorMark` and selection with `#available`
607
-
608
- ### Don't
609
-
610
- - Put chart-wide modifiers such as `chartXAxis` or `chartXSelection` on individual marks
611
- - Apply manual `.foregroundStyle(.color)` per mark for categorical data - use `foregroundStyle(by:)` instead
612
- - Rely on unstable identities when chart data can be inserted, removed, or reordered
613
- - Use string values for naturally numeric or date-based axes unless you want categorical behavior
614
- - Stack unrelated series by default just because `BarMark` and `AreaMark` allow it
615
- - Force every tick label to display when collision handling or stride values would be clearer
616
- - Assume selection returns a model object; it only returns the plottable axis value
617
- - Forget that range selection is available only for X and Y axes, not angle selection
618
-
619
- For chart accessibility (VoiceOver, Audio Graph, `AXChartDescriptorRepresentable`), fallback strategies, WWDC sessions, and a full summary checklist, see `charts-accessibility.md`.
537
+ ## Guidelines
538
+
539
+ Do:
540
+ - write descriptive `.value` labels; axes and VoiceOver read them
541
+ - give chart data stable identity with `Identifiable` or `id:`
542
+ - colour categorical series with `foregroundStyle(by:)` to get a legend and accessible series
543
+ - draw targets, limits and the current selection with `RuleMark`
544
+ - pass explicit `AxisMarks(values:)` when automatic ticks crowd
545
+ - fix domains with `chartXScale` / `chartYScale` when charts must compare visually
546
+ - brush with `chartXSelection(range:)` or `chartYSelection(range:)`
547
+ - wrap `SectorMark`, selection and other iOS 17+ APIs in `#available`
548
+
549
+ Avoid:
550
+ - attaching `chartXAxis`, `chartXSelection` or other chart-wide modifiers to one mark
551
+ - per-mark hard-coded colours for categories
552
+ - identities that shift when points get added, deleted or moved
553
+ - strings for values that are really numbers or dates, unless categorical behaviour is wanted
554
+ - stacking unrelated series just because `BarMark` and `AreaMark` stack by default
555
+ - forcing every tick label to show when collision handling or a stride reads better
556
+ - treating a selection binding as a model object; it is only the plottable value
557
+ - looking for range selection on angles; it exists only for X and Y
558
+
559
+ VoiceOver, Audio Graph, `AXChartDescriptorRepresentable`, version fallbacks, session links and the full checklist: `charts-accessibility.md`.