datagrok-tools 4.13.17 → 4.13.18
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/CHANGELOG.md
CHANGED
package/bin/commands/add.js
CHANGED
|
@@ -229,11 +229,9 @@ function add(args) {
|
|
|
229
229
|
var viewerClass = _fs["default"].readFileSync(_path["default"].join(templateDir, 'entity-template', 'viewer-class' + ext), 'utf8');
|
|
230
230
|
_fs["default"].writeFileSync(viewerPath, insertName(name, viewerClass), 'utf8');
|
|
231
231
|
|
|
232
|
-
// Add a viewer function to package.js
|
|
233
|
-
|
|
234
|
-
contents = insertName(name, "import {#{NAME}} from './".concat(utils.camelCaseToKebab(name), "';\n"));
|
|
232
|
+
// Add a viewer function to package.js
|
|
233
|
+
contents = insertName(name, "import {_#{NAME}} from './package.g';\n");
|
|
235
234
|
contents += _fs["default"].readFileSync(packageEntry, 'utf8');
|
|
236
|
-
contents += insertName(name, viewer);
|
|
237
235
|
_fs["default"].writeFileSync(packageEntry, contents, 'utf8');
|
|
238
236
|
console.log(_entHelpers.help.viewer(name));
|
|
239
237
|
break;
|
package/bin/commands/create.js
CHANGED
|
@@ -54,9 +54,10 @@ function createDirectoryContents(name, config, templateDir, packageDir) {
|
|
|
54
54
|
contents = contents.replace(/#{GROK_HOST_ALIAS}/g, config["default"]);
|
|
55
55
|
contents = contents.replace(/#{GROK_HOST}/g, /localhost|127\.0\.0\.1/.test(config['servers'][config["default"]]['url']) ? 'http://localhost:63343/login.html' : new URL(config['servers'][config["default"]]['url']).origin);
|
|
56
56
|
if (file === 'package.json') {
|
|
57
|
+
var _package$scripts;
|
|
57
58
|
// Generate scripts for non-default servers from `config.yaml`
|
|
58
59
|
var _package = JSON.parse(contents);
|
|
59
|
-
_package['scripts'] = {};
|
|
60
|
+
_package['scripts'] = (_package$scripts = _package['scripts']) !== null && _package$scripts !== void 0 ? _package$scripts : {};
|
|
60
61
|
for (var server in config.servers) {
|
|
61
62
|
if (server === config["default"]) continue;
|
|
62
63
|
_package['scripts']["debug-".concat(name.toLowerCase(), "-").concat(server)] = "webpack && grok publish ".concat(server);
|
|
@@ -2,11 +2,30 @@ import * as grok from 'datagrok-api/grok';
|
|
|
2
2
|
import * as ui from 'datagrok-api/ui';
|
|
3
3
|
import * as DG from 'datagrok-api/dg';
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
@grok.decorators.viewer({
|
|
6
|
+
name: '#{NAME}',
|
|
7
|
+
description: 'Creates #{NAME} viewer'
|
|
8
|
+
})
|
|
9
9
|
export class #{NAME} extends DG.JsViewer {
|
|
10
|
+
constructor() {
|
|
11
|
+
super();
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
// Additional chart settings
|
|
15
|
+
init() {
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
// Override to handle property changes
|
|
19
|
+
onPropertyChanged(property : DG.Property | null) {
|
|
20
|
+
super.onPropertyChanged(property);
|
|
21
|
+
this.render();
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// Cancel subscriptions when the viewer is detached
|
|
25
|
+
detach() {
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// Stream subscriptions
|
|
10
29
|
onTableAttached() {
|
|
11
30
|
this.subs.push(this.dataFrame!.selection.onChanged.subscribe((_) => this.render()));
|
|
12
31
|
this.subs.push(this.dataFrame!.filter.onChanged.subscribe((_) => this.render()));
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"webpack-cli": "latest"
|
|
16
16
|
},
|
|
17
17
|
"scripts": {
|
|
18
|
-
"link-all": "",
|
|
18
|
+
"link-all": "grok link",
|
|
19
19
|
"debug-#{PACKAGE_NAME_LOWERCASE}": "webpack && grok publish",
|
|
20
20
|
"release-#{PACKAGE_NAME_LOWERCASE}": "webpack && grok publish --release",
|
|
21
21
|
"build-#{PACKAGE_NAME_LOWERCASE}": "webpack",
|
package/package.json
CHANGED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
@grok.decorators.viewer({
|
|
4
|
-
name: '#{NAME}',
|
|
5
|
-
description: 'Creates #{NAME} viewer'
|
|
6
|
-
})
|
|
7
|
-
export class #{NAME}Viewer extends DG.JsViewer {
|
|
8
|
-
constructor() {
|
|
9
|
-
super();
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
// Additional chart settings
|
|
13
|
-
init() {
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
// Stream subscriptions
|
|
17
|
-
onTableAttached() {
|
|
18
|
-
this.init();
|
|
19
|
-
this.render();
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
// Cancel subscriptions when the viewer is detached
|
|
23
|
-
detach() {
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
// Override to handle property changes
|
|
27
|
-
onPropertyChanged(property : DG.Property | null) {
|
|
28
|
-
super.onPropertyChanged(property);
|
|
29
|
-
this.render();
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
render(computeData = true) {
|
|
33
|
-
}
|
|
34
|
-
}
|