@datagrok/api-samples 1.0.8 → 1.0.12

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.
Files changed (118) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/dist/package-test.js +2 -2
  3. package/files/viewer-events/bar-chart/on-category-clicked.js +1 -0
  4. package/files/viewer-events/grid/on-cell-clicked.js +1 -0
  5. package/files/viewer-events/pc-plot/on-line-clicked.js +1 -0
  6. package/files/viewer-events/pie-chart/on-segment-clicked.js +1 -0
  7. package/files/viewer-events/scatter-plot/on-point-clicked.js +1 -0
  8. package/files/viewer-events/scatter-plot/on-rendered.js +1 -0
  9. package/layouts/demog-table-layout.json +329 -181
  10. package/package.json +17 -15
  11. package/scripts/dapi/files.js +40 -0
  12. package/scripts/dapi/projects-open.js +1 -1
  13. package/scripts/dapi/sticky-meta-1-tags.js +54 -0
  14. package/scripts/dapi/sticky-meta-2-semtype.js +33 -0
  15. package/scripts/data-access/db-master-details-manual.js +3 -2
  16. package/scripts/data-access/external/stock-prices.js +1 -1
  17. package/scripts/data-access/open-table-by-id.js +11 -3
  18. package/scripts/data-access/output-layouts.js +3 -1
  19. package/scripts/data-frame/advanced/data-frames-in-columns.js +4 -1
  20. package/scripts/data-frame/advanced/virtual-columns.js +1 -1
  21. package/scripts/data-frame/aggregation/unpivot.js +1 -1
  22. package/scripts/data-frame/column-access.js +1 -3
  23. package/scripts/data-frame/compare-tables.js +3 -2
  24. package/scripts/data-frame/construction/create-from-csv-format.js +3 -3
  25. package/scripts/data-frame/construction/create-from-typed-arrays.js +7 -2
  26. package/scripts/data-frame/construction/export-to-csv-advanced.js +14 -4
  27. package/scripts/data-frame/construction/export-to-csv-molblock.js +3 -0
  28. package/scripts/data-frame/construction/export-to-csv.js +1 -1
  29. package/scripts/data-frame/events/calculated-columns/creation.js +1 -1
  30. package/scripts/data-frame/events/calculated-columns/deletion.js +1 -1
  31. package/scripts/data-frame/events/calculated-columns/update.js +1 -1
  32. package/scripts/data-frame/join-link/link-tables-dynamic.js +3 -5
  33. package/scripts/data-frame/metadata/dataframe-meta.js +1 -1
  34. package/scripts/data-frame/modification/add-columns.js +1 -1
  35. package/scripts/data-frame/modification/append.js +1 -1
  36. package/scripts/data-frame/modification/calculated-columns/edit-formula.js +2 -2
  37. package/scripts/data-frame/modification/double-precision.js +26 -0
  38. package/scripts/data-frame/modification/manipulate.js +3 -3
  39. package/scripts/domains/chem/sketcher.js +2 -2
  40. package/scripts/events/form-creation.js +2 -2
  41. package/scripts/events/global-events.js +1 -1
  42. package/scripts/events/layout-events.js +5 -6
  43. package/scripts/events/viewer-data-events.js +11 -0
  44. package/scripts/functions/func-call.js +5 -0
  45. package/scripts/grid/advanced/cell-renderer.js +1 -1
  46. package/scripts/grid/advanced/format-formula.js +7 -0
  47. package/scripts/grid/advanced/link-click.js +3 -3
  48. package/scripts/grid/advanced/markup-link.js +6 -0
  49. package/scripts/grid/advanced/paint-counts.js +4 -1
  50. package/scripts/grid/{color-coding-conditional.js → color-coding/color-coding-conditional.js} +17 -10
  51. package/scripts/grid/color-coding/color-coding.js +5 -9
  52. package/scripts/grid/color-coding/get-cell-color.js +3 -5
  53. package/scripts/grid/column-cell-styles.js +10 -0
  54. package/scripts/grid/column-controlled-values.js +2 -2
  55. package/scripts/grid/data-format.js +4 -4
  56. package/scripts/grid/hit-test.js +1 -1
  57. package/scripts/grid/html-cells/html-table-cells.js +1 -1
  58. package/scripts/misc/audit/test-tracking.js +1 -1
  59. package/scripts/misc/user-settings-storage.js +48 -0
  60. package/scripts/scripting/files-for-scripting.js +24 -0
  61. package/scripts/scripting/grok-scripting.js +1 -1
  62. package/scripts/shell/last-error.js +1 -1
  63. package/scripts/shell/ui-parts.js +9 -9
  64. package/scripts/shell/windows/browse/customize-tree.js +3 -0
  65. package/scripts/ui/apps/bioreactor.js +5 -5
  66. package/scripts/ui/components/accordion.js +3 -3
  67. package/scripts/ui/components/tree-view-adv.js +4 -2
  68. package/scripts/ui/containers/splitters.js +13 -13
  69. package/scripts/ui/dialogs/wizard.js +8 -8
  70. package/scripts/ui/docking/docking.js +4 -1
  71. package/scripts/ui/handlers/markup-handlers.js +61 -0
  72. package/scripts/ui/inputs/advanced/all-input-types.js +37 -24
  73. package/scripts/ui/inputs/advanced/input-api.js +39 -0
  74. package/scripts/ui/inputs/advanced/input-events.js +10 -10
  75. package/scripts/ui/inputs/advanced/input-form.js +8 -8
  76. package/scripts/ui/inputs/choice-input.js +5 -5
  77. package/scripts/ui/inputs/column-combo-box.js +3 -3
  78. package/scripts/ui/inputs/column-inputs.js +3 -3
  79. package/scripts/ui/inputs/forms.js +10 -10
  80. package/scripts/ui/inputs/helm-input-ui.js +7 -0
  81. package/scripts/ui/inputs/inputs-events.js +8 -8
  82. package/scripts/ui/inputs/inputs-extended.js +2 -2
  83. package/scripts/ui/inputs/inputs.js +17 -15
  84. package/scripts/ui/inputs/molecule-input.js +1 -1
  85. package/scripts/ui/inputs/table-input.js +1 -1
  86. package/scripts/ui/inputs/tags-input.js +2 -2
  87. package/scripts/ui/inputs/typeahead-input.js +16 -17
  88. package/scripts/ui/inputs/validation/input-validators.js +11 -0
  89. package/scripts/ui/inputs/validation/script-param-validation.js +6 -0
  90. package/scripts/ui/inputs/validation/visible-enabled.js +9 -0
  91. package/scripts/ui/interactivity/drag-and-drop.js +3 -3
  92. package/scripts/ui/tooltips/tooltips.js +6 -2
  93. package/scripts/ui/viewers/advanced/attached-properties.js +5 -5
  94. package/scripts/ui/viewers/advanced/default-axis-type.js +1 -1
  95. package/scripts/ui/viewers/advanced/init-function.js +21 -0
  96. package/scripts/ui/viewers/advanced/init-script.js +15 -0
  97. package/scripts/ui/viewers/filters/add-single-filter.js +5 -5
  98. package/scripts/ui/viewers/filters/custom-filters.js +3 -3
  99. package/scripts/ui/viewers/filters/filter-group.js +6 -1
  100. package/scripts/ui/viewers/filters/multi-value-filter.js +1 -1
  101. package/scripts/ui/viewers/js viewers/chord-viewer.js +1 -1
  102. package/scripts/ui/viewers/js viewers/sankey-viewer.js +1 -1
  103. package/scripts/ui/viewers/js viewers/word-cloud.js +1 -1
  104. package/scripts/ui/viewers/scatter-plot-events.js +6 -1
  105. package/scripts/ui/viewers/trellis-plot-with-summary-viewer.js +3 -1
  106. package/scripts/ui/viewers/types/markup-advanced.js +1 -1
  107. package/scripts/ui/viewers/types/trellis-plot.js +13 -1
  108. package/scripts/ui/viewers/types/word-cloud.js +1 -1
  109. package/scripts/ui/views/default-views.js +3 -3
  110. package/scripts/ui/views/layouts.js +16 -17
  111. package/scripts/ui/views/multi-view.js +1 -1
  112. package/src/global.d.ts +13 -0
  113. package/src/package-test.ts +106 -16
  114. package/webpack.config.js +4 -1
  115. package/files.js +0 -39
  116. package/scripts/misc/user-data-storage.js +0 -49
  117. /package/scripts/scripting/{scripting.js → package-scripting.js} +0 -0
  118. /package/{scripts/ui/handlers → to fix}/dynamic-loading.js +0 -0
@@ -0,0 +1 @@
1
+ grok.shell.info(args.args.matchConditionStr);
@@ -0,0 +1 @@
1
+ grok.shell.info('Clicked on ' + args.data.cell.column.name + ' : ' + args.data.cell.rowIndex)
@@ -0,0 +1 @@
1
+ grok.shell.info('Clicked on ' + args.args.rowId);
@@ -0,0 +1 @@
1
+ grok.shell.info(args.args.matchConditionStr);
@@ -0,0 +1 @@
1
+ grok.shell.o = ui.divText('Clicked on ' + args.rowId);
@@ -0,0 +1 @@
1
+ args.sender.canvas.getContext('2d').fillText('foo', 100, 100);
@@ -1,236 +1,384 @@
1
1
  {
2
2
  "#type": "ViewLayout",
3
- "type": "TableView",
4
- "friendlyName": "demog-table-layout",
5
3
  "viewStateMap": {
6
4
  "containerType": "horizontal",
7
5
  "state": {
8
- "width": 1105,
9
- "height": 860
6
+ "width": 1179,
7
+ "height": 924
10
8
  },
11
9
  "children": [
12
10
  {
13
- "containerType": "horizontal",
11
+ "containerType": "vertical",
14
12
  "state": {
15
- "width": 711,
16
- "height": 860
13
+ "width": 388,
14
+ "height": 924
17
15
  },
18
16
  "children": [
19
17
  {
20
- "containerType": "panel",
21
- "state": {
22
- "width": 357,
23
- "height": 860,
24
- "element": {
25
- "id": "ea7539b0-3260-11e9-a856-271c562d1aaf",
26
- "type": "Bar chart",
27
- "look": {
28
- "splitColumnName": "DIS_POP",
29
- "valueAggrType": "avg",
30
- "valueColumnName": "AGE"
31
- }
32
- }
33
- },
34
- "children": [
35
-
36
- ]
37
- },
38
- {
39
- "containerType": "vertical",
18
+ "containerType": "fill",
40
19
  "state": {
41
- "width": 345,
42
- "height": 860
20
+ "width": 388,
21
+ "height": 458,
22
+ "documentManager": true
43
23
  },
44
24
  "children": [
45
- {
46
- "containerType": "fill",
47
- "state": {
48
- "width": 345,
49
- "height": 421,
50
- "documentManager": true
51
- },
52
- "children": [
53
- {
54
- "containerType": "panel",
55
- "state": {
56
- "width": 345,
57
- "height": 421,
58
- "element": {
59
- "id": "ea75aee0-3260-11e9-cd55-27767803c24d",
60
- "type": "Grid",
61
- "look": {
62
- "#type": "HeatMapLook",
63
- "allowColumnMenu": true,
64
- "topLevelDefaultMenu": true,
65
- "columns": [
66
- {
67
- "width": 78,
68
- "columnName": "USUBJID",
69
- "cellType": "string"
70
- },
71
- {
72
- "width": 51,
73
- "columnName": "AGE",
74
- "cellType": "number"
75
- },
76
- {
77
- "width": 60,
78
- "columnName": "SEX",
79
- "cellType": "string"
80
- },
81
- {
82
- "width": 60,
83
- "columnName": "RACE",
84
- "cellType": "string"
85
- },
86
- {
87
- "width": 76,
88
- "columnName": "DIS_POP",
89
- "cellType": "string"
90
- },
91
- {
92
- "width": 71,
93
- "columnName": "HEIGHT",
94
- "cellType": "number"
95
- },
96
- {
97
- "width": 73,
98
- "columnName": "WEIGHT",
99
- "cellType": "number"
100
- },
101
- {
102
- "width": 69,
103
- "columnName": "DEMOG",
104
- "cellType": "string"
105
- },
106
- {
107
- "width": 78,
108
- "columnName": "STUDYID",
109
- "cellType": "string"
110
- },
111
- {
112
- "width": 64,
113
- "columnName": "SITEID",
114
- "cellType": "number"
115
- },
116
- {
117
- "width": 69,
118
- "columnName": "SUBJID",
119
- "cellType": "number"
120
- },
121
- {
122
- "width": 84,
123
- "columnName": "SITESUBJ",
124
- "cellType": "string"
125
- },
126
- {
127
- "width": 86,
128
- "columnName": "UNIQUE_P",
129
- "cellType": "string"
130
- }
131
- ]
132
- }
133
- }
134
- },
135
- "children": [
136
-
137
- ]
138
- }
139
- ]
140
- },
141
25
  {
142
26
  "containerType": "panel",
143
27
  "state": {
144
- "width": 345,
145
- "height": 430,
28
+ "width": 388,
29
+ "height": 458,
146
30
  "element": {
147
- "id": "ea762410-3260-11e9-e56d-114895ca4284",
148
- "type": "Scatter plot",
31
+ "id": "5e4b4aa0-73f0-11ef-859d-9fc5c455bfff",
32
+ "type": "Grid",
149
33
  "look": {
150
- "xColumnName": "WEIGHT",
151
- "yColumnName": "HEIGHT",
152
- "colorColumnName": "SEX",
153
- "markerMinSize": 3.0,
154
- "markerMaxSize": 20.0
155
- }
34
+ "#type": "GridLook",
35
+ "showAddNewRowIcon": true,
36
+ "addNewRowOnLastRowEdit": true,
37
+ "topLevelDefaultMenu": true,
38
+ "allowColumnMenu": true,
39
+ "columns": [
40
+ {
41
+ "width": 52,
42
+ "backgroundColor": 4294440951,
43
+ "customName": "",
44
+ "cellType": "row header",
45
+ "headerCellStyle": {
46
+ "textWrap": "words"
47
+ }
48
+ },
49
+ {
50
+ "width": 67,
51
+ "columnName": "subj",
52
+ "cellType": "number",
53
+ "headerCellStyle": {
54
+ "textWrap": "words"
55
+ }
56
+ },
57
+ {
58
+ "width": 69,
59
+ "columnName": "study",
60
+ "headerCellStyle": {
61
+ "textWrap": "words"
62
+ }
63
+ },
64
+ {
65
+ "width": 91,
66
+ "columnName": "site",
67
+ "headerCellStyle": {
68
+ "textWrap": "words"
69
+ }
70
+ },
71
+ {
72
+ "width": 53,
73
+ "columnName": "age",
74
+ "cellType": "number",
75
+ "headerCellStyle": {
76
+ "textWrap": "words"
77
+ }
78
+ },
79
+ {
80
+ "width": 45,
81
+ "columnName": "sex",
82
+ "headerCellStyle": {
83
+ "textWrap": "words"
84
+ }
85
+ },
86
+ {
87
+ "width": 81,
88
+ "columnName": "race",
89
+ "headerCellStyle": {
90
+ "textWrap": "words"
91
+ }
92
+ },
93
+ {
94
+ "width": 84,
95
+ "columnName": "disease",
96
+ "headerCellStyle": {
97
+ "textWrap": "words"
98
+ }
99
+ },
100
+ {
101
+ "width": 126,
102
+ "columnName": "started",
103
+ "cellType": "number",
104
+ "format": "M/d/yyyy HH:mm",
105
+ "headerCellStyle": {
106
+ "textWrap": "words"
107
+ }
108
+ },
109
+ {
110
+ "width": 62,
111
+ "columnName": "height",
112
+ "cellType": "number",
113
+ "headerCellStyle": {
114
+ "textWrap": "words"
115
+ }
116
+ },
117
+ {
118
+ "width": 64,
119
+ "columnName": "weight",
120
+ "cellType": "number",
121
+ "headerCellStyle": {
122
+ "textWrap": "words"
123
+ }
124
+ }
125
+ ]
126
+ },
127
+ "title": "demog 10000 (2)",
128
+ "default": true
156
129
  }
157
130
  },
158
- "children": [
159
-
160
- ]
131
+ "children": []
161
132
  }
162
133
  ]
134
+ },
135
+ {
136
+ "containerType": "panel",
137
+ "state": {
138
+ "width": 388,
139
+ "height": 465,
140
+ "element": {
141
+ "id": "5e4b98c0-73f0-11ef-a6c3-3dffd3dd25f7",
142
+ "type": "Bar chart",
143
+ "look": {
144
+ "#type": "BarChartLook",
145
+ "valueColumnName": "subj",
146
+ "valueAggrType": "count",
147
+ "barSortType": "by value",
148
+ "barSortOrder": "desc",
149
+ "splitColumnName": "study"
150
+ },
151
+ "title": "Bar chart"
152
+ }
153
+ },
154
+ "children": []
163
155
  }
164
156
  ]
165
157
  },
166
158
  {
167
159
  "containerType": "vertical",
168
160
  "state": {
169
- "width": 385,
170
- "height": 860
161
+ "width": 392,
162
+ "height": 924
171
163
  },
172
164
  "children": [
173
165
  {
174
166
  "containerType": "panel",
175
167
  "state": {
176
- "width": 385,
177
- "height": 425,
168
+ "width": 392,
169
+ "height": 458,
178
170
  "element": {
179
- "id": "ea764b20-3260-11e9-a7c0-a1f07a947fad",
180
- "type": "Line chart",
171
+ "id": "5e4c0df0-73f0-11ef-e0a3-a562420fbeb0",
172
+ "type": "Scatter plot",
181
173
  "look": {
182
- "xColumnName": "AGE",
183
- "yColumnNames": [
184
- "STARTED",
185
- "HEIGHT",
186
- "WEIGHT"
187
- ],
188
- "yAggrTypes": [
189
- "avg",
190
- "avg",
191
- "avg"
192
- ],
193
- "overviewColumnName": "HEIGHT",
194
- "chartTypes": [
195
- "Line Chart",
196
- "Line Chart",
197
- "Line Chart"
198
- ]
199
- }
174
+ "#type": "ScatterPlotLook",
175
+ "xColumnName": "subj",
176
+ "yColumnName": "weight",
177
+ "markerMinSize": 3,
178
+ "markerMaxSize": 20,
179
+ "viewport": ""
180
+ },
181
+ "title": "Scatter plot"
200
182
  }
201
183
  },
202
- "children": [
203
-
204
- ]
184
+ "children": []
205
185
  },
206
186
  {
207
187
  "containerType": "panel",
208
188
  "state": {
209
- "width": 385,
210
- "height": 426,
189
+ "width": 392,
190
+ "height": 465,
211
191
  "element": {
212
- "id": "ea767230-3260-11e9-8324-3762815e7b42",
192
+ "id": "5e4c3500-73f0-11ef-98ef-4fdbd1d36b1e",
213
193
  "type": "Histogram",
214
194
  "look": {
215
- "valueColumnName": "AGE",
195
+ "#type": "HistogramLook",
196
+ "valueColumnName": "subj",
216
197
  "showXAxis": true,
217
198
  "showYAxis": true,
199
+ "binWidthRatio": 0.9,
218
200
  "marginLeft": 5,
219
- "marginRight": 5,
220
- "binWidthRatio": 1.0
221
- }
201
+ "marginRight": 5
202
+ },
203
+ "title": "Histogram"
222
204
  }
223
205
  },
224
- "children": [
225
-
226
- ]
206
+ "children": []
227
207
  }
228
208
  ]
209
+ },
210
+ {
211
+ "containerType": "panel",
212
+ "state": {
213
+ "width": 397,
214
+ "height": 924,
215
+ "element": {
216
+ "id": "5e4c8320-73f0-11ef-e112-635ed7bdd8d4",
217
+ "type": "Line chart",
218
+ "look": {
219
+ "#type": "LineChartLook",
220
+ "overviewColumnName": "subj",
221
+ "yAggrTypes": [
222
+ "avg",
223
+ "avg",
224
+ "avg",
225
+ "avg"
226
+ ],
227
+ "xColumnName": "started",
228
+ "yColumnNames": [
229
+ "subj",
230
+ "age",
231
+ "height",
232
+ "weight"
233
+ ],
234
+ "chartTypes": [
235
+ "Line Chart",
236
+ "Line Chart",
237
+ "Line Chart",
238
+ "Line Chart"
239
+ ]
240
+ },
241
+ "title": "Line chart"
242
+ }
243
+ },
244
+ "children": []
245
+ }
246
+ ],
247
+ "floating": [],
248
+ "tableId": "e472f840-73f0-11ef-ee87-7934cb77edb3",
249
+ "tableName": "demog 10000 (2)"
250
+ },
251
+ "columns": [
252
+ {
253
+ "name": "subj",
254
+ "type": "int",
255
+ "id": "e4a552e0-73f0-11ef-b844-2f9b4fd8b126",
256
+ "friendlyName": "Subj",
257
+ "entityTags": [
258
+ {
259
+ "tag": ".semantic-detection-duration",
260
+ "id": "5e4cf850-73f0-11ef-fedb-8973c5a5470d"
261
+ },
262
+ {
263
+ "tag": ".id",
264
+ "id": "5e4cf850-73f0-11ef-fc64-21c49cfe3941"
265
+ }
266
+ ],
267
+ "metaParams": {
268
+ ".semantic-detection-duration": "6",
269
+ ".id": "e4a552e0-73f0-11ef-b844-2f9b4fd8b126"
270
+ }
271
+ },
272
+ {
273
+ "name": "weight",
274
+ "type": "double",
275
+ "id": "e4a63d40-73f0-11ef-e8b2-c9546f2bcbf1",
276
+ "friendlyName": "Weight",
277
+ "entityTags": [
278
+ {
279
+ "tag": ".semantic-detection-duration",
280
+ "id": "5e4cf850-73f0-11ef-eb6c-4338acf4995d"
281
+ },
282
+ {
283
+ "tag": ".id",
284
+ "id": "5e4cf850-73f0-11ef-edac-65c054d65874"
285
+ }
286
+ ],
287
+ "metaParams": {
288
+ ".semantic-detection-duration": "3",
289
+ ".id": "e4a63d40-73f0-11ef-e8b2-c9546f2bcbf1"
290
+ }
291
+ },
292
+ {
293
+ "name": "study",
294
+ "type": "string",
295
+ "id": "e4a5a100-73f0-11ef-9bba-c51db608fbae",
296
+ "friendlyName": "Study",
297
+ "entityTags": [
298
+ {
299
+ "tag": ".semantic-detection-duration",
300
+ "id": "5e4d1f60-73f0-11ef-8235-990a286d480b"
301
+ },
302
+ {
303
+ "tag": ".id",
304
+ "id": "5e4d1f60-73f0-11ef-e437-1dab9d754843"
305
+ }
306
+ ],
307
+ "metaParams": {
308
+ ".semantic-detection-duration": "7",
309
+ ".id": "e4a5a100-73f0-11ef-9bba-c51db608fbae"
310
+ }
311
+ },
312
+ {
313
+ "name": "started",
314
+ "type": "datetime",
315
+ "id": "e4a61630-73f0-11ef-9017-bbfa182cefa3",
316
+ "friendlyName": "Started",
317
+ "entityTags": [
318
+ {
319
+ "tag": "format",
320
+ "id": "5e4d1f60-73f0-11ef-f02b-e5abbf87a6fe"
321
+ },
322
+ {
323
+ "tag": ".semantic-detection-duration",
324
+ "id": "5e4d1f60-73f0-11ef-d5c7-dfffe8f9e393"
325
+ },
326
+ {
327
+ "tag": ".id",
328
+ "id": "5e4d4670-73f0-11ef-8b41-9398f3a1c2e8"
329
+ }
330
+ ],
331
+ "metaParams": {
332
+ "format": "M/d/yyyy HH:mm",
333
+ ".semantic-detection-duration": "3",
334
+ ".id": "e4a61630-73f0-11ef-9017-bbfa182cefa3"
335
+ }
336
+ },
337
+ {
338
+ "name": "age",
339
+ "type": "int",
340
+ "id": "e4a5c810-73f0-11ef-ef44-559e14ace2fe",
341
+ "friendlyName": "Age",
342
+ "entityTags": [
343
+ {
344
+ "tag": ".semantic-detection-duration",
345
+ "id": "5e4d4670-73f0-11ef-d83e-355b6594a480"
346
+ },
347
+ {
348
+ "tag": ".id",
349
+ "id": "5e4d4670-73f0-11ef-9c9c-db197c72f24a"
350
+ }
351
+ ],
352
+ "metaParams": {
353
+ ".semantic-detection-duration": "4",
354
+ ".id": "e4a5c810-73f0-11ef-ef44-559e14ace2fe"
355
+ }
356
+ },
357
+ {
358
+ "name": "height",
359
+ "type": "double",
360
+ "id": "e4a61630-73f0-11ef-c0ec-2f427a1bfca3",
361
+ "friendlyName": "Height",
362
+ "entityTags": [
363
+ {
364
+ "tag": ".semantic-detection-duration",
365
+ "id": "5e4d4670-73f0-11ef-d764-397f62213e64"
366
+ },
367
+ {
368
+ "tag": ".id",
369
+ "id": "5e4d6d80-73f0-11ef-98f2-2da90a140b07"
370
+ }
371
+ ],
372
+ "metaParams": {
373
+ ".semantic-detection-duration": "3",
374
+ ".id": "e4a61630-73f0-11ef-c0ec-2f427a1bfca3"
229
375
  }
230
- ]
376
+ }
377
+ ],
378
+ "name": "DemogTableLayout",
379
+ "friendlyName": "DemogTableLayout",
380
+ "author": {
381
+ "id": "f7c9fb10-fec0-11ee-829a-bd6a1fb43c6f"
231
382
  },
232
- "id": "e17b4620-bd30-11e8-ee69-3f240ada768a",
233
- "createdOn": "2019-04-04T12:15:34.056116Z",
234
- "updatedOn": "2019-04-04T12:19:41.302899Z",
235
- "name": "DemogTableLayout"
236
- }
383
+ "createdOn": "2024-10-04T12:37:07.782Z"
384
+ }
package/package.json CHANGED
@@ -1,18 +1,18 @@
1
1
  {
2
2
  "name": "@datagrok/api-samples",
3
- "version": "1.0.8",
3
+ "version": "1.0.12",
4
4
  "author": {
5
- "name": "Anna Muzychyna",
6
- "email": "amuzychyna@datagrok.ai"
5
+ "name": "Savenko Stanislav",
6
+ "email": "ssavenko@datagrok.ai"
7
7
  },
8
8
  "servicePackage": true,
9
9
  "dependencies": {
10
- "@datagrok-libraries/utils": "^4.1.19",
10
+ "@datagrok-libraries/utils": "^4.3.0",
11
11
  "cash-dom": "^8.1.1",
12
- "datagrok-api": "^1.17.2",
13
- "dayjs": "latest",
12
+ "datagrok-api": "^1.21.1",
13
+ "dayjs": "^1.11.13",
14
14
  "rxjs": "^6.6.7",
15
- "wu": "latest"
15
+ "wu": "^2.1.0"
16
16
  },
17
17
  "devDependencies": {
18
18
  "@types/wu": "^2.1.42",
@@ -20,18 +20,20 @@
20
20
  "@typescript-eslint/parser": "^5.26.0",
21
21
  "eslint": "^8.16.0",
22
22
  "eslint-config-google": "^0.14.0",
23
- "root-require": "latest",
23
+ "root-require": "^0.3.1",
24
24
  "ts-loader": "^9.2.6",
25
25
  "typescript": "^4.4.4",
26
26
  "webpack": "^5.59.1",
27
27
  "webpack-cli": "^4.9.1",
28
- "@datagrok/chem": "latest",
29
- "@datagrok/clinical-case": "latest",
30
- "@datagrok/power-grid": "latest",
31
- "@datagrok/usage-analysis": "latest",
32
- "@datagrok/charts": "latest",
33
- "@datagrok/chembl": "latest",
34
- "@datagrok/samples": "latest"
28
+ "@datagrok/bio": "^2.15.0",
29
+ "@datagrok/chem": "^1.12.0",
30
+ "@datagrok/helm": "^2.5.0",
31
+ "@datagrok/clinical-case": "^1.1.0",
32
+ "@datagrok/power-grid": "^1.4.0",
33
+ "@datagrok/usage-analysis": "^2.1.0",
34
+ "@datagrok/charts": "^1.4.0",
35
+ "@datagrok/chembl": "^1.1.4",
36
+ "@datagrok/samples": "^1.0.4"
35
37
  },
36
38
  "friendlyName": "API Samples",
37
39
  "description": "API Samples",
@@ -0,0 +1,40 @@
1
+ //tags: FileInfo
2
+ //help-url: https://datagrok.ai/help/develop/how-to/access-data
3
+ // JS API methods for working with files
4
+
5
+ (async () => {
6
+
7
+ let res = null;
8
+
9
+ // Write files
10
+ await grok.dapi.files.write('System:AppData/Samples/testFile.dat', [0, 1, 2]);
11
+ await grok.dapi.files.writeAsText('System:AppData/Samples/testFile.txt', 'testString');
12
+
13
+ // Rename
14
+ await grok.dapi.files.writeAsText('System:AppData/Samples/forRename.txt', 'testString');
15
+ await grok.dapi.files.rename('System:AppData/Samples/forRename.txt', 'renamed.txt');
16
+
17
+ // Read files
18
+ res = await grok.dapi.files.readAsBytes('System:AppData/Samples/testFile.dat');
19
+ console.log(`readAsBytes: ${res}`);
20
+ res = await grok.dapi.files.readAsText('System:AppData/Samples/testFile.txt');
21
+ console.log(`readAsText: ${res}`);
22
+ res = await grok.dapi.files.exists('System:AppData/Samples/testFile.dat');
23
+ console.log(`testFile.dat exists: ${res}`);
24
+
25
+ // Search files
26
+ let recursive = true;
27
+ let searchPattern = 'test';
28
+ res = await grok.dapi.files.list('System:AppData/Samples/', recursive, searchPattern);
29
+ console.log(`list: ${res}`);
30
+
31
+ // Move files
32
+ await grok.dapi.files.move(['System:AppData/Samples/testFile.txt'], 'Samples/geo');
33
+ res = await grok.dapi.files.exists('System:AppData/Samples/geo/testFile.txt');
34
+ console.log(`testFile.txt was moved to geo: ${res}`);
35
+
36
+ // Delete files
37
+ await grok.dapi.files.delete('System:AppData/Samples/geo/testFile.txt');
38
+ await grok.dapi.files.delete('System:AppData/Samples/testFile.dat');
39
+ await grok.dapi.files.delete('System:AppData/Samples/renamed.txt');
40
+ })();