@datagrok/api-samples 1.0.5 → 1.0.6
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/README.md +5 -3
- package/dist/package-test.js +2 -519
- package/dist/package.js +2 -30
- package/layouts/demog-table-layout.json +236 -0
- package/package.json +2 -7
- package/scripts/data-access/db/db-edit.js +27 -0
- package/scripts/data-access/dynamic-query.js +13 -0
- package/scripts/data-access/output-layouts.js +5 -0
- package/scripts/data-frame/events/calculated-columns/update.js +1 -1
- package/scripts/data-frame/join-link/join-tables.js +5 -6
- package/scripts/misc/paint/paint.js +14 -0
- package/scripts/misc/utils/hide-empty-columns.js +6 -0
- package/scripts/shell/current-object.js +1 -1
- package/scripts/ui/components/balloons.js +6 -0
- package/scripts/ui/components/breadcrumbs.js +4 -0
- package/scripts/ui/components/drop-down.js +7 -0
- package/scripts/ui/docking/README.md +3 -3
- package/scripts/ui/elements/inputs/tags-input.js +12 -0
- package/scripts/ui/elements/inputs/typeahead-input.js +8 -0
- package/scripts/ui/handlers/handlers.js +1 -1
- package/scripts/ui/layouts/templates/2 Column.js +1 -1
- package/scripts/ui/layouts/templates/3 Column.js +1 -1
- package/scripts/ui/layouts/templates/Flex box.js +1 -1
- package/scripts/ui/layouts/templates/Fluid layout.js +1 -1
- package/scripts/ui/layouts/templates/Gallery grid.js +1 -1
- package/scripts/ui/layouts/templates/Splitter (1 Column 2 Row).js +1 -1
- package/scripts/ui/layouts/templates/Splitter (2 Column).js +1 -1
- package/scripts/ui/layouts/templates/Splitter (2 Row).js +1 -1
- package/scripts/ui/layouts/templates/Splitter (2-3 Column).js +1 -1
- package/scripts/ui/layouts/templates/Tabs 2 column.js +1 -1
- package/scripts/ui/layouts/templates/Tabs navbar.js +1 -1
- package/scripts/ui/viewers/advanced/sketch-form.js +9 -0
- package/scripts/ui/viewers/filters/custom-filters.js +8 -3
- package/scripts/ui/viewers/types/form-advanced.js +7 -0
- package/scripts/ux/Interactivity/hints.js +20 -17
- package/scripts/ux/Interactivity/wizard-hints.js +15 -0
- package/scripts/ux/Layouts/example-1.js +2 -2
- package/scripts/ux/Layouts/example-2.js +2 -2
- package/scripts/ux/Layouts/example-3.js +2 -2
- package/scripts/ux/Layouts/example-4.js +2 -2
- package/scripts/ux/Views/property-panel.js +2 -2
- package/scripts/ux/Views/toolbar.js +3 -18
- package/tsconfig.json +1 -1
package/dist/package.js
CHANGED
|
@@ -1,30 +1,2 @@
|
|
|
1
|
-
var apisamples;
|
|
2
|
-
|
|
3
|
-
/******/ "use strict";
|
|
4
|
-
/******/ // The require scope
|
|
5
|
-
/******/ var __webpack_require__ = {};
|
|
6
|
-
/******/
|
|
7
|
-
/************************************************************************/
|
|
8
|
-
/******/ /* webpack/runtime/make namespace object */
|
|
9
|
-
/******/ (() => {
|
|
10
|
-
/******/ // define __esModule on exports
|
|
11
|
-
/******/ __webpack_require__.r = (exports) => {
|
|
12
|
-
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
13
|
-
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
14
|
-
/******/ }
|
|
15
|
-
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
|
16
|
-
/******/ };
|
|
17
|
-
/******/ })();
|
|
18
|
-
/******/
|
|
19
|
-
/************************************************************************/
|
|
20
|
-
var __webpack_exports__ = {};
|
|
21
|
-
/*!************************!*\
|
|
22
|
-
!*** ./src/package.ts ***!
|
|
23
|
-
\************************/
|
|
24
|
-
__webpack_require__.r(__webpack_exports__);
|
|
25
|
-
|
|
26
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGFja2FnZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbInBhY2thZ2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsInNvdXJjZXNDb250ZW50IjpbIi8qIERvIG5vdCBjaGFuZ2UgdGhlc2UgaW1wb3J0IGxpbmVzLiBEYXRhZ3JvayB3aWxsIGltcG9ydCBBUEkgbGlicmFyeSBpbiBleGFjdGx5IHRoZSBzYW1lIG1hbm5lciAqL1xuaW1wb3J0ICogYXMgZ3JvayBmcm9tICdkYXRhZ3Jvay1hcGkvZ3Jvayc7XG5pbXBvcnQgKiBhcyB1aSBmcm9tICdkYXRhZ3Jvay1hcGkvdWknO1xuaW1wb3J0ICogYXMgREcgZnJvbSAnZGF0YWdyb2stYXBpL2RnJztcbiJdfQ==
|
|
27
|
-
apisamples = __webpack_exports__;
|
|
28
|
-
/******/ })()
|
|
29
|
-
;
|
|
30
|
-
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGFja2FnZS5qcyIsIm1hcHBpbmdzIjoiOzs7VUFBQTtVQUNBOzs7OztXQ0RBO1dBQ0E7V0FDQTtXQUNBLHVEQUF1RCxpQkFBaUI7V0FDeEU7V0FDQSxnREFBZ0QsYUFBYTtXQUM3RDs7Ozs7Ozs7O0FDTlU7QUFDViwyQ0FBMkMsdWQiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9hcGlzYW1wbGVzL3dlYnBhY2svYm9vdHN0cmFwIiwid2VicGFjazovL2FwaXNhbXBsZXMvd2VicGFjay9ydW50aW1lL21ha2UgbmFtZXNwYWNlIG9iamVjdCIsIndlYnBhY2s6Ly9hcGlzYW1wbGVzLy4vc3JjL3BhY2thZ2UudHMiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gVGhlIHJlcXVpcmUgc2NvcGVcbnZhciBfX3dlYnBhY2tfcmVxdWlyZV9fID0ge307XG5cbiIsIi8vIGRlZmluZSBfX2VzTW9kdWxlIG9uIGV4cG9ydHNcbl9fd2VicGFja19yZXF1aXJlX18uciA9IChleHBvcnRzKSA9PiB7XG5cdGlmKHR5cGVvZiBTeW1ib2wgIT09ICd1bmRlZmluZWQnICYmIFN5bWJvbC50b1N0cmluZ1RhZykge1xuXHRcdE9iamVjdC5kZWZpbmVQcm9wZXJ0eShleHBvcnRzLCBTeW1ib2wudG9TdHJpbmdUYWcsIHsgdmFsdWU6ICdNb2R1bGUnIH0pO1xuXHR9XG5cdE9iamVjdC5kZWZpbmVQcm9wZXJ0eShleHBvcnRzLCAnX19lc01vZHVsZScsIHsgdmFsdWU6IHRydWUgfSk7XG59OyIsImV4cG9ydCB7fTtcbi8vIyBzb3VyY2VNYXBwaW5nVVJMPWRhdGE6YXBwbGljYXRpb24vanNvbjtiYXNlNjQsZXlKMlpYSnphVzl1SWpvekxDSm1hV3hsSWpvaWNHRmphMkZuWlM1cWN5SXNJbk52ZFhKalpWSnZiM1FpT2lJaUxDSnpiM1Z5WTJWeklqcGJJbkJoWTJ0aFoyVXVkSE1pWFN3aWJtRnRaWE1pT2x0ZExDSnRZWEJ3YVc1bmN5STZJaUlzSW5OdmRYSmpaWE5EYjI1MFpXNTBJanBiSWk4cUlFUnZJRzV2ZENCamFHRnVaMlVnZEdobGMyVWdhVzF3YjNKMElHeHBibVZ6TGlCRVlYUmhaM0p2YXlCM2FXeHNJR2x0Y0c5eWRDQkJVRWtnYkdsaWNtRnllU0JwYmlCbGVHRmpkR3g1SUhSb1pTQnpZVzFsSUcxaGJtNWxjaUFxTDF4dWFXMXdiM0owSUNvZ1lYTWdaM0p2YXlCbWNtOXRJQ2RrWVhSaFozSnZheTFoY0drdlozSnZheWM3WEc1cGJYQnZjblFnS2lCaGN5QjFhU0JtY205dElDZGtZWFJoWjNKdmF5MWhjR2t2ZFdrbk8xeHVhVzF3YjNKMElDb2dZWE1nUkVjZ1puSnZiU0FuWkdGMFlXZHliMnN0WVhCcEwyUm5KenRjYmlKZGZRPT0iXSwibmFtZXMiOltdLCJzb3VyY2VSb290IjoiIn0=
|
|
1
|
+
var apisamples;(()=>{"use strict";var e={};(e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})})(e),apisamples=e})();
|
|
2
|
+
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGFja2FnZS5qcyIsIm1hcHBpbmdzIjoia0NBQ0EsSSxLQ0F3QixDQUFDQSxJQUNILG9CQUFYQyxRQUEwQkEsT0FBT0MsYUFDMUNDLE9BQU9DLGVBQWVKLEVBQVNDLE9BQU9DLFlBQWEsQ0FBRUcsTUFBTyxXQUU3REYsT0FBT0MsZUFBZUosRUFBUyxhQUFjLENBQUVLLE9BQU8sR0FBTyxFIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vYXBpc2FtcGxlcy93ZWJwYWNrL2Jvb3RzdHJhcCIsIndlYnBhY2s6Ly9hcGlzYW1wbGVzL3dlYnBhY2svcnVudGltZS9tYWtlIG5hbWVzcGFjZSBvYmplY3QiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gVGhlIHJlcXVpcmUgc2NvcGVcbnZhciBfX3dlYnBhY2tfcmVxdWlyZV9fID0ge307XG5cbiIsIi8vIGRlZmluZSBfX2VzTW9kdWxlIG9uIGV4cG9ydHNcbl9fd2VicGFja19yZXF1aXJlX18uciA9IChleHBvcnRzKSA9PiB7XG5cdGlmKHR5cGVvZiBTeW1ib2wgIT09ICd1bmRlZmluZWQnICYmIFN5bWJvbC50b1N0cmluZ1RhZykge1xuXHRcdE9iamVjdC5kZWZpbmVQcm9wZXJ0eShleHBvcnRzLCBTeW1ib2wudG9TdHJpbmdUYWcsIHsgdmFsdWU6ICdNb2R1bGUnIH0pO1xuXHR9XG5cdE9iamVjdC5kZWZpbmVQcm9wZXJ0eShleHBvcnRzLCAnX19lc01vZHVsZScsIHsgdmFsdWU6IHRydWUgfSk7XG59OyJdLCJuYW1lcyI6WyJleHBvcnRzIiwiU3ltYm9sIiwidG9TdHJpbmdUYWciLCJPYmplY3QiLCJkZWZpbmVQcm9wZXJ0eSIsInZhbHVlIl0sInNvdXJjZVJvb3QiOiIifQ==
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
{
|
|
2
|
+
"#type": "ViewLayout",
|
|
3
|
+
"type": "TableView",
|
|
4
|
+
"friendlyName": "demog-table-layout",
|
|
5
|
+
"viewStateMap": {
|
|
6
|
+
"containerType": "horizontal",
|
|
7
|
+
"state": {
|
|
8
|
+
"width": 1105,
|
|
9
|
+
"height": 860
|
|
10
|
+
},
|
|
11
|
+
"children": [
|
|
12
|
+
{
|
|
13
|
+
"containerType": "horizontal",
|
|
14
|
+
"state": {
|
|
15
|
+
"width": 711,
|
|
16
|
+
"height": 860
|
|
17
|
+
},
|
|
18
|
+
"children": [
|
|
19
|
+
{
|
|
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",
|
|
40
|
+
"state": {
|
|
41
|
+
"width": 345,
|
|
42
|
+
"height": 860
|
|
43
|
+
},
|
|
44
|
+
"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
|
+
{
|
|
142
|
+
"containerType": "panel",
|
|
143
|
+
"state": {
|
|
144
|
+
"width": 345,
|
|
145
|
+
"height": 430,
|
|
146
|
+
"element": {
|
|
147
|
+
"id": "ea762410-3260-11e9-e56d-114895ca4284",
|
|
148
|
+
"type": "Scatter plot",
|
|
149
|
+
"look": {
|
|
150
|
+
"xColumnName": "WEIGHT",
|
|
151
|
+
"yColumnName": "HEIGHT",
|
|
152
|
+
"colorColumnName": "SEX",
|
|
153
|
+
"markerMinSize": 3.0,
|
|
154
|
+
"markerMaxSize": 20.0
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
},
|
|
158
|
+
"children": [
|
|
159
|
+
|
|
160
|
+
]
|
|
161
|
+
}
|
|
162
|
+
]
|
|
163
|
+
}
|
|
164
|
+
]
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
"containerType": "vertical",
|
|
168
|
+
"state": {
|
|
169
|
+
"width": 385,
|
|
170
|
+
"height": 860
|
|
171
|
+
},
|
|
172
|
+
"children": [
|
|
173
|
+
{
|
|
174
|
+
"containerType": "panel",
|
|
175
|
+
"state": {
|
|
176
|
+
"width": 385,
|
|
177
|
+
"height": 425,
|
|
178
|
+
"element": {
|
|
179
|
+
"id": "ea764b20-3260-11e9-a7c0-a1f07a947fad",
|
|
180
|
+
"type": "Line chart",
|
|
181
|
+
"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
|
+
}
|
|
200
|
+
}
|
|
201
|
+
},
|
|
202
|
+
"children": [
|
|
203
|
+
|
|
204
|
+
]
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
"containerType": "panel",
|
|
208
|
+
"state": {
|
|
209
|
+
"width": 385,
|
|
210
|
+
"height": 426,
|
|
211
|
+
"element": {
|
|
212
|
+
"id": "ea767230-3260-11e9-8324-3762815e7b42",
|
|
213
|
+
"type": "Histogram",
|
|
214
|
+
"look": {
|
|
215
|
+
"valueColumnName": "AGE",
|
|
216
|
+
"showXAxis": true,
|
|
217
|
+
"showYAxis": true,
|
|
218
|
+
"marginLeft": 5,
|
|
219
|
+
"marginRight": 5,
|
|
220
|
+
"binWidthRatio": 1.0
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
},
|
|
224
|
+
"children": [
|
|
225
|
+
|
|
226
|
+
]
|
|
227
|
+
}
|
|
228
|
+
]
|
|
229
|
+
}
|
|
230
|
+
]
|
|
231
|
+
},
|
|
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
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@datagrok/api-samples",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6",
|
|
4
4
|
"author": {
|
|
5
5
|
"name": "Alexander Paramonov",
|
|
6
6
|
"email": "aparamonov@datagrok.ai"
|
|
@@ -20,16 +20,11 @@
|
|
|
20
20
|
"datagrok-tools": "^4.7.2",
|
|
21
21
|
"eslint": "^8.16.0",
|
|
22
22
|
"eslint-config-google": "^0.14.0",
|
|
23
|
-
"@types/js-yaml": "^4.0.5",
|
|
24
|
-
"js-yaml": "^4.1.0",
|
|
25
|
-
"puppeteer": "^13.7.0",
|
|
26
23
|
"root-require": "latest",
|
|
27
24
|
"ts-loader": "^9.2.6",
|
|
28
25
|
"typescript": "^4.4.4",
|
|
29
26
|
"webpack": "^5.59.1",
|
|
30
|
-
"webpack-cli": "^4.9.1"
|
|
31
|
-
"@types/node-fetch": "^2.6.2",
|
|
32
|
-
"node-fetch": "^2.6.7"
|
|
27
|
+
"webpack-cli": "^4.9.1"
|
|
33
28
|
},
|
|
34
29
|
"friendlyName": "API Samples",
|
|
35
30
|
"description": "API Samples",
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// Real-time updates in the DB as you edit the table
|
|
2
|
+
|
|
3
|
+
const dbEdit = (t) => {
|
|
4
|
+
const dbTableName = t.tags['DbTable'];
|
|
5
|
+
const dbIdColumnName = 'id';
|
|
6
|
+
|
|
7
|
+
let v = grok.shell.addTableView(t);
|
|
8
|
+
v.grid.onCellValueEdited.subscribe((c) => {
|
|
9
|
+
const idColumnName = 'id'
|
|
10
|
+
const dbColumnName = c.cell.column.tags['DbColumn'];
|
|
11
|
+
const sql =
|
|
12
|
+
'update ' + dbTableName +
|
|
13
|
+
' set ' + dbColumnName + " = '" + c.cell.value + "'" +
|
|
14
|
+
' where ' + dbIdColumnName + " = '" + c.cell.row.get(idColumnName) + "'";
|
|
15
|
+
|
|
16
|
+
grok.shell.info('Executing ' + sql);
|
|
17
|
+
|
|
18
|
+
grok.data.db
|
|
19
|
+
.query('System:Datagrok', sql)
|
|
20
|
+
.then(r => grok.shell.info('Success!'))
|
|
21
|
+
.catch(e => grok.shell.error(e));
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
grok.data.db
|
|
26
|
+
.query('System:Datagrok', 'select * from models')
|
|
27
|
+
.then(dbEdit);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// Creating a dynamic query and getting data
|
|
2
|
+
|
|
3
|
+
// Get a connection. Also, you can use grok.dapi.connection to read it
|
|
4
|
+
let connection = await grok.functions.eval('System:Datagrok')
|
|
5
|
+
|
|
6
|
+
// Create a query
|
|
7
|
+
let q = connection.query('query name', 'select 1 as hello_world');
|
|
8
|
+
|
|
9
|
+
// Get data
|
|
10
|
+
let data = await q.apply();
|
|
11
|
+
|
|
12
|
+
// Add to workspace
|
|
13
|
+
grok.shell.addTableView(data);
|
|
@@ -18,5 +18,5 @@ df.onMetadataChanged
|
|
|
18
18
|
}
|
|
19
19
|
});
|
|
20
20
|
|
|
21
|
-
// Change the formula either programmatically or from the interface (tab 'Formula' in the
|
|
21
|
+
// Change the formula either programmatically or from the interface (tab 'Formula' in the context panel)
|
|
22
22
|
col.tags[DG.TAGS.FORMULA] = 'Avg($[x])';
|
|
@@ -26,9 +26,8 @@ grok.shell.addTableView(t1);
|
|
|
26
26
|
grok.shell.addTableView(t2);
|
|
27
27
|
grok.shell.addTableView(tj);
|
|
28
28
|
|
|
29
|
-
// Join types:
|
|
30
|
-
//
|
|
31
|
-
//
|
|
32
|
-
//
|
|
33
|
-
//
|
|
34
|
-
// RIGHT
|
|
29
|
+
// Join types from JOIN_TYPE enum:
|
|
30
|
+
// INNER
|
|
31
|
+
// OUTER
|
|
32
|
+
// LEFT
|
|
33
|
+
// RIGHT
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Helper methods for rendering on canvas
|
|
2
|
+
|
|
3
|
+
const canvas = ui.canvas(200, 200);
|
|
4
|
+
|
|
5
|
+
const g = canvas.getContext("2d");
|
|
6
|
+
DG.Paint.horzAxis(g, 0, 100, 30, 170, 160, 30);
|
|
7
|
+
DG.Paint.vertAxis(g, 0, 100, 0, 10, 30, 160);
|
|
8
|
+
|
|
9
|
+
for (let i = 0; i < 100; i++)
|
|
10
|
+
DG.Paint.marker(g, DG.MARKER_TYPE.CIRCLE,
|
|
11
|
+
Math.random() * 160 + 30, Math.random() * 160 + 10,
|
|
12
|
+
DG.Color.filteredRows, 5);
|
|
13
|
+
|
|
14
|
+
canvas
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
const dropDown = ui.dropDown(ui.iconFA('plus'), () => ui.div('Element'));
|
|
2
|
+
const dropDown2 = ui.dropDown(ui.iconFA('minus'), () => ui.list(['Element 1', 'Element 2', 'Element 3']));
|
|
3
|
+
|
|
4
|
+
dropDown.onElementClick.subscribe(() => grok.shell.info('Element click'));
|
|
5
|
+
dropDown.onExpand.subscribe(() => grok.shell.info('expand event'));
|
|
6
|
+
|
|
7
|
+
grok.shell.newView('DropDown', [ui.ribbonPanel([dropDown.root, dropDown2.root])]);
|
|
@@ -5,12 +5,12 @@ could be either dragged out and positioned manually, or set up automatically.
|
|
|
5
5
|
|
|
6
6
|
## Top-level window docking
|
|
7
7
|
|
|
8
|
-
Use `grok.shell.dockManager` to dock, undock, or reposition windows.
|
|
9
|
-
See also `View.dockNode`
|
|
8
|
+
Use `grok.shell.dockManager` to dock, undock, or reposition windows.
|
|
9
|
+
See also `View.dockNode`
|
|
10
10
|
|
|
11
11
|
## Nested docking
|
|
12
12
|
|
|
13
13
|
Some of the views contain a nested docking manager, which allows to manage
|
|
14
14
|
windows within that particular view (they cannot be undocked and docked on
|
|
15
|
-
a top level, or within a different view). See `dockManager` property of the
|
|
15
|
+
a top level, or within a different view). See `dockManager` property of the
|
|
16
16
|
View class.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
const tagsInput = ui.tagsInput('Tags', ['Apps', 'Demo', 'Curves'], false);
|
|
2
|
+
|
|
3
|
+
tagsInput.addTag('New');
|
|
4
|
+
tagsInput.removeTag('Demo');
|
|
5
|
+
|
|
6
|
+
tagsInput.onTagAdded.subscribe((value) => grok.shell.info(`${value} tag was added.`));
|
|
7
|
+
tagsInput.onTagRemoved.subscribe((value) => grok.shell.info(`${value} tag was removed.`));
|
|
8
|
+
|
|
9
|
+
const tagsInput2 = ui.tagsInput('Tags', ['Apps2', 'Demo2', 'Curves2'], true);
|
|
10
|
+
tagsInput2.setTags(['Apps', 'Demo', 'Viewers', 'Tree']);
|
|
11
|
+
|
|
12
|
+
grok.shell.newView('TagsInput', [ui.form([tagsInput, tagsInput2])]);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
const typeAhead = ui.typeAhead('Countries', {source: {local: ['USA', 'Ukraine', 'Antigua', 'United Kingdom', 'United Arab Emirates']},
|
|
2
|
+
minLength: 2, limit: 3, hint: true, autoSelect: true, highlight: true, diacritics: true,
|
|
3
|
+
onSubmit: (event, value) => grok.shell.info(`The value is ${value?.label}`), debounceRemote: 100});
|
|
4
|
+
|
|
5
|
+
typeAhead.onInput(() => grok.shell.info('input event'));
|
|
6
|
+
typeAhead.onChanged(() => grok.shell.info('change event'));
|
|
7
|
+
|
|
8
|
+
grok.shell.newView('TypeAhead', [ui.ribbonPanel([typeAhead.root])]);
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
let windows = grok.shell.windows;
|
|
4
4
|
windows.showToolbox = false; //*hide tool box
|
|
5
|
-
windows.
|
|
5
|
+
windows.showContextPanel = false; //*hide context panel
|
|
6
6
|
|
|
7
7
|
let view = grok.shell.newView('2 Column', [
|
|
8
8
|
ui.block25(['Column 1 (25%)']),
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
let windows = grok.shell.windows;
|
|
4
4
|
windows.showToolbox = false; //*hide tool box
|
|
5
|
-
windows.
|
|
5
|
+
windows.showContextPanel = false; //*hide context panel
|
|
6
6
|
|
|
7
7
|
let view = grok.shell.newView('3 Column', [
|
|
8
8
|
ui.block50(['Column 1']),
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
let windows = grok.shell.windows;
|
|
4
4
|
windows.showToolbox = false; //*hide tool box
|
|
5
|
-
windows.
|
|
5
|
+
windows.showContextPanel = false; //*hide context panel
|
|
6
6
|
|
|
7
7
|
let view = grok.shell.newView('Fluid layout', [
|
|
8
8
|
ui.block25(['block 1']),
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
let windows = grok.shell.windows;
|
|
4
4
|
windows.showToolbox = false; //*hide tool box
|
|
5
|
-
windows.
|
|
5
|
+
windows.showContextPanel = false; //*hide context panel
|
|
6
6
|
|
|
7
7
|
let gallery = ui.divH([],'grok-gallery-grid');
|
|
8
8
|
for (let i =0; i<40; i++){
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
let windows = grok.shell.windows;
|
|
4
4
|
windows.showToolbox = false; //*hide tool box
|
|
5
|
-
windows.
|
|
5
|
+
windows.showContextPanel = false; //*hide context panel
|
|
6
6
|
|
|
7
7
|
let view = grok.shell.newView('1 Column - 2 Rows', [
|
|
8
8
|
ui.splitH([
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
let windows = grok.shell.windows;
|
|
4
4
|
windows.showToolbox = false; //*hide tool box
|
|
5
|
-
windows.
|
|
5
|
+
windows.showContextPanel = false; //*hide context panel
|
|
6
6
|
|
|
7
7
|
let view = grok.shell.newView('Splitter 2 - 3 Column', [
|
|
8
8
|
ui.splitV([
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
let windows = grok.shell.windows;
|
|
4
4
|
windows.showToolbox = false; //*hide tool box
|
|
5
|
-
windows.
|
|
5
|
+
windows.showContextPanel = false; //*hide context panel
|
|
6
6
|
|
|
7
7
|
let view = grok.shell.newView('Tabs Navbar', [
|
|
8
8
|
ui.tabControl({
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
let tv = grok.shell.addTableView(grok.data.demo.demog());
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
|
|
3
|
+
// We need to load the external package before we use the
|
|
4
|
+
// synchronous "tv.filters" method that uses the filter
|
|
5
|
+
grok.functions.call('Widgets:radioButtonFilter').then((_) => {
|
|
6
|
+
tv.filters({filters: [
|
|
7
|
+
{type: 'Widgets:radioButtonFilter', columnName: 'race'},
|
|
8
|
+
]});
|
|
9
|
+
});
|