@hpcc-js/eclwatch 2.77.6 → 2.77.7

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hpcc-js/eclwatch",
3
- "version": "2.77.6",
3
+ "version": "2.77.7",
4
4
  "description": "hpcc-js - ECL Watch",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.es6",
@@ -38,16 +38,16 @@
38
38
  "update": "npx --yes npm-check-updates -u -t minor"
39
39
  },
40
40
  "dependencies": {
41
- "@hpcc-js/codemirror": "^2.66.1",
42
- "@hpcc-js/common": "^2.73.2",
43
- "@hpcc-js/comms": "^2.102.1",
44
- "@hpcc-js/dgrid": "^2.34.3",
45
- "@hpcc-js/graph": "^2.87.2",
46
- "@hpcc-js/layout": "^2.51.2",
47
- "@hpcc-js/phosphor": "^2.20.3",
48
- "@hpcc-js/timeline": "^2.57.0",
49
- "@hpcc-js/tree": "^2.45.0",
50
- "@hpcc-js/util": "^2.53.1"
41
+ "@hpcc-js/codemirror": "^2.66.2",
42
+ "@hpcc-js/common": "^2.73.3",
43
+ "@hpcc-js/comms": "^2.102.2",
44
+ "@hpcc-js/dgrid": "^2.34.4",
45
+ "@hpcc-js/graph": "^2.87.3",
46
+ "@hpcc-js/layout": "^2.51.3",
47
+ "@hpcc-js/phosphor": "^2.20.4",
48
+ "@hpcc-js/timeline": "^2.57.1",
49
+ "@hpcc-js/tree": "^2.45.1",
50
+ "@hpcc-js/util": "^2.53.3"
51
51
  },
52
52
  "devDependencies": {
53
53
  "@hpcc-js/bundle": "^2.12.0",
@@ -65,5 +65,5 @@
65
65
  "url": "https://github.com/hpcc-systems/Visualization/issues"
66
66
  },
67
67
  "homepage": "https://github.com/hpcc-systems/Visualization",
68
- "gitHead": "84f852a555c8d7b7381e4fcb93bfad829b1db62e"
68
+ "gitHead": "0907b8d15d369c89483954a1d96e2247ba020cb6"
69
69
  }
@@ -1,160 +1,160 @@
1
- import { Editor } from "@hpcc-js/codemirror";
2
- import { Workunit } from "@hpcc-js/comms";
3
- import { SplitPanel } from "@hpcc-js/phosphor";
4
- import { DirectoryTree } from "@hpcc-js/tree";
5
- import { hashSum, xml2json } from "@hpcc-js/util";
6
-
7
- export class ECLArchiveViewer extends SplitPanel {
8
- private _prevHash;
9
- private _contentStr;
10
- public _directoryPane = new DirectoryTree();
11
- public _fileEditorPane = new Editor()
12
- .text("")
13
- ;
14
-
15
- constructor() {
16
- super("horizontal");
17
- this._directoryPane.rowClick = (text) => {
18
- this._fileEditorPane
19
- .text(text)
20
- .render()
21
- ;
22
- };
23
- }
24
-
25
- protected transformArchiveTreeData(json) {
26
- const ret = {
27
- label: json.name,
28
- children: json._children.map(transformNode).filter(n => n)
29
- };
30
-
31
- if (ret.children && ret.children[0] && ret.children[0].label === "html") {
32
- // must be parsererror
33
- return {
34
- label: "root",
35
- children: [
36
- {
37
- label: "error",
38
- content: JSON.stringify(ret, null, 4)
39
- }
40
- ]
41
- };
42
- }
43
- return ret;
44
-
45
- function transformNode(node) {
46
- const _node: any = {};
47
- _node.label = node.name + (node["$"] && node["$"].key ? ` (${node["$"].key})` : "");
48
- if (node._children && node._children.length > 0) {
49
- _node.children = node._children.map(_node => {
50
- return transformNode(_node);
51
- })
52
- .filter(n => n)
53
- ;
54
- } else if (typeof node.content === "string" && node.content.trim()) {
55
- _node.content = node.content;
56
- } else {
57
- return false;
58
- }
59
- return _node;
60
- }
61
- }
62
-
63
- updateDirectoryPane(contentStr) {
64
- let json;
65
- if (contentStr) {
66
- try {
67
- json = JSON.parse(contentStr);
68
- } catch (e) {
69
- json = xml2json(contentStr);
70
- }
71
- }
72
- if (json) {
73
- const _data = this.transformArchiveTreeData(json);
74
- this._directoryPane
75
- .data(_data)
76
- .render()
77
- ;
78
- }
79
- }
80
-
81
- enter(domNode, element) {
82
- super.enter(domNode, element);
83
- this
84
- .addWidget(this._directoryPane)
85
- .addWidget(this._fileEditorPane)
86
- ;
87
- }
88
-
89
- update(domNode, element) {
90
- super.update(domNode, element);
91
-
92
- const hash = hashSum({
93
- baseUrl: this.baseUrl(),
94
- wuid: this.wuid()
95
- });
96
-
97
- if (this._prevHash !== hash || typeof this._contentStr === "undefined") {
98
- Workunit.attach({ baseUrl: this.baseUrl() }, this.wuid())
99
- .fetchArchive()
100
- .then(resp => {
101
-
102
- this._contentStr = resp;
103
- this.updateDirectoryPane(this._contentStr);
104
-
105
- this._prevHash = hash;
106
- });
107
- } else {
108
- this.updateDirectoryPane(this._contentStr);
109
- }
110
-
111
- this.relativeSizes([this.directoryWidthRatio(), 1 - this.directoryWidthRatio()]);
112
- }
113
- }
114
- ECLArchiveViewer.prototype._class += " eclwatch_ECLArchiveViewer";
115
-
116
- export interface ECLArchiveViewer {
117
- directoryPaneColor(): string;
118
- directoryPaneColor(_: string): this;
119
- directoryPaneHoverColor(): string;
120
- directoryPaneHoverColor(_: string): this;
121
- fontColor(): string;
122
- fontColor(_: string): this;
123
- fontFamily(): string;
124
- fontFamily(_: string): this;
125
- fontSize(): number;
126
- fontSize(_: number): this;
127
- fileIconSize(): number;
128
- fileIconSize(_: number): this;
129
- folderIconOpen(): string;
130
- folderIconOpen(_: string): this;
131
- folderIconClosed(): string;
132
- folderIconClosed(_: string): this;
133
- textFileIcon(): string;
134
- textFileIcon(_: string): this;
135
- codeFileIcon(): string;
136
- codeFileIcon(_: string): this;
137
- verticalScroll(): boolean;
138
- verticalScroll(_: boolean): this;
139
- directoryWidthRatio(): number;
140
- directoryWidthRatio(_: number): this;
141
- baseUrl(): string;
142
- baseUrl(_: string): this;
143
- wuid(): string;
144
- wuid(_: string): this;
145
- }
146
- ECLArchiveViewer.prototype.publish("baseUrl", "", "string", "HPCC Platform Base URL");
147
- ECLArchiveViewer.prototype.publish("wuid", "", "string", "Workunit ID");
148
- ECLArchiveViewer.prototype.publish("directoryWidthRatio", 0.38, "number", "Default directory panel width ratio relative to the full width");
149
- ECLArchiveViewer.prototype.publish("contentString", null, "string", "XML/JSON archive content string");
150
- ECLArchiveViewer.prototype.publishProxy("directoryPaneColor", "_directoryPane", "backgroundColor");
151
- ECLArchiveViewer.prototype.publishProxy("directoryPaneHoverColor", "_directoryPane", "hoverBackgroundColor");
152
- ECLArchiveViewer.prototype.publishProxy("iconSize", "_directoryPane");
153
- ECLArchiveViewer.prototype.publishProxy("fontColor", "_directoryPane");
154
- ECLArchiveViewer.prototype.publishProxy("fontFamily", "_directoryPane");
155
- ECLArchiveViewer.prototype.publishProxy("fontSize", "_directoryPane");
156
- ECLArchiveViewer.prototype.publishProxy("folderIconOpen", "_directoryPane");
157
- ECLArchiveViewer.prototype.publishProxy("folderIconClosed", "_directoryPane");
158
- ECLArchiveViewer.prototype.publishProxy("textFileIcon", "_directoryPane");
159
- ECLArchiveViewer.prototype.publishProxy("codeFileIcon", "_directoryPane");
160
- ECLArchiveViewer.prototype.publishProxy("verticalScroll", "_directoryPane");
1
+ import { Editor } from "@hpcc-js/codemirror";
2
+ import { Workunit } from "@hpcc-js/comms";
3
+ import { SplitPanel } from "@hpcc-js/phosphor";
4
+ import { DirectoryTree } from "@hpcc-js/tree";
5
+ import { hashSum, xml2json } from "@hpcc-js/util";
6
+
7
+ export class ECLArchiveViewer extends SplitPanel {
8
+ private _prevHash;
9
+ private _contentStr;
10
+ public _directoryPane = new DirectoryTree();
11
+ public _fileEditorPane = new Editor()
12
+ .text("")
13
+ ;
14
+
15
+ constructor() {
16
+ super("horizontal");
17
+ this._directoryPane.rowClick = (text) => {
18
+ this._fileEditorPane
19
+ .text(text)
20
+ .render()
21
+ ;
22
+ };
23
+ }
24
+
25
+ protected transformArchiveTreeData(json) {
26
+ const ret = {
27
+ label: json.name,
28
+ children: json._children.map(transformNode).filter(n => n)
29
+ };
30
+
31
+ if (ret.children && ret.children[0] && ret.children[0].label === "html") {
32
+ // must be parsererror
33
+ return {
34
+ label: "root",
35
+ children: [
36
+ {
37
+ label: "error",
38
+ content: JSON.stringify(ret, null, 4)
39
+ }
40
+ ]
41
+ };
42
+ }
43
+ return ret;
44
+
45
+ function transformNode(node) {
46
+ const _node: any = {};
47
+ _node.label = node.name + (node["$"] && node["$"].key ? ` (${node["$"].key})` : "");
48
+ if (node._children && node._children.length > 0) {
49
+ _node.children = node._children.map(_node => {
50
+ return transformNode(_node);
51
+ })
52
+ .filter(n => n)
53
+ ;
54
+ } else if (typeof node.content === "string" && node.content.trim()) {
55
+ _node.content = node.content;
56
+ } else {
57
+ return false;
58
+ }
59
+ return _node;
60
+ }
61
+ }
62
+
63
+ updateDirectoryPane(contentStr) {
64
+ let json;
65
+ if (contentStr) {
66
+ try {
67
+ json = JSON.parse(contentStr);
68
+ } catch (e) {
69
+ json = xml2json(contentStr);
70
+ }
71
+ }
72
+ if (json) {
73
+ const _data = this.transformArchiveTreeData(json);
74
+ this._directoryPane
75
+ .data(_data)
76
+ .render()
77
+ ;
78
+ }
79
+ }
80
+
81
+ enter(domNode, element) {
82
+ super.enter(domNode, element);
83
+ this
84
+ .addWidget(this._directoryPane)
85
+ .addWidget(this._fileEditorPane)
86
+ ;
87
+ }
88
+
89
+ update(domNode, element) {
90
+ super.update(domNode, element);
91
+
92
+ const hash = hashSum({
93
+ baseUrl: this.baseUrl(),
94
+ wuid: this.wuid()
95
+ });
96
+
97
+ if (this._prevHash !== hash || typeof this._contentStr === "undefined") {
98
+ Workunit.attach({ baseUrl: this.baseUrl() }, this.wuid())
99
+ .fetchArchive()
100
+ .then(resp => {
101
+
102
+ this._contentStr = resp;
103
+ this.updateDirectoryPane(this._contentStr);
104
+
105
+ this._prevHash = hash;
106
+ });
107
+ } else {
108
+ this.updateDirectoryPane(this._contentStr);
109
+ }
110
+
111
+ this.relativeSizes([this.directoryWidthRatio(), 1 - this.directoryWidthRatio()]);
112
+ }
113
+ }
114
+ ECLArchiveViewer.prototype._class += " eclwatch_ECLArchiveViewer";
115
+
116
+ export interface ECLArchiveViewer {
117
+ directoryPaneColor(): string;
118
+ directoryPaneColor(_: string): this;
119
+ directoryPaneHoverColor(): string;
120
+ directoryPaneHoverColor(_: string): this;
121
+ fontColor(): string;
122
+ fontColor(_: string): this;
123
+ fontFamily(): string;
124
+ fontFamily(_: string): this;
125
+ fontSize(): number;
126
+ fontSize(_: number): this;
127
+ fileIconSize(): number;
128
+ fileIconSize(_: number): this;
129
+ folderIconOpen(): string;
130
+ folderIconOpen(_: string): this;
131
+ folderIconClosed(): string;
132
+ folderIconClosed(_: string): this;
133
+ textFileIcon(): string;
134
+ textFileIcon(_: string): this;
135
+ codeFileIcon(): string;
136
+ codeFileIcon(_: string): this;
137
+ verticalScroll(): boolean;
138
+ verticalScroll(_: boolean): this;
139
+ directoryWidthRatio(): number;
140
+ directoryWidthRatio(_: number): this;
141
+ baseUrl(): string;
142
+ baseUrl(_: string): this;
143
+ wuid(): string;
144
+ wuid(_: string): this;
145
+ }
146
+ ECLArchiveViewer.prototype.publish("baseUrl", "", "string", "HPCC Platform Base URL");
147
+ ECLArchiveViewer.prototype.publish("wuid", "", "string", "Workunit ID");
148
+ ECLArchiveViewer.prototype.publish("directoryWidthRatio", 0.38, "number", "Default directory panel width ratio relative to the full width");
149
+ ECLArchiveViewer.prototype.publish("contentString", null, "string", "XML/JSON archive content string");
150
+ ECLArchiveViewer.prototype.publishProxy("directoryPaneColor", "_directoryPane", "backgroundColor");
151
+ ECLArchiveViewer.prototype.publishProxy("directoryPaneHoverColor", "_directoryPane", "hoverBackgroundColor");
152
+ ECLArchiveViewer.prototype.publishProxy("iconSize", "_directoryPane");
153
+ ECLArchiveViewer.prototype.publishProxy("fontColor", "_directoryPane");
154
+ ECLArchiveViewer.prototype.publishProxy("fontFamily", "_directoryPane");
155
+ ECLArchiveViewer.prototype.publishProxy("fontSize", "_directoryPane");
156
+ ECLArchiveViewer.prototype.publishProxy("folderIconOpen", "_directoryPane");
157
+ ECLArchiveViewer.prototype.publishProxy("folderIconClosed", "_directoryPane");
158
+ ECLArchiveViewer.prototype.publishProxy("textFileIcon", "_directoryPane");
159
+ ECLArchiveViewer.prototype.publishProxy("codeFileIcon", "_directoryPane");
160
+ ECLArchiveViewer.prototype.publishProxy("verticalScroll", "_directoryPane");
package/src/WUGraph.css CHANGED
@@ -1,40 +1,40 @@
1
- .eclwatch_WUGraph .graph_Vertex {
2
- cursor: auto;
3
- }
4
-
5
- .eclwatch_WUGraph .marker {
6
- fill: #656565;
7
- stroke: none;
8
- stroke-width: 1.0px;
9
- }
10
-
11
- .eclwatch_WUGraph .zoom {
12
- fill: none;
13
- pointer-events: all;
14
- }
15
-
16
- .eclwatch_WUGraph .selectionBrush {
17
- fill: none;
18
- stroke: darkgray;
19
- }
20
-
21
- .d3-tip .eclwatch_WUGraph_Tooltip h3 {
22
- margin:0px;
23
- }
24
-
25
- .d3-tip .eclwatch_WUGraph_Tooltip h4 {
26
- margin:0px;
27
- }
28
-
29
- .d3-tip .eclwatch_WUGraph_Tooltip table {
30
- border-collapse: separate;
31
- border-spacing: 5px;
32
- }
33
-
34
- .d3-tip .eclwatch_WUGraph_Tooltip table .key {
35
- font-weight: bold;
36
- }
37
-
38
- .d3-tip .eclwatch_WUGraph_Tooltip table .value {
39
- font-weight: normal;
40
- }
1
+ .eclwatch_WUGraph .graph_Vertex {
2
+ cursor: auto;
3
+ }
4
+
5
+ .eclwatch_WUGraph .marker {
6
+ fill: #656565;
7
+ stroke: none;
8
+ stroke-width: 1.0px;
9
+ }
10
+
11
+ .eclwatch_WUGraph .zoom {
12
+ fill: none;
13
+ pointer-events: all;
14
+ }
15
+
16
+ .eclwatch_WUGraph .selectionBrush {
17
+ fill: none;
18
+ stroke: darkgray;
19
+ }
20
+
21
+ .d3-tip .eclwatch_WUGraph_Tooltip h3 {
22
+ margin:0px;
23
+ }
24
+
25
+ .d3-tip .eclwatch_WUGraph_Tooltip h4 {
26
+ margin:0px;
27
+ }
28
+
29
+ .d3-tip .eclwatch_WUGraph_Tooltip table {
30
+ border-collapse: separate;
31
+ border-spacing: 5px;
32
+ }
33
+
34
+ .d3-tip .eclwatch_WUGraph_Tooltip table .key {
35
+ font-weight: bold;
36
+ }
37
+
38
+ .d3-tip .eclwatch_WUGraph_Tooltip table .value {
39
+ font-weight: normal;
40
+ }