@codeauradev/ngx-wind-charts 0.0.0-stage → 1.0.4
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/LICENSE +21 -0
- package/README.md +178 -2
- package/fesm2022/codeauradev-ngx-wind-charts-map.mjs +60292 -0
- package/fesm2022/codeauradev-ngx-wind-charts-map.mjs.map +1 -0
- package/fesm2022/codeauradev-ngx-wind-charts.mjs +4016 -0
- package/fesm2022/codeauradev-ngx-wind-charts.mjs.map +1 -0
- package/ngx-charts.css +343 -0
- package/package.json +52 -4
- package/types/codeauradev-ngx-wind-charts-map.d.ts +261 -0
- package/types/codeauradev-ngx-wind-charts.d.ts +982 -0
package/ngx-charts.css
ADDED
|
@@ -0,0 +1,343 @@
|
|
|
1
|
+
.ngx-charts,
|
|
2
|
+
.ngx-wind-charts {
|
|
3
|
+
--ngx-1: var(--color-chart-1, var(--color-sky-600, #0284c7));
|
|
4
|
+
--ngx-2: var(--color-chart-2, var(--color-amber-600, #d97706));
|
|
5
|
+
--ngx-3: var(--color-chart-3, var(--color-emerald-600, #059669));
|
|
6
|
+
--ngx-4: var(--color-chart-4, var(--color-rose-600, #e11d48));
|
|
7
|
+
--ngx-5: var(--color-chart-5, var(--color-violet-600, #7c3aed));
|
|
8
|
+
--ngx-map-min: var(--color-amber-100, #fef3c7);
|
|
9
|
+
--ngx-map-max: var(--color-amber-700, #b45309);
|
|
10
|
+
--ngx-map-empty: color-mix(in oklab, currentColor 14%, #f8fafc);
|
|
11
|
+
--ngx-map-stroke: color-mix(in oklab, var(--ngx-surface, #fff) 92%, #94a3b8);
|
|
12
|
+
--ngx-map-water: color-mix(in oklab, var(--ngx-2, #d97706) 9%, var(--ngx-surface, #f6f9fc));
|
|
13
|
+
--ngx-grid: color-mix(in oklab, currentColor 14%, transparent);
|
|
14
|
+
--ngx-zero: color-mix(in oklab, currentColor 38%, transparent);
|
|
15
|
+
--ngx-track: color-mix(in oklab, currentColor 12%, transparent);
|
|
16
|
+
--ngx-surface: var(--color-surface, canvas);
|
|
17
|
+
display: flex;
|
|
18
|
+
box-sizing: border-box;
|
|
19
|
+
width: 100%;
|
|
20
|
+
max-width: 100%;
|
|
21
|
+
min-width: 0;
|
|
22
|
+
flex-direction: column;
|
|
23
|
+
gap: 0.75rem;
|
|
24
|
+
color: var(--color-muted, #64748b);
|
|
25
|
+
font-family: var(--font-sans, ui-sans-serif, system-ui, sans-serif);
|
|
26
|
+
font-size: 0.875rem;
|
|
27
|
+
line-height: 1.45;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.ngx-plot {
|
|
31
|
+
position: relative;
|
|
32
|
+
width: 100%;
|
|
33
|
+
max-width: 100%;
|
|
34
|
+
min-width: 0;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.ngx-fill {
|
|
38
|
+
position: absolute;
|
|
39
|
+
inset: 0;
|
|
40
|
+
width: 100%;
|
|
41
|
+
height: 100%;
|
|
42
|
+
max-width: 100%;
|
|
43
|
+
max-height: 100%;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.ngx-square {
|
|
47
|
+
position: relative;
|
|
48
|
+
max-width: 100%;
|
|
49
|
+
margin-inline: auto;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.ngx-charts svg,
|
|
53
|
+
.ngx-wind-charts svg {
|
|
54
|
+
display: block;
|
|
55
|
+
width: 100%;
|
|
56
|
+
max-width: 100%;
|
|
57
|
+
overflow: hidden;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.ngx-fill,
|
|
61
|
+
.ngx-square > svg,
|
|
62
|
+
.ngx-map-svg {
|
|
63
|
+
width: 100%;
|
|
64
|
+
height: 100%;
|
|
65
|
+
max-width: 100%;
|
|
66
|
+
max-height: 100%;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.ngx-charts text,
|
|
70
|
+
.ngx-wind-charts text {
|
|
71
|
+
fill: currentColor;
|
|
72
|
+
font-size: 0.75rem;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.ngx-grid {
|
|
76
|
+
stroke: var(--ngx-grid);
|
|
77
|
+
stroke-width: 1;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.ngx-zero {
|
|
81
|
+
stroke: var(--ngx-zero);
|
|
82
|
+
stroke-width: 1;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.ngx-value {
|
|
86
|
+
fill: var(--color-foreground, currentColor);
|
|
87
|
+
font-size: 0.75rem;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.ngx-tip {
|
|
91
|
+
position: absolute;
|
|
92
|
+
z-index: 20;
|
|
93
|
+
display: flex;
|
|
94
|
+
flex-direction: column;
|
|
95
|
+
gap: 0.25rem;
|
|
96
|
+
width: max-content;
|
|
97
|
+
max-width: 16rem;
|
|
98
|
+
transform: translateY(-100%);
|
|
99
|
+
border: 1px solid var(--color-border, #e2e8f0);
|
|
100
|
+
border-radius: 0.5rem;
|
|
101
|
+
background: var(--color-surface, #fff);
|
|
102
|
+
color: var(--color-foreground, #0f172a);
|
|
103
|
+
padding: 0.5rem 0.75rem;
|
|
104
|
+
font-size: 0.75rem;
|
|
105
|
+
line-height: 1.4;
|
|
106
|
+
box-shadow: 0 8px 24px color-mix(in oklab, black 12%, transparent);
|
|
107
|
+
pointer-events: none;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.ngx-tip-row {
|
|
111
|
+
display: flex;
|
|
112
|
+
align-items: center;
|
|
113
|
+
gap: 0.4rem;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.ngx-legend {
|
|
117
|
+
display: flex;
|
|
118
|
+
flex-wrap: wrap;
|
|
119
|
+
justify-content: center;
|
|
120
|
+
gap: 0.5rem 1rem;
|
|
121
|
+
margin: 0;
|
|
122
|
+
padding: 0;
|
|
123
|
+
list-style: none;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.ngx-legend li,
|
|
127
|
+
.ngx-key {
|
|
128
|
+
display: inline-flex;
|
|
129
|
+
align-items: center;
|
|
130
|
+
gap: 0.4rem;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.ngx-swatch {
|
|
134
|
+
width: 0.625rem;
|
|
135
|
+
height: 0.625rem;
|
|
136
|
+
flex: none;
|
|
137
|
+
border-radius: 999px;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.ngx-heat-scale {
|
|
141
|
+
height: 0.5rem;
|
|
142
|
+
flex: 1;
|
|
143
|
+
border-radius: 999px;
|
|
144
|
+
background: linear-gradient(90deg, var(--ngx-track), var(--ngx-2));
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.ngx-sr {
|
|
148
|
+
position: absolute;
|
|
149
|
+
width: 1px;
|
|
150
|
+
height: 1px;
|
|
151
|
+
padding: 0;
|
|
152
|
+
margin: -1px;
|
|
153
|
+
overflow: hidden;
|
|
154
|
+
clip: rect(0, 0, 0, 0);
|
|
155
|
+
white-space: nowrap;
|
|
156
|
+
border: 0;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.ngx-in {
|
|
160
|
+
animation: ngx-in 480ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.ngx-grow-y,
|
|
164
|
+
.ngx-grow-x,
|
|
165
|
+
.ngx-pop {
|
|
166
|
+
transform-box: fill-box;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
.ngx-grow-bottom { transform-origin: center bottom; }
|
|
170
|
+
.ngx-grow-top { transform-origin: center top; }
|
|
171
|
+
.ngx-grow-left { transform-origin: left center; }
|
|
172
|
+
.ngx-grow-right { transform-origin: right center; }
|
|
173
|
+
.ngx-pop { transform-origin: center; }
|
|
174
|
+
|
|
175
|
+
.ngx-grow-y { animation: ngx-grow-y 560ms cubic-bezier(0.2, 0.7, 0.2, 1) both; }
|
|
176
|
+
.ngx-grow-x { animation: ngx-grow-x 560ms cubic-bezier(0.2, 0.7, 0.2, 1) both; }
|
|
177
|
+
.ngx-pop { animation: ngx-pop 280ms cubic-bezier(0.2, 0.7, 0.2, 1) both; }
|
|
178
|
+
|
|
179
|
+
.ngx-rise-on {
|
|
180
|
+
transform-box: view-box;
|
|
181
|
+
transform-origin: 50% var(--ngx-rise-origin);
|
|
182
|
+
animation: ngx-rise 640ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.ngx-draw {
|
|
186
|
+
animation: ngx-draw 700ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
@keyframes ngx-in {
|
|
190
|
+
from { opacity: 0; }
|
|
191
|
+
to { opacity: 1; }
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
@keyframes ngx-grow-y {
|
|
195
|
+
from { transform: scaleY(0); }
|
|
196
|
+
to { transform: scaleY(1); }
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
@keyframes ngx-grow-x {
|
|
200
|
+
from { transform: scaleX(0); }
|
|
201
|
+
to { transform: scaleX(1); }
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
@keyframes ngx-pop {
|
|
205
|
+
from { transform: scale(0); }
|
|
206
|
+
to { transform: scale(1); }
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
@keyframes ngx-rise {
|
|
210
|
+
from { transform: scaleY(0); }
|
|
211
|
+
to { transform: scaleY(1); }
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
@keyframes ngx-draw {
|
|
215
|
+
from { stroke-dashoffset: 1; }
|
|
216
|
+
to { stroke-dashoffset: 0; }
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
@media (prefers-reduced-motion: reduce) {
|
|
220
|
+
.ngx-in,
|
|
221
|
+
.ngx-grow-y,
|
|
222
|
+
.ngx-grow-x,
|
|
223
|
+
.ngx-pop,
|
|
224
|
+
.ngx-rise-on,
|
|
225
|
+
.ngx-draw {
|
|
226
|
+
animation: none;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
.ngx-map {
|
|
231
|
+
display: flex;
|
|
232
|
+
flex-direction: column;
|
|
233
|
+
width: 100%;
|
|
234
|
+
height: 100%;
|
|
235
|
+
max-width: 100%;
|
|
236
|
+
max-height: 100%;
|
|
237
|
+
min-width: 0;
|
|
238
|
+
min-height: 0;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
.ngx-map-crumbs {
|
|
242
|
+
display: flex;
|
|
243
|
+
flex-wrap: wrap;
|
|
244
|
+
align-items: center;
|
|
245
|
+
gap: 0.35rem;
|
|
246
|
+
margin: 0 0 0.35rem;
|
|
247
|
+
color: var(--color-foreground, #0f172a);
|
|
248
|
+
font-size: 0.75rem;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
.ngx-map-crumbs button {
|
|
252
|
+
border: 0;
|
|
253
|
+
background: none;
|
|
254
|
+
padding: 0;
|
|
255
|
+
color: var(--ngx-map-max);
|
|
256
|
+
font: inherit;
|
|
257
|
+
font-weight: 650;
|
|
258
|
+
cursor: pointer;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
.ngx-map-crumbs button:disabled {
|
|
262
|
+
color: inherit;
|
|
263
|
+
font-weight: 500;
|
|
264
|
+
cursor: default;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
.ngx-map-hint {
|
|
268
|
+
margin: 0 0 0.5rem;
|
|
269
|
+
font-size: 0.75rem;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
.ngx-map-svg {
|
|
273
|
+
display: block;
|
|
274
|
+
width: 100%;
|
|
275
|
+
max-width: 100%;
|
|
276
|
+
border-radius: 0.75rem;
|
|
277
|
+
background: var(--ngx-map-water);
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
.ngx-map-water {
|
|
281
|
+
fill: var(--ngx-map-water);
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
.ngx-map-region {
|
|
285
|
+
stroke: var(--ngx-map-stroke);
|
|
286
|
+
stroke-width: 1;
|
|
287
|
+
vector-effect: non-scaling-stroke;
|
|
288
|
+
cursor: pointer;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
.ngx-map-hot {
|
|
292
|
+
stroke: var(--ngx-map-max);
|
|
293
|
+
stroke-width: 1.6;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
.ngx-map-county-base {
|
|
297
|
+
fill: var(--ngx-map-empty);
|
|
298
|
+
stroke: var(--ngx-map-stroke);
|
|
299
|
+
stroke-width: 1.25;
|
|
300
|
+
vector-effect: non-scaling-stroke;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
.ngx-charts text.ngx-map-label,
|
|
304
|
+
.ngx-wind-charts text.ngx-map-label {
|
|
305
|
+
fill: var(--color-foreground, #0f172a);
|
|
306
|
+
font-size: var(--ngx-map-font, 12px);
|
|
307
|
+
font-weight: 600;
|
|
308
|
+
paint-order: stroke;
|
|
309
|
+
stroke: var(--ngx-map-water);
|
|
310
|
+
stroke-width: 3px;
|
|
311
|
+
vector-effect: non-scaling-stroke;
|
|
312
|
+
pointer-events: none;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
.ngx-map-scale {
|
|
316
|
+
margin-top: 0.75rem;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
.ngx-map-scale-title,
|
|
320
|
+
.ngx-map-scale-ends {
|
|
321
|
+
display: flex;
|
|
322
|
+
justify-content: space-between;
|
|
323
|
+
font-size: 0.75rem;
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
.ngx-map-bar {
|
|
327
|
+
position: relative;
|
|
328
|
+
height: 0.5rem;
|
|
329
|
+
margin: 0.35rem 0;
|
|
330
|
+
border-radius: 999px;
|
|
331
|
+
background: linear-gradient(90deg, var(--ngx-map-min), var(--ngx-map-max));
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
.ngx-map-marker {
|
|
335
|
+
position: absolute;
|
|
336
|
+
top: -0.35rem;
|
|
337
|
+
width: 0;
|
|
338
|
+
height: 0;
|
|
339
|
+
border-right: 5px solid transparent;
|
|
340
|
+
border-left: 5px solid transparent;
|
|
341
|
+
border-top: 7px solid var(--color-foreground, #0f172a);
|
|
342
|
+
transform: translateX(-50%);
|
|
343
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,54 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codeauradev/ngx-wind-charts",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "1.0.4",
|
|
4
|
+
"description": "Angular 22 charts styled with Tailwind CSS, including a USA choropleth. Pass data in, get SVG charts out.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"angular",
|
|
7
|
+
"angular22",
|
|
8
|
+
"charts",
|
|
9
|
+
"tailwindcss",
|
|
10
|
+
"ngx",
|
|
11
|
+
"svg",
|
|
12
|
+
"choropleth",
|
|
13
|
+
"map",
|
|
14
|
+
"bar-chart",
|
|
15
|
+
"line-chart"
|
|
16
|
+
],
|
|
17
|
+
"license": "MIT",
|
|
18
|
+
"publishConfig": {
|
|
19
|
+
"access": "public"
|
|
20
|
+
},
|
|
21
|
+
"sideEffects": [
|
|
22
|
+
"*.css",
|
|
23
|
+
"styles.css"
|
|
24
|
+
],
|
|
25
|
+
"type": "module",
|
|
26
|
+
"module": "fesm2022/codeauradev-ngx-wind-charts.mjs",
|
|
27
|
+
"typings": "types/codeauradev-ngx-wind-charts.d.ts",
|
|
28
|
+
"exports": {
|
|
29
|
+
"./styles.css": "./ngx-charts.css",
|
|
30
|
+
"./package.json": {
|
|
31
|
+
"default": "./package.json"
|
|
32
|
+
},
|
|
33
|
+
".": {
|
|
34
|
+
"types": "./types/codeauradev-ngx-wind-charts.d.ts",
|
|
35
|
+
"default": "./fesm2022/codeauradev-ngx-wind-charts.mjs"
|
|
36
|
+
},
|
|
37
|
+
"./map": {
|
|
38
|
+
"types": "./types/codeauradev-ngx-wind-charts-map.d.ts",
|
|
39
|
+
"default": "./fesm2022/codeauradev-ngx-wind-charts-map.mjs"
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
"peerDependencies": {
|
|
43
|
+
"@angular/core": "^22.0.0",
|
|
44
|
+
"tailwindcss": "^4.0.0"
|
|
45
|
+
},
|
|
46
|
+
"peerDependenciesMeta": {
|
|
47
|
+
"tailwindcss": {
|
|
48
|
+
"optional": true
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
"dependencies": {
|
|
52
|
+
"tslib": "^2.8.1"
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
interface CategoryDatum {
|
|
3
|
+
label: string;
|
|
4
|
+
value: number;
|
|
5
|
+
color?: string;
|
|
6
|
+
}
|
|
7
|
+
interface ChartSeries {
|
|
8
|
+
name: string;
|
|
9
|
+
data: number[];
|
|
10
|
+
color?: string;
|
|
11
|
+
}
|
|
12
|
+
interface ScatterPoint {
|
|
13
|
+
x: number;
|
|
14
|
+
y: number;
|
|
15
|
+
label?: string;
|
|
16
|
+
}
|
|
17
|
+
interface ScatterSeries {
|
|
18
|
+
name: string;
|
|
19
|
+
data: ScatterPoint[];
|
|
20
|
+
color?: string;
|
|
21
|
+
}
|
|
22
|
+
type ChartFormatName = 'number' | 'compact' | 'percent' | 'currency';
|
|
23
|
+
type ChartFormat = ChartFormatName | ((value: number) => string);
|
|
24
|
+
type BarMode = 'grouped' | 'stacked';
|
|
25
|
+
type BarOrientation = 'vertical' | 'horizontal';
|
|
26
|
+
type MapLevel = 'state' | 'county' | 'city';
|
|
27
|
+
interface MapDatum {
|
|
28
|
+
id: string;
|
|
29
|
+
value: number;
|
|
30
|
+
}
|
|
31
|
+
interface MapSelection {
|
|
32
|
+
level: MapLevel;
|
|
33
|
+
id: string;
|
|
34
|
+
name: string;
|
|
35
|
+
value: number | null;
|
|
36
|
+
}
|
|
37
|
+
interface LegendItem {
|
|
38
|
+
name: string;
|
|
39
|
+
color: string;
|
|
40
|
+
}
|
|
41
|
+
interface ChartTooltipRow {
|
|
42
|
+
swatch: string;
|
|
43
|
+
label: string;
|
|
44
|
+
value: string;
|
|
45
|
+
}
|
|
46
|
+
interface ChartTooltip {
|
|
47
|
+
x: number;
|
|
48
|
+
y: number;
|
|
49
|
+
title: string;
|
|
50
|
+
rows: ChartTooltipRow[];
|
|
51
|
+
}
|
|
52
|
+
interface NormalizedSeries {
|
|
53
|
+
categories: string[];
|
|
54
|
+
series: ChartSeries[];
|
|
55
|
+
pointColors?: (string | undefined)[];
|
|
56
|
+
}
|
|
57
|
+
interface StateShape {
|
|
58
|
+
id: string;
|
|
59
|
+
code: string;
|
|
60
|
+
name: string;
|
|
61
|
+
d: string;
|
|
62
|
+
box: [number, number, number, number];
|
|
63
|
+
label: [number, number];
|
|
64
|
+
}
|
|
65
|
+
interface CountyShape {
|
|
66
|
+
id: string;
|
|
67
|
+
state: string;
|
|
68
|
+
name: string;
|
|
69
|
+
d: string;
|
|
70
|
+
box: [number, number, number, number];
|
|
71
|
+
label: [number, number];
|
|
72
|
+
}
|
|
73
|
+
interface CityPoint {
|
|
74
|
+
id: string;
|
|
75
|
+
name: string;
|
|
76
|
+
code: string;
|
|
77
|
+
county: string;
|
|
78
|
+
pop: number;
|
|
79
|
+
x: number;
|
|
80
|
+
y: number;
|
|
81
|
+
}
|
|
82
|
+
declare const usaView: [number, number];
|
|
83
|
+
export declare const usaStates: StateShape[];
|
|
84
|
+
export declare const usaCounties: CountyShape[];
|
|
85
|
+
export declare const usaCities: CityPoint[];
|
|
86
|
+
type Box = [number, number, number, number];
|
|
87
|
+
declare function countiesIn(stateId: string): CountyShape[];
|
|
88
|
+
declare function citiesIn(countyId: string): CityPoint[];
|
|
89
|
+
declare function findState(id: string | null | undefined): StateShape | undefined;
|
|
90
|
+
declare function findCounty(id: string | null | undefined, stateId?: string): CountyShape | undefined;
|
|
91
|
+
declare function stateOf(county: CountyShape): StateShape | undefined;
|
|
92
|
+
declare function valueIndex(rows: MapDatum[] | null | undefined): Map<string, number>;
|
|
93
|
+
declare function stateValue(index: Map<string, number>, state: StateShape): number | undefined;
|
|
94
|
+
declare function countyValue(index: Map<string, number>, county: CountyShape, code: string): number | undefined;
|
|
95
|
+
declare function cityValue(index: Map<string, number>, city: CityPoint): number | undefined;
|
|
96
|
+
declare function domainOf(values: number[]): {
|
|
97
|
+
min: number;
|
|
98
|
+
max: number;
|
|
99
|
+
} | null;
|
|
100
|
+
declare function choroplethColor(value: number | null, domain: {
|
|
101
|
+
min: number;
|
|
102
|
+
max: number;
|
|
103
|
+
} | null): string;
|
|
104
|
+
declare function padBox(box: Box, ratio: number): Box;
|
|
105
|
+
declare function unionBox(boxes: Box[]): Box;
|
|
106
|
+
declare function viewBoxOf(box: Box): string;
|
|
107
|
+
declare function labelFits(box: Box, view: Box): boolean;
|
|
108
|
+
declare function markerPercent(value: number | null, domain: {
|
|
109
|
+
min: number;
|
|
110
|
+
max: number;
|
|
111
|
+
} | null): number | null;
|
|
112
|
+
interface DrawnShape {
|
|
113
|
+
id: string;
|
|
114
|
+
name: string;
|
|
115
|
+
d: string;
|
|
116
|
+
label: [number, number];
|
|
117
|
+
box: Box;
|
|
118
|
+
value: number | null;
|
|
119
|
+
color: string;
|
|
120
|
+
text: string;
|
|
121
|
+
showLabel: boolean;
|
|
122
|
+
}
|
|
123
|
+
interface DrawnCity {
|
|
124
|
+
id: string;
|
|
125
|
+
name: string;
|
|
126
|
+
x: number;
|
|
127
|
+
y: number;
|
|
128
|
+
r: number;
|
|
129
|
+
value: number | null;
|
|
130
|
+
color: string;
|
|
131
|
+
text: string;
|
|
132
|
+
showLabel: boolean;
|
|
133
|
+
}
|
|
134
|
+
export declare class NgxUsaMap {
|
|
135
|
+
readonly states: import("@angular/core").InputSignal<MapDatum[]>;
|
|
136
|
+
readonly counties: import("@angular/core").InputSignal<MapDatum[]>;
|
|
137
|
+
readonly cities: import("@angular/core").InputSignal<MapDatum[]>;
|
|
138
|
+
readonly state: import("@angular/core").ModelSignal<string | null>;
|
|
139
|
+
readonly county: import("@angular/core").ModelSignal<string | null>;
|
|
140
|
+
readonly drill: import("@angular/core").InputSignal<boolean>;
|
|
141
|
+
readonly height: import("@angular/core").InputSignal<number>;
|
|
142
|
+
readonly format: import("@angular/core").InputSignal<ChartFormat>;
|
|
143
|
+
readonly currency: import("@angular/core").InputSignal<string>;
|
|
144
|
+
readonly title: import("@angular/core").InputSignal<string | undefined>;
|
|
145
|
+
readonly ariaLabel: import("@angular/core").InputSignal<string>;
|
|
146
|
+
readonly legend: import("@angular/core").InputSignal<string>;
|
|
147
|
+
readonly regionChange: import("@angular/core").OutputEmitterRef<MapSelection>;
|
|
148
|
+
readonly tip: import("@angular/core").WritableSignal<ChartTooltip | null>;
|
|
149
|
+
readonly hot: import("@angular/core").WritableSignal<string | null>;
|
|
150
|
+
readonly hovered: import("@angular/core").WritableSignal<number | null>;
|
|
151
|
+
readonly box: {
|
|
152
|
+
width: import("@angular/core").WritableSignal<number>;
|
|
153
|
+
height: import("@angular/core").WritableSignal<number>;
|
|
154
|
+
};
|
|
155
|
+
readonly headers: string[];
|
|
156
|
+
readonly formatter: import("@angular/core").Signal<(value: number) => string>;
|
|
157
|
+
readonly activeCounty: import("@angular/core").Signal<CountyShape | undefined>;
|
|
158
|
+
readonly activeState: import("@angular/core").Signal<StateShape | undefined>;
|
|
159
|
+
readonly level: import("@angular/core").Signal<"state" | "county" | "city">;
|
|
160
|
+
readonly stateIndex: import("@angular/core").Signal<Map<string, number>>;
|
|
161
|
+
readonly countyIndex: import("@angular/core").Signal<Map<string, number>>;
|
|
162
|
+
readonly cityIndex: import("@angular/core").Signal<Map<string, number>>;
|
|
163
|
+
readonly view: import("@angular/core").Signal<Box>;
|
|
164
|
+
readonly svgView: import("@angular/core").Signal<string>;
|
|
165
|
+
readonly domain: import("@angular/core").Signal<{
|
|
166
|
+
min: number;
|
|
167
|
+
max: number;
|
|
168
|
+
} | null>;
|
|
169
|
+
readonly regions: import("@angular/core").Signal<DrawnShape[]>;
|
|
170
|
+
readonly countyShape: import("@angular/core").Signal<CountyShape | null>;
|
|
171
|
+
readonly citiesDrawn: import("@angular/core").Signal<DrawnCity[]>;
|
|
172
|
+
readonly marker: import("@angular/core").Signal<number | null>;
|
|
173
|
+
readonly labelSize: import("@angular/core").Signal<number>;
|
|
174
|
+
readonly scaleMin: import("@angular/core").Signal<string>;
|
|
175
|
+
readonly scaleMax: import("@angular/core").Signal<string>;
|
|
176
|
+
readonly rows: import("@angular/core").Signal<string[][]>;
|
|
177
|
+
span(box: Box, axis: 0 | 1): number;
|
|
178
|
+
labelGap(): number;
|
|
179
|
+
goCountry(): void;
|
|
180
|
+
goState(): void;
|
|
181
|
+
onRegion(region: DrawnShape, event: PointerEvent): void;
|
|
182
|
+
onCity(city: DrawnCity, event: PointerEvent): void;
|
|
183
|
+
pickRegion(region: DrawnShape): void;
|
|
184
|
+
pickCity(city: DrawnCity): void;
|
|
185
|
+
clearHover(): void;
|
|
186
|
+
private camera;
|
|
187
|
+
private drawRegions;
|
|
188
|
+
private drawCities;
|
|
189
|
+
private shape;
|
|
190
|
+
private visibleValues;
|
|
191
|
+
private tableRows;
|
|
192
|
+
private formatValue;
|
|
193
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgxUsaMap, never>;
|
|
194
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<NgxUsaMap, "ngx-usa-map, ngx-choropleth", never, {
|
|
195
|
+
"states": {
|
|
196
|
+
"alias": "states";
|
|
197
|
+
"required": false;
|
|
198
|
+
"isSignal": true;
|
|
199
|
+
};
|
|
200
|
+
"counties": {
|
|
201
|
+
"alias": "counties";
|
|
202
|
+
"required": false;
|
|
203
|
+
"isSignal": true;
|
|
204
|
+
};
|
|
205
|
+
"cities": {
|
|
206
|
+
"alias": "cities";
|
|
207
|
+
"required": false;
|
|
208
|
+
"isSignal": true;
|
|
209
|
+
};
|
|
210
|
+
"state": {
|
|
211
|
+
"alias": "state";
|
|
212
|
+
"required": false;
|
|
213
|
+
"isSignal": true;
|
|
214
|
+
};
|
|
215
|
+
"county": {
|
|
216
|
+
"alias": "county";
|
|
217
|
+
"required": false;
|
|
218
|
+
"isSignal": true;
|
|
219
|
+
};
|
|
220
|
+
"drill": {
|
|
221
|
+
"alias": "drill";
|
|
222
|
+
"required": false;
|
|
223
|
+
"isSignal": true;
|
|
224
|
+
};
|
|
225
|
+
"height": {
|
|
226
|
+
"alias": "height";
|
|
227
|
+
"required": false;
|
|
228
|
+
"isSignal": true;
|
|
229
|
+
};
|
|
230
|
+
"format": {
|
|
231
|
+
"alias": "format";
|
|
232
|
+
"required": false;
|
|
233
|
+
"isSignal": true;
|
|
234
|
+
};
|
|
235
|
+
"currency": {
|
|
236
|
+
"alias": "currency";
|
|
237
|
+
"required": false;
|
|
238
|
+
"isSignal": true;
|
|
239
|
+
};
|
|
240
|
+
"title": {
|
|
241
|
+
"alias": "title";
|
|
242
|
+
"required": false;
|
|
243
|
+
"isSignal": true;
|
|
244
|
+
};
|
|
245
|
+
"ariaLabel": {
|
|
246
|
+
"alias": "ariaLabel";
|
|
247
|
+
"required": false;
|
|
248
|
+
"isSignal": true;
|
|
249
|
+
};
|
|
250
|
+
"legend": {
|
|
251
|
+
"alias": "legend";
|
|
252
|
+
"required": false;
|
|
253
|
+
"isSignal": true;
|
|
254
|
+
};
|
|
255
|
+
}, {
|
|
256
|
+
"state": "stateChange";
|
|
257
|
+
"county": "countyChange";
|
|
258
|
+
"regionChange": "regionChange";
|
|
259
|
+
}, never, never, true, never>;
|
|
260
|
+
}
|
|
261
|
+
export type { CityPoint, CountyShape, StateShape };
|