@codeauradev/ngx-wind-charts 0.0.0-stage → 1.0.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.
@@ -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 };