@uwdata/mosaic-core 0.16.2 → 0.18.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/LICENSE +1 -1
- package/README.md +0 -1
- package/dist/src/Coordinator.d.ts +147 -0
- package/dist/src/Coordinator.d.ts.map +1 -0
- package/dist/src/Coordinator.js +269 -0
- package/dist/src/Coordinator.js.map +1 -0
- package/dist/{types → src}/MosaicClient.d.ts +37 -42
- package/dist/src/MosaicClient.d.ts.map +1 -0
- package/dist/src/MosaicClient.js +213 -0
- package/dist/src/MosaicClient.js.map +1 -0
- package/dist/src/Param.d.ts +56 -0
- package/dist/src/Param.d.ts.map +1 -0
- package/dist/src/Param.js +89 -0
- package/dist/src/Param.js.map +1 -0
- package/dist/src/QueryConsolidator.d.ts +11 -0
- package/dist/src/QueryConsolidator.d.ts.map +1 -0
- package/dist/src/QueryConsolidator.js +249 -0
- package/dist/src/QueryConsolidator.js.map +1 -0
- package/dist/src/QueryManager.d.ts +77 -0
- package/dist/src/QueryManager.d.ts.map +1 -0
- package/dist/src/QueryManager.js +174 -0
- package/dist/src/QueryManager.js.map +1 -0
- package/dist/src/Selection.d.ts +222 -0
- package/dist/src/Selection.d.ts.map +1 -0
- package/dist/src/Selection.js +319 -0
- package/dist/src/Selection.js.map +1 -0
- package/dist/src/SelectionClause.d.ts +192 -0
- package/dist/src/SelectionClause.d.ts.map +1 -0
- package/dist/src/SelectionClause.js +126 -0
- package/dist/src/SelectionClause.js.map +1 -0
- package/dist/{types → src}/connectors/Connector.d.ts +6 -5
- package/dist/src/connectors/Connector.d.ts.map +1 -0
- package/dist/src/connectors/Connector.js +2 -0
- package/dist/src/connectors/Connector.js.map +1 -0
- package/dist/src/connectors/rest.d.ts +24 -0
- package/dist/src/connectors/rest.d.ts.map +1 -0
- package/dist/src/connectors/rest.js +37 -0
- package/dist/src/connectors/rest.js.map +1 -0
- package/dist/src/connectors/socket.d.ts +40 -0
- package/dist/src/connectors/socket.d.ts.map +1 -0
- package/dist/src/connectors/socket.js +115 -0
- package/dist/src/connectors/socket.js.map +1 -0
- package/dist/src/connectors/wasm.d.ts +53 -0
- package/dist/src/connectors/wasm.d.ts.map +1 -0
- package/dist/src/connectors/wasm.js +113 -0
- package/dist/src/connectors/wasm.js.map +1 -0
- package/dist/src/index.d.ts +28 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +25 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/make-client.d.ts +35 -0
- package/dist/src/make-client.d.ts.map +1 -0
- package/dist/src/make-client.js +52 -0
- package/dist/src/make-client.js.map +1 -0
- package/dist/{types → src}/preagg/PreAggregator.d.ts +64 -94
- package/dist/src/preagg/PreAggregator.d.ts.map +1 -0
- package/dist/src/preagg/PreAggregator.js +382 -0
- package/dist/src/preagg/PreAggregator.js.map +1 -0
- package/dist/{types → src}/preagg/preagg-columns.d.ts +10 -8
- package/dist/src/preagg/preagg-columns.d.ts.map +1 -0
- package/dist/src/preagg/preagg-columns.js +95 -0
- package/dist/src/preagg/preagg-columns.js.map +1 -0
- package/dist/src/preagg/sufficient-statistics.d.ts +14 -0
- package/dist/src/preagg/sufficient-statistics.d.ts.map +1 -0
- package/dist/src/preagg/sufficient-statistics.js +446 -0
- package/dist/src/preagg/sufficient-statistics.js.map +1 -0
- package/dist/{types → src}/types.d.ts +23 -9
- package/dist/src/types.d.ts.map +1 -0
- package/dist/src/types.js +2 -0
- package/dist/src/types.js.map +1 -0
- package/dist/{types → src}/util/AsyncDispatch.d.ts +53 -32
- package/dist/src/util/AsyncDispatch.d.ts.map +1 -0
- package/dist/src/util/AsyncDispatch.js +188 -0
- package/dist/src/util/AsyncDispatch.js.map +1 -0
- package/dist/src/util/cache.d.ts +19 -0
- package/dist/src/util/cache.d.ts.map +1 -0
- package/dist/src/util/cache.js +66 -0
- package/dist/src/util/cache.js.map +1 -0
- package/dist/src/util/decode-ipc.d.ts +12 -0
- package/dist/src/util/decode-ipc.d.ts.map +1 -0
- package/{src → dist/src}/util/decode-ipc.js +5 -6
- package/dist/src/util/decode-ipc.js.map +1 -0
- package/dist/src/util/distinct.d.ts +3 -0
- package/dist/src/util/distinct.d.ts.map +1 -0
- package/dist/src/util/distinct.js +16 -0
- package/dist/src/util/distinct.js.map +1 -0
- package/dist/src/util/field-info.d.ts +26 -0
- package/dist/src/util/field-info.d.ts.map +1 -0
- package/dist/src/util/field-info.js +91 -0
- package/dist/src/util/field-info.js.map +1 -0
- package/dist/src/util/hash.d.ts +2 -0
- package/dist/src/util/hash.d.ts.map +1 -0
- package/dist/src/util/hash.js +26 -0
- package/dist/src/util/hash.js.map +1 -0
- package/dist/src/util/is-activatable.d.ts +8 -0
- package/dist/src/util/is-activatable.d.ts.map +1 -0
- package/dist/src/util/is-activatable.js +10 -0
- package/dist/src/util/is-activatable.js.map +1 -0
- package/dist/src/util/is-arrow-table.d.ts +9 -0
- package/dist/src/util/is-arrow-table.d.ts.map +1 -0
- package/dist/src/util/is-arrow-table.js +11 -0
- package/dist/src/util/is-arrow-table.js.map +1 -0
- package/dist/src/util/js-type.d.ts +9 -0
- package/dist/src/util/js-type.d.ts.map +1 -0
- package/dist/src/util/js-type.js +59 -0
- package/dist/src/util/js-type.js.map +1 -0
- package/dist/{types → src}/util/priority-queue.d.ts +12 -14
- package/dist/src/util/priority-queue.d.ts.map +1 -0
- package/dist/src/util/priority-queue.js +81 -0
- package/dist/src/util/priority-queue.js.map +1 -0
- package/dist/src/util/query-result.d.ts +47 -0
- package/dist/src/util/query-result.d.ts.map +1 -0
- package/dist/src/util/query-result.js +83 -0
- package/dist/src/util/query-result.js.map +1 -0
- package/dist/src/util/synchronizer.d.ts +36 -0
- package/dist/src/util/synchronizer.d.ts.map +1 -0
- package/dist/src/util/synchronizer.js +52 -0
- package/dist/src/util/synchronizer.js.map +1 -0
- package/dist/src/util/throttle.d.ts +12 -0
- package/dist/src/util/throttle.d.ts.map +1 -0
- package/dist/src/util/throttle.js +51 -0
- package/dist/src/util/throttle.js.map +1 -0
- package/dist/src/util/to-data-columns.d.ts +22 -0
- package/dist/src/util/to-data-columns.d.ts.map +1 -0
- package/dist/src/util/to-data-columns.js +51 -0
- package/dist/src/util/to-data-columns.js.map +1 -0
- package/dist/src/util/void-logger.d.ts +13 -0
- package/dist/src/util/void-logger.d.ts.map +1 -0
- package/dist/src/util/void-logger.js +13 -0
- package/dist/src/util/void-logger.js.map +1 -0
- package/package.json +15 -13
- package/src/Coordinator.ts +367 -0
- package/src/{MosaicClient.js → MosaicClient.ts} +49 -43
- package/src/{Param.js → Param.ts} +29 -28
- package/src/{QueryConsolidator.js → QueryConsolidator.ts} +81 -58
- package/src/{QueryManager.js → QueryManager.ts} +61 -54
- package/src/Selection.ts +388 -0
- package/src/SelectionClause.ts +275 -0
- package/src/connectors/Connector.ts +6 -6
- package/src/connectors/rest.ts +56 -0
- package/src/connectors/{socket.js → socket.ts} +53 -42
- package/src/connectors/{wasm.js → wasm.ts} +46 -62
- package/src/{index.js → index.ts} +13 -1
- package/src/make-client.ts +93 -0
- package/src/preagg/{PreAggregator.js → PreAggregator.ts} +164 -145
- package/src/preagg/{preagg-columns.js → preagg-columns.ts} +27 -24
- package/src/preagg/{sufficient-statistics.js → sufficient-statistics.ts} +161 -110
- package/src/types.ts +24 -9
- package/src/util/{AsyncDispatch.js → AsyncDispatch.ts} +62 -43
- package/src/util/{cache.js → cache.ts} +25 -15
- package/src/util/decode-ipc.ts +15 -0
- package/src/util/{distinct.js → distinct.ts} +3 -3
- package/src/util/{field-info.js → field-info.ts} +31 -32
- package/src/util/{hash.js → hash.ts} +4 -4
- package/src/util/is-activatable.ts +11 -0
- package/src/util/is-arrow-table.ts +12 -0
- package/src/util/{js-type.js → js-type.ts} +7 -5
- package/src/util/{priority-queue.js → priority-queue.ts} +32 -20
- package/src/util/{query-result.js → query-result.ts} +24 -17
- package/src/util/synchronizer.ts +56 -0
- package/src/util/throttle.ts +59 -0
- package/src/util/to-data-columns.ts +65 -0
- package/src/util/void-logger.ts +23 -0
- package/dist/types/Coordinator.d.ts +0 -164
- package/dist/types/Param.d.ts +0 -47
- package/dist/types/QueryConsolidator.d.ts +0 -9
- package/dist/types/QueryManager.d.ts +0 -91
- package/dist/types/Selection.d.ts +0 -235
- package/dist/types/SelectionClause.d.ts +0 -105
- package/dist/types/connectors/rest.d.ts +0 -13
- package/dist/types/connectors/socket.d.ts +0 -100
- package/dist/types/connectors/wasm.d.ts +0 -135
- package/dist/types/index-types.d.ts +0 -4
- package/dist/types/index.d.ts +0 -19
- package/dist/types/make-client.d.ts +0 -78
- package/dist/types/preagg/sufficient-statistics.d.ts +0 -13
- package/dist/types/util/cache.d.ts +0 -17
- package/dist/types/util/decode-ipc.d.ts +0 -12
- package/dist/types/util/distinct.d.ts +0 -2
- package/dist/types/util/field-info.d.ts +0 -23
- package/dist/types/util/hash.d.ts +0 -1
- package/dist/types/util/is-activatable.d.ts +0 -6
- package/dist/types/util/is-arrow-table.d.ts +0 -8
- package/dist/types/util/js-type.d.ts +0 -7
- package/dist/types/util/query-result.d.ts +0 -44
- package/dist/types/util/selection-types.d.ts +0 -114
- package/dist/types/util/synchronizer.d.ts +0 -29
- package/dist/types/util/throttle.d.ts +0 -13
- package/dist/types/util/to-data-columns.d.ts +0 -29
- package/dist/types/util/void-logger.d.ts +0 -10
- package/jsconfig.json +0 -11
- package/src/Coordinator.js +0 -337
- package/src/Selection.js +0 -380
- package/src/SelectionClause.js +0 -159
- package/src/connectors/rest.js +0 -38
- package/src/index-types.ts +0 -4
- package/src/make-client.js +0 -101
- package/src/util/is-activatable.js +0 -8
- package/src/util/is-arrow-table.js +0 -10
- package/src/util/selection-types.ts +0 -137
- package/src/util/synchronizer.js +0 -47
- package/src/util/throttle.js +0 -54
- package/src/util/to-data-columns.js +0 -60
- package/src/util/void-logger.js +0 -13
- package/tsconfig.json +0 -11
- package/vitest.config.ts +0 -3
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @typedef {Object} MakeClientOptions
|
|
3
|
-
* @property {Coordinator} [coordinator] Mosaic coordinator.
|
|
4
|
-
* Defaults to the global coordinator.
|
|
5
|
-
* @property {Selection|null} [selection] A selection whose predicates are
|
|
6
|
-
* fed into the query function to produce the SQL query.
|
|
7
|
-
* @property {boolean} [enabled] A flag (default `true`) indicating if the
|
|
8
|
-
* client should initially be enabled or not.
|
|
9
|
-
* @property {boolean} [filterStable] A flag (default `true`) indicating if the
|
|
10
|
-
* if client queries can be sped up using pre-aggregated data. Should be set
|
|
11
|
-
* to `false` if filtering changes the groupby domain of the query.
|
|
12
|
-
* @property {function(): Promise<void>} [prepare]
|
|
13
|
-
* An async function to prepare the client before running queries.
|
|
14
|
-
* @property {function(any): any} [query]
|
|
15
|
-
* A function that returns a query from a list of selection predicates.
|
|
16
|
-
* @property {function(any): void} [queryResult]
|
|
17
|
-
* Called by the coordinator to return a query result.
|
|
18
|
-
* @property {function(): void} [queryPending]
|
|
19
|
-
* Called by the coordinator to report a query execution error.
|
|
20
|
-
* @property {function(any): void} [queryError]
|
|
21
|
-
* Called by the coordinator to inform the client that a query is pending.
|
|
22
|
-
*/
|
|
23
|
-
/**
|
|
24
|
-
* Make a new client with the given options, and connect the client to the
|
|
25
|
-
* provided coordinator.
|
|
26
|
-
* @param {MakeClientOptions} options The options for making the client.
|
|
27
|
-
* @returns {MosaicClient & { destroy: () => void }} The resulting client,
|
|
28
|
-
* along with a method to destroy the client when no longer needed.
|
|
29
|
-
*/
|
|
30
|
-
export function makeClient(options: MakeClientOptions): MosaicClient & {
|
|
31
|
-
destroy: () => void;
|
|
32
|
-
};
|
|
33
|
-
export type MakeClientOptions = {
|
|
34
|
-
/**
|
|
35
|
-
* Mosaic coordinator.
|
|
36
|
-
* Defaults to the global coordinator.
|
|
37
|
-
*/
|
|
38
|
-
coordinator?: Coordinator;
|
|
39
|
-
/**
|
|
40
|
-
* A selection whose predicates are
|
|
41
|
-
* fed into the query function to produce the SQL query.
|
|
42
|
-
*/
|
|
43
|
-
selection?: Selection | null;
|
|
44
|
-
/**
|
|
45
|
-
* A flag (default `true`) indicating if the
|
|
46
|
-
* client should initially be enabled or not.
|
|
47
|
-
*/
|
|
48
|
-
enabled?: boolean;
|
|
49
|
-
/**
|
|
50
|
-
* A flag (default `true`) indicating if the
|
|
51
|
-
* if client queries can be sped up using pre-aggregated data. Should be set
|
|
52
|
-
* to `false` if filtering changes the groupby domain of the query.
|
|
53
|
-
*/
|
|
54
|
-
filterStable?: boolean;
|
|
55
|
-
/**
|
|
56
|
-
* An async function to prepare the client before running queries.
|
|
57
|
-
*/
|
|
58
|
-
prepare?: () => Promise<void>;
|
|
59
|
-
/**
|
|
60
|
-
* A function that returns a query from a list of selection predicates.
|
|
61
|
-
*/
|
|
62
|
-
query?: (arg0: any) => any;
|
|
63
|
-
/**
|
|
64
|
-
* Called by the coordinator to return a query result.
|
|
65
|
-
*/
|
|
66
|
-
queryResult?: (arg0: any) => void;
|
|
67
|
-
/**
|
|
68
|
-
* Called by the coordinator to report a query execution error.
|
|
69
|
-
*/
|
|
70
|
-
queryPending?: () => void;
|
|
71
|
-
/**
|
|
72
|
-
* Called by the coordinator to inform the client that a query is pending.
|
|
73
|
-
*/
|
|
74
|
-
queryError?: (arg0: any) => void;
|
|
75
|
-
};
|
|
76
|
-
import { MosaicClient } from './MosaicClient.js';
|
|
77
|
-
import type { Coordinator } from './Coordinator.js';
|
|
78
|
-
import type { Selection } from './Selection.js';
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Determine sufficient statistics to preaggregate the given node. This
|
|
3
|
-
* method populates the *preagg* and *aggrs* arguments with necessary
|
|
4
|
-
* information for preaggregation optimization.
|
|
5
|
-
* @param {AggregateNode} node An aggregate function.
|
|
6
|
-
* @param {Record<string, ExprNode>} preagg Map of column names to
|
|
7
|
-
* expressions to include in the preaggregation table.
|
|
8
|
-
* @returns {ExprNode} Output aggregate expression that uses preaggregated
|
|
9
|
-
* sufficient statistics to service updates.
|
|
10
|
-
*/
|
|
11
|
-
export function sufficientStatistics(node: AggregateNode, preagg: Record<string, ExprNode>, avg: any): ExprNode;
|
|
12
|
-
import type { AggregateNode } from '@uwdata/mosaic-sql';
|
|
13
|
-
import type { ExprNode } from '@uwdata/mosaic-sql';
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Create a new cache that ignores all values.
|
|
3
|
-
* @returns {Cache}
|
|
4
|
-
*/
|
|
5
|
-
export function voidCache(): Cache;
|
|
6
|
-
/**
|
|
7
|
-
* Create a new cache that uses an LRU eviction policy.
|
|
8
|
-
* @param {object} [options] Cache options.
|
|
9
|
-
* @param {number} [options.max] Maximum number of cache entries.
|
|
10
|
-
* @param {number} [options.ttl] Time-to-live for cache entries.
|
|
11
|
-
* @returns {Cache}
|
|
12
|
-
*/
|
|
13
|
-
export function lruCache({ max, ttl }?: {
|
|
14
|
-
max?: number;
|
|
15
|
-
ttl?: number;
|
|
16
|
-
}): Cache;
|
|
17
|
-
import type { Cache } from '../types.js';
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Decode Arrow IPC bytes to a table instance.
|
|
3
|
-
* The default options map date and timestamp values to JS Date objects.
|
|
4
|
-
* @param {ArrayBuffer | Uint8Array} data Arrow IPC bytes.
|
|
5
|
-
* @param {ExtractionOptions} [options] Arrow IPC extraction options.
|
|
6
|
-
* If unspecified, the default options will extract date and timestamp
|
|
7
|
-
* values to JS Date objects.
|
|
8
|
-
* @returns {Table} A table instance.
|
|
9
|
-
*/
|
|
10
|
-
export function decodeIPC(data: ArrayBuffer | Uint8Array, options?: ExtractionOptions): Table;
|
|
11
|
-
import type { ExtractionOptions } from '@uwdata/flechette';
|
|
12
|
-
import type { Table } from '@uwdata/flechette';
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Queries information about fields of a table.
|
|
3
|
-
* If the `fields` array contains a single field with the column set to '*',
|
|
4
|
-
* the function will retrieve and return the table information using `getTableInfo`.
|
|
5
|
-
* Otherwise, it will query individual field information using `getFieldInfo`
|
|
6
|
-
* for each field in the `fields` array.
|
|
7
|
-
* @param {import('../Coordinator.js').Coordinator} mc A Mosaic coordinator.
|
|
8
|
-
* @param {import('../types.js').FieldInfoRequest[]} fields
|
|
9
|
-
* @returns {Promise<import('../types.js').FieldInfo[]>}
|
|
10
|
-
*/
|
|
11
|
-
export function queryFieldInfo(mc: import("../Coordinator.js").Coordinator, fields: import("../types.js").FieldInfoRequest[]): Promise<import("../types.js").FieldInfo[]>;
|
|
12
|
-
export const Count: "count";
|
|
13
|
-
export const Nulls: "nulls";
|
|
14
|
-
export const Max: "max";
|
|
15
|
-
export const Min: "min";
|
|
16
|
-
export const Distinct: "distinct";
|
|
17
|
-
export namespace Stats {
|
|
18
|
-
export { Count };
|
|
19
|
-
export { Nulls };
|
|
20
|
-
export { Max };
|
|
21
|
-
export { Min };
|
|
22
|
-
export { Distinct };
|
|
23
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export function fnv_hash(v: any): number;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Test if a value is a Flechette Arrow table.
|
|
3
|
-
* We use a "duck typing" approach and check for a getChild function.
|
|
4
|
-
* @param {*} values The value to test
|
|
5
|
-
* @returns {values is import('@uwdata/flechette').Table}
|
|
6
|
-
* true if the value duck types as Arrow data
|
|
7
|
-
*/
|
|
8
|
-
export function isArrowTable(values: any): values is import("@uwdata/flechette").Table;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Maps a SQL data type to its corresponding JavaScript type.
|
|
3
|
-
* @param {string} type The name of a SQL data type
|
|
4
|
-
* @returns {import('../types.js').JSType} The corresponding JavaScript type name
|
|
5
|
-
* @throws {Error} Throws an error if the given SQL type name is unsupported or unrecognized.
|
|
6
|
-
*/
|
|
7
|
-
export function jsType(type: string): import("../types.js").JSType;
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
export const QueryState: Readonly<{
|
|
2
|
-
pending: symbol;
|
|
3
|
-
ready: symbol;
|
|
4
|
-
error: symbol;
|
|
5
|
-
done: symbol;
|
|
6
|
-
}>;
|
|
7
|
-
/**
|
|
8
|
-
* A query result Promise that can allows external callers
|
|
9
|
-
* to resolve or reject the Promise.
|
|
10
|
-
*/
|
|
11
|
-
export class QueryResult extends Promise<any> {
|
|
12
|
-
/**
|
|
13
|
-
* Create a new query result Promise.
|
|
14
|
-
*/
|
|
15
|
-
constructor();
|
|
16
|
-
_resolve: any;
|
|
17
|
-
_reject: any;
|
|
18
|
-
_state: symbol;
|
|
19
|
-
_value: any;
|
|
20
|
-
/**
|
|
21
|
-
* Resolve the result Promise with a prepared value or the provided value.
|
|
22
|
-
* This method will only succeed if either a value is provided or the promise is ready.
|
|
23
|
-
* @param {*} value The result value.
|
|
24
|
-
* @returns {this}
|
|
25
|
-
*/
|
|
26
|
-
fulfill(value: any): this;
|
|
27
|
-
/**
|
|
28
|
-
* Prepare to resolve with the provided value.
|
|
29
|
-
* @param {*} value The result value.
|
|
30
|
-
* @returns {this}
|
|
31
|
-
*/
|
|
32
|
-
ready(value: any): this;
|
|
33
|
-
/**
|
|
34
|
-
* Rejects the result Promise with the provided error.
|
|
35
|
-
* @param {*} error The error value.
|
|
36
|
-
* @returns {this}
|
|
37
|
-
*/
|
|
38
|
-
reject(error: any): this;
|
|
39
|
-
/**
|
|
40
|
-
* Returns the state of this query result.
|
|
41
|
-
* @returns {symbol}
|
|
42
|
-
*/
|
|
43
|
-
get state(): symbol;
|
|
44
|
-
}
|
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
import { ExprNode } from '@uwdata/mosaic-sql';
|
|
2
|
-
import { MosaicClient } from '../MosaicClient.js';
|
|
3
|
-
/**
|
|
4
|
-
* Selection clause metadata to guide possible query optimizations.
|
|
5
|
-
* Sub-interfaces provide more information about the specifics of a
|
|
6
|
-
* given selection based on the selection type.
|
|
7
|
-
*/
|
|
8
|
-
export interface ClauseMetadata {
|
|
9
|
-
/**
|
|
10
|
-
* The selection type, such as `'point'`, `'interval'`, or `'match'`.
|
|
11
|
-
*/
|
|
12
|
-
type: string;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Selection clause metadata indicating selection of one or more discrete
|
|
16
|
-
* point values, typically based on equality or is distinctiveness checks.
|
|
17
|
-
*/
|
|
18
|
-
export interface PointMetadata extends ClauseMetadata {
|
|
19
|
-
type: 'point';
|
|
20
|
-
}
|
|
21
|
-
/** Text search matching methods. */
|
|
22
|
-
export type MatchMethod = 'contains' | 'prefix' | 'suffix' | 'regexp' | (string & {});
|
|
23
|
-
/**
|
|
24
|
-
* Selection clause metadata indicating text search matching.
|
|
25
|
-
*/
|
|
26
|
-
export interface MatchMetadata extends ClauseMetadata {
|
|
27
|
-
type: MatchMethod;
|
|
28
|
-
/** The text search matching method used. */
|
|
29
|
-
method?: 'contains' | 'prefix' | 'suffix' | 'regexp' | (string & {});
|
|
30
|
-
}
|
|
31
|
-
/** Quantitative scale types. */
|
|
32
|
-
export type ScaleType = 'identity' | 'linear' | 'log' | 'sqrt' | 'pow' | 'symlog' | 'time' | 'utc';
|
|
33
|
-
/** A data value interval extent. */
|
|
34
|
-
export type Extent = [number, number] | [Date, Date];
|
|
35
|
-
/**
|
|
36
|
-
* Descriptor for a scale that maps a data domain to screen pixels.
|
|
37
|
-
*/
|
|
38
|
-
export interface Scale {
|
|
39
|
-
/** The scale type, such as `'linear'`, `'log'`, etc. */
|
|
40
|
-
type: ScaleType;
|
|
41
|
-
/** The scale domain, as an array of start and end data values. */
|
|
42
|
-
domain: Extent;
|
|
43
|
-
/**
|
|
44
|
-
* The scale range, as an array of start and end screen pixels.
|
|
45
|
-
* The range may be omitted for *identity* scales.
|
|
46
|
-
*/
|
|
47
|
-
range?: [number, number];
|
|
48
|
-
/** The base of the logarithm. For `'log'` scales only. */
|
|
49
|
-
base?: number;
|
|
50
|
-
/** The constant parameter. For `'symlog'` scales only. */
|
|
51
|
-
constant?: number;
|
|
52
|
-
/** The exponent parameter. For `'pow'` scales only. */
|
|
53
|
-
exponent?: number;
|
|
54
|
-
}
|
|
55
|
-
/** A binning method name. */
|
|
56
|
-
export type BinMethod = 'floor' | 'ceil' | 'round';
|
|
57
|
-
/**
|
|
58
|
-
* Selection clause metadata for one or more selected intervals. This
|
|
59
|
-
* metadata can be used to determine appropriate data-space binning
|
|
60
|
-
* schemes that correspond to pixel-level bins in screen space.
|
|
61
|
-
*/
|
|
62
|
-
export interface IntervalMetadata extends ClauseMetadata {
|
|
63
|
-
type: 'interval';
|
|
64
|
-
/**
|
|
65
|
-
* The interactive pixel size used by the generating component.
|
|
66
|
-
* Values larger than one indicate intervals that "snap-to" values
|
|
67
|
-
* greater than a single pixel. If unspecified, assumed to be `1`.
|
|
68
|
-
*/
|
|
69
|
-
pixelSize?: number;
|
|
70
|
-
/**
|
|
71
|
-
* An array of one or more scale descriptors that describe the
|
|
72
|
-
* mapping from data values to screen pixels.
|
|
73
|
-
*/
|
|
74
|
-
scales?: Scale[];
|
|
75
|
-
/**
|
|
76
|
-
* A hint for the binning method to use when discretizing the
|
|
77
|
-
* interval domain. If unspecified, the default is `'floor'`.
|
|
78
|
-
*/
|
|
79
|
-
bin?: BinMethod;
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* A selection clause representing filtering criteria
|
|
83
|
-
* to apply within a Mosiac Selection.
|
|
84
|
-
*/
|
|
85
|
-
export interface SelectionClause {
|
|
86
|
-
/**
|
|
87
|
-
* A unique identifier (according to object equality) for the source
|
|
88
|
-
* component that generated this clause. In many cases, this is a
|
|
89
|
-
* reference to the originating component itself.
|
|
90
|
-
*/
|
|
91
|
-
source: any;
|
|
92
|
-
/**
|
|
93
|
-
* A set of Mosaic clients associated with this clause that should not
|
|
94
|
-
* be updated when this clause is applied in a cross-filtering context.
|
|
95
|
-
*/
|
|
96
|
-
clients?: Set<MosaicClient>;
|
|
97
|
-
/**
|
|
98
|
-
* A selected value associated with this clause. For example, for a 1D
|
|
99
|
-
* interval selection clause the value may be a [lo, hi] array.
|
|
100
|
-
*/
|
|
101
|
-
value: any;
|
|
102
|
-
/**
|
|
103
|
-
* A predicate SQL expression suitable for use in a query WHERE clause.
|
|
104
|
-
* The predicate should apply filtering criteria consistent with this
|
|
105
|
-
* clause's *value* property.
|
|
106
|
-
*/
|
|
107
|
-
predicate: ExprNode | null;
|
|
108
|
-
/**
|
|
109
|
-
* Optional clause metadata that varies based on the selection type.
|
|
110
|
-
* The metadata can be used to optimize selection queries, for example
|
|
111
|
-
* by creating materialized views of pre-aggregated data when applicable.
|
|
112
|
-
*/
|
|
113
|
-
meta?: ClauseMetadata;
|
|
114
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Create a new synchronizer instance to aid synchronization
|
|
3
|
-
* of updates on multiple pending operations.
|
|
4
|
-
*/
|
|
5
|
-
export function synchronizer(): {
|
|
6
|
-
/**
|
|
7
|
-
* Mark an item as pending.
|
|
8
|
-
* @param {*} item An item to synchronize on.
|
|
9
|
-
*/
|
|
10
|
-
pending(item: any): void;
|
|
11
|
-
/**
|
|
12
|
-
* Mark a pending item as ready, indicating it is
|
|
13
|
-
* ready for a synchronized update.
|
|
14
|
-
* @param {*} item An item to synchronize on.
|
|
15
|
-
* @returns {boolean} True if the synchronizer is ready to
|
|
16
|
-
* resolve, false otherwise.
|
|
17
|
-
*/
|
|
18
|
-
ready(item: any): boolean;
|
|
19
|
-
/**
|
|
20
|
-
* Resolve the current synchronization cycle, causing the synchronize
|
|
21
|
-
* promise to resolve and thereby trigger downstream updates.
|
|
22
|
-
*/
|
|
23
|
-
resolve(): void;
|
|
24
|
-
/**
|
|
25
|
-
* The promise for the current synchronization cycle.
|
|
26
|
-
* @return {Promise} The synchronization promise.
|
|
27
|
-
*/
|
|
28
|
-
readonly promise: Promise<any>;
|
|
29
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Throttle invocations of a callback function. The callback must return
|
|
3
|
-
* a Promise. Upon repeated invocation, the callback will not be invoked
|
|
4
|
-
* until a prior Promise resolves. If multiple invocations occurs while
|
|
5
|
-
* waiting, only the most recent invocation will be pending.
|
|
6
|
-
* @template E, T
|
|
7
|
-
* @param {(event: E) => Promise<T>} callback The callback function.
|
|
8
|
-
* @param {boolean} [debounce=true] Flag indicating if invocations
|
|
9
|
-
* should also be debounced within the current animation frame.
|
|
10
|
-
* @returns {(event: E) => void} A new function that throttles
|
|
11
|
-
* access to the callback.
|
|
12
|
-
*/
|
|
13
|
-
export function throttle<E, T>(callback: (event: E) => Promise<T>, debounce?: boolean): (event: E) => void;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @typedef {Array | Int8Array | Uint8Array | Uint8ClampedArray
|
|
3
|
-
* | Int16Array | Uint16Array | Int32Array | Uint32Array
|
|
4
|
-
* | Float32Array | Float64Array
|
|
5
|
-
* } Arrayish - an Array or TypedArray
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* @typedef {
|
|
9
|
-
* | { numRows: number, columns: Record<string,Arrayish> }
|
|
10
|
-
* | { numRows: number, values: Arrayish; }
|
|
11
|
-
* } DataColumns
|
|
12
|
-
*/
|
|
13
|
-
/**
|
|
14
|
-
* Convert input data to a set of column arrays.
|
|
15
|
-
* @param {any} data The input data.
|
|
16
|
-
* @returns {DataColumns} An object with named column arrays.
|
|
17
|
-
*/
|
|
18
|
-
export function toDataColumns(data: any): DataColumns;
|
|
19
|
-
/**
|
|
20
|
-
* - an Array or TypedArray
|
|
21
|
-
*/
|
|
22
|
-
export type Arrayish = any[] | Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array;
|
|
23
|
-
export type DataColumns = any | {
|
|
24
|
-
numRows: number;
|
|
25
|
-
columns: Record<string, Arrayish>;
|
|
26
|
-
} | {
|
|
27
|
-
numRows: number;
|
|
28
|
-
values: Arrayish;
|
|
29
|
-
};
|