@hpcc-js/marshaller 2.28.5 → 2.28.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/LICENSE +43 -43
- package/dist/index.es6.js +22 -22
- package/dist/index.es6.js.map +1 -1
- package/dist/index.js +20 -20
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +2 -2
- package/dist/index.min.js.map +1 -1
- package/package.json +16 -16
- package/src/__package__.ts +3 -3
- package/src/dashy.css +239 -239
- package/src/dashy.ts +521 -521
- package/src/ddl1/DDLApi.ts +229 -229
- package/src/ddl1/FlyoutButton.ts +120 -120
- package/src/ddl1/Graph.ts +93 -93
- package/src/ddl1/HTML.ts +77 -77
- package/src/ddl1/HipieDDL.ts +2437 -2437
- package/src/ddl1/HipieDDLMixin.ts +380 -380
- package/src/ddl1/Tabbed.ts +91 -91
- package/src/ddl1/TargetMarshaller.ts +57 -57
- package/src/ddl2/PopupManager.ts +89 -89
- package/src/ddl2/activities/activity.ts +431 -431
- package/src/ddl2/activities/databomb.ts +237 -237
- package/src/ddl2/activities/datasource.ts +52 -52
- package/src/ddl2/activities/dspicker.ts +106 -106
- package/src/ddl2/activities/filter.ts +542 -542
- package/src/ddl2/activities/form.ts +153 -153
- package/src/ddl2/activities/groupby.ts +439 -439
- package/src/ddl2/activities/hipiepipeline.ts +114 -114
- package/src/ddl2/activities/limit.ts +49 -49
- package/src/ddl2/activities/logicalfile.ts +62 -62
- package/src/ddl2/activities/nullview.ts +12 -12
- package/src/ddl2/activities/project.ts +764 -764
- package/src/ddl2/activities/rest.ts +568 -568
- package/src/ddl2/activities/roxie.ts +490 -490
- package/src/ddl2/activities/sampledata.json +16264 -16264
- package/src/ddl2/activities/sort.ts +176 -176
- package/src/ddl2/activities/wuresult.ts +395 -395
- package/src/ddl2/dashboard.css +13 -13
- package/src/ddl2/dashboard.ts +330 -330
- package/src/ddl2/dashboardDockPanel.ts +123 -123
- package/src/ddl2/dashboardGrid.ts +202 -202
- package/src/ddl2/ddl.ts +410 -410
- package/src/ddl2/ddleditor.ts +60 -60
- package/src/ddl2/dsTable.ts +238 -238
- package/src/ddl2/dvTable.ts +31 -31
- package/src/ddl2/graphadapter.ts +297 -297
- package/src/ddl2/javascriptadapter.ts +354 -354
- package/src/ddl2/model/element.ts +398 -398
- package/src/ddl2/model/visualization.ts +351 -351
- package/src/ddl2/model/vizChartPanel.ts +149 -149
- package/src/ddl2/pipelinePanel.css +4 -4
- package/src/ddl2/pipelinePanel.ts +465 -465
- package/src/index.ts +26 -26
- package/types/__package__.d.ts +2 -2
- package/types-3.4/__package__.d.ts +2 -2
package/src/ddl1/FlyoutButton.ts
CHANGED
|
@@ -1,120 +1,120 @@
|
|
|
1
|
-
import { Widget } from "@hpcc-js/common";
|
|
2
|
-
import { Button } from "@hpcc-js/form";
|
|
3
|
-
import { Popup, Surface } from "@hpcc-js/layout";
|
|
4
|
-
|
|
5
|
-
export class FlyoutButton extends Button {
|
|
6
|
-
_popupSurface;
|
|
7
|
-
_popup;
|
|
8
|
-
_popupParentWidget;
|
|
9
|
-
|
|
10
|
-
constructor() {
|
|
11
|
-
super();
|
|
12
|
-
|
|
13
|
-
this.value("^");
|
|
14
|
-
|
|
15
|
-
const context = this;
|
|
16
|
-
this._popupSurface = new Surface()
|
|
17
|
-
.surfaceBackgroundColor("rgb(234, 249, 255)")
|
|
18
|
-
.buttonAnnotations([
|
|
19
|
-
{
|
|
20
|
-
id: "",
|
|
21
|
-
label: "\uf00d",
|
|
22
|
-
width: 20,
|
|
23
|
-
padding: "0px 5px",
|
|
24
|
-
class: "close",
|
|
25
|
-
font: "FontAwesome"
|
|
26
|
-
}
|
|
27
|
-
])
|
|
28
|
-
.on("click", function (ann) {
|
|
29
|
-
if (ann.class === "close") {
|
|
30
|
-
context._popup
|
|
31
|
-
.visible(false)
|
|
32
|
-
.popupState(false)
|
|
33
|
-
.render()
|
|
34
|
-
;
|
|
35
|
-
}
|
|
36
|
-
})
|
|
37
|
-
;
|
|
38
|
-
this._popup = new Popup()
|
|
39
|
-
.size({ width: 400, height: 400 })
|
|
40
|
-
.position("fixed")
|
|
41
|
-
.widget(this._popupSurface)
|
|
42
|
-
;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
reference(obj) {
|
|
46
|
-
const retVal: any = new Button()
|
|
47
|
-
.value(this.value())
|
|
48
|
-
;
|
|
49
|
-
const context = this;
|
|
50
|
-
retVal.click = function () {
|
|
51
|
-
context.click();
|
|
52
|
-
};
|
|
53
|
-
return retVal;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
click(obj?) {
|
|
57
|
-
const context = this;
|
|
58
|
-
this._popup
|
|
59
|
-
.visible(true)
|
|
60
|
-
.popupState(true)
|
|
61
|
-
.render(function (w) {
|
|
62
|
-
const bbox = context._popupSurface.widget().getBBox();
|
|
63
|
-
context._popupSurface.resize({
|
|
64
|
-
width: bbox.width,
|
|
65
|
-
height: bbox.height + context._popupSurface.calcHeight(context._popupSurface.element().select(".surfaceTitle")) + 18
|
|
66
|
-
});
|
|
67
|
-
context._popup.render();
|
|
68
|
-
})
|
|
69
|
-
;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
enter(domNode, element) {
|
|
73
|
-
super.enter(domNode, element);
|
|
74
|
-
let parentWidget: Widget = this;
|
|
75
|
-
while (parentWidget && ["marshaller_HTML", "marshaller_Graph", "composite_MegaChart"].indexOf(parentWidget.classID()) === -1) {
|
|
76
|
-
parentWidget = parentWidget.locateParentWidget();
|
|
77
|
-
}
|
|
78
|
-
if (parentWidget) {
|
|
79
|
-
this._popupParentWidget = parentWidget;
|
|
80
|
-
this._popup
|
|
81
|
-
.target(parentWidget.node())
|
|
82
|
-
;
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
render(callback?): this {
|
|
87
|
-
const context = this;
|
|
88
|
-
const isVisible = this._popup.popupState();
|
|
89
|
-
Button.prototype.render.call(context, function (widget) {
|
|
90
|
-
const popupParentWidgetBBox = context._popupParentWidget.getBBox();
|
|
91
|
-
const bbox = widget.getBBox();
|
|
92
|
-
context._popup
|
|
93
|
-
.left(bbox.x - popupParentWidgetBBox.x + bbox.width - context._popup.width())
|
|
94
|
-
.top(bbox.y - popupParentWidgetBBox.y + bbox.height)
|
|
95
|
-
.visible(isVisible && context.autoClose() ? false : isVisible) // hack: closes the form when submit is clicked ---
|
|
96
|
-
.popupState(isVisible && context.autoClose() ? false : isVisible)
|
|
97
|
-
.render()
|
|
98
|
-
;
|
|
99
|
-
if (callback) {
|
|
100
|
-
callback(widget);
|
|
101
|
-
}
|
|
102
|
-
});
|
|
103
|
-
return this;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
autoClose: { (): boolean; (_: boolean): FlyoutButton };
|
|
107
|
-
autoClose_exists: () => boolean;
|
|
108
|
-
}
|
|
109
|
-
FlyoutButton.prototype._class += " marshaller_FlyoutButton";
|
|
110
|
-
|
|
111
|
-
export interface FlyoutButton {
|
|
112
|
-
title(): string;
|
|
113
|
-
title(_: string): this;
|
|
114
|
-
widget(): Widget;
|
|
115
|
-
widget(_: Widget): this;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
FlyoutButton.prototype.publishProxy("title", "_popupSurface");
|
|
119
|
-
FlyoutButton.prototype.publishProxy("widget", "_popupSurface");
|
|
120
|
-
FlyoutButton.prototype.publish("autoClose", true, "boolean", "Auto Close");
|
|
1
|
+
import { Widget } from "@hpcc-js/common";
|
|
2
|
+
import { Button } from "@hpcc-js/form";
|
|
3
|
+
import { Popup, Surface } from "@hpcc-js/layout";
|
|
4
|
+
|
|
5
|
+
export class FlyoutButton extends Button {
|
|
6
|
+
_popupSurface;
|
|
7
|
+
_popup;
|
|
8
|
+
_popupParentWidget;
|
|
9
|
+
|
|
10
|
+
constructor() {
|
|
11
|
+
super();
|
|
12
|
+
|
|
13
|
+
this.value("^");
|
|
14
|
+
|
|
15
|
+
const context = this;
|
|
16
|
+
this._popupSurface = new Surface()
|
|
17
|
+
.surfaceBackgroundColor("rgb(234, 249, 255)")
|
|
18
|
+
.buttonAnnotations([
|
|
19
|
+
{
|
|
20
|
+
id: "",
|
|
21
|
+
label: "\uf00d",
|
|
22
|
+
width: 20,
|
|
23
|
+
padding: "0px 5px",
|
|
24
|
+
class: "close",
|
|
25
|
+
font: "FontAwesome"
|
|
26
|
+
}
|
|
27
|
+
])
|
|
28
|
+
.on("click", function (ann) {
|
|
29
|
+
if (ann.class === "close") {
|
|
30
|
+
context._popup
|
|
31
|
+
.visible(false)
|
|
32
|
+
.popupState(false)
|
|
33
|
+
.render()
|
|
34
|
+
;
|
|
35
|
+
}
|
|
36
|
+
})
|
|
37
|
+
;
|
|
38
|
+
this._popup = new Popup()
|
|
39
|
+
.size({ width: 400, height: 400 })
|
|
40
|
+
.position("fixed")
|
|
41
|
+
.widget(this._popupSurface)
|
|
42
|
+
;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
reference(obj) {
|
|
46
|
+
const retVal: any = new Button()
|
|
47
|
+
.value(this.value())
|
|
48
|
+
;
|
|
49
|
+
const context = this;
|
|
50
|
+
retVal.click = function () {
|
|
51
|
+
context.click();
|
|
52
|
+
};
|
|
53
|
+
return retVal;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
click(obj?) {
|
|
57
|
+
const context = this;
|
|
58
|
+
this._popup
|
|
59
|
+
.visible(true)
|
|
60
|
+
.popupState(true)
|
|
61
|
+
.render(function (w) {
|
|
62
|
+
const bbox = context._popupSurface.widget().getBBox();
|
|
63
|
+
context._popupSurface.resize({
|
|
64
|
+
width: bbox.width,
|
|
65
|
+
height: bbox.height + context._popupSurface.calcHeight(context._popupSurface.element().select(".surfaceTitle")) + 18
|
|
66
|
+
});
|
|
67
|
+
context._popup.render();
|
|
68
|
+
})
|
|
69
|
+
;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
enter(domNode, element) {
|
|
73
|
+
super.enter(domNode, element);
|
|
74
|
+
let parentWidget: Widget = this;
|
|
75
|
+
while (parentWidget && ["marshaller_HTML", "marshaller_Graph", "composite_MegaChart"].indexOf(parentWidget.classID()) === -1) {
|
|
76
|
+
parentWidget = parentWidget.locateParentWidget();
|
|
77
|
+
}
|
|
78
|
+
if (parentWidget) {
|
|
79
|
+
this._popupParentWidget = parentWidget;
|
|
80
|
+
this._popup
|
|
81
|
+
.target(parentWidget.node())
|
|
82
|
+
;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
render(callback?): this {
|
|
87
|
+
const context = this;
|
|
88
|
+
const isVisible = this._popup.popupState();
|
|
89
|
+
Button.prototype.render.call(context, function (widget) {
|
|
90
|
+
const popupParentWidgetBBox = context._popupParentWidget.getBBox();
|
|
91
|
+
const bbox = widget.getBBox();
|
|
92
|
+
context._popup
|
|
93
|
+
.left(bbox.x - popupParentWidgetBBox.x + bbox.width - context._popup.width())
|
|
94
|
+
.top(bbox.y - popupParentWidgetBBox.y + bbox.height)
|
|
95
|
+
.visible(isVisible && context.autoClose() ? false : isVisible) // hack: closes the form when submit is clicked ---
|
|
96
|
+
.popupState(isVisible && context.autoClose() ? false : isVisible)
|
|
97
|
+
.render()
|
|
98
|
+
;
|
|
99
|
+
if (callback) {
|
|
100
|
+
callback(widget);
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
return this;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
autoClose: { (): boolean; (_: boolean): FlyoutButton };
|
|
107
|
+
autoClose_exists: () => boolean;
|
|
108
|
+
}
|
|
109
|
+
FlyoutButton.prototype._class += " marshaller_FlyoutButton";
|
|
110
|
+
|
|
111
|
+
export interface FlyoutButton {
|
|
112
|
+
title(): string;
|
|
113
|
+
title(_: string): this;
|
|
114
|
+
widget(): Widget;
|
|
115
|
+
widget(_: Widget): this;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
FlyoutButton.prototype.publishProxy("title", "_popupSurface");
|
|
119
|
+
FlyoutButton.prototype.publishProxy("widget", "_popupSurface");
|
|
120
|
+
FlyoutButton.prototype.publish("autoClose", true, "boolean", "Auto Close");
|
package/src/ddl1/Graph.ts
CHANGED
|
@@ -1,93 +1,93 @@
|
|
|
1
|
-
import { ResizeSurface } from "@hpcc-js/common";
|
|
2
|
-
import { Edge, Graph as GraphWidget } from "@hpcc-js/graph";
|
|
3
|
-
import { HipieDDLMixin } from "./HipieDDLMixin";
|
|
4
|
-
|
|
5
|
-
export class Graph extends GraphWidget {
|
|
6
|
-
_design_mode;
|
|
7
|
-
_dashboards;
|
|
8
|
-
graphAttributes;
|
|
9
|
-
widgetAttributes;
|
|
10
|
-
_ddlVisualizations;
|
|
11
|
-
_ddlPopupVisualizations;
|
|
12
|
-
_ddlDashboards;
|
|
13
|
-
|
|
14
|
-
constructor() {
|
|
15
|
-
super();
|
|
16
|
-
HipieDDLMixin.call(this);
|
|
17
|
-
|
|
18
|
-
this._design_mode = false;
|
|
19
|
-
this._dashboards = [];
|
|
20
|
-
this.graphAttributes = ["snapToGrid", "showEdges"];
|
|
21
|
-
this.widgetAttributes = ["layout", "chartType", "palette", "title", "columns", "data"];
|
|
22
|
-
this.layout("Hierarchy");
|
|
23
|
-
this.applyScaleOnLayout(true);
|
|
24
|
-
this.content([]);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
populateContent() {
|
|
28
|
-
const vertices = [];
|
|
29
|
-
const edges = [];
|
|
30
|
-
this._ddlVisualizations.concat(this._ddlPopupVisualizations).forEach(function (viz) {
|
|
31
|
-
if (viz.widget) {
|
|
32
|
-
let newSurface = null;
|
|
33
|
-
if (viz.widget instanceof ResizeSurface) {
|
|
34
|
-
newSurface = viz.widget
|
|
35
|
-
.size({ width: 210, height: 210 })
|
|
36
|
-
;
|
|
37
|
-
} else {
|
|
38
|
-
const width = 280;
|
|
39
|
-
const height = 210;
|
|
40
|
-
newSurface = new ResizeSurface()
|
|
41
|
-
.showTitle(true)
|
|
42
|
-
.size({ width, height })
|
|
43
|
-
.content(viz.widget)
|
|
44
|
-
;
|
|
45
|
-
}
|
|
46
|
-
if (newSurface) {
|
|
47
|
-
viz.newWidgetSurface = newSurface;
|
|
48
|
-
}
|
|
49
|
-
vertices.push(newSurface);
|
|
50
|
-
}
|
|
51
|
-
viz.getInputVisualizations().forEach(() => {
|
|
52
|
-
});
|
|
53
|
-
}, this);
|
|
54
|
-
this._ddlDashboards.forEach(dashboard => {
|
|
55
|
-
dashboard.visualizations.forEach(viz => {
|
|
56
|
-
viz.getInputVisualizations().forEach(inViz => {
|
|
57
|
-
edges.push(new Edge()
|
|
58
|
-
.sourceVertex(inViz.newWidgetSurface)
|
|
59
|
-
.targetVertex(viz.newWidgetSurface)
|
|
60
|
-
.targetMarker("arrowHead")
|
|
61
|
-
);
|
|
62
|
-
});
|
|
63
|
-
});
|
|
64
|
-
});
|
|
65
|
-
this.content(vertices);
|
|
66
|
-
this.data({ vertices, edges });
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
enter(domNode, element) {
|
|
70
|
-
GraphWidget.prototype.enter.apply(this, arguments);
|
|
71
|
-
element.classed("graph_Graph", true);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
render(callback) {
|
|
75
|
-
this._marshallerRender(GraphWidget.prototype, callback);
|
|
76
|
-
return this;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
commsError(source, error) {
|
|
80
|
-
alert("Comms Error:\n" + source + "\n" + error);
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
content: { (): any[]; (_: any[]): Graph };
|
|
84
|
-
content_exists: () => boolean;
|
|
85
|
-
|
|
86
|
-
// HipieDDLMixin ---
|
|
87
|
-
_marshallerRender: (BaseClass, callback) => this;
|
|
88
|
-
}
|
|
89
|
-
Graph.prototype.mixin(HipieDDLMixin);
|
|
90
|
-
Graph.prototype._class += " marshaller_Graph";
|
|
91
|
-
|
|
92
|
-
// TODO Still Needed?: Graph.prototype.publish("visualizeRoxie", false, "boolean", "Show Roxie Data Sources", null, { tags: ["Private"] });
|
|
93
|
-
Graph.prototype.publish("content", [], "widgetArray", "widgets", null, { tags: ["Basic"] });
|
|
1
|
+
import { ResizeSurface } from "@hpcc-js/common";
|
|
2
|
+
import { Edge, Graph as GraphWidget } from "@hpcc-js/graph";
|
|
3
|
+
import { HipieDDLMixin } from "./HipieDDLMixin";
|
|
4
|
+
|
|
5
|
+
export class Graph extends GraphWidget {
|
|
6
|
+
_design_mode;
|
|
7
|
+
_dashboards;
|
|
8
|
+
graphAttributes;
|
|
9
|
+
widgetAttributes;
|
|
10
|
+
_ddlVisualizations;
|
|
11
|
+
_ddlPopupVisualizations;
|
|
12
|
+
_ddlDashboards;
|
|
13
|
+
|
|
14
|
+
constructor() {
|
|
15
|
+
super();
|
|
16
|
+
HipieDDLMixin.call(this);
|
|
17
|
+
|
|
18
|
+
this._design_mode = false;
|
|
19
|
+
this._dashboards = [];
|
|
20
|
+
this.graphAttributes = ["snapToGrid", "showEdges"];
|
|
21
|
+
this.widgetAttributes = ["layout", "chartType", "palette", "title", "columns", "data"];
|
|
22
|
+
this.layout("Hierarchy");
|
|
23
|
+
this.applyScaleOnLayout(true);
|
|
24
|
+
this.content([]);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
populateContent() {
|
|
28
|
+
const vertices = [];
|
|
29
|
+
const edges = [];
|
|
30
|
+
this._ddlVisualizations.concat(this._ddlPopupVisualizations).forEach(function (viz) {
|
|
31
|
+
if (viz.widget) {
|
|
32
|
+
let newSurface = null;
|
|
33
|
+
if (viz.widget instanceof ResizeSurface) {
|
|
34
|
+
newSurface = viz.widget
|
|
35
|
+
.size({ width: 210, height: 210 })
|
|
36
|
+
;
|
|
37
|
+
} else {
|
|
38
|
+
const width = 280;
|
|
39
|
+
const height = 210;
|
|
40
|
+
newSurface = new ResizeSurface()
|
|
41
|
+
.showTitle(true)
|
|
42
|
+
.size({ width, height })
|
|
43
|
+
.content(viz.widget)
|
|
44
|
+
;
|
|
45
|
+
}
|
|
46
|
+
if (newSurface) {
|
|
47
|
+
viz.newWidgetSurface = newSurface;
|
|
48
|
+
}
|
|
49
|
+
vertices.push(newSurface);
|
|
50
|
+
}
|
|
51
|
+
viz.getInputVisualizations().forEach(() => {
|
|
52
|
+
});
|
|
53
|
+
}, this);
|
|
54
|
+
this._ddlDashboards.forEach(dashboard => {
|
|
55
|
+
dashboard.visualizations.forEach(viz => {
|
|
56
|
+
viz.getInputVisualizations().forEach(inViz => {
|
|
57
|
+
edges.push(new Edge()
|
|
58
|
+
.sourceVertex(inViz.newWidgetSurface)
|
|
59
|
+
.targetVertex(viz.newWidgetSurface)
|
|
60
|
+
.targetMarker("arrowHead")
|
|
61
|
+
);
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
this.content(vertices);
|
|
66
|
+
this.data({ vertices, edges });
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
enter(domNode, element) {
|
|
70
|
+
GraphWidget.prototype.enter.apply(this, arguments);
|
|
71
|
+
element.classed("graph_Graph", true);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
render(callback) {
|
|
75
|
+
this._marshallerRender(GraphWidget.prototype, callback);
|
|
76
|
+
return this;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
commsError(source, error) {
|
|
80
|
+
alert("Comms Error:\n" + source + "\n" + error);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
content: { (): any[]; (_: any[]): Graph };
|
|
84
|
+
content_exists: () => boolean;
|
|
85
|
+
|
|
86
|
+
// HipieDDLMixin ---
|
|
87
|
+
_marshallerRender: (BaseClass, callback) => this;
|
|
88
|
+
}
|
|
89
|
+
Graph.prototype.mixin(HipieDDLMixin);
|
|
90
|
+
Graph.prototype._class += " marshaller_Graph";
|
|
91
|
+
|
|
92
|
+
// TODO Still Needed?: Graph.prototype.publish("visualizeRoxie", false, "boolean", "Show Roxie Data Sources", null, { tags: ["Private"] });
|
|
93
|
+
Graph.prototype.publish("content", [], "widgetArray", "widgets", null, { tags: ["Basic"] });
|
package/src/ddl1/HTML.ts
CHANGED
|
@@ -1,77 +1,77 @@
|
|
|
1
|
-
import { Grid } from "@hpcc-js/layout";
|
|
2
|
-
import { HipieDDLMixin } from "./HipieDDLMixin";
|
|
3
|
-
|
|
4
|
-
export class HTML extends Grid {
|
|
5
|
-
_ddlDashboards: any[];
|
|
6
|
-
surfacePadding_default: (n: number) => void;
|
|
7
|
-
_marshallerRender: (...args: any[]) => any;
|
|
8
|
-
|
|
9
|
-
constructor() {
|
|
10
|
-
super();
|
|
11
|
-
HipieDDLMixin.call(this);
|
|
12
|
-
|
|
13
|
-
this.surfacePadding_default(0);
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
populateContent() {
|
|
17
|
-
let cellRow = 0;
|
|
18
|
-
let cellCol = 0;
|
|
19
|
-
const cellDensity = 3;
|
|
20
|
-
this._ddlDashboards.forEach(dashboard => {
|
|
21
|
-
const maxCol = Math.floor(Math.sqrt(dashboard.visualizations.length));
|
|
22
|
-
dashboard.visualizations.forEach(viz => {
|
|
23
|
-
if (viz.newWidgetSurface) {
|
|
24
|
-
while (this.getCell(cellRow * cellDensity, cellCol * cellDensity) !== null) {
|
|
25
|
-
cellCol++;
|
|
26
|
-
if (cellCol % maxCol === 0) {
|
|
27
|
-
cellRow++;
|
|
28
|
-
cellCol = 0;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
this.setContent(cellRow * cellDensity, cellCol * cellDensity, viz.newWidgetSurface, "", cellDensity, cellDensity);
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
const vizCellMap = {};
|
|
37
|
-
this.content().forEach(function (cell) {
|
|
38
|
-
let widget: any = cell.widget();
|
|
39
|
-
if (widget && widget.classID() === "layout_Surface") {
|
|
40
|
-
widget = widget.widget();
|
|
41
|
-
}
|
|
42
|
-
if (widget) {
|
|
43
|
-
vizCellMap[widget.id()] = cell;
|
|
44
|
-
}
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
this._ddlDashboards.forEach(function (dashboard) {
|
|
48
|
-
dashboard.visualizations.forEach(function (viz, idx) {
|
|
49
|
-
if (viz.properties.flyout || viz.parentVisualization) {
|
|
50
|
-
return;
|
|
51
|
-
}
|
|
52
|
-
const targetVizs = viz.events.getUpdatesVisualizations();
|
|
53
|
-
const targetIDs = targetVizs.filter(function (targetViz) {
|
|
54
|
-
return vizCellMap[targetViz.id];
|
|
55
|
-
}).map(function (targetViz) {
|
|
56
|
-
return vizCellMap[targetViz.id].id();
|
|
57
|
-
});
|
|
58
|
-
vizCellMap[viz.id].indicateTheseIds(targetIDs);
|
|
59
|
-
});
|
|
60
|
-
}, this);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
enter(domNode, element) {
|
|
64
|
-
super.enter(domNode, element);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
render(callback) {
|
|
68
|
-
this._marshallerRender(Grid.prototype, callback);
|
|
69
|
-
return this;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
commsError(source, error) {
|
|
73
|
-
alert("Comms Error:\n" + source + "\n" + error);
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
HTML.prototype.mixin(HipieDDLMixin);
|
|
77
|
-
HTML.prototype._class += " marshaller_HTML";
|
|
1
|
+
import { Grid } from "@hpcc-js/layout";
|
|
2
|
+
import { HipieDDLMixin } from "./HipieDDLMixin";
|
|
3
|
+
|
|
4
|
+
export class HTML extends Grid {
|
|
5
|
+
_ddlDashboards: any[];
|
|
6
|
+
surfacePadding_default: (n: number) => void;
|
|
7
|
+
_marshallerRender: (...args: any[]) => any;
|
|
8
|
+
|
|
9
|
+
constructor() {
|
|
10
|
+
super();
|
|
11
|
+
HipieDDLMixin.call(this);
|
|
12
|
+
|
|
13
|
+
this.surfacePadding_default(0);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
populateContent() {
|
|
17
|
+
let cellRow = 0;
|
|
18
|
+
let cellCol = 0;
|
|
19
|
+
const cellDensity = 3;
|
|
20
|
+
this._ddlDashboards.forEach(dashboard => {
|
|
21
|
+
const maxCol = Math.floor(Math.sqrt(dashboard.visualizations.length));
|
|
22
|
+
dashboard.visualizations.forEach(viz => {
|
|
23
|
+
if (viz.newWidgetSurface) {
|
|
24
|
+
while (this.getCell(cellRow * cellDensity, cellCol * cellDensity) !== null) {
|
|
25
|
+
cellCol++;
|
|
26
|
+
if (cellCol % maxCol === 0) {
|
|
27
|
+
cellRow++;
|
|
28
|
+
cellCol = 0;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
this.setContent(cellRow * cellDensity, cellCol * cellDensity, viz.newWidgetSurface, "", cellDensity, cellDensity);
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
const vizCellMap = {};
|
|
37
|
+
this.content().forEach(function (cell) {
|
|
38
|
+
let widget: any = cell.widget();
|
|
39
|
+
if (widget && widget.classID() === "layout_Surface") {
|
|
40
|
+
widget = widget.widget();
|
|
41
|
+
}
|
|
42
|
+
if (widget) {
|
|
43
|
+
vizCellMap[widget.id()] = cell;
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
this._ddlDashboards.forEach(function (dashboard) {
|
|
48
|
+
dashboard.visualizations.forEach(function (viz, idx) {
|
|
49
|
+
if (viz.properties.flyout || viz.parentVisualization) {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
const targetVizs = viz.events.getUpdatesVisualizations();
|
|
53
|
+
const targetIDs = targetVizs.filter(function (targetViz) {
|
|
54
|
+
return vizCellMap[targetViz.id];
|
|
55
|
+
}).map(function (targetViz) {
|
|
56
|
+
return vizCellMap[targetViz.id].id();
|
|
57
|
+
});
|
|
58
|
+
vizCellMap[viz.id].indicateTheseIds(targetIDs);
|
|
59
|
+
});
|
|
60
|
+
}, this);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
enter(domNode, element) {
|
|
64
|
+
super.enter(domNode, element);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
render(callback) {
|
|
68
|
+
this._marshallerRender(Grid.prototype, callback);
|
|
69
|
+
return this;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
commsError(source, error) {
|
|
73
|
+
alert("Comms Error:\n" + source + "\n" + error);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
HTML.prototype.mixin(HipieDDLMixin);
|
|
77
|
+
HTML.prototype._class += " marshaller_HTML";
|