@keneth80/k-chart 1.8.2 → 1.10.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 (115) hide show
  1. package/CHANGELOG.md +41 -0
  2. package/README.md +242 -4
  3. package/docs/assets/kchart-hero.svg +110 -0
  4. package/docs/assets/kchart-icon.svg +40 -0
  5. package/docs/configuration-reference.md +395 -0
  6. package/docs/functional-api.md +103 -3
  7. package/examples/stackblitz-candlestick-basic/index.html +23 -0
  8. package/examples/stackblitz-candlestick-basic/package-lock.json +1435 -0
  9. package/examples/stackblitz-candlestick-basic/package.json +18 -0
  10. package/examples/stackblitz-candlestick-basic/src/main.ts +107 -0
  11. package/examples/stackblitz-candlestick-basic/src/style.css +16 -0
  12. package/examples/stackblitz-canvas-line-basic/index.html +23 -0
  13. package/examples/stackblitz-canvas-line-basic/package-lock.json +1435 -0
  14. package/examples/stackblitz-canvas-line-basic/package.json +18 -0
  15. package/examples/stackblitz-canvas-line-basic/src/main.ts +73 -0
  16. package/examples/stackblitz-canvas-line-basic/src/style.css +46 -0
  17. package/examples/stackblitz-column-basic/index.html +23 -0
  18. package/examples/stackblitz-column-basic/package-lock.json +1435 -0
  19. package/examples/stackblitz-column-basic/package.json +18 -0
  20. package/examples/stackblitz-column-basic/src/main.ts +128 -0
  21. package/examples/stackblitz-column-basic/src/style.css +41 -0
  22. package/examples/stackblitz-doughnut-basic/index.html +21 -0
  23. package/examples/stackblitz-doughnut-basic/package-lock.json +1435 -0
  24. package/examples/stackblitz-doughnut-basic/package.json +18 -0
  25. package/examples/stackblitz-doughnut-basic/src/main.ts +177 -0
  26. package/examples/stackblitz-doughnut-basic/src/style.css +43 -0
  27. package/examples/stackblitz-line-basic/index.html +23 -0
  28. package/examples/stackblitz-line-basic/package-lock.json +1435 -0
  29. package/examples/stackblitz-line-basic/package.json +18 -0
  30. package/examples/stackblitz-line-basic/src/main.ts +112 -0
  31. package/examples/stackblitz-line-basic/src/style.css +108 -0
  32. package/examples/stackblitz-multi-series-basic/index.html +1 -0
  33. package/examples/stackblitz-multi-series-basic/package-lock.json +1435 -0
  34. package/examples/stackblitz-multi-series-basic/package.json +9 -0
  35. package/examples/stackblitz-multi-series-basic/src/main.ts +29 -0
  36. package/examples/stackblitz-multi-series-basic/src/style.css +1 -0
  37. package/examples/stackblitz-options-basic/index.html +1 -0
  38. package/examples/stackblitz-options-basic/package-lock.json +1435 -0
  39. package/examples/stackblitz-options-basic/package.json +9 -0
  40. package/examples/stackblitz-options-basic/src/main.ts +32 -0
  41. package/examples/stackblitz-options-basic/src/style.css +1 -0
  42. package/examples/stackblitz-pie-basic/index.html +21 -0
  43. package/examples/stackblitz-pie-basic/package-lock.json +1435 -0
  44. package/examples/stackblitz-pie-basic/package.json +18 -0
  45. package/examples/stackblitz-pie-basic/src/main.ts +156 -0
  46. package/examples/stackblitz-pie-basic/src/style.css +43 -0
  47. package/examples/stackblitz-plot-basic/index.html +1 -0
  48. package/examples/stackblitz-plot-basic/package-lock.json +1435 -0
  49. package/examples/stackblitz-plot-basic/package.json +9 -0
  50. package/examples/stackblitz-plot-basic/src/main.ts +32 -0
  51. package/examples/stackblitz-plot-basic/src/style.css +1 -0
  52. package/examples/stackblitz-radial-basic/index.html +21 -0
  53. package/examples/stackblitz-radial-basic/package-lock.json +1435 -0
  54. package/examples/stackblitz-radial-basic/package.json +18 -0
  55. package/examples/stackblitz-radial-basic/src/main.ts +223 -0
  56. package/examples/stackblitz-radial-basic/src/style.css +87 -0
  57. package/examples/stackblitz-simple-api-basic/index.html +30 -0
  58. package/examples/stackblitz-simple-api-basic/package-lock.json +1435 -0
  59. package/examples/stackblitz-simple-api-basic/package.json +18 -0
  60. package/examples/stackblitz-simple-api-basic/src/main.ts +69 -0
  61. package/examples/stackblitz-simple-api-basic/src/style.css +127 -0
  62. package/examples/stackblitz-stacked-column-basic/index.html +23 -0
  63. package/examples/stackblitz-stacked-column-basic/package-lock.json +1435 -0
  64. package/examples/stackblitz-stacked-column-basic/package.json +18 -0
  65. package/examples/stackblitz-stacked-column-basic/src/main.ts +136 -0
  66. package/examples/stackblitz-stacked-column-basic/src/style.css +16 -0
  67. package/examples/stackblitz-three-wafer-basic/index.html +1 -0
  68. package/examples/stackblitz-three-wafer-basic/package-lock.json +1453 -0
  69. package/examples/stackblitz-three-wafer-basic/package.json +9 -0
  70. package/examples/stackblitz-three-wafer-basic/src/main.ts +29 -0
  71. package/examples/stackblitz-three-wafer-basic/src/style.css +1 -0
  72. package/examples/stackblitz-topology-basic/index.html +1 -0
  73. package/examples/stackblitz-topology-basic/package-lock.json +1435 -0
  74. package/examples/stackblitz-topology-basic/package.json +9 -0
  75. package/examples/stackblitz-topology-basic/src/main.ts +89 -0
  76. package/examples/stackblitz-topology-basic/src/style.css +1 -0
  77. package/examples/stackblitz-webgl-line-basic/index.html +23 -0
  78. package/examples/stackblitz-webgl-line-basic/package-lock.json +1435 -0
  79. package/examples/stackblitz-webgl-line-basic/package.json +18 -0
  80. package/examples/stackblitz-webgl-line-basic/src/main.ts +86 -0
  81. package/examples/stackblitz-webgl-line-basic/src/style.css +46 -0
  82. package/examples/stackblitz-worker-json-line/index.html +41 -0
  83. package/examples/stackblitz-worker-json-line/package-lock.json +1435 -0
  84. package/examples/stackblitz-worker-json-line/package.json +19 -0
  85. package/examples/stackblitz-worker-json-line/public/data/large-line.json +4322 -0
  86. package/examples/stackblitz-worker-json-line/src/kchart-render.worker.ts +4 -0
  87. package/examples/stackblitz-worker-json-line/src/main.ts +185 -0
  88. package/examples/stackblitz-worker-json-line/src/style.css +101 -0
  89. package/lib/core/contracts.d.ts +22 -0
  90. package/lib/core/contracts.d.ts.map +1 -1
  91. package/lib/core/create-kchart.d.ts.map +1 -1
  92. package/lib/core/create-kchart.js +93 -4
  93. package/lib/core/create-kchart.js.map +1 -1
  94. package/lib/index.d.ts +1 -0
  95. package/lib/index.d.ts.map +1 -1
  96. package/lib/index.js +1 -0
  97. package/lib/index.js.map +1 -1
  98. package/lib/kchart.d.ts +1 -0
  99. package/lib/kchart.d.ts.map +1 -1
  100. package/lib/kchart.js +1 -0
  101. package/lib/kchart.js.map +1 -1
  102. package/lib/presets/index.d.ts +97 -0
  103. package/lib/presets/index.d.ts.map +1 -0
  104. package/lib/presets/index.js +481 -0
  105. package/lib/presets/index.js.map +1 -0
  106. package/lib/series/canvas-line.d.ts.map +1 -1
  107. package/lib/series/canvas-line.js +16 -11
  108. package/lib/series/canvas-line.js.map +1 -1
  109. package/lib/series/svg-line.d.ts.map +1 -1
  110. package/lib/series/svg-line.js +19 -3
  111. package/lib/series/svg-line.js.map +1 -1
  112. package/lib/series/webgl-line.d.ts.map +1 -1
  113. package/lib/series/webgl-line.js +10 -3
  114. package/lib/series/webgl-line.js.map +1 -1
  115. package/package.json +13 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,46 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.10.0 - 2026-07-02
4
+
5
+ ### Added
6
+
7
+ - Added a beginner-friendly preset API with `createLineChart()`, `createColumnChart()`, `createPieChart()`, and `createDoughnutChart()`.
8
+ - Added the chainable `chartConfig(data)` builder for composing common charts before dropping down to the full functional API.
9
+ - Added a `@keneth80/k-chart/presets` export path for lightweight beginner imports.
10
+ - Added a Simple API StackBlitz example for quick browser-based experimentation.
11
+ - Added chart animation configuration for series enter/update rendering, including SVG line, Canvas line, WebGL line, column, stacked column, plot, pie, doughnut, and radial examples.
12
+
13
+ ### Changed
14
+
15
+ - Updated README and functional API docs with beginner quick starts, builder examples, and animation usage.
16
+
17
+ ### Fixed
18
+
19
+ - Added segment-level hover and tooltip behavior for preset pie and doughnut charts.
20
+
21
+ ### Packages
22
+
23
+ - Published `@keneth80/k-chart@1.10.0`.
24
+
25
+ ## 1.9.0 - 2026-06-28
26
+
27
+ ### Added
28
+
29
+ - Added the optional `@keneth80/k-chart-three` package for integrating Three.js scenes as KChart custom series.
30
+ - Added `createKThreeScene()` for reusable Three.js renderer, camera, lights, resize, pointer, and OrbitControls lifecycle management.
31
+ - Added `createThreeWaferSeries()` and `createWaferMonitorObject()` for semiconductor wafer monitoring with instanced die rendering, status colors, hover highlighting, and die click callbacks.
32
+ - Added `createWaferDies()` mock data generation for wafer demos and examples.
33
+ - Added a Three.js Wafer Monitor demo and usage snippet to the KChart playground.
34
+
35
+ ### Fixed
36
+
37
+ - Ensured Three.js wafer canvases receive drag and wheel events by restoring canvas `pointer-events`, `touch-action`, cursor, and interaction z-index after KChart canvas layer updates.
38
+
39
+ ### Packages
40
+
41
+ - Published `@keneth80/k-chart@1.9.0`.
42
+ - Published `@keneth80/k-chart-three@0.1.0`.
43
+
3
44
  ## 1.8.2 - 2026-06-26
4
45
 
5
46
  ### Added
package/README.md CHANGED
@@ -1,9 +1,134 @@
1
- # KChart
1
+ <p align="center">
2
+ <img src="docs/assets/kchart-icon.svg" alt="KChart icon" width="96" height="96" />
3
+ <br />
4
+ <img src="docs/assets/kchart-hero.svg" alt="KChart hybrid chart runtime preview" width="100%" />
5
+ </p>
6
+
7
+ <h1 align="center">KChart</h1>
8
+
9
+ <p align="center">
10
+ TypeScript 기반 class-free 하이브리드 차트 엔진입니다.<br />
11
+ 축, scale, layout은 코어가 계산하고 시각 표현은 SVG, Canvas, WebGL, Three.js renderer 함수가 담당합니다.
12
+ </p>
13
+
14
+ <p align="center">
15
+ <a href="https://github.com/keneth80/k-chart/releases"><img alt="Release" src="https://img.shields.io/github/v/release/keneth80/k-chart?include_prereleases&style=for-the-badge&label=Release&color=38bdf8"></a>
16
+ <a href="https://github.com/keneth80/k-chart/actions/workflows/ci.yml"><img alt="Build" src="https://img.shields.io/github/actions/workflow/status/keneth80/k-chart/ci.yml?branch=main&style=for-the-badge&label=Build"></a>
17
+ <img alt="Coverage" src="https://img.shields.io/badge/Coverage-not_configured-64748b?style=for-the-badge">
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
+ <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
+ <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
+ </p>
22
+
23
+ <p align="center">
24
+ <code>SVG</code>
25
+ <code>Canvas 2D</code>
26
+ <code>WebGL</code>
27
+ <code>Three.js</code>
28
+ <code>CesiumJS</code>
29
+ <code>MapLibre</code>
30
+ <code>Candlestick</code>
31
+ <code>LTTB</code>
32
+ <code>OffscreenCanvas</code>
33
+ <code>Tooltip Notes</code>
34
+ </p>
35
+
36
+ <p align="center">
37
+ <a href="https://k-chart-playground.vercel.app/"><strong>Open Playground</strong></a>
38
+ ·
39
+ <a href="#quick-start"><strong>Quick Start</strong></a>
40
+ ·
41
+ <a href="docs/functional-api.md"><strong>API Guide</strong></a>
42
+ ·
43
+ <a href="packages/k-chart-three/README.md"><strong>Three.js Adapter</strong></a>
44
+ </p>
45
+
46
+ <p align="center">
47
+ <a href="https://stackblitz.com/fork/github/keneth80/k-chart/tree/main/examples/stackblitz-line-basic?title=KChart%20Line%20Basic&file=src/main.ts">
48
+ <img alt="Open SVG Line in StackBlitz" src="https://developer.stackblitz.com/img/open_in_stackblitz.svg">
49
+ </a>
50
+ <br />
51
+ <a href="https://stackblitz.com/fork/github/keneth80/k-chart/tree/main/examples/stackblitz-simple-api-basic?title=KChart%20Simple%20API&file=src/main.ts"><strong>Simple API</strong></a>
52
+ ·
53
+ <a href="https://stackblitz.com/fork/github/keneth80/k-chart/tree/main/examples/stackblitz-canvas-line-basic?title=KChart%20Canvas%20Line&file=src/main.ts"><strong>Canvas Line</strong></a>
54
+ ·
55
+ <a href="https://stackblitz.com/fork/github/keneth80/k-chart/tree/main/examples/stackblitz-webgl-line-basic?title=KChart%20WebGL%20Line&file=src/main.ts"><strong>WebGL Line</strong></a>
56
+ ·
57
+ <a href="https://stackblitz.com/fork/github/keneth80/k-chart/tree/main/examples/stackblitz-worker-json-line?title=KChart%20Worker%20JSON%20Line&file=src/main.ts"><strong>Worker JSON</strong></a>
58
+ ·
59
+ <a href="https://stackblitz.com/fork/github/keneth80/k-chart/tree/main/examples/stackblitz-column-basic?title=KChart%20Column&file=src/main.ts"><strong>Column</strong></a>
60
+ ·
61
+ <a href="https://stackblitz.com/fork/github/keneth80/k-chart/tree/main/examples/stackblitz-stacked-column-basic?title=KChart%20Stacked%20Column&file=src/main.ts"><strong>Stacked Column</strong></a>
62
+ ·
63
+ <a href="https://stackblitz.com/fork/github/keneth80/k-chart/tree/main/examples/stackblitz-candlestick-basic?title=KChart%20Candlestick&file=src/main.ts"><strong>Candlestick</strong></a>
64
+ ·
65
+ <a href="https://stackblitz.com/fork/github/keneth80/k-chart/tree/main/examples/stackblitz-plot-basic?title=KChart%20Plot&file=src/main.ts"><strong>Plot</strong></a>
66
+ ·
67
+ <a href="https://stackblitz.com/fork/github/keneth80/k-chart/tree/main/examples/stackblitz-radial-basic?title=KChart%20Radial&file=src/main.ts"><strong>Radial</strong></a>
68
+ ·
69
+ <a href="https://stackblitz.com/fork/github/keneth80/k-chart/tree/main/examples/stackblitz-pie-basic?title=KChart%20Pie&file=src/main.ts"><strong>Pie</strong></a>
70
+ ·
71
+ <a href="https://stackblitz.com/fork/github/keneth80/k-chart/tree/main/examples/stackblitz-doughnut-basic?title=KChart%20Doughnut&file=src/main.ts"><strong>Doughnut</strong></a>
72
+ ·
73
+ <a href="https://stackblitz.com/fork/github/keneth80/k-chart/tree/main/examples/stackblitz-multi-series-basic?title=KChart%20Multi%20Series&file=src/main.ts"><strong>Multi Series</strong></a>
74
+ ·
75
+ <a href="https://stackblitz.com/fork/github/keneth80/k-chart/tree/main/examples/stackblitz-options-basic?title=KChart%20Options&file=src/main.ts"><strong>Options</strong></a>
76
+ ·
77
+ <a href="https://stackblitz.com/fork/github/keneth80/k-chart/tree/main/examples/stackblitz-topology-basic?title=KChart%20Topology&file=src/main.ts"><strong>Topology</strong></a>
78
+ ·
79
+ <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>
80
+ </p>
81
+
82
+ ## Overview
2
83
 
3
84
  KChart는 TypeScript 기반 D3 하이브리드 차트 엔진입니다.
4
85
 
5
86
  축, scale, layout은 차트 코어가 계산하고, 실제 시각 표현은 series renderer 함수가 담당합니다. Renderer는 같은 scale 정보를 받아 SVG, Canvas, WebGL 레이어 중 원하는 방식으로 그릴 수 있습니다. 새 저장소 기준 public API는 class-free 함수형 런타임입니다.
6
87
 
88
+ ## Why KChart
89
+
90
+ KChart는 완성형 대시보드 차트만 제공하는 라이브러리라기보다, 업무 화면에서 필요한 시각화를 가볍게 조립하기 위한 rendering runtime입니다. 축과 scale은 코어가 책임지고, series와 option은 함수형 renderer로 분리되어 SVG, Canvas, WebGL, Three.js, CesiumJS, MapLibre 같은 표현 계층을 필요할 때만 붙일 수 있습니다.
91
+
92
+ | Focus | KChart approach |
93
+ | --- | --- |
94
+ | Hybrid rendering | 하나의 chart runtime에서 SVG, Canvas 2D, WebGL series를 함께 사용할 수 있습니다. |
95
+ | Large data | WebGL line/point, interleaved buffer, LTTB downsampling, OffscreenCanvas worker hook을 제공합니다. |
96
+ | Custom visualization | `createCustomSeries(...)`로 scale, layer, plot size를 받은 뒤 원하는 renderer를 직접 구현할 수 있습니다. |
97
+ | Optional adapters | Three.js, CesiumJS, MapLibre는 별도 package로 분리해 기본 chart bundle에 3D/map 비용을 섞지 않습니다. |
98
+ | Business UI fit | tooltip note, fixed guide line, spec area, topology, candlestick처럼 운영 화면에서 바로 쓰는 옵션을 포함합니다. |
99
+
100
+ ### Size And Capability Snapshot
101
+
102
+ 아래 수치는 2026-07-01 기준 package footprint입니다. KChart는 현재 저장소에서 `npm pack --dry-run`으로 측정했고, 다른 패키지는 npm registry의 `dist.unpackedSize`를 사용했습니다. 실제 app bundle size는 bundler, tree-shaking, import 방식, CSS/asset 포함 여부에 따라 달라지므로, 절대 성능 순위가 아니라 package footprint를 비교하기 위한 참고값입니다.
103
+
104
+ | Package | Version | npm unpacked size | Primary renderer model | WebGL path |
105
+ | --- | ---: | ---: | --- | --- |
106
+ | `@keneth80/k-chart` | `1.9.0` | `1.1 MB` | SVG + Canvas + WebGL functional series | Built-in line/point WebGL series |
107
+ | `chart.js` | `4.5.1` | `5.89 MiB` | Canvas chart components | Not a core renderer target |
108
+ | `plotly.js-dist-min` | `3.6.0` | `4.62 MiB` | Prebuilt Plotly distribution | WebGL trace families |
109
+ | `echarts` | `6.1.0` | `57.50 MiB` | Canvas/SVG chart platform | Extension-oriented GL use cases |
110
+ | `highcharts` | `13.0.0` | `68.12 MiB` | SVG chart platform | Boost/module-oriented large data path |
111
+
112
+ Reproduce the package size numbers:
113
+
114
+ ```bash
115
+ npm pack --dry-run
116
+ npm view chart.js@latest version dist.unpackedSize
117
+ npm view plotly.js-dist-min@latest version dist.unpackedSize
118
+ npm view echarts@latest version dist.unpackedSize
119
+ npm view highcharts@latest version dist.unpackedSize
120
+ ```
121
+
122
+ ### Performance Positioning
123
+
124
+ KChart의 성능 방향은 “모든 기능을 하나의 거대한 chart object에 넣기”가 아니라, 데이터 양과 표현 방식에 맞춰 renderer를 선택하는 것입니다.
125
+
126
+ - 작은 데이터와 선명한 DOM interaction이 필요하면 SVG series를 사용합니다.
127
+ - 수천에서 수만 개의 point를 빠르게 그려야 하면 Canvas series를 사용합니다.
128
+ - 더 큰 line/point 데이터나 잦은 viewport 변경이 있으면 WebGL series와 LTTB downsampling을 조합합니다.
129
+ - 3D, 지도, 지구본은 optional adapter package로 분리해 필요한 화면에서만 로드합니다.
130
+ - 수치 비교가 필요한 경우 playground example 기준으로 같은 dataset, 같은 viewport, 같은 browser에서 FPS, first render time, memory를 측정하는 benchmark를 추가할 수 있습니다.
131
+
7
132
  ## Core Concept
8
133
 
9
134
  ```txt
@@ -32,11 +157,45 @@ createKChart(config)
32
157
 
33
158
  ### Three.js Custom Series
34
159
 
35
- Three.js는 KChart 코어 의존성이 아닙니다. 애플리케이션에서 `three`를 설치한 뒤
36
- `createCustomSeries(...)`와 `getWebglCanvas()`를 사용해 선택적으로 결합할 수 있습니다.
160
+ Three.js는 KChart 코어 의존성이 아닙니다. 가벼운 3D scene wrapper와
161
+ 반도체 웨이퍼 모니터링 객체가 필요하면 optional package인
162
+ `@keneth80/k-chart-three`를 설치합니다. 직접 renderer를 만들고 싶다면
163
+ `createCustomSeries(...)`와 `getWebglCanvas()`를 사용해 선택적으로 결합할 수도 있습니다.
37
164
 
38
165
  ```bash
39
- npm install three
166
+ npm install @keneth80/k-chart-three three
167
+ ```
168
+
169
+ [`packages/k-chart-three`](packages/k-chart-three/README.md)는 renderer, camera,
170
+ OrbitControls, resize, pointer event, dispose 생명주기를 처리하는
171
+ `createKThreeScene(...)` wrapper를 제공합니다. `createThreeWaferSeries(...)`는
172
+ KChart series contract에 맞춘 웨이퍼 모니터링 예제이며, die cell은
173
+ `InstancedMesh`로 렌더링합니다.
174
+
175
+ ```ts
176
+ import { createThreeWaferSeries, createWaferDies } from '@keneth80/k-chart-three';
177
+ import '@keneth80/k-chart-three/style.css';
178
+
179
+ const chart = createKChart({
180
+ selector: '#chart',
181
+ data: createWaferDies({ rows: 29, cols: 29 }),
182
+ axes: [],
183
+ grid: { visible: false },
184
+ legend: { visible: false },
185
+ series: [
186
+ createThreeWaferSeries({
187
+ selector: 'wafer-a17',
188
+ fields: {
189
+ id: 'id',
190
+ row: 'row',
191
+ col: 'col',
192
+ status: 'status',
193
+ value: 'value',
194
+ label: 'label'
195
+ }
196
+ })
197
+ ]
198
+ });
40
199
  ```
41
200
 
42
201
  양자리의 실제 주요 별 배치를 기반으로 별 노드와 연결선을 3D로 표현하는 전체 예제는
@@ -70,6 +229,7 @@ npm install @keneth80/k-chart
70
229
 
71
230
  ## Playground
72
231
 
232
+ - Live playground: [https://k-chart-playground.vercel.app/](https://k-chart-playground.vercel.app/)
73
233
  - Local playground URL: `http://127.0.0.1:9011`
74
234
 
75
235
  The playground demonstrates the React wrapper, chart examples, configuration editor, and AI Builder flow.
@@ -92,6 +252,7 @@ Then open `http://127.0.0.1:9003/`.
92
252
  ## Guides
93
253
 
94
254
  - [Functional API Guide](docs/functional-api.md)
255
+ - [Configuration Reference](docs/configuration-reference.md)
95
256
  - [Code Graph Handoff](docs/code-graph-handoff.md)
96
257
  - [React And Next.js Guide](docs/react-nextjs.md)
97
258
  - [Release Guide](docs/release.md)
@@ -100,6 +261,7 @@ Then open `http://127.0.0.1:9003/`.
100
261
  - [SVG Globe Map Example](examples/svg-globe-map-series.ts)
101
262
  - [MapLibre Globe Drilldown Adapter](packages/k-chart-maplibre/README.md)
102
263
  - [CesiumJS 3D Route Adapter](packages/k-chart-cesium/README.md)
264
+ - [Three.js Scene And Wafer Adapter](packages/k-chart-three/README.md)
103
265
 
104
266
  ## Module Structure
105
267
 
@@ -120,6 +282,7 @@ available:
120
282
 
121
283
  ```ts
122
284
  import {createKChart} from '@keneth80/k-chart/core';
285
+ import {createLineChart, chartConfig} from '@keneth80/k-chart/presets';
123
286
  import {createCanvasLineSeries} from '@keneth80/k-chart/series';
124
287
  import {createGuideLineOption} from '@keneth80/k-chart/options';
125
288
  import {downsampleLTTB} from '@keneth80/k-chart/utils';
@@ -131,6 +294,47 @@ The core calls concrete renderers only through the
131
294
 
132
295
  ## Quick Start
133
296
 
297
+ 처음 시작할 때는 preset API를 사용하면 축과 series boilerplate를 줄일 수 있습니다.
298
+
299
+ ```ts
300
+ import {createLineChart, chartConfig} from '@keneth80/k-chart';
301
+
302
+ type SalesPoint = {
303
+ month: string;
304
+ revenue: number;
305
+ orders: number;
306
+ };
307
+
308
+ const data: SalesPoint[] = [
309
+ {month: 'Jan', revenue: 42, orders: 320},
310
+ {month: 'Feb', revenue: 48, orders: 360},
311
+ {month: 'Mar', revenue: 45, orders: 340}
312
+ ];
313
+
314
+ createLineChart<SalesPoint>({
315
+ selector: '#line-chart',
316
+ data,
317
+ x: {field: 'month', type: 'point', title: 'Month'},
318
+ y: {field: 'revenue', type: 'number', title: 'Revenue'},
319
+ title: 'Revenue Trend',
320
+ animation: true
321
+ });
322
+
323
+ chartConfig<SalesPoint>(data)
324
+ .selector('#column-chart')
325
+ .title('Orders By Month')
326
+ .x('month', 'point', {title: 'Month'})
327
+ .y('orders', 'number', {title: 'Orders'})
328
+ .column({color: '#56d08f'})
329
+ .tooltip()
330
+ .animation()
331
+ .render();
332
+ ```
333
+
334
+ Preset API는 내부적으로 `KChartConfiguration`을 생성합니다. 더 세밀한 제어가 필요하면 아래 advanced API처럼 `createKChart(...)`, `axes`, `series`를 직접 구성하면 됩니다.
335
+
336
+ ## Advanced Quick Start
337
+
134
338
  ```ts
135
339
  import {
136
340
  createKChart,
@@ -587,6 +791,10 @@ createWebglLineSeries<Point>({
587
791
 
588
792
  같은 옵션은 `createCanvasLineSeries`에서도 사용할 수 있습니다.
589
793
 
794
+ JSON 데이터를 `fetch()`로 읽고 worker 생성 여부를 화면에서 확인하는 전체 예제는
795
+ [Worker JSON Line StackBlitz](https://stackblitz.com/fork/github/keneth80/k-chart/tree/main/examples/stackblitz-worker-json-line?title=KChart%20Worker%20JSON%20Line&file=src/main.ts)를 참고하세요.
796
+ 이 예제는 API/data URL과 worker module URL이 서로 다른 역할이라는 점을 보여줍니다.
797
+
590
798
  직접 제어가 필요하면 `render(context)` 안에서 Canvas/WebGL layer를 받을 수도 있습니다.
591
799
 
592
800
  ```ts
@@ -657,6 +865,11 @@ createKChart({
657
865
  tooltip: {
658
866
  visible: true
659
867
  },
868
+ animation: {
869
+ enabled: true,
870
+ duration: 820,
871
+ easing: 'easeOutCubic'
872
+ },
660
873
  axes: [
661
874
  { field: 'x', type: 'number', placement: 'bottom', title: 'Month Index' },
662
875
  { field: 'value', type: 'number', placement: 'left', title: 'Value' },
@@ -679,6 +892,31 @@ series: [
679
892
  ]
680
893
  ```
681
894
 
895
+ ## Animation
896
+
897
+ `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 효과를 적용합니다.
898
+
899
+ ```ts
900
+ createKChart({
901
+ selector: '#chart',
902
+ data,
903
+ axes,
904
+ series: [
905
+ createLineSeries({ selector: 'value', xField: 'x', yField: 'value' }),
906
+ createCanvasLineSeries({ selector: 'volume', xField: 'x', yField: 'volume' })
907
+ ],
908
+ animation: {
909
+ enabled: true,
910
+ duration: 820,
911
+ easing: 'easeOutCubic',
912
+ mode: 'enter',
913
+ respectReducedMotion: true
914
+ }
915
+ }).render();
916
+ ```
917
+
918
+ 대용량 WebGL 차트에서는 animation이 매 프레임 재렌더링을 발생시키므로 필요한 예제나 화면에서만 opt-in으로 켜는 것을 권장합니다.
919
+
682
920
  ## Spec Areas, Fixed Guide Lines, And Cursor Guide
683
921
 
684
922
  대용량 trace/WebGL 차트처럼 공정 단계나 관심 구간을 표시해야 할 때 `specAreas`를 사용할 수 있습니다.
@@ -0,0 +1,110 @@
1
+ <svg width="1280" height="520" viewBox="0 0 1280 520" fill="none" xmlns="http://www.w3.org/2000/svg" role="img" aria-labelledby="title desc">
2
+ <title id="title">KChart hybrid chart engine preview</title>
3
+ <desc id="desc">A dark metallic dashboard preview showing SVG, Canvas, WebGL, globe, and wafer monitoring chart layers.</desc>
4
+ <defs>
5
+ <linearGradient id="bg" x1="0" y1="0" x2="1280" y2="520" gradientUnits="userSpaceOnUse">
6
+ <stop stop-color="#070B12"/>
7
+ <stop offset="0.52" stop-color="#111C2A"/>
8
+ <stop offset="1" stop-color="#07111F"/>
9
+ </linearGradient>
10
+ <linearGradient id="panel" x1="128" y1="60" x2="1152" y2="460" gradientUnits="userSpaceOnUse">
11
+ <stop stop-color="#1D2938" stop-opacity="0.98"/>
12
+ <stop offset="1" stop-color="#0C1420" stop-opacity="0.96"/>
13
+ </linearGradient>
14
+ <linearGradient id="line" x1="176" y1="328" x2="760" y2="180" gradientUnits="userSpaceOnUse">
15
+ <stop stop-color="#5EDBFF"/>
16
+ <stop offset="0.5" stop-color="#8B7CFF"/>
17
+ <stop offset="1" stop-color="#35F2A0"/>
18
+ </linearGradient>
19
+ <linearGradient id="bar" x1="0" y1="0" x2="0" y2="148" gradientUnits="userSpaceOnUse">
20
+ <stop stop-color="#7DD3FC"/>
21
+ <stop offset="1" stop-color="#2563EB"/>
22
+ </linearGradient>
23
+ <linearGradient id="wafer" x1="850" y1="140" x2="1080" y2="370" gradientUnits="userSpaceOnUse">
24
+ <stop stop-color="#1E3A5F"/>
25
+ <stop offset="0.45" stop-color="#0F766E"/>
26
+ <stop offset="1" stop-color="#10233D"/>
27
+ </linearGradient>
28
+ <filter id="softGlow" x="-40%" y="-40%" width="180%" height="180%">
29
+ <feGaussianBlur stdDeviation="8" result="blur"/>
30
+ <feColorMatrix in="blur" type="matrix" values="0 0 0 0 0.28 0 0 0 0 0.78 0 0 0 0 1 0 0 0 0.85 0"/>
31
+ <feMerge>
32
+ <feMergeNode/>
33
+ <feMergeNode in="SourceGraphic"/>
34
+ </feMerge>
35
+ </filter>
36
+ <pattern id="grid" width="32" height="32" patternUnits="userSpaceOnUse">
37
+ <path d="M32 0H0V32" stroke="#93A4B8" stroke-opacity="0.08"/>
38
+ </pattern>
39
+ </defs>
40
+
41
+ <rect width="1280" height="520" rx="34" fill="url(#bg)"/>
42
+ <rect width="1280" height="520" rx="34" fill="url(#grid)"/>
43
+ <rect x="74" y="44" width="1132" height="432" rx="28" fill="url(#panel)" stroke="#90A4B8" stroke-opacity="0.2"/>
44
+ <rect x="74" y="44" width="1132" height="72" rx="28" fill="#182233" fill-opacity="0.9"/>
45
+ <path d="M74 116H1206" stroke="#B8C7D9" stroke-opacity="0.12"/>
46
+
47
+ <text x="116" y="92" fill="#F8FAFC" font-family="Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, sans-serif" font-size="36" font-weight="800">KChart</text>
48
+ <text x="258" y="91" fill="#9FB0C7" font-family="Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, sans-serif" font-size="17" font-weight="600">Class-free hybrid chart runtime for SVG, Canvas, WebGL and custom 3D renderers</text>
49
+
50
+ <g transform="translate(118 144)">
51
+ <rect width="670" height="274" rx="22" fill="#0B1320" stroke="#4B5B72" stroke-opacity="0.55"/>
52
+ <path d="M48 226H622" stroke="#C8D4E3" stroke-opacity="0.28"/>
53
+ <path d="M48 32V226" stroke="#C8D4E3" stroke-opacity="0.28"/>
54
+ <path d="M48 190H622M48 154H622M48 118H622M48 82H622M48 46H622" stroke="#9FB0C7" stroke-opacity="0.08" stroke-dasharray="4 12"/>
55
+ <path d="M58 206C106 164 126 180 170 128C218 72 260 82 314 122C376 168 420 122 468 82C522 38 564 70 612 42" stroke="url(#line)" stroke-width="5" stroke-linecap="round" stroke-linejoin="round" filter="url(#softGlow)"/>
56
+ <path d="M58 218C112 208 154 198 210 176C278 150 314 168 364 198C430 238 496 194 546 166C580 146 602 148 622 140" stroke="#F97316" stroke-opacity="0.78" stroke-width="3" stroke-linecap="round"/>
57
+ <g opacity="0.9">
58
+ <rect x="94" y="162" width="42" height="64" rx="8" fill="url(#bar)"/>
59
+ <rect x="160" y="120" width="42" height="106" rx="8" fill="url(#bar)"/>
60
+ <rect x="226" y="144" width="42" height="82" rx="8" fill="url(#bar)"/>
61
+ <rect x="292" y="92" width="42" height="134" rx="8" fill="url(#bar)"/>
62
+ <rect x="358" y="132" width="42" height="94" rx="8" fill="url(#bar)"/>
63
+ </g>
64
+ <circle cx="468" cy="82" r="7" fill="#35F2A0" stroke="#E2F7FF" stroke-width="3"/>
65
+ <circle cx="612" cy="42" r="7" fill="#7DD3FC" stroke="#E2F7FF" stroke-width="3"/>
66
+ <rect x="466" y="94" width="112" height="64" rx="14" fill="#080D16" stroke="#7DD3FC" stroke-opacity="0.6"/>
67
+ <text x="484" y="121" fill="#EAF6FF" font-family="Inter, ui-sans-serif, system-ui" font-size="14" font-weight="800">WebGL</text>
68
+ <text x="484" y="144" fill="#9FB0C7" font-family="Inter, ui-sans-serif, system-ui" font-size="13">120k points</text>
69
+ </g>
70
+
71
+ <g transform="translate(832 146)">
72
+ <circle cx="148" cy="136" r="122" fill="url(#wafer)" stroke="#9BE7FF" stroke-opacity="0.65" stroke-width="2"/>
73
+ <circle cx="148" cy="136" r="122" stroke="#B5F7FF" stroke-opacity="0.24" stroke-width="12"/>
74
+ <path d="M84 241C112 228 188 228 214 242" stroke="#09111C" stroke-width="10" stroke-linecap="round"/>
75
+ <g opacity="0.95">
76
+ <rect x="84" y="78" width="18" height="18" rx="4" fill="#22F59A"/>
77
+ <rect x="108" y="78" width="18" height="18" rx="4" fill="#22F59A"/>
78
+ <rect x="132" y="78" width="18" height="18" rx="4" fill="#FFD166"/>
79
+ <rect x="156" y="78" width="18" height="18" rx="4" fill="#22F59A"/>
80
+ <rect x="180" y="78" width="18" height="18" rx="4" fill="#22F59A"/>
81
+ <rect x="72" y="104" width="18" height="18" rx="4" fill="#22F59A"/>
82
+ <rect x="96" y="104" width="18" height="18" rx="4" fill="#22F59A"/>
83
+ <rect x="120" y="104" width="18" height="18" rx="4" fill="#FF3D71"/>
84
+ <rect x="144" y="104" width="18" height="18" rx="4" fill="#22F59A"/>
85
+ <rect x="168" y="104" width="18" height="18" rx="4" fill="#22F59A"/>
86
+ <rect x="192" y="104" width="18" height="18" rx="4" fill="#22F59A"/>
87
+ <rect x="72" y="130" width="18" height="18" rx="4" fill="#22F59A"/>
88
+ <rect x="96" y="130" width="18" height="18" rx="4" fill="#7DD3FC"/>
89
+ <rect x="120" y="130" width="18" height="18" rx="4" fill="#22F59A"/>
90
+ <rect x="144" y="130" width="18" height="18" rx="4" fill="#22F59A"/>
91
+ <rect x="168" y="130" width="18" height="18" rx="4" fill="#FFD166"/>
92
+ <rect x="192" y="130" width="18" height="18" rx="4" fill="#22F59A"/>
93
+ <rect x="84" y="156" width="18" height="18" rx="4" fill="#22F59A"/>
94
+ <rect x="108" y="156" width="18" height="18" rx="4" fill="#22F59A"/>
95
+ <rect x="132" y="156" width="18" height="18" rx="4" fill="#22F59A"/>
96
+ <rect x="156" y="156" width="18" height="18" rx="4" fill="#FF3D71"/>
97
+ <rect x="180" y="156" width="18" height="18" rx="4" fill="#22F59A"/>
98
+ <rect x="108" y="182" width="18" height="18" rx="4" fill="#22F59A"/>
99
+ <rect x="132" y="182" width="18" height="18" rx="4" fill="#22F59A"/>
100
+ <rect x="156" y="182" width="18" height="18" rx="4" fill="#22F59A"/>
101
+ </g>
102
+ <path d="M48 48C80 18 128 4 174 12C222 21 258 52 272 94" stroke="#A7F3D0" stroke-opacity="0.45" stroke-width="3" stroke-linecap="round"/>
103
+ </g>
104
+
105
+ <g transform="translate(832 390)">
106
+ <rect width="294" height="44" rx="22" fill="#0B1320" stroke="#5EDBFF" stroke-opacity="0.28"/>
107
+ <circle cx="28" cy="22" r="7" fill="#35F2A0"/>
108
+ <text x="48" y="28" fill="#DDEBFA" font-family="Inter, ui-sans-serif, system-ui" font-size="15" font-weight="700">SVG · Canvas · WebGL · Three.js</text>
109
+ </g>
110
+ </svg>
@@ -0,0 +1,40 @@
1
+ <svg width="512" height="512" viewBox="0 0 512 512" fill="none" xmlns="http://www.w3.org/2000/svg" role="img" aria-labelledby="title desc">
2
+ <title id="title">KChart icon</title>
3
+ <desc id="desc">A metallic K monogram with a hybrid chart line.</desc>
4
+ <defs>
5
+ <linearGradient id="shell" x1="72" y1="44" x2="440" y2="468" gradientUnits="userSpaceOnUse">
6
+ <stop stop-color="#223049"/>
7
+ <stop offset="0.48" stop-color="#0B1320"/>
8
+ <stop offset="1" stop-color="#182237"/>
9
+ </linearGradient>
10
+ <linearGradient id="stroke" x1="82" y1="70" x2="438" y2="438" gradientUnits="userSpaceOnUse">
11
+ <stop stop-color="#E8F7FF" stop-opacity="0.9"/>
12
+ <stop offset="0.34" stop-color="#5EDBFF"/>
13
+ <stop offset="0.68" stop-color="#35F2A0"/>
14
+ <stop offset="1" stop-color="#FBBF24"/>
15
+ </linearGradient>
16
+ <linearGradient id="kfill" x1="132" y1="112" x2="336" y2="398" gradientUnits="userSpaceOnUse">
17
+ <stop stop-color="#F8FBFF"/>
18
+ <stop offset="0.42" stop-color="#BEEBFF"/>
19
+ <stop offset="1" stop-color="#7DD3FC"/>
20
+ </linearGradient>
21
+ <filter id="glow" x="-45%" y="-45%" width="190%" height="190%" color-interpolation-filters="sRGB">
22
+ <feGaussianBlur stdDeviation="13" result="blur"/>
23
+ <feColorMatrix in="blur" type="matrix" values="0 0 0 0 0.20 0 0 0 0 0.85 0 0 0 0 1.00 0 0 0 0.65 0"/>
24
+ <feBlend in="SourceGraphic" mode="screen"/>
25
+ </filter>
26
+ <filter id="softShadow" x="-20%" y="-20%" width="140%" height="140%" color-interpolation-filters="sRGB">
27
+ <feDropShadow dx="0" dy="24" stdDeviation="24" flood-color="#000000" flood-opacity="0.42"/>
28
+ </filter>
29
+ </defs>
30
+ <rect x="42" y="42" width="428" height="428" rx="96" fill="url(#shell)" filter="url(#softShadow)"/>
31
+ <rect x="54" y="54" width="404" height="404" rx="84" stroke="url(#stroke)" stroke-opacity="0.72" stroke-width="8"/>
32
+ <path d="M112 120H160V231L272 120H337L215 238L350 392H285L185 273L160 298V392H112V120Z" fill="url(#kfill)"/>
33
+ <path d="M142 382C196 310 229 334 272 270C316 204 354 236 400 154" stroke="url(#stroke)" stroke-width="22" stroke-linecap="round" stroke-linejoin="round" filter="url(#glow)"/>
34
+ <path d="M142 382C196 310 229 334 272 270C316 204 354 236 400 154" stroke="#08111F" stroke-opacity="0.36" stroke-width="7" stroke-linecap="round" stroke-linejoin="round"/>
35
+ <circle cx="142" cy="382" r="18" fill="#5EDBFF" stroke="#F8FBFF" stroke-width="8"/>
36
+ <circle cx="272" cy="270" r="18" fill="#35F2A0" stroke="#F8FBFF" stroke-width="8"/>
37
+ <circle cx="400" cy="154" r="18" fill="#FBBF24" stroke="#F8FBFF" stroke-width="8"/>
38
+ <path d="M94 96H418" stroke="#FFFFFF" stroke-opacity="0.16" stroke-width="6" stroke-linecap="round"/>
39
+ <path d="M96 418H418" stroke="#5EDBFF" stroke-opacity="0.18" stroke-width="5" stroke-linecap="round"/>
40
+ </svg>