@keneth80/k-chart 1.12.2 → 1.14.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 +29 -0
- package/docs/configuration-reference.md +53 -0
- package/docs/functional-api.md +87 -0
- package/examples/stackblitz-korea-region-map-basic/package-lock.json +1 -1
- package/examples/stackblitz-korea-region-map-basic/package.json +1 -1
- package/examples/stackblitz-world-country-map-basic/package-lock.json +1 -1
- package/examples/stackblitz-world-country-map-basic/package.json +1 -1
- package/examples/stackblitz-world-photo-marker-map/index.html +20 -0
- package/examples/stackblitz-world-photo-marker-map/package.json +17 -0
- package/examples/stackblitz-world-photo-marker-map/src/main.ts +183 -0
- package/examples/stackblitz-world-photo-marker-map/src/style.css +57 -0
- package/lib/core/contracts.d.ts +100 -0
- package/lib/core/contracts.d.ts.map +1 -1
- package/lib/series/index.d.ts +3 -0
- package/lib/series/index.d.ts.map +1 -1
- package/lib/series/index.js +3 -0
- package/lib/series/index.js.map +1 -1
- package/lib/series/svg-area.d.ts +3 -0
- package/lib/series/svg-area.d.ts.map +1 -0
- package/lib/series/svg-area.js +77 -0
- package/lib/series/svg-area.js.map +1 -0
- package/lib/series/svg-bar.d.ts +4 -0
- package/lib/series/svg-bar.d.ts.map +1 -0
- package/lib/series/svg-bar.js +244 -0
- package/lib/series/svg-bar.js.map +1 -0
- package/lib/series/svg-region-map.d.ts.map +1 -1
- package/lib/series/svg-region-map.js +152 -3
- package/lib/series/svg-region-map.js.map +1 -1
- package/lib/series/svg-scatter.d.ts +4 -0
- package/lib/series/svg-scatter.d.ts.map +1 -0
- package/lib/series/svg-scatter.js +122 -0
- package/lib/series/svg-scatter.js.map +1 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,34 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.14.0 - 2026-07-08
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- Added `createAreaSeries()` for SVG area charts.
|
|
8
|
+
- Added `createBarSeries()` for horizontal bar charts.
|
|
9
|
+
- Added `createGroupedColumnSeries()` for side-by-side grouped columns.
|
|
10
|
+
- Added `createScatterSeries()` and `createBubbleSeries()` for correlation and size-encoded point charts.
|
|
11
|
+
|
|
12
|
+
### Packages
|
|
13
|
+
|
|
14
|
+
- Published `@keneth80/k-chart@1.14.0`.
|
|
15
|
+
|
|
16
|
+
## 1.13.0 - 2026-07-07
|
|
17
|
+
|
|
18
|
+
### Added
|
|
19
|
+
|
|
20
|
+
- Added coordinate-based `bubbles` and `markers` to SVG region maps and world country maps.
|
|
21
|
+
- Added circular image markers, marker labels, pin tails, and marker click callbacks for map-style branch/location visualizations.
|
|
22
|
+
- Added a World Photo Marker Map StackBlitz example.
|
|
23
|
+
|
|
24
|
+
### Changed
|
|
25
|
+
|
|
26
|
+
- Updated map StackBlitz examples to depend on `@keneth80/k-chart@^1.13.0`.
|
|
27
|
+
|
|
28
|
+
### Packages
|
|
29
|
+
|
|
30
|
+
- Published `@keneth80/k-chart@1.13.0`.
|
|
31
|
+
|
|
3
32
|
## 1.12.2 - 2026-07-07
|
|
4
33
|
|
|
5
34
|
### Changed
|
|
@@ -188,6 +188,55 @@ createKChart({
|
|
|
188
188
|
| `dot` | `boolean \| { radius; fill; stroke }` | `false` | 각 point에 SVG circle을 표시합니다. |
|
|
189
189
|
| `downsample` | `boolean \| object` | disabled | LTTB를 적용합니다. |
|
|
190
190
|
|
|
191
|
+
### SVG Area: `createAreaSeries`
|
|
192
|
+
|
|
193
|
+
| Field | Type | Default | Description |
|
|
194
|
+
| --- | --- | --- | --- |
|
|
195
|
+
| `selector` | `string` | required | series id/class입니다. |
|
|
196
|
+
| `xField` / `yField` | `keyof T & string` | required | area 좌표 field입니다. |
|
|
197
|
+
| `baseline` | `number` | `0` | area가 닫히는 기준 y 값입니다. |
|
|
198
|
+
| `fill` / `fillOpacity` | `string`, `number` | chart color, `0.26` | area fill 스타일입니다. |
|
|
199
|
+
| `stroke` / `strokeWidth` | `string`, `number` | chart color, `2` | area 상단 라인 스타일입니다. |
|
|
200
|
+
| `curve` | `boolean` | `false` | `true`이면 `curveMonotoneX`를 사용합니다. |
|
|
201
|
+
| `downsample` | `boolean \| object` | disabled | LTTB를 적용합니다. |
|
|
202
|
+
|
|
203
|
+
### SVG Horizontal Bar: `createBarSeries`
|
|
204
|
+
|
|
205
|
+
| Field | Type | Default | Description |
|
|
206
|
+
| --- | --- | --- | --- |
|
|
207
|
+
| `selector` | `string` | required | series id/class입니다. |
|
|
208
|
+
| `xField` | `keyof T & string` | required | bar 길이로 사용할 numeric field입니다. |
|
|
209
|
+
| `yField` | `keyof T & string` | required | category 위치 field입니다. |
|
|
210
|
+
| `fill` / `color` | `string \| (point, index) => string` | chart color | bar fill 색상입니다. |
|
|
211
|
+
| `barHeight` | `number` | auto | bar 높이입니다. `minBarHeight`, `maxBarHeight`로 제한할 수 있습니다. |
|
|
212
|
+
| `radius` | `number` | `5` | bar corner radius입니다. |
|
|
213
|
+
| `baseline` | `number` | `0` | bar 시작 기준 x 값입니다. |
|
|
214
|
+
|
|
215
|
+
### SVG Grouped Column: `createGroupedColumnSeries`
|
|
216
|
+
|
|
217
|
+
| Field | Type | Default | Description |
|
|
218
|
+
| --- | --- | --- | --- |
|
|
219
|
+
| `selector` | `string` | required | series id/class입니다. |
|
|
220
|
+
| `xField` | `keyof T & string` | required | group category field입니다. |
|
|
221
|
+
| `segments` | `{ field; label?; color? }[]` | required | group 안에 나란히 그릴 numeric fields입니다. |
|
|
222
|
+
| `groupWidthRatio` | `number` | `0.72` | category band 중 column group이 차지하는 비율입니다. |
|
|
223
|
+
| `gap` | `number` | `4` | segment 사이 간격입니다. |
|
|
224
|
+
| `radius` | `number` | `4` | column corner radius입니다. |
|
|
225
|
+
| `baseline` | `number` | `0` | column 시작 기준 y 값입니다. |
|
|
226
|
+
|
|
227
|
+
### SVG Scatter / Bubble: `createScatterSeries`, `createBubbleSeries`
|
|
228
|
+
|
|
229
|
+
| Field | Type | Default | Description |
|
|
230
|
+
| --- | --- | --- | --- |
|
|
231
|
+
| `selector` | `string` | required | series id/class입니다. |
|
|
232
|
+
| `xField` / `yField` | `keyof T & string` | required | point 좌표 field입니다. |
|
|
233
|
+
| `radius` | `number \| (point, index) => number` | `5` | scatter point 반지름입니다. |
|
|
234
|
+
| `radiusField` | `keyof T & string` | - | bubble 크기 매핑 field입니다. |
|
|
235
|
+
| `minRadius` / `maxRadius` | `number` | `4`, `18` | bubble radius 범위입니다. |
|
|
236
|
+
| `fill` / `color` | `string \| (point, index) => string` | chart color | point fill 색상입니다. |
|
|
237
|
+
| `stroke` / `strokeWidth` | `string`, `number` | light stroke, `1.4` | point stroke 스타일입니다. |
|
|
238
|
+
| `opacity` | `number` | scatter `0.9`, bubble `0.55` | point fill opacity입니다. |
|
|
239
|
+
|
|
191
240
|
### Canvas Line: `createCanvasLineSeries`
|
|
192
241
|
|
|
193
242
|
| Field | Type | Default | Description |
|
|
@@ -275,10 +324,14 @@ WebGL point는 현재 interleaved buffer `[x, y, size]` 구조로 GPU에 전달
|
|
|
275
324
|
| `hoverFill` / `hoverStroke` / `hoverStrokeWidth` | mixed | - | tooltip hit region hover style입니다. |
|
|
276
325
|
| `labels` | `boolean \| KChartGeoRegionMapLabelConfiguration<T>` | disabled | `centroid` 또는 `callout` 라벨을 표시합니다. |
|
|
277
326
|
| `zoom` | `boolean \| KChartGeoRegionMapZoomConfiguration` | disabled | 지도 내부 wheel zoom, drag pan, zoom button control을 켭니다. |
|
|
327
|
+
| `bubbles` | `KChartGeoRegionMapBubble[]` | `[]` | 위도/경도 기반 원형 bubble marker입니다. `value` 또는 `radius`로 크기를 조절합니다. |
|
|
328
|
+
| `markers` | `KChartGeoRegionMapMarker[]` | `[]` | 위도/경도 기반 사진/라벨/pin marker입니다. `imageUrl`, `labelPosition`, `onClick`을 지원합니다. |
|
|
278
329
|
| `tooltip` | `boolean \| { formatter }` | enabled | region tooltip입니다. |
|
|
279
330
|
|
|
280
331
|
`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
332
|
|
|
333
|
+
`bubbles`와 `markers`의 좌표는 일반적인 위도/경도입니다. 내부에서는 `projection([lon, lat])` 순서로 변환하므로 옵션에는 `{lat, lon}`으로 전달하면 됩니다. `markers[].imageUrl`은 원형 `clipPath`로 렌더링되며, `markers[].onClick`은 marker 데이터와 SVG 좌표를 함께 전달합니다.
|
|
334
|
+
|
|
282
335
|
### SVG Globe: `createSvgGlobeSeries`
|
|
283
336
|
|
|
284
337
|
| Field | Type | Default | Description |
|
package/docs/functional-api.md
CHANGED
|
@@ -183,6 +183,56 @@ const chart = createKChart<TrafficPoint>({
|
|
|
183
183
|
chart.render();
|
|
184
184
|
```
|
|
185
185
|
|
|
186
|
+
## Built-In SVG BI Series
|
|
187
|
+
|
|
188
|
+
일반 BI 화면에서 자주 쓰는 면적, 가로 막대, 그룹 막대, 산점도, 버블 차트는 SVG factory로 제공합니다.
|
|
189
|
+
|
|
190
|
+
```ts
|
|
191
|
+
createAreaSeries<Point>({
|
|
192
|
+
selector: 'area',
|
|
193
|
+
xField: 'month',
|
|
194
|
+
yField: 'traffic',
|
|
195
|
+
curve: true,
|
|
196
|
+
fill: '#5db8ff',
|
|
197
|
+
stroke: '#5db8ff'
|
|
198
|
+
});
|
|
199
|
+
|
|
200
|
+
createBarSeries<CategoryPoint>({
|
|
201
|
+
selector: 'ranking',
|
|
202
|
+
yField: 'name',
|
|
203
|
+
xField: 'score',
|
|
204
|
+
color: '#56d08f'
|
|
205
|
+
});
|
|
206
|
+
|
|
207
|
+
createGroupedColumnSeries<SalesPoint>({
|
|
208
|
+
selector: 'grouped-sales',
|
|
209
|
+
xField: 'month',
|
|
210
|
+
segments: [
|
|
211
|
+
{field: 'online', label: 'Online', color: '#5db8ff'},
|
|
212
|
+
{field: 'store', label: 'Store', color: '#56d08f'}
|
|
213
|
+
]
|
|
214
|
+
});
|
|
215
|
+
|
|
216
|
+
createScatterSeries<Point>({
|
|
217
|
+
selector: 'scatter',
|
|
218
|
+
xField: 'temperature',
|
|
219
|
+
yField: 'sales',
|
|
220
|
+
color: '#f3b45b'
|
|
221
|
+
});
|
|
222
|
+
|
|
223
|
+
createBubbleSeries<Point>({
|
|
224
|
+
selector: 'bubble',
|
|
225
|
+
xField: 'growth',
|
|
226
|
+
yField: 'margin',
|
|
227
|
+
radiusField: 'revenue',
|
|
228
|
+
minRadius: 5,
|
|
229
|
+
maxRadius: 22,
|
|
230
|
+
color: '#d876ff'
|
|
231
|
+
});
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
`createBarSeries()`는 horizontal bar 전용이므로 x축은 숫자, y축은 문자열/point/category 축을 사용합니다. `createGroupedColumnSeries()`는 같은 x 값 안에 여러 segment를 나란히 배치합니다. `createBubbleSeries()`는 `radiusField` 값의 최소/최대 범위를 `minRadius`와 `maxRadius`로 선형 매핑합니다.
|
|
235
|
+
|
|
186
236
|
## Built-In Canvas Series
|
|
187
237
|
|
|
188
238
|
Canvas 2D line/point renderer는 별도 class 없이 factory로 생성합니다.
|
|
@@ -559,10 +609,47 @@ createWorldCountryMapSeries<Country>({
|
|
|
559
609
|
});
|
|
560
610
|
```
|
|
561
611
|
|
|
612
|
+
지도 위에 좌표 기반 강조 요소가 필요하면 `bubbles`와 `markers`를 함께 사용할 수 있습니다. 둘 다 일반적인 위도/경도 값을 사용하며 내부에서 `projection([lon, lat])`로 화면 좌표를 계산합니다. `bubbles`는 지도 위 원형 분포/규모 표현에 적합하고, `markers`는 사진 썸네일, 라벨, 핀 형태의 지점 표시를 제공합니다. `imageUrl`에는 일반 이미지 URL이나 `data:image/...` URI를 넣을 수 있습니다. 마커별 `onClick`을 지정하면 원본 marker, 화면 좌표, mouse event를 받아 팝업이나 상세 이동을 연결할 수 있습니다.
|
|
613
|
+
|
|
614
|
+
```ts
|
|
615
|
+
createWorldCountryMapSeries<Country>({
|
|
616
|
+
selector: 'world-branches',
|
|
617
|
+
dataKey: 'name',
|
|
618
|
+
colorField: 'color',
|
|
619
|
+
backgroundFill: '#1f7daf',
|
|
620
|
+
fill: '#f8fbff',
|
|
621
|
+
missingFill: '#f8fbff',
|
|
622
|
+
zoom: {
|
|
623
|
+
enabled: true,
|
|
624
|
+
wheel: true,
|
|
625
|
+
pan: true,
|
|
626
|
+
controls: {visible: true}
|
|
627
|
+
},
|
|
628
|
+
bubbles: [
|
|
629
|
+
{id: 'seoul-bubble', lat: 37.5665, lon: 126.978, value: 56, color: '#ffd45a'},
|
|
630
|
+
{id: 'us-bubble', lat: 39.8, lon: -98.5, value: 82, color: '#ff5a36'}
|
|
631
|
+
],
|
|
632
|
+
markers: [
|
|
633
|
+
{
|
|
634
|
+
id: 'netherlands',
|
|
635
|
+
label: '네덜란드교회',
|
|
636
|
+
lat: 52.3676,
|
|
637
|
+
lon: 4.9041,
|
|
638
|
+
color: '#4ecfb0',
|
|
639
|
+
size: 66,
|
|
640
|
+
imageUrl: '/images/church/netherlands.jpg',
|
|
641
|
+
labelPosition: 'top',
|
|
642
|
+
onClick: ({marker}) => console.log(marker.id)
|
|
643
|
+
}
|
|
644
|
+
]
|
|
645
|
+
});
|
|
646
|
+
```
|
|
647
|
+
|
|
562
648
|
전체 예제:
|
|
563
649
|
|
|
564
650
|
- [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)
|
|
565
651
|
- [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)
|
|
652
|
+
- [World Photo Marker Map StackBlitz](https://stackblitz.com/fork/github/keneth80/k-chart/tree/main/examples/stackblitz-world-photo-marker-map?title=KChart%20World%20Photo%20Marker%20Map&file=src/main.ts)
|
|
566
653
|
|
|
567
654
|
## Display Options
|
|
568
655
|
|
|
@@ -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 World Photo Marker Map</title>
|
|
7
|
+
</head>
|
|
8
|
+
<body>
|
|
9
|
+
<main>
|
|
10
|
+
<section>
|
|
11
|
+
<div>
|
|
12
|
+
<p>KChart SVG map markers</p>
|
|
13
|
+
<h1>World photo marker 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>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "kchart-world-photo-marker-map",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"dev": "vite --host 0.0.0.0",
|
|
8
|
+
"build": "vite build",
|
|
9
|
+
"preview": "vite preview --host 0.0.0.0"
|
|
10
|
+
},
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"@keneth80/k-chart": "^1.13.0",
|
|
13
|
+
"typescript": "^6.0.3",
|
|
14
|
+
"vite": "^7.1.12"
|
|
15
|
+
},
|
|
16
|
+
"devDependencies": {}
|
|
17
|
+
}
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import { createKChart, createWorldCountryMapSeries } from "@keneth80/k-chart";
|
|
2
|
+
import "./style.css";
|
|
3
|
+
|
|
4
|
+
type CountryDatum = {
|
|
5
|
+
name: string;
|
|
6
|
+
color: string;
|
|
7
|
+
score: number;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
const countries: CountryDatum[] = [
|
|
11
|
+
{ name: "South Korea", color: "#ffd45a", score: 100 },
|
|
12
|
+
{ name: "Japan", color: "#6ee7b7", score: 86 },
|
|
13
|
+
{ name: "Philippines", color: "#18764b", score: 74 },
|
|
14
|
+
{ name: "Australia", color: "#48bfe3", score: 68 },
|
|
15
|
+
{ name: "United States of America", color: "#ff5a36", score: 92 },
|
|
16
|
+
{ name: "Canada", color: "#ff5a36", score: 66 },
|
|
17
|
+
{ name: "Colombia", color: "#48bfe3", score: 56 },
|
|
18
|
+
{ name: "United Kingdom", color: "#df185c", score: 82 },
|
|
19
|
+
{ name: "Netherlands", color: "#4ecfb0", score: 73 },
|
|
20
|
+
{ name: "Germany", color: "#57c7d4", score: 78 },
|
|
21
|
+
{ name: "South Africa", color: "#df185c", score: 63 }
|
|
22
|
+
];
|
|
23
|
+
|
|
24
|
+
const makePhoto = (label: string, color: string): string => {
|
|
25
|
+
const svg = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 120 120">
|
|
26
|
+
<defs>
|
|
27
|
+
<linearGradient id="sky" x1="0" x2="1" y1="0" y2="1">
|
|
28
|
+
<stop stop-color="#eff6ff"/>
|
|
29
|
+
<stop offset="1" stop-color="${color}"/>
|
|
30
|
+
</linearGradient>
|
|
31
|
+
</defs>
|
|
32
|
+
<rect width="120" height="120" fill="url(#sky)"/>
|
|
33
|
+
<rect x="20" y="42" width="80" height="52" rx="4" fill="#f8fafc" opacity=".92"/>
|
|
34
|
+
<rect x="30" y="54" width="16" height="18" fill="${color}" opacity=".82"/>
|
|
35
|
+
<rect x="52" y="54" width="16" height="18" fill="${color}" opacity=".65"/>
|
|
36
|
+
<rect x="74" y="54" width="16" height="18" fill="${color}" opacity=".82"/>
|
|
37
|
+
<rect x="48" y="78" width="24" height="16" fill="#334155" opacity=".85"/>
|
|
38
|
+
<text x="60" y="24" text-anchor="middle" font-family="Arial" font-size="11" font-weight="700" fill="#0f172a">${label}</text>
|
|
39
|
+
</svg>`;
|
|
40
|
+
return `data:image/svg+xml;charset=utf-8,${encodeURIComponent(svg)}`;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
createKChart<CountryDatum>({
|
|
44
|
+
selector: "#chart",
|
|
45
|
+
data: countries,
|
|
46
|
+
width: 1180,
|
|
47
|
+
height: 640,
|
|
48
|
+
margin: { top: 56, right: 24, bottom: 24, left: 24 },
|
|
49
|
+
title: { text: "Global branches with photo markers", align: "left", fontSize: 15 },
|
|
50
|
+
grid: { visible: false },
|
|
51
|
+
legend: { visible: false },
|
|
52
|
+
tooltip: { visible: true },
|
|
53
|
+
axes: [],
|
|
54
|
+
series: [
|
|
55
|
+
createWorldCountryMapSeries<CountryDatum>({
|
|
56
|
+
selector: "world-photo-map",
|
|
57
|
+
displayName: "Branches",
|
|
58
|
+
dataKey: "name",
|
|
59
|
+
valueField: "score",
|
|
60
|
+
colorField: "color",
|
|
61
|
+
fitPadding: 8,
|
|
62
|
+
backgroundFill: "#1f7daf",
|
|
63
|
+
fill: "#f8fbff",
|
|
64
|
+
missingFill: "#f8fbff",
|
|
65
|
+
stroke: "rgba(255, 255, 255, 0.85)",
|
|
66
|
+
strokeWidth: 0.55,
|
|
67
|
+
hoverStroke: "#ffffff",
|
|
68
|
+
hoverStrokeWidth: 1.5,
|
|
69
|
+
zoom: {
|
|
70
|
+
enabled: true,
|
|
71
|
+
wheel: true,
|
|
72
|
+
pan: true,
|
|
73
|
+
scaleExtent: [1, 6],
|
|
74
|
+
controls: { visible: true, x: 10, y: 10, step: 0.3 }
|
|
75
|
+
},
|
|
76
|
+
bubbles: [
|
|
77
|
+
{ id: "kr", lat: 37.56, lon: 126.97, value: 56, color: "#ffd45a", opacity: 0.9 },
|
|
78
|
+
{ id: "ph", lat: 14.6, lon: 121.0, value: 46, color: "#18764b", opacity: 0.86 },
|
|
79
|
+
{ id: "us", lat: 39.8, lon: -98.5, value: 82, color: "#ff5a36", opacity: 0.82 },
|
|
80
|
+
{ id: "za", lat: -30.5, lon: 22.9, value: 72, color: "#df185c", opacity: 0.86 },
|
|
81
|
+
{ id: "au", lat: -25.2, lon: 133.7, value: 70, color: "#48bfe3", opacity: 0.86 },
|
|
82
|
+
{ id: "co", lat: 4.57, lon: -74.3, value: 52, color: "#48bfe3", opacity: 0.86 }
|
|
83
|
+
],
|
|
84
|
+
markers: [
|
|
85
|
+
{
|
|
86
|
+
id: "netherlands",
|
|
87
|
+
label: "네덜란드교회",
|
|
88
|
+
lat: 52.37,
|
|
89
|
+
lon: 4.9,
|
|
90
|
+
color: "#4ecfb0",
|
|
91
|
+
size: 66,
|
|
92
|
+
imageUrl: makePhoto("NL", "#4ecfb0"),
|
|
93
|
+
labelPosition: "top"
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
id: "germany",
|
|
97
|
+
label: "중부독일교회",
|
|
98
|
+
lat: 50.11,
|
|
99
|
+
lon: 8.68,
|
|
100
|
+
color: "#57c7d4",
|
|
101
|
+
size: 62,
|
|
102
|
+
imageUrl: makePhoto("DE", "#57c7d4"),
|
|
103
|
+
labelPosition: "right"
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
id: "uk",
|
|
107
|
+
label: "영국교회",
|
|
108
|
+
lat: 51.5,
|
|
109
|
+
lon: -0.12,
|
|
110
|
+
color: "#df185c",
|
|
111
|
+
size: 58,
|
|
112
|
+
imageUrl: makePhoto("UK", "#df185c"),
|
|
113
|
+
labelPosition: "left"
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
id: "philippines",
|
|
117
|
+
label: "필리핀교회",
|
|
118
|
+
lat: 14.6,
|
|
119
|
+
lon: 121.0,
|
|
120
|
+
color: "#18764b",
|
|
121
|
+
size: 60,
|
|
122
|
+
imageUrl: makePhoto("PH", "#18764b"),
|
|
123
|
+
labelPosition: "right"
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
id: "australia",
|
|
127
|
+
label: "호주교회",
|
|
128
|
+
lat: -33.86,
|
|
129
|
+
lon: 151.2,
|
|
130
|
+
color: "#48bfe3",
|
|
131
|
+
size: 62,
|
|
132
|
+
imageUrl: makePhoto("AU", "#48bfe3"),
|
|
133
|
+
labelPosition: "bottom"
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
id: "chicago",
|
|
137
|
+
label: "시카고교회",
|
|
138
|
+
lat: 41.88,
|
|
139
|
+
lon: -87.63,
|
|
140
|
+
color: "#ff5a36",
|
|
141
|
+
size: 62,
|
|
142
|
+
imageUrl: makePhoto("US", "#ff5a36"),
|
|
143
|
+
labelPosition: "top"
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
id: "new-york",
|
|
147
|
+
label: "뉴욕교회",
|
|
148
|
+
lat: 40.71,
|
|
149
|
+
lon: -74.0,
|
|
150
|
+
color: "#ff5a36",
|
|
151
|
+
size: 62,
|
|
152
|
+
imageUrl: makePhoto("NY", "#ff5a36"),
|
|
153
|
+
labelPosition: "right"
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
id: "colombia",
|
|
157
|
+
label: "콜롬비아교회",
|
|
158
|
+
lat: 4.71,
|
|
159
|
+
lon: -74.07,
|
|
160
|
+
color: "#48bfe3",
|
|
161
|
+
size: 62,
|
|
162
|
+
imageUrl: makePhoto("CO", "#48bfe3"),
|
|
163
|
+
labelPosition: "bottom"
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
id: "cape-town",
|
|
167
|
+
label: "케이프타운교회",
|
|
168
|
+
lat: -33.92,
|
|
169
|
+
lon: 18.42,
|
|
170
|
+
color: "#df185c",
|
|
171
|
+
size: 64,
|
|
172
|
+
imageUrl: makePhoto("ZA", "#df185c"),
|
|
173
|
+
labelPosition: "bottom"
|
|
174
|
+
}
|
|
175
|
+
],
|
|
176
|
+
tooltip: {
|
|
177
|
+
formatter: ({ label, data }) => data
|
|
178
|
+
? `<strong>${label}</strong><br/>score: ${data.score}`
|
|
179
|
+
: `<strong>${label}</strong><br/>No data`
|
|
180
|
+
}
|
|
181
|
+
})
|
|
182
|
+
]
|
|
183
|
+
}).render();
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
color-scheme: dark;
|
|
3
|
+
font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
|
|
4
|
+
background: #0b1017;
|
|
5
|
+
color: #edf3f8;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
* {
|
|
9
|
+
box-sizing: border-box;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
body {
|
|
13
|
+
margin: 0;
|
|
14
|
+
min-height: 100vh;
|
|
15
|
+
background:
|
|
16
|
+
radial-gradient(circle at 72% 18%, rgba(93, 184, 255, 0.18), transparent 30%),
|
|
17
|
+
linear-gradient(180deg, #162331 0%, #0b1017 72%);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
main {
|
|
21
|
+
min-height: 100vh;
|
|
22
|
+
display: grid;
|
|
23
|
+
place-items: center;
|
|
24
|
+
padding: 28px;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
section {
|
|
28
|
+
width: min(1240px, 100%);
|
|
29
|
+
border: 1px solid rgba(219, 232, 242, 0.16);
|
|
30
|
+
border-radius: 12px;
|
|
31
|
+
background: rgba(21, 28, 38, 0.82);
|
|
32
|
+
box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
|
|
33
|
+
overflow: hidden;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
section > div:first-child {
|
|
37
|
+
padding: 24px 28px 0;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
p {
|
|
41
|
+
margin: 0 0 8px;
|
|
42
|
+
color: #8ea0ad;
|
|
43
|
+
font-size: 12px;
|
|
44
|
+
font-weight: 800;
|
|
45
|
+
text-transform: uppercase;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
h1 {
|
|
49
|
+
margin: 0;
|
|
50
|
+
font-size: 26px;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
#chart {
|
|
54
|
+
width: 100%;
|
|
55
|
+
min-height: 650px;
|
|
56
|
+
padding: 10px 16px 22px;
|
|
57
|
+
}
|
package/lib/core/contracts.d.ts
CHANGED
|
@@ -139,6 +139,67 @@ export interface KChartLineSeriesConfiguration<T = any> {
|
|
|
139
139
|
};
|
|
140
140
|
downsample?: boolean | KChartDownsampleConfiguration<T>;
|
|
141
141
|
}
|
|
142
|
+
export interface KChartAreaSeriesConfiguration<T = any> {
|
|
143
|
+
selector: string;
|
|
144
|
+
displayName?: string;
|
|
145
|
+
xField: keyof T & string;
|
|
146
|
+
yField: keyof T & string;
|
|
147
|
+
baseline?: number;
|
|
148
|
+
color?: string;
|
|
149
|
+
fill?: string;
|
|
150
|
+
fillOpacity?: number;
|
|
151
|
+
stroke?: string;
|
|
152
|
+
strokeWidth?: number;
|
|
153
|
+
curve?: boolean;
|
|
154
|
+
downsample?: boolean | KChartDownsampleConfiguration<T>;
|
|
155
|
+
}
|
|
156
|
+
export interface KChartBarSeriesConfiguration<T = any> {
|
|
157
|
+
selector: string;
|
|
158
|
+
displayName?: string;
|
|
159
|
+
xField: keyof T & string;
|
|
160
|
+
yField: keyof T & string;
|
|
161
|
+
color?: string;
|
|
162
|
+
fill?: string | ((point: T, index: number) => string);
|
|
163
|
+
opacity?: number;
|
|
164
|
+
barHeight?: number;
|
|
165
|
+
minBarHeight?: number;
|
|
166
|
+
maxBarHeight?: number;
|
|
167
|
+
radius?: number;
|
|
168
|
+
baseline?: number;
|
|
169
|
+
}
|
|
170
|
+
export interface KChartGroupedColumnSegment<T = any> {
|
|
171
|
+
field: keyof T & string;
|
|
172
|
+
label?: string;
|
|
173
|
+
color?: string;
|
|
174
|
+
}
|
|
175
|
+
export interface KChartGroupedColumnSeriesConfiguration<T = any> {
|
|
176
|
+
selector: string;
|
|
177
|
+
displayName?: string;
|
|
178
|
+
xField: keyof T & string;
|
|
179
|
+
segments: Array<KChartGroupedColumnSegment<T>>;
|
|
180
|
+
opacity?: number;
|
|
181
|
+
groupWidthRatio?: number;
|
|
182
|
+
gap?: number;
|
|
183
|
+
radius?: number;
|
|
184
|
+
baseline?: number;
|
|
185
|
+
}
|
|
186
|
+
export interface KChartScatterSeriesConfiguration<T = any> {
|
|
187
|
+
selector: string;
|
|
188
|
+
displayName?: string;
|
|
189
|
+
xField: keyof T & string;
|
|
190
|
+
yField: keyof T & string;
|
|
191
|
+
color?: string;
|
|
192
|
+
radius?: number | ((point: T, index: number) => number);
|
|
193
|
+
fill?: string | ((point: T, index: number) => string);
|
|
194
|
+
stroke?: string;
|
|
195
|
+
strokeWidth?: number;
|
|
196
|
+
opacity?: number;
|
|
197
|
+
}
|
|
198
|
+
export interface KChartBubbleSeriesConfiguration<T = any> extends KChartScatterSeriesConfiguration<T> {
|
|
199
|
+
radiusField?: keyof T & string;
|
|
200
|
+
minRadius?: number;
|
|
201
|
+
maxRadius?: number;
|
|
202
|
+
}
|
|
142
203
|
export interface KChartCanvasLineSeriesConfiguration<T = any> {
|
|
143
204
|
selector: string;
|
|
144
205
|
displayName?: string;
|
|
@@ -314,6 +375,43 @@ export interface KChartGeoRegionMapZoomConfiguration {
|
|
|
314
375
|
controls?: boolean | KChartGeoRegionMapZoomControlsConfiguration;
|
|
315
376
|
scaleExtent?: [number, number];
|
|
316
377
|
}
|
|
378
|
+
export interface KChartGeoRegionMapMarkerClickContext {
|
|
379
|
+
marker: KChartGeoRegionMapMarker;
|
|
380
|
+
event: MouseEvent;
|
|
381
|
+
x: number;
|
|
382
|
+
y: number;
|
|
383
|
+
}
|
|
384
|
+
export interface KChartGeoRegionMapMarker {
|
|
385
|
+
id: string;
|
|
386
|
+
lat: number;
|
|
387
|
+
lon: number;
|
|
388
|
+
label?: string;
|
|
389
|
+
size?: number;
|
|
390
|
+
color?: string;
|
|
391
|
+
imageUrl?: string;
|
|
392
|
+
imagePadding?: number;
|
|
393
|
+
stroke?: string;
|
|
394
|
+
strokeWidth?: number;
|
|
395
|
+
labelPosition?: 'top' | 'right' | 'bottom' | 'left';
|
|
396
|
+
labelFill?: string;
|
|
397
|
+
labelTextFill?: string;
|
|
398
|
+
labelFontSize?: number;
|
|
399
|
+
labelFontWeight?: number | string;
|
|
400
|
+
labelOffset?: number;
|
|
401
|
+
pin?: boolean;
|
|
402
|
+
onClick?: (context: KChartGeoRegionMapMarkerClickContext) => void;
|
|
403
|
+
}
|
|
404
|
+
export interface KChartGeoRegionMapBubble {
|
|
405
|
+
id: string;
|
|
406
|
+
lat: number;
|
|
407
|
+
lon: number;
|
|
408
|
+
value?: number;
|
|
409
|
+
radius?: number;
|
|
410
|
+
color?: string;
|
|
411
|
+
opacity?: number;
|
|
412
|
+
stroke?: string;
|
|
413
|
+
strokeWidth?: number;
|
|
414
|
+
}
|
|
317
415
|
export interface KChartGeoRegionMapSeriesConfiguration<T = any> {
|
|
318
416
|
selector: string;
|
|
319
417
|
displayName?: string;
|
|
@@ -336,6 +434,8 @@ export interface KChartGeoRegionMapSeriesConfiguration<T = any> {
|
|
|
336
434
|
hoverStrokeWidth?: number;
|
|
337
435
|
zoom?: boolean | KChartGeoRegionMapZoomConfiguration;
|
|
338
436
|
labels?: boolean | KChartGeoRegionMapLabelConfiguration<T>;
|
|
437
|
+
bubbles?: KChartGeoRegionMapBubble[];
|
|
438
|
+
markers?: KChartGeoRegionMapMarker[];
|
|
339
439
|
tooltip?: boolean | {
|
|
340
440
|
formatter?: (context: KChartGeoRegionMapContext<T>) => string;
|
|
341
441
|
};
|