@deephaven-enterprise/jsapi-coreplus-types 1.20240517.510 → 1.20240517.518

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.
@@ -4,134 +4,71 @@ declare module '@deephaven/jsapi-types' {
4
4
  export namespace dh.coreplus.pivot {
5
5
 
6
6
  /**
7
- * Tool to request the server pivot a table and return the results.
7
+ * This type is an analog of {@link dh.Sort}, with a few differences:
8
+ * <ul>
9
+ * <li>The {@link column} property always returns null, and instead there is a {@link name} property</li>
10
+ * <li>Reverse is not supported</li>
11
+ * </ul>
12
+ *
13
+ * A PivotSort doesn't sort the columns of the pivot directly, but sorts the keys uses for columns or rows.
8
14
  */
9
- export class PivotService implements dh.HasEventHandling {
10
- protected constructor();
11
-
12
- /**
13
- * Given a server object, finds or creates a pivot service talking to that same server. If the instance is a
14
- * PivotService, it will be wrapped and returned. The initial call for a given worker must be either a PivotTable or
15
- * a PivotService.
16
- * @param object - some instance that lives on the server to be connected to.
17
- * @return a promise that will resolve to a PivotService instance
18
- */
19
- static getInstance(object:dh.Table|dh.Widget|dh.WidgetExportedObject|dh.PartitionedTable|dh.TotalsTable|dh.TreeTable):Promise<PivotService>;
20
- /**
21
- * Creates a pivot table from the given options - a source table, row keys, column keys, and aggregations.
22
- * @param options - to use when creating the pivot table
23
- * @return a Promise that resolves to a PivotTable instance
24
- */
25
- createPivotTable(options:PivotCreationOptions):Promise<PivotTable>;
26
- addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
27
- nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<dh.Event<T>>;
28
- hasListeners(name:string):boolean;
29
- removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
30
- }
15
+ export class PivotSort {
16
+ static readonly ASCENDING:string;
17
+ static readonly DESCENDING:string;
31
18
 
32
- /**
33
- * For either the row or column dimension, this class provides access to dimension-specific metadata and data made
34
- * available by the viewport subscription.
35
- */
36
- export class DimensionData {
37
19
  protected constructor();
38
20
 
39
21
  /**
40
- * Given a position in this dimension, returns true if the item can be expanded to show children.
41
- * @param position - the position in the dimension
42
- * @return true if the item can be expanded
43
- */
44
- hasChildren(position:number):boolean;
45
- /**
46
- * Given a position in this dimension, returns true if the item is already expanded. Any item that cannot be
47
- * expanded will return false.
48
- * @param position - the position in the dimension
49
- * @return true if the item is expanded
22
+ * Builds a Sort instance to sort values in ascending order.
23
+ * @return {@link dh.coreplus.pivot.PivotSort}
50
24
  */
51
- isExpanded(position:number):boolean;
25
+ asc():PivotSort;
52
26
  /**
53
- * Given a position in this dimension, returns the depth of the item in the hierarchy. The root level is 1, all
54
- * items at the top level are then at depth 2, and so on.
55
- * @param position - the position in the dimension
56
- * @return the depth of the item in the hierarchy
27
+ * Builds a Sort instance to sort values in descending order.
28
+ * @return {@link dh.coreplus.pivot.PivotSort}
57
29
  */
58
- getDepth(position:number):number;
30
+ desc():PivotSort;
59
31
  /**
60
- * Given a position in this dimension, returns the keys for that item. The keys are the values of the grouping
61
- * columns, and the values then represent the aggregated values for the underlying table.
62
- * <p>
63
- * Types of the keys are provided by
64
- * {@link PivotTable.getColDim}/{@link PivotTable.getRowDim}.
65
- * @param position - the position in the dimension
66
- * @return an array of key values for the item at the given position
32
+ * Builds a Sort instance which takes the absolute value before applying order.
33
+ * @return {@link dh.coreplus.pivot.PivotSort}
67
34
  */
68
- getKeys(position:number):any[];
35
+ abs():PivotSort;
36
+ toString():string;
69
37
  /**
70
- * Given a position in this dimension, returns the total for the item in the dimension at that position.
71
- * <p>
72
- * The type of this data will match the type of the provided {@link dh.coreplus.pivot.PivotSource}.
73
- * @param position - the position in the dimension
74
- * @param value - the value source to read, must have been included in the subscription
75
- * @return the total for the item at the given position in this dimension
38
+ * True if the absolute value of the column should be used when sorting; defaults to false.
39
+ * @return boolean
76
40
  */
77
- getTotal(position:number, value:PivotSource):any;
41
+ get isAbs():boolean;
78
42
  /**
79
- * The first position in this dimension that is present in this snapshot.
43
+ * The column which is sorted.
44
+ * @return {@link dh.Column}
80
45
  */
81
- get offset():number;
46
+ get column():dh.Column;
82
47
  /**
83
- * Number of elements in this dimension that are present in this snapshot.
48
+ * The name of the column which is sorted.
49
+ * @return String
84
50
  */
85
- get count():number;
51
+ get name():string;
86
52
  /**
87
- * The total number of elements in this dimension, given the current expansion state. Viewports past the end of
88
- * this will not be fully populated.
53
+ * The direction of this sort, either <b>ASC</b> or <b>DESC</b>.
54
+ * @return String
89
55
  */
90
- get totalCount():number;
56
+ get direction():string;
91
57
  }
92
58
 
93
59
  /**
94
- * Provides the details for an updated event from a pivot table subscription. Unlike
95
- * {@link dh.TableData}, this class offers a matrix of data for each value column, and
96
- * row/column expand state, depth, and grand totals.
60
+ * Describes the desired subscription for a pivot table.
97
61
  */
98
- export class PivotSnapshot {
99
- protected constructor();
62
+ export class PivotSubscriptionOptions {
63
+ rows:dh.RangeSet|dh.coreplus.SimpleRange;
64
+ columns:dh.RangeSet|dh.coreplus.SimpleRange;
65
+ sources:Array<PivotSource>;
66
+ updateIntervalMs?:number|null;
100
67
 
101
- /**
102
- * Returns the grand total for a given value source in the pivot table.
103
- * <p>
104
- * The type of this data will match the type of the provided {@link dh.coreplus.pivot.PivotSource}.
105
- * @param value - the value source to read, must have been included in the subscription
106
- * @return the grand total for the given value source
107
- */
108
- getGrandTotal(value:PivotSource):any;
109
- /**
110
- * Reads a value from the pivot table data for a given position in the grid.
111
- * <p>
112
- * The type of this data will match the type of the provided {@link dh.coreplus.pivot.PivotSource}.
113
- * @param value - the value source to read, must have been included in the subscription
114
- * @param rowPosition - the row position within the pivot table
115
- * @param colPosition - the column position within the pivot table
116
- * @return the value present in the pivot table at the given position
117
- */
118
- getValue(value:PivotSource, rowPosition:number, colPosition:number):any;
119
- /**
120
- * Data specific to the column dimension of the pivot table, including the groups, depth of each column, whether
121
- * each column is expanded, and the totals for each column.
122
- */
123
- get columns():DimensionData;
124
- /**
125
- * Data specific to the row dimension of the pivot table, including the groups, depth of each row, whether each row
126
- * is expanded, and the totals for each row.
127
- */
128
- get rows():DimensionData;
129
- /**
130
- * The value sources that were included in the subscription and can be read from this snapshot.
131
- */
132
- get valueSources():Array<PivotSource>;
68
+ constructor();
133
69
  }
134
70
 
71
+
135
72
  /**
136
73
  * Represents a PivotTable on the Deephaven server, with support for sorting, filtering, and viewports with
137
74
  * expand/collapse on rows and columns.
@@ -174,6 +111,12 @@ export namespace dh.coreplus.pivot {
174
111
  * @param expandDescendants - if true, also expands all descendants of the row, defaults to false
175
112
  */
176
113
  expandRow(position:number, expandDescendants?:boolean):void;
114
+ expandRootRow(expandDescendants?:boolean):void;
115
+ expandRootColumn(expandDescendants?:boolean):void;
116
+ collapseRootRow():void;
117
+ collapseRootColumn():void;
118
+ setRootRowExpanded(isExpanded:boolean, expandDescendants?:boolean):void;
119
+ setRootColumnExpanded(isExpanded:boolean, expandDescendants?:boolean):void;
177
120
  /**
178
121
  * Collapses the row at the given position.
179
122
  * @param position - the position of the row to collapse
@@ -208,10 +151,15 @@ export namespace dh.coreplus.pivot {
208
151
  setColumnExpanded(position:number, isExpanded:boolean, expandDescendants?:boolean):void;
209
152
  /**
210
153
  * Expands all rows and columns in this pivot table, including all descendants of any expanded rows or columns.
154
+ * @deprecated Use {@link #expandRootRow} and {@link #expandRootColumn} instead to control rows and columns
211
155
  */
212
156
  expandAll():void;
213
157
  /**
214
158
  * Collapses all rows and columns in this pivot table, including all descendants of any expanded rows or columns.
159
+ * @deprecated This method is probably not helpful - it reflects the behavior in rollups, but collapsing both
160
+ * dimensions leads to a single cell for each value source. Use {@link #collapseRootRow} and
161
+ * {@link #collapseRootColumn} (independently or jointly) if that is the behavior you want, and possible
162
+ * expand the root row/column to see the initial contents.
215
163
  */
216
164
  collapseAll():void;
217
165
  setViewport(options:PivotSubscriptionOptions):void;
@@ -260,6 +208,67 @@ export namespace dh.coreplus.pivot {
260
208
  get valueSources():Array<PivotSource>;
261
209
  }
262
210
 
211
+ /**
212
+ * For either the row or column dimension, this class provides access to dimension-specific metadata and data made
213
+ * available by the viewport subscription.
214
+ */
215
+ export class DimensionData {
216
+ protected constructor();
217
+
218
+ /**
219
+ * Given a position in this dimension, returns true if the item can be expanded to show children.
220
+ * @param position - the position in the dimension
221
+ * @return true if the item can be expanded
222
+ */
223
+ hasChildren(position:number):boolean;
224
+ /**
225
+ * Given a position in this dimension, returns true if the item is already expanded. Any item that cannot be
226
+ * expanded will return false.
227
+ * @param position - the position in the dimension
228
+ * @return true if the item is expanded
229
+ */
230
+ isExpanded(position:number):boolean;
231
+ /**
232
+ * Given a position in this dimension, returns the depth of the item in the hierarchy. The root level is 1, all
233
+ * items at the top level are then at depth 2, and so on.
234
+ * @param position - the position in the dimension
235
+ * @return the depth of the item in the hierarchy
236
+ */
237
+ getDepth(position:number):number;
238
+ /**
239
+ * Given a position in this dimension, returns the keys for that item. The keys are the values of the grouping
240
+ * columns, and the values then represent the aggregated values for the underlying table.
241
+ * <p>
242
+ * Types of the keys are provided by
243
+ * {@link PivotTable.getColDim}/{@link PivotTable.getRowDim}.
244
+ * @param position - the position in the dimension
245
+ * @return an array of key values for the item at the given position
246
+ */
247
+ getKeys(position:number):any[];
248
+ /**
249
+ * Given a position in this dimension, returns the total for the item in the dimension at that position.
250
+ * <p>
251
+ * The type of this data will match the type of the provided {@link dh.coreplus.pivot.PivotSource}.
252
+ * @param position - the position in the dimension
253
+ * @param value - the value source to read, must have been included in the subscription
254
+ * @return the total for the item at the given position in this dimension
255
+ */
256
+ getTotal(position:number, value:PivotSource):any;
257
+ /**
258
+ * The first position in this dimension that is present in this snapshot.
259
+ */
260
+ get offset():number;
261
+ /**
262
+ * Number of elements in this dimension that are present in this snapshot.
263
+ */
264
+ get count():number;
265
+ /**
266
+ * The total number of elements in this dimension, given the current expansion state. Viewports past the end of
267
+ * this will not be fully populated.
268
+ */
269
+ get totalCount():number;
270
+ }
271
+
263
272
  /**
264
273
  * Analog of {@link dh.Column}, but specific to pivot tables. Represents a named, typed set of values in the pivot table
265
274
  * that can be read.
@@ -290,24 +299,15 @@ export namespace dh.coreplus.pivot {
290
299
  */
291
300
  get isSortable():boolean;
292
301
  /**
302
+ * The description of this source, if any.
303
+ */
304
+ get description():string;
305
+ /**
293
306
  * The type of this source.
294
307
  */
295
308
  get type():string;
296
309
  }
297
310
 
298
- /**
299
- * Describes the desired subscription for a pivot table.
300
- */
301
- export class PivotSubscriptionOptions {
302
- rows:dh.RangeSet|dh.coreplus.SimpleRange;
303
- columns:dh.RangeSet|dh.coreplus.SimpleRange;
304
- sources:Array<PivotSource>;
305
- updateIntervalMs?:number|null;
306
-
307
- constructor();
308
- }
309
-
310
-
311
311
  /**
312
312
  * Options for creating a pivot table.
313
313
  */
@@ -323,56 +323,71 @@ export namespace dh.coreplus.pivot {
323
323
  }
324
324
 
325
325
  /**
326
- * This type is an analog of {@link dh.Sort}, with a few differences:
327
- * <ul>
328
- * <li>The {@link column} property always returns null, and instead there is a {@link name} property</li>
329
- * <li>Reverse is not supported</li>
330
- * </ul>
331
- *
332
- * A PivotSort doesn't sort the columns of the pivot directly, but sorts the keys uses for columns or rows.
326
+ * Provides the details for an updated event from a pivot table subscription. Unlike
327
+ * {@link dh.TableData}, this class offers a matrix of data for each value column, and
328
+ * row/column expand state, depth, and grand totals.
333
329
  */
334
- export class PivotSort {
335
- static readonly ASCENDING:string;
336
- static readonly DESCENDING:string;
337
-
330
+ export class PivotSnapshot {
338
331
  protected constructor();
339
332
 
340
333
  /**
341
- * Builds a Sort instance to sort values in ascending order.
342
- * @return {@link dh.coreplus.pivot.PivotSort}
334
+ * Returns the grand total for a given value source in the pivot table.
335
+ * <p>
336
+ * The type of this data will match the type of the provided {@link dh.coreplus.pivot.PivotSource}.
337
+ * @param value - the value source to read, must have been included in the subscription
338
+ * @return the grand total for the given value source
343
339
  */
344
- asc():PivotSort;
340
+ getGrandTotal(value:PivotSource):any;
345
341
  /**
346
- * Builds a Sort instance to sort values in descending order.
347
- * @return {@link dh.coreplus.pivot.PivotSort}
342
+ * Reads a value from the pivot table data for a given position in the grid.
343
+ * <p>
344
+ * The type of this data will match the type of the provided {@link dh.coreplus.pivot.PivotSource}.
345
+ * @param value - the value source to read, must have been included in the subscription
346
+ * @param rowPosition - the row position within the pivot table
347
+ * @param colPosition - the column position within the pivot table
348
+ * @return the value present in the pivot table at the given position
348
349
  */
349
- desc():PivotSort;
350
+ getValue(value:PivotSource, rowPosition:number, colPosition:number):any;
350
351
  /**
351
- * Builds a Sort instance which takes the absolute value before applying order.
352
- * @return {@link dh.coreplus.pivot.PivotSort}
352
+ * Data specific to the column dimension of the pivot table, including the groups, depth of each column, whether
353
+ * each column is expanded, and the totals for each column.
353
354
  */
354
- abs():PivotSort;
355
- toString():string;
355
+ get columns():DimensionData;
356
356
  /**
357
- * True if the absolute value of the column should be used when sorting; defaults to false.
358
- * @return boolean
357
+ * Data specific to the row dimension of the pivot table, including the groups, depth of each row, whether each row
358
+ * is expanded, and the totals for each row.
359
359
  */
360
- get isAbs():boolean;
360
+ get rows():DimensionData;
361
361
  /**
362
- * The column which is sorted.
363
- * @return {@link dh.Column}
362
+ * The value sources that were included in the subscription and can be read from this snapshot.
364
363
  */
365
- get column():dh.Column;
364
+ get valueSources():Array<PivotSource>;
365
+ }
366
+
367
+ /**
368
+ * Tool to request the server pivot a table and return the results.
369
+ */
370
+ export class PivotService implements dh.HasEventHandling {
371
+ protected constructor();
372
+
366
373
  /**
367
- * The name of the column which is sorted.
368
- * @return String
374
+ * Given a server object, finds or creates a pivot service talking to that same server. If the instance is a
375
+ * PivotService, it will be wrapped and returned. The initial call for a given worker must be either a PivotTable or
376
+ * a PivotService.
377
+ * @param object - some instance that lives on the server to be connected to.
378
+ * @return a promise that will resolve to a PivotService instance
369
379
  */
370
- get name():string;
380
+ static getInstance(object:dh.Table|dh.Widget|dh.WidgetExportedObject|dh.PartitionedTable|dh.TotalsTable|dh.TreeTable):Promise<PivotService>;
371
381
  /**
372
- * The direction of this sort, either <b>ASC</b> or <b>DESC</b>.
373
- * @return String
382
+ * Creates a pivot table from the given options - a source table, row keys, column keys, and aggregations.
383
+ * @param options - to use when creating the pivot table
384
+ * @return a Promise that resolves to a PivotTable instance
374
385
  */
375
- get direction():string;
386
+ createPivotTable(options:PivotCreationOptions):Promise<PivotTable>;
387
+ addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
388
+ nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<dh.Event<T>>;
389
+ hasListeners(name:string):boolean;
390
+ removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
376
391
  }
377
392
 
378
393
  }
@@ -0,0 +1,136 @@
1
+ Deephaven Data Labs is dedicated to developing Deephaven's software in the open
2
+ and is making software available under the following licenses:
3
+
4
+ - **Deephaven Open Source** is made available under the Apache 2.0 License
5
+ - **Deephaven Community** is provided under a source-available license, the
6
+ Deephaven Community License Agreement
7
+
8
+ To request a commercial license for software or uses not covered by these
9
+ licenses or to ask any license-related question, please contact us at:
10
+ [license@deephaven.io](mailto:license@deephaven.io)
11
+
12
+
13
+ # Deephaven Community License Agreement Version 1.0
14
+
15
+ 1. **ACCEPTANCE.** This Deephaven Community License Agreement is entered into by
16
+ and between Deephaven Data Labs LLC, a Delaware Limited Liability Company, with
17
+ an address of 2800 Niagara Lane North, Plymouth, MN 55447 ("Deephaven") and
18
+ “You” (a) in your individual capacity, or (b) on behalf of your company if you
19
+ are licensing the Software for a company for which or with which you work. By
20
+ using the Software, You agree to all of the terms and conditions in this
21
+ Deephaven Community License Agreement (the "Agreement").
22
+
23
+ 2. **THE SOFTWARE.** The "Software" means the version of the Deephaven Community
24
+ Software provided to the original licensee with this Agreement. The Software may
25
+ include third party owned code. Each third party module is subject to the terms
26
+ of its respective license; the details of which can be found in the notices
27
+ served at [https://github.com/deephaven/deephaven-core](https://github.com/deephaven/deephaven-core).
28
+ Since licensees may contribute back to the Software as provided for in Section
29
+ 3(b), the Software may include any such contributions.
30
+
31
+ 3. **GRANT OF LICENSE.** Subject to the terms and conditions of this Agreement,
32
+ Deephaven hereby grants You a royalty-free, worldwide, non-exclusive,
33
+ non-transferable license to the Software (the "License"), subject, in all of the
34
+ cases, to applicable laws and regulations, but not for the Prohibited Use (as
35
+ provided for in Section 4), solely as follows:
36
+
37
+ - a. **Internal Use.** A license to use, copy, compile, and install the
38
+ Software for Your internal use;
39
+
40
+ - b. **Derivative Works.** A license to (i) prepare, develop, compile, and test
41
+ Derivative Works of the Software, (ii) use Your Derivative Works for Your
42
+ internal use solely as expressly permitted in Section 3(a), and (iii) distribute
43
+ Your Derivative Works back to Deephaven under a separate Deephaven Contributor
44
+ Agreement for potential incorporation into the Software at Deephaven's sole
45
+ discretion. A "Derivative Work" means any work that (A) is based on or derived
46
+ from the Software including any modifications to the Software, or (B) meets the
47
+ definition of derivative work under the United States Copyright Act of 1976, 17
48
+ U.S.C. Section 101; and
49
+
50
+ - c. **Distribution and redistribution.** A license to distribute or
51
+ redistribute the Software and Your Derivative Works, and copies of the Software
52
+ and Your Derivative Works, to customers and other third parties for their use
53
+ pursuant to this Agreement subject to the prohibitions in Section 4 and
54
+ Agreement requirement as provided for in Section 5.
55
+
56
+ 4. **PROHIBITED USE.** Notwithstanding any provision of this Agreement to the
57
+ contrary, the original licensee is prohibited from using, distributing, or
58
+ deploying the Software or Derivative Works in such a way that a third party
59
+ (including any recipient under Section 3(c)) can, directly or indirectly
60
+ through the original licensee, its agents, its technology, or solutions made
61
+ available to them, add, define, redefine, or modify the schema for any input
62
+ tables (including source tables, or other input objects) that the Software or
63
+ Derivative Works access. For clarification, every recipient of the Software or
64
+ Derivative Works after the original licensee of the Software is prohibited from
65
+ adding, defining, redefining, or modifying the schema for any input tables
66
+ (including source tables, or other input objects) that the Software or
67
+ Derivative Works access. This prohibition in no way affects the ability of a
68
+ third party to add, define, redefine, or modify the schema of output tables
69
+ (including output tables that are interim or derived). Further, this
70
+ prohibition in no way affects the ability of a third party to add, define,
71
+ redefine, or modify data (as opposed to schema), nor does it cause You to be
72
+ limited in any capacity for Your internal use as permitted in Section 3(a). If
73
+ You have any questions on this prohibition, please contact us at:
74
+ [license@deephaven.io](mailto:license@deephaven.io)
75
+
76
+ 5. **AGREEMENT.** If You distribute the Software, whether directly, as a copy,
77
+ or via Your Derivative Works you must provide recipients a copy of this
78
+ Agreement (which will bind each recipient directly) and You must ensure that all
79
+ copyright, patent, trademark, and attribution notices from the Software are
80
+ retained.
81
+
82
+ 6. **AFFILIATES.** You may permit Your affiliates to exercise the License,
83
+ provided that such exercise must be solely for Your benefit and/or the benefit
84
+ of Your affiliate, and You shall be responsible for all acts and omissions of
85
+ such affiliates in connection with such exercise of the License, including but
86
+ not limited to breach of any terms of this Agreement.
87
+
88
+ 7. **SUBLICENSE.** The License is sublicensable only to Your third-party
89
+ subcontractors and contractors performing services on Your or Your affiliates'
90
+ behalf, subject to the terms and conditions of this Agreement. The License is
91
+ not sublicensable to any other third party nor is it further sublicensable. You
92
+ shall be responsible for all acts and omissions of such subcontractor and
93
+ contractors in connection with such exercise of the sublicense, including but
94
+ not limited to breach of any terms of this Agreement.
95
+
96
+ 8. **PATENTS.** Rights to use the Software do not give You any right to
97
+ implement or use Deephaven's patents independently of the permitted use of the
98
+ Software.
99
+
100
+ 9. **RESERVATION OF RIGHTS.** Deephaven reserves all rights not granted in this
101
+ Agreement. You have no right to use Deephaven trade names, trademarks, service
102
+ marks, or product names except as required for reasonable and customary use in
103
+ describing the origin of the Software.
104
+
105
+ 10. **DISCLAIMER OF WARRANTY.** THE SOFTWARE IS LICENSED ON AN "AS IS" BASIS
106
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND. DEEPHAVEN DISCLAIMS ALL
107
+ WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OF
108
+ TITLE, NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.
109
+ You are solely responsible for determining the appropriateness of using,
110
+ distributing or redistributing the Software and Derivative Works and assume all
111
+ risks associated with Your exercise of the License.
112
+
113
+ 11. **INDEMNIFICATION.** If You distribute or redistribute the Software or
114
+ Derivative Works, You agree to defend on request, and indemnify, Deephaven and
115
+ its affiliates, officers, directors, employees and agents from and against any
116
+ and all losses, damages, liabilities, claims, costs and expenses (including
117
+ reasonable attorney’s fees and expenses) incurred or arising from the
118
+ exploitation of the Software or Derivative Works.
119
+
120
+ 12. **LIMITATION OF LIABILITY.** THE LICENSE IS GRANTED FOR NO FEE. IN NO EVENT
121
+ AND UNDER NO LEGAL THEORY, WHETHER IN TORT (INCLUDING NEGLIGENCE), CONTRACT, OR
122
+ OTHERWISE, SHALL DEEPHAVEN BE LIABLE FOR ANY DAMAGES ARISING OUT OF OR AS A
123
+ RESULT OF THIS AGREEMENT, INCLUDING ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL,
124
+ OR CONSEQUENTIAL DAMAGES (INCLUDING BUT NOT LIMITED TO DAMAGES FOR LOSS OF
125
+ GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR LOSS OR CORRUPTION
126
+ OF DATA), EVEN IF DEEPHAVEN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
127
+
128
+ 13. **TERMINATION.** The License will automatically terminate if You violate the
129
+ use rights or prohibitions in this Agreement.
130
+
131
+ 14. **GOVERNING LAW.** This Agreement will be interpreted, construed and
132
+ enforced in all respects in accordance with the laws of the State of Delaware,
133
+ USA without reference to its choice of law rules to the contrary.
134
+
135
+
136
+ # END OF AGREEMENT
@@ -0,0 +1,410 @@
1
+ declare module '@deephaven/jsapi-types' {
2
+ // Minimum TypeScript Version: 4.3
3
+ // Generated using com.vertispan.tsdefs.doclet.TsDoclet
4
+ export namespace dh.coreplus.pivot {
5
+
6
+ /**
7
+ * This type is an analog of {@link dh.Sort}, with a few differences:
8
+ * <ul>
9
+ * <li>The {@link column} property always returns null, and instead there is a {@link name} property</li>
10
+ * <li>Reverse is not supported</li>
11
+ * </ul>
12
+ *
13
+ * A PivotSort doesn't sort the columns of the pivot directly, but sorts the keys uses for columns or rows.
14
+ */
15
+ export class PivotSort {
16
+ static readonly ASCENDING:string;
17
+ static readonly DESCENDING:string;
18
+
19
+ protected constructor();
20
+
21
+ /**
22
+ * Builds a Sort instance to sort values in ascending order.
23
+ * @return {@link dh.coreplus.pivot.PivotSort}
24
+ */
25
+ asc():PivotSort;
26
+ /**
27
+ * Builds a Sort instance to sort values in descending order.
28
+ * @return {@link dh.coreplus.pivot.PivotSort}
29
+ */
30
+ desc():PivotSort;
31
+ /**
32
+ * Builds a Sort instance which takes the absolute value before applying order.
33
+ * @return {@link dh.coreplus.pivot.PivotSort}
34
+ */
35
+ abs():PivotSort;
36
+ toString():string;
37
+ /**
38
+ * True if the absolute value of the column should be used when sorting; defaults to false.
39
+ * @return boolean
40
+ */
41
+ get isAbs():boolean;
42
+ /**
43
+ * The column which is sorted.
44
+ * @return {@link dh.Column}
45
+ */
46
+ get column():dh.Column;
47
+ /**
48
+ * The name of the column which is sorted.
49
+ * @return String
50
+ */
51
+ get name():string;
52
+ /**
53
+ * The direction of this sort, either <b>ASC</b> or <b>DESC</b>.
54
+ * @return String
55
+ */
56
+ get direction():string;
57
+ }
58
+
59
+ /**
60
+ * Describes the desired subscription for a pivot table.
61
+ */
62
+ export class PivotSubscriptionOptions {
63
+ rows:dh.RangeSet|dh.coreplus.SimpleRange;
64
+ columns:dh.RangeSet|dh.coreplus.SimpleRange;
65
+ sources:Array<PivotSource>;
66
+ updateIntervalMs?:number|null;
67
+
68
+ constructor();
69
+ }
70
+
71
+
72
+ /**
73
+ * Represents a PivotTable on the Deephaven server, with support for sorting, filtering, and viewports with
74
+ * expand/collapse on rows and columns.
75
+ */
76
+ export class PivotTable implements dh.HasEventHandling {
77
+ static readonly EVENT_UPDATED:string;
78
+ static readonly EVENT_DISCONNECT:string;
79
+ static readonly EVENT_RECONNECT:string;
80
+ static readonly EVENT_RECONNECTFAILED:string;
81
+
82
+ /**
83
+ * Creates a client PivotTable instance from a {@link dh.Widget} that has been exported from the server.
84
+ * @param widget - a PivotTable widget that has been fetched from the server
85
+ */
86
+ constructor(widget:dh.Widget);
87
+
88
+ /**
89
+ * Changes the row sorts of this pivot table. The row sorts may contain sorts of both the row and value sources.
90
+ * @param rowSorts - row and value sorts to apply to the rows of this pivot table
91
+ * @return the previous row sorts
92
+ */
93
+ applyRowSort(rowSorts:PivotSort[]):Array<PivotSort>;
94
+ /**
95
+ * Changes the column sorts of this pivot table. The column sorts may contain sorts of both the column and value
96
+ * sources.
97
+ * @param colSorts - column and value sorts to apply to the columns of this pivot table
98
+ * @return the previous column sorts
99
+ */
100
+ applyColumnSort(colSorts:PivotSort[]):Array<PivotSort>;
101
+ /**
102
+ * Changes the filter conditions of this pivot table. The filter array may contain any number of conditions, which
103
+ * will be AND'd together. Only row and column sources can be filtered, not value sources.
104
+ * @param filter - Row and column filter conditions to apply to this pivot table.
105
+ * @return the previous filter conditions
106
+ */
107
+ applyFilter(filter:dh.FilterCondition[]):Array<dh.FilterCondition>;
108
+ /**
109
+ * Expands the row at the given position.
110
+ * @param position - the position of the row to expand
111
+ * @param expandDescendants - if true, also expands all descendants of the row, defaults to false
112
+ */
113
+ expandRow(position:number, expandDescendants?:boolean):void;
114
+ expandRootRow(expandDescendants?:boolean):void;
115
+ expandRootColumn(expandDescendants?:boolean):void;
116
+ collapseRootRow():void;
117
+ collapseRootColumn():void;
118
+ setRootRowExpanded(isExpanded:boolean, expandDescendants?:boolean):void;
119
+ setRootColumnExpanded(isExpanded:boolean, expandDescendants?:boolean):void;
120
+ /**
121
+ * Collapses the row at the given position.
122
+ * @param position - the position of the row to collapse
123
+ */
124
+ collapseRow(position:number):void;
125
+ /**
126
+ * Sets the expansion state of the row at the given position.
127
+ * @param position - the position of the row to set the expansion state for
128
+ * @param isExpanded - if true, the row will be expanded, if false, it will be collapsed
129
+ * @param expandDescendants - if true, also expands all descendants of the row, defaults to false. Ignored if
130
+ * isExpanded is false.
131
+ */
132
+ setRowExpanded(position:number, isExpanded:boolean, expandDescendants?:boolean):void;
133
+ /**
134
+ * Expands the column at the given position.
135
+ * @param position - the position of the column to expand
136
+ * @param expandDescendants - if true, also expands all descendants of the column, defaults to false
137
+ */
138
+ expandColumn(position:number, expandDescendants?:boolean):void;
139
+ /**
140
+ * Collapses the column at the given position.
141
+ * @param position - the position of the column to collapse
142
+ */
143
+ collapseColumn(position:number):void;
144
+ /**
145
+ * Sets the expansion state of the column at the given position.
146
+ * @param position - the position of the column to set the expansion state for
147
+ * @param isExpanded - if true, the column will be expanded, if false, it will be collapsed
148
+ * @param expandDescendants - if true, also expands all descendants of the column, defaults to false. Ignored if
149
+ * isExpanded is false.
150
+ */
151
+ setColumnExpanded(position:number, isExpanded:boolean, expandDescendants?:boolean):void;
152
+ /**
153
+ * Expands all rows and columns in this pivot table, including all descendants of any expanded rows or columns.
154
+ * @deprecated Use {@link #expandRootRow} and {@link #expandRootColumn} instead to control rows and columns
155
+ */
156
+ expandAll():void;
157
+ /**
158
+ * Collapses all rows and columns in this pivot table, including all descendants of any expanded rows or columns.
159
+ * @deprecated This method is probably not helpful - it reflects the behavior in rollups, but collapsing both
160
+ * dimensions leads to a single cell for each value source. Use {@link #collapseRootRow} and
161
+ * {@link #collapseRootColumn} (independently or jointly) if that is the behavior you want, and possible
162
+ * expand the root row/column to see the initial contents.
163
+ */
164
+ collapseAll():void;
165
+ setViewport(options:PivotSubscriptionOptions):void;
166
+ /**
167
+ * Closes this pivot table, releasing all resources and subscriptions associated with it.
168
+ */
169
+ close():void;
170
+ addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
171
+ nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<dh.Event<T>>;
172
+ hasListeners(name:string):boolean;
173
+ removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
174
+ /**
175
+ * The current filter configuration of this Tree Table.
176
+ * @return {@link dh.FilterCondition} array
177
+ */
178
+ get filter():Array<dh.FilterCondition>;
179
+ /**
180
+ * The current column sort configuration of this PivotTable.
181
+ * @return {@link dh.coreplus.pivot.PivotSort} array
182
+ */
183
+ get columnSort():Array<PivotSort>;
184
+ /**
185
+ * True if this pivot table is closed.
186
+ */
187
+ get isClosed():boolean;
188
+ /**
189
+ * The sources that represent the columns of this pivot table.
190
+ */
191
+ get columnSources():Array<PivotSource>;
192
+ /**
193
+ * The current row sort configuration of this PivotTable.
194
+ * @return {@link dh.coreplus.pivot.PivotSort} array
195
+ */
196
+ get rowSort():Array<PivotSort>;
197
+ /**
198
+ * True if this pivot table's subscription may receive updates from the server.
199
+ */
200
+ get isRefreshing():boolean;
201
+ /**
202
+ * The sources that represent the rows of this pivot table.
203
+ */
204
+ get rowSources():Array<PivotSource>;
205
+ /**
206
+ * The sources that represent the values of this pivot table.
207
+ */
208
+ get valueSources():Array<PivotSource>;
209
+ }
210
+
211
+ /**
212
+ * For either the row or column dimension, this class provides access to dimension-specific metadata and data made
213
+ * available by the viewport subscription.
214
+ */
215
+ export class DimensionData {
216
+ protected constructor();
217
+
218
+ /**
219
+ * Given a position in this dimension, returns true if the item can be expanded to show children.
220
+ * @param position - the position in the dimension
221
+ * @return true if the item can be expanded
222
+ */
223
+ hasChildren(position:number):boolean;
224
+ /**
225
+ * Given a position in this dimension, returns true if the item is already expanded. Any item that cannot be
226
+ * expanded will return false.
227
+ * @param position - the position in the dimension
228
+ * @return true if the item is expanded
229
+ */
230
+ isExpanded(position:number):boolean;
231
+ /**
232
+ * Given a position in this dimension, returns the depth of the item in the hierarchy. The root level is 1, all
233
+ * items at the top level are then at depth 2, and so on.
234
+ * @param position - the position in the dimension
235
+ * @return the depth of the item in the hierarchy
236
+ */
237
+ getDepth(position:number):number;
238
+ /**
239
+ * Given a position in this dimension, returns the keys for that item. The keys are the values of the grouping
240
+ * columns, and the values then represent the aggregated values for the underlying table.
241
+ * <p>
242
+ * Types of the keys are provided by
243
+ * {@link PivotTable.getColDim}/{@link PivotTable.getRowDim}.
244
+ * @param position - the position in the dimension
245
+ * @return an array of key values for the item at the given position
246
+ */
247
+ getKeys(position:number):any[];
248
+ /**
249
+ * Given a position in this dimension, returns the total for the item in the dimension at that position.
250
+ * <p>
251
+ * The type of this data will match the type of the provided {@link dh.coreplus.pivot.PivotSource}.
252
+ * @param position - the position in the dimension
253
+ * @param value - the value source to read, must have been included in the subscription
254
+ * @return the total for the item at the given position in this dimension
255
+ */
256
+ getTotal(position:number, value:PivotSource):any;
257
+ /**
258
+ * The first position in this dimension that is present in this snapshot.
259
+ */
260
+ get offset():number;
261
+ /**
262
+ * Number of elements in this dimension that are present in this snapshot.
263
+ */
264
+ get count():number;
265
+ /**
266
+ * The total number of elements in this dimension, given the current expansion state. Viewports past the end of
267
+ * this will not be fully populated.
268
+ */
269
+ get totalCount():number;
270
+ }
271
+
272
+ /**
273
+ * Analog of {@link dh.Column}, but specific to pivot tables. Represents a named, typed set of values in the pivot table
274
+ * that can be read.
275
+ */
276
+ export class PivotSource {
277
+ protected constructor();
278
+
279
+ /**
280
+ * Creates a new {@link dh.coreplus.pivot.PivotSort} for this source. The sort object then can be made to be ascending or descending,
281
+ * using {@link PivotSort.asc} or {@link PivotSort.desc}.
282
+ * @see {@link dh.Column.sort}
283
+ * @return a new {@link dh.coreplus.pivot.PivotSort} for this source
284
+ */
285
+ sort():PivotSort;
286
+ /**
287
+ * Creates a new {@link dh.FilterValue} for this source. The filter value can used as a builder to create a
288
+ * {@link dh.FilterCondition} or used as a parameter to another filter operation
289
+ * @see {@link dh.FilterCondition}
290
+ * @return a new {@link dh.FilterValue} for this source
291
+ */
292
+ filter():dh.FilterValue;
293
+ /**
294
+ * The name of this source.
295
+ */
296
+ get name():string;
297
+ /**
298
+ * True if the data type in this source is sortable.
299
+ */
300
+ get isSortable():boolean;
301
+ /**
302
+ * The description of this source, if any.
303
+ */
304
+ get description():string;
305
+ /**
306
+ * The type of this source.
307
+ */
308
+ get type():string;
309
+ }
310
+
311
+ /**
312
+ * Options for creating a pivot table.
313
+ */
314
+ export class PivotCreationOptions {
315
+ source:dh.JoinableTable;
316
+ rowKeys:string[];
317
+ columnKeys:string[];
318
+ aggregations:{ [key: string]: Array<string>; };
319
+
320
+ protected constructor();
321
+
322
+ toString():string;
323
+ }
324
+
325
+ /**
326
+ * Provides the details for an updated event from a pivot table subscription. Unlike
327
+ * {@link dh.TableData}, this class offers a matrix of data for each value column, and
328
+ * row/column expand state, depth, and grand totals.
329
+ */
330
+ export class PivotSnapshot {
331
+ protected constructor();
332
+
333
+ /**
334
+ * Returns the grand total for a given value source in the pivot table.
335
+ * <p>
336
+ * The type of this data will match the type of the provided {@link dh.coreplus.pivot.PivotSource}.
337
+ * @param value - the value source to read, must have been included in the subscription
338
+ * @return the grand total for the given value source
339
+ */
340
+ getGrandTotal(value:PivotSource):any;
341
+ /**
342
+ * Reads a value from the pivot table data for a given position in the grid.
343
+ * <p>
344
+ * The type of this data will match the type of the provided {@link dh.coreplus.pivot.PivotSource}.
345
+ * @param value - the value source to read, must have been included in the subscription
346
+ * @param rowPosition - the row position within the pivot table
347
+ * @param colPosition - the column position within the pivot table
348
+ * @return the value present in the pivot table at the given position
349
+ */
350
+ getValue(value:PivotSource, rowPosition:number, colPosition:number):any;
351
+ /**
352
+ * Data specific to the column dimension of the pivot table, including the groups, depth of each column, whether
353
+ * each column is expanded, and the totals for each column.
354
+ */
355
+ get columns():DimensionData;
356
+ /**
357
+ * Data specific to the row dimension of the pivot table, including the groups, depth of each row, whether each row
358
+ * is expanded, and the totals for each row.
359
+ */
360
+ get rows():DimensionData;
361
+ /**
362
+ * The value sources that were included in the subscription and can be read from this snapshot.
363
+ */
364
+ get valueSources():Array<PivotSource>;
365
+ }
366
+
367
+ /**
368
+ * Tool to request the server pivot a table and return the results.
369
+ */
370
+ export class PivotService implements dh.HasEventHandling {
371
+ protected constructor();
372
+
373
+ /**
374
+ * Given a server object, finds or creates a pivot service talking to that same server. If the instance is a
375
+ * PivotService, it will be wrapped and returned. The initial call for a given worker must be either a PivotTable or
376
+ * a PivotService.
377
+ * @param object - some instance that lives on the server to be connected to.
378
+ * @return a promise that will resolve to a PivotService instance
379
+ */
380
+ static getInstance(object:dh.Table|dh.Widget|dh.WidgetExportedObject|dh.PartitionedTable|dh.TotalsTable|dh.TreeTable):Promise<PivotService>;
381
+ /**
382
+ * Creates a pivot table from the given options - a source table, row keys, column keys, and aggregations.
383
+ * @param options - to use when creating the pivot table
384
+ * @return a Promise that resolves to a PivotTable instance
385
+ */
386
+ createPivotTable(options:PivotCreationOptions):Promise<PivotTable>;
387
+ addEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):()=>void;
388
+ nextEvent<T>(eventName:string, timeoutInMillis?:number):Promise<dh.Event<T>>;
389
+ hasListeners(name:string):boolean;
390
+ removeEventListener<T>(name:string, callback:(e:dh.Event<T>)=>void):boolean;
391
+ }
392
+
393
+ }
394
+
395
+
396
+ export namespace dh.coreplus {
397
+
398
+ /**
399
+ * Simple range consisting only of start and end numbers. Will be migrated to deephaven-core in the near future, and
400
+ * subsequently removed from this the coreplus namespace.
401
+ */
402
+ export interface SimpleRange {
403
+ first:number;
404
+ last:number;
405
+ }
406
+ }
407
+
408
+ }
409
+
410
+ export { dh } from '@deephaven/jsapi-types';
@@ -0,0 +1,24 @@
1
+ {
2
+ "name": "@deephaven-enterprise/jsapi-coreplus-types",
3
+ "version": "1.20240517.250905123531-gb5ceb1a6b5",
4
+ "description": "Deephaven Enterprise Core+ JSAPI Types",
5
+ "author": "Deephaven Data Labs LLC",
6
+ "license": "SEE LICENSE IN LICENSE.md",
7
+ "type": "module",
8
+ "devDependencies": {
9
+ "typedoc": "^0.24.8",
10
+ "typescript": "^5.1.6"
11
+ },
12
+ "dependencies": {
13
+ "@deephaven/jsapi-types": "^1.0.0-dev0.39.2"
14
+ },
15
+ "files": [
16
+ "dist",
17
+ "LICENSE.md"
18
+ ],
19
+ "types": "./dist/index.d.ts",
20
+ "sideEffects": false,
21
+ "publishConfig": {
22
+ "access": "public"
23
+ }
24
+ }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deephaven-enterprise/jsapi-coreplus-types",
3
- "version": "1.20240517.510",
3
+ "version": "1.20240517.518",
4
4
  "description": "Deephaven Enterprise Core+ JSAPI Types",
5
5
  "author": "Deephaven Data Labs LLC",
6
6
  "license": "SEE LICENSE IN LICENSE.md",