@keneth80/k-chart 1.21.0 → 1.23.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 (80) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/README.md +10 -24
  3. package/docs/configuration-reference.md +18 -0
  4. package/docs/functional-api.md +16 -0
  5. package/examples/stackblitz-area-basic/index.html +21 -0
  6. package/examples/stackblitz-area-basic/package-lock.json +1531 -0
  7. package/examples/stackblitz-area-basic/package.json +18 -0
  8. package/examples/stackblitz-area-basic/src/main.ts +65 -0
  9. package/examples/stackblitz-area-basic/src/style.css +83 -0
  10. package/examples/stackblitz-area-basic/src/vite-env.d.ts +1 -0
  11. package/examples/stackblitz-box-plot-basic/index.html +21 -0
  12. package/examples/stackblitz-box-plot-basic/package-lock.json +1531 -0
  13. package/examples/stackblitz-box-plot-basic/package.json +18 -0
  14. package/examples/stackblitz-box-plot-basic/src/main.ts +69 -0
  15. package/examples/stackblitz-box-plot-basic/src/style.css +83 -0
  16. package/examples/stackblitz-box-plot-basic/src/vite-env.d.ts +1 -0
  17. package/examples/stackblitz-bubble-basic/index.html +21 -0
  18. package/examples/stackblitz-bubble-basic/package-lock.json +1531 -0
  19. package/examples/stackblitz-bubble-basic/package.json +18 -0
  20. package/examples/stackblitz-bubble-basic/src/main.ts +64 -0
  21. package/examples/stackblitz-bubble-basic/src/style.css +83 -0
  22. package/examples/stackblitz-bubble-basic/src/vite-env.d.ts +1 -0
  23. package/examples/stackblitz-gauge-basic/index.html +21 -0
  24. package/examples/stackblitz-gauge-basic/package-lock.json +1531 -0
  25. package/examples/stackblitz-gauge-basic/package.json +18 -0
  26. package/examples/stackblitz-gauge-basic/src/main.ts +55 -0
  27. package/examples/stackblitz-gauge-basic/src/style.css +83 -0
  28. package/examples/stackblitz-gauge-basic/src/vite-env.d.ts +1 -0
  29. package/examples/stackblitz-grouped-column-basic/index.html +26 -0
  30. package/examples/stackblitz-grouped-column-basic/package-lock.json +1531 -0
  31. package/examples/stackblitz-grouped-column-basic/package.json +18 -0
  32. package/examples/stackblitz-grouped-column-basic/src/main.ts +61 -0
  33. package/examples/stackblitz-grouped-column-basic/src/style.css +83 -0
  34. package/examples/stackblitz-grouped-column-basic/src/vite-env.d.ts +1 -0
  35. package/examples/stackblitz-histogram-basic/index.html +21 -0
  36. package/examples/stackblitz-histogram-basic/package-lock.json +1531 -0
  37. package/examples/stackblitz-histogram-basic/package.json +18 -0
  38. package/examples/stackblitz-histogram-basic/src/main.ts +64 -0
  39. package/examples/stackblitz-histogram-basic/src/style.css +83 -0
  40. package/examples/stackblitz-histogram-basic/src/vite-env.d.ts +1 -0
  41. package/examples/stackblitz-horizontal-bar-basic/index.html +21 -0
  42. package/examples/stackblitz-horizontal-bar-basic/package-lock.json +1531 -0
  43. package/examples/stackblitz-horizontal-bar-basic/package.json +18 -0
  44. package/examples/stackblitz-horizontal-bar-basic/src/main.ts +58 -0
  45. package/examples/stackblitz-horizontal-bar-basic/src/style.css +83 -0
  46. package/examples/stackblitz-horizontal-bar-basic/src/vite-env.d.ts +1 -0
  47. package/examples/stackblitz-scatter-basic/index.html +21 -0
  48. package/examples/stackblitz-scatter-basic/package-lock.json +1531 -0
  49. package/examples/stackblitz-scatter-basic/package.json +18 -0
  50. package/examples/stackblitz-scatter-basic/src/main.ts +66 -0
  51. package/examples/stackblitz-scatter-basic/src/style.css +83 -0
  52. package/examples/stackblitz-scatter-basic/src/vite-env.d.ts +1 -0
  53. package/examples/stackblitz-three-constellation-basic/index.html +41 -0
  54. package/examples/stackblitz-three-constellation-basic/package-lock.json +1607 -0
  55. package/examples/stackblitz-three-constellation-basic/package.json +22 -0
  56. package/examples/stackblitz-three-constellation-basic/src/main.ts +374 -0
  57. package/examples/stackblitz-three-constellation-basic/src/style.css +173 -0
  58. package/examples/stackblitz-waterfall-basic/index.html +26 -0
  59. package/examples/stackblitz-waterfall-basic/package-lock.json +1531 -0
  60. package/examples/stackblitz-waterfall-basic/package.json +18 -0
  61. package/examples/stackblitz-waterfall-basic/src/main.ts +75 -0
  62. package/examples/stackblitz-waterfall-basic/src/style.css +83 -0
  63. package/examples/stackblitz-waterfall-basic/src/vite-env.d.ts +1 -0
  64. package/lib/core/axis-title.d.ts +23 -0
  65. package/lib/core/axis-title.d.ts.map +1 -0
  66. package/lib/core/axis-title.js +129 -0
  67. package/lib/core/axis-title.js.map +1 -0
  68. package/lib/core/contracts.d.ts +3 -0
  69. package/lib/core/contracts.d.ts.map +1 -1
  70. package/lib/core/create-kchart.d.ts +9 -0
  71. package/lib/core/create-kchart.d.ts.map +1 -1
  72. package/lib/core/create-kchart.js +130 -25
  73. package/lib/core/create-kchart.js.map +1 -1
  74. package/lib/presets/index.d.ts +2 -0
  75. package/lib/presets/index.d.ts.map +1 -1
  76. package/lib/presets/index.js.map +1 -1
  77. package/lib/series/support/canvas.d.ts.map +1 -1
  78. package/lib/series/support/canvas.js +68 -15
  79. package/lib/series/support/canvas.js.map +1 -1
  80. package/package.json +2 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,37 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.23.0 - 2026-08-25
4
+
5
+ ### Added
6
+
7
+ - Added the remaining StackBlitz-ready starters for area, grouped and
8
+ horizontal bars, scatter, bubble, box plot, histogram, gauge, waterfall,
9
+ and the Three.js constellation example.
10
+
11
+ ### Changed
12
+
13
+ - Coalesced wheel and drag zoom rendering to the latest state once per
14
+ animation frame, preventing repeated full-series projection while preserving
15
+ immediate zoom callbacks and a final render at gesture end.
16
+
17
+ ### Tests
18
+
19
+ - Added zoom scheduling lifecycle coverage, including overlapping gesture
20
+ boundaries and authoritative-render cancellation. Three 60-second 300k-point
21
+ S3 runs completed with zero long tasks; the final reviewed build recorded a
22
+ 50 ms worst frame, down from the previously published multi-second stall.
23
+
24
+ ## 1.22.0 - 2026-08-20
25
+
26
+ ### Added
27
+
28
+ - Added `titleLayout` and `titleOffset` axis options, including readable horizontal Y-axis titles and automatic title-aware margins that avoid chart-title, legend, and top-axis overlap.
29
+
30
+ ### Changed
31
+
32
+ - Bounded OffscreenCanvas line-render traffic to one active request and one newest queued frame, preventing stale high-frequency Canvas/WebGL updates from accumulating in the worker queue while preserving render-completion semantics.
33
+ - Updated the Cesium route demo and usage guide to load the optional Cesium runtime and adapter together on demand as asynchronous chunks, and documented that normal KChart chart imports do not include Cesium.
34
+
3
35
  ## 1.21.0 - 2026-07-25
4
36
 
5
37
  ### Changed
package/README.md CHANGED
@@ -136,28 +136,6 @@ KChart는 완성형 대시보드 차트만 제공하는 라이브러리라기보
136
136
  | Part-to-whole analysis | `createTreemapSeries(...)`로 동일 metric의 구성 비중을 사각형 면적으로 비교합니다. |
137
137
  | Flow analysis | `createSankeySeries(...)`로 단계별 흐름의 상대적인 크기와 이탈 지점을 표현합니다. |
138
138
 
139
- ### Size And Capability Snapshot
140
-
141
- 아래 수치는 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를 비교하기 위한 참고값입니다.
142
-
143
- | Package | Version | npm unpacked size | Primary renderer model | WebGL path |
144
- | --- | ---: | ---: | --- | --- |
145
- | `@keneth80/k-chart` | `1.9.0` | `1.1 MB` | SVG + Canvas + WebGL functional series | Built-in line/point WebGL series |
146
- | `chart.js` | `4.5.1` | `5.89 MiB` | Canvas chart components | Not a core renderer target |
147
- | `plotly.js-dist-min` | `3.6.0` | `4.62 MiB` | Prebuilt Plotly distribution | WebGL trace families |
148
- | `echarts` | `6.1.0` | `57.50 MiB` | Canvas/SVG chart platform | Extension-oriented GL use cases |
149
- | `highcharts` | `13.0.0` | `68.12 MiB` | SVG chart platform | Boost/module-oriented large data path |
150
-
151
- Reproduce the package size numbers:
152
-
153
- ```bash
154
- npm pack --dry-run
155
- npm view chart.js@latest version dist.unpackedSize
156
- npm view plotly.js-dist-min@latest version dist.unpackedSize
157
- npm view echarts@latest version dist.unpackedSize
158
- npm view highcharts@latest version dist.unpackedSize
159
- ```
160
-
161
139
  ### Performance Positioning
162
140
 
163
141
  KChart의 성능 방향은 “모든 기능을 하나의 거대한 chart object에 넣기”가 아니라, 데이터 양과 표현 방식에 맞춰 renderer를 선택하는 것입니다.
@@ -166,7 +144,7 @@ KChart의 성능 방향은 “모든 기능을 하나의 거대한 chart object
166
144
  - 수천에서 수만 개의 point를 빠르게 그려야 하면 Canvas series를 사용합니다.
167
145
  - 더 큰 line/point 데이터나 잦은 viewport 변경이 있으면 WebGL series와 LTTB downsampling을 조합합니다.
168
146
  - 3D, 지도, 지구본은 optional adapter package로 분리해 필요한 화면에서만 로드합니다.
169
- - 렌더링 성능 비교와 재현 조건은 [KChart Benchmark](https://k-chart-bench.vercel.app/)에서 확인할 수 있습니다. 결과를 해석할 때는 dataset, viewport, browser, 측정 종점과 각 라이브러리 설정을 함께 확인해야 합니다.
147
+ - 재현 가능한 렌더링 측정 결과와 조건은 [KChart Benchmark](https://k-chart-bench.vercel.app/)에서 확인할 수 있습니다.
170
148
 
171
149
  ## Core Concept
172
150
 
@@ -277,7 +255,7 @@ The playground demonstrates the React wrapper, chart examples, configuration edi
277
255
 
278
256
  - Live benchmark: [https://k-chart-bench.vercel.app/](https://k-chart-bench.vercel.app/)
279
257
 
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.
258
+ The benchmark publishes reproducible KChart rendering measurements alongside the dataset size, browser environment, runtime version, and measurement methodology.
281
259
 
282
260
  ## Local Development
283
261
 
@@ -635,6 +613,14 @@ satellite, place-search, or 3D Tiles services have separate terms. Do not
635
613
  hard-code private provider keys in reusable library code, and keep Cesium/provider
636
614
  credits and copyright notices visible.
637
615
 
616
+ Cesium is not a dependency of the main `@keneth80/k-chart` package, so users
617
+ who import only core, SVG, Canvas, or WebGL chart modules do not include the
618
+ Cesium runtime in their application bundle. Load both `cesium` and
619
+ `@keneth80/k-chart-cesium` with `import()` when the globe route or panel opens
620
+ to keep Cesium in separate on-demand chunks. A static Cesium import can place
621
+ that runtime in the initial application bundle even when the globe is not yet
622
+ visible.
623
+
638
624
  Detailed Cesium usage, asset deployment, provider/license notes, and first-view
639
625
  camera tips are documented in
640
626
  [`packages/k-chart-cesium/README.md`](packages/k-chart-cesium/README.md).
@@ -58,11 +58,29 @@ createKChart({
58
58
  | `visible` | `boolean` | no | `false`이면 axis를 숨깁니다. scale 자체는 여전히 series 계산에 사용할 수 있습니다. |
59
59
  | `padding` | `number` | no | number/time domain 양끝에 비율 padding을 추가합니다. `min`, `max`가 없을 때만 적용됩니다. |
60
60
  | `title` | `string` | no | axis title입니다. |
61
+ | `titleLayout` | `'vertical' \| 'horizontal'` | no | left/right 축 제목의 방향입니다. 기본값은 기존과 동일한 `vertical`입니다. 짧은 한글 제목이나 좁은 패널에서는 `horizontal`을 권장합니다. bottom/top 축은 항상 가로로 표시됩니다. |
62
+ | `titleOffset` | `number` | no | 축선에서 제목까지의 거리(px)입니다. 음수는 `0`으로 보정되며, 사용 가능한 차트 크기 안에서는 제목이 잘리지 않도록 해당 방향의 margin이 자동 확장됩니다. offset과 margin의 합이 차트 자체 크기를 넘으면 plot 영역이 축소될 수 있습니다. 기본값은 bottom `34`, top `24`, 세로 left/right `36`, 가로 left/right `12`입니다. |
61
63
  | `tickCount` | `number` | no | `number`/`time` 축에서는 기존 D3 tick 개수 힌트입니다. `point`/`string` 축에서는 표시할 tick을 domain 전체에서 균등하게 샘플링하며 첫 값과 마지막 값을 보존합니다. |
62
64
  | `tickFormat` | `(value: any) => string` | no | tick label formatter입니다. |
63
65
 
64
66
  `point`/`string` 축의 `tickCount`는 표시 tick만 줄입니다. scale domain과 데이터 위치는 전체 domain을 기준으로 그대로 유지됩니다. `tickCount`를 지정하지 않거나 domain 길이 이상으로 지정하면 모든 tick을 표시합니다. 여러 category가 있을 때 `tickCount`가 `1`이면 범위의 양 끝을 전달하기 위해 첫 값과 마지막 값, 총 2개를 표시합니다. `number`/`time` 축에서는 계속 D3에 tick 개수 힌트로 전달되므로 실제 tick 개수는 달라질 수 있습니다.
65
67
 
68
+ 짧은 Y축 제목을 가로로 배치하면 회전된 글자를 읽는 불편과 패널 왼쪽 잘림을 함께 줄일 수 있습니다.
69
+
70
+ ```ts
71
+ axes: [
72
+ {field: 'date', type: 'time', placement: 'bottom'},
73
+ {
74
+ field: 'count',
75
+ type: 'number',
76
+ placement: 'left',
77
+ title: '연결',
78
+ titleLayout: 'horizontal',
79
+ titleOffset: 12
80
+ }
81
+ ]
82
+ ```
83
+
66
84
  ## Title, Grid, Legend, Tooltip
67
85
 
68
86
  ### `title`
@@ -142,6 +142,22 @@ axes: [
142
142
 
143
143
  `tickCount`를 생략하거나 domain 길이 이상으로 지정한 `point`/`string` 축은 모든 tick을 표시합니다. 여러 category가 있는 축에서 `tickCount: 1`은 첫 값과 마지막 값을 보존하기 위해 2개 라벨로 처리됩니다. `number`와 `time` 축의 `tickCount`는 기존처럼 D3 tick 생성에 전달되는 개수 힌트이며 실제 표시 개수와 정확히 일치하지 않을 수 있습니다.
144
144
 
145
+ Y축 제목은 기본적으로 기존 호환성을 위해 세로로 표시됩니다. 짧은 한글 제목이나 좁은 대시보드 패널에서는 `titleLayout: 'horizontal'`로 가독성을 높이고 `titleOffset`으로 축선과의 간격을 조절할 수 있습니다.
146
+
147
+ ```ts
148
+ axes: [
149
+ {field: 'date', type: 'time', placement: 'bottom'},
150
+ {
151
+ field: 'count',
152
+ type: 'number',
153
+ placement: 'left',
154
+ title: '연결',
155
+ titleLayout: 'horizontal',
156
+ titleOffset: 12
157
+ }
158
+ ]
159
+ ```
160
+
145
161
  ## Built-In BI / Distribution Series
146
162
 
147
163
  대시보드에서 자주 필요한 분포, 구성, KPI, 누적 흐름 차트도 class-free factory로 사용할 수 있습니다.
@@ -0,0 +1,21 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <title>KChart Area Basic</title>
7
+ </head>
8
+ <body>
9
+ <main class="page-shell">
10
+ <header class="intro">
11
+ <p class="eyebrow">Operations overview</p>
12
+ <h1>Weekly energy demand</h1>
13
+ <p>Grid load climbs through the summer peak before easing into early autumn.</p>
14
+ </header>
15
+ <section class="chart-panel">
16
+ <div id="chart"></div>
17
+ </section>
18
+ </main>
19
+ <script type="module" src="/src/main.ts"></script>
20
+ </body>
21
+ </html>