@keneth80/k-chart 1.10.0 → 1.11.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 +17 -0
- package/README.md +4 -0
- package/docs/functional-api.md +61 -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 +90 -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 +50 -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 +324 -0
- package/lib/series/svg-region-map.js.map +1 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.11.0 - 2026-07-02
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- Added `createGeoRegionMapSeries()` for SVG choropleth/region maps backed by user-provided GeoJSON.
|
|
8
|
+
- Added `createWorldCountryMapSeries()` with built-in `world-atlas` country geometry for country-level color maps.
|
|
9
|
+
- Added region map hover highlight, click callbacks, tooltip formatting, centroid labels, and callout labels.
|
|
10
|
+
- Added Korea Region Map and World Country Map StackBlitz examples.
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
|
|
14
|
+
- Documented region map usage and linked the new map examples from README and the functional API guide.
|
|
15
|
+
|
|
16
|
+
### Packages
|
|
17
|
+
|
|
18
|
+
- Published `@keneth80/k-chart@1.11.0`.
|
|
19
|
+
|
|
3
20
|
## 1.10.0 - 2026-07-02
|
|
4
21
|
|
|
5
22
|
### 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>
|
package/docs/functional-api.md
CHANGED
|
@@ -492,6 +492,67 @@ 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
|
+
labels: {
|
|
528
|
+
visible: true,
|
|
529
|
+
mode: 'callout'
|
|
530
|
+
},
|
|
531
|
+
tooltip: {
|
|
532
|
+
formatter: ({label, value}) => `<strong>${label}</strong><br/>value: ${value}`
|
|
533
|
+
}
|
|
534
|
+
})
|
|
535
|
+
]
|
|
536
|
+
}).render();
|
|
537
|
+
```
|
|
538
|
+
|
|
539
|
+
전세계 국가 지도는 `world-atlas` 110m country geometry를 내장한 `createWorldCountryMapSeries()`로 더 짧게 만들 수 있습니다. country 이름은 `world-atlas`의 `properties.name`과 맞춰야 합니다.
|
|
540
|
+
|
|
541
|
+
```ts
|
|
542
|
+
createWorldCountryMapSeries<Country>({
|
|
543
|
+
selector: 'world-country',
|
|
544
|
+
dataKey: 'name',
|
|
545
|
+
valueField: 'visitors',
|
|
546
|
+
colorField: 'color',
|
|
547
|
+
missingFill: 'rgba(142, 160, 173, 0.18)'
|
|
548
|
+
});
|
|
549
|
+
```
|
|
550
|
+
|
|
551
|
+
전체 예제:
|
|
552
|
+
|
|
553
|
+
- [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)
|
|
554
|
+
- [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)
|
|
555
|
+
|
|
495
556
|
## Display Options
|
|
496
557
|
|
|
497
558
|
```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>
|