@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,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* geom_path - Path geometry
|
|
3
|
+
*
|
|
4
|
+
* Connects data points in the order they appear in the data,
|
|
5
|
+
* unlike geom_line which sorts by x. Useful for trajectories,
|
|
6
|
+
* drawing shapes, and ordered sequences.
|
|
7
|
+
*/
|
|
8
|
+
import type { Geom } from '../types';
|
|
9
|
+
export interface PathOptions {
|
|
10
|
+
/** Line width (1-3) */
|
|
11
|
+
linewidth?: number;
|
|
12
|
+
/** Line type */
|
|
13
|
+
linetype?: 'solid' | 'dashed' | 'dotted';
|
|
14
|
+
/** Opacity (0-1) */
|
|
15
|
+
alpha?: number;
|
|
16
|
+
/** Fixed color (hex string) */
|
|
17
|
+
color?: string;
|
|
18
|
+
/** Line end style */
|
|
19
|
+
lineend?: 'butt' | 'round' | 'square';
|
|
20
|
+
/** Line join style */
|
|
21
|
+
linejoin?: 'round' | 'mitre' | 'bevel';
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Connect data points in data order (not sorted by x)
|
|
25
|
+
*
|
|
26
|
+
* Unlike geom_line which sorts points by x before connecting them,
|
|
27
|
+
* geom_path connects points in the order they appear in the data.
|
|
28
|
+
* This is essential for:
|
|
29
|
+
* - Trajectories and movement paths
|
|
30
|
+
* - Drawing shapes and polygons
|
|
31
|
+
* - Time series where x is not monotonic
|
|
32
|
+
* - Spiral and circular patterns
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* // Draw a trajectory
|
|
36
|
+
* gg(trajectoryData)
|
|
37
|
+
* .aes({ x: 'longitude', y: 'latitude' })
|
|
38
|
+
* .geom(geom_path())
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* // Draw a spiral
|
|
42
|
+
* const spiral = Array.from({ length: 100 }, (_, i) => {
|
|
43
|
+
* const t = i * 0.1
|
|
44
|
+
* return { x: t * Math.cos(t), y: t * Math.sin(t) }
|
|
45
|
+
* })
|
|
46
|
+
* gg(spiral).aes({ x: 'x', y: 'y' }).geom(geom_path())
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* // Draw a shape (triangle)
|
|
50
|
+
* const triangle = [
|
|
51
|
+
* { x: 0, y: 0 },
|
|
52
|
+
* { x: 1, y: 2 },
|
|
53
|
+
* { x: 2, y: 0 },
|
|
54
|
+
* { x: 0, y: 0 }, // close the shape
|
|
55
|
+
* ]
|
|
56
|
+
* gg(triangle).aes({ x: 'x', y: 'y' }).geom(geom_path())
|
|
57
|
+
*/
|
|
58
|
+
export declare function geom_path(options?: PathOptions): Geom;
|
|
59
|
+
//# sourceMappingURL=path.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"path.d.ts","sourceRoot":"","sources":["../../src/geoms/path.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,UAAU,CAAA;AAEpC,MAAM,WAAW,WAAW;IAC1B,uBAAuB;IACvB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,gBAAgB;IAChB,QAAQ,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,QAAQ,CAAA;IACxC,oBAAoB;IACpB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,+BAA+B;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,qBAAqB;IACrB,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAA;IACrC,sBAAsB;IACtB,QAAQ,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,OAAO,CAAA;CACvC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,wBAAgB,SAAS,CAAC,OAAO,GAAE,WAAgB,GAAG,IAAI,CAczD"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* geom_point - Scatter plot geometry
|
|
3
|
+
*/
|
|
4
|
+
import type { Geom } from '../types';
|
|
5
|
+
import type { Position } from '../positions';
|
|
6
|
+
export interface PointOptions {
|
|
7
|
+
size?: number;
|
|
8
|
+
shape?: 'circle' | 'square' | 'triangle' | 'cross' | 'diamond';
|
|
9
|
+
alpha?: number;
|
|
10
|
+
color?: string;
|
|
11
|
+
/** Position adjustment (default: 'identity'). Use position_jitter() for overplotted data. */
|
|
12
|
+
position?: Position | 'identity' | 'jitter' | 'dodge';
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Render data points as scatter plot markers
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```ts
|
|
19
|
+
* // Basic scatter plot
|
|
20
|
+
* gg(data).geom(geom_point())
|
|
21
|
+
*
|
|
22
|
+
* // Jittered points to avoid overplotting
|
|
23
|
+
* gg(data).geom(geom_point({ position: position_jitter() }))
|
|
24
|
+
*
|
|
25
|
+
* // Or with shorthand
|
|
26
|
+
* gg(data).geom(geom_point({ position: 'jitter' }))
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
export declare function geom_point(options?: PointOptions): Geom;
|
|
30
|
+
//# sourceMappingURL=point.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"point.d.ts","sourceRoot":"","sources":["../../src/geoms/point.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,YAAY;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,UAAU,GAAG,OAAO,GAAG,SAAS,CAAA;IAC9D,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,6FAA6F;IAC7F,QAAQ,CAAC,EAAE,QAAQ,GAAG,UAAU,GAAG,QAAQ,GAAG,OAAO,CAAA;CACtD;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,UAAU,CAAC,OAAO,GAAE,YAAiB,GAAG,IAAI,CAY3D"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* geom_qq - Q-Q plot geometry
|
|
3
|
+
*
|
|
4
|
+
* Creates Q-Q (quantile-quantile) plots to assess whether data
|
|
5
|
+
* follows a particular distribution (typically normal).
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```ts
|
|
9
|
+
* // Basic Q-Q plot to check normality
|
|
10
|
+
* gg(data)
|
|
11
|
+
* .aes({ x: 'values' })
|
|
12
|
+
* .geom(geom_qq())
|
|
13
|
+
* .geom(geom_qq_line())
|
|
14
|
+
*
|
|
15
|
+
* // With custom distribution
|
|
16
|
+
* gg(data)
|
|
17
|
+
* .aes({ x: 'values' })
|
|
18
|
+
* .geom(geom_qq({ distribution: 'uniform' }))
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
import type { Geom } from '../types';
|
|
22
|
+
export interface QQOptions {
|
|
23
|
+
/** Distribution to compare against (default: 'norm') */
|
|
24
|
+
distribution?: 'norm' | 'uniform' | 'exp';
|
|
25
|
+
/** Distribution parameters */
|
|
26
|
+
dparams?: {
|
|
27
|
+
mean?: number;
|
|
28
|
+
sd?: number;
|
|
29
|
+
rate?: number;
|
|
30
|
+
};
|
|
31
|
+
/** Point size */
|
|
32
|
+
size?: number;
|
|
33
|
+
/** Point shape */
|
|
34
|
+
shape?: string;
|
|
35
|
+
/** Point color */
|
|
36
|
+
color?: string;
|
|
37
|
+
/** Alpha transparency */
|
|
38
|
+
alpha?: number;
|
|
39
|
+
}
|
|
40
|
+
export interface QQLineOptions {
|
|
41
|
+
/** Distribution to compare against (default: 'norm') */
|
|
42
|
+
distribution?: 'norm' | 'uniform' | 'exp';
|
|
43
|
+
/** Distribution parameters */
|
|
44
|
+
dparams?: {
|
|
45
|
+
mean?: number;
|
|
46
|
+
sd?: number;
|
|
47
|
+
rate?: number;
|
|
48
|
+
};
|
|
49
|
+
/** Line color */
|
|
50
|
+
color?: string;
|
|
51
|
+
/** Line type */
|
|
52
|
+
linetype?: 'solid' | 'dashed' | 'dotted';
|
|
53
|
+
/** Alpha transparency */
|
|
54
|
+
alpha?: number;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Q-Q plot points
|
|
58
|
+
*
|
|
59
|
+
* Plots sample quantiles against theoretical quantiles.
|
|
60
|
+
* If the points fall approximately on the diagonal reference line,
|
|
61
|
+
* the data follows the reference distribution.
|
|
62
|
+
*
|
|
63
|
+
* The x aesthetic should be the variable to test.
|
|
64
|
+
* Output uses x = theoretical quantile, y = sample quantile.
|
|
65
|
+
*/
|
|
66
|
+
export declare function geom_qq(options?: QQOptions): Geom;
|
|
67
|
+
/**
|
|
68
|
+
* Q-Q plot reference line
|
|
69
|
+
*
|
|
70
|
+
* Draws a line through the first and third quartiles of the
|
|
71
|
+
* theoretical vs sample distribution. Points should fall on
|
|
72
|
+
* this line if the data follows the reference distribution.
|
|
73
|
+
*/
|
|
74
|
+
export declare function geom_qq_line(options?: QQLineOptions): Geom;
|
|
75
|
+
//# sourceMappingURL=qq.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"qq.d.ts","sourceRoot":"","sources":["../../src/geoms/qq.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,UAAU,CAAA;AAEpC,MAAM,WAAW,SAAS;IACxB,wDAAwD;IACxD,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,KAAK,CAAA;IACzC,8BAA8B;IAC9B,OAAO,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,EAAE,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;IACvD,iBAAiB;IACjB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,kBAAkB;IAClB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,kBAAkB;IAClB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,yBAAyB;IACzB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,MAAM,WAAW,aAAa;IAC5B,wDAAwD;IACxD,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,KAAK,CAAA;IACzC,8BAA8B;IAC9B,OAAO,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,EAAE,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;IACvD,iBAAiB;IACjB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,gBAAgB;IAChB,QAAQ,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,QAAQ,CAAA;IACxC,yBAAyB;IACzB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED;;;;;;;;;GASG;AACH,wBAAgB,OAAO,CAAC,OAAO,GAAE,SAAc,GAAG,IAAI,CAarD;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,OAAO,GAAE,aAAkB,GAAG,IAAI,CAY9D"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* geom_rect - Rectangle geometry
|
|
3
|
+
*
|
|
4
|
+
* Renders rectangles defined by xmin, xmax, ymin, ymax.
|
|
5
|
+
*/
|
|
6
|
+
import type { Geom } from '../types';
|
|
7
|
+
export interface RectOptions {
|
|
8
|
+
/** Alpha transparency */
|
|
9
|
+
alpha?: number;
|
|
10
|
+
/** Border color */
|
|
11
|
+
color?: string;
|
|
12
|
+
/** Fill color */
|
|
13
|
+
fill?: string;
|
|
14
|
+
/** Border linetype */
|
|
15
|
+
linetype?: 'solid' | 'dashed' | 'dotted';
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Render rectangles
|
|
19
|
+
*/
|
|
20
|
+
export declare function geom_rect(options?: RectOptions): Geom;
|
|
21
|
+
/**
|
|
22
|
+
* Render arbitrary lines (y = slope * x + intercept)
|
|
23
|
+
*/
|
|
24
|
+
export interface AblineOptions {
|
|
25
|
+
/** Slope of the line */
|
|
26
|
+
slope?: number;
|
|
27
|
+
/** Y-intercept of the line */
|
|
28
|
+
intercept?: number;
|
|
29
|
+
/** Alpha transparency */
|
|
30
|
+
alpha?: number;
|
|
31
|
+
/** Line color */
|
|
32
|
+
color?: string;
|
|
33
|
+
/** Linetype */
|
|
34
|
+
linetype?: 'solid' | 'dashed' | 'dotted';
|
|
35
|
+
}
|
|
36
|
+
export declare function geom_abline(options?: AblineOptions): Geom;
|
|
37
|
+
//# sourceMappingURL=rect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rect.d.ts","sourceRoot":"","sources":["../../src/geoms/rect.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,UAAU,CAAA;AAEpC,MAAM,WAAW,WAAW;IAC1B,yBAAyB;IACzB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,mBAAmB;IACnB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,iBAAiB;IACjB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,sBAAsB;IACtB,QAAQ,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,QAAQ,CAAA;CACzC;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,OAAO,GAAE,WAAgB,GAAG,IAAI,CAYzD;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,wBAAwB;IACxB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,8BAA8B;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,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,wBAAgB,WAAW,CAAC,OAAO,GAAE,aAAkB,GAAG,IAAI,CAa7D"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* geom_rug - Marginal rug plots
|
|
3
|
+
*
|
|
4
|
+
* Draws tick marks along the axes showing the marginal distribution
|
|
5
|
+
* of data points. Commonly used alongside scatter plots to visualize
|
|
6
|
+
* data density along each axis.
|
|
7
|
+
*/
|
|
8
|
+
import type { Geom } from '../types';
|
|
9
|
+
export interface RugOptions {
|
|
10
|
+
/** Which sides to draw rugs on */
|
|
11
|
+
sides?: string;
|
|
12
|
+
/** Length of rug ticks (in character cells) */
|
|
13
|
+
length?: number;
|
|
14
|
+
/** Opacity (0-1) */
|
|
15
|
+
alpha?: number;
|
|
16
|
+
/** Fixed color (hex string) */
|
|
17
|
+
color?: string;
|
|
18
|
+
/** Whether to draw outside the plot area (default: true) */
|
|
19
|
+
outside?: boolean;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Draw marginal rug marks along axes
|
|
23
|
+
*
|
|
24
|
+
* Rug plots show tick marks at each data point position along one
|
|
25
|
+
* or both axes. This helps visualize the marginal distribution of
|
|
26
|
+
* data, especially useful for identifying clustering or gaps.
|
|
27
|
+
*
|
|
28
|
+
* @param options.sides - Which sides to draw rugs: 'b' (bottom), 't' (top),
|
|
29
|
+
* 'l' (left), 'r' (right). Can combine, e.g., 'bl' for bottom and left.
|
|
30
|
+
* Default is 'bl'.
|
|
31
|
+
* @param options.length - Length of rug ticks in character cells. Default is 1.
|
|
32
|
+
* @param options.alpha - Opacity from 0 to 1. Default is 1.
|
|
33
|
+
* @param options.color - Fixed color for all rug marks.
|
|
34
|
+
* @param options.outside - Whether to draw outside plot area. Default is true.
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* // Add rugs to a scatter plot (bottom and left)
|
|
38
|
+
* gg(data)
|
|
39
|
+
* .aes({ x: 'x', y: 'y' })
|
|
40
|
+
* .geom(geom_point())
|
|
41
|
+
* .geom(geom_rug())
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* // Rugs on all four sides
|
|
45
|
+
* gg(data)
|
|
46
|
+
* .aes({ x: 'x', y: 'y' })
|
|
47
|
+
* .geom(geom_point())
|
|
48
|
+
* .geom(geom_rug({ sides: 'bltr' }))
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* // Only x-axis rugs (bottom)
|
|
52
|
+
* gg(data)
|
|
53
|
+
* .aes({ x: 'x', y: 'y' })
|
|
54
|
+
* .geom(geom_point())
|
|
55
|
+
* .geom(geom_rug({ sides: 'b' }))
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* // Colored rugs with transparency
|
|
59
|
+
* gg(data)
|
|
60
|
+
* .aes({ x: 'x', y: 'y', color: 'group' })
|
|
61
|
+
* .geom(geom_point())
|
|
62
|
+
* .geom(geom_rug({ alpha: 0.5 }))
|
|
63
|
+
*/
|
|
64
|
+
export declare function geom_rug(options?: RugOptions): Geom;
|
|
65
|
+
//# sourceMappingURL=rug.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rug.d.ts","sourceRoot":"","sources":["../../src/geoms/rug.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,UAAU,CAAA;AAEpC,MAAM,WAAW,UAAU;IACzB,kCAAkC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,+CAA+C;IAC/C,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,oBAAoB;IACpB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,+BAA+B;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,4DAA4D;IAC5D,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,wBAAgB,QAAQ,CAAC,OAAO,GAAE,UAAe,GAAG,IAAI,CAavD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"segment.d.ts","sourceRoot":"","sources":["../../src/geoms/segment.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,UAAU,CAAA;AAEpC,MAAM,WAAW,cAAc;IAC7B,8BAA8B;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,mCAAmC;IACnC,QAAQ,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,QAAQ,CAAA;IACxC,2BAA2B;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,mCAAmC;IACnC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,wCAAwC;IACxC,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,qCAAqC;IACrC,SAAS,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAA;CAC9B;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,OAAO,GAAE,cAAmB,GAAG,IAAI,CAc/D;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,OAAO,GAAE,cAAc,GAAG;IACnD,+CAA+C;IAC/C,SAAS,CAAC,EAAE,MAAM,CAAA;CACd,GAAG,IAAI,CAeZ"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* geom_smooth - Smoothed conditional means
|
|
3
|
+
*
|
|
4
|
+
* Adds a smoothed line with optional confidence interval band.
|
|
5
|
+
* Uses linear regression (lm) or LOESS smoothing.
|
|
6
|
+
*/
|
|
7
|
+
import type { Geom } from '../types';
|
|
8
|
+
export interface SmoothOptions {
|
|
9
|
+
/** Smoothing method: 'lm' for linear, 'loess' or 'lowess' for local regression */
|
|
10
|
+
method?: 'lm' | 'loess' | 'lowess';
|
|
11
|
+
/** For loess: proportion of data to use in each local regression (0-1) */
|
|
12
|
+
span?: number;
|
|
13
|
+
/** Number of points to evaluate the smooth at */
|
|
14
|
+
n?: number;
|
|
15
|
+
/** Show confidence interval band? */
|
|
16
|
+
se?: boolean;
|
|
17
|
+
/** Confidence level (default 0.95) */
|
|
18
|
+
level?: number;
|
|
19
|
+
/** Line color */
|
|
20
|
+
color?: string;
|
|
21
|
+
/** Confidence band fill color (defaults to line color with alpha) */
|
|
22
|
+
fill?: string;
|
|
23
|
+
/** Alpha for confidence band (0-1) */
|
|
24
|
+
alpha?: number;
|
|
25
|
+
/** Line width/style */
|
|
26
|
+
linetype?: 'solid' | 'dashed' | 'dotted';
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Add a smoothed conditional mean line with confidence interval
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```ts
|
|
33
|
+
* // Linear regression with confidence band
|
|
34
|
+
* gg(data).geom(geom_smooth())
|
|
35
|
+
*
|
|
36
|
+
* // LOESS smoothing
|
|
37
|
+
* gg(data).geom(geom_smooth({ method: 'loess' }))
|
|
38
|
+
*
|
|
39
|
+
* // Linear regression without confidence band
|
|
40
|
+
* gg(data).geom(geom_smooth({ se: false }))
|
|
41
|
+
*
|
|
42
|
+
* // Custom styling
|
|
43
|
+
* gg(data).geom(geom_smooth({
|
|
44
|
+
* method: 'lm',
|
|
45
|
+
* color: '#3366cc',
|
|
46
|
+
* alpha: 0.2
|
|
47
|
+
* }))
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
export declare function geom_smooth(options?: SmoothOptions): Geom;
|
|
51
|
+
//# sourceMappingURL=smooth.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"smooth.d.ts","sourceRoot":"","sources":["../../src/geoms/smooth.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,UAAU,CAAA;AAEpC,MAAM,WAAW,aAAa;IAC5B,kFAAkF;IAClF,MAAM,CAAC,EAAE,IAAI,GAAG,OAAO,GAAG,QAAQ,CAAA;IAClC,0EAA0E;IAC1E,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,iDAAiD;IACjD,CAAC,CAAC,EAAE,MAAM,CAAA;IACV,qCAAqC;IACrC,EAAE,CAAC,EAAE,OAAO,CAAA;IACZ,sCAAsC;IACtC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,iBAAiB;IACjB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,qEAAqE;IACrE,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,sCAAsC;IACtC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,uBAAuB;IACvB,QAAQ,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,QAAQ,CAAA;CACzC;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,WAAW,CAAC,OAAO,GAAE,aAAkB,GAAG,IAAI,CAiB7D"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* geom_step - Step/staircase line geometry
|
|
3
|
+
*
|
|
4
|
+
* Creates a stairstep plot where lines only move horizontally
|
|
5
|
+
* or vertically, not diagonally. Useful for time series with
|
|
6
|
+
* discrete changes (e.g., stock prices, state machines).
|
|
7
|
+
*/
|
|
8
|
+
import type { Geom } from '../types';
|
|
9
|
+
export interface StepOptions {
|
|
10
|
+
/** Step direction: 'hv' (right then up/down), 'vh' (up/down then right), 'mid' (midpoint) */
|
|
11
|
+
direction?: 'hv' | 'vh' | 'mid';
|
|
12
|
+
/** Line width (1-3) */
|
|
13
|
+
linewidth?: number;
|
|
14
|
+
/** Line type */
|
|
15
|
+
linetype?: 'solid' | 'dashed' | 'dotted';
|
|
16
|
+
/** Opacity (0-1) */
|
|
17
|
+
alpha?: number;
|
|
18
|
+
/** Fixed color (hex string) */
|
|
19
|
+
color?: string;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Connect data points with stairstep lines
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* // Stock price changes (horizontal first, then vertical)
|
|
26
|
+
* gg(stockData)
|
|
27
|
+
* .aes({ x: 'date', y: 'price' })
|
|
28
|
+
* .geom(geom_step())
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* // State changes (vertical first, then horizontal)
|
|
32
|
+
* gg(stateData)
|
|
33
|
+
* .aes({ x: 'time', y: 'state' })
|
|
34
|
+
* .geom(geom_step({ direction: 'vh' }))
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* // Centered steps
|
|
38
|
+
* gg(data)
|
|
39
|
+
* .aes({ x: 'x', y: 'y' })
|
|
40
|
+
* .geom(geom_step({ direction: 'mid' }))
|
|
41
|
+
*/
|
|
42
|
+
export declare function geom_step(options?: StepOptions): Geom;
|
|
43
|
+
//# sourceMappingURL=step.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"step.d.ts","sourceRoot":"","sources":["../../src/geoms/step.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,UAAU,CAAA;AAEpC,MAAM,WAAW,WAAW;IAC1B,6FAA6F;IAC7F,SAAS,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,KAAK,CAAA;IAC/B,uBAAuB;IACvB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,gBAAgB;IAChB,QAAQ,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,QAAQ,CAAA;IACxC,oBAAoB;IACpB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,+BAA+B;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,SAAS,CAAC,OAAO,GAAE,WAAgB,GAAG,IAAI,CAazD"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* geom_text - Text label geometry
|
|
3
|
+
*/
|
|
4
|
+
import type { Geom } from '../types';
|
|
5
|
+
export interface TextOptions {
|
|
6
|
+
nudge_x?: number;
|
|
7
|
+
nudge_y?: number;
|
|
8
|
+
hjust?: 'left' | 'center' | 'right';
|
|
9
|
+
vjust?: 'top' | 'middle' | 'bottom';
|
|
10
|
+
color?: string;
|
|
11
|
+
size?: number;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Add text labels to the plot
|
|
15
|
+
*/
|
|
16
|
+
export declare function geom_text(options?: TextOptions): Geom;
|
|
17
|
+
/**
|
|
18
|
+
* Add text labels with background (for better readability)
|
|
19
|
+
*/
|
|
20
|
+
export declare function geom_label(options?: TextOptions & {
|
|
21
|
+
fill?: string;
|
|
22
|
+
}): Geom;
|
|
23
|
+
//# sourceMappingURL=text.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../src/geoms/text.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,UAAU,CAAA;AAEpC,MAAM,WAAW,WAAW;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,KAAK,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAA;IACnC,KAAK,CAAC,EAAE,KAAK,GAAG,QAAQ,GAAG,QAAQ,CAAA;IACnC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,OAAO,GAAE,WAAgB,GAAG,IAAI,CAczD;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,OAAO,GAAE,WAAW,GAAG;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAO,GAAG,IAAI,CAe9E"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* geom_tile - Tile geometry for heatmaps
|
|
3
|
+
*
|
|
4
|
+
* Renders rectangles at x, y positions with fill based on a value.
|
|
5
|
+
*/
|
|
6
|
+
import type { Geom } from '../types';
|
|
7
|
+
export interface TileOptions {
|
|
8
|
+
/** Width of each tile (default: auto from data spacing) */
|
|
9
|
+
width?: number;
|
|
10
|
+
/** Height of each tile (default: auto from data spacing) */
|
|
11
|
+
height?: number;
|
|
12
|
+
/** Alpha transparency */
|
|
13
|
+
alpha?: number;
|
|
14
|
+
/** Border color (default: none) */
|
|
15
|
+
color?: string;
|
|
16
|
+
/** Fill aesthetic (maps to color scale) */
|
|
17
|
+
fill?: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Render tiles/heatmap
|
|
21
|
+
*/
|
|
22
|
+
export declare function geom_tile(options?: TileOptions): Geom;
|
|
23
|
+
/**
|
|
24
|
+
* Alias for geom_tile with default binning
|
|
25
|
+
*/
|
|
26
|
+
export declare function geom_raster(options?: TileOptions): Geom;
|
|
27
|
+
//# sourceMappingURL=tile.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tile.d.ts","sourceRoot":"","sources":["../../src/geoms/tile.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,UAAU,CAAA;AAEpC,MAAM,WAAW,WAAW;IAC1B,2DAA2D;IAC3D,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,4DAA4D;IAC5D,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,yBAAyB;IACzB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,mCAAmC;IACnC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,2CAA2C;IAC3C,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,OAAO,GAAE,WAAgB,GAAG,IAAI,CAazD;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,OAAO,GAAE,WAAgB,GAAG,IAAI,CAE3D"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* geom_violin - Violin plot geometry
|
|
3
|
+
*
|
|
4
|
+
* Combines a boxplot with a rotated kernel density plot on each side.
|
|
5
|
+
*/
|
|
6
|
+
import type { Geom } from '../types';
|
|
7
|
+
export interface ViolinOptions {
|
|
8
|
+
/** Width of the violin (default: 0.8) */
|
|
9
|
+
width?: number;
|
|
10
|
+
/** Whether to draw the quantile lines (default: true) */
|
|
11
|
+
draw_quantiles?: number[] | null;
|
|
12
|
+
/** Scale violins: 'area' (default), 'count', or 'width' */
|
|
13
|
+
scale?: 'area' | 'count' | 'width';
|
|
14
|
+
/** Trim violin to data range (default: true) */
|
|
15
|
+
trim?: boolean;
|
|
16
|
+
/** Bandwidth adjustment factor (default: 1) */
|
|
17
|
+
adjust?: number;
|
|
18
|
+
/** Alpha transparency */
|
|
19
|
+
alpha?: number;
|
|
20
|
+
/** Border color */
|
|
21
|
+
color?: string;
|
|
22
|
+
/** Fill color */
|
|
23
|
+
fill?: string;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Render violin plot
|
|
27
|
+
*/
|
|
28
|
+
export declare function geom_violin(options?: ViolinOptions): Geom;
|
|
29
|
+
//# sourceMappingURL=violin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"violin.d.ts","sourceRoot":"","sources":["../../src/geoms/violin.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,UAAU,CAAA;AAEpC,MAAM,WAAW,aAAa;IAC5B,yCAAyC;IACzC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,yDAAyD;IACzD,cAAc,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,CAAA;IAChC,2DAA2D;IAC3D,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,OAAO,CAAA;IAClC,gDAAgD;IAChD,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,+CAA+C;IAC/C,MAAM,CAAC,EAAE,MAAM,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,WAAW,CAAC,OAAO,GAAE,aAAkB,GAAG,IAAI,CAe7D"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* gg() - Plot builder with fluent API
|
|
3
|
+
*/
|
|
4
|
+
import type { AestheticMapping, Coord, DataSource, Facet, Geom, Labels, PlotSpec, RenderOptions, Scale, Stat, Theme } from './types';
|
|
5
|
+
/**
|
|
6
|
+
* Plot builder class with fluent API
|
|
7
|
+
*/
|
|
8
|
+
export declare class GGPlot {
|
|
9
|
+
private _data;
|
|
10
|
+
private _aes;
|
|
11
|
+
private _geoms;
|
|
12
|
+
private _stats;
|
|
13
|
+
private _scales;
|
|
14
|
+
private _coord;
|
|
15
|
+
private _facet?;
|
|
16
|
+
private _theme;
|
|
17
|
+
private _labels;
|
|
18
|
+
constructor(data: DataSource);
|
|
19
|
+
/**
|
|
20
|
+
* Set aesthetic mappings
|
|
21
|
+
*/
|
|
22
|
+
aes(mapping: AestheticMapping): this;
|
|
23
|
+
/**
|
|
24
|
+
* Add a geometry layer
|
|
25
|
+
*/
|
|
26
|
+
geom(geom: Geom): this;
|
|
27
|
+
/**
|
|
28
|
+
* Add an annotation layer
|
|
29
|
+
* Annotations are geometry layers with fixed positions (not mapped from data)
|
|
30
|
+
*/
|
|
31
|
+
annotate(annotation: Geom): this;
|
|
32
|
+
/**
|
|
33
|
+
* Add a statistical transformation
|
|
34
|
+
*/
|
|
35
|
+
stat(stat: Stat): this;
|
|
36
|
+
/**
|
|
37
|
+
* Add or configure a scale
|
|
38
|
+
*/
|
|
39
|
+
scale(scale: Scale): this;
|
|
40
|
+
/**
|
|
41
|
+
* Set coordinate system
|
|
42
|
+
*/
|
|
43
|
+
coord(coord: Coord): this;
|
|
44
|
+
/**
|
|
45
|
+
* Set faceting
|
|
46
|
+
*/
|
|
47
|
+
facet(facet: Facet): this;
|
|
48
|
+
/**
|
|
49
|
+
* Apply a theme
|
|
50
|
+
*/
|
|
51
|
+
theme(theme: Theme | Partial<Theme>): this;
|
|
52
|
+
/**
|
|
53
|
+
* Set labels (title, axes, legends)
|
|
54
|
+
*/
|
|
55
|
+
labs(labels: Labels): this;
|
|
56
|
+
/**
|
|
57
|
+
* Push new data points (for streaming)
|
|
58
|
+
*/
|
|
59
|
+
push(data: DataSource | Record<string, unknown>): this;
|
|
60
|
+
/**
|
|
61
|
+
* Get the current plot specification
|
|
62
|
+
*/
|
|
63
|
+
spec(): PlotSpec;
|
|
64
|
+
/**
|
|
65
|
+
* Get data
|
|
66
|
+
*/
|
|
67
|
+
get data(): DataSource;
|
|
68
|
+
/**
|
|
69
|
+
* Get geoms
|
|
70
|
+
*/
|
|
71
|
+
get geoms(): Geom[];
|
|
72
|
+
/**
|
|
73
|
+
* Render plot to string
|
|
74
|
+
*/
|
|
75
|
+
render(options: RenderOptions): string;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Create a new plot
|
|
79
|
+
*/
|
|
80
|
+
export declare function gg(data?: DataSource): GGPlot;
|
|
81
|
+
//# sourceMappingURL=grammar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grammar.d.ts","sourceRoot":"","sources":["../src/grammar.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EACV,gBAAgB,EAChB,KAAK,EACL,UAAU,EACV,KAAK,EACL,IAAI,EACJ,MAAM,EACN,QAAQ,EACR,aAAa,EACb,KAAK,EACL,IAAI,EACJ,KAAK,EACN,MAAM,SAAS,CAAA;AAKhB;;GAEG;AACH,qBAAa,MAAM;IACjB,OAAO,CAAC,KAAK,CAAY;IACzB,OAAO,CAAC,IAAI,CAAqC;IACjD,OAAO,CAAC,MAAM,CAAa;IAC3B,OAAO,CAAC,MAAM,CAAa;IAC3B,OAAO,CAAC,OAAO,CAAc;IAC7B,OAAO,CAAC,MAAM,CAA0B;IACxC,OAAO,CAAC,MAAM,CAAC,CAAO;IACtB,OAAO,CAAC,MAAM,CAAwB;IACtC,OAAO,CAAC,OAAO,CAAa;gBAEhB,IAAI,EAAE,UAAU;IAI5B;;OAEG;IACH,GAAG,CAAC,OAAO,EAAE,gBAAgB,GAAG,IAAI;IAKpC;;OAEG;IACH,IAAI,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI;IAKtB;;;OAGG;IACH,QAAQ,CAAC,UAAU,EAAE,IAAI,GAAG,IAAI;IAKhC;;OAEG;IACH,IAAI,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI;IAKtB;;OAEG;IACH,KAAK,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI;IAWzB;;OAEG;IACH,KAAK,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI;IAKzB;;OAEG;IACH,KAAK,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI;IAKzB;;OAEG;IACH,KAAK,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,IAAI;IAK1C;;OAEG;IACH,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAK1B;;OAEG;IACH,IAAI,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IAStD;;OAEG;IACH,IAAI,IAAI,QAAQ;IAchB;;OAEG;IACH,IAAI,IAAI,IAAI,UAAU,CAErB;IAED;;OAEG;IACH,IAAI,KAAK,IAAI,IAAI,EAAE,CAElB;IAED;;OAEG;IACH,MAAM,CAAC,OAAO,EAAE,aAAa,GAAG,MAAM;CAGvC;AAED;;GAEG;AACH,wBAAgB,EAAE,CAAC,IAAI,GAAE,UAAe,GAAG,MAAM,CAEhD"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Plot history management
|
|
3
|
+
*
|
|
4
|
+
* Tracks all plots created with provenance metadata for later retrieval.
|
|
5
|
+
*/
|
|
6
|
+
import type { PlotSpec } from '../types';
|
|
7
|
+
export interface PlotProvenance {
|
|
8
|
+
id: string;
|
|
9
|
+
timestamp: string;
|
|
10
|
+
dataFile?: string;
|
|
11
|
+
command?: string;
|
|
12
|
+
description: string;
|
|
13
|
+
geomTypes: string[];
|
|
14
|
+
aesthetics: string[];
|
|
15
|
+
}
|
|
16
|
+
export interface HistoricalPlot {
|
|
17
|
+
_provenance: PlotProvenance;
|
|
18
|
+
spec: PlotSpec;
|
|
19
|
+
}
|
|
20
|
+
export interface HistoryEntry {
|
|
21
|
+
id: string;
|
|
22
|
+
timestamp: string;
|
|
23
|
+
description: string;
|
|
24
|
+
dataFile?: string;
|
|
25
|
+
geomTypes: string[];
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Get the .ggterm directory path
|
|
29
|
+
*/
|
|
30
|
+
export declare function getGGTermDir(): string;
|
|
31
|
+
/**
|
|
32
|
+
* Get the plots directory path
|
|
33
|
+
*/
|
|
34
|
+
export declare function getPlotsDir(): string;
|
|
35
|
+
/**
|
|
36
|
+
* Get the history file path
|
|
37
|
+
*/
|
|
38
|
+
export declare function getHistoryFile(): string;
|
|
39
|
+
/**
|
|
40
|
+
* Ensure the history directories exist
|
|
41
|
+
*/
|
|
42
|
+
export declare function ensureHistoryDirs(): void;
|
|
43
|
+
/**
|
|
44
|
+
* Generate a unique plot ID based on date and sequence
|
|
45
|
+
*/
|
|
46
|
+
export declare function generatePlotId(): string;
|
|
47
|
+
/**
|
|
48
|
+
* Auto-generate a description based on the plot spec
|
|
49
|
+
*/
|
|
50
|
+
export declare function generateDescription(spec: PlotSpec): string;
|
|
51
|
+
/**
|
|
52
|
+
* Save a plot to history
|
|
53
|
+
*/
|
|
54
|
+
export declare function savePlotToHistory(spec: PlotSpec, options?: {
|
|
55
|
+
dataFile?: string;
|
|
56
|
+
command?: string;
|
|
57
|
+
description?: string;
|
|
58
|
+
}): string;
|
|
59
|
+
/**
|
|
60
|
+
* Load a plot from history by ID
|
|
61
|
+
*/
|
|
62
|
+
export declare function loadPlotFromHistory(id: string): HistoricalPlot | null;
|
|
63
|
+
/**
|
|
64
|
+
* Get all history entries
|
|
65
|
+
*/
|
|
66
|
+
export declare function getHistory(): HistoryEntry[];
|
|
67
|
+
/**
|
|
68
|
+
* Search history by text (searches description, dataFile, geomTypes)
|
|
69
|
+
*/
|
|
70
|
+
export declare function searchHistory(query: string): HistoryEntry[];
|
|
71
|
+
/**
|
|
72
|
+
* Get the most recent plot ID
|
|
73
|
+
*/
|
|
74
|
+
export declare function getLatestPlotId(): string | null;
|
|
75
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/history/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAExC,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAA;IACV,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,WAAW,EAAE,MAAM,CAAA;IACnB,SAAS,EAAE,MAAM,EAAE,CAAA;IACnB,UAAU,EAAE,MAAM,EAAE,CAAA;CACrB;AAED,MAAM,WAAW,cAAc;IAC7B,WAAW,EAAE,cAAc,CAAA;IAC3B,IAAI,EAAE,QAAQ,CAAA;CACf;AAED,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAA;IACV,SAAS,EAAE,MAAM,CAAA;IACjB,WAAW,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,EAAE,CAAA;CACpB;AAED;;GAEG;AACH,wBAAgB,YAAY,IAAI,MAAM,CAErC;AAED;;GAEG;AACH,wBAAgB,WAAW,IAAI,MAAM,CAEpC;AAED;;GAEG;AACH,wBAAgB,cAAc,IAAI,MAAM,CAEvC;AAED;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,IAAI,CAUxC;AAED;;GAEG;AACH,wBAAgB,cAAc,IAAI,MAAM,CAwBvC;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,QAAQ,GAAG,MAAM,CA8B1D;AA6BD;;GAEG;AACH,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,QAAQ,EACd,OAAO,GAAE;IACP,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,WAAW,CAAC,EAAE,MAAM,CAAA;CAChB,GACL,MAAM,CAwCR;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,EAAE,EAAE,MAAM,GAAG,cAAc,GAAG,IAAI,CAQrE;AAED;;GAEG;AACH,wBAAgB,UAAU,IAAI,YAAY,EAAE,CAgB3C;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,YAAY,EAAE,CAa3D;AAED;;GAEG;AACH,wBAAgB,eAAe,IAAI,MAAM,GAAG,IAAI,CAM/C"}
|