@keneth80/k-chart 1.10.0 → 1.12.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.
- package/CHANGELOG.md +32 -0
- package/README.md +4 -0
- package/docs/configuration-reference.md +21 -0
- package/docs/functional-api.md +71 -0
- package/examples/stackblitz-korea-region-map-basic/index.html +20 -0
- package/examples/stackblitz-korea-region-map-basic/package-lock.json +1434 -0
- package/examples/stackblitz-korea-region-map-basic/package.json +17 -0
- package/examples/stackblitz-korea-region-map-basic/src/main.ts +99 -0
- package/examples/stackblitz-korea-region-map-basic/src/style.css +57 -0
- package/examples/stackblitz-world-country-map-basic/index.html +20 -0
- package/examples/stackblitz-world-country-map-basic/package-lock.json +1434 -0
- package/examples/stackblitz-world-country-map-basic/package.json +17 -0
- package/examples/stackblitz-world-country-map-basic/src/main.ts +64 -0
- package/examples/stackblitz-world-country-map-basic/src/style.css +57 -0
- package/lib/core/contracts.d.ts +64 -0
- package/lib/core/contracts.d.ts.map +1 -1
- package/lib/series/index.d.ts +1 -0
- package/lib/series/index.d.ts.map +1 -1
- package/lib/series/index.js +1 -0
- package/lib/series/index.js.map +1 -1
- package/lib/series/svg-region-map.d.ts +4 -0
- package/lib/series/svg-region-map.d.ts.map +1 -0
- package/lib/series/svg-region-map.js +507 -0
- package/lib/series/svg-region-map.js.map +1 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,37 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.12.0 - 2026-07-03
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- Added `zoom` support to `createGeoRegionMapSeries()` for wheel zoom, drag pan, and in-chart zoom controls.
|
|
8
|
+
|
|
9
|
+
### Changed
|
|
10
|
+
|
|
11
|
+
- Updated the Korea Region Map example to use centroid labels and choropleth colors instead of dense callout guide lines.
|
|
12
|
+
- Documented region map zoom options in the functional API guide and configuration reference.
|
|
13
|
+
|
|
14
|
+
### Packages
|
|
15
|
+
|
|
16
|
+
- Published `@keneth80/k-chart@1.12.0`.
|
|
17
|
+
|
|
18
|
+
## 1.11.0 - 2026-07-02
|
|
19
|
+
|
|
20
|
+
### Added
|
|
21
|
+
|
|
22
|
+
- Added `createGeoRegionMapSeries()` for SVG choropleth/region maps backed by user-provided GeoJSON.
|
|
23
|
+
- Added `createWorldCountryMapSeries()` with built-in `world-atlas` country geometry for country-level color maps.
|
|
24
|
+
- Added region map hover highlight, click callbacks, tooltip formatting, centroid labels, and callout labels.
|
|
25
|
+
- Added Korea Region Map and World Country Map StackBlitz examples.
|
|
26
|
+
|
|
27
|
+
### Changed
|
|
28
|
+
|
|
29
|
+
- Documented region map usage and linked the new map examples from README and the functional API guide.
|
|
30
|
+
|
|
31
|
+
### Packages
|
|
32
|
+
|
|
33
|
+
- Published `@keneth80/k-chart@1.11.0`.
|
|
34
|
+
|
|
3
35
|
## 1.10.0 - 2026-07-02
|
|
4
36
|
|
|
5
37
|
### Added
|
package/README.md
CHANGED
|
@@ -56,6 +56,10 @@
|
|
|
56
56
|
·
|
|
57
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
58
|
·
|
|
59
|
+
<a href="https://stackblitz.com/fork/github/keneth80/k-chart/tree/main/examples/stackblitz-korea-region-map-basic?title=KChart%20Korea%20Region%20Map&file=src/main.ts"><strong>Korea Map</strong></a>
|
|
60
|
+
·
|
|
61
|
+
<a href="https://stackblitz.com/fork/github/keneth80/k-chart/tree/main/examples/stackblitz-world-country-map-basic?title=KChart%20World%20Country%20Map&file=src/main.ts"><strong>World Map</strong></a>
|
|
62
|
+
·
|
|
59
63
|
<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
64
|
·
|
|
61
65
|
<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>
|
|
@@ -257,6 +257,27 @@ createKChart({
|
|
|
257
257
|
|
|
258
258
|
WebGL point는 현재 interleaved buffer `[x, y, size]` 구조로 GPU에 전달합니다. Worker async path는 line series에만 구현되어 있습니다.
|
|
259
259
|
|
|
260
|
+
### SVG Region Map: `createGeoRegionMapSeries`
|
|
261
|
+
|
|
262
|
+
| Field | Type | Default | Description |
|
|
263
|
+
| --- | --- | --- | --- |
|
|
264
|
+
| `geoJson` | `FeatureCollection \| Feature \| Feature[]` | required | 지도 경계 GeoJSON입니다. 한국 시도, 세계 국가, 사내 구역처럼 polygon feature를 넣습니다. |
|
|
265
|
+
| `dataKey` | `keyof T & string` | `name` | chart data에서 region key로 사용할 field입니다. |
|
|
266
|
+
| `featureKey` | `string \| (feature) => string` | `name` | GeoJSON feature에서 region key로 사용할 property입니다. |
|
|
267
|
+
| `labelKey` | `string \| (feature) => string` | `featureKey` | label에 사용할 feature property입니다. |
|
|
268
|
+
| `valueField` | `keyof T & string` | - | tooltip/label에 표시할 값 field입니다. |
|
|
269
|
+
| `colorField` | `keyof T & string` | - | data row별 fill color field입니다. |
|
|
270
|
+
| `fitPadding` | `number` | `16` | projection fit 시 plot edge와 지도 사이 여백입니다. |
|
|
271
|
+
| `backgroundFill` | `string` | transparent | 지도 배경색입니다. |
|
|
272
|
+
| `fill` / `missingFill` | `string \| (context) => string` | palette / translucent gray | data가 있는 region과 없는 region의 채움색입니다. |
|
|
273
|
+
| `stroke` / `strokeWidth` | `string \| (context) => string`, `number` | white, `1.2` | region 경계선입니다. |
|
|
274
|
+
| `hoverFill` / `hoverStroke` / `hoverStrokeWidth` | mixed | - | tooltip hit region hover style입니다. |
|
|
275
|
+
| `labels` | `boolean \| KChartGeoRegionMapLabelConfiguration<T>` | disabled | `centroid` 또는 `callout` 라벨을 표시합니다. |
|
|
276
|
+
| `zoom` | `boolean \| KChartGeoRegionMapZoomConfiguration` | disabled | 지도 내부 wheel zoom, drag pan, zoom button control을 켭니다. |
|
|
277
|
+
| `tooltip` | `boolean \| { formatter }` | enabled | region tooltip입니다. |
|
|
278
|
+
|
|
279
|
+
`zoom: {enabled: true, controls: {visible: true}, scaleExtent: [1, 7]}`처럼 지정하면 축이 없는 지도에서도 확대/축소와 drag 이동을 사용할 수 있습니다. `wheel`은 mouse wheel zoom, `pan`은 drag pan 입력을 제어합니다. `labels.mode: 'callout'`은 작은 지도의 라벨 선이 복잡해질 수 있으므로, choropleth 지도에서는 `centroid`와 짧은 label formatter를 우선 권장합니다.
|
|
280
|
+
|
|
260
281
|
### SVG Globe: `createSvgGlobeSeries`
|
|
261
282
|
|
|
262
283
|
| Field | Type | Default | Description |
|
package/docs/functional-api.md
CHANGED
|
@@ -492,6 +492,77 @@ JSON 데이터를 `fetch()`로 읽고 worker 생성 여부를 화면에서 확
|
|
|
492
492
|
[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)를 참고하세요.
|
|
493
493
|
이 예제는 API/data URL과 worker module URL이 서로 다른 역할이라는 점을 보여줍니다.
|
|
494
494
|
|
|
495
|
+
### SVG Region Maps
|
|
496
|
+
|
|
497
|
+
`createGeoRegionMapSeries()`는 GeoJSON `FeatureCollection`을 받아 각 region을 SVG path로 렌더링합니다. 한국 시도, 세계 국가, 사내 공장 구역처럼 경계 데이터가 있는 지도형 시각화에 사용할 수 있습니다. `dataKey`와 `featureKey`가 같은 값을 가리키면 chart data가 GeoJSON feature에 매핑됩니다.
|
|
498
|
+
|
|
499
|
+
```ts
|
|
500
|
+
import {createGeoRegionMapSeries, createKChart} from '@keneth80/k-chart';
|
|
501
|
+
|
|
502
|
+
type Region = {
|
|
503
|
+
name: string;
|
|
504
|
+
value: number;
|
|
505
|
+
color: string;
|
|
506
|
+
};
|
|
507
|
+
|
|
508
|
+
createKChart<Region>({
|
|
509
|
+
selector: '#chart',
|
|
510
|
+
data: [
|
|
511
|
+
{name: '서울특별시', value: 92, color: '#2f73b8'},
|
|
512
|
+
{name: '부산광역시', value: 82, color: '#202b84'}
|
|
513
|
+
],
|
|
514
|
+
axes: [],
|
|
515
|
+
grid: {visible: false},
|
|
516
|
+
legend: {visible: false},
|
|
517
|
+
tooltip: {visible: true},
|
|
518
|
+
series: [
|
|
519
|
+
createGeoRegionMapSeries<Region>({
|
|
520
|
+
selector: 'korea-region',
|
|
521
|
+
geoJson: koreaProvinceGeoJson,
|
|
522
|
+
dataKey: 'name',
|
|
523
|
+
featureKey: 'name',
|
|
524
|
+
labelKey: 'name',
|
|
525
|
+
valueField: 'value',
|
|
526
|
+
colorField: 'color',
|
|
527
|
+
zoom: {
|
|
528
|
+
enabled: true,
|
|
529
|
+
wheel: true,
|
|
530
|
+
pan: true,
|
|
531
|
+
scaleExtent: [1, 7],
|
|
532
|
+
controls: {visible: true}
|
|
533
|
+
},
|
|
534
|
+
labels: {
|
|
535
|
+
visible: true,
|
|
536
|
+
mode: 'centroid',
|
|
537
|
+
formatter: ({label, value}) => `${label} ${value}`
|
|
538
|
+
},
|
|
539
|
+
tooltip: {
|
|
540
|
+
formatter: ({label, value}) => `<strong>${label}</strong><br/>value: ${value}`
|
|
541
|
+
}
|
|
542
|
+
})
|
|
543
|
+
]
|
|
544
|
+
}).render();
|
|
545
|
+
```
|
|
546
|
+
|
|
547
|
+
`zoom`은 지역 지도 전용 확대/이동 옵션입니다. `enabled: true`이면 mouse wheel로 확대/축소하고 drag로 지도를 이동할 수 있습니다. `controls: {visible: true}`를 지정하면 오른쪽 상단에 `+`, 현재 배율, `-` 버튼이 표시됩니다. `scaleExtent`는 최소/최대 배율이며, `wheel`과 `pan`을 각각 꺼서 입력 방식을 제한할 수 있습니다. 지도 라벨은 비교적 좁은 화면에서 `callout` 선이 복잡해질 수 있으므로, 한국 시도 choropleth처럼 경계 내부에 값을 보여줄 때는 `labels.mode: 'centroid'`를 권장합니다.
|
|
548
|
+
|
|
549
|
+
전세계 국가 지도는 `world-atlas` 110m country geometry를 내장한 `createWorldCountryMapSeries()`로 더 짧게 만들 수 있습니다. country 이름은 `world-atlas`의 `properties.name`과 맞춰야 합니다.
|
|
550
|
+
|
|
551
|
+
```ts
|
|
552
|
+
createWorldCountryMapSeries<Country>({
|
|
553
|
+
selector: 'world-country',
|
|
554
|
+
dataKey: 'name',
|
|
555
|
+
valueField: 'visitors',
|
|
556
|
+
colorField: 'color',
|
|
557
|
+
missingFill: 'rgba(142, 160, 173, 0.18)'
|
|
558
|
+
});
|
|
559
|
+
```
|
|
560
|
+
|
|
561
|
+
전체 예제:
|
|
562
|
+
|
|
563
|
+
- [Korea Region Map StackBlitz](https://stackblitz.com/fork/github/keneth80/k-chart/tree/main/examples/stackblitz-korea-region-map-basic?title=KChart%20Korea%20Region%20Map&file=src/main.ts)
|
|
564
|
+
- [World Country Map StackBlitz](https://stackblitz.com/fork/github/keneth80/k-chart/tree/main/examples/stackblitz-world-country-map-basic?title=KChart%20World%20Country%20Map&file=src/main.ts)
|
|
565
|
+
|
|
495
566
|
## Display Options
|
|
496
567
|
|
|
497
568
|
```ts
|
|
@@ -0,0 +1,20 @@
|
|
|
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 Korea Region Map</title>
|
|
7
|
+
</head>
|
|
8
|
+
<body>
|
|
9
|
+
<main>
|
|
10
|
+
<section>
|
|
11
|
+
<div>
|
|
12
|
+
<p>KChart SVG region map</p>
|
|
13
|
+
<h1>Korea region map</h1>
|
|
14
|
+
</div>
|
|
15
|
+
<div id="chart"></div>
|
|
16
|
+
</section>
|
|
17
|
+
</main>
|
|
18
|
+
<script type="module" src="/src/main.ts"></script>
|
|
19
|
+
</body>
|
|
20
|
+
</html>
|