@ggterm/core 0.2.17 → 0.3.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/cli-plot.js +3128 -118
- package/dist/cli.js +2287 -23
- package/dist/geoms/biplot.d.ts +35 -0
- package/dist/geoms/biplot.d.ts.map +1 -0
- package/dist/geoms/bland-altman.d.ts +50 -0
- package/dist/geoms/bland-altman.d.ts.map +1 -0
- package/dist/geoms/control.d.ts +118 -0
- package/dist/geoms/control.d.ts.map +1 -0
- package/dist/geoms/dendrogram.d.ts +74 -0
- package/dist/geoms/dendrogram.d.ts.map +1 -0
- package/dist/geoms/ecdf.d.ts +66 -0
- package/dist/geoms/ecdf.d.ts.map +1 -0
- package/dist/geoms/forest.d.ts +45 -0
- package/dist/geoms/forest.d.ts.map +1 -0
- package/dist/geoms/funnel.d.ts +78 -0
- package/dist/geoms/funnel.d.ts.map +1 -0
- package/dist/geoms/heatmap.d.ts +34 -0
- package/dist/geoms/heatmap.d.ts.map +1 -0
- package/dist/geoms/index.d.ts +15 -1
- package/dist/geoms/index.d.ts.map +1 -1
- package/dist/geoms/kaplan-meier.d.ts +39 -0
- package/dist/geoms/kaplan-meier.d.ts.map +1 -0
- package/dist/geoms/ma.d.ts +77 -0
- package/dist/geoms/ma.d.ts.map +1 -0
- package/dist/geoms/manhattan.d.ts +29 -0
- package/dist/geoms/manhattan.d.ts.map +1 -0
- package/dist/geoms/qq.d.ts +51 -59
- package/dist/geoms/qq.d.ts.map +1 -1
- package/dist/geoms/roc.d.ts +44 -0
- package/dist/geoms/roc.d.ts.map +1 -0
- package/dist/geoms/scree.d.ts +97 -0
- package/dist/geoms/scree.d.ts.map +1 -0
- package/dist/geoms/upset.d.ts +63 -0
- package/dist/geoms/upset.d.ts.map +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2315 -25
- package/dist/pipeline/pipeline.d.ts.map +1 -1
- package/dist/pipeline/render-geoms.d.ts +4 -0
- package/dist/pipeline/render-geoms.d.ts.map +1 -1
- package/dist/serve.d.ts +8 -0
- package/dist/serve.d.ts.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PCA Biplot Geometry
|
|
3
|
+
*
|
|
4
|
+
* Visualizes PCA (Principal Component Analysis) results showing both samples
|
|
5
|
+
* (scores) and variables (loadings) in the same plot. Useful for understanding
|
|
6
|
+
* relationships between samples and which variables drive the separation.
|
|
7
|
+
*/
|
|
8
|
+
import type { Geom } from '../types';
|
|
9
|
+
export interface BiplotOptions {
|
|
10
|
+
pc1_col?: string;
|
|
11
|
+
pc2_col?: string;
|
|
12
|
+
loadings?: Array<{
|
|
13
|
+
variable: string;
|
|
14
|
+
pc1: number;
|
|
15
|
+
pc2: number;
|
|
16
|
+
}>;
|
|
17
|
+
var_explained?: [number, number];
|
|
18
|
+
show_scores?: boolean;
|
|
19
|
+
score_color?: string;
|
|
20
|
+
score_size?: number;
|
|
21
|
+
score_alpha?: number;
|
|
22
|
+
score_char?: string;
|
|
23
|
+
show_score_labels?: boolean;
|
|
24
|
+
show_loadings?: boolean;
|
|
25
|
+
loading_color?: string;
|
|
26
|
+
loading_scale?: number;
|
|
27
|
+
arrow_char?: string;
|
|
28
|
+
show_loading_labels?: boolean;
|
|
29
|
+
show_origin?: boolean;
|
|
30
|
+
origin_color?: string;
|
|
31
|
+
show_circle?: boolean;
|
|
32
|
+
circle_color?: string;
|
|
33
|
+
}
|
|
34
|
+
export declare function geom_biplot(options?: BiplotOptions): Geom;
|
|
35
|
+
//# sourceMappingURL=biplot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"biplot.d.ts","sourceRoot":"","sources":["../../src/geoms/biplot.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,UAAU,CAAA;AAEpC,MAAM,WAAW,aAAa;IAE5B,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,OAAO,CAAC,EAAE,MAAM,CAAA;IAGhB,QAAQ,CAAC,EAAE,KAAK,CAAC;QACf,QAAQ,EAAE,MAAM,CAAA;QAChB,GAAG,EAAE,MAAM,CAAA;QACX,GAAG,EAAE,MAAM,CAAA;KACZ,CAAC,CAAA;IAGF,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAGhC,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAG3B,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAG7B,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,YAAY,CAAC,EAAE,MAAM,CAAA;IAGrB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB;AAED,wBAAgB,WAAW,CAAC,OAAO,GAAE,aAAkB,GAAG,IAAI,CA2B7D"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bland-Altman Plot Geom
|
|
3
|
+
*
|
|
4
|
+
* Creates Bland-Altman plots (difference plots) for method comparison.
|
|
5
|
+
* Used to assess agreement between two measurement methods.
|
|
6
|
+
*
|
|
7
|
+
* Plots the difference between methods against their mean.
|
|
8
|
+
* Shows mean difference (bias) and limits of agreement (±1.96 SD).
|
|
9
|
+
*
|
|
10
|
+
* Expected data format:
|
|
11
|
+
* - method1: Measurements from first method
|
|
12
|
+
* - method2: Measurements from second method
|
|
13
|
+
* OR pre-computed:
|
|
14
|
+
* - mean: Mean of two methods ((method1 + method2) / 2)
|
|
15
|
+
* - diff: Difference between methods (method1 - method2)
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```typescript
|
|
19
|
+
* gg(comparisonData)
|
|
20
|
+
* .aes({ x: 'method1', y: 'method2' })
|
|
21
|
+
* .geom(geom_bland_altman({ show_limits: true, show_bias: true }))
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
import type { Geom } from '../types';
|
|
25
|
+
export interface BlandAltmanOptions {
|
|
26
|
+
/** Show limits of agreement lines (default: true) */
|
|
27
|
+
show_limits?: boolean;
|
|
28
|
+
/** Show mean bias line (default: true) */
|
|
29
|
+
show_bias?: boolean;
|
|
30
|
+
/** Multiplier for limits of agreement (default: 1.96 for 95% limits) */
|
|
31
|
+
limit_multiplier?: number;
|
|
32
|
+
/** Color for bias line (default: '#0000ff') */
|
|
33
|
+
bias_color?: string;
|
|
34
|
+
/** Color for limit lines (default: '#ff0000') */
|
|
35
|
+
limit_color?: string;
|
|
36
|
+
/** Line style for reference lines (default: 'dashed') */
|
|
37
|
+
linetype?: 'solid' | 'dashed' | 'dotted';
|
|
38
|
+
/** Show confidence intervals for limits (default: false) */
|
|
39
|
+
show_ci?: boolean;
|
|
40
|
+
/** Confidence level (default: 0.95) */
|
|
41
|
+
conf_level?: number;
|
|
42
|
+
/** Point character (default: '●') */
|
|
43
|
+
point_char?: string;
|
|
44
|
+
/** Show percentage difference instead of absolute (default: false) */
|
|
45
|
+
percent_diff?: boolean;
|
|
46
|
+
/** Data is pre-computed mean/diff format (default: false) */
|
|
47
|
+
precomputed?: boolean;
|
|
48
|
+
}
|
|
49
|
+
export declare function geom_bland_altman(options?: BlandAltmanOptions): Geom;
|
|
50
|
+
//# sourceMappingURL=bland-altman.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bland-altman.d.ts","sourceRoot":"","sources":["../../src/geoms/bland-altman.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,UAAU,CAAA;AAEpC,MAAM,WAAW,kBAAkB;IACjC,qDAAqD;IACrD,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,0CAA0C;IAC1C,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,wEAAwE;IACxE,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,+CAA+C;IAC/C,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,iDAAiD;IACjD,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,yDAAyD;IACzD,QAAQ,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,QAAQ,CAAA;IACxC,4DAA4D;IAC5D,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,uCAAuC;IACvC,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,qCAAqC;IACrC,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,sEAAsE;IACtE,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,6DAA6D;IAC7D,WAAW,CAAC,EAAE,OAAO,CAAA;CACtB;AAED,wBAAgB,iBAAiB,CAAC,OAAO,GAAE,kBAAuB,GAAG,IAAI,CAmBxE"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Control Chart (Shewhart Chart) Geometry
|
|
3
|
+
*
|
|
4
|
+
* Creates statistical process control charts showing data points
|
|
5
|
+
* with control limits (UCL, LCL) and center line.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* // Basic control chart
|
|
9
|
+
* gg(data)
|
|
10
|
+
* .aes({ x: 'sample', y: 'measurement' })
|
|
11
|
+
* .geom(geom_control())
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* // Control chart with custom limits
|
|
15
|
+
* gg(data)
|
|
16
|
+
* .aes({ x: 'sample', y: 'measurement' })
|
|
17
|
+
* .geom(geom_control({ sigma: 2 }))
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* // X-bar chart for subgroup means
|
|
21
|
+
* gg(data)
|
|
22
|
+
* .aes({ x: 'sample', y: 'measurement' })
|
|
23
|
+
* .geom(geom_control({ chart_type: 'xbar' }))
|
|
24
|
+
*/
|
|
25
|
+
import type { Geom } from '../types';
|
|
26
|
+
export interface ControlOptions {
|
|
27
|
+
/**
|
|
28
|
+
* Type of control chart
|
|
29
|
+
* - 'i': Individual measurements (I-chart)
|
|
30
|
+
* - 'xbar': Subgroup means (X-bar chart)
|
|
31
|
+
* - 'r': Range chart
|
|
32
|
+
* - 's': Standard deviation chart
|
|
33
|
+
* - 'p': Proportion chart
|
|
34
|
+
* - 'c': Count chart
|
|
35
|
+
* @default 'i'
|
|
36
|
+
*/
|
|
37
|
+
chart_type?: 'i' | 'xbar' | 'r' | 's' | 'p' | 'c';
|
|
38
|
+
/**
|
|
39
|
+
* Number of standard deviations for control limits
|
|
40
|
+
* @default 3
|
|
41
|
+
*/
|
|
42
|
+
sigma?: number;
|
|
43
|
+
/**
|
|
44
|
+
* Show center line (mean/target)
|
|
45
|
+
* @default true
|
|
46
|
+
*/
|
|
47
|
+
show_center?: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Show upper control limit
|
|
50
|
+
* @default true
|
|
51
|
+
*/
|
|
52
|
+
show_ucl?: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Show lower control limit
|
|
55
|
+
* @default true
|
|
56
|
+
*/
|
|
57
|
+
show_lcl?: boolean;
|
|
58
|
+
/**
|
|
59
|
+
* Show warning limits (typically at 2 sigma)
|
|
60
|
+
* @default false
|
|
61
|
+
*/
|
|
62
|
+
show_warning?: boolean;
|
|
63
|
+
/**
|
|
64
|
+
* Custom center line value (if not computed from data)
|
|
65
|
+
* @default undefined
|
|
66
|
+
*/
|
|
67
|
+
center?: number;
|
|
68
|
+
/**
|
|
69
|
+
* Custom UCL value
|
|
70
|
+
* @default undefined
|
|
71
|
+
*/
|
|
72
|
+
ucl?: number;
|
|
73
|
+
/**
|
|
74
|
+
* Custom LCL value
|
|
75
|
+
* @default undefined
|
|
76
|
+
*/
|
|
77
|
+
lcl?: number;
|
|
78
|
+
/**
|
|
79
|
+
* Color for center line
|
|
80
|
+
* @default '#0000ff'
|
|
81
|
+
*/
|
|
82
|
+
center_color?: string;
|
|
83
|
+
/**
|
|
84
|
+
* Color for control limits
|
|
85
|
+
* @default '#ff0000'
|
|
86
|
+
*/
|
|
87
|
+
limit_color?: string;
|
|
88
|
+
/**
|
|
89
|
+
* Color for warning limits
|
|
90
|
+
* @default '#ffa500'
|
|
91
|
+
*/
|
|
92
|
+
warning_color?: string;
|
|
93
|
+
/**
|
|
94
|
+
* Connect points with lines
|
|
95
|
+
* @default true
|
|
96
|
+
*/
|
|
97
|
+
connect_points?: boolean;
|
|
98
|
+
/**
|
|
99
|
+
* Highlight out-of-control points
|
|
100
|
+
* @default true
|
|
101
|
+
*/
|
|
102
|
+
highlight_ooc?: boolean;
|
|
103
|
+
/**
|
|
104
|
+
* Character for out-of-control points
|
|
105
|
+
* @default '◆'
|
|
106
|
+
*/
|
|
107
|
+
ooc_char?: string;
|
|
108
|
+
/**
|
|
109
|
+
* Point character
|
|
110
|
+
* @default '●'
|
|
111
|
+
*/
|
|
112
|
+
point_char?: string;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Create a control chart geometry
|
|
116
|
+
*/
|
|
117
|
+
export declare function geom_control(options?: ControlOptions): Geom;
|
|
118
|
+
//# sourceMappingURL=control.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"control.d.ts","sourceRoot":"","sources":["../../src/geoms/control.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAErC,MAAM,WAAW,cAAc;IAC7B;;;;;;;;;OASG;IACH,UAAU,CAAC,EAAE,GAAG,GAAG,MAAM,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;IAElD;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IAEvB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IAEzB;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,OAAO,GAAE,cAAmB,GAAG,IAAI,CAwB/D"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dendrogram Geom
|
|
3
|
+
*
|
|
4
|
+
* Hierarchical tree visualization for clustering results, phylogenetics, etc.
|
|
5
|
+
* Supports both pre-computed dendrograms and automatic hierarchical clustering.
|
|
6
|
+
*
|
|
7
|
+
* Data format options:
|
|
8
|
+
* 1. Linkage matrix: Standard hierarchical clustering output
|
|
9
|
+
* [{ merge1: idx1, merge2: idx2, height: h, size: n }, ...]
|
|
10
|
+
* 2. Newick format: Phylogenetic tree string in 'newick' column
|
|
11
|
+
* 3. Parent-child: { id, parent, height? } format
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* // Linkage matrix format
|
|
15
|
+
* const linkage = [
|
|
16
|
+
* { merge1: 0, merge2: 1, height: 0.5, size: 2 },
|
|
17
|
+
* { merge1: 2, merge2: 3, height: 1.0, size: 2 },
|
|
18
|
+
* { merge1: 4, merge2: 5, height: 2.0, size: 4 },
|
|
19
|
+
* ]
|
|
20
|
+
* gg(linkage).geom(geom_dendrogram({ labels: ['A', 'B', 'C', 'D'] }))
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* // Parent-child format
|
|
24
|
+
* const tree = [
|
|
25
|
+
* { id: 'root', parent: null, height: 3 },
|
|
26
|
+
* { id: 'A', parent: 'node1', height: 0 },
|
|
27
|
+
* { id: 'B', parent: 'node1', height: 0 },
|
|
28
|
+
* { id: 'node1', parent: 'root', height: 1 },
|
|
29
|
+
* ]
|
|
30
|
+
* gg(tree).aes({ x: 'id', y: 'height' }).geom(geom_dendrogram())
|
|
31
|
+
*/
|
|
32
|
+
import type { Geom } from '../types';
|
|
33
|
+
export interface DendrogramOptions {
|
|
34
|
+
/** Orientation: 'vertical' (root at top) or 'horizontal' (root at left) */
|
|
35
|
+
orientation?: 'vertical' | 'horizontal';
|
|
36
|
+
/** Leaf labels (for linkage matrix format) */
|
|
37
|
+
labels?: string[];
|
|
38
|
+
/** Show leaf labels */
|
|
39
|
+
show_labels?: boolean;
|
|
40
|
+
/** Hang leaves at same level (vs proportional to height) */
|
|
41
|
+
hang?: boolean;
|
|
42
|
+
/** Cut height for coloring clusters */
|
|
43
|
+
cut_height?: number;
|
|
44
|
+
/** Number of clusters to highlight (alternative to cut_height) */
|
|
45
|
+
k?: number;
|
|
46
|
+
/** Branch line character */
|
|
47
|
+
branch_char?: string;
|
|
48
|
+
/** Horizontal connector character */
|
|
49
|
+
h_connector?: string;
|
|
50
|
+
/** Vertical connector character */
|
|
51
|
+
v_connector?: string;
|
|
52
|
+
/** Corner characters */
|
|
53
|
+
corner_tl?: string;
|
|
54
|
+
corner_tr?: string;
|
|
55
|
+
corner_bl?: string;
|
|
56
|
+
corner_br?: string;
|
|
57
|
+
/** Leaf character */
|
|
58
|
+
leaf_char?: string;
|
|
59
|
+
/** Colors for different clusters */
|
|
60
|
+
cluster_colors?: string[];
|
|
61
|
+
/** Line style: 'square' (default) or 'diagonal' */
|
|
62
|
+
line_style?: 'square' | 'diagonal';
|
|
63
|
+
/** Column containing parent references */
|
|
64
|
+
parent_col?: string;
|
|
65
|
+
/** Column containing node heights */
|
|
66
|
+
height_col?: string;
|
|
67
|
+
/** Column containing node IDs */
|
|
68
|
+
id_col?: string;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Create a dendrogram geom for hierarchical tree visualization
|
|
72
|
+
*/
|
|
73
|
+
export declare function geom_dendrogram(options?: DendrogramOptions): Geom;
|
|
74
|
+
//# sourceMappingURL=dendrogram.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dendrogram.d.ts","sourceRoot":"","sources":["../../src/geoms/dendrogram.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,UAAU,CAAA;AAEpC,MAAM,WAAW,iBAAiB;IAChC,2EAA2E;IAC3E,WAAW,CAAC,EAAE,UAAU,GAAG,YAAY,CAAA;IACvC,8CAA8C;IAC9C,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;IACjB,uBAAuB;IACvB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,4DAA4D;IAC5D,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,uCAAuC;IACvC,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,kEAAkE;IAClE,CAAC,CAAC,EAAE,MAAM,CAAA;IACV,4BAA4B;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,qCAAqC;IACrC,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,mCAAmC;IACnC,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,wBAAwB;IACxB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,qBAAqB;IACrB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,oCAAoC;IACpC,cAAc,CAAC,EAAE,MAAM,EAAE,CAAA;IACzB,mDAAmD;IACnD,UAAU,CAAC,EAAE,QAAQ,GAAG,UAAU,CAAA;IAClC,0CAA0C;IAC1C,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,qCAAqC;IACrC,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,iCAAiC;IACjC,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,OAAO,GAAE,iBAAsB,GAAG,IAAI,CA2BrE"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Empirical Cumulative Distribution Function Geometry
|
|
3
|
+
*
|
|
4
|
+
* Creates ECDF plots showing the proportion of data at or below each value.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* // Basic ECDF
|
|
8
|
+
* gg(data)
|
|
9
|
+
* .aes({ x: 'values' })
|
|
10
|
+
* .geom(geom_ecdf())
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* // ECDF with confidence band
|
|
14
|
+
* gg(data)
|
|
15
|
+
* .aes({ x: 'values' })
|
|
16
|
+
* .geom(geom_ecdf({ show_ci: true }))
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* // Multiple ECDFs by group
|
|
20
|
+
* gg(data)
|
|
21
|
+
* .aes({ x: 'values', color: 'group' })
|
|
22
|
+
* .geom(geom_ecdf())
|
|
23
|
+
*/
|
|
24
|
+
import type { Geom } from '../types';
|
|
25
|
+
export interface ECDFOptions {
|
|
26
|
+
/**
|
|
27
|
+
* Pad the ECDF to [0, 1] range on y-axis
|
|
28
|
+
* @default true
|
|
29
|
+
*/
|
|
30
|
+
pad?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Show confidence band (Dvoretzky-Kiefer-Wolfowitz inequality)
|
|
33
|
+
* @default false
|
|
34
|
+
*/
|
|
35
|
+
show_ci?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Confidence level for CI band
|
|
38
|
+
* @default 0.95
|
|
39
|
+
*/
|
|
40
|
+
conf_level?: number;
|
|
41
|
+
/**
|
|
42
|
+
* Step type for the ECDF
|
|
43
|
+
* @default 'post'
|
|
44
|
+
*/
|
|
45
|
+
step_type?: 'pre' | 'post' | 'mid';
|
|
46
|
+
/**
|
|
47
|
+
* Show points at each step
|
|
48
|
+
* @default false
|
|
49
|
+
*/
|
|
50
|
+
show_points?: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Line character for steps
|
|
53
|
+
* @default '─'
|
|
54
|
+
*/
|
|
55
|
+
line_char?: string;
|
|
56
|
+
/**
|
|
57
|
+
* Complement (1 - ECDF) for survival-style plot
|
|
58
|
+
* @default false
|
|
59
|
+
*/
|
|
60
|
+
complement?: boolean;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Create an ECDF geometry
|
|
64
|
+
*/
|
|
65
|
+
export declare function geom_ecdf(options?: ECDFOptions): Geom;
|
|
66
|
+
//# sourceMappingURL=ecdf.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ecdf.d.ts","sourceRoot":"","sources":["../../src/geoms/ecdf.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAErC,MAAM,WAAW,WAAW;IAC1B;;;OAGG;IACH,GAAG,CAAC,EAAE,OAAO,CAAC;IAEd;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;OAGG;IACH,SAAS,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,KAAK,CAAC;IAEnC;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,OAAO,GAAE,WAAgB,GAAG,IAAI,CAezD"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Forest Plot Geom
|
|
3
|
+
*
|
|
4
|
+
* Creates forest plots for meta-analysis visualization.
|
|
5
|
+
* Shows effect sizes with confidence intervals across multiple studies.
|
|
6
|
+
*
|
|
7
|
+
* Expected data format:
|
|
8
|
+
* - study: Study identifier/name
|
|
9
|
+
* - estimate: Point estimate (e.g., odds ratio, hazard ratio, mean difference)
|
|
10
|
+
* - ci_lower: Lower confidence interval bound
|
|
11
|
+
* - ci_upper: Upper confidence interval bound
|
|
12
|
+
* - weight (optional): Study weight for point size
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```typescript
|
|
16
|
+
* gg(metaData)
|
|
17
|
+
* .aes({ y: 'study', x: 'estimate', xmin: 'ci_lower', xmax: 'ci_upper', size: 'weight' })
|
|
18
|
+
* .geom(geom_forest({ null_line: 1, log_scale: true }))
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
import type { Geom } from '../types';
|
|
22
|
+
export interface ForestOptions {
|
|
23
|
+
/** Value for null effect line (default: 1 for ratios, 0 for differences) */
|
|
24
|
+
null_line?: number;
|
|
25
|
+
/** Use log scale for x-axis (default: false, set true for ratios) */
|
|
26
|
+
log_scale?: boolean;
|
|
27
|
+
/** Show diamond for summary/pooled estimate (default: false) */
|
|
28
|
+
show_summary?: boolean;
|
|
29
|
+
/** Row index for summary diamond (default: last row) */
|
|
30
|
+
summary_row?: number;
|
|
31
|
+
/** Color for null line (default: '#888888') */
|
|
32
|
+
null_line_color?: string;
|
|
33
|
+
/** Line style for null line (default: 'dashed') */
|
|
34
|
+
null_line_type?: 'solid' | 'dashed' | 'dotted';
|
|
35
|
+
/** Point character (default: '■') */
|
|
36
|
+
point_char?: string;
|
|
37
|
+
/** Show study weights as percentages (default: false) */
|
|
38
|
+
show_weights?: boolean;
|
|
39
|
+
/** Minimum point size (default: 1) */
|
|
40
|
+
min_size?: number;
|
|
41
|
+
/** Maximum point size (default: 3) */
|
|
42
|
+
max_size?: number;
|
|
43
|
+
}
|
|
44
|
+
export declare function geom_forest(options?: ForestOptions): Geom;
|
|
45
|
+
//# sourceMappingURL=forest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"forest.d.ts","sourceRoot":"","sources":["../../src/geoms/forest.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,UAAU,CAAA;AAEpC,MAAM,WAAW,aAAa;IAC5B,4EAA4E;IAC5E,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,qEAAqE;IACrE,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,gEAAgE;IAChE,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,wDAAwD;IACxD,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,+CAA+C;IAC/C,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,mDAAmD;IACnD,cAAc,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,QAAQ,CAAA;IAC9C,qCAAqC;IACrC,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,yDAAyD;IACzD,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,sCAAsC;IACtC,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,sCAAsC;IACtC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAED,wBAAgB,WAAW,CAAC,OAAO,GAAE,aAAkB,GAAG,IAAI,CAkB7D"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Funnel Plot Geometry
|
|
3
|
+
*
|
|
4
|
+
* Creates funnel plots for detecting publication bias in meta-analyses.
|
|
5
|
+
* Plots effect size against precision (1/SE or sample size).
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* // Basic funnel plot
|
|
9
|
+
* gg(data)
|
|
10
|
+
* .aes({ x: 'effect_size', y: 'se' })
|
|
11
|
+
* .geom(geom_funnel())
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* // Funnel plot with contour lines
|
|
15
|
+
* gg(data)
|
|
16
|
+
* .aes({ x: 'effect_size', y: 'se' })
|
|
17
|
+
* .geom(geom_funnel({ show_contours: true }))
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* // Funnel plot with significance regions
|
|
21
|
+
* gg(data)
|
|
22
|
+
* .aes({ x: 'effect_size', y: 'se' })
|
|
23
|
+
* .geom(geom_funnel({ show_significance: true }))
|
|
24
|
+
*/
|
|
25
|
+
import type { Geom } from '../types';
|
|
26
|
+
export interface FunnelOptions {
|
|
27
|
+
/**
|
|
28
|
+
* Show pseudo-confidence interval contours
|
|
29
|
+
* @default true
|
|
30
|
+
*/
|
|
31
|
+
show_contours?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Contour levels (e.g., [0.90, 0.95, 0.99])
|
|
34
|
+
* @default [0.95]
|
|
35
|
+
*/
|
|
36
|
+
contour_levels?: number[];
|
|
37
|
+
/**
|
|
38
|
+
* Show significance regions
|
|
39
|
+
* @default false
|
|
40
|
+
*/
|
|
41
|
+
show_significance?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Summary effect estimate (vertical line)
|
|
44
|
+
* If not provided, uses mean of effect sizes
|
|
45
|
+
* @default undefined
|
|
46
|
+
*/
|
|
47
|
+
summary_effect?: number;
|
|
48
|
+
/**
|
|
49
|
+
* Show vertical line at summary effect
|
|
50
|
+
* @default true
|
|
51
|
+
*/
|
|
52
|
+
show_summary_line?: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Y-axis is SE (true) or precision 1/SE (false)
|
|
55
|
+
* @default true
|
|
56
|
+
*/
|
|
57
|
+
y_is_se?: boolean;
|
|
58
|
+
/**
|
|
59
|
+
* Invert y-axis (SE plots typically have 0 at top)
|
|
60
|
+
* @default true
|
|
61
|
+
*/
|
|
62
|
+
invert_y?: boolean;
|
|
63
|
+
/**
|
|
64
|
+
* Point character
|
|
65
|
+
* @default '●'
|
|
66
|
+
*/
|
|
67
|
+
point_char?: string;
|
|
68
|
+
/**
|
|
69
|
+
* Contour color
|
|
70
|
+
* @default '#888888'
|
|
71
|
+
*/
|
|
72
|
+
contour_color?: string;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Create a funnel plot geometry
|
|
76
|
+
*/
|
|
77
|
+
export declare function geom_funnel(options?: FunnelOptions): Geom;
|
|
78
|
+
//# sourceMappingURL=funnel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"funnel.d.ts","sourceRoot":"","sources":["../../src/geoms/funnel.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAErC,MAAM,WAAW,aAAa;IAC5B;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAE1B;;;OAGG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAE5B;;;;OAIG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAE5B;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,OAAO,GAAE,aAAkB,GAAG,IAAI,CAiB7D"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Heatmap Geometry with Optional Clustering
|
|
3
|
+
*
|
|
4
|
+
* Visualizes matrix data as a colored grid with optional hierarchical clustering
|
|
5
|
+
* dendrograms. Commonly used for gene expression matrices, correlation matrices,
|
|
6
|
+
* and other 2D data.
|
|
7
|
+
*/
|
|
8
|
+
import type { Geom } from '../types';
|
|
9
|
+
export interface HeatmapOptions {
|
|
10
|
+
x_col?: string;
|
|
11
|
+
y_col?: string;
|
|
12
|
+
value_col?: string;
|
|
13
|
+
low_color?: string;
|
|
14
|
+
mid_color?: string;
|
|
15
|
+
high_color?: string;
|
|
16
|
+
na_color?: string;
|
|
17
|
+
midpoint?: number;
|
|
18
|
+
cluster_rows?: boolean;
|
|
19
|
+
cluster_cols?: boolean;
|
|
20
|
+
clustering_method?: 'complete' | 'single' | 'average';
|
|
21
|
+
clustering_distance?: 'euclidean' | 'correlation' | 'manhattan';
|
|
22
|
+
show_row_dendrogram?: boolean;
|
|
23
|
+
show_col_dendrogram?: boolean;
|
|
24
|
+
dendrogram_ratio?: number;
|
|
25
|
+
show_row_labels?: boolean;
|
|
26
|
+
show_col_labels?: boolean;
|
|
27
|
+
show_values?: boolean;
|
|
28
|
+
value_format?: string;
|
|
29
|
+
cell_char?: string;
|
|
30
|
+
border?: boolean;
|
|
31
|
+
scale?: 'none' | 'row' | 'column';
|
|
32
|
+
}
|
|
33
|
+
export declare function geom_heatmap(options?: HeatmapOptions): Geom;
|
|
34
|
+
//# sourceMappingURL=heatmap.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"heatmap.d.ts","sourceRoot":"","sources":["../../src/geoms/heatmap.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,UAAU,CAAA;AAEpC,MAAM,WAAW,cAAc;IAE7B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,SAAS,CAAC,EAAE,MAAM,CAAA;IAGlB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAA;IAGjB,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,iBAAiB,CAAC,EAAE,UAAU,GAAG,QAAQ,GAAG,SAAS,CAAA;IACrD,mBAAmB,CAAC,EAAE,WAAW,GAAG,aAAa,GAAG,WAAW,CAAA;IAG/D,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B,gBAAgB,CAAC,EAAE,MAAM,CAAA;IAGzB,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,YAAY,CAAC,EAAE,MAAM,CAAA;IAGrB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,MAAM,CAAC,EAAE,OAAO,CAAA;IAGhB,KAAK,CAAC,EAAE,MAAM,GAAG,KAAK,GAAG,QAAQ,CAAA;CAClC;AAED,wBAAgB,YAAY,CAAC,OAAO,GAAE,cAAmB,GAAG,IAAI,CA8B/D"}
|
package/dist/geoms/index.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ export { geom_bin2d, type Bin2dOptions } from './bin2d';
|
|
|
20
20
|
export { geom_contour, geom_contour_filled, geom_density_2d, type ContourOptions } from './contour';
|
|
21
21
|
export { geom_errorbar, geom_errorbarh, geom_crossbar, geom_linerange, geom_pointrange, type ErrorbarOptions, } from './errorbar';
|
|
22
22
|
export { geom_rect, geom_abline, type RectOptions, type AblineOptions } from './rect';
|
|
23
|
-
export { geom_qq,
|
|
23
|
+
export { geom_qq, type QQOptions } from './qq';
|
|
24
24
|
export { geom_ridgeline, geom_joy, type RidgelineOptions } from './ridgeline';
|
|
25
25
|
export { geom_beeswarm, geom_quasirandom, type BeeswarmOptions } from './beeswarm';
|
|
26
26
|
export { geom_dumbbell, type DumbbellOptions } from './dumbbell';
|
|
@@ -35,4 +35,18 @@ export { geom_corrmat, type CorrmatOptions } from './corrmat';
|
|
|
35
35
|
export { geom_sankey, type SankeyOptions } from './sankey';
|
|
36
36
|
export { geom_treemap, type TreemapOptions } from './treemap';
|
|
37
37
|
export { geom_volcano, type VolcanoOptions } from './volcano';
|
|
38
|
+
export { geom_ma, type MAOptions } from './ma';
|
|
39
|
+
export { geom_manhattan, type ManhattanOptions } from './manhattan';
|
|
40
|
+
export { geom_heatmap, type HeatmapOptions } from './heatmap';
|
|
41
|
+
export { geom_biplot, type BiplotOptions } from './biplot';
|
|
42
|
+
export { geom_kaplan_meier, type KaplanMeierOptions } from './kaplan-meier';
|
|
43
|
+
export { geom_forest, type ForestOptions } from './forest';
|
|
44
|
+
export { geom_roc, type RocOptions } from './roc';
|
|
45
|
+
export { geom_bland_altman, type BlandAltmanOptions } from './bland-altman';
|
|
46
|
+
export { geom_ecdf, type ECDFOptions } from './ecdf';
|
|
47
|
+
export { geom_funnel, type FunnelOptions } from './funnel';
|
|
48
|
+
export { geom_control, type ControlOptions } from './control';
|
|
49
|
+
export { geom_scree, type ScreeOptions } from './scree';
|
|
50
|
+
export { geom_upset, type UpsetOptions } from './upset';
|
|
51
|
+
export { geom_dendrogram, type DendrogramOptions } from './dendrogram';
|
|
38
52
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +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,MAAM,WAAW,CAAA;AAC7D,OAAO,EAAE,YAAY,EAAE,KAAK,cAAc,EAAE,MAAM,WAAW,CAAA;AAC7D,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,KAAK,cAAc,EAAE,MAAM,WAAW,CAAA;AACzE,OAAO,EAAE,WAAW,EAAE,KAAK,aAAa,EAAE,MAAM,UAAU,CAAA;AAC1D,OAAO,EAAE,SAAS,EAAE,KAAK,WAAW,EAAE,MAAM,QAAQ,CAAA;AACpD,OAAO,EAAE,QAAQ,EA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AQ,EAAE,KAAK,UAAU,EAAE,MAAM,OAAO,CAAA;AACjD,OAAO,EAAE,iBAAiB,EAAE,KAAK,kBAAkB,EAAE,MAAM,gBAAgB,CAAA;AAG3E,OAAO,EAAE,SAAS,EAAE,KAAK,WAAW,EAAE,MAAM,QAAQ,CAAA;AACpD,OAAO,EAAE,WAAW,EAAE,KAAK,aAAa,EAAE,MAAM,UAAU,CAAA;AAC1D,OAAO,EAAE,YAAY,EAAE,KAAK,cAAc,EAAE,MAAM,WAAW,CAAA;AAC7D,OAAO,EAAE,UAAU,EAAE,KAAK,YAAY,EAAE,MAAM,SAAS,CAAA;AAGvD,OAAO,EAAE,UAAU,EAAE,KAAK,YAAY,EAAE,MAAM,SAAS,CAAA;AACvD,OAAO,EAAE,eAAe,EAAE,KAAK,iBAAiB,EAAE,MAAM,cAAc,CAAA"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Kaplan-Meier Survival Curve Geom
|
|
3
|
+
*
|
|
4
|
+
* Creates survival curves for time-to-event analysis.
|
|
5
|
+
* Commonly used in clinical trials and epidemiological studies.
|
|
6
|
+
*
|
|
7
|
+
* Expected data format:
|
|
8
|
+
* - time: Time to event or censoring
|
|
9
|
+
* - status: Event indicator (1 = event, 0 = censored)
|
|
10
|
+
* - group (optional): Stratification variable for multiple curves
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```typescript
|
|
14
|
+
* gg(survivalData)
|
|
15
|
+
* .aes({ x: 'time', y: 'status', color: 'treatment' })
|
|
16
|
+
* .geom(geom_kaplan_meier({ show_ci: true, show_censored: true }))
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
import type { Geom } from '../types';
|
|
20
|
+
export interface KaplanMeierOptions {
|
|
21
|
+
/** Show confidence intervals (default: false) */
|
|
22
|
+
show_ci?: boolean;
|
|
23
|
+
/** Confidence level for CI (default: 0.95) */
|
|
24
|
+
conf_level?: number;
|
|
25
|
+
/** Show censored observations as tick marks (default: true) */
|
|
26
|
+
show_censored?: boolean;
|
|
27
|
+
/** Character for censored marks (default: '+') */
|
|
28
|
+
censor_char?: string;
|
|
29
|
+
/** Show number at risk table (default: false) */
|
|
30
|
+
show_risk_table?: boolean;
|
|
31
|
+
/** Line style for survival curve (default: 'solid') */
|
|
32
|
+
linetype?: 'solid' | 'dashed' | 'dotted';
|
|
33
|
+
/** Show median survival line (default: false) */
|
|
34
|
+
show_median?: boolean;
|
|
35
|
+
/** Step style: 'post' keeps value until next event (default: 'post') */
|
|
36
|
+
step_type?: 'post' | 'pre';
|
|
37
|
+
}
|
|
38
|
+
export declare function geom_kaplan_meier(options?: KaplanMeierOptions): Geom;
|
|
39
|
+
//# sourceMappingURL=kaplan-meier.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kaplan-meier.d.ts","sourceRoot":"","sources":["../../src/geoms/kaplan-meier.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,UAAU,CAAA;AAEpC,MAAM,WAAW,kBAAkB;IACjC,iDAAiD;IACjD,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,8CAA8C;IAC9C,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,+DAA+D;IAC/D,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,kDAAkD;IAClD,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,iDAAiD;IACjD,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,uDAAuD;IACvD,QAAQ,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,QAAQ,CAAA;IACxC,iDAAiD;IACjD,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,wEAAwE;IACxE,SAAS,CAAC,EAAE,MAAM,GAAG,KAAK,CAAA;CAC3B;AAED,wBAAgB,iBAAiB,CAAC,OAAO,GAAE,kBAAuB,GAAG,IAAI,CAgBxE"}
|