@keneth80/k-chart 1.24.1 → 1.26.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 (33) hide show
  1. package/CHANGELOG.md +56 -0
  2. package/README.md +33 -2
  3. package/docs/ai/agent-usage.md +8 -3
  4. package/docs/configuration-reference.md +13 -6
  5. package/docs/functional-api.md +72 -1
  6. package/examples/stackblitz-doughnut-scroll-legend/index.html +46 -0
  7. package/examples/stackblitz-doughnut-scroll-legend/package.json +18 -0
  8. package/examples/stackblitz-doughnut-scroll-legend/src/main.ts +96 -0
  9. package/examples/stackblitz-doughnut-scroll-legend/src/style.css +267 -0
  10. package/examples/stackblitz-doughnut-scroll-legend/src/vite-env.d.ts +1 -0
  11. package/examples/stackblitz-world-activity-map/index.html +23 -0
  12. package/examples/stackblitz-world-activity-map/package.json +16 -0
  13. package/examples/stackblitz-world-activity-map/src/main.ts +77 -0
  14. package/examples/stackblitz-world-activity-map/src/style.css +78 -0
  15. package/examples/stackblitz-world-activity-map/src/vite-env.d.ts +1 -0
  16. package/examples/stackblitz-world-cluster-map/index.html +19 -0
  17. package/examples/stackblitz-world-cluster-map/package.json +19 -0
  18. package/examples/stackblitz-world-cluster-map/src/main.ts +78 -0
  19. package/examples/stackblitz-world-cluster-map/src/style.css +65 -0
  20. package/lib/core/contracts.d.ts +19 -0
  21. package/lib/core/contracts.d.ts.map +1 -1
  22. package/lib/internal/downsample.d.ts.map +1 -1
  23. package/lib/internal/downsample.js +248 -2
  24. package/lib/internal/downsample.js.map +1 -1
  25. package/lib/presets/index.d.ts +31 -0
  26. package/lib/presets/index.d.ts.map +1 -1
  27. package/lib/presets/index.js +185 -9
  28. package/lib/presets/index.js.map +1 -1
  29. package/lib/series/svg-region-map.d.ts +20 -1
  30. package/lib/series/svg-region-map.d.ts.map +1 -1
  31. package/lib/series/svg-region-map.js +181 -7
  32. package/lib/series/svg-region-map.js.map +1 -1
  33. package/package.json +2 -2
@@ -0,0 +1,267 @@
1
+ :root {
2
+ color-scheme: dark;
3
+ font-family: Inter, Pretendard, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
4
+ background: #080d18;
5
+ color: #e5edf7;
6
+ }
7
+
8
+ * {
9
+ box-sizing: border-box;
10
+ }
11
+
12
+ body {
13
+ margin: 0;
14
+ min-width: 320px;
15
+ min-height: 100vh;
16
+ background:
17
+ radial-gradient(circle at 12% 4%, rgba(34, 211, 238, 0.13), transparent 29rem),
18
+ radial-gradient(circle at 88% 0%, rgba(129, 140, 248, 0.14), transparent 30rem),
19
+ #080d18;
20
+ }
21
+
22
+ .page-shell {
23
+ width: min(1180px, calc(100vw - 32px));
24
+ margin: 0 auto;
25
+ padding: 42px 0;
26
+ }
27
+
28
+ .page-header {
29
+ margin-bottom: 20px;
30
+ }
31
+
32
+ .eyebrow,
33
+ .legend-kicker {
34
+ margin: 0 0 8px;
35
+ color: #67e8f9;
36
+ font-size: 12px;
37
+ font-weight: 800;
38
+ letter-spacing: 0.08em;
39
+ text-transform: uppercase;
40
+ }
41
+
42
+ h1 {
43
+ margin: 0;
44
+ color: #f8fafc;
45
+ font-size: clamp(28px, 5vw, 46px);
46
+ line-height: 1.1;
47
+ letter-spacing: 0;
48
+ }
49
+
50
+ .page-header > p:last-child {
51
+ margin: 12px 0 0;
52
+ color: #94a3b8;
53
+ line-height: 1.6;
54
+ }
55
+
56
+ .dashboard-card {
57
+ display: grid;
58
+ grid-template-columns: minmax(0, 1fr) 330px;
59
+ min-height: 580px;
60
+ overflow: hidden;
61
+ border: 1px solid rgba(148, 163, 184, 0.2);
62
+ border-radius: 8px;
63
+ background: rgba(12, 19, 33, 0.94);
64
+ box-shadow: 0 24px 80px rgba(0, 0, 0, 0.32);
65
+ }
66
+
67
+ .chart-region {
68
+ min-width: 0;
69
+ padding: 24px 18px;
70
+ background:
71
+ linear-gradient(rgba(148, 163, 184, 0.035) 1px, transparent 1px),
72
+ linear-gradient(90deg, rgba(148, 163, 184, 0.035) 1px, transparent 1px);
73
+ background-size: 28px 28px;
74
+ }
75
+
76
+ #chart {
77
+ width: 100%;
78
+ height: 520px;
79
+ }
80
+
81
+ #chart .kchart-svg text {
82
+ font-family: inherit;
83
+ }
84
+
85
+ #chart .kchart-title {
86
+ fill: #f8fafc;
87
+ }
88
+
89
+ #chart .value-pie {
90
+ transition: fill-opacity 140ms ease, stroke 140ms ease;
91
+ }
92
+
93
+ .legend-panel {
94
+ display: flex;
95
+ min-width: 0;
96
+ flex-direction: column;
97
+ align-self: center;
98
+ margin: 24px 24px 24px 0;
99
+ overflow: hidden;
100
+ border: 1px solid rgba(148, 163, 184, 0.18);
101
+ border-radius: 8px;
102
+ background: rgba(15, 23, 42, 0.86);
103
+ }
104
+
105
+ .legend-header,
106
+ .legend-footer {
107
+ display: flex;
108
+ align-items: center;
109
+ justify-content: space-between;
110
+ gap: 16px;
111
+ padding: 18px;
112
+ }
113
+
114
+ .legend-header {
115
+ border-bottom: 1px solid rgba(148, 163, 184, 0.13);
116
+ }
117
+
118
+ .legend-kicker {
119
+ margin-bottom: 5px;
120
+ color: #94a3b8;
121
+ letter-spacing: 0.04em;
122
+ }
123
+
124
+ .legend-header h2 {
125
+ margin: 0;
126
+ color: #f8fafc;
127
+ font-size: 16px;
128
+ letter-spacing: 0;
129
+ }
130
+
131
+ .legend-count {
132
+ flex: 0 0 auto;
133
+ color: #67e8f9;
134
+ font-size: 13px;
135
+ font-weight: 800;
136
+ }
137
+
138
+ .legend-scroll {
139
+ height: 360px;
140
+ overflow-x: hidden;
141
+ overflow-y: auto;
142
+ scrollbar-color: #475569 transparent;
143
+ scrollbar-width: thin;
144
+ }
145
+
146
+ .legend-scroll:focus-visible {
147
+ outline: 2px solid #22d3ee;
148
+ outline-offset: -2px;
149
+ }
150
+
151
+ .legend-scroll::-webkit-scrollbar {
152
+ width: 8px;
153
+ }
154
+
155
+ .legend-scroll::-webkit-scrollbar-track {
156
+ background: transparent;
157
+ }
158
+
159
+ .legend-scroll::-webkit-scrollbar-thumb {
160
+ border: 2px solid transparent;
161
+ border-radius: 8px;
162
+ background: #475569;
163
+ background-clip: padding-box;
164
+ }
165
+
166
+ .legend-list {
167
+ margin: 0;
168
+ padding: 6px 10px;
169
+ list-style: none;
170
+ }
171
+
172
+ .legend-item {
173
+ display: grid;
174
+ grid-template-columns: 10px minmax(0, 1fr) auto;
175
+ align-items: center;
176
+ gap: 11px;
177
+ min-height: 54px;
178
+ padding: 8px;
179
+ border-bottom: 1px solid rgba(148, 163, 184, 0.09);
180
+ }
181
+
182
+ .legend-item:last-child {
183
+ border-bottom: 0;
184
+ }
185
+
186
+ .legend-swatch {
187
+ width: 9px;
188
+ height: 9px;
189
+ border-radius: 50%;
190
+ background: var(--series-color);
191
+ box-shadow: 0 0 10px color-mix(in srgb, var(--series-color) 72%, transparent);
192
+ }
193
+
194
+ .legend-name {
195
+ min-width: 0;
196
+ overflow: hidden;
197
+ color: #cbd5e1;
198
+ font-size: 13px;
199
+ font-weight: 650;
200
+ text-overflow: ellipsis;
201
+ white-space: nowrap;
202
+ }
203
+
204
+ .legend-metric {
205
+ display: grid;
206
+ justify-items: end;
207
+ gap: 2px;
208
+ font-variant-numeric: tabular-nums;
209
+ }
210
+
211
+ .legend-metric strong {
212
+ color: #f8fafc;
213
+ font-size: 13px;
214
+ }
215
+
216
+ .legend-metric small {
217
+ color: #64748b;
218
+ font-size: 11px;
219
+ }
220
+
221
+ .legend-footer {
222
+ border-top: 1px solid rgba(148, 163, 184, 0.13);
223
+ color: #64748b;
224
+ font-size: 12px;
225
+ }
226
+
227
+ .legend-footer strong {
228
+ color: #cbd5e1;
229
+ }
230
+
231
+ @media (max-width: 860px) {
232
+ .dashboard-card {
233
+ grid-template-columns: 1fr;
234
+ }
235
+
236
+ .legend-panel {
237
+ margin: 0 18px 18px;
238
+ }
239
+
240
+ .legend-scroll {
241
+ height: 260px;
242
+ }
243
+ }
244
+
245
+ @media (max-width: 720px) {
246
+ .page-shell {
247
+ width: min(100vw - 20px, 1180px);
248
+ padding: 24px 0;
249
+ }
250
+
251
+ .chart-region {
252
+ padding: 14px 6px;
253
+ }
254
+
255
+ #chart {
256
+ height: 390px;
257
+ }
258
+
259
+ .legend-panel {
260
+ margin: 0 10px 10px;
261
+ }
262
+
263
+ .legend-header,
264
+ .legend-footer {
265
+ padding: 15px;
266
+ }
267
+ }
@@ -0,0 +1 @@
1
+ /// <reference types="vite/client" />
@@ -0,0 +1,23 @@
1
+ <!doctype html>
2
+ <html lang="ko">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <title>KChart World Activity Map</title>
7
+ </head>
8
+ <body>
9
+ <main>
10
+ <section>
11
+ <div id="chart"></div>
12
+ <aside class="activity-legend" aria-label="국가별 활동 지수 범례">
13
+ <strong>국가별 활동 지수</strong>
14
+ <span class="activity-legend__bar"></span>
15
+ <span class="activity-legend__labels">
16
+ <span>낮음</span><span>보통</span><span>높음</span><span>매우 높음</span>
17
+ </span>
18
+ </aside>
19
+ </section>
20
+ </main>
21
+ <script type="module" src="/src/main.ts"></script>
22
+ </body>
23
+ </html>
@@ -0,0 +1,16 @@
1
+ {
2
+ "name": "kchart-world-activity-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.26.0",
13
+ "typescript": "^6.0.3",
14
+ "vite": "^7.1.12"
15
+ }
16
+ }
@@ -0,0 +1,77 @@
1
+ import {createKChart, createWorldCountryMapSeries} from '@keneth80/k-chart';
2
+ import './style.css';
3
+
4
+ type CountryActivity = {
5
+ name: string;
6
+ activity: number;
7
+ region: string;
8
+ };
9
+
10
+ const countryActivity: CountryActivity[] = [
11
+ {name: 'South Korea', activity: 92, region: 'Asia'},
12
+ {name: 'Japan', activity: 84, region: 'Asia'},
13
+ {name: 'China', activity: 78, region: 'Asia'},
14
+ {name: 'India', activity: 71, region: 'Asia'},
15
+ {name: 'Australia', activity: 63, region: 'Oceania'},
16
+ {name: 'United States of America', activity: 88, region: 'North America'},
17
+ {name: 'Canada', activity: 66, region: 'North America'},
18
+ {name: 'Brazil', activity: 58, region: 'South America'},
19
+ {name: 'France', activity: 73, region: 'Europe'},
20
+ {name: 'Germany', activity: 76, region: 'Europe'},
21
+ {name: 'United Kingdom', activity: 69, region: 'Europe'},
22
+ {name: 'South Africa', activity: 46, region: 'Africa'}
23
+ ];
24
+
25
+ createKChart<CountryActivity>({
26
+ selector: '#chart',
27
+ data: countryActivity,
28
+ width: 1180,
29
+ height: 650,
30
+ margin: {top: 76, right: 24, bottom: 24, left: 24},
31
+ title: {
32
+ text: '글로벌 시장 활동 현황',
33
+ align: 'center',
34
+ fontSize: 18,
35
+ fontWeight: 800
36
+ },
37
+ grid: {visible: false},
38
+ legend: {visible: false},
39
+ tooltip: {visible: true},
40
+ axes: [],
41
+ series: [
42
+ createWorldCountryMapSeries<CountryActivity>({
43
+ selector: 'world-activity-map',
44
+ displayName: 'Market activity',
45
+ dataKey: 'name',
46
+ valueField: 'activity',
47
+ colorLegend: {
48
+ visible: true,
49
+ title: '국가별 활동 지수',
50
+ position: 'bottom-left',
51
+ domain: [40, 100],
52
+ colors: ['#315a7d', '#2f9c95', '#f2c14e', '#e05d5d'],
53
+ labels: ['관찰', '안정', '활발', '최상'],
54
+ width: 280
55
+ },
56
+ fitPadding: 34,
57
+ backgroundFill: 'rgba(9, 15, 24, 0.72)',
58
+ missingFill: 'rgba(112, 132, 151, 0.22)',
59
+ stroke: 'rgba(225, 236, 246, 0.5)',
60
+ strokeWidth: 0.55,
61
+ hoverStroke: '#ffffff',
62
+ hoverStrokeWidth: 1.5,
63
+ zoom: {
64
+ enabled: true,
65
+ wheel: true,
66
+ pan: true,
67
+ scaleExtent: [1, 8],
68
+ controls: {visible: true, x: 10, y: 12, step: 0.3}
69
+ },
70
+ tooltip: {
71
+ formatter: ({label, data}) => data
72
+ ? `<strong>${label}</strong><br/>활동 지수: ${data.activity}<br/>권역: ${data.region}`
73
+ : `<strong>${label}</strong><br/>집계 데이터 없음`
74
+ }
75
+ })
76
+ ]
77
+ }).render();
@@ -0,0 +1,78 @@
1
+ :root {
2
+ color-scheme: dark;
3
+ font-family: Inter, Pretendard, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
4
+ background: #091018;
5
+ color: #edf3f8;
6
+ }
7
+
8
+ * {
9
+ box-sizing: border-box;
10
+ }
11
+
12
+ body {
13
+ margin: 0;
14
+ min-height: 100vh;
15
+ background: linear-gradient(155deg, #172331 0%, #091018 62%);
16
+ }
17
+
18
+ main {
19
+ min-height: 100vh;
20
+ display: grid;
21
+ place-items: center;
22
+ padding: 24px;
23
+ }
24
+
25
+ section {
26
+ position: relative;
27
+ width: min(1220px, 100%);
28
+ overflow: hidden;
29
+ border: 1px solid rgba(219, 232, 242, 0.18);
30
+ border-radius: 8px;
31
+ background: rgba(16, 23, 33, 0.88);
32
+ box-shadow: 0 24px 76px rgba(0, 0, 0, 0.32);
33
+ }
34
+
35
+ #chart {
36
+ width: 100%;
37
+ min-height: 650px;
38
+ }
39
+
40
+ .activity-legend {
41
+ position: absolute;
42
+ left: 40px;
43
+ bottom: 36px;
44
+ width: min(280px, calc(100% - 80px));
45
+ display: grid;
46
+ gap: 9px;
47
+ padding: 13px 14px 11px;
48
+ border: 1px solid rgba(226, 236, 249, 0.24);
49
+ border-radius: 7px;
50
+ background: rgba(16, 23, 33, 0.88);
51
+ pointer-events: none;
52
+ }
53
+
54
+ .activity-legend strong {
55
+ font-size: 12px;
56
+ }
57
+
58
+ .activity-legend__bar {
59
+ height: 10px;
60
+ border-radius: 5px;
61
+ background: linear-gradient(90deg, #274c77, #2a9d8f, #e9c46a, #e76f51);
62
+ }
63
+
64
+ .activity-legend__labels {
65
+ display: flex;
66
+ justify-content: space-between;
67
+ gap: 6px;
68
+ font-size: 10px;
69
+ font-weight: 700;
70
+ }
71
+
72
+ @media (max-width: 520px) {
73
+ .activity-legend {
74
+ left: 20px;
75
+ bottom: 20px;
76
+ width: calc(100% - 40px);
77
+ }
78
+ }
@@ -0,0 +1 @@
1
+ declare module '*.css';
@@ -0,0 +1,19 @@
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 Cluster Map</title>
7
+ </head>
8
+ <body>
9
+ <main>
10
+ <header>
11
+ <p>KChart + MapLibre</p>
12
+ <h1>Global operations clusters</h1>
13
+ <span>Drag horizontally to explore the wrapped world.</span>
14
+ </header>
15
+ <section id="map" aria-label="Global clustered locations"></section>
16
+ </main>
17
+ <script type="module" src="/src/main.ts"></script>
18
+ </body>
19
+ </html>
@@ -0,0 +1,19 @@
1
+ {
2
+ "name": "kchart-world-cluster-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.26.0",
13
+ "@keneth80/k-chart-maplibre": "^0.2.0",
14
+ "maplibre-gl": "^5.19.0",
15
+ "typescript": "^6.0.3",
16
+ "vite": "^7.1.12"
17
+ },
18
+ "devDependencies": {}
19
+ }
@@ -0,0 +1,78 @@
1
+ import {createMapLibreFlatMap} from '@keneth80/k-chart-maplibre';
2
+ import type {KChartMapLibrePlace} from '@keneth80/k-chart-maplibre';
3
+ import '@keneth80/k-chart-maplibre/style.css';
4
+ import 'maplibre-gl/dist/maplibre-gl.css';
5
+ import './style.css';
6
+
7
+ interface OperationsPlace extends KChartMapLibrePlace {
8
+ region: string;
9
+ }
10
+
11
+ const hubs = [
12
+ ['Seoul', 37.5665, 126.978, 96, 'Asia Pacific'],
13
+ ['Tokyo', 35.6762, 139.6503, 82, 'Asia Pacific'],
14
+ ['Singapore', 1.3521, 103.8198, 64, 'Asia Pacific'],
15
+ ['Sydney', -33.8688, 151.2093, 52, 'Asia Pacific'],
16
+ ['Mumbai', 19.076, 72.8777, 58, 'Asia Pacific'],
17
+ ['Dubai', 25.2048, 55.2708, 44, 'Middle East'],
18
+ ['London', 51.5072, -0.1276, 76, 'Europe'],
19
+ ['Berlin', 52.52, 13.405, 54, 'Europe'],
20
+ ['Amsterdam', 52.3676, 4.9041, 38, 'Europe'],
21
+ ['New York', 40.7128, -74.006, 88, 'North America'],
22
+ ['Chicago', 41.8781, -87.6298, 46, 'North America'],
23
+ ['San Francisco', 37.7749, -122.4194, 69, 'North America'],
24
+ ['Mexico City', 19.4326, -99.1332, 42, 'Latin America'],
25
+ ['Sao Paulo', -23.5505, -46.6333, 62, 'Latin America'],
26
+ ['Cape Town', -33.9249, 18.4241, 35, 'Africa']
27
+ ] as const;
28
+
29
+ const places: OperationsPlace[] = hubs.flatMap(
30
+ ([city, hubLat, hubLon, count, region], hubIndex) =>
31
+ Array.from({length: count}, (_unused, pointIndex) => {
32
+ const angle = pointIndex * 2.3999632297 + hubIndex * 0.41;
33
+ const distance = 0.08 + Math.sqrt(pointIndex + 1) * 0.055;
34
+ const lat = Math.max(-85, Math.min(85, hubLat + Math.sin(angle) * distance));
35
+ const rawLon = hubLon + Math.cos(angle) * distance * 1.35;
36
+ const lon = ((rawLon + 180) % 360 + 360) % 360 - 180;
37
+ return {
38
+ id: `${city.toLowerCase().replace(/\s+/g, '-')}-${pointIndex + 1}`,
39
+ name: `${city} signal ${pointIndex + 1}`,
40
+ category: region,
41
+ region,
42
+ description: 'Aggregated operational event available for drilldown.',
43
+ lat,
44
+ lon
45
+ };
46
+ })
47
+ );
48
+
49
+ const controller = createMapLibreFlatMap<OperationsPlace>({
50
+ container: '#map',
51
+ style: 'https://tiles.openfreemap.org/styles/liberty',
52
+ initialZoom: 1.15,
53
+ minZoom: 0.6,
54
+ maxZoom: 12,
55
+ cluster: true,
56
+ clusterRadius: 58,
57
+ markerColor: '#22d3ee',
58
+ onPlaceClick: ({place}) => console.info('Selected place', place)
59
+ });
60
+
61
+ await controller.show({
62
+ lat: 20,
63
+ lon: 5,
64
+ zoom: 1.15,
65
+ places
66
+ });
67
+
68
+ // MapLibre repeats the same world horizontally at low zoom. This is one map,
69
+ // not two map instances. Set false when a single bounded world is preferred.
70
+ const map = controller.getMap();
71
+ map?.setRenderWorldCopies(true);
72
+ map?.setPaintProperty('kchart-maplibre-place-clusters', 'circle-color', [
73
+ 'step', ['get', 'point_count'], '#4ade80', 24, '#facc15', 64, '#fb923c'
74
+ ]);
75
+ map?.setPaintProperty('kchart-maplibre-place-clusters', 'circle-radius', [
76
+ 'step', ['get', 'point_count'], 16, 24, 21, 64, 27
77
+ ]);
78
+ map?.setPaintProperty('kchart-maplibre-place-cluster-count', 'text-color', '#17202a');
@@ -0,0 +1,65 @@
1
+ :root {
2
+ font-family: Inter, ui-sans-serif, system-ui, sans-serif;
3
+ color: #e5eef6;
4
+ background: #07111d;
5
+ }
6
+
7
+ * {
8
+ box-sizing: border-box;
9
+ }
10
+
11
+ body {
12
+ min-width: 320px;
13
+ min-height: 100vh;
14
+ margin: 0;
15
+ padding: 24px;
16
+ background: radial-gradient(circle at 20% 0%, #17324c 0, #07111d 42%);
17
+ }
18
+
19
+ main {
20
+ width: min(1500px, 100%);
21
+ margin: 0 auto;
22
+ }
23
+
24
+ header {
25
+ display: grid;
26
+ gap: 6px;
27
+ margin-bottom: 14px;
28
+ }
29
+
30
+ header p,
31
+ header h1,
32
+ header span {
33
+ margin: 0;
34
+ }
35
+
36
+ header p {
37
+ color: #67e8f9;
38
+ font-size: 12px;
39
+ font-weight: 800;
40
+ text-transform: uppercase;
41
+ }
42
+
43
+ header h1 {
44
+ font-size: 25px;
45
+ }
46
+
47
+ header span {
48
+ color: #93a4b7;
49
+ font-size: 13px;
50
+ }
51
+
52
+ #map {
53
+ position: relative;
54
+ height: min(68vh, 720px);
55
+ min-height: 460px;
56
+ overflow: hidden;
57
+ border: 1px solid rgba(148, 163, 184, 0.35);
58
+ border-radius: 8px;
59
+ background: #0f1b29;
60
+ box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
61
+ }
62
+
63
+ #map .kchart-maplibre-toolbar {
64
+ display: none;
65
+ }
@@ -50,9 +50,13 @@ export interface KChartDownsampleContext<T = any> {
50
50
  }
51
51
  export interface KChartDownsampleConfiguration<T = any> {
52
52
  enabled?: boolean;
53
+ /** LTTB target point count. Pixel-column min/max does not use this option. */
53
54
  threshold?: number | ((context: KChartDownsampleContext<T>) => number);
54
55
  xAccessor?: (point: T) => number;
55
56
  yAccessor?: (point: T) => number;
57
+ strategy?: 'lttb' | 'min-max' | 'auto';
58
+ /** Minimum visible points per plot pixel before pixel-column min/max sampling starts. */
59
+ pointsPerPixel?: number;
56
60
  }
57
61
  export interface KChartAsyncRenderConfiguration {
58
62
  enabled?: boolean;
@@ -684,6 +688,20 @@ export interface KChartGeoRegionMapZoomConfiguration {
684
688
  controls?: boolean | KChartGeoRegionMapZoomControlsConfiguration;
685
689
  scaleExtent?: [number, number];
686
690
  }
691
+ export interface KChartGeoRegionMapColorLegendConfiguration {
692
+ visible?: boolean;
693
+ title?: string;
694
+ position?: 'bottom-left' | 'bottom-center' | 'bottom-right';
695
+ domain?: [number, number];
696
+ colors?: string[];
697
+ labels?: string[];
698
+ width?: number;
699
+ height?: number;
700
+ offset?: number;
701
+ backgroundFill?: string;
702
+ borderColor?: string;
703
+ textColor?: string;
704
+ }
687
705
  export interface KChartGeoRegionMapMarkerClickContext {
688
706
  marker: KChartGeoRegionMapMarker;
689
707
  event: MouseEvent;
@@ -742,6 +760,7 @@ export interface KChartGeoRegionMapSeriesConfiguration<T = any> {
742
760
  hoverStroke?: string;
743
761
  hoverStrokeWidth?: number;
744
762
  zoom?: boolean | KChartGeoRegionMapZoomConfiguration;
763
+ colorLegend?: boolean | KChartGeoRegionMapColorLegendConfiguration;
745
764
  labels?: boolean | KChartGeoRegionMapLabelConfiguration<T>;
746
765
  bubbles?: KChartGeoRegionMapBubble[];
747
766
  markers?: KChartGeoRegionMapMarker[];