canvasxpress 65.3.0 → 65.5.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/package.json +2 -1
- package/src/canvasXpress.d.ts +108 -0
- package/src/canvasXpress.js +4 -4
package/package.json
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "canvasxpress",
|
|
3
3
|
"main": "src/canvasXpress.js",
|
|
4
|
+
"types": "src/canvasXpress.d.ts",
|
|
4
5
|
"style": "src/canvasXpress.css",
|
|
5
6
|
"title": "CanvasXpress",
|
|
6
|
-
"version": "65.
|
|
7
|
+
"version": "65.5.0",
|
|
7
8
|
"license": {
|
|
8
9
|
"type": "Dual licensing",
|
|
9
10
|
"url": "https://www.canvasxpress.org/docs/license.html"
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
// Type definitions for canvasxpress
|
|
2
|
+
// Project: https://www.canvasxpress.org
|
|
3
|
+
// Definitions: https://github.com/neuhausi/canvasXpress-node
|
|
4
|
+
//
|
|
5
|
+
// The published `canvasxpress` package is a CommonJS/UMD bundle whose
|
|
6
|
+
// module.exports is a namespace of { init, cxplot, aes }, where `init` is the
|
|
7
|
+
// CanvasXpress constructor. These declarations are intentionally permissive:
|
|
8
|
+
// they cover the documented data shape, the constructor, and the common
|
|
9
|
+
// instance methods, while leaving the long tail of configuration options and
|
|
10
|
+
// methods open via index signatures rather than enumerating hundreds of keys.
|
|
11
|
+
|
|
12
|
+
export = CanvasXpress;
|
|
13
|
+
|
|
14
|
+
declare namespace CanvasXpress {
|
|
15
|
+
/**
|
|
16
|
+
* The CanvasXpress data object. The primary numeric matrix lives under `y`;
|
|
17
|
+
* `x` holds per-sample (column) annotations and `z` per-variable (row)
|
|
18
|
+
* annotations. Network/genome/tree graph types carry additional top-level
|
|
19
|
+
* keys, so the shape is left open.
|
|
20
|
+
*/
|
|
21
|
+
interface CXData {
|
|
22
|
+
y?: {
|
|
23
|
+
/** Row (variable) identifiers. */
|
|
24
|
+
vars?: Array<string | number>;
|
|
25
|
+
/** Column (sample) identifiers. */
|
|
26
|
+
smps?: Array<string | number>;
|
|
27
|
+
/** Row-major numeric matrix: data[varIndex][smpIndex]. */
|
|
28
|
+
data?: any[][];
|
|
29
|
+
[key: string]: any;
|
|
30
|
+
};
|
|
31
|
+
/** Per-sample (column) annotations, keyed by annotation name. */
|
|
32
|
+
x?: { [annotation: string]: any[] };
|
|
33
|
+
/** Per-variable (row) annotations, keyed by annotation name. */
|
|
34
|
+
z?: { [annotation: string]: any[] };
|
|
35
|
+
[key: string]: any;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* CanvasXpress configuration. `graphType` selects the renderer (e.g.
|
|
40
|
+
* "Scatter2D", "Bar", "Heatmap", "Network", "Bump"); every other option is
|
|
41
|
+
* open.
|
|
42
|
+
*/
|
|
43
|
+
interface CXConfig {
|
|
44
|
+
graphType?: string;
|
|
45
|
+
colorBy?: string;
|
|
46
|
+
sizeBy?: string;
|
|
47
|
+
shapeBy?: string;
|
|
48
|
+
[option: string]: any;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/** Event handlers, keyed by CanvasXpress event name (e.g. "click"). */
|
|
52
|
+
interface CXEvents {
|
|
53
|
+
[event: string]: (o?: any, e?: any, t?: any) => void;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/** A live CanvasXpress chart instance. */
|
|
57
|
+
interface CanvasXpressInstance {
|
|
58
|
+
/** DOM id of the host canvas. */
|
|
59
|
+
target: string;
|
|
60
|
+
/** The instance's data object. */
|
|
61
|
+
data: CXData;
|
|
62
|
+
/** Merge `data` into the chart and redraw. */
|
|
63
|
+
updateData(data: CXData, redraw?: boolean, soft?: boolean, config?: CXConfig): void;
|
|
64
|
+
/** Apply configuration. Pass `noDraw = true` to defer the redraw. */
|
|
65
|
+
updateConfig(config: CXConfig, noDraw?: boolean): void;
|
|
66
|
+
/** Reset configuration to defaults, optionally preserving the named keys. */
|
|
67
|
+
resetConfig(keep?: string[]): void;
|
|
68
|
+
/** Resize the chart. Pass `noDraw = true` to defer the redraw. */
|
|
69
|
+
setDimensions(width: number, height: number, noDraw?: boolean): void;
|
|
70
|
+
/** Tear down the chart and restore the host canvas to the DOM. */
|
|
71
|
+
destroy(target?: string | { target: string }, soft?: boolean): void;
|
|
72
|
+
/** Force a (re)draw. */
|
|
73
|
+
draw(options?: any): void;
|
|
74
|
+
[member: string]: any;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/** The CanvasXpress constructor (the module's `init` export). */
|
|
78
|
+
interface CanvasXpressConstructor {
|
|
79
|
+
new (
|
|
80
|
+
target: string | object,
|
|
81
|
+
data?: CXData,
|
|
82
|
+
config?: CXConfig,
|
|
83
|
+
events?: CXEvents,
|
|
84
|
+
info?: string,
|
|
85
|
+
afterRender?: any[],
|
|
86
|
+
callback?: (instance: CanvasXpressInstance) => void,
|
|
87
|
+
noValidate?: boolean,
|
|
88
|
+
synchronous?: boolean
|
|
89
|
+
): CanvasXpressInstance;
|
|
90
|
+
/** All live instances on the page. */
|
|
91
|
+
instances: CanvasXpressInstance[];
|
|
92
|
+
[member: string]: any;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/** The CanvasXpress constructor. */
|
|
96
|
+
const init: CanvasXpressConstructor;
|
|
97
|
+
|
|
98
|
+
/** ggplot-style plotting entry point. */
|
|
99
|
+
function cxplot(
|
|
100
|
+
target: string | object,
|
|
101
|
+
data?: CXData,
|
|
102
|
+
config?: CXConfig,
|
|
103
|
+
events?: CXEvents
|
|
104
|
+
): CanvasXpressInstance;
|
|
105
|
+
|
|
106
|
+
/** Aesthetic-mapping helper used by the cxplot grammar. */
|
|
107
|
+
function aes(...mappings: any[]): any;
|
|
108
|
+
}
|