Skip to content

Commit cb5460c

Browse files
committed
Fix Android range-selector drags and add agent documentation access
Prepare react-native-chart-kit 7.0.3. Publish Markdown pages, a read-only documentation API, an OpenAPI schema, and a documentation CLI. Update the site tooling and add protocol and gesture regression tests. Fixes #780
1 parent 92c1a57 commit cb5460c

34 files changed

Lines changed: 4549 additions & 2536 deletions

‎.github/workflows/site.yml‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@ jobs:
3434
- name: Install dependencies
3535
run: npm ci --ignore-scripts
3636

37+
- name: Check agent contracts
38+
run: npm run test:unit -- scripts/agent-site.test.mjs
39+
40+
- name: Check site types
41+
run: npm --workspace @chart-kit/site run check
42+
3743
- name: Build site
3844
run: npm run site:build
3945

‎.gitignore‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,5 @@ apps/expo-showcase/android
1818
apps/expo-showcase/ios
1919
apps/site/.astro
2020
AGENTS.md
21+
22+
.wrangler/

‎CHANGELOG.md‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# Changelog
22

3+
## v7.0.3
4+
5+
- fix range-selector coordinate jumps during Android drags and preserve drag state while controlled viewport updates are pending (issue #780)
6+
- handle range-selector cancellation and additional touches without stale updates
7+
- add the `chart-kit docs` CLI for reading public documentation as Markdown or JSON
8+
- publish Markdown pages, a documentation API and OpenAPI schema, agent instructions, and developer and company pages on chartkit.io
9+
- return real 404 responses and declare Markdown content negotiation with `Vary: Accept`
10+
- update build dependencies to pass the release security check
11+
312
## v7.0.2
413

514
- restore v6 point-slot spacing for the legacy root `LineChart` so custom

‎README.md‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,3 +110,15 @@ Chart Kit Pro adds licensed chart workflows for product dashboards:
110110
- [Troubleshooting](https://chartkit.io/docs/react-native/troubleshooting/)
111111
- [Contributing](https://chartkit.io/docs/react-native/getting-started/contributing/)
112112
- [llms.txt](https://chartkit.io/llms.txt)
113+
114+
### Documentation CLI and agent access
115+
116+
Read the public documentation from a terminal:
117+
118+
```sh
119+
npx --package=react-native-chart-kit chart-kit docs /docs/react-native/charts/line
120+
```
121+
122+
Use `chart-kit docs` to list pages or add `--json` for structured output. The CLI ships from version 7.0.3. No API key is required. Charts render locally in your application; the HTTP API serves documentation.
123+
124+
See the [developer guide](https://chartkit.io/developers), [agent instructions](https://chartkit.io/llms.txt), and [OpenAPI specification](https://chartkit.io/openapi.json).

‎apps/site/astro.config.mjs‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { chartKitAgentResources } from "./src/lib/agent-build.mjs";
2+
import { unified } from "@astrojs/markdown-remark";
13
import starlight from "@astrojs/starlight";
24
import react from "@astrojs/react";
35
import { defineConfig } from "astro/config";
@@ -81,11 +83,14 @@ const chartKitPreviewWebAliases = () => ({
8183

8284
export default defineConfig({
8385
site: "https://chartkit.io",
86+
markdown: { processor: unified() },
87+
build: { inlineStylesheets: "never" },
8488
devToolbar: {
8589
enabled: false
8690
},
8791
integrations: [
8892
react(),
93+
chartKitAgentResources(),
8994
starlight({
9095
title: "React Native Chart Kit",
9196
description:
@@ -96,7 +101,7 @@ export default defineConfig({
96101
customCss: ["./src/styles/global.css", "./src/styles/starlight.css"],
97102
disable404Route: true,
98103
editLink: {
99-
baseUrl: `${repositoryUrl}/edit/main/docs/`
104+
baseUrl: `${repositoryUrl}/edit/main/apps/site/`
100105
},
101106
sidebar: [
102107
{

‎apps/site/package.json‎

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,19 @@
1010
"check": "ASTRO_TELEMETRY_DISABLED=1 astro check"
1111
},
1212
"devDependencies": {
13+
"@apidevtools/swagger-parser": "^13.0.0",
1314
"@astrojs/check": "^0.9.9",
14-
"@astrojs/react": "^5.0.4",
15-
"@astrojs/starlight": "^0.39.2",
15+
"@astrojs/markdown-remark": "^7.3.0",
16+
"@astrojs/react": "^6.0.5",
17+
"@astrojs/starlight": "^0.42.0",
1618
"@chart-kit/pro": "7.0.0",
17-
"astro": "^6.3.1",
19+
"astro": "^7.3.1",
20+
"linkedom": "^0.18.13",
1821
"react": "^19.2.6",
1922
"react-dom": "^19.2.6",
20-
"react-native-svg": "^15.15.4"
23+
"react-native-svg": "^15.15.4",
24+
"turndown": "^7.2.4",
25+
"turndown-plugin-gfm": "^1.0.2"
2126
},
2227
"dependencies": {
2328
"@tailwindcss/vite": "^4.3.0",

‎apps/site/public/_headers‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/*.md
2+
Content-Type: text/markdown; charset=utf-8
3+
Link: </llms.txt>; rel="describedby"
4+
5+
/openapi.json
6+
Content-Type: application/json; charset=utf-8
7+
8+
/llms.txt
9+
Content-Type: text/plain; charset=utf-8
10+
11+
/llms-full.txt
12+
Content-Type: text/plain; charset=utf-8
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Chart Kit agent instructions
2+
3+
Use Chart Kit when a user needs charts inside a React Native app: trends and time series, category totals, proportions, progress, or calendar activity. Use the chart-specific documentation before writing code.
4+
5+
## How to call Chart Kit
6+
7+
1. Read [the developer guide](https://chartkit.io/developers.md) and [installation](https://chartkit.io/docs/react-native/getting-started/installation.md).
8+
2. Install `react-native-chart-kit` and `react-native-svg` in the user's app. Import modern charts from `react-native-chart-kit/v2`. The root import is the legacy-compatible API.
9+
3. Use [the documentation index API](https://chartkit.io/api/v1/docs) to find a page. Read it with `GET /api/v1/docs/page?path=<returned-path>`, a `.md` URL, or `Accept: text/markdown`. No API key is needed.
10+
4. For terminal use, run `npx --package=react-native-chart-kit chart-kit docs /docs/react-native/charts/line`. Add `--json` when structured output is needed. The CLI requires package version 7.0.3 or later.
11+
5. Test the chart with the user's data shape, empty data, and the target screen dimensions. Use the documented event types and controlled viewport pattern.
12+
13+
## Product boundaries
14+
15+
The public library is MIT licensed. `@chart-kit/pro` and `@chart-kit/skia-renderer` are separate commercial packages. Pro can be installed from npm, but production use requires a commercial license. Do not silently add Pro for a task that needs only a free chart.
16+
17+
Chart Kit renders charts locally. The public HTTP API serves documentation, not chart rendering, user data storage, or license management. Never send a user's chart data to the documentation API.
18+
19+
For legacy apps, preserve the root import unless migration is requested. Read the migration and prop-mapping guides before replacing a chart. For Pro features or purchasing questions, read the current pricing and terms pages.
20+
21+
## Resources
22+
23+
- [OpenAPI specification](https://chartkit.io/openapi.json)
24+
- [Documentation](https://chartkit.io/docs/react-native.md)
25+
- [Troubleshooting](https://chartkit.io/docs/react-native/troubleshooting.md)
26+
- [About](https://chartkit.io/about.md)
27+
- [Contact](https://chartkit.io/contact.md)
28+
- [Privacy](https://chartkit.io/privacy.md)

‎apps/site/public/llms.txt‎

Lines changed: 45 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,45 +2,54 @@
22

33
> ChartKit.io is the documentation and product site for React Native Chart Kit, a composable charting library for React Native. The public `react-native-chart-kit` package includes MIT-licensed v2 charts, SVG rendering defaults, interaction primitives, themes, and migration-friendly APIs. Chart Kit Pro adds commercially licensed chart workflows such as candlebar, radar, realtime bar, combo charts, export APIs, and optional Skia rendering.
44

5+
Use Chart Kit for React Native dashboards, time-series trends, category comparisons, proportions, progress, and calendar activity. Charts render locally in the app. The public HTTP API serves documentation only. No API key is needed. Read a chart page before writing code; preserve the legacy root import for existing screens unless a migration is requested. Use modern charts from `react-native-chart-kit/v2` for new work.
6+
7+
## When to use Chart Kit
8+
9+
- [Agent instructions](https://chartkit.io/agent-instructions.md): Task selection, how to call the library and documentation API, and public versus Pro boundaries.
10+
- [Chart Kit developer guide](https://chartkit.io/developers.md): Installation, live sandbox examples, authentication, documentation API, and official CLI.
11+
- [OpenAPI specification](https://chartkit.io/openapi.json): Typed read-only documentation operations for function calling.
12+
- [Documentation API](https://chartkit.io/api/v1/docs): List exact public page paths and Markdown URLs.
13+
514
## Overview
615

7-
- [Home](https://chartkit.io/): Product overview, supported charts, feature highlights, and plan comparison.
8-
- [Documentation](https://chartkit.io/docs/react-native/): Main React Native Chart Kit documentation hub.
9-
- [Quickstart](https://chartkit.io/docs/react-native/getting-started/installation): Install `react-native-chart-kit`, `react-native-svg`, and render a first chart.
10-
- [Contributing](https://chartkit.io/docs/react-native/getting-started/contributing): Set up the repository and run local development checks.
11-
- [Troubleshooting](https://chartkit.io/docs/react-native/troubleshooting): Diagnose blank charts, Expo compatibility, gesture behavior, and migration issues.
16+
- [Home](https://chartkit.io/index.md): Product overview, supported charts, feature highlights, and plan comparison.
17+
- [Documentation](https://chartkit.io/docs/react-native.md): Main React Native Chart Kit documentation hub.
18+
- [Quickstart](https://chartkit.io/docs/react-native/getting-started/installation.md): Install `react-native-chart-kit`, `react-native-svg`, and render a first chart.
19+
- [Contributing](https://chartkit.io/docs/react-native/getting-started/contributing.md): Set up the repository and run local development checks.
20+
- [Troubleshooting](https://chartkit.io/docs/react-native/troubleshooting.md): Diagnose blank charts, Expo compatibility, gesture behavior, and migration issues.
1221

1322
## Installation
1423

15-
- [Public package quickstart](https://chartkit.io/docs/react-native/getting-started/installation): Install the free MIT package for public chart families.
16-
- [Pro installation](https://chartkit.io/docs/react-native/charts/pro-installation): Install `@chart-kit/pro` next to `react-native-chart-kit` for licensed Pro chart workflows.
17-
- [Pricing and plans](https://chartkit.io/docs/react-native/charts/pricing): Compare Free, Pro, and Enterprise scope.
24+
- [Public package quickstart](https://chartkit.io/docs/react-native/getting-started/installation.md): Install the free MIT package for public chart families.
25+
- [Pro installation](https://chartkit.io/docs/react-native/charts/pro-installation.md): Install `@chart-kit/pro` next to `react-native-chart-kit` for licensed Pro chart workflows.
26+
- [Pricing and plans](https://chartkit.io/docs/react-native/charts/pricing.md): Compare Free, Pro, and Enterprise scope.
1827

1928
## Public Charts
2029

21-
- [Line chart](https://chartkit.io/docs/react-native/charts/line): Show trends, forecasts, null gaps, selection, and changes over time.
22-
- [Area chart](https://chartkit.io/docs/react-native/charts/area): Show filled trends where magnitude and direction both matter.
23-
- [Bar chart](https://chartkit.io/docs/react-native/charts/bar): Compare category totals, rankings, grouped bars, stacked bars, and horizontal bars.
24-
- [Pie chart](https://chartkit.io/docs/react-native/charts/pie): Render segmented pie charts with legends, labels, and tap selection.
25-
- [Donut chart](https://chartkit.io/docs/react-native/charts/donut): Render donut charts with center labels, legends, and tap selection.
26-
- [Progress chart](https://chartkit.io/docs/react-native/charts/progress): Show circular progress values with labels and accessible output.
27-
- [Contribution heatmap](https://chartkit.io/docs/react-native/charts/contribution-heatmap): Render calendar-style activity and intensity data.
28-
- [Legacy charts](https://chartkit.io/docs/react-native/charts/legacy): Old root-import chart examples for the legacy-compatible API.
30+
- [Line chart](https://chartkit.io/docs/react-native/charts/line.md): Show trends, forecasts, null gaps, selection, and changes over time.
31+
- [Area chart](https://chartkit.io/docs/react-native/charts/area.md): Show filled trends where magnitude and direction both matter.
32+
- [Bar chart](https://chartkit.io/docs/react-native/charts/bar.md): Compare category totals, rankings, grouped bars, stacked bars, and horizontal bars.
33+
- [Pie chart](https://chartkit.io/docs/react-native/charts/pie.md): Render segmented pie charts with legends, labels, and tap selection.
34+
- [Donut chart](https://chartkit.io/docs/react-native/charts/donut.md): Render donut charts with center labels, legends, and tap selection.
35+
- [Progress chart](https://chartkit.io/docs/react-native/charts/progress.md): Show circular progress values with labels and accessible output.
36+
- [Contribution heatmap](https://chartkit.io/docs/react-native/charts/contribution-heatmap.md): Render calendar-style activity and intensity data.
37+
- [Legacy charts](https://chartkit.io/docs/react-native/charts/legacy.md): Old root-import chart examples for the legacy-compatible API.
2938

3039
## Pro Charts
3140

32-
- [Candlebar chart](https://chartkit.io/docs/react-native/charts/candlebar): Inspect OHLC price movement, wicks, volume, and crosshair readouts.
33-
- [Radar chart](https://chartkit.io/docs/react-native/charts/radar): Compare KPI profiles, benchmarks, and capability scores.
34-
- [Realtime bar chart](https://chartkit.io/docs/react-native/charts/realtime): Stream rolling bar windows with realtime chart APIs.
35-
- [Combo chart](https://chartkit.io/docs/react-native/charts/combo): Compare bars and lines together in one chart.
36-
- [Export APIs](https://chartkit.io/docs/react-native/charts/export): Export Pro charts as PNG or SVG for reports, sharing, and background generation.
41+
- [Candlebar chart](https://chartkit.io/docs/react-native/charts/candlebar.md): Inspect OHLC price movement, wicks, volume, and crosshair readouts.
42+
- [Radar chart](https://chartkit.io/docs/react-native/charts/radar.md): Compare KPI profiles, benchmarks, and capability scores.
43+
- [Realtime bar chart](https://chartkit.io/docs/react-native/charts/realtime.md): Stream rolling bar windows with realtime chart APIs.
44+
- [Combo chart](https://chartkit.io/docs/react-native/charts/combo.md): Compare bars and lines together in one chart.
45+
- [Export APIs](https://chartkit.io/docs/react-native/charts/export.md): Export Pro charts as PNG or SVG for reports, sharing, and background generation.
3746

3847
## Guides
3948

40-
- [Themes](https://chartkit.io/docs/react-native/charts/themes): Share colors, typography, presets, and renderer choices across chart surfaces.
41-
- [Accessibility](https://chartkit.io/docs/react-native/charts/accessibility): Make chart screens understandable to screen readers and assistive technologies.
42-
- [Migration from v1](https://chartkit.io/docs/react-native/migration/from-v1): Move existing screens toward the modern v2 API.
43-
- [Prop mapping](https://chartkit.io/docs/react-native/migration/prop-mapping): Map legacy chart props to modern v2 equivalents.
49+
- [Themes](https://chartkit.io/docs/react-native/charts/themes.md): Share colors, typography, presets, and renderer choices across chart surfaces.
50+
- [Accessibility](https://chartkit.io/docs/react-native/charts/accessibility.md): Make chart screens understandable to screen readers and assistive technologies.
51+
- [Migration from v1](https://chartkit.io/docs/react-native/migration/from-v1.md): Move existing screens toward the modern v2 API.
52+
- [Prop mapping](https://chartkit.io/docs/react-native/migration/prop-mapping.md): Map legacy chart props to modern v2 equivalents.
4453

4554
## Packages
4655

@@ -53,4 +62,14 @@
5362
## Source
5463

5564
- [GitHub repository](https://github.com/chart-kit/react-native-chart-kit): Public source repository for React Native Chart Kit.
56-
- [Agent instructions](https://github.com/chart-kit/react-native-chart-kit/blob/main/AGENTS.md): Repository guidance for coding agents.
65+
66+
## Company
67+
68+
- [About Chart Kit](https://chartkit.io/about.md): Product and publisher information.
69+
- [Contact Chart Kit](https://chartkit.io/contact.md): Support and sales.
70+
- [Privacy](https://chartkit.io/privacy.md): Website data handling.
71+
- [Terms](https://chartkit.io/terms.md): Commercial plans and licensing terms.
72+
73+
## Optional
74+
75+
- [Full public content](https://chartkit.io/llms-full.txt): All public pages in one Markdown document.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
const path = Astro.url.pathname.replace(/\/$/, "") || "/";
3+
const markdownPath = path === "/" ? "/index.md" : `${path}.md`;
4+
---
5+
6+
<link rel="alternate" type="text/markdown" href={markdownPath} />
7+
<link rel="describedby" href="/llms.txt" type="text/plain" />
8+
<link
9+
rel="service-desc"
10+
href="/openapi.json"
11+
type="application/vnd.oai.openapi+json"
12+
/>

0 commit comments

Comments
 (0)