@keneth80/k-chart 1.18.1 → 1.20.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 (59) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/README.md +30 -3
  3. package/ai/catalog.json +2291 -0
  4. package/ai/chart-plan.schema.json +372 -0
  5. package/ai/examples/intent-to-config.jsonl +32 -0
  6. package/ai/prompts/dashboard-system.md +42 -0
  7. package/docs/ai/agent-usage.md +79 -0
  8. package/docs/ai/chart-selection.md +65 -0
  9. package/docs/ai/index.md +195 -0
  10. package/docs/configuration-reference.md +34 -4
  11. package/docs/functional-api.md +27 -2
  12. package/examples/stackblitz-realtime-line-basic/src/main.ts +6 -0
  13. package/lib/ai/catalog.d.ts +4 -0
  14. package/lib/ai/catalog.d.ts.map +1 -0
  15. package/lib/ai/catalog.js +676 -0
  16. package/lib/ai/catalog.js.map +1 -0
  17. package/lib/ai/compiler.d.ts +63 -0
  18. package/lib/ai/compiler.d.ts.map +1 -0
  19. package/lib/ai/compiler.js +950 -0
  20. package/lib/ai/compiler.js.map +1 -0
  21. package/lib/ai/contracts.d.ts +117 -0
  22. package/lib/ai/contracts.d.ts.map +1 -0
  23. package/lib/ai/contracts.js +3 -0
  24. package/lib/ai/contracts.js.map +1 -0
  25. package/lib/ai/index.d.ts +6 -0
  26. package/lib/ai/index.d.ts.map +1 -0
  27. package/lib/ai/index.js +22 -0
  28. package/lib/ai/index.js.map +1 -0
  29. package/lib/ai/schema.d.ts +272 -0
  30. package/lib/ai/schema.d.ts.map +1 -0
  31. package/lib/ai/schema.js +199 -0
  32. package/lib/ai/schema.js.map +1 -0
  33. package/lib/ai/validate-plan.d.ts +5 -0
  34. package/lib/ai/validate-plan.d.ts.map +1 -0
  35. package/lib/ai/validate-plan.js +877 -0
  36. package/lib/ai/validate-plan.js.map +1 -0
  37. package/lib/core/animation.d.ts +8 -0
  38. package/lib/core/animation.d.ts.map +1 -0
  39. package/lib/core/animation.js +66 -0
  40. package/lib/core/animation.js.map +1 -0
  41. package/lib/core/contracts.d.ts +2 -0
  42. package/lib/core/contracts.d.ts.map +1 -1
  43. package/lib/core/create-kchart.d.ts.map +1 -1
  44. package/lib/core/create-kchart.js +82 -10
  45. package/lib/core/create-kchart.js.map +1 -1
  46. package/lib/series/canvas-line.d.ts.map +1 -1
  47. package/lib/series/canvas-line.js +68 -64
  48. package/lib/series/canvas-line.js.map +1 -1
  49. package/lib/series/svg-line.d.ts.map +1 -1
  50. package/lib/series/svg-line.js +1 -0
  51. package/lib/series/svg-line.js.map +1 -1
  52. package/lib/series/webgl-line.d.ts.map +1 -1
  53. package/lib/series/webgl-line.js +75 -71
  54. package/lib/series/webgl-line.js.map +1 -1
  55. package/lib/worker/render-worker.d.ts.map +1 -1
  56. package/lib/worker/render-worker.js +18 -6
  57. package/lib/worker/render-worker.js.map +1 -1
  58. package/llms.txt +37 -0
  59. package/package.json +19 -4
package/CHANGELOG.md CHANGED
@@ -1,5 +1,38 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.20.0 - 2026-07-25
4
+
5
+ ### Added
6
+
7
+ - Added the provider-neutral `@keneth80/k-chart/ai` entry point with typed `ChartPlan` contracts, a generated JSON Schema, and the machine-readable KChart capability catalog.
8
+ - Added `validateKChartAIPlan()` / `assertKChartAIPlan()` for strict capability, renderer, field-binding, option-compatibility, and JSON-safe settings validation.
9
+ - Added `compileKChartAIPlan()` / `renderKChartAIPlan()` to convert validated plans into real KChart configurations without executing model-generated source.
10
+ - Added trusted runtime settings and registered custom series compilers so applications can inject callbacks, GeoJSON, providers, credentials, and custom recipes outside the model trust boundary.
11
+ - Added `llms.txt`, natural-language intent fixtures, agent guides, Cursor/Codex/Claude Code instructions, and reusable dashboard generation prompts.
12
+
13
+ ### Changed
14
+
15
+ - Updated CI and package checks to validate generated AI metadata, 32 natural-language intent fixtures, compiler behavior, adapter credential stripping, and packaged AI exports.
16
+ - Migrated the Next.js Playground AI flow to validated `ChartPlan` JSON with separate server/client feature flags; QA and Live remain disabled by default.
17
+
18
+ ### Package
19
+
20
+ - Versioned the provider-neutral AI planning and compilation layer as `@keneth80/k-chart@1.20.0`.
21
+
22
+ ## 1.19.0 - 2026-07-17
23
+
24
+ ### Changed
25
+
26
+ - Implemented `animation.mode: 'update'` for smooth `number`/`time` axis-domain transitions during `updateData()`.
27
+ - Updated the realtime time-series demo and StackBlitz starter to scroll continuously between 250ms samples while retaining the fixed 240-point memory bound.
28
+ - Limited update-frame animation to explicitly supported synchronous series; worker-backed lines retain one render per data update to avoid message backpressure.
29
+ - Avoided resetting unchanged main-thread and OffscreenCanvas backing-store dimensions on repeated renders.
30
+ - Ensured superseded render-completion promises resolve when a newer animated update replaces an in-flight frame.
31
+
32
+ ### Packages
33
+
34
+ - Published `@keneth80/k-chart@1.19.0`.
35
+
3
36
  ## 1.18.1 - 2026-07-14
4
37
 
5
38
  ### Changed
package/README.md CHANGED
@@ -18,6 +18,7 @@
18
18
  <a href="https://www.npmjs.com/package/@keneth80/k-chart"><img alt="npm" src="https://img.shields.io/npm/v/%40keneth80%2Fk-chart?style=for-the-badge&label=npm&color=0ea5e9"></a>
19
19
  <a href="https://github.com/keneth80/k-chart/blob/main/LICENSE"><img alt="License" src="https://img.shields.io/github/license/keneth80/k-chart?style=for-the-badge&color=22c55e"></a>
20
20
  <a href="https://k-chart-playground.vercel.app/"><img alt="Playground" src="https://img.shields.io/badge/Live_Playground-open-8b5cf6?style=for-the-badge"></a>
21
+ <a href="https://k-chart-bench.vercel.app/"><img alt="Benchmark" src="https://img.shields.io/badge/Live_Benchmark-view-f59e0b?style=for-the-badge"></a>
21
22
  </p>
22
23
 
23
24
  <p align="center">
@@ -36,10 +37,16 @@
36
37
  <p align="center">
37
38
  <a href="https://k-chart-playground.vercel.app/"><strong>Open Playground</strong></a>
38
39
  ·
40
+ <a href="https://k-chart-bench.vercel.app/"><strong>View Benchmark</strong></a>
41
+ ·
39
42
  <a href="#quick-start"><strong>Quick Start</strong></a>
40
43
  ·
41
44
  <a href="docs/functional-api.md"><strong>API Guide</strong></a>
42
45
  ·
46
+ <a href="docs/ai/index.md"><strong>AI & Agent Guide</strong></a>
47
+ ·
48
+ <a href="llms.txt"><strong>llms.txt</strong></a>
49
+ ·
43
50
  <a href="packages/k-chart-three/README.md"><strong>Three.js Adapter</strong></a>
44
51
  </p>
45
52
 
@@ -93,6 +100,20 @@
93
100
  <a href="https://stackblitz.com/fork/github/keneth80/k-chart/tree/main/examples/stackblitz-three-wafer-basic?title=KChart%20Three.js%20Wafer&file=src/main.ts"><strong>Three.js Wafer</strong></a>
94
101
  </p>
95
102
 
103
+ ## Hybrid Rendering In 60 Seconds
104
+
105
+ <p align="center">
106
+ <a href="https://raw.githubusercontent.com/keneth80/k-chart/main/docs/promotion/kchart-hybrid-rendering-60s-ko.mp4">
107
+ <img src="docs/promotion/kchart-hybrid-rendering-preview.gif" alt="Watch the KChart hybrid rendering video" width="100%" />
108
+ </a>
109
+ </p>
110
+
111
+ <p align="center">
112
+ <a href="https://raw.githubusercontent.com/keneth80/k-chart/main/docs/promotion/kchart-hybrid-rendering-60s-ko.mp4"><strong>Watch the 60-second video</strong></a>
113
+ ·
114
+ <a href="docs/promotion/hybrid-rendering-ko.md"><strong>Read the Korean technical article</strong></a>
115
+ </p>
116
+
96
117
  ## Overview
97
118
 
98
119
  KChart는 TypeScript 기반 D3 하이브리드 차트 엔진입니다.
@@ -145,7 +166,7 @@ KChart의 성능 방향은 “모든 기능을 하나의 거대한 chart object
145
166
  - 수천에서 수만 개의 point를 빠르게 그려야 하면 Canvas series를 사용합니다.
146
167
  - 더 큰 line/point 데이터나 잦은 viewport 변경이 있으면 WebGL series와 LTTB downsampling을 조합합니다.
147
168
  - 3D, 지도, 지구본은 optional adapter package로 분리해 필요한 화면에서만 로드합니다.
148
- - 수치 비교가 필요한 경우 playground example 기준으로 같은 dataset, 같은 viewport, 같은 browser에서 FPS, first render time, memory를 측정하는 benchmark를 추가할 수 있습니다.
169
+ - 렌더링 성능 비교와 재현 조건은 [KChart Benchmark](https://k-chart-bench.vercel.app/)에서 확인할 수 있습니다. 결과를 해석할 때는 dataset, viewport, browser, 측정 종점과 각 라이브러리 설정을 함께 확인해야 합니다.
149
170
 
150
171
  ## Core Concept
151
172
 
@@ -252,6 +273,12 @@ npm install @keneth80/k-chart
252
273
 
253
274
  The playground demonstrates the React wrapper, chart examples, configuration editor, and AI Builder flow.
254
275
 
276
+ ## Benchmark
277
+
278
+ - Live benchmark: [https://k-chart-bench.vercel.app/](https://k-chart-bench.vercel.app/)
279
+
280
+ The benchmark publishes reproducible rendering measurements alongside the dataset size, browser environment, library versions, and measurement methodology. Use the methodology shown with each result when comparing KChart with other chart libraries.
281
+
255
282
  ## Local Development
256
283
 
257
284
  ```bash
@@ -929,7 +956,7 @@ series: [
929
956
 
930
957
  ## Animation
931
958
 
932
- `animation` 옵션을 켜면 supported series가 enter animation으로 렌더링됩니다. 현재 기본 지원 renderer는 SVG line, Canvas line, WebGL line입니다. Demo의 SVG column, stacked column, plot point, radial, pie, doughnut 같은 custom series도 `context.animation.progress`를 사용해 scale, opacity, arc sweep 효과를 적용합니다.
959
+ `animation` 옵션은 최초 series 등장과 `updateData()` 전환을 제어합니다. `mode: 'enter'`에서는 supported series가 enter animation으로 렌더링되고, `mode: 'update'`에서는 `number`/`time` 축 domain을 이전 화면에서 새 화면까지 보간합니다. 따라서 실시간 시계열은 수신 간격마다 튀지 않고 연속해서 흐릅니다. Demo의 SVG column, stacked column, plot point, radial, pie, doughnut 같은 custom series도 `context.animation.progress`를 사용해 scale, opacity, arc sweep 효과를 적용합니다.
933
960
 
934
961
  ```ts
935
962
  createKChart({
@@ -950,7 +977,7 @@ createKChart({
950
977
  }).render();
951
978
  ```
952
979
 
953
- 대용량 WebGL 차트에서는 animation이 매 프레임 재렌더링을 발생시키므로 필요한 예제나 화면에서만 opt-in으로 켜는 것을 권장합니다.
980
+ 실시간 차트는 `duration`을 데이터 수신 간격과 같게 두고 `easing: 'linear'`, `mode: 'update'`를 사용합니다. 새 데이터가 전환 도중 도착하면 현재 화면 위치에서 다음 domain으로 이어집니다. Worker-backed Canvas/WebGL line은 메시지 큐 증가를 막기 위해 update transition을 자동으로 생략하고 수신 주기당 한 번만 렌더합니다. 대용량 차트에서는 필요한 화면에서만 animation을 켜고 downsampling을 함께 사용하는 것을 권장합니다.
954
981
 
955
982
  ## Spec Areas, Fixed Guide Lines, And Cursor Guide
956
983