@keneth80/k-chart 1.11.0 → 1.12.1

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 CHANGED
@@ -1,5 +1,35 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.12.1 - 2026-07-07
4
+
5
+ ### Added
6
+
7
+ - Added TopoJSON `Topology` support to `createGeoRegionMapSeries()` with optional `topoObjectName`.
8
+ - Added real Korea province TopoJSON data to the Korea Region Map StackBlitz example with source license notes.
9
+
10
+ ### Fixed
11
+
12
+ - Replaced the temporary block-shaped Korea map example geometry with real province boundary data.
13
+
14
+ ### Packages
15
+
16
+ - Published `@keneth80/k-chart@1.12.1`.
17
+
18
+ ## 1.12.0 - 2026-07-03
19
+
20
+ ### Added
21
+
22
+ - Added `zoom` support to `createGeoRegionMapSeries()` for wheel zoom, drag pan, and in-chart zoom controls.
23
+
24
+ ### Changed
25
+
26
+ - Updated the Korea Region Map example to use centroid labels and choropleth colors instead of dense callout guide lines.
27
+ - Documented region map zoom options in the functional API guide and configuration reference.
28
+
29
+ ### Packages
30
+
31
+ - Published `@keneth80/k-chart@1.12.0`.
32
+
3
33
  ## 1.11.0 - 2026-07-02
4
34
 
5
35
  ### Added
@@ -257,6 +257,28 @@ 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[] \| Topology` | required | 지도 경계 GeoJSON 또는 TopoJSON입니다. 한국 시도, 세계 국가, 사내 구역처럼 polygon feature를 넣습니다. |
265
+ | `topoObjectName` | `string` | first object | TopoJSON을 넘겼을 때 사용할 object 이름입니다. 생략하면 첫 번째 object를 사용합니다. |
266
+ | `dataKey` | `keyof T & string` | `name` | chart data에서 region key로 사용할 field입니다. |
267
+ | `featureKey` | `string \| (feature) => string` | `name` | GeoJSON feature에서 region key로 사용할 property입니다. |
268
+ | `labelKey` | `string \| (feature) => string` | `featureKey` | label에 사용할 feature property입니다. |
269
+ | `valueField` | `keyof T & string` | - | tooltip/label에 표시할 값 field입니다. |
270
+ | `colorField` | `keyof T & string` | - | data row별 fill color field입니다. |
271
+ | `fitPadding` | `number` | `16` | projection fit 시 plot edge와 지도 사이 여백입니다. |
272
+ | `backgroundFill` | `string` | transparent | 지도 배경색입니다. |
273
+ | `fill` / `missingFill` | `string \| (context) => string` | palette / translucent gray | data가 있는 region과 없는 region의 채움색입니다. |
274
+ | `stroke` / `strokeWidth` | `string \| (context) => string`, `number` | white, `1.2` | region 경계선입니다. |
275
+ | `hoverFill` / `hoverStroke` / `hoverStrokeWidth` | mixed | - | tooltip hit region hover style입니다. |
276
+ | `labels` | `boolean \| KChartGeoRegionMapLabelConfiguration<T>` | disabled | `centroid` 또는 `callout` 라벨을 표시합니다. |
277
+ | `zoom` | `boolean \| KChartGeoRegionMapZoomConfiguration` | disabled | 지도 내부 wheel zoom, drag pan, zoom button control을 켭니다. |
278
+ | `tooltip` | `boolean \| { formatter }` | enabled | region tooltip입니다. |
279
+
280
+ `zoom: {enabled: true, controls: {visible: true}, scaleExtent: [1, 7]}`처럼 지정하면 축이 없는 지도에서도 확대/축소와 drag 이동을 사용할 수 있습니다. `wheel`은 mouse wheel zoom, `pan`은 drag pan 입력을 제어합니다. `labels.mode: 'callout'`은 작은 지도의 라벨 선이 복잡해질 수 있으므로, choropleth 지도에서는 `centroid`와 짧은 label formatter를 우선 권장합니다.
281
+
260
282
  ### SVG Globe: `createSvgGlobeSeries`
261
283
 
262
284
  | Field | Type | Default | Description |
@@ -494,7 +494,7 @@ JSON 데이터를 `fetch()`로 읽고 worker 생성 여부를 화면에서 확
494
494
 
495
495
  ### SVG Region Maps
496
496
 
497
- `createGeoRegionMapSeries()`는 GeoJSON `FeatureCollection`을 받아 각 region을 SVG path로 렌더링합니다. 한국 시도, 세계 국가, 사내 공장 구역처럼 경계 데이터가 있는 지도형 시각화에 사용할 수 있습니다. `dataKey`와 `featureKey`가 같은 값을 가리키면 chart data가 GeoJSON feature에 매핑됩니다.
497
+ `createGeoRegionMapSeries()`는 GeoJSON `FeatureCollection` 또는 TopoJSON `Topology`를 받아 각 region을 SVG path로 렌더링합니다. 한국 시도, 세계 국가, 사내 공장 구역처럼 경계 데이터가 있는 지도형 시각화에 사용할 수 있습니다. `dataKey`와 `featureKey`가 같은 값을 가리키면 chart data가 GeoJSON feature에 매핑됩니다. TopoJSON에 여러 object가 들어 있다면 `topoObjectName`으로 사용할 object 이름을 지정할 수 있고, 생략하면 첫 번째 object를 사용합니다.
498
498
 
499
499
  ```ts
500
500
  import {createGeoRegionMapSeries, createKChart} from '@keneth80/k-chart';
@@ -519,14 +519,23 @@ createKChart<Region>({
519
519
  createGeoRegionMapSeries<Region>({
520
520
  selector: 'korea-region',
521
521
  geoJson: koreaProvinceGeoJson,
522
+ topoObjectName: 'skorea_provinces_2018_geo',
522
523
  dataKey: 'name',
523
524
  featureKey: 'name',
524
525
  labelKey: 'name',
525
526
  valueField: 'value',
526
527
  colorField: 'color',
528
+ zoom: {
529
+ enabled: true,
530
+ wheel: true,
531
+ pan: true,
532
+ scaleExtent: [1, 7],
533
+ controls: {visible: true}
534
+ },
527
535
  labels: {
528
536
  visible: true,
529
- mode: 'callout'
537
+ mode: 'centroid',
538
+ formatter: ({label, value}) => `${label} ${value}`
530
539
  },
531
540
  tooltip: {
532
541
  formatter: ({label, value}) => `<strong>${label}</strong><br/>value: ${value}`
@@ -536,6 +545,8 @@ createKChart<Region>({
536
545
  }).render();
537
546
  ```
538
547
 
548
+ `zoom`은 지역 지도 전용 확대/이동 옵션입니다. `enabled: true`이면 mouse wheel로 확대/축소하고 drag로 지도를 이동할 수 있습니다. `controls: {visible: true}`를 지정하면 오른쪽 상단에 `+`, 현재 배율, `-` 버튼이 표시됩니다. `scaleExtent`는 최소/최대 배율이며, `wheel`과 `pan`을 각각 꺼서 입력 방식을 제한할 수 있습니다. 지도 라벨은 비교적 좁은 화면에서 `callout` 선이 복잡해질 수 있으므로, 한국 시도 choropleth처럼 경계 내부에 값을 보여줄 때는 `labels.mode: 'centroid'`를 권장합니다.
549
+
539
550
  전세계 국가 지도는 `world-atlas` 110m country geometry를 내장한 `createWorldCountryMapSeries()`로 더 짧게 만들 수 있습니다. country 이름은 `world-atlas`의 `properties.name`과 맞춰야 합니다.
540
551
 
541
552
  ```ts
@@ -8,7 +8,7 @@
8
8
  "name": "kchart-korea-region-map-basic",
9
9
  "version": "1.0.0",
10
10
  "dependencies": {
11
- "@keneth80/k-chart": "^1.11.0",
11
+ "@keneth80/k-chart": "^1.12.1",
12
12
  "typescript": "^6.0.3",
13
13
  "vite": "^7.1.12"
14
14
  },
@@ -9,7 +9,7 @@
9
9
  "preview": "vite preview --host 0.0.0.0"
10
10
  },
11
11
  "dependencies": {
12
- "@keneth80/k-chart": "^1.11.0",
12
+ "@keneth80/k-chart": "^1.12.1",
13
13
  "typescript": "^6.0.3",
14
14
  "vite": "^7.1.12"
15
15
  },
@@ -0,0 +1,11 @@
1
+ Korea province map data source
2
+
3
+ The original map data in this directory was collected from Statistics Korea SGIS
4
+ (https://sgis.kostat.go.kr/) and is provided under the Korea Open Government
5
+ License Type 1.
6
+
7
+ Source mirror used for this example:
8
+ https://github.com/southkorea/southkorea-maps
9
+
10
+ License information:
11
+ http://www.kogl.or.kr/info/license.do