@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,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Coordinate system functions
|
|
3
|
+
*
|
|
4
|
+
* Coordinates control how data is mapped to the plotting area:
|
|
5
|
+
* - coordCartesian: Standard x-y coordinates with optional zoom
|
|
6
|
+
* - coordFlip: Swaps x and y axes
|
|
7
|
+
* - coordFixed: Fixed aspect ratio between x and y
|
|
8
|
+
* - coordTrans: Apply transformations to both axes
|
|
9
|
+
* - coordPolar: Polar coordinates (angle + radius)
|
|
10
|
+
*/
|
|
11
|
+
import type { Coord } from '../types';
|
|
12
|
+
export interface CartesianOptions {
|
|
13
|
+
xlim?: [number, number];
|
|
14
|
+
ylim?: [number, number];
|
|
15
|
+
clip?: boolean;
|
|
16
|
+
}
|
|
17
|
+
export interface FixedOptions extends CartesianOptions {
|
|
18
|
+
/** Aspect ratio (y/x). Default is 1 for equal scaling */
|
|
19
|
+
ratio?: number;
|
|
20
|
+
}
|
|
21
|
+
export interface TransOptions extends CartesianOptions {
|
|
22
|
+
/** Transformation for x-axis: 'identity' | 'log10' | 'sqrt' | 'reverse' */
|
|
23
|
+
x?: 'identity' | 'log10' | 'sqrt' | 'reverse';
|
|
24
|
+
/** Transformation for y-axis: 'identity' | 'log10' | 'sqrt' | 'reverse' */
|
|
25
|
+
y?: 'identity' | 'log10' | 'sqrt' | 'reverse';
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Standard Cartesian coordinates (x horizontal, y vertical)
|
|
29
|
+
*
|
|
30
|
+
* Unlike scale limits which filter data, coord limits zoom the view
|
|
31
|
+
* while keeping all data - points outside the limits are clipped visually.
|
|
32
|
+
*/
|
|
33
|
+
export declare function coordCartesian(options?: CartesianOptions): Coord;
|
|
34
|
+
/**
|
|
35
|
+
* Flipped coordinates (x vertical, y horizontal)
|
|
36
|
+
*/
|
|
37
|
+
export declare function coordFlip(): Coord;
|
|
38
|
+
/**
|
|
39
|
+
* Polar coordinates
|
|
40
|
+
*/
|
|
41
|
+
export declare function coordPolar(options?: {
|
|
42
|
+
theta?: 'x' | 'y';
|
|
43
|
+
}): Coord;
|
|
44
|
+
/**
|
|
45
|
+
* Fixed aspect ratio coordinates
|
|
46
|
+
*
|
|
47
|
+
* Ensures that the visual representation of one unit on the x-axis
|
|
48
|
+
* has the same length as one unit on the y-axis (or a fixed ratio).
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* ```ts
|
|
52
|
+
* // Equal scaling (circles appear circular)
|
|
53
|
+
* gg(data).coord(coordFixed())
|
|
54
|
+
*
|
|
55
|
+
* // 2:1 aspect ratio
|
|
56
|
+
* gg(data).coord(coordFixed({ ratio: 2 }))
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
59
|
+
export declare function coordFixed(options?: FixedOptions): Coord;
|
|
60
|
+
/**
|
|
61
|
+
* Equal scaling coordinates (alias for coordFixed with ratio=1)
|
|
62
|
+
*
|
|
63
|
+
* Ensures that one unit on x-axis has same visual length as one unit on y-axis.
|
|
64
|
+
* Useful for maps, geometric shapes, or any plot where proportions matter.
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* ```ts
|
|
68
|
+
* gg(data).coord(coordEqual())
|
|
69
|
+
* ```
|
|
70
|
+
*/
|
|
71
|
+
export declare function coordEqual(options?: CartesianOptions): Coord;
|
|
72
|
+
/**
|
|
73
|
+
* Transformed coordinates
|
|
74
|
+
*
|
|
75
|
+
* Apply transformations to x and/or y axes. Unlike scale transforms,
|
|
76
|
+
* coord transforms happen after statistical transformations and affect
|
|
77
|
+
* how the data is visually represented.
|
|
78
|
+
*
|
|
79
|
+
* @example
|
|
80
|
+
* ```ts
|
|
81
|
+
* // Log-log plot
|
|
82
|
+
* gg(data).coord(coordTrans({ x: 'log10', y: 'log10' }))
|
|
83
|
+
*
|
|
84
|
+
* // Square root y-axis
|
|
85
|
+
* gg(data).coord(coordTrans({ y: 'sqrt' }))
|
|
86
|
+
* ```
|
|
87
|
+
*/
|
|
88
|
+
export declare function coordTrans(options?: TransOptions): Coord;
|
|
89
|
+
/**
|
|
90
|
+
* Flipped coordinates with options
|
|
91
|
+
*
|
|
92
|
+
* Like coordFlip but with xlim/ylim support.
|
|
93
|
+
* Note: limits refer to the original (pre-flip) data range.
|
|
94
|
+
*/
|
|
95
|
+
export declare function coordFlipWithLimits(options?: CartesianOptions): Coord;
|
|
96
|
+
//# sourceMappingURL=cartesian.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cartesian.d.ts","sourceRoot":"","sources":["../../src/coords/cartesian.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AAErC,MAAM,WAAW,gBAAgB;IAC/B,IAAI,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACvB,IAAI,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACvB,IAAI,CAAC,EAAE,OAAO,CAAA;CACf;AAED,MAAM,WAAW,YAAa,SAAQ,gBAAgB;IACpD,yDAAyD;IACzD,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,MAAM,WAAW,YAAa,SAAQ,gBAAgB;IACpD,2EAA2E;IAC3E,CAAC,CAAC,EAAE,UAAU,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,CAAA;IAC7C,2EAA2E;IAC3E,CAAC,CAAC,EAAE,UAAU,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,CAAA;CAC9C;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,OAAO,GAAE,gBAAqB,GAAG,KAAK,CAWpE;AAED;;GAEG;AACH,wBAAgB,SAAS,IAAI,KAAK,CAOjC;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,OAAO,GAAE;IAAE,KAAK,CAAC,EAAE,GAAG,GAAG,GAAG,CAAA;CAAO,GAAG,KAAK,CAgBrE;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,UAAU,CAAC,OAAO,GAAE,YAAiB,GAAG,KAAK,CAe5D;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,UAAU,CAAC,OAAO,GAAE,gBAAqB,GAAG,KAAK,CAEhE;AAkBD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,UAAU,CAAC,OAAO,GAAE,YAAiB,GAAG,KAAK,CAmB5D;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,GAAE,gBAAqB,GAAG,KAAK,CAUzE"}
|
package/dist/demo.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"demo.d.ts","sourceRoot":"","sources":["../src/demo.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/export/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AACtE,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PlotSpec → Vega-Lite converter
|
|
3
|
+
*
|
|
4
|
+
* Converts ggterm PlotSpec to Vega-Lite specification for publication-quality output.
|
|
5
|
+
* Vega-Lite can render to SVG, PNG, PDF via vl2svg, vl2png, vl2pdf CLI tools.
|
|
6
|
+
*/
|
|
7
|
+
import type { PlotSpec } from '../types';
|
|
8
|
+
export interface VegaLiteSpec {
|
|
9
|
+
$schema: string;
|
|
10
|
+
width?: number;
|
|
11
|
+
height?: number;
|
|
12
|
+
title?: string | {
|
|
13
|
+
text: string;
|
|
14
|
+
subtitle?: string;
|
|
15
|
+
};
|
|
16
|
+
data: {
|
|
17
|
+
values: Record<string, unknown>[];
|
|
18
|
+
};
|
|
19
|
+
mark?: string | {
|
|
20
|
+
type: string;
|
|
21
|
+
[key: string]: unknown;
|
|
22
|
+
};
|
|
23
|
+
encoding?: Record<string, unknown>;
|
|
24
|
+
layer?: VegaLiteLayer[];
|
|
25
|
+
params?: VegaLiteParam[];
|
|
26
|
+
config?: Record<string, unknown>;
|
|
27
|
+
facet?: {
|
|
28
|
+
field?: string;
|
|
29
|
+
type?: string;
|
|
30
|
+
columns?: number;
|
|
31
|
+
row?: {
|
|
32
|
+
field: string;
|
|
33
|
+
type?: string;
|
|
34
|
+
};
|
|
35
|
+
column?: {
|
|
36
|
+
field: string;
|
|
37
|
+
type?: string;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
spec?: {
|
|
41
|
+
mark?: string | {
|
|
42
|
+
type: string;
|
|
43
|
+
[key: string]: unknown;
|
|
44
|
+
};
|
|
45
|
+
encoding?: Record<string, unknown>;
|
|
46
|
+
layer?: VegaLiteLayer[];
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
interface VegaLiteParam {
|
|
50
|
+
name: string;
|
|
51
|
+
select?: string | {
|
|
52
|
+
type: string;
|
|
53
|
+
[key: string]: unknown;
|
|
54
|
+
};
|
|
55
|
+
bind?: string | Record<string, unknown>;
|
|
56
|
+
value?: unknown;
|
|
57
|
+
}
|
|
58
|
+
interface VegaLiteLayer {
|
|
59
|
+
mark: string | {
|
|
60
|
+
type: string;
|
|
61
|
+
[key: string]: unknown;
|
|
62
|
+
};
|
|
63
|
+
encoding?: Record<string, unknown>;
|
|
64
|
+
}
|
|
65
|
+
export interface InteractiveOptions {
|
|
66
|
+
tooltip?: boolean;
|
|
67
|
+
hover?: boolean;
|
|
68
|
+
brush?: boolean;
|
|
69
|
+
zoom?: boolean;
|
|
70
|
+
legendFilter?: boolean;
|
|
71
|
+
}
|
|
72
|
+
export interface ExportOptions {
|
|
73
|
+
width?: number;
|
|
74
|
+
height?: number;
|
|
75
|
+
publication?: boolean;
|
|
76
|
+
interactive?: boolean | InteractiveOptions;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Convert ggterm PlotSpec to Vega-Lite specification
|
|
80
|
+
*/
|
|
81
|
+
export declare function plotSpecToVegaLite(spec: PlotSpec, options?: ExportOptions): VegaLiteSpec;
|
|
82
|
+
/**
|
|
83
|
+
* Convert PlotSpec to Vega-Lite JSON string
|
|
84
|
+
*/
|
|
85
|
+
export declare function exportToVegaLiteJSON(spec: PlotSpec, options?: ExportOptions): string;
|
|
86
|
+
export {};
|
|
87
|
+
//# sourceMappingURL=vega-lite.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vega-lite.d.ts","sourceRoot":"","sources":["../../src/export/vega-lite.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAA0B,MAAM,UAAU,CAAA;AAEhE,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EAAE,MAAM,GAAG;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;IACpD,IAAI,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAA;KAAE,CAAA;IAC3C,IAAI,CAAC,EAAE,MAAM,GAAG;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAA;IACxD,QAAQ,CAAC,EAAE,MAAM,CAAC,MAA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ACvD,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CACnC;AAuPD,MAAM,WAAW,kBAAkB;IACjC,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,YAAY,CAAC,EAAE,OAAO,CAAA;CACvB;AAED,MAAM,WAAW,aAAa;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,WAAW,CAAC,EAAE,OAAO,GAAG,kBAAkB,CAAA;CAC3C;AAyFD;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,QAAQ,EACd,OAAO,GAAE,aAAkB,GAC1B,YAAY,CAqLd;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,QAAQ,EAAE,OAAO,GAAE,aAAkB,GAAG,MAAM,CAGxF"}
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Faceting functions for creating small multiples
|
|
3
|
+
*/
|
|
4
|
+
import type { Facet, DataSource, Labeller } from '../types';
|
|
5
|
+
export type { Labeller } from '../types';
|
|
6
|
+
/**
|
|
7
|
+
* Default labeller - just returns the value
|
|
8
|
+
*/
|
|
9
|
+
export declare const label_value: Labeller;
|
|
10
|
+
/**
|
|
11
|
+
* Labeller that shows both variable name and value
|
|
12
|
+
* @example "category: A"
|
|
13
|
+
*/
|
|
14
|
+
export declare const label_both: Labeller;
|
|
15
|
+
/**
|
|
16
|
+
* Labeller that parses underscores as spaces
|
|
17
|
+
* @example "my_category" -> "my category"
|
|
18
|
+
*/
|
|
19
|
+
export declare const label_parsed: Labeller;
|
|
20
|
+
/**
|
|
21
|
+
* Labeller that wraps long labels
|
|
22
|
+
*/
|
|
23
|
+
export declare const label_wrap: (width: number) => Labeller;
|
|
24
|
+
/**
|
|
25
|
+
* Create a custom labeller from a record of value -> label mappings
|
|
26
|
+
*/
|
|
27
|
+
export declare function as_labeller(labels: Record<string, string>): Labeller;
|
|
28
|
+
export interface FacetWrapOptions {
|
|
29
|
+
/** Number of columns (default: auto-calculated) */
|
|
30
|
+
ncol?: number;
|
|
31
|
+
/** Number of rows (default: auto-calculated) */
|
|
32
|
+
nrow?: number;
|
|
33
|
+
/** Scale behavior: 'fixed' (same for all), 'free' (independent), 'free_x', 'free_y' */
|
|
34
|
+
scales?: 'fixed' | 'free' | 'free_x' | 'free_y';
|
|
35
|
+
/** Direction to fill panels: 'h' (horizontal) or 'v' (vertical) */
|
|
36
|
+
dir?: 'h' | 'v';
|
|
37
|
+
/** Strip position: 'top' or 'bottom' (default: 'top') */
|
|
38
|
+
strip?: 'top' | 'bottom';
|
|
39
|
+
/** Labeller function for customizing strip labels */
|
|
40
|
+
labeller?: Labeller;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Wrap a 1D ribbon of panels into 2D
|
|
44
|
+
*
|
|
45
|
+
* Facet by a single variable, arranging panels in a wrapped layout.
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```ts
|
|
49
|
+
* gg(data)
|
|
50
|
+
* .aes({ x: 'x', y: 'y' })
|
|
51
|
+
* .geom(geom_point())
|
|
52
|
+
* .facet(facet_wrap('category', { ncol: 3 }))
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
export declare function facet_wrap(facets: string, options?: FacetWrapOptions): Facet;
|
|
56
|
+
export interface FacetGridOptions {
|
|
57
|
+
/** Scale behavior: 'fixed' (same for all), 'free' (independent), 'free_x', 'free_y' */
|
|
58
|
+
scales?: 'fixed' | 'free' | 'free_x' | 'free_y';
|
|
59
|
+
/** Move row/column strips: 'x' moves col strips to bottom, 'y' moves row strips to left */
|
|
60
|
+
switch?: 'x' | 'y' | 'both' | null;
|
|
61
|
+
/** Labeller function for customizing strip labels */
|
|
62
|
+
labeller?: Labeller;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Lay out panels in a 2D grid by row and/or column variables
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* ```ts
|
|
69
|
+
* // Grid by two variables
|
|
70
|
+
* gg(data)
|
|
71
|
+
* .aes({ x: 'x', y: 'y' })
|
|
72
|
+
* .geom(geom_point())
|
|
73
|
+
* .facet(facet_grid({ rows: 'gender', cols: 'treatment' }))
|
|
74
|
+
*
|
|
75
|
+
* // Just rows
|
|
76
|
+
* gg(data)
|
|
77
|
+
* .facet(facet_grid({ rows: 'category' }))
|
|
78
|
+
*
|
|
79
|
+
* // Just columns
|
|
80
|
+
* gg(data)
|
|
81
|
+
* .facet(facet_grid({ cols: 'year' }))
|
|
82
|
+
* ```
|
|
83
|
+
*/
|
|
84
|
+
export declare function facet_grid(facets: {
|
|
85
|
+
rows?: string;
|
|
86
|
+
cols?: string;
|
|
87
|
+
}, options?: FacetGridOptions): Facet;
|
|
88
|
+
/**
|
|
89
|
+
* Panel information for layout
|
|
90
|
+
*/
|
|
91
|
+
export interface FacetPanel {
|
|
92
|
+
/** Panel index (0-based) */
|
|
93
|
+
index: number;
|
|
94
|
+
/** Row index in grid (0-based) */
|
|
95
|
+
row: number;
|
|
96
|
+
/** Column index in grid (0-based) */
|
|
97
|
+
col: number;
|
|
98
|
+
/** Label for this panel */
|
|
99
|
+
label: string;
|
|
100
|
+
/** Row variable value (for grid facets) */
|
|
101
|
+
rowValue?: string;
|
|
102
|
+
/** Column variable value (for grid facets) */
|
|
103
|
+
colValue?: string;
|
|
104
|
+
/** Data subset for this panel */
|
|
105
|
+
data: DataSource;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Compute facet panels from data and facet specification
|
|
109
|
+
*/
|
|
110
|
+
export declare function computeFacetPanels(data: DataSource, facet: Facet): {
|
|
111
|
+
panels: FacetPanel[];
|
|
112
|
+
nrow: number;
|
|
113
|
+
ncol: number;
|
|
114
|
+
};
|
|
115
|
+
/**
|
|
116
|
+
* Calculate panel layout positions
|
|
117
|
+
*/
|
|
118
|
+
export interface PanelLayout {
|
|
119
|
+
x: number;
|
|
120
|
+
y: number;
|
|
121
|
+
width: number;
|
|
122
|
+
height: number;
|
|
123
|
+
labelY: number;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Layout options for panel calculation
|
|
127
|
+
*/
|
|
128
|
+
export interface PanelLayoutOptions {
|
|
129
|
+
/** Whether this is a grid facet with separate row/col strips */
|
|
130
|
+
isGrid?: boolean;
|
|
131
|
+
/** Whether the grid has row variable */
|
|
132
|
+
hasRowVar?: boolean;
|
|
133
|
+
/** Whether the grid has column variable */
|
|
134
|
+
hasColVar?: boolean;
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Grid strip layout information
|
|
138
|
+
*/
|
|
139
|
+
export interface GridStripLayout {
|
|
140
|
+
/** X position for each column strip (at top) */
|
|
141
|
+
colStripX: number[];
|
|
142
|
+
/** Y position for column strips */
|
|
143
|
+
colStripY: number;
|
|
144
|
+
/** Width of column strips */
|
|
145
|
+
colStripWidth: number;
|
|
146
|
+
/** Y position for each row strip (on right) */
|
|
147
|
+
rowStripY: number[];
|
|
148
|
+
/** X position for row strips */
|
|
149
|
+
rowStripX: number;
|
|
150
|
+
/** Max width for row strip text */
|
|
151
|
+
rowStripWidth: number;
|
|
152
|
+
}
|
|
153
|
+
export declare function calculatePanelLayouts(totalWidth: number, totalHeight: number, nrow: number, ncol: number, hasTitle: boolean, margins: {
|
|
154
|
+
top: number;
|
|
155
|
+
right: number;
|
|
156
|
+
bottom: number;
|
|
157
|
+
left: number;
|
|
158
|
+
}, options?: PanelLayoutOptions): PanelLayout[];
|
|
159
|
+
/**
|
|
160
|
+
* Calculate grid strip layout for facet_grid
|
|
161
|
+
*/
|
|
162
|
+
export declare function calculateGridStripLayout(totalWidth: number, totalHeight: number, nrow: number, ncol: number, hasTitle: boolean, margins: {
|
|
163
|
+
top: number;
|
|
164
|
+
right: number;
|
|
165
|
+
bottom: number;
|
|
166
|
+
left: number;
|
|
167
|
+
}, hasRowVar: boolean, hasColVar: boolean): GridStripLayout;
|
|
168
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/facets/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAG3D,YAAY,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAExC;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,QAA2B,CAAA;AAErD;;;GAGG;AACH,eAAO,MAAM,UAAU,EAAE,QACmB,CAAA;AAE5C;;;GAGG;AACH,eAAO,MAAM,YAAY,EAAE,QAA8C,CAAA;AAEzE;;GAEG;AACH,eAAO,MAAM,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,QAI3C,CAAA;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,QAAQ,CAEpE;AAED,MAAM,WAAW,gBAAgB;IAC/B,mDAAmD;IACnD,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,gDAAgD;IAChD,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,uFAAuF;IACvF,MAAM,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,QAAQ,GAAG,QAAQ,CAAA;IAC/C,mEAAmE;IACnE,GAAG,CAAC,EAAE,GAAG,GAAG,GAAG,CAAA;IACf,yDAAyD;IACzD,KAAK,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAA;IACxB,qDAAqD;IACrD,QAAQ,CAAC,EAAE,QAAQ,CAAA;CACpB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,UA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O,EAClB,SAAS,EAAE,OAAO,GACjB,eAAe,CAoCjB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"area.d.ts","sourceRoot":"","sources":["../../src/geoms/area.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,UAAU,CAAA;AAEpC,MAAM,WAAW,WAAW;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,OAAO,GAAE,WAAgB,GAAG,IAAI,CAWzD;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,OAAO,GAAE,WAAgB,GAAG,IAAI,CAW3D"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* geom_bar - Bar geometry
|
|
3
|
+
*/
|
|
4
|
+
import type { Geom } from '../types';
|
|
5
|
+
import type { Position } from '../positions';
|
|
6
|
+
export interface BarOptions {
|
|
7
|
+
stat?: 'count' | 'identity';
|
|
8
|
+
width?: number;
|
|
9
|
+
/** Position adjustment: 'stack' | 'dodge' | 'fill' or use position_*() functions */
|
|
10
|
+
position?: Position | 'stack' | 'dodge' | 'fill' | 'identity';
|
|
11
|
+
alpha?: number;
|
|
12
|
+
color?: string;
|
|
13
|
+
fill?: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Render vertical bars
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```ts
|
|
20
|
+
* // Stacked bar chart (default)
|
|
21
|
+
* gg(data).geom(geom_bar())
|
|
22
|
+
*
|
|
23
|
+
* // Grouped bar chart
|
|
24
|
+
* gg(data).geom(geom_bar({ position: 'dodge' }))
|
|
25
|
+
*
|
|
26
|
+
* // Or with position function for more control
|
|
27
|
+
* gg(data).geom(geom_bar({ position: position_dodge({ width: 0.7 }) }))
|
|
28
|
+
*
|
|
29
|
+
* // 100% stacked bar chart
|
|
30
|
+
* gg(data).geom(geom_bar({ position: 'fill' }))
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
export declare function geom_bar(options?: BarOptions): Geom;
|
|
34
|
+
/**
|
|
35
|
+
* Render columns (alias for geom_bar with stat='identity')
|
|
36
|
+
*/
|
|
37
|
+
export declare function geom_col(options?: Omit<BarOptions, 'stat'>): Geom;
|
|
38
|
+
//# sourceMappingURL=bar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bar.d.ts","sourceRoot":"","sources":["../../src/geoms/bar.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,UAAU,CAAA;AACpC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAE5C,MAAM,WAAW,UAAU;IACzB,IAAI,CAAC,EAAE,OAAO,GAAG,UAAU,CAAA;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,oFAAoF;IACpF,QAAQ,CAAC,EAAE,QAAQ,GAAG,OAAO,GAAG,OAAO,GAAG,MAAM,GAAG,UAAU,CAAA;IAC7D,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,QAAQ,CAAC,OAAO,GAAE,UAAe,GAAG,IAAI,CAYvD;AAED;;GAEG;AACH,wBAAgB,QAAQ,CAAC,OAAO,GAAE,IAAI,CAAC,UAAU,EAAE,MAAM,CAAM,GAAG,IAAI,CAErE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"boxplot.d.ts","sourceRoot":"","sources":["../../src/geoms/boxplot.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,UAAU,CAAA;AAEpC,MAAM,WAAW,cAAc;IAC7B,uCAAuC;IACvC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,0DAA0D;IAC1D,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,oCAAoC;IACpC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,kCAAkC;IAClC,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,yBAAyB;IACzB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,mBAAmB;IACnB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,iBAAiB;IACjB,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,OAAO,GAAE,cAAmB,GAAG,IAAI,CAc/D"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* geom_contour - Contour line geometry
|
|
3
|
+
*
|
|
4
|
+
* Renders contour lines from a 2D density or grid.
|
|
5
|
+
*/
|
|
6
|
+
import type { Geom } from '../types';
|
|
7
|
+
export interface ContourOptions {
|
|
8
|
+
/** Number of contour levels (default: 10) */
|
|
9
|
+
bins?: number;
|
|
10
|
+
/** Specific contour break values */
|
|
11
|
+
breaks?: number[];
|
|
12
|
+
/** Bandwidth for 2D density estimation */
|
|
13
|
+
bandwidth?: number | [number, number];
|
|
14
|
+
/** Alpha transparency */
|
|
15
|
+
alpha?: number;
|
|
16
|
+
/** Line color */
|
|
17
|
+
color?: string;
|
|
18
|
+
/** Linetype */
|
|
19
|
+
linetype?: 'solid' | 'dashed' | 'dotted';
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Render contour lines
|
|
23
|
+
*/
|
|
24
|
+
export declare function geom_contour(options?: ContourOptions): Geom;
|
|
25
|
+
/**
|
|
26
|
+
* Filled contour polygons
|
|
27
|
+
*/
|
|
28
|
+
export declare function geom_contour_filled(options?: ContourOptions): Geom;
|
|
29
|
+
/**
|
|
30
|
+
* 2D density contours
|
|
31
|
+
*/
|
|
32
|
+
export declare function geom_density_2d(options?: ContourOptions): Geom;
|
|
33
|
+
//# sourceMappingURL=contour.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contour.d.ts","sourceRoot":"","sources":["../../src/geoms/contour.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,UAAU,CAAA;AAEpC,MAAM,WAAW,cAAc;IAC7B,6CAA6C;IAC7C,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,oCAAoC;IACpC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;IACjB,0CAA0C;IAC1C,SAAS,CAAC,EAAE,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACrC,yBAAyB;IACzB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,iBAAiB;IACjB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,eAAe;IACf,QAAQ,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,QAAQ,CAAA;CACzC;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,OAAO,GAAE,cAAmB,GAAG,IAAI,CAc/D;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,GAAE,cAAmB,GAAG,IAAI,CAUtE;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,OAAO,GAAE,cAAmB,GAAG,IAAI,CAclE"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* geom_errorbar - Error bar geometry
|
|
3
|
+
*
|
|
4
|
+
* Renders vertical or horizontal error bars.
|
|
5
|
+
*/
|
|
6
|
+
import type { Geom } from '../types';
|
|
7
|
+
export interface ErrorbarOptions {
|
|
8
|
+
/** Width of the error bar caps (default: 0.5) */
|
|
9
|
+
width?: number;
|
|
10
|
+
/** Alpha transparency */
|
|
11
|
+
alpha?: number;
|
|
12
|
+
/** Line color */
|
|
13
|
+
color?: string;
|
|
14
|
+
/** Linetype */
|
|
15
|
+
linetype?: 'solid' | 'dashed' | 'dotted';
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Render vertical error bars (ymin to ymax)
|
|
19
|
+
*/
|
|
20
|
+
export declare function geom_errorbar(options?: ErrorbarOptions): Geom;
|
|
21
|
+
/**
|
|
22
|
+
* Render horizontal error bars (xmin to xmax)
|
|
23
|
+
*/
|
|
24
|
+
export declare function geom_errorbarh(options?: ErrorbarOptions): Geom;
|
|
25
|
+
/**
|
|
26
|
+
* Render crossbar (horizontal bar with vertical line)
|
|
27
|
+
*/
|
|
28
|
+
export declare function geom_crossbar(options?: ErrorbarOptions & {
|
|
29
|
+
fatten?: number;
|
|
30
|
+
}): Geom;
|
|
31
|
+
/**
|
|
32
|
+
* Render linerange (vertical line from ymin to ymax)
|
|
33
|
+
*/
|
|
34
|
+
export declare function geom_linerange(options?: Omit<ErrorbarOptions, 'width'>): Geom;
|
|
35
|
+
/**
|
|
36
|
+
* Render pointrange (point with vertical line from ymin to ymax)
|
|
37
|
+
*/
|
|
38
|
+
export declare function geom_pointrange(options?: ErrorbarOptions & {
|
|
39
|
+
fatten?: number;
|
|
40
|
+
}): Geom;
|
|
41
|
+
//# sourceMappingURL=errorbar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errorbar.d.ts","sourceRoot":"","sources":["../../src/geoms/errorbar.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,UAAU,CAAA;AAEpC,MAAM,WAAW,eAAe;IAC9B,iDAAiD;IACjD,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,yBAAyB;IACzB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,iBAAiB;IACjB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,eAAe;IACf,QAAQ,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,QAAQ,CAAA;CACzC;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,OAAO,GAAE,eAAoB,GAAG,IAAI,CAYjE;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,OAAO,GAAE,eAAoB,GAAG,IAAI,CAYlE;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,OAAO,GAAE,eAAe,GAAG;IAAE,MAAM,CAAC,EAAE,MAAM,CAAA;CAAO,GAAG,IAAI,CAavF;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,OAAO,GAAE,IAAI,CAAC,eAAe,EAAE,OAAO,CAAM,GAAG,IAAI,CAWjF;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,OAAO,GAAE,eAAe,GAAG;IAAE,MAAM,CAAC,EAAE,MAAM,CAAA;CAAO,GAAG,IAAI,CAYzF"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* geom_histogram - Histogram geometry
|
|
3
|
+
*/
|
|
4
|
+
import type { Geom } from '../types';
|
|
5
|
+
export interface HistogramOptions {
|
|
6
|
+
/** Number of bins (default: 30) */
|
|
7
|
+
bins?: number;
|
|
8
|
+
/** Bin width (overrides bins if specified) */
|
|
9
|
+
binwidth?: number;
|
|
10
|
+
/** Center of one bin */
|
|
11
|
+
center?: number;
|
|
12
|
+
/** Boundary between bins */
|
|
13
|
+
boundary?: number;
|
|
14
|
+
/** Alpha transparency */
|
|
15
|
+
alpha?: number;
|
|
16
|
+
/** Border color */
|
|
17
|
+
color?: string;
|
|
18
|
+
/** Fill color */
|
|
19
|
+
fill?: string;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Render histogram (binned bar chart)
|
|
23
|
+
*/
|
|
24
|
+
export declare function geom_histogram(options?: HistogramOptions): Geom;
|
|
25
|
+
export interface FreqpolyOptions {
|
|
26
|
+
/** Number of bins (default: 30) */
|
|
27
|
+
bins?: number;
|
|
28
|
+
/** Bin width (overrides bins if specified) */
|
|
29
|
+
binwidth?: number;
|
|
30
|
+
/** Center of one bin */
|
|
31
|
+
center?: number;
|
|
32
|
+
/** Boundary between bins */
|
|
33
|
+
boundary?: number;
|
|
34
|
+
/** Alpha transparency */
|
|
35
|
+
alpha?: number;
|
|
36
|
+
/** Line color */
|
|
37
|
+
color?: string;
|
|
38
|
+
/** Line type */
|
|
39
|
+
linetype?: 'solid' | 'dashed' | 'dotted';
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Frequency polygon - line version of histogram
|
|
43
|
+
*
|
|
44
|
+
* Draws a line connecting the midpoints of histogram bins.
|
|
45
|
+
* Useful for comparing multiple distributions on the same plot
|
|
46
|
+
* since lines don't overlap like bars do.
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```ts
|
|
50
|
+
* // Basic frequency polygon
|
|
51
|
+
* gg(data)
|
|
52
|
+
* .aes({ x: 'value' })
|
|
53
|
+
* .geom(geom_freqpoly())
|
|
54
|
+
*
|
|
55
|
+
* // Compare multiple distributions
|
|
56
|
+
* gg(data)
|
|
57
|
+
* .aes({ x: 'value', color: 'group' })
|
|
58
|
+
* .geom(geom_freqpoly({ bins: 20 }))
|
|
59
|
+
* ```
|
|
60
|
+
*/
|
|
61
|
+
export declare function geom_freqpoly(options?: FreqpolyOptions): Geom;
|
|
62
|
+
//# sourceMappingURL=histogram.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"histogram.d.ts","sourceRoot":"","sources":["../../src/geoms/histogram.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,UAAU,CAAA;AAEpC,MAAM,WAAW,gBAAgB;IAC/B,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;IACjB,yBAAyB;IACzB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,mBAAmB;IACnB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,iBAAiB;IACjB,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,OAAO,GAAE,gBAAqB,GAAG,IAAI,CAcnE;AAED,MAAM,WAAW,eAAe;IAC9B,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;IACjB,yBAAyB;IACzB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,iBAAiB;IACjB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,gBAAgB;IAChB,QAAQ,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,QAAQ,CAAA;CACzC;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,aAAa,CAAC,OAAO,GAAE,eAAoB,GAAG,IAAI,CAcjE"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Geometry exports
|
|
3
|
+
*/
|
|
4
|
+
export { geom_point, type PointOptions } from './point';
|
|
5
|
+
export { geom_line, geom_hline, geom_vline, type LineOptions } from './line';
|
|
6
|
+
export { geom_path, type PathOptions } from './path';
|
|
7
|
+
export { geom_bar, geom_col, type BarOptions } from './bar';
|
|
8
|
+
export { geom_text, geom_label, type TextOptions } from './text';
|
|
9
|
+
export { geom_area, geom_ribbon, type AreaOptions } from './area';
|
|
10
|
+
export { geom_histogram, geom_freqpoly, type HistogramOptions, type FreqpolyOptions } from './histogram';
|
|
11
|
+
export { geom_boxplot, type BoxplotOptions } from './boxplot';
|
|
12
|
+
export { geom_segment, geom_curve, type SegmentOptions } from './segment';
|
|
13
|
+
export { geom_smooth, type SmoothOptions } from './smooth';
|
|
14
|
+
export { geom_step, type StepOptions } from './step';
|
|
15
|
+
export { geom_rug, type RugOptions } from './rug';
|
|
16
|
+
export { geom_violin, type ViolinOptions } from './violin';
|
|
17
|
+
export { geom_tile, geom_raster, type TileOptions } from './tile';
|
|
18
|
+
export { geom_contour, geom_contour_filled, geom_density_2d, type ContourOptions } from './contour';
|
|
19
|
+
export { geom_errorbar, geom_errorbarh, geom_crossbar, geom_linerange, geom_pointrange, type ErrorbarOptions, } from './errorbar';
|
|
20
|
+
export { geom_rect, geom_abline, type RectOptions, type AblineOptions } from './rect';
|
|
21
|
+
export { geom_qq, geom_qq_line, type QQOptions, type QQLineOptions } from './qq';
|
|
22
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/geoms/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,KAAK,YAAY,EAAE,MAAM,SAAS,CAAA;AACvD,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,KAAK,WAAW,EAAE,MAAM,QAAQ,CAAA;AAC5E,OAAO,EAAE,SAAS,EAAE,KAAK,WAAW,EAAE,MAAM,QAAQ,CAAA;AACpD,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,UAAU,EAAE,MAAM,OAAO,CAAA;AAC3D,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,KAAK,WAAW,EAAE,MAAM,QAAQ,CAAA;AAChE,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,KAAK,WAAW,EAAE,MAAM,QAAQ,CAAA;AACjE,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,KAAK,gBAAgB,EAAE,KAAK,eAAe,EAAE,MAAM,aAAa,CAAA;AACxG,OAAO,EAAE,YAAY,EAAE,KAAK,cAAc,EAAE,MAA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