@hpcc-js/composite 2.9.0 → 3.1.1
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/dist/index.js +1082 -1035
- package/dist/index.js.map +7 -1
- package/package.json +38 -41
- package/src/ChartPanel.ts +2 -4
- package/src/MegaChart.ts +1 -1
- package/src/MultiChart.ts +3 -3
- package/src/MultiChartSurface.ts +1 -1
- package/src/Persist.ts +1 -1
- package/src/__package__.ts +2 -2
- package/src/index.ts +7 -7
- package/types/ChartPanel.d.ts +2 -4
- package/types/Dermatology.d.ts +0 -1
- package/types/MegaChart.d.ts +4 -5
- package/types/MultiChart.d.ts +0 -1
- package/types/Persist.d.ts +0 -1
- package/types/Utility.d.ts +0 -1
- package/types/__package__.d.ts +2 -3
- package/types/index.d.ts +7 -8
- package/dist/index.es6.js +0 -1051
- package/dist/index.es6.js.map +0 -1
- package/dist/index.min.js +0 -2
- package/dist/index.min.js.map +0 -1
- package/types/ChartPanel.d.ts.map +0 -1
- package/types/Dermatology.d.ts.map +0 -1
- package/types/MegaChart.d.ts.map +0 -1
- package/types/MultiChart.d.ts.map +0 -1
- package/types/MultiChartSurface.d.ts +0 -5
- package/types/MultiChartSurface.d.ts.map +0 -1
- package/types/Persist.d.ts.map +0 -1
- package/types/Utility.d.ts.map +0 -1
- package/types/__package__.d.ts.map +0 -1
- package/types/index.d.ts.map +0 -1
- package/types-3.4/ChartPanel.d.ts +0 -19
- package/types-3.4/Dermatology.d.ts +0 -26
- package/types-3.4/MegaChart.d.ts +0 -155
- package/types-3.4/MultiChart.d.ts +0 -62
- package/types-3.4/MultiChartSurface.d.ts +0 -5
- package/types-3.4/Persist.d.ts +0 -7
- package/types-3.4/Utility.d.ts +0 -3
- package/types-3.4/__package__.d.ts +0 -4
- package/types-3.4/index.d.ts +0 -10
package/dist/index.es6.js
DELETED
|
@@ -1,1051 +0,0 @@
|
|
|
1
|
-
import { Utility as Utility$1, map, HTMLWidget, Text, select, Platform } from '@hpcc-js/common';
|
|
2
|
-
import { ChartPanel, Toolbar, Border } from '@hpcc-js/layout';
|
|
3
|
-
import { INDChart, IGraph } from '@hpcc-js/api';
|
|
4
|
-
import { OnOff, Button, Input, Select } from '@hpcc-js/form';
|
|
5
|
-
import { PropertyEditor, Legend, Html, Persist as Persist$1 } from '@hpcc-js/other';
|
|
6
|
-
|
|
7
|
-
var PKG_NAME = "@hpcc-js/composite";
|
|
8
|
-
var PKG_VERSION = "2.9.0";
|
|
9
|
-
var BUILD_VERSION = "2.107.0";
|
|
10
|
-
|
|
11
|
-
/******************************************************************************
|
|
12
|
-
Copyright (c) Microsoft Corporation.
|
|
13
|
-
|
|
14
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
15
|
-
purpose with or without fee is hereby granted.
|
|
16
|
-
|
|
17
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
18
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
19
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
20
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
21
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
22
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
23
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
24
|
-
***************************************************************************** */
|
|
25
|
-
/* global Reflect, Promise, SuppressedError, Symbol, Iterator */
|
|
26
|
-
|
|
27
|
-
var extendStatics = function(d, b) {
|
|
28
|
-
extendStatics = Object.setPrototypeOf ||
|
|
29
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
30
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
31
|
-
return extendStatics(d, b);
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
function __extends(d, b) {
|
|
35
|
-
if (typeof b !== "function" && b !== null)
|
|
36
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
37
|
-
extendStatics(d, b);
|
|
38
|
-
function __() { this.constructor = d; }
|
|
39
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
43
|
-
var e = new Error(message);
|
|
44
|
-
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
function requireWidget(classID) {
|
|
48
|
-
return new Promise(function (resolve, _reject) {
|
|
49
|
-
var parsedClassID = Utility$1.parseClassID(classID);
|
|
50
|
-
if (require) {
|
|
51
|
-
require([parsedClassID.package], function (Package) {
|
|
52
|
-
var Widget = null;
|
|
53
|
-
if (Package && Package[parsedClassID.widgetID]) {
|
|
54
|
-
Widget = Package[parsedClassID.widgetID];
|
|
55
|
-
}
|
|
56
|
-
resolve(parsedClassID.memberWidgetID ? (Widget.prototype ? Widget.prototype[parsedClassID.memberWidgetID] : Widget[parsedClassID.memberWidgetID]) : Widget);
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
function requireWidgets(classIDs) {
|
|
62
|
-
return Promise.all(classIDs.map(requireWidget));
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
var Utility = /*#__PURE__*/Object.freeze({
|
|
66
|
-
__proto__: null,
|
|
67
|
-
requireWidget: requireWidget,
|
|
68
|
-
requireWidgets: requireWidgets
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
var MultiChart = /** @class */ (function (_super) {
|
|
72
|
-
__extends(MultiChart, _super);
|
|
73
|
-
function MultiChart() {
|
|
74
|
-
var _this = _super.call(this) || this;
|
|
75
|
-
_this._allCharts = {};
|
|
76
|
-
INDChart.call(_this);
|
|
77
|
-
IGraph.call(_this);
|
|
78
|
-
_this._tag = "div";
|
|
79
|
-
_this._allCharts = {};
|
|
80
|
-
_this._allChartTypes.forEach(function (item) {
|
|
81
|
-
var newItem = JSON.parse(JSON.stringify(item));
|
|
82
|
-
newItem.widget = null;
|
|
83
|
-
this._allCharts[item.id] = newItem;
|
|
84
|
-
this._allCharts[item.display] = newItem;
|
|
85
|
-
this._allCharts[item.widgetClass] = newItem;
|
|
86
|
-
}, _this);
|
|
87
|
-
_this._chartTypeDefaults = {};
|
|
88
|
-
_this._chartTypeProperties = {};
|
|
89
|
-
return _this;
|
|
90
|
-
}
|
|
91
|
-
MultiChart.prototype.fields = function (_) {
|
|
92
|
-
var retVal = _super.prototype.fields.apply(this, arguments);
|
|
93
|
-
if (this.chart()) {
|
|
94
|
-
if (!arguments.length)
|
|
95
|
-
return this.chart().fields();
|
|
96
|
-
this.chart().fields(_);
|
|
97
|
-
}
|
|
98
|
-
return retVal;
|
|
99
|
-
};
|
|
100
|
-
MultiChart.prototype.columns = function (_, asDefault) {
|
|
101
|
-
var retVal = HTMLWidget.prototype.columns.apply(this, arguments);
|
|
102
|
-
if (this.chart()) {
|
|
103
|
-
if (!arguments.length)
|
|
104
|
-
return this.chart().columns();
|
|
105
|
-
this.chart().columns(_, asDefault);
|
|
106
|
-
}
|
|
107
|
-
return retVal;
|
|
108
|
-
};
|
|
109
|
-
MultiChart.prototype.data = function (_) {
|
|
110
|
-
var retVal = HTMLWidget.prototype.data.apply(this, arguments);
|
|
111
|
-
if (this.chart()) {
|
|
112
|
-
if (!arguments.length)
|
|
113
|
-
return this.chart().data();
|
|
114
|
-
this.chart().data(_);
|
|
115
|
-
}
|
|
116
|
-
return retVal;
|
|
117
|
-
};
|
|
118
|
-
MultiChart.prototype.hasOverlay = function () {
|
|
119
|
-
return this.chart() && this.chart().hasOverlay();
|
|
120
|
-
};
|
|
121
|
-
MultiChart.prototype.visible = function (_) {
|
|
122
|
-
if (!arguments.length)
|
|
123
|
-
return this.chart() && this.chart().visible();
|
|
124
|
-
if (this.chart()) {
|
|
125
|
-
this.chart().visible(_);
|
|
126
|
-
}
|
|
127
|
-
return this;
|
|
128
|
-
};
|
|
129
|
-
MultiChart.prototype.chartTypeDefaults = function (_) {
|
|
130
|
-
if (!arguments.length)
|
|
131
|
-
return this._chartTypeDefaults;
|
|
132
|
-
this._chartTypeDefaults = _;
|
|
133
|
-
return this;
|
|
134
|
-
};
|
|
135
|
-
MultiChart.prototype.chartTypeProperties = function (_) {
|
|
136
|
-
if (!arguments.length)
|
|
137
|
-
return this._chartTypeProperties;
|
|
138
|
-
this._chartTypeProperties = _;
|
|
139
|
-
return this;
|
|
140
|
-
};
|
|
141
|
-
MultiChart.prototype.getChartDataFamily = function () {
|
|
142
|
-
return this._allCharts[this.chartType()].family;
|
|
143
|
-
};
|
|
144
|
-
MultiChart.prototype.requireContent = function (chartType, callback) {
|
|
145
|
-
var classInfo = Utility$1.parseClassID(this._allCharts[chartType].widgetClass);
|
|
146
|
-
switch (classInfo.package) {
|
|
147
|
-
case "@hpcc-js/chart":
|
|
148
|
-
require(["@hpcc-js/chart"], function (mod) {
|
|
149
|
-
callback(new mod[classInfo.widgetID]());
|
|
150
|
-
});
|
|
151
|
-
break;
|
|
152
|
-
case "@hpcc-js/dgrid":
|
|
153
|
-
require(["@hpcc-js/dgrid"], function (mod) {
|
|
154
|
-
callback(new mod[classInfo.widgetID]());
|
|
155
|
-
});
|
|
156
|
-
break;
|
|
157
|
-
default:
|
|
158
|
-
requireWidget(this._allCharts[chartType].widgetClass).then(function (WidgetClass) {
|
|
159
|
-
callback(new WidgetClass());
|
|
160
|
-
});
|
|
161
|
-
}
|
|
162
|
-
};
|
|
163
|
-
MultiChart.prototype.switchChart = function (callback) {
|
|
164
|
-
if (this._switchingTo === this.chartType()) {
|
|
165
|
-
if (callback) {
|
|
166
|
-
callback(this);
|
|
167
|
-
}
|
|
168
|
-
return;
|
|
169
|
-
}
|
|
170
|
-
else if (this._switchingTo) {
|
|
171
|
-
console.warn("Attempting switch to: " + this.chartType() + ", before previous switch is complete (" + this._switchingTo + ")");
|
|
172
|
-
}
|
|
173
|
-
this._switchingTo = this.chartType();
|
|
174
|
-
var oldContent = this.chart();
|
|
175
|
-
var context = this;
|
|
176
|
-
this.requireContent(this.chartType(), function (newContent) {
|
|
177
|
-
if (newContent !== oldContent) {
|
|
178
|
-
var size = context.size();
|
|
179
|
-
newContent
|
|
180
|
-
.fields(context.fields())
|
|
181
|
-
.data(context.data())
|
|
182
|
-
.size(size);
|
|
183
|
-
context.chart(newContent);
|
|
184
|
-
if (oldContent) {
|
|
185
|
-
oldContent
|
|
186
|
-
.size({ width: 1, height: 1 })
|
|
187
|
-
.render();
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
delete context._switchingTo;
|
|
191
|
-
if (callback) {
|
|
192
|
-
callback(this);
|
|
193
|
-
}
|
|
194
|
-
});
|
|
195
|
-
};
|
|
196
|
-
MultiChart.prototype.update = function (domNode, element) {
|
|
197
|
-
_super.prototype.update.call(this, domNode, element);
|
|
198
|
-
var content = element.selectAll(".multiChart").data(this.chart() ? [this.chart()] : [], function (d) { return d._id; });
|
|
199
|
-
content.enter().append("div")
|
|
200
|
-
.attr("class", "multiChart")
|
|
201
|
-
.each(function (d) {
|
|
202
|
-
d.target(this);
|
|
203
|
-
});
|
|
204
|
-
var currChart = this.chart();
|
|
205
|
-
if (currChart) {
|
|
206
|
-
for (var key in this._chartTypeDefaults) {
|
|
207
|
-
if (currChart[key + "_default"]) {
|
|
208
|
-
try {
|
|
209
|
-
currChart[key + "_default"](this._chartTypeDefaults[key]);
|
|
210
|
-
}
|
|
211
|
-
catch (e) {
|
|
212
|
-
console.warn("Exception Setting Default: " + key);
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
else {
|
|
216
|
-
console.warn("Unknown Default: " + key);
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
this._chartTypeDefaults = {};
|
|
220
|
-
for (var propKey in this._chartTypeProperties) {
|
|
221
|
-
if (currChart[propKey]) {
|
|
222
|
-
try {
|
|
223
|
-
currChart[propKey](this._chartTypeProperties[propKey]);
|
|
224
|
-
}
|
|
225
|
-
catch (e) {
|
|
226
|
-
console.warn("Exception Setting Property: " + propKey);
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
else {
|
|
230
|
-
console.warn("Unknown Property: " + propKey);
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
this._chartTypeProperties = {};
|
|
234
|
-
}
|
|
235
|
-
var context = this;
|
|
236
|
-
content
|
|
237
|
-
.each(function (d) { d.resize(context.size()); });
|
|
238
|
-
content.exit().transition()
|
|
239
|
-
.each(function (d) { d.target(null); })
|
|
240
|
-
.remove();
|
|
241
|
-
};
|
|
242
|
-
MultiChart.prototype.exit = function (domNode, element) {
|
|
243
|
-
if (this._chartMonitor) {
|
|
244
|
-
this._chartMonitor.remove();
|
|
245
|
-
delete this._chartMonitor;
|
|
246
|
-
}
|
|
247
|
-
if (this.chart()) {
|
|
248
|
-
this.chart().target(null);
|
|
249
|
-
}
|
|
250
|
-
_super.prototype.exit.call(this, domNode, element);
|
|
251
|
-
};
|
|
252
|
-
MultiChart.prototype.render = function (_callback) {
|
|
253
|
-
if (this.chartType() && (!this.chart() || (this.chart().classID() !== this._allCharts[this.chartType()].widgetClass))) {
|
|
254
|
-
var context_1 = this;
|
|
255
|
-
var args_1 = arguments;
|
|
256
|
-
this.switchChart(function () {
|
|
257
|
-
HTMLWidget.prototype.render.apply(context_1, args_1);
|
|
258
|
-
});
|
|
259
|
-
return this;
|
|
260
|
-
}
|
|
261
|
-
return HTMLWidget.prototype.render.apply(this, arguments);
|
|
262
|
-
};
|
|
263
|
-
return MultiChart;
|
|
264
|
-
}(HTMLWidget));
|
|
265
|
-
MultiChart.prototype._class += " composite_MultiChart";
|
|
266
|
-
MultiChart.prototype.implements(INDChart.prototype);
|
|
267
|
-
MultiChart.prototype.implements(IGraph.prototype);
|
|
268
|
-
MultiChart.prototype._otherChartTypes = [
|
|
269
|
-
{ id: "FORM", display: "Form", widgetClass: "form_FieldForm" }
|
|
270
|
-
].map(function (item) { item.family = "other"; return item; });
|
|
271
|
-
MultiChart.prototype._graphChartTypes = [
|
|
272
|
-
{ id: "GRAPH", display: "Graph", widgetClass: "graph_Graph" },
|
|
273
|
-
{ id: "ADJACENCY_GRAPH", display: "Graph", widgetClass: "graph_AdjacencyGraph" },
|
|
274
|
-
{ id: "GRAPHC", display: "GraphC", widgetClass: "graph_GraphC" }
|
|
275
|
-
].map(function (item) { item.family = "GRAPH"; return item; });
|
|
276
|
-
MultiChart.prototype._1DChartTypes = [].map(function (item) { item.family = "1D"; return item; });
|
|
277
|
-
MultiChart.prototype._2DChartTypes = [
|
|
278
|
-
{ id: "SUMMARY", display: "Summary", widgetClass: "chart_Summary" },
|
|
279
|
-
{ id: "BUBBLE", display: "Bubble", widgetClass: "chart_Bubble" },
|
|
280
|
-
{ id: "PIE", display: "Pie", widgetClass: "chart_Pie" },
|
|
281
|
-
{ id: "WORD_CLOUD", display: "Word Cloud", widgetClass: "other_WordCloud" }
|
|
282
|
-
].map(function (item) { item.family = "2D"; return item; });
|
|
283
|
-
MultiChart.prototype._NDChartTypes = [
|
|
284
|
-
{ id: "COLUMN", display: "Column", widgetClass: "chart_Column" },
|
|
285
|
-
{ id: "BAR", display: "Bar", widgetClass: "chart_Bar" },
|
|
286
|
-
{ id: "LINE", display: "Line", widgetClass: "chart_Line" },
|
|
287
|
-
{ id: "AREA", display: "Area", widgetClass: "chart_Area" },
|
|
288
|
-
{ id: "STEP", display: "Step", widgetClass: "chart_Step" },
|
|
289
|
-
{ id: "SCATTER", display: "Scatter", widgetClass: "chart_Scatter" },
|
|
290
|
-
{ id: "HEXBIN", display: "Hex Bin", widgetClass: "chart_HexBin" }
|
|
291
|
-
].map(function (item) { item.family = "ND"; return item; });
|
|
292
|
-
MultiChart.prototype._mapChartTypes = [
|
|
293
|
-
{ id: "CHORO_USSTATES", display: "US State Choropleth", widgetClass: "map_ChoroplethStates" },
|
|
294
|
-
{ id: "CHORO_USCOUNTIES", display: "US County Choropleth", widgetClass: "map_ChoroplethCounties" },
|
|
295
|
-
{ id: "CHORO_COUNTRIES", display: "Country Choropleth", widgetClass: "map_ChoroplethCountries" },
|
|
296
|
-
{ id: "GMAP_CHORO_USCOUNTIES", display: "Google Map US County Choropleth", widgetClass: "map_GMapCounties" },
|
|
297
|
-
{ id: "GOOGLE_MAP", display: "Google Map", widgetClass: "map_GMapLayered" },
|
|
298
|
-
{ id: "OPENSTREET", display: "Open Street Map", widgetClass: "map_OpenStreet" }
|
|
299
|
-
].map(function (item) { item.family = "map"; return item; });
|
|
300
|
-
MultiChart.prototype._anyChartTypes = [
|
|
301
|
-
{ id: "TABLE", display: "Table", widgetClass: "dgrid_Table" },
|
|
302
|
-
{ id: "TABLE_LEGACY", display: "Table (legacy)", widgetClass: "other_Table" },
|
|
303
|
-
{ id: "TABLE_NESTED", display: "Nested Table", widgetClass: "other_NestedTable" },
|
|
304
|
-
{ id: "TABLE_CALENDAR", display: "Table driven Calendar Heat Map", widgetClass: "other_CalendarHeatMap" },
|
|
305
|
-
{ id: "TABLE_BULLET", display: "Table driven bullet chart", widgetClass: "chart_Bullet" },
|
|
306
|
-
{ id: "TABLE_SELECT", display: "Table driven select", widgetClass: "other_Select" },
|
|
307
|
-
{ id: "TABLE_AUTOCOMPLETE", display: "Table driven auto complete", widgetClass: "other_AutoCompleteText" },
|
|
308
|
-
{ id: "TABLE_OPPORTUNITY", display: "Table driven opportunity widget", widgetClass: "graph_Opportunity" },
|
|
309
|
-
{ id: "TABLE_TREE", display: "Table driven tree", widgetClass: "tree_Dendrogram" },
|
|
310
|
-
{ id: "TABLE_TREEMAP", display: "Table driven Treemap", widgetClass: "tree_Treemap" },
|
|
311
|
-
{ id: "TABLE_SANKEY", display: "Table driven Sankey", widgetClass: "graph_Sankey" },
|
|
312
|
-
{ id: "TABLE_GMAP_PIN", display: "Table driven Google Map (pins)", widgetClass: "map_GMapPin" },
|
|
313
|
-
{ id: "TABLE_GMAP_PINLINE", display: "Table driven Google Map (pins/lines)", widgetClass: "map_GMapPinLine" },
|
|
314
|
-
{ id: "TABLE_XML_TREE", display: "Table driven XML Tree", widgetClass: "tree_Indented" }
|
|
315
|
-
].map(function (item) { item.family = "any"; return item; });
|
|
316
|
-
MultiChart.prototype._allChartTypes =
|
|
317
|
-
MultiChart.prototype._otherChartTypes.concat(MultiChart.prototype._graphChartTypes.concat(MultiChart.prototype._1DChartTypes.concat(MultiChart.prototype._2DChartTypes.concat(MultiChart.prototype._NDChartTypes.concat(MultiChart.prototype._mapChartTypes.concat(MultiChart.prototype._anyChartTypes))))));
|
|
318
|
-
MultiChart.prototype._allMap = map(MultiChart.prototype._allChartTypes, function (item) { return item.family; });
|
|
319
|
-
MultiChart.prototype._allFamilies = MultiChart.prototype._allMap.keys();
|
|
320
|
-
MultiChart.prototype._allChartTypesMap = {};
|
|
321
|
-
MultiChart.prototype._allChartTypesByClass = {};
|
|
322
|
-
MultiChart.prototype._allChartTypes.forEach(function (item) {
|
|
323
|
-
item.widgetPath = Utility$1.widgetPath(item.widgetClass);
|
|
324
|
-
MultiChart.prototype._allChartTypesMap[item.id] = item;
|
|
325
|
-
MultiChart.prototype._allChartTypesByClass[item.widgetClass] = item;
|
|
326
|
-
});
|
|
327
|
-
MultiChart.prototype.publishReset();
|
|
328
|
-
MultiChart.prototype.publish("hideRowOnLegendClick", false, "boolean", "Enable/Disable hiding row on legend clicks", null, { tags: ["Basic"] });
|
|
329
|
-
MultiChart.prototype.publish("chartType", "BUBBLE", "set", "Chart Type", MultiChart.prototype._allChartTypes.map(function (item) { return item.id; }), { tags: ["Basic"] });
|
|
330
|
-
MultiChart.prototype.publish("chart", null, "widget", "Chart", null, { tags: ["Basic"] });
|
|
331
|
-
var _origChart = MultiChart.prototype.chart;
|
|
332
|
-
MultiChart.prototype.chart = function (_) {
|
|
333
|
-
var retVal = _origChart.apply(this, arguments);
|
|
334
|
-
if (arguments.length) {
|
|
335
|
-
var context_2 = this;
|
|
336
|
-
if (this._allChartTypesByClass[_.classID()]) {
|
|
337
|
-
this.chartType(this._allChartTypesByClass[_.classID()].id);
|
|
338
|
-
}
|
|
339
|
-
else {
|
|
340
|
-
console.warn("Unknown Class ID: " + _.classID());
|
|
341
|
-
}
|
|
342
|
-
_.click = function (_row, _column, _selected) {
|
|
343
|
-
context_2.click.apply(context_2, arguments);
|
|
344
|
-
};
|
|
345
|
-
_.dblclick = function (_row, _column, _selected) {
|
|
346
|
-
context_2.dblclick.apply(context_2, arguments);
|
|
347
|
-
};
|
|
348
|
-
_.vertex_click = function (row, column, selected, more) {
|
|
349
|
-
context_2.vertex_click.apply(context_2, arguments);
|
|
350
|
-
};
|
|
351
|
-
_.vertex_dblclick = function (row, column, selected, more) {
|
|
352
|
-
context_2.vertex_dblclick.apply(context_2, arguments);
|
|
353
|
-
};
|
|
354
|
-
_.edge_click = function (row, column, selected, more) {
|
|
355
|
-
context_2.edge_click.apply(context_2, arguments);
|
|
356
|
-
};
|
|
357
|
-
_.edge_dblclick = function (row, column, selected, more) {
|
|
358
|
-
context_2.edge_dblclick.apply(context_2, arguments);
|
|
359
|
-
};
|
|
360
|
-
if (this._chartMonitor) {
|
|
361
|
-
this._chartMonitor.remove();
|
|
362
|
-
delete this._chartMonitor;
|
|
363
|
-
}
|
|
364
|
-
this._chartMonitor = _.monitor(function (key, newVal, oldVal) {
|
|
365
|
-
context_2.broadcast(key, newVal, oldVal, _);
|
|
366
|
-
});
|
|
367
|
-
}
|
|
368
|
-
return retVal;
|
|
369
|
-
};
|
|
370
|
-
|
|
371
|
-
function styleInject(css, ref) {
|
|
372
|
-
if ( ref === void 0 ) ref = {};
|
|
373
|
-
var insertAt = ref.insertAt;
|
|
374
|
-
|
|
375
|
-
if (!css || typeof document === 'undefined') { return; }
|
|
376
|
-
|
|
377
|
-
var head = document.head || document.getElementsByTagName('head')[0];
|
|
378
|
-
var style = document.createElement('style');
|
|
379
|
-
style.type = 'text/css';
|
|
380
|
-
|
|
381
|
-
if (insertAt === 'top') {
|
|
382
|
-
if (head.firstChild) {
|
|
383
|
-
head.insertBefore(style, head.firstChild);
|
|
384
|
-
} else {
|
|
385
|
-
head.appendChild(style);
|
|
386
|
-
}
|
|
387
|
-
} else {
|
|
388
|
-
head.appendChild(style);
|
|
389
|
-
}
|
|
390
|
-
|
|
391
|
-
if (style.styleSheet) {
|
|
392
|
-
style.styleSheet.cssText = css;
|
|
393
|
-
} else {
|
|
394
|
-
style.appendChild(document.createTextNode(css));
|
|
395
|
-
}
|
|
396
|
-
}
|
|
397
|
-
|
|
398
|
-
var css_248z$2 = ".composite_ChartPanel>.body{display:flex;flex-flow:row;margin:0;padding:0}.composite_ChartPanel>.body>article{flex:3 1 60%;order:2}.composite_ChartPanel>.body>nav{flex:1 6 20%;order:1}.composite_ChartPanel>.body>aside{flex:1 6 20%;margin-left:4px;order:3}footer,header{display:block}";
|
|
399
|
-
styleInject(css_248z$2);
|
|
400
|
-
|
|
401
|
-
var Summary = /** @class */ (function (_super) {
|
|
402
|
-
__extends(Summary, _super);
|
|
403
|
-
function Summary() {
|
|
404
|
-
return _super.call(this) || this;
|
|
405
|
-
}
|
|
406
|
-
Summary.prototype.enter = function (domNode, element) {
|
|
407
|
-
_super.prototype.enter.call(this, domNode, element);
|
|
408
|
-
element.append("p");
|
|
409
|
-
};
|
|
410
|
-
Summary.prototype.update = function (domNode, element) {
|
|
411
|
-
_super.prototype.update.call(this, domNode, element);
|
|
412
|
-
element.select("p").text(this.text());
|
|
413
|
-
};
|
|
414
|
-
return Summary;
|
|
415
|
-
}(HTMLWidget));
|
|
416
|
-
Summary.prototype.publish("text", "", "string");
|
|
417
|
-
var MultiChartPanel = /** @class */ (function (_super) {
|
|
418
|
-
__extends(MultiChartPanel, _super);
|
|
419
|
-
function MultiChartPanel() {
|
|
420
|
-
var _this = _super.call(this) || this;
|
|
421
|
-
_this.widget(new MultiChart().chartType("COLUMN"));
|
|
422
|
-
return _this;
|
|
423
|
-
}
|
|
424
|
-
MultiChartPanel.prototype.multiChart = function () {
|
|
425
|
-
return this._widget;
|
|
426
|
-
};
|
|
427
|
-
MultiChartPanel.prototype.chartType = function (_) {
|
|
428
|
-
if (!arguments.length)
|
|
429
|
-
return this._widget.chartType();
|
|
430
|
-
this._widget.chartType(_);
|
|
431
|
-
return this;
|
|
432
|
-
};
|
|
433
|
-
MultiChartPanel.prototype.chart = function (_) {
|
|
434
|
-
if (!arguments.length)
|
|
435
|
-
return this._widget.chart();
|
|
436
|
-
this._widget.chart(_);
|
|
437
|
-
return this;
|
|
438
|
-
};
|
|
439
|
-
MultiChartPanel.prototype.chartTypeDefaults = function (_) {
|
|
440
|
-
if (!arguments.length)
|
|
441
|
-
return this._widget.chartTypeDefaults();
|
|
442
|
-
this._widget.chartTypeDefaults(_);
|
|
443
|
-
return this;
|
|
444
|
-
};
|
|
445
|
-
MultiChartPanel.prototype.chartTypeProperties = function (_) {
|
|
446
|
-
if (!arguments.length)
|
|
447
|
-
return this._widget.chartTypeProperties();
|
|
448
|
-
this._widget.chartTypeProperties(_);
|
|
449
|
-
return this;
|
|
450
|
-
};
|
|
451
|
-
MultiChartPanel.prototype.update = function (domNode, element) {
|
|
452
|
-
_super.prototype.update.call(this, domNode, element);
|
|
453
|
-
if (this._widget instanceof MultiChart) {
|
|
454
|
-
this._legend.dataFamily(this._widget.getChartDataFamily());
|
|
455
|
-
}
|
|
456
|
-
_super.prototype.update.call(this, domNode, element);
|
|
457
|
-
};
|
|
458
|
-
return MultiChartPanel;
|
|
459
|
-
}(ChartPanel));
|
|
460
|
-
MultiChartPanel.prototype._class += " composite_MultiChartPanel";
|
|
461
|
-
|
|
462
|
-
var css_248z$1 = ".composite_Dermatology{background-color:#f8f8ff}.composite_Dermatology .common_Icon{background-color:red;opacity:.75}.composite_Dermatology .common_Icon .common_Shape{fill:#fff;stroke:#a9a9a9;cursor:pointer}.composite_Dermatology .common_Icon.show .common_Shape{fill:#d3d3d3}.composite_Dermatology .common_Icon .common_FAChar .common_Text{fill:#a9a9a9;cursor:pointer}.composite_Dermatology .other_PropertyEditor{font-family:sans-serif;font-size:11px}.composite_Dermatology .other_PropertyEditor input{border:0;font-family:sans-serif;font-size:11px}.composite_Dermatology .other_PropertyEditor .property-label{height:unset}";
|
|
463
|
-
styleInject(css_248z$1);
|
|
464
|
-
|
|
465
|
-
var Dermatology = /** @class */ (function (_super) {
|
|
466
|
-
__extends(Dermatology, _super);
|
|
467
|
-
function Dermatology() {
|
|
468
|
-
var _this = _super.call(this) || this;
|
|
469
|
-
_this._toolbar = new Toolbar()
|
|
470
|
-
.title("Dermatology");
|
|
471
|
-
_this._propEditor = new PropertyEditor()
|
|
472
|
-
.show_settings(true);
|
|
473
|
-
return _this;
|
|
474
|
-
}
|
|
475
|
-
Dermatology.prototype.showProperties = function (_) {
|
|
476
|
-
if (!arguments.length)
|
|
477
|
-
return this._showProperties;
|
|
478
|
-
this._showProperties = _;
|
|
479
|
-
this
|
|
480
|
-
.rightPercentage(0)
|
|
481
|
-
.rightSize(this._showProperties ? 360 : 0)
|
|
482
|
-
.setContent("right", this._showProperties ? this._propEditor : null);
|
|
483
|
-
var widget = this.widget();
|
|
484
|
-
if (widget && widget.designMode) {
|
|
485
|
-
widget.designMode(this._showProperties);
|
|
486
|
-
}
|
|
487
|
-
return this;
|
|
488
|
-
};
|
|
489
|
-
Dermatology.prototype.toggleProperties = function () {
|
|
490
|
-
return this.showProperties(!this.showProperties());
|
|
491
|
-
};
|
|
492
|
-
Dermatology.prototype.enter = function (domNode, element) {
|
|
493
|
-
_super.prototype.enter.call(this, domNode, element);
|
|
494
|
-
this
|
|
495
|
-
.topPercentage(0)
|
|
496
|
-
.topSize(0)
|
|
497
|
-
.setContent("top", this._toolbar);
|
|
498
|
-
this.getCell("top").surfaceShadow(true);
|
|
499
|
-
var context = this;
|
|
500
|
-
this._propsButton = new OnOff()
|
|
501
|
-
.id(this.id() + "_props")
|
|
502
|
-
.value("Properties")
|
|
503
|
-
.on("click", function () {
|
|
504
|
-
context
|
|
505
|
-
.toggleProperties()
|
|
506
|
-
.render();
|
|
507
|
-
});
|
|
508
|
-
this._toolbar.widgets([this._propsButton]);
|
|
509
|
-
};
|
|
510
|
-
Dermatology.prototype.update = function (domNode, element) {
|
|
511
|
-
this
|
|
512
|
-
.topPercentage(0)
|
|
513
|
-
.topSize(this.showToolbar() ? 32 : 0);
|
|
514
|
-
_super.prototype.update.call(this, domNode, element);
|
|
515
|
-
var widget = this.widget();
|
|
516
|
-
element.style("background-color", widget && widget.surfaceShadow ? null : "white");
|
|
517
|
-
};
|
|
518
|
-
Dermatology.prototype.render = function (callback) {
|
|
519
|
-
var widget = this.widget();
|
|
520
|
-
if (widget !== this._prevWidget) {
|
|
521
|
-
if (widget && widget.surfaceShadow) {
|
|
522
|
-
widget.surfaceBackgroundColor_default("white");
|
|
523
|
-
}
|
|
524
|
-
this.setContent("center", widget);
|
|
525
|
-
this._propEditor.widget(widget);
|
|
526
|
-
this._prevWidget = widget;
|
|
527
|
-
}
|
|
528
|
-
return _super.prototype.render.call(this, callback);
|
|
529
|
-
};
|
|
530
|
-
return Dermatology;
|
|
531
|
-
}(Border));
|
|
532
|
-
Dermatology.prototype._class += " composite_Dermatology";
|
|
533
|
-
Dermatology.prototype.publish("showToolbar", true, "boolean", "Show Toolbar");
|
|
534
|
-
Dermatology.prototype.publish("widget", null, "widget", "Widget");
|
|
535
|
-
|
|
536
|
-
var css_248z = ".composite_MegaChart-Info,.composite_MegaChart-Info *,.composite_MegaChart-Maximize,.composite_MegaChart-Maximize *{font-family:FontAwesome}";
|
|
537
|
-
styleInject(css_248z);
|
|
538
|
-
|
|
539
|
-
var MegaChart = /** @class */ (function (_super) {
|
|
540
|
-
__extends(MegaChart, _super);
|
|
541
|
-
function MegaChart() {
|
|
542
|
-
var _this = _super.call(this) || this;
|
|
543
|
-
_this._chart = new MultiChart();
|
|
544
|
-
_this._toolbar = new Toolbar();
|
|
545
|
-
_this._valueTitle = new Text();
|
|
546
|
-
_this._domainTitle = new Text();
|
|
547
|
-
_this._legend = new Legend();
|
|
548
|
-
_this._tag = "div";
|
|
549
|
-
var context = _this;
|
|
550
|
-
_this._chart.click = function () {
|
|
551
|
-
context.click.apply(context, arguments);
|
|
552
|
-
};
|
|
553
|
-
_this._chart.dblclick = function () {
|
|
554
|
-
context.dblclick.apply(context, arguments);
|
|
555
|
-
};
|
|
556
|
-
_this._chart.vertex_click = function () {
|
|
557
|
-
context.vertex_click.apply(context, arguments);
|
|
558
|
-
};
|
|
559
|
-
_this._chart.vertex_dblclick = function () {
|
|
560
|
-
context.vertex_dblclick.apply(context, arguments);
|
|
561
|
-
};
|
|
562
|
-
_this._chart.edge_click = function () {
|
|
563
|
-
context.edge_click.apply(context, arguments);
|
|
564
|
-
};
|
|
565
|
-
_this._chart.edge_dblclick = function () {
|
|
566
|
-
context.edge_dblclick.apply(context, arguments);
|
|
567
|
-
};
|
|
568
|
-
return _this;
|
|
569
|
-
}
|
|
570
|
-
MegaChart.prototype.toolbarWidgets = function (_) {
|
|
571
|
-
if (!arguments.length)
|
|
572
|
-
return this._toolbar.widgets();
|
|
573
|
-
this._toolbar.widgets(_);
|
|
574
|
-
return this;
|
|
575
|
-
};
|
|
576
|
-
MegaChart.prototype.chartTypeDefaults = function (_) {
|
|
577
|
-
if (!arguments.length)
|
|
578
|
-
return this._chart.chartTypeDefaults();
|
|
579
|
-
this._chart.chartTypeDefaults(_);
|
|
580
|
-
return this;
|
|
581
|
-
};
|
|
582
|
-
MegaChart.prototype.chartTypeProperties = function (_) {
|
|
583
|
-
if (!arguments.length)
|
|
584
|
-
return this._chart.chartTypeProperties();
|
|
585
|
-
this._chart.chartTypeProperties(_);
|
|
586
|
-
return this;
|
|
587
|
-
};
|
|
588
|
-
MegaChart.prototype.fields = function (_) {
|
|
589
|
-
if (!arguments.length)
|
|
590
|
-
return this._chart.fields();
|
|
591
|
-
this._chart.fields(_);
|
|
592
|
-
return this;
|
|
593
|
-
};
|
|
594
|
-
MegaChart.prototype.columns = function (_, asDefault) {
|
|
595
|
-
if (!arguments.length)
|
|
596
|
-
return this._chart.columns();
|
|
597
|
-
this._chart.columns(_, asDefault);
|
|
598
|
-
return this;
|
|
599
|
-
};
|
|
600
|
-
MegaChart.prototype.data = function (_) {
|
|
601
|
-
if (!arguments.length)
|
|
602
|
-
return this._chart.data();
|
|
603
|
-
this._chart.data(_);
|
|
604
|
-
return this;
|
|
605
|
-
};
|
|
606
|
-
MegaChart.prototype.downloadCSV = function () {
|
|
607
|
-
Utility$1.downloadString("CSV", this._chart.export("CSV"));
|
|
608
|
-
return this;
|
|
609
|
-
};
|
|
610
|
-
MegaChart.prototype.enter = function (domNode, element) {
|
|
611
|
-
_super.prototype.enter.call(this, domNode, element);
|
|
612
|
-
var context = this;
|
|
613
|
-
this.topShrinkWrap(false).topPercentage(0).topSize(30);
|
|
614
|
-
this._dataCount = new Html()
|
|
615
|
-
.classed({ "composite_MegaChart-dataCount": true })
|
|
616
|
-
.id(this.id() + "_dataCount")
|
|
617
|
-
.html('<span class="MegaChart-dataCount-label">Count:</span> <span class="MegaChart-dataCount-value">' + (this.data() ? this.data().length : "0") + "</span>")
|
|
618
|
-
.overflowX("visible")
|
|
619
|
-
.overflowY("visible");
|
|
620
|
-
this._csvButton = new Button()
|
|
621
|
-
.classed({ "composite_MegaChart-CSV": true })
|
|
622
|
-
.id(this.id() + "_csv")
|
|
623
|
-
.value("CSV");
|
|
624
|
-
this._csvButton.click = function (a) {
|
|
625
|
-
context.downloadCSV();
|
|
626
|
-
};
|
|
627
|
-
this._infoButton = new Button()
|
|
628
|
-
.classed({ "composite_MegaChart-Info": true })
|
|
629
|
-
.id(this.id() + "_info")
|
|
630
|
-
.value(this.infoIcon());
|
|
631
|
-
this._maximizeButton = new Button()
|
|
632
|
-
.classed({ "composite_MegaChart-Maximize": true })
|
|
633
|
-
.id(this.id() + "_maximize")
|
|
634
|
-
.value("\uf2d0");
|
|
635
|
-
this._maximizeButton.click = function (buttonWidget) {
|
|
636
|
-
var target = context.target();
|
|
637
|
-
var node = target;
|
|
638
|
-
var isMaximized = select(target).classed("__hpccisMaximized");
|
|
639
|
-
// Find the layout_Grid ancestor
|
|
640
|
-
var parentGrid = context.locateAncestor("layout_Grid");
|
|
641
|
-
if (parentGrid) {
|
|
642
|
-
node = parentGrid.element().node();
|
|
643
|
-
}
|
|
644
|
-
else {
|
|
645
|
-
node = document.body;
|
|
646
|
-
}
|
|
647
|
-
var targetElement = select(context.target());
|
|
648
|
-
if (isMaximized) {
|
|
649
|
-
// Restore from maximized to natural size/position
|
|
650
|
-
var targetParentBox_1 = target.parentElement.getBoundingClientRect();
|
|
651
|
-
var targetPaddingTop_1 = parseInt(getComputedStyle(target, null).getPropertyValue("padding-top").replace("px", ""));
|
|
652
|
-
var targetPaddingLeft_1 = parseInt(getComputedStyle(target, null).getPropertyValue("padding-left").replace("px", ""));
|
|
653
|
-
var targetPaddingRight_1 = parseInt(getComputedStyle(target, null).getPropertyValue("padding-right").replace("px", ""));
|
|
654
|
-
var targetPaddingBottom_1 = parseInt(getComputedStyle(target, null).getPropertyValue("padding-bottom").replace("px", ""));
|
|
655
|
-
context.contentDiv.style("opacity", 0).transition(100);
|
|
656
|
-
targetElement.transition() // .duration(3000)
|
|
657
|
-
.style("top", targetParentBox_1.top + "px")
|
|
658
|
-
.style("left", targetParentBox_1.left + "px")
|
|
659
|
-
.style("width", (targetParentBox_1.width - targetPaddingLeft_1 - targetPaddingRight_1) + "px")
|
|
660
|
-
.style("height", (targetParentBox_1.height - targetPaddingTop_1 - targetPaddingBottom_1) + "px")
|
|
661
|
-
.each("end", function () {
|
|
662
|
-
targetElement.style("position", target.__old_position);
|
|
663
|
-
targetElement.style("z-index", target.__old_zindex);
|
|
664
|
-
targetElement.style("background-color", target.__old_backgroundColor);
|
|
665
|
-
targetElement.style("box-shadow", target.__old_boxshadow);
|
|
666
|
-
context
|
|
667
|
-
.resize({
|
|
668
|
-
width: targetParentBox_1.width - targetPaddingLeft_1 - targetPaddingRight_1,
|
|
669
|
-
height: targetParentBox_1.height - targetPaddingTop_1 - targetPaddingBottom_1
|
|
670
|
-
})
|
|
671
|
-
.render(function () {
|
|
672
|
-
context.contentDiv.transition()
|
|
673
|
-
.style("opacity", 1);
|
|
674
|
-
});
|
|
675
|
-
buttonWidget.value("\uf2d0").render();
|
|
676
|
-
});
|
|
677
|
-
}
|
|
678
|
-
else {
|
|
679
|
-
// Maximize this MegaChart
|
|
680
|
-
target.__old_position = target.style.position;
|
|
681
|
-
target.__old_zindex = target.style.zIndex;
|
|
682
|
-
target.__old_boxshadow = target.style.boxShadow;
|
|
683
|
-
target.__old_backgroundColor = context.element().style("background-color");
|
|
684
|
-
var grid = select(node).datum();
|
|
685
|
-
var gridTarget = grid.target();
|
|
686
|
-
var gridBox_1 = grid ? gridTarget.getBoundingClientRect() : node.getBoundingClientRect();
|
|
687
|
-
var gridPaddingTop_1 = parseInt(getComputedStyle(gridTarget, null).getPropertyValue("padding-top").replace("px", ""));
|
|
688
|
-
var gridPaddingLeft_1 = parseInt(getComputedStyle(gridTarget, null).getPropertyValue("padding-left").replace("px", ""));
|
|
689
|
-
var gridPaddingRight_1 = parseInt(getComputedStyle(gridTarget, null).getPropertyValue("padding-right").replace("px", ""));
|
|
690
|
-
var gridPaddingBottom_1 = parseInt(getComputedStyle(gridTarget, null).getPropertyValue("padding-bottom").replace("px", ""));
|
|
691
|
-
context.contentDiv.style("opacity", 0).transition(100);
|
|
692
|
-
targetElement
|
|
693
|
-
.style("position", "fixed")
|
|
694
|
-
.style("z-index", 999999)
|
|
695
|
-
.style("box-shadow", "0 8px 8px 0 rgba(0,0,0,.14),0 12px 4px -8px rgba(0,0,0,.2),0 4px 20px 0 rgba(0,0,0,.12)")
|
|
696
|
-
.style("background-color", target.__old_backgroundColor)
|
|
697
|
-
.transition() // .duration(3000)
|
|
698
|
-
.style("top", (gridBox_1.top + gridPaddingTop_1) + "px")
|
|
699
|
-
.style("left", (gridBox_1.left + gridPaddingLeft_1) + "px")
|
|
700
|
-
.style("width", (gridBox_1.width - gridPaddingLeft_1 - gridPaddingRight_1) + "px")
|
|
701
|
-
.style("height", (gridBox_1.height - gridPaddingTop_1 - gridPaddingBottom_1) + "px")
|
|
702
|
-
.each("end", function () {
|
|
703
|
-
targetElement.style("background-color", context.maximizedBackgroundColor());
|
|
704
|
-
context
|
|
705
|
-
.resize({
|
|
706
|
-
width: (gridBox_1.width - gridPaddingLeft_1 - gridPaddingRight_1),
|
|
707
|
-
height: (gridBox_1.height - gridPaddingTop_1 - gridPaddingBottom_1)
|
|
708
|
-
})
|
|
709
|
-
.render(function () {
|
|
710
|
-
context.contentDiv.transition()
|
|
711
|
-
.style("opacity", 1);
|
|
712
|
-
});
|
|
713
|
-
buttonWidget.value("\uf2d1").render();
|
|
714
|
-
});
|
|
715
|
-
}
|
|
716
|
-
select(target).classed("__hpccisMaximized", !isMaximized);
|
|
717
|
-
};
|
|
718
|
-
this._legendButton = new Input()
|
|
719
|
-
.classed({ "composite_MegaChart-legend": true })
|
|
720
|
-
.id(this.id() + "_legend")
|
|
721
|
-
.type("checkbox")
|
|
722
|
-
.inlineLabel("Legend: ");
|
|
723
|
-
this._legendButton.click = function (a) {
|
|
724
|
-
context.render();
|
|
725
|
-
};
|
|
726
|
-
this._chartTypeSelect = new Select()
|
|
727
|
-
.classed({ "composite_MegaChart-chartType": true })
|
|
728
|
-
.id(this.id() + "_chartType")
|
|
729
|
-
.selectOptions(this._allChartTypes.map(function (a) { return [a.id, a.display]; }))
|
|
730
|
-
.value(this.chartType());
|
|
731
|
-
this._chartTypeSelect.change = function (a) {
|
|
732
|
-
context.chartType(a.value()).render();
|
|
733
|
-
};
|
|
734
|
-
this.setContent("center", this._chart);
|
|
735
|
-
this._legend
|
|
736
|
-
.targetWidget(this._chart)
|
|
737
|
-
.orientation(["top", "bottom"].indexOf(this.legendPosition()) !== -1 ? "horizontal" : "vertical")
|
|
738
|
-
.fixedSize(true);
|
|
739
|
-
this._prevLegendPosition = this.legendPosition();
|
|
740
|
-
if (this.valueAxisTitle()) {
|
|
741
|
-
this.setContent("left", this._valueTitle.rotation(-90)).leftShrinkWrap(true);
|
|
742
|
-
}
|
|
743
|
-
if (this.domainAxisTitle()) {
|
|
744
|
-
this.setContent("bottom", this._domainTitle).bottomShrinkWrap(true);
|
|
745
|
-
}
|
|
746
|
-
if (this.legendPosition() !== "none") {
|
|
747
|
-
this.setContent(this.legendPosition(), this._legend)[this.legendPosition() + "ShrinkWrap"](true);
|
|
748
|
-
}
|
|
749
|
-
};
|
|
750
|
-
MegaChart.prototype.update = function (domNode, element) {
|
|
751
|
-
function showHideButton(twArr2, button, show) {
|
|
752
|
-
if (show && twArr2.indexOf(button) === -1) {
|
|
753
|
-
twArr2.push(button);
|
|
754
|
-
}
|
|
755
|
-
else if (!show) {
|
|
756
|
-
var idx = twArr2.indexOf(button);
|
|
757
|
-
if (idx >= 0) {
|
|
758
|
-
twArr2.splice(idx, 1);
|
|
759
|
-
}
|
|
760
|
-
}
|
|
761
|
-
}
|
|
762
|
-
if (this._chart && typeof this._chart.hideRowOnLegendClick === "function") {
|
|
763
|
-
this._chart.hideRowOnLegendClick(this.hideRowOnLegendClick());
|
|
764
|
-
}
|
|
765
|
-
this._dataCount.html('<span class="MegaChart-dataCount-label">Count:</span> <span class="MegaChart-dataCount-value">' + (this.data() ? this.data().length : "0") + "</span>");
|
|
766
|
-
this._chartTypeSelect.value(this.chartType());
|
|
767
|
-
var twArr = this.toolbarWidgets();
|
|
768
|
-
showHideButton(twArr, this._csvButton, this.showCSV());
|
|
769
|
-
showHideButton(twArr, this._maximizeButton, this.showMaximize());
|
|
770
|
-
showHideButton(twArr, this._legendButton, this.toolbarShowLegend());
|
|
771
|
-
showHideButton(twArr, this._chartTypeSelect, this.showChartSelect());
|
|
772
|
-
showHideButton(twArr, this._infoButton, this.showInfoButton());
|
|
773
|
-
showHideButton(twArr, this._dataCount, this.showCount());
|
|
774
|
-
this.toolbarWidgets(twArr);
|
|
775
|
-
if (this._prevShowToolbar !== this.showToolbar()) {
|
|
776
|
-
this.setContent("top", this.showToolbar() ? this._toolbar : null);
|
|
777
|
-
this._prevShowToolbar = this.showToolbar();
|
|
778
|
-
}
|
|
779
|
-
// TODO: Proxy + themes not working...
|
|
780
|
-
this._toolbar
|
|
781
|
-
.fontSize(this.titleFontSize())
|
|
782
|
-
.fontColor(this.titleFontColor())
|
|
783
|
-
.fontFamily(this.titleFontFamily())
|
|
784
|
-
.fontBold(this.titleFontBold())
|
|
785
|
-
.backgroundColor(this.titleBackgroundColor());
|
|
786
|
-
this._chart
|
|
787
|
-
.data(this.data());
|
|
788
|
-
if (this._chart.chartType() !== this.chartType()) {
|
|
789
|
-
this._chart.chartType(this.chartType());
|
|
790
|
-
}
|
|
791
|
-
var legendPosition = this.legendPosition();
|
|
792
|
-
if (this.toolbarShowLegend() && !this._legendButton.checked()) {
|
|
793
|
-
legendPosition = "none";
|
|
794
|
-
}
|
|
795
|
-
if (this._prevLegendPosition !== legendPosition) {
|
|
796
|
-
if (this._prevLegendPosition !== "none") {
|
|
797
|
-
this.clearContent(this._prevLegendPosition);
|
|
798
|
-
}
|
|
799
|
-
this._prevLegendPosition = legendPosition;
|
|
800
|
-
if (legendPosition !== "none") {
|
|
801
|
-
this._legend = new Legend().targetWidget(this.getContent("center").fixedSize(true));
|
|
802
|
-
this.setContent(legendPosition, this._legend);
|
|
803
|
-
this._legend.orientation(["top", "bottom"].indexOf(legendPosition) !== -1 ? "horizontal" : "vertical");
|
|
804
|
-
}
|
|
805
|
-
}
|
|
806
|
-
this._contentClasses = this.getContentClasses();
|
|
807
|
-
if (this.valueAxisTitle() && this._contentClasses.left !== "common_Text") {
|
|
808
|
-
if (legendPosition !== "left") {
|
|
809
|
-
this.setContent("left", this._valueTitle.rotation(-90));
|
|
810
|
-
}
|
|
811
|
-
}
|
|
812
|
-
if (this.domainAxisTitle() && this._contentClasses.bottom !== "common_Text") {
|
|
813
|
-
if (legendPosition !== "bottom") {
|
|
814
|
-
this.setContent("bottom", this._domainTitle).bottomShrinkWrap(true);
|
|
815
|
-
}
|
|
816
|
-
}
|
|
817
|
-
this._legend.dataFamily(this._chart.getChartDataFamily());
|
|
818
|
-
_super.prototype.update.call(this, domNode, element);
|
|
819
|
-
};
|
|
820
|
-
MegaChart.prototype.exit = function (domNode, element) {
|
|
821
|
-
_super.prototype.exit.call(this, domNode, element);
|
|
822
|
-
};
|
|
823
|
-
MegaChart.prototype.getContentClasses = function () {
|
|
824
|
-
var obj = {};
|
|
825
|
-
var t = this.getContent("top");
|
|
826
|
-
var r = this.getContent("right");
|
|
827
|
-
var b = this.getContent("bottom");
|
|
828
|
-
var l = this.getContent("left");
|
|
829
|
-
obj.top = t !== null ? t.classID() : undefined;
|
|
830
|
-
obj.right = r !== null ? r.classID() : undefined;
|
|
831
|
-
obj.bottom = b !== null ? b.classID() : undefined;
|
|
832
|
-
obj.left = l !== null ? l.classID() : undefined;
|
|
833
|
-
return obj;
|
|
834
|
-
};
|
|
835
|
-
MegaChart.prototype.serializeState = function () {
|
|
836
|
-
var state = {
|
|
837
|
-
title: this.title(),
|
|
838
|
-
data: this.data()
|
|
839
|
-
};
|
|
840
|
-
var chart = this.chart();
|
|
841
|
-
if (chart) {
|
|
842
|
-
if (chart.serializeState) {
|
|
843
|
-
state.chart = chart.serializeState();
|
|
844
|
-
delete state.chart.data;
|
|
845
|
-
}
|
|
846
|
-
}
|
|
847
|
-
return state;
|
|
848
|
-
};
|
|
849
|
-
MegaChart.prototype.deserializeState = function (state) {
|
|
850
|
-
if (state) {
|
|
851
|
-
this
|
|
852
|
-
.title(state.title)
|
|
853
|
-
.data(state.data);
|
|
854
|
-
var chart = this.chart();
|
|
855
|
-
if (chart && state.chart) {
|
|
856
|
-
if (chart.serializeState) {
|
|
857
|
-
chart.deserializeState(state.chart);
|
|
858
|
-
}
|
|
859
|
-
}
|
|
860
|
-
}
|
|
861
|
-
return this;
|
|
862
|
-
};
|
|
863
|
-
// Events ---
|
|
864
|
-
MegaChart.prototype.click = function (row, column, selected) {
|
|
865
|
-
};
|
|
866
|
-
MegaChart.prototype.dblclick = function (row, column, selected) {
|
|
867
|
-
};
|
|
868
|
-
MegaChart.prototype.vertex_click = function (row, col, sel, more) {
|
|
869
|
-
if (more && more.vertex) ;
|
|
870
|
-
};
|
|
871
|
-
MegaChart.prototype.vertex_dblclick = function (row, col, sel, more) {
|
|
872
|
-
if (more && more.vertex) ;
|
|
873
|
-
};
|
|
874
|
-
MegaChart.prototype.edge_click = function (row, col, sel, more) {
|
|
875
|
-
if (more && more.edge) ;
|
|
876
|
-
};
|
|
877
|
-
MegaChart.prototype.edge_dblclick = function (row, col, sel, more) {
|
|
878
|
-
if (more && more.edge) ;
|
|
879
|
-
};
|
|
880
|
-
return MegaChart;
|
|
881
|
-
}(Border));
|
|
882
|
-
MegaChart.prototype._class += " composite_MegaChart";
|
|
883
|
-
MegaChart.prototype._1DChartTypes = MultiChart.prototype._1DChartTypes;
|
|
884
|
-
MegaChart.prototype._2DChartTypes = MultiChart.prototype._2DChartTypes;
|
|
885
|
-
MegaChart.prototype._NDChartTypes = MultiChart.prototype._NDChartTypes;
|
|
886
|
-
MegaChart.prototype._anyChartTypes = MultiChart.prototype._anyChartTypes;
|
|
887
|
-
MegaChart.prototype._allChartTypes = MultiChart.prototype._allChartTypes;
|
|
888
|
-
MegaChart.prototype.publishReset();
|
|
889
|
-
MegaChart.prototype.publish("hideRowOnLegendClick", false, "boolean", "Enable/Disable hiding row on legend clicks", null, { tags: ["Basic"] });
|
|
890
|
-
MegaChart.prototype.publish("showToolbar", true, "boolean", "Enable/Disable Toolbar widget", null, { tags: ["Basic"] });
|
|
891
|
-
MegaChart.prototype.publishProxy("title", "_toolbar", "title");
|
|
892
|
-
MegaChart.prototype.publish("ddlParamsFormat", "", "string", "DDL Param Format '{fname}, {lname}'", null, { tags: ["Advanced"], optional: true });
|
|
893
|
-
MegaChart.prototype.publish("titleFontSize", null, "number", "Title Font Size (px)", null, { tags: ["Advanced"], optional: true });
|
|
894
|
-
MegaChart.prototype.publish("titleFontColor", null, "html-color", "Title Font Color", null, { tags: ["Advanced"], optional: true });
|
|
895
|
-
MegaChart.prototype.publish("titleFontFamily", null, "string", "Title Font Family", null, { tags: ["Advanced"], optional: true });
|
|
896
|
-
MegaChart.prototype.publish("titleFontBold", true, "boolean", "Enable Bold Title Font", null, { tags: ["Advanced"], optional: true });
|
|
897
|
-
MegaChart.prototype.publish("titleBackgroundColor", null, "html-color", "Background Color", null, { tags: ["Intermediate"], optional: true });
|
|
898
|
-
MegaChart.prototype.publish("maximizedBackgroundColor", "#FFFFFF", "html-color", "Background Color while maximized", null, { tags: ["Intermediate"], optional: true });
|
|
899
|
-
MegaChart.prototype.publish("showChartSelect", true, "boolean", "Show/Hide the chartType dropdown in the toolbar", null, { tags: ["Basic"] });
|
|
900
|
-
MegaChart.prototype.publish("showCSV", true, "boolean", "Show/Hide CSV button", null, { tags: ["Basic"] });
|
|
901
|
-
MegaChart.prototype.publish("showCount", false, "boolean", "Show/Hide Data Count", null, { tags: ["Basic"] });
|
|
902
|
-
MegaChart.prototype.publish("showMaximize", false, "boolean", "Show/Hide Maximize button", null, { tags: ["Basic"] });
|
|
903
|
-
MegaChart.prototype.publish("toolbarShowLegend", false, "boolean", "Show/Hide Legend button", null, { tags: ["Basic"] });
|
|
904
|
-
MegaChart.prototype.publish("showInfoButton", false, "boolean", "Show/Hide Info button in toolbar", null, { tags: ["Basic"] });
|
|
905
|
-
MegaChart.prototype.publish("infoIcon", "\uf05a", "string", "Help Icon", null, { tags: ["Basic"] });
|
|
906
|
-
MegaChart.prototype.publish("legendPosition", "none", "set", "Position of the Legend widget", ["none", "top", "right", "bottom", "left"], { tags: ["Basic"] });
|
|
907
|
-
MegaChart.prototype.publishProxy("legendFormat", "_legend", "rainbowFormat");
|
|
908
|
-
MegaChart.prototype.publishProxy("legendBins", "_legend", "rainbowBins");
|
|
909
|
-
MegaChart.prototype.publishProxy("domainAxisTitle", "_domainTitle", "text");
|
|
910
|
-
MegaChart.prototype.publishProxy("valueAxisTitle", "_valueTitle", "text");
|
|
911
|
-
MegaChart.prototype.publishProxy("chartType", "_chart", "chartType");
|
|
912
|
-
MegaChart.prototype.publishProxy("chart", "_chart", "chart");
|
|
913
|
-
|
|
914
|
-
function retrofit_114_serialization(state, replacement_version) {
|
|
915
|
-
replacement_version = !replacement_version || replacement_version === "1.14.2-dev" ? "1.18.0" : replacement_version;
|
|
916
|
-
if (!state.__version)
|
|
917
|
-
return state;
|
|
918
|
-
var state_version_obj = Utility$1.parseVersionString(state.__version);
|
|
919
|
-
var target_version_obj = Utility$1.parseVersionString(replacement_version);
|
|
920
|
-
if (state_version_obj.major === 1 && state_version_obj.minor === 14) {
|
|
921
|
-
console.info("Upgrading old persist from " + state.__version + " to " + replacement_version);
|
|
922
|
-
var _json_str = JSON.stringify(state);
|
|
923
|
-
_json_str = _json_str.split('"' + state.__version).join('"' + replacement_version);
|
|
924
|
-
var ret_obj = JSON.parse(_json_str);
|
|
925
|
-
if (ret_obj.__properties && ret_obj.__properties.content) {
|
|
926
|
-
ret_obj.__properties.content.forEach(function (n) {
|
|
927
|
-
if (JSON.stringify(n).split("graph_Graph").length > 1 && target_version_obj.minor >= 16) {
|
|
928
|
-
n.__properties.widget.__id = n.__properties.widget.__properties.widget.__id;
|
|
929
|
-
n.__properties.widget.__class = "composite_MegaChart";
|
|
930
|
-
n.__properties.widget.__properties.showCSV = false;
|
|
931
|
-
n.__properties.widget.__properties.chartType = "GRAPH";
|
|
932
|
-
n.__properties.widget.__properties.chart = n.__properties.widget.__properties.widget;
|
|
933
|
-
delete n.__properties.widget.__properties.chart.__id;
|
|
934
|
-
delete n.__properties.widget.__properties.widget;
|
|
935
|
-
}
|
|
936
|
-
if ("undefined" === typeof n.__properties.fields) {
|
|
937
|
-
n.__properties.fields = [];
|
|
938
|
-
}
|
|
939
|
-
});
|
|
940
|
-
}
|
|
941
|
-
return ret_obj;
|
|
942
|
-
}
|
|
943
|
-
else {
|
|
944
|
-
return state;
|
|
945
|
-
}
|
|
946
|
-
}
|
|
947
|
-
function deserializeFromObject(widget, state) {
|
|
948
|
-
var promises = [];
|
|
949
|
-
Persist$1.widgetPropertyWalker(widget, null, function (w, item) {
|
|
950
|
-
w[item.id + "_reset"]();
|
|
951
|
-
if (state.__properties[item.id] !== undefined) {
|
|
952
|
-
switch (item.type) {
|
|
953
|
-
case "widget":
|
|
954
|
-
var widgetKey_1 = item.id;
|
|
955
|
-
promises.push(create(state.__properties[item.id]).then(function (w2) {
|
|
956
|
-
w2._owner = w;
|
|
957
|
-
w[widgetKey_1](w2);
|
|
958
|
-
return w2;
|
|
959
|
-
}));
|
|
960
|
-
break;
|
|
961
|
-
case "widgetArray":
|
|
962
|
-
case "propertyArray":
|
|
963
|
-
var widgetArrayKey_1 = item.id;
|
|
964
|
-
var widgetStateArray = state.__properties[item.id];
|
|
965
|
-
if (widgetStateArray.length) {
|
|
966
|
-
var arrPromises = [];
|
|
967
|
-
for (var _i = 0, widgetStateArray_1 = widgetStateArray; _i < widgetStateArray_1.length; _i++) {
|
|
968
|
-
var widgetState = widgetStateArray_1[_i];
|
|
969
|
-
arrPromises.push(create(widgetState).then(function (widgetItem) {
|
|
970
|
-
widgetItem._owner = w;
|
|
971
|
-
return widgetItem;
|
|
972
|
-
}));
|
|
973
|
-
}
|
|
974
|
-
promises.push(Promise.all(arrPromises).then(function (widgetArray) {
|
|
975
|
-
w[widgetArrayKey_1](widgetArray);
|
|
976
|
-
}));
|
|
977
|
-
}
|
|
978
|
-
break;
|
|
979
|
-
default:
|
|
980
|
-
w[item.id](state.__properties[item.id]);
|
|
981
|
-
break;
|
|
982
|
-
}
|
|
983
|
-
}
|
|
984
|
-
});
|
|
985
|
-
return Promise.all(promises).then(function (widgets) {
|
|
986
|
-
if (state.__data) {
|
|
987
|
-
for (var key in state.__data) {
|
|
988
|
-
if (state.__data.HasOwnProperty(key)) {
|
|
989
|
-
switch (key) {
|
|
990
|
-
case "data":
|
|
991
|
-
widget.data(state.__data[key]);
|
|
992
|
-
break;
|
|
993
|
-
default:
|
|
994
|
-
console.warn("Unexpected __data item: " + key);
|
|
995
|
-
widget[key](state.__data[key]);
|
|
996
|
-
break;
|
|
997
|
-
}
|
|
998
|
-
}
|
|
999
|
-
}
|
|
1000
|
-
}
|
|
1001
|
-
if (state.__state) {
|
|
1002
|
-
if (widget.deserializeState) {
|
|
1003
|
-
widget.deserializeState(state.__state);
|
|
1004
|
-
}
|
|
1005
|
-
else if (state.__state.data && widget.data) {
|
|
1006
|
-
widget.data(state.__state.data);
|
|
1007
|
-
}
|
|
1008
|
-
}
|
|
1009
|
-
return widget;
|
|
1010
|
-
});
|
|
1011
|
-
}
|
|
1012
|
-
function deserialize(widget, state) {
|
|
1013
|
-
if (typeof state === "string") {
|
|
1014
|
-
state = JSON.parse(state);
|
|
1015
|
-
}
|
|
1016
|
-
if (state.__id && state.__id.indexOf(widget._idSeed) !== 0 && widget._id !== state.__id) {
|
|
1017
|
-
console.warn("Deserialize: IDs do not match - " + widget._id);
|
|
1018
|
-
}
|
|
1019
|
-
deserializeFromObject(widget, state);
|
|
1020
|
-
}
|
|
1021
|
-
function create(state) {
|
|
1022
|
-
if (typeof state === "string") {
|
|
1023
|
-
state = JSON.parse(state);
|
|
1024
|
-
}
|
|
1025
|
-
state = retrofit_114_serialization(state, Platform.version());
|
|
1026
|
-
return requireWidget(state.__class).then(function (WidgetClass) {
|
|
1027
|
-
var widget = new WidgetClass();
|
|
1028
|
-
if (state.__id && state.__id.indexOf(widget._idSeed) !== 0 && state.__id.indexOf("_pe") !== 0) {
|
|
1029
|
-
widget._id = state.__id;
|
|
1030
|
-
}
|
|
1031
|
-
return deserializeFromObject(widget, state);
|
|
1032
|
-
}).catch(function (e) {
|
|
1033
|
-
console.error("Persist.create: ***exception***");
|
|
1034
|
-
console.error(e);
|
|
1035
|
-
});
|
|
1036
|
-
}
|
|
1037
|
-
function clone(widget) {
|
|
1038
|
-
create(Persist$1.serializeToObject(widget, undefined, true, true));
|
|
1039
|
-
}
|
|
1040
|
-
|
|
1041
|
-
var Persist = /*#__PURE__*/Object.freeze({
|
|
1042
|
-
__proto__: null,
|
|
1043
|
-
clone: clone,
|
|
1044
|
-
create: create,
|
|
1045
|
-
deserialize: deserialize,
|
|
1046
|
-
deserializeFromObject: deserializeFromObject,
|
|
1047
|
-
retrofit_114_serialization: retrofit_114_serialization
|
|
1048
|
-
});
|
|
1049
|
-
|
|
1050
|
-
export { BUILD_VERSION, Dermatology, MegaChart, MultiChart, MultiChartPanel, PKG_NAME, PKG_VERSION, Persist, Utility };
|
|
1051
|
-
//# sourceMappingURL=index.es6.js.map
|