@ggterm/core 0.2.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/dist/annotations.d.ts +79 -0
- package/dist/annotations.d.ts.map +1 -0
- package/dist/canvas/canvas.d.ts.map +1 -0
- package/dist/canvas/index.d.ts.map +1 -0
- package/dist/cli-plot.d.ts +14 -0
- package/dist/cli-plot.d.ts.map +1 -0
- package/dist/cli.d.ts +13 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +6485 -0
- package/dist/coords/cartesian.d.ts +96 -0
- package/dist/coords/cartesian.d.ts.map +1 -0
- package/dist/demo.d.ts +6 -0
- package/dist/demo.d.ts.map +1 -0
- package/dist/export/index.d.ts +6 -0
- package/dist/export/index.d.ts.map +1 -0
- package/dist/export/vega-lite.d.ts +87 -0
- package/dist/export/vega-lite.d.ts.map +1 -0
- package/dist/facets/index.d.ts +168 -0
- package/dist/facets/index.d.ts.map +1 -0
- package/dist/geoms/area.d.ts.map +1 -0
- package/dist/geoms/bar.d.ts +38 -0
- package/dist/geoms/bar.d.ts.map +1 -0
- package/dist/geoms/boxplot.d.ts.map +1 -0
- package/dist/geoms/contour.d.ts +33 -0
- package/dist/geoms/contour.d.ts.map +1 -0
- package/dist/geoms/errorbar.d.ts +41 -0
- package/dist/geoms/errorbar.d.ts.map +1 -0
- package/dist/geoms/histogram.d.ts +62 -0
- package/dist/geoms/histogram.d.ts.map +1 -0
- package/dist/geoms/index.d.ts +22 -0
- package/dist/geoms/index.d.ts.map +1 -0
- package/dist/geoms/line.d.ts.map +1 -0
- package/dist/geoms/path.d.ts +59 -0
- package/dist/geoms/path.d.ts.map +1 -0
- package/dist/geoms/point.d.ts +30 -0
- package/dist/geoms/point.d.ts.map +1 -0
- package/dist/geoms/qq.d.ts +75 -0
- package/dist/geoms/qq.d.ts.map +1 -0
- package/dist/geoms/rect.d.ts +37 -0
- package/dist/geoms/rect.d.ts.map +1 -0
- package/dist/geoms/rug.d.ts +65 -0
- package/dist/geoms/rug.d.ts.map +1 -0
- package/dist/geoms/segment.d.ts.map +1 -0
- package/dist/geoms/smooth.d.ts +51 -0
- package/dist/geoms/smooth.d.ts.map +1 -0
- package/dist/geoms/step.d.ts +43 -0
- package/dist/geoms/step.d.ts.map +1 -0
- package/dist/geoms/text.d.ts +23 -0
- package/dist/geoms/text.d.ts.map +1 -0
- package/dist/geoms/tile.d.ts +27 -0
- package/dist/geoms/tile.d.ts.map +1 -0
- package/dist/geoms/violin.d.ts +29 -0
- package/dist/geoms/violin.d.ts.map +1 -0
- package/dist/grammar.d.ts +81 -0
- package/dist/grammar.d.ts.map +1 -0
- package/dist/history/index.d.ts +75 -0
- package/dist/history/index.d.ts.map +1 -0
- package/dist/index.d.ts +37 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +9168 -0
- package/dist/performance/binning.d.ts +112 -0
- package/dist/performance/binning.d.ts.map +1 -0
- package/dist/performance/canvas-diff.d.ts +107 -0
- package/dist/performance/canvas-diff.d.ts.map +1 -0
- package/dist/performance/index.d.ts +14 -0
- package/dist/performance/index.d.ts.map +1 -0
- package/dist/performance/level-of-detail.d.ts +98 -0
- package/dist/performance/level-of-detail.d.ts.map +1 -0
- package/dist/performance/sampling.d.ts +86 -0
- package/dist/performance/sampling.d.ts.map +1 -0
- package/dist/pipeline/index.d.ts +11 -0
- package/dist/pipeline/index.d.ts.map +1 -0
- package/dist/pipeline/pipeline.d.ts.map +1 -0
- package/dist/pipeline/render-axes.d.ts +94 -0
- package/dist/pipeline/render-axes.d.ts.map +1 -0
- package/dist/pipeline/render-geoms.d.ts +121 -0
- package/dist/pipeline/render-geoms.d.ts.map +1 -0
- package/dist/pipeline/scales.d.ts +151 -0
- package/dist/pipeline/scales.d.ts.map +1 -0
- package/dist/positions/index.d.ts +141 -0
- package/dist/positions/index.d.ts.map +1 -0
- package/dist/repl/index.d.ts +6 -0
- package/dist/repl/index.d.ts.map +1 -0
- package/dist/repl/repl.d.ts +161 -0
- package/dist/repl/repl.d.ts.map +1 -0
- package/dist/scales/alpha.d.ts +57 -0
- package/dist/scales/alpha.d.ts.map +1 -0
- package/dist/scales/color.d.ts +260 -0
- package/dist/scales/color.d.ts.map +1 -0
- package/dist/scales/continuous.d.ts +60 -0
- package/dist/scales/continuous.d.ts.map +1 -0
- package/dist/scales/datetime.d.ts +60 -0
- package/dist/scales/datetime.d.ts.map +1 -0
- package/dist/scales/discrete.d.ts +36 -0
- package/dist/scales/discrete.d.ts.map +1 -0
- package/dist/scales/index.d.ts +11 -0
- package/dist/scales/index.d.ts.map +1 -0
- package/dist/scales/shape.d.ts +43 -0
- package/dist/scales/shape.d.ts.map +1 -0
- package/dist/scales/size.d.ts +43 -0
- package/dist/scales/size.d.ts.map +1 -0
- package/dist/stats/bin.d.ts.map +1 -0
- package/dist/stats/boxplot.d.ts.map +1 -0
- package/dist/stats/count.d.ts +21 -0
- package/dist/stats/count.d.ts.map +1 -0
- package/dist/stats/density.d.ts +36 -0
- package/dist/stats/density.d.ts.map +1 -0
- package/dist/stats/index.d.ts +18 -0
- package/dist/stats/index.d.ts.map +1 -0
- package/dist/stats/qq.d.ts +47 -0
- package/dist/stats/qq.d.ts.map +1 -0
- package/dist/stats/smooth.d.ts.map +1 -0
- package/dist/stats/summary.d.ts.map +1 -0
- package/dist/streaming/data-buffer.d.ts +121 -0
- package/dist/streaming/data-buffer.d.ts.map +1 -0
- package/dist/streaming/data-window.d.ts +133 -0
- package/dist/streaming/data-window.d.ts.map +1 -0
- package/dist/streaming/index.d.ts +14 -0
- package/dist/streaming/index.d.ts.map +1 -0
- package/dist/streaming/rolling-aggregator.d.ts +116 -0
- package/dist/streaming/rolling-aggregator.d.ts.map +1 -0
- package/dist/streaming/streaming-plot.d.ts +194 -0
- package/dist/streaming/streaming-plot.d.ts.map +1 -0
- package/dist/terminal/capabilities.d.ts +89 -0
- package/dist/terminal/capabilities.d.ts.map +1 -0
- package/dist/terminal/colors.d.ts +82 -0
- package/dist/terminal/colors.d.ts.map +1 -0
- package/dist/terminal/index.d.ts +12 -0
- package/dist/terminal/index.d.ts.map +1 -0
- package/dist/terminal/renderer-chain.d.ts +110 -0
- package/dist/terminal/renderer-chain.d.ts.map +1 -0
- package/dist/themes/default.d.ts.map +1 -0
- package/dist/types.d.ts +198 -0
- package/dist/types.d.ts.map +1 -0
- package/package.json +50 -0
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Color scales
|
|
3
|
+
*
|
|
4
|
+
* Provides a comprehensive set of color palettes for data visualization,
|
|
5
|
+
* including sequential, diverging, and categorical palettes.
|
|
6
|
+
*/
|
|
7
|
+
import type { Scale } from '../types';
|
|
8
|
+
declare const PALETTES: {
|
|
9
|
+
viridis: string[];
|
|
10
|
+
plasma: string[];
|
|
11
|
+
inferno: string[];
|
|
12
|
+
magma: string[];
|
|
13
|
+
cividis: string[];
|
|
14
|
+
turbo: string[];
|
|
15
|
+
Blues: string[];
|
|
16
|
+
Greens: string[];
|
|
17
|
+
Greys: string[];
|
|
18
|
+
Oranges: string[];
|
|
19
|
+
Purples: string[];
|
|
20
|
+
Reds: string[];
|
|
21
|
+
BuGn: string[];
|
|
22
|
+
BuPu: string[];
|
|
23
|
+
GnBu: string[];
|
|
24
|
+
OrRd: string[];
|
|
25
|
+
PuBu: string[];
|
|
26
|
+
PuBuGn: string[];
|
|
27
|
+
PuRd: string[];
|
|
28
|
+
RdPu: string[];
|
|
29
|
+
YlGn: string[];
|
|
30
|
+
YlGnBu: string[];
|
|
31
|
+
YlOrBr: string[];
|
|
32
|
+
YlOrRd: string[];
|
|
33
|
+
BrBG: string[];
|
|
34
|
+
PiYG: string[];
|
|
35
|
+
PRGn: string[];
|
|
36
|
+
PuOr: string[];
|
|
37
|
+
RdBu: string[];
|
|
38
|
+
RdGy: string[];
|
|
39
|
+
RdYlBu: string[];
|
|
40
|
+
RdYlGn: string[];
|
|
41
|
+
Spectral: string[];
|
|
42
|
+
category10: string[];
|
|
43
|
+
category20: string[];
|
|
44
|
+
Accent: string[];
|
|
45
|
+
Dark2: string[];
|
|
46
|
+
Paired: string[];
|
|
47
|
+
Pastel1: string[];
|
|
48
|
+
Pastel2: string[];
|
|
49
|
+
Set1: string[];
|
|
50
|
+
Set2: string[];
|
|
51
|
+
Set3: string[];
|
|
52
|
+
Tab10: string[];
|
|
53
|
+
Tab20: string[];
|
|
54
|
+
thermal: string[];
|
|
55
|
+
haline: string[];
|
|
56
|
+
terrain: string[];
|
|
57
|
+
rainbow: string[];
|
|
58
|
+
cubehelix: string[];
|
|
59
|
+
};
|
|
60
|
+
export interface ColorContinuousOptions {
|
|
61
|
+
palette?: keyof typeof PALETTES | string[];
|
|
62
|
+
limits?: [number, number];
|
|
63
|
+
na_value?: string;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Continuous color scale
|
|
67
|
+
*/
|
|
68
|
+
export declare function scale_color_continuous(options?: ColorContinuousOptions): Scale;
|
|
69
|
+
/**
|
|
70
|
+
* Viridis color scale
|
|
71
|
+
*/
|
|
72
|
+
export declare function scale_color_viridis(options?: Omit<ColorContinuousOptions, 'palette'>): Scale;
|
|
73
|
+
/**
|
|
74
|
+
* Ordering strategy for discrete color scales
|
|
75
|
+
*/
|
|
76
|
+
export type ColorDiscreteOrder = 'alphabetical' | 'data' | 'frequency' | 'reverse';
|
|
77
|
+
export interface ColorDiscreteOptions {
|
|
78
|
+
palette?: keyof typeof PALETTES | string[];
|
|
79
|
+
na_value?: string;
|
|
80
|
+
/** Explicit order of categories */
|
|
81
|
+
limits?: string[];
|
|
82
|
+
/** Ordering strategy when limits not provided */
|
|
83
|
+
order?: ColorDiscreteOrder;
|
|
84
|
+
/** Reverse the order */
|
|
85
|
+
reverse?: boolean;
|
|
86
|
+
/** Exclude specific categories */
|
|
87
|
+
exclude?: string[];
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Discrete color scale with ordering support
|
|
91
|
+
*/
|
|
92
|
+
export declare function scale_color_discrete(options?: ColorDiscreteOptions): Scale & {
|
|
93
|
+
orderOptions?: ColorDiscreteOptions;
|
|
94
|
+
};
|
|
95
|
+
export interface ColorManualOptions {
|
|
96
|
+
values: Record<string, string>;
|
|
97
|
+
na_value?: string;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Manual color scale with explicit mappings
|
|
101
|
+
*/
|
|
102
|
+
export declare function scale_color_manual(options: ColorManualOptions): Scale;
|
|
103
|
+
export declare function scale_fill_continuous(options?: ColorContinuousOptions): Scale;
|
|
104
|
+
export declare function scale_fill_viridis(options?: Omit<ColorContinuousOptions, 'palette'>): Scale;
|
|
105
|
+
export declare function scale_fill_discrete(options?: ColorDiscreteOptions): Scale;
|
|
106
|
+
export declare function scale_fill_manual(options: ColorManualOptions): Scale;
|
|
107
|
+
export type BrewerPalette = 'Blues' | 'Greens' | 'Greys' | 'Oranges' | 'Purples' | 'Reds' | 'BuGn' | 'BuPu' | 'GnBu' | 'OrRd' | 'PuBu' | 'PuBuGn' | 'PuRd' | 'RdPu' | 'YlGn' | 'YlGnBu' | 'YlOrBr' | 'YlOrRd' | 'BrBG' | 'PiYG' | 'PRGn' | 'PuOr' | 'RdBu' | 'RdGy' | 'RdYlBu' | 'RdYlGn' | 'Spectral' | 'Accent' | 'Dark2' | 'Paired' | 'Pastel1' | 'Pastel2' | 'Set1' | 'Set2' | 'Set3';
|
|
108
|
+
export interface BrewerOptions {
|
|
109
|
+
palette?: BrewerPalette;
|
|
110
|
+
direction?: 1 | -1;
|
|
111
|
+
na_value?: string;
|
|
112
|
+
/** Explicit order of categories */
|
|
113
|
+
limits?: string[];
|
|
114
|
+
/** Ordering strategy when limits not provided */
|
|
115
|
+
order?: ColorDiscreteOrder;
|
|
116
|
+
/** Reverse the order */
|
|
117
|
+
reverse?: boolean;
|
|
118
|
+
/** Exclude specific categories */
|
|
119
|
+
exclude?: string[];
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* ColorBrewer scale for discrete data (categorical palettes)
|
|
123
|
+
* Use this for categorical/qualitative data with ordering support
|
|
124
|
+
*/
|
|
125
|
+
export declare function scale_color_brewer(options?: BrewerOptions): Scale & {
|
|
126
|
+
orderOptions?: BrewerOptions;
|
|
127
|
+
};
|
|
128
|
+
export declare function scale_fill_brewer(options?: BrewerOptions): Scale;
|
|
129
|
+
export interface DistillerOptions {
|
|
130
|
+
palette?: BrewerPalette;
|
|
131
|
+
direction?: 1 | -1;
|
|
132
|
+
limits?: [number, number];
|
|
133
|
+
na_value?: string;
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* ColorBrewer scale for continuous data (distiller)
|
|
137
|
+
* Interpolates between palette colors for continuous values
|
|
138
|
+
*/
|
|
139
|
+
export declare function scale_color_distiller(options?: DistillerOptions): Scale;
|
|
140
|
+
export declare function scale_fill_distiller(options?: DistillerOptions): Scale;
|
|
141
|
+
export interface GradientOptions {
|
|
142
|
+
low?: string;
|
|
143
|
+
high?: string;
|
|
144
|
+
limits?: [number, number];
|
|
145
|
+
na_value?: string;
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Two-color gradient scale
|
|
149
|
+
* Creates a smooth gradient from low to high color
|
|
150
|
+
*/
|
|
151
|
+
export declare function scale_color_gradient(options?: GradientOptions): Scale;
|
|
152
|
+
export declare function scale_fill_gradient(options?: GradientOptions): Scale;
|
|
153
|
+
export interface Gradient2Options {
|
|
154
|
+
low?: string;
|
|
155
|
+
mid?: string;
|
|
156
|
+
high?: string;
|
|
157
|
+
midpoint?: number;
|
|
158
|
+
limits?: [number, number];
|
|
159
|
+
na_value?: string;
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Three-color diverging gradient scale
|
|
163
|
+
* Creates a gradient from low through mid to high color
|
|
164
|
+
*/
|
|
165
|
+
export declare function scale_color_gradient2(options?: Gradient2Options): Scale;
|
|
166
|
+
export declare function scale_fill_gradient2(options?: Gradient2Options): Scale;
|
|
167
|
+
export interface GradientNOptions {
|
|
168
|
+
colors: string[];
|
|
169
|
+
limits?: [number, number];
|
|
170
|
+
na_value?: string;
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* N-color gradient scale
|
|
174
|
+
* Creates a smooth gradient through multiple colors
|
|
175
|
+
*/
|
|
176
|
+
export declare function scale_color_gradientn(options: GradientNOptions): Scale;
|
|
177
|
+
export declare function scale_fill_gradientn(options: GradientNOptions): Scale;
|
|
178
|
+
export type ViridisOption = 'viridis' | 'magma' | 'plasma' | 'inferno' | 'cividis' | 'turbo';
|
|
179
|
+
export interface ViridisOptions {
|
|
180
|
+
option?: ViridisOption;
|
|
181
|
+
direction?: 1 | -1;
|
|
182
|
+
limits?: [number, number];
|
|
183
|
+
na_value?: string;
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Viridis family color scales (perceptually uniform, colorblind-friendly)
|
|
187
|
+
*/
|
|
188
|
+
export declare function scale_color_viridis_c(options?: ViridisOptions): Scale;
|
|
189
|
+
export declare function scale_fill_viridis_c(options?: ViridisOptions): Scale;
|
|
190
|
+
/**
|
|
191
|
+
* Plasma color scale
|
|
192
|
+
*/
|
|
193
|
+
export declare function scale_color_plasma(options?: Omit<ViridisOptions, 'option'>): Scale;
|
|
194
|
+
export declare function scale_fill_plasma(options?: Omit<ViridisOptions, 'option'>): Scale;
|
|
195
|
+
/**
|
|
196
|
+
* Inferno color scale
|
|
197
|
+
*/
|
|
198
|
+
export declare function scale_color_inferno(options?: Omit<ViridisOptions, 'option'>): Scale;
|
|
199
|
+
export declare function scale_fill_inferno(options?: Omit<ViridisOptions, 'option'>): Scale;
|
|
200
|
+
/**
|
|
201
|
+
* Magma color scale
|
|
202
|
+
*/
|
|
203
|
+
export declare function scale_color_magma(options?: Omit<ViridisOptions, 'option'>): Scale;
|
|
204
|
+
export declare function scale_fill_magma(options?: Omit<ViridisOptions, 'option'>): Scale;
|
|
205
|
+
/**
|
|
206
|
+
* Cividis color scale (optimized for color vision deficiency)
|
|
207
|
+
*/
|
|
208
|
+
export declare function scale_color_cividis(options?: Omit<ViridisOptions, 'option'>): Scale;
|
|
209
|
+
export declare function scale_fill_cividis(options?: Omit<ViridisOptions, 'option'>): Scale;
|
|
210
|
+
/**
|
|
211
|
+
* Turbo color scale (rainbow-like but more perceptually uniform)
|
|
212
|
+
*/
|
|
213
|
+
export declare function scale_color_turbo(options?: Omit<ViridisOptions, 'option'>): Scale;
|
|
214
|
+
export declare function scale_fill_turbo(options?: Omit<ViridisOptions, 'option'>): Scale;
|
|
215
|
+
export interface GreyOptions {
|
|
216
|
+
start?: number;
|
|
217
|
+
end?: number;
|
|
218
|
+
limits?: [number, number];
|
|
219
|
+
na_value?: string;
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* Grey/Grayscale for continuous data
|
|
223
|
+
*/
|
|
224
|
+
export declare function scale_color_grey(options?: GreyOptions): Scale;
|
|
225
|
+
export declare const scale_color_gray: typeof scale_color_grey;
|
|
226
|
+
export declare function scale_fill_grey(options?: GreyOptions): Scale;
|
|
227
|
+
export declare const scale_fill_gray: typeof scale_fill_grey;
|
|
228
|
+
/**
|
|
229
|
+
* Identity color scale - uses data values directly as color specifications
|
|
230
|
+
* Data should contain valid hex colors like '#ff0000'
|
|
231
|
+
*/
|
|
232
|
+
export declare function scale_color_identity(): Scale;
|
|
233
|
+
export declare function scale_fill_identity(): Scale;
|
|
234
|
+
export interface HueOptions {
|
|
235
|
+
h?: [number, number];
|
|
236
|
+
c?: number;
|
|
237
|
+
l?: number;
|
|
238
|
+
limits?: [number, number];
|
|
239
|
+
na_value?: string;
|
|
240
|
+
}
|
|
241
|
+
/**
|
|
242
|
+
* Hue-based color scale for cyclical data
|
|
243
|
+
* Varies hue while keeping saturation and lightness constant
|
|
244
|
+
*/
|
|
245
|
+
export declare function scale_color_hue(options?: HueOptions): Scale;
|
|
246
|
+
export declare function scale_fill_hue(options?: HueOptions): Scale;
|
|
247
|
+
/**
|
|
248
|
+
* Get list of available palette names
|
|
249
|
+
*/
|
|
250
|
+
export declare function getAvailablePalettes(): string[];
|
|
251
|
+
/**
|
|
252
|
+
* Get colors for a specific palette
|
|
253
|
+
*/
|
|
254
|
+
export declare function getPaletteColors(name: string): string[] | undefined;
|
|
255
|
+
/**
|
|
256
|
+
* Export palette type for external use
|
|
257
|
+
*/
|
|
258
|
+
export type PaletteName = keyof typeof PALETTES;
|
|
259
|
+
export {};
|
|
260
|
+
//# sourceMappingURL=color.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"color.d.ts","sourceRoot":"","sources":["../../src/scales/color.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAQ,MAAM,UAAU,CAAA;AAG3C,QAAA,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+Fb,CAAA;AA4BD,MAAM,WAAW,sBAAsB;IACrC,OAAO,CAAC,EAAE,MAAM,OAAO,QAAQ,GAAG,MAAM,EAAE,CAAA;IAC1C,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CACpC,OAAO,GAAE,sBAA2B,GACnC,KAAK,CA6BP;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,GAAE,IAAI,CAAC,sBAAsB,EAAE,SAAS,CAAM,GACpD,KAAK,CAEP;AAED;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAC1B,cAAc,GACd,MAAM,GACN,WAAW,GACX,SAAS,CAAA;AAEb,MAAM,WAAW,oBAAoB;IACnC,OAAO,CAAC,EAAE,MAAM,OAAO,QAAQ,GAAG,MAAM,EAAE,CAAA;IAC1C,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,mCAAmC;IACnC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;IACjB,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CAAA;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,GAAE,WAAgB,GAAG,KAAK,CAgBjE;AAGD,eAAO,MAAM,gBAAgB,yBAAmB,CAAA;AAEhD,wBAAgB,eAAe,CAAC,OAAO,GAAE,WAAgB,GAAG,KAAK,CAGhE;AAED,eAAO,MAAM,eAAe,wBAAkB,CAAA;AAM9C;;;GAGG;AACH,wBAAgB,oBAAoB,IAAI,KAAK,CAS5C;AAED,wBAAgB,mBAAmB,IAAI,KAAK,CAG3C;AAMD,MAAM,WAAW,UAAU;IACzB,CAAC,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACpB,CAAC,CAAC,EAAE,MAAM,CAAA;IACV,CAAC,CAAC,EAAE,MAAM,CAAA;IACV,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,OAAO,GAAE,UAAe,GAAG,KAAK,CAiB/D;AAED,wBAAgB,cAAc,CAAC,OAAO,GAAE,UAAe,GAAG,KAAK,CAG9D;AAkCD;;GAEG;AACH,wBAAgB,oBAAoB,IAAI,MAAM,EAAE,CAE/C;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAEnE;AAED;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,OAAO,QAAQ,CAAA"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Continuous scales
|
|
3
|
+
*/
|
|
4
|
+
import type { Scale } from '../types';
|
|
5
|
+
export interface ContinuousScaleOptions {
|
|
6
|
+
limits?: [number, number];
|
|
7
|
+
breaks?: number[];
|
|
8
|
+
labels?: string[];
|
|
9
|
+
trans?: 'identity' | 'log10' | 'sqrt' | 'reverse';
|
|
10
|
+
expand?: [number, number];
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Continuous x-axis scale
|
|
14
|
+
*/
|
|
15
|
+
export declare function scale_x_continuous(options?: ContinuousScaleOptions): Scale;
|
|
16
|
+
/**
|
|
17
|
+
* Continuous y-axis scale
|
|
18
|
+
*/
|
|
19
|
+
export declare function scale_y_continuous(options?: ContinuousScaleOptions): Scale;
|
|
20
|
+
/**
|
|
21
|
+
* Log10 x-axis scale
|
|
22
|
+
*/
|
|
23
|
+
export declare function scale_x_log10(options?: Omit<ContinuousScaleOptions, 'trans'>): Scale;
|
|
24
|
+
/**
|
|
25
|
+
* Log10 y-axis scale
|
|
26
|
+
*/
|
|
27
|
+
export declare function scale_y_log10(options?: Omit<ContinuousScaleOptions, 'trans'>): Scale;
|
|
28
|
+
/**
|
|
29
|
+
* Square root x-axis scale
|
|
30
|
+
*/
|
|
31
|
+
export declare function scale_x_sqrt(options?: Omit<ContinuousScaleOptions, 'trans'>): Scale;
|
|
32
|
+
/**
|
|
33
|
+
* Square root y-axis scale
|
|
34
|
+
*/
|
|
35
|
+
export declare function scale_y_sqrt(options?: Omit<ContinuousScaleOptions, 'trans'>): Scale;
|
|
36
|
+
/**
|
|
37
|
+
* Reversed x-axis scale
|
|
38
|
+
*/
|
|
39
|
+
export declare function scale_x_reverse(options?: Omit<ContinuousScaleOptions, 'trans'>): Scale;
|
|
40
|
+
/**
|
|
41
|
+
* Reversed y-axis scale
|
|
42
|
+
*/
|
|
43
|
+
export declare function scale_y_reverse(options?: Omit<ContinuousScaleOptions, 'trans'>): Scale;
|
|
44
|
+
/**
|
|
45
|
+
* Secondary y-axis continuous scale
|
|
46
|
+
*/
|
|
47
|
+
export declare function scale_y2_continuous(options?: ContinuousScaleOptions): Scale;
|
|
48
|
+
/**
|
|
49
|
+
* Secondary y-axis log10 scale
|
|
50
|
+
*/
|
|
51
|
+
export declare function scale_y2_log10(options?: Omit<ContinuousScaleOptions, 'trans'>): Scale;
|
|
52
|
+
/**
|
|
53
|
+
* Secondary y-axis sqrt scale
|
|
54
|
+
*/
|
|
55
|
+
export declare function scale_y2_sqrt(options?: Omit<ContinuousScaleOptions, 'trans'>): Scale;
|
|
56
|
+
/**
|
|
57
|
+
* Secondary y-axis reversed scale
|
|
58
|
+
*/
|
|
59
|
+
export declare function scale_y2_reverse(options?: Omit<ContinuousScaleOptions, 'trans'>): Scale;
|
|
60
|
+
//# sourceMappingURL=continuous.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"continuous.d.ts","sourceRoot":"","sources":["../../src/scales/continuous.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAkB,MAAM,UAAU,CAAA;AAErD,MAAM,WAAW,sBAAsB;IACrC,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACzB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;IACjB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;IACjB,KAAK,CAAC,EAAE,UAAU,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,CAAA;IACjD,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAC1B;AAmDD;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,GAAE,sBAA2B,GACnC,KAAK,CAEP;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,GAAE,sBAA2B,GACnC,KAAK,CAEP;AAED;;GAEG;AACH,wBAAgB,aAAa,CAC3B,OAAO,GAAE,IAAI,CAAC,sBAAsB,EAAE,OAAO,CAAM,GAClD,KAAK,CAEP;AAED;;GAEG;AACH,wBAAgB,aAAa,CAC3B,OAAO,GAAE,IAAI,CAAC,sBAAsB,EAAE,OAAO,CAAM,GAClD,KAAK,CAEP;AAED;;GAEG;AACH,wBAAgB,YAAY,CAC1B,OAAO,GAAE,IAAI,CAAC,sBAAsB,EAAE,OAAO,CAAM,GAClD,KAAK,CAEP;AAED;;GAEG;AACH,wBAAgB,YAAY,CAC1B,OAAO,GAAE,IAAI,CAAC,sBAAsB,EAAE,OAAO,CAAM,GAClD,KAAK,CAEP;AAED;;GAEG;AACH,wBAAgB,eAAe,CAC7B,OAAO,GAAE,IAAI,CAAC,sBAAsB,EAAE,OAAO,CAAM,GAClD,KAAK,CAEP;AAED;;GAEG;AACH,wBAAgB,eAAe,CAC7B,OAAO,GAAE,IAAI,CAAC,sBAAsB,EAAE,OAAO,CAAM,GAClD,KAAK,CAEP;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,GAAE,sBAA2B,GACnC,KAAK,CAEP;AAED;;GAEG;AACH,wBAAgB,cAAc,CAC5B,OAAO,GAAE,IAAI,CAAC,sBAAsB,EAAE,OAAO,CAAM,GAClD,KAAK,CAEP;AAED;;GAEG;AACH,wBAAgB,aAAa,CAC3B,OAAO,GAAE,IAAI,CAAC,sBAAsB,EAAE,OAAO,CAAM,GAClD,KAAK,CAEP;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,GAAE,IAAI,CAAC,sBAAsB,EAAE,OAAO,CAAM,GAClD,KAAK,CAEP"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Date/Time scales
|
|
3
|
+
*
|
|
4
|
+
* Maps date/time values to plot coordinates with intelligent tick formatting.
|
|
5
|
+
*/
|
|
6
|
+
import type { Scale } from '../types';
|
|
7
|
+
/**
|
|
8
|
+
* Format a date value based on the time span
|
|
9
|
+
*/
|
|
10
|
+
export declare function formatDateTime(ms: number, spanMs: number): string;
|
|
11
|
+
/**
|
|
12
|
+
* Calculate nice tick positions for a time range
|
|
13
|
+
*/
|
|
14
|
+
export declare function calculateDateTimeTicks(minMs: number, maxMs: number, targetTicks?: number): number[];
|
|
15
|
+
export interface DateTimeScaleOptions {
|
|
16
|
+
/** Domain [min, max] as dates, numbers, or strings */
|
|
17
|
+
domain?: [Date | number | string, Date | number | string];
|
|
18
|
+
/** Time zone (default: local) */
|
|
19
|
+
timezone?: string;
|
|
20
|
+
/** Date format string */
|
|
21
|
+
format?: string;
|
|
22
|
+
/** Axis label */
|
|
23
|
+
name?: string;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* X-axis date/time scale
|
|
27
|
+
*/
|
|
28
|
+
export declare function scale_x_datetime(options?: DateTimeScaleOptions): Scale;
|
|
29
|
+
/**
|
|
30
|
+
* Y-axis date/time scale
|
|
31
|
+
*/
|
|
32
|
+
export declare function scale_y_datetime(options?: DateTimeScaleOptions): Scale;
|
|
33
|
+
/**
|
|
34
|
+
* Date scale (no time component)
|
|
35
|
+
*/
|
|
36
|
+
export declare function scale_x_date(options?: DateTimeScaleOptions): Scale;
|
|
37
|
+
export declare function scale_y_date(options?: DateTimeScaleOptions): Scale;
|
|
38
|
+
/**
|
|
39
|
+
* Time scale (time of day, ignoring date)
|
|
40
|
+
*/
|
|
41
|
+
export interface TimeScaleOptions {
|
|
42
|
+
/** Domain as hours [0-24, 0-24] */
|
|
43
|
+
domain?: [number, number];
|
|
44
|
+
/** Axis label */
|
|
45
|
+
name?: string;
|
|
46
|
+
}
|
|
47
|
+
export declare function scale_x_time(options?: TimeScaleOptions): Scale;
|
|
48
|
+
export declare function scale_y_time(options?: TimeScaleOptions): Scale;
|
|
49
|
+
/**
|
|
50
|
+
* Duration scale (time spans)
|
|
51
|
+
*/
|
|
52
|
+
export interface DurationScaleOptions {
|
|
53
|
+
/** Unit to display: 'auto', 'seconds', 'minutes', 'hours', 'days' */
|
|
54
|
+
unit?: 'auto' | 'milliseconds' | 'seconds' | 'minutes' | 'hours' | 'days';
|
|
55
|
+
/** Axis label */
|
|
56
|
+
name?: string;
|
|
57
|
+
}
|
|
58
|
+
export declare function scale_x_duration(options?: DurationScaleOptions): Scale;
|
|
59
|
+
export declare function scale_y_duration(options?: DurationScaleOptions): Scale;
|
|
60
|
+
//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AAC,OAAO,GAAE,gBAAqB,GAAG,KAAK,CAgClE;AAED,wBAAgB,YAAY,CAAC,OAAO,GAAE,gBAAqB,GAAG,KAAK,CAIlE;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,qEAAqE;IACrE,IAAI,CAAC,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,MAAM,CAAA;IACzE,iBAAiB;IACjB,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED,wBAAgB,gBAAgB,CAAC,OAAO,GAAE,oBAAyB,GAAG,KAAK,CAkC1E;AAED,wBAAgB,gBAAgB,CAAC,OAAO,GAAE,oBAAyB,GAAG,KAAK,CAI1E"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Discrete (categorical) scales
|
|
3
|
+
*
|
|
4
|
+
* Supports ordering categories through:
|
|
5
|
+
* - limits: Explicit order of categories
|
|
6
|
+
* - order: Automatic ordering strategy
|
|
7
|
+
* - reverse: Reverse the order
|
|
8
|
+
*/
|
|
9
|
+
import type { Scale } from '../types';
|
|
10
|
+
/**
|
|
11
|
+
* Ordering strategy for discrete scales
|
|
12
|
+
*/
|
|
13
|
+
export type DiscreteOrder = 'alphabetical' | 'data' | 'frequency' | 'reverse';
|
|
14
|
+
export interface DiscreteScaleOptions {
|
|
15
|
+
/** Explicit order of categories (overrides order option) */
|
|
16
|
+
limits?: string[];
|
|
17
|
+
/** Custom labels for each category (must match limits length) */
|
|
18
|
+
labels?: string[];
|
|
19
|
+
/** Whether to drop unused levels (default: true) */
|
|
20
|
+
drop?: boolean;
|
|
21
|
+
/** Ordering strategy when limits not provided */
|
|
22
|
+
order?: DiscreteOrder;
|
|
23
|
+
/** Reverse the order (applied after order/limits) */
|
|
24
|
+
reverse?: boolean;
|
|
25
|
+
/** Exclude specific categories */
|
|
26
|
+
exclude?: string[];
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Discrete x-axis scale
|
|
30
|
+
*/
|
|
31
|
+
export declare function scale_x_discrete(options?: DiscreteScaleOptions): Scale;
|
|
32
|
+
/**
|
|
33
|
+
* Discrete y-axis scale
|
|
34
|
+
*/
|
|
35
|
+
export declare function scale_y_discrete(options?: DiscreteScaleOptions): Scale;
|
|
36
|
+
//# sourceMappingURL=discrete.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"discrete.d.ts","sourceRoot":"","sources":["../../src/scales/discrete.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AAErC;;GAEG;AACH,MAAM,MAAM,aAAa,GACrB,cAAc,GACd,MAAM,GACN,WAAW,GACX,SAAS,CAAA;AAEb,MAAM,WAAW,oBAAoB;IACnC,4DAA4D;IAC5D,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;IACjB,iEAAiE;IACjE,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;IACjB,oDAAoD;IACpD,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,iDAAiD;IACjD,KAAK,CAAC,EAAE,aAAa,CAAA;IACrB,qDAAqD;IACrD,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,kCAAkC;IAClC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;CACnB;AAiED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,GAAE,oBAAyB,GAAG,KAAK,CAE1E;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,GAAE,oBAAyB,GAAG,KAAK,CAE1E"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Scale exports
|
|
3
|
+
*/
|
|
4
|
+
export { scale_x_continuous, scale_y_continuous, scale_x_log10, scale_y_log10, scale_x_sqrt, scale_y_sqrt, scale_x_reverse, scale_y_reverse, scale_y2_continuous, scale_y2_log10, scale_y2_sqrt, scale_y2_reverse, type ContinuousScaleOptions, } from './continuous';
|
|
5
|
+
export { scale_x_discrete, scale_y_discrete, type DiscreteScaleOptions, type DiscreteOrder, } from './discrete';
|
|
6
|
+
export { scale_color_continuous, scale_color_viridis, scale_color_discrete, scale_color_manual, scale_fill_continuous, scale_fill_viridis, scale_fill_discrete, scale_fill_manual, scale_color_brewer, scale_fill_brewer, scale_color_distiller, scale_fill_distiller, scale_color_gradient, scale_fill_gradient, scale_color_gradient2, scale_fill_gradient2, scale_color_gradientn, scale_fill_gradientn, scale_color_viridis_c, scale_fill_viridis_c, scale_color_plasma, scale_fill_plasma, scale_color_inferno, scale_fill_inferno, scale_color_magma, scale_fill_magma, scale_color_cividis, scale_fill_cividis, scale_color_turbo, scale_fill_turbo, scale_color_grey, scale_color_gray, scale_fill_grey, scale_fill_gray, scale_color_identity, scale_fill_identity, scale_color_hue, scale_fill_hue, getAvailablePalettes, getPaletteColors, type ColorContinuousOptions, type ColorDiscreteOptions, type ColorManualOptions, type BrewerPalette, type BrewerOptions, type DistillerOptions, type GradientOptions, type Gradient2Options, type GradientNOptions, type ViridisOption, type ViridisOptions, type GreyOptions, type HueOptions, type PaletteName, } from './color';
|
|
7
|
+
export { scale_size_continuous, scale_size_area, scale_size_radius, scale_size_identity, scale_size_binned, type SizeScaleOptions, type BinnedSizeOptions, } from './size';
|
|
8
|
+
export { scale_shape_discrete, scale_shape_manual, scale_shape_identity, scale_shape_ordinal, DEFAULT_SHAPES, SHAPE_CHARS, type ShapeScaleOptions, type ManualShapeOptions, } from './shape';
|
|
9
|
+
export { scale_alpha_continuous, scale_alpha, scale_alpha_identity, scale_alpha_discrete, scale_alpha_manual, scale_alpha_binned, type AlphaScaleOptions, type DiscreteAlphaOptions, type ManualAlphaOptions, type BinnedAlphaOptions, } from './alpha';
|
|
10
|
+
export { scale_x_datetime, scale_y_datetime, scale_x_date, scale_y_date, scale_x_time, scale_y_time, scale_x_duration, scale_y_duration, formatDateTime, calculateDateTimeTicks, type DateTimeScaleOptions, type TimeScaleOptions, type DurationScaleOptions, } from './datetime';
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/scales/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,kBAAkB,EAClB,kBAAkB,EAClB,aAAa,EACb,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,eAAe,EACf,eAAe,EAEf,mBAAmB,EACnB,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,KAAK,sBAAsB,GAC5B,MAAM,cAAc,CAAA;AAErB,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,KAAK,oBAAoB,EACzB,KAAK,aAAa,GACnB,MAAM,YAAY,CAAA;AAEnB,OAAO,EAEL,sBAAsB,EACtB,mBAAmB,EACnB,oBAAoB,EACpB,kBAAkB,EAClB,qBAAqB,EACrB,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EAEjB,kBAAkB,EAClB,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,EAEpB,oBAAoB,EACpB,mBAAmB,EACnB,qBAAqB,EACrB,oBAAoB,EACpB,qBAAqB,EACrB,oBAAoB,EAEpB,qBAAqB,EACrB,oBAAoB,EACpB,kBAAkB,EAClB,iBAAiB,EACjB,mBAAmB,EACnB,kBAAkB,EAClB,iBAAiB,EACjB,gBAAgB,EAChB,mBAAmB,EACnB,kBAAkB,EAClB,iBAAiB,EACjB,gBAAgB,EAEhB,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,eAAe,EAEf,oBAAoB,EACpB,mBAAmB,EACnB,eAAe,EACf,cAAc,EAEd,oBAAoB,EACpB,gBAAgB,EAEhB,KAAK,sBAAsB,EAC3B,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EACvB,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,WAAW,GACjB,MAAM,SAAS,CAAA;AAGhB,OAAO,EACL,qBAAqB,EACrB,eAAe,EACf,iBAAiB,EACjB,mBAAmB,EACnB,iBAAiB,EACjB,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,GACvB,MAAM,QAAQ,CAAA;AAEf,OAAO,EACL,oBAAoB,EACpB,kBAAkB,EAClB,oBAAoB,EACpB,mBAAmB,EACnB,cAAc,EACd,WAAW,EACX,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,GACxB,MAAM,SAAS,CAAA;AAEhB,OAAO,EACL,sBAAsB,EACtB,WAAW,EACX,oBAAoB,EACpB,oBAAoB,EACpB,kBAAkB,EAClB,kBAAkB,EAClB,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,GACxB,MAAM,SAAS,CAAA;AAEhB,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,EACd,sBAAsB,EACtB,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,GAC1B,MAAM,YAAY,CAAA"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shape scales
|
|
3
|
+
*
|
|
4
|
+
* Maps data values to point shapes.
|
|
5
|
+
*/
|
|
6
|
+
import type { Scale } from '../types';
|
|
7
|
+
/**
|
|
8
|
+
* Default shape palette
|
|
9
|
+
*/
|
|
10
|
+
export declare const DEFAULT_SHAPES: string[];
|
|
11
|
+
/**
|
|
12
|
+
* Shape characters for rendering
|
|
13
|
+
*/
|
|
14
|
+
export declare const SHAPE_CHARS: Record<string, string>;
|
|
15
|
+
export interface ShapeScaleOptions {
|
|
16
|
+
/** Available shapes to cycle through */
|
|
17
|
+
values?: string[];
|
|
18
|
+
/** Guide title */
|
|
19
|
+
name?: string;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Discrete shape scale (auto-assigns shapes)
|
|
23
|
+
*/
|
|
24
|
+
export declare function scale_shape_discrete(options?: ShapeScaleOptions): Scale;
|
|
25
|
+
export interface ManualShapeOptions {
|
|
26
|
+
/** Mapping from data values to shapes */
|
|
27
|
+
values: Record<string, string>;
|
|
28
|
+
/** Guide title */
|
|
29
|
+
name?: string;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Manual shape scale (explicit mapping)
|
|
33
|
+
*/
|
|
34
|
+
export declare function scale_shape_manual(options: ManualShapeOptions): Scale;
|
|
35
|
+
/**
|
|
36
|
+
* Identity shape scale (use data values directly as shape names)
|
|
37
|
+
*/
|
|
38
|
+
export declare function scale_shape_identity(): Scale;
|
|
39
|
+
/**
|
|
40
|
+
* Ordinal shape scale (integer values to shapes)
|
|
41
|
+
*/
|
|
42
|
+
export declare function scale_shape_ordinal(options?: ShapeScaleOptions): Scale;
|
|
43
|
+
//# sourceMappingURL=shape.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shape.d.ts","sourceRoot":"","sources":["../../src/scales/shape.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AAErC;;GAEG;AACH,eAAO,MAAM,cAAc,UAa1B,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAuB9C,CAAA;AAED,MAAM,WAAW,iBAAiB;IAChC,wCAAwC;IACxC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;IACjB,kBAAkB;IAClB,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,GAAE,iBAAsB,GAAG,KAAK,CAsB3E;AAED,MAAM,WAAW,kBAAkB;IACjC,yCAAyC;IACzC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC9B,kBAAkB;IAClB,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,kBAAkB,GAAG,KAAK,CAarE;AAED;;GAEG;AACH,wBAAgB,oBAAoB,IAAI,KAAK,CAS5C;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,GAAE,iBAAsB,GAAG,KAAK,CAgB1E"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Size scales
|
|
3
|
+
*
|
|
4
|
+
* Maps data values to point sizes.
|
|
5
|
+
*/
|
|
6
|
+
import type { Scale } from '../types';
|
|
7
|
+
export interface SizeScaleOptions {
|
|
8
|
+
/** Size range [min, max] in character widths */
|
|
9
|
+
range?: [number, number];
|
|
10
|
+
/** Domain [min, max] */
|
|
11
|
+
domain?: [number, number];
|
|
12
|
+
/** Transformation: 'identity', 'sqrt' (area proportional), 'radius' */
|
|
13
|
+
trans?: 'identity' | 'sqrt' | 'radius';
|
|
14
|
+
/** Guide title */
|
|
15
|
+
name?: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Continuous size scale
|
|
19
|
+
*/
|
|
20
|
+
export declare function scale_size_continuous(options?: SizeScaleOptions): Scale;
|
|
21
|
+
/**
|
|
22
|
+
* Area-proportional size scale (default for bubble plots)
|
|
23
|
+
*/
|
|
24
|
+
export declare function scale_size_area(options?: SizeScaleOptions): Scale;
|
|
25
|
+
/**
|
|
26
|
+
* Radius-proportional size scale
|
|
27
|
+
*/
|
|
28
|
+
export declare function scale_size_radius(options?: SizeScaleOptions): Scale;
|
|
29
|
+
/**
|
|
30
|
+
* Identity size scale (use data values directly)
|
|
31
|
+
*/
|
|
32
|
+
export declare function scale_size_identity(): Scale;
|
|
33
|
+
/**
|
|
34
|
+
* Binned size scale
|
|
35
|
+
*/
|
|
36
|
+
export interface BinnedSizeOptions extends SizeScaleOptions {
|
|
37
|
+
/** Number of bins */
|
|
38
|
+
n_breaks?: number;
|
|
39
|
+
/** Explicit break points */
|
|
40
|
+
breaks?: number[];
|
|
41
|
+
}
|
|
42
|
+
export declare function scale_size_binned(options?: BinnedSizeOptions): Scale;
|
|
43
|
+
//# sourceMappingURL=size.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"size.d.ts","sourceRoot":"","sources":["../../src/scales/size.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AAErC,MAAM,WAAW,gBAAgB;IAC/B,gDAAgD;IAChD,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACxB,wBAAwB;IACxB,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACzB,uEAAuE;IACvE,KAAK,CAAC,EAAE,UAAU,GAAG,MAAM,GAAG,QAAQ,CAAA;IACtC,kBAAkB;IAClB,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,GAAE,gBAAqB,GAAG,KAAK,CAyB3E;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,OAAO,GAAE,gBAAqB,GAAG,KAAK,CAErE;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,GAAE,gBAAqB,GAAG,KAAK,CAEvE;AAED;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,KAAK,CAQ3C;AAED;;GAEG;AACH,MAAM,WAAW,iBAAkB,SAAQ,gBAAgB;IACzD,qBAAqB;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,4BAA4B;IAC5B,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;CAClB;AAED,wBAAgB,iBAAiB,CAAC,OAAO,GAAE,iBAAsB,GAAG,KAAK,CAqCxE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bin.d.ts","sourceRoot":"","sources":["../../src/stats/bin.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAoB,UAAU,EAAE,IAAI,EAAE,MAAM,UAAU,CAAA;AAElE,MAAM,WAAW,aAAa;IAC5B,mCAAmC;IACnC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,8CAA8C;IAC9C,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,wBAAwB;IACxB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,4BAA4B;IAC5B,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAED;;GAEG;AACH,wBAAgB,WAAW,CACzB,IAAI,EAAE,UAAU,EAChB,KAAK,EAAE,MAAM,EACb,MAAM,GAAE,aAAkB,GACzB;IAAE,IAAI,EAAE,SAAS,EAAE,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CA6EzC;AAED,MAAM,WAAW,SAAS;IACxB,CAAC,EAAE,MAAM,CAAA;IACT,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,MAAM,CAAA;CAChB;AAED;;GAEG;AACH,wBAAgB,QAAQ,CAAC,MAAM,GAAE,aAAkB,GAAG,IAAI,CAmDzD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"boxplot.d.ts","sourceRoot":"","sources":["../../src/stats/boxplot.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAgC,IAAI,EAAE,MAAM,UAAU,CAAA;AAElE,MAAM,WAAW,iBAAiB;IAChC,0DAA0D;IAC1D,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED,MAAM,WAAW,aAAa;IAC5B,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IAClB,KAAK,EAAE,MAAM,CAAA;IACb,EAAE,EAAE,MAAM,CAAA;IACV,MAAM,EAAE,MAAM,CAAA;IACd,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,MAAM,EAAE,CAAA;IAClB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;AAkBD;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,MAAM,EAAE,EAChB,IAAI,GAAE,MAAY,GACjB,IAAI,CAAC,aAAa,EAAE,GAAG,CAAC,CAyC1B;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,MAAM,GAAE,iBAAsB,GAAG,IAAI,CAuCjE"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* stat_count - Count occurrences of each x value
|
|
3
|
+
*/
|
|
4
|
+
import type { DataSource, AestheticMapping } from '../types';
|
|
5
|
+
export interface StatCountParams {
|
|
6
|
+
}
|
|
7
|
+
export interface CountResult {
|
|
8
|
+
x: string | number;
|
|
9
|
+
count: number;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Count occurrences of each unique x value
|
|
13
|
+
*/
|
|
14
|
+
export declare function stat_count(_params?: StatCountParams): {
|
|
15
|
+
compute(data: DataSource, aes: AestheticMapping): CountResult[];
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Compute counts directly (utility function)
|
|
19
|
+
*/
|
|
20
|
+
export declare function computeCount(data: DataSource, xField: string): CountResult[];
|
|
21
|
+
//# sourceMappingURL=count.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"count.d.ts","sourceRoot":"","sources":["../../src/stats/count.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AAE5D,MAAM,WAAW,eAAe;CAE/B;AAED,MAAM,WAAW,WAAW;IAC1B,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IAClB,KAAK,EAAE,MAAM,CAAA;CACd;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,OAAO,GAAE,eAAoB;kBAEtC,UAAU,OAAO,gBAAgB,GAAG,WAAW,EAAE;EAiClE;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,GAAG,WAAW,EAAE,CAE5E"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* stat_density - Kernel density estimation for smooth density plots
|
|
3
|
+
*/
|
|
4
|
+
import type { DataSource, Stat } from '../types';
|
|
5
|
+
export interface StatDensityParams {
|
|
6
|
+
/** Bandwidth for kernel density estimation (default: auto via Silverman's rule) */
|
|
7
|
+
bw?: number;
|
|
8
|
+
/** Kernel function: 'gaussian' | 'epanechnikov' | 'rectangular' (default: 'gaussian') */
|
|
9
|
+
kernel?: 'gaussian' | 'epanechnikov' | 'rectangular';
|
|
10
|
+
/** Number of points to evaluate density at (default: 512) */
|
|
11
|
+
n?: number;
|
|
12
|
+
/** Adjustment factor for bandwidth (default: 1) */
|
|
13
|
+
adjust?: number;
|
|
14
|
+
}
|
|
15
|
+
export interface DensityResult {
|
|
16
|
+
x: number;
|
|
17
|
+
y: number;
|
|
18
|
+
density: number;
|
|
19
|
+
scaled: number;
|
|
20
|
+
count: number;
|
|
21
|
+
[key: string]: unknown;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Compute kernel density estimation
|
|
25
|
+
*/
|
|
26
|
+
export declare function computeDensity(data: DataSource, field: string, params?: StatDensityParams): DataSource;
|
|
27
|
+
/**
|
|
28
|
+
* Create stat_density transformation
|
|
29
|
+
*/
|
|
30
|
+
export declare function stat_density(params?: StatDensityParams): Stat;
|
|
31
|
+
/**
|
|
32
|
+
* Create stat_ydensity transformation for violin plots
|
|
33
|
+
* Groups data by x aesthetic (categorical) and computes density on y values
|
|
34
|
+
*/
|
|
35
|
+
export declare function stat_ydensity(params?: StatDensityParams): Stat;
|
|
36
|
+
//# sourceMappingURL=density.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"density.d.ts","sourceRoot":"","sources":["../../src/stats/density.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAoB,UAAU,EAAE,IAAI,EAAE,MAAM,UAAU,CAAA;AAElE,MAAM,WAAW,iBAAiB;IAChC,mFAAmF;IACnF,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,yFAAyF;IACzF,MAAM,CAAC,EAAE,UAAU,GAAG,cAAc,GAAG,aAAa,CAAA;IACpD,6DAA6D;IAC7D,CAAC,CAAC,EAAE,MAAM,CAAA;IACV,mDAAmD;IACnD,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AA8CD,MAAM,WAAW,aAAa;IAC5B,CAAC,EAAE,MAAM,CAAA;IACT,CAAC,EAAE,MAAM,CAAA;IACT,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,MAAM,CAAA;IACd,KAAK,EAAE,MAAM,CAAA;IACb,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CACvB;AAED;;GAEG;AACH,wBAAgB,cAAc,CAC5B,IAAI,EAAE,UAAU,EAChB,KAAK,EAAE,MAAM,EACb,MAAM,GAAE,iBAAsB,GAC7B,UAAU,CAkFZ;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,MAAM,GAAE,iBAAsB,GAAG,IAAI,CAgCjE;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,MAAM,GAAE,iBAAsB,GAAG,IAAI,CA6ClE"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Statistical transformations
|
|
3
|
+
*/
|
|
4
|
+
export { stat_bin, computeBins } from './bin';
|
|
5
|
+
export type { StatBinParams, BinResult } from './bin';
|
|
6
|
+
export { stat_count, computeCount } from './count';
|
|
7
|
+
export type { StatCountParams, CountResult } from './count';
|
|
8
|
+
export { stat_boxplot, computeBoxplotStats } from './boxplot';
|
|
9
|
+
export type { StatBoxplotParams, BoxplotResult } from './boxplot';
|
|
10
|
+
export { stat_density, stat_ydensity, computeDensity } from './density';
|
|
11
|
+
export type { StatDensityParams, DensityResult } from './density';
|
|
12
|
+
export { stat_smooth, computeSmooth } from './smooth';
|
|
13
|
+
export type { StatSmoothParams, SmoothResult } from './smooth';
|
|
14
|
+
export { stat_summary, computeSummary } from './summary';
|
|
15
|
+
export type { StatSummaryParams, SummaryResult, SummaryFun } from './summary';
|
|
16
|
+
export { stat_qq, stat_qq_line, computeQQ, computeQQLine } from './qq';
|
|
17
|
+
export type { StatQQParams, QQResult } from './qq';
|
|
18
|
+
//# sourceMappingURL=index.d.ts.map
|