@hpcc-js/api 2.14.0 → 3.2.0

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.
Files changed (47) hide show
  1. package/dist/index.js +127 -761
  2. package/dist/index.js.map +7 -1
  3. package/package.json +28 -33
  4. package/src/ITooltip.ts +2 -2
  5. package/src/Tooltip.ts +2 -2
  6. package/src/__package__.ts +2 -2
  7. package/src/index.ts +10 -10
  8. package/types/I1DChart.d.ts +0 -1
  9. package/types/I2DAggrChart.d.ts +0 -1
  10. package/types/I2DChart.d.ts +0 -1
  11. package/types/IGraph.d.ts +0 -1
  12. package/types/IHighlight.d.ts +0 -1
  13. package/types/IInput.d.ts +0 -1
  14. package/types/INDChart.d.ts +0 -1
  15. package/types/ITooltip.d.ts +1 -2
  16. package/types/ITree.d.ts +0 -1
  17. package/types/Tooltip.d.ts +0 -1
  18. package/types/__package__.d.ts +2 -3
  19. package/types/index.d.ts +10 -11
  20. package/dist/index.es6.js +0 -745
  21. package/dist/index.es6.js.map +0 -1
  22. package/dist/index.min.js +0 -2
  23. package/dist/index.min.js.map +0 -1
  24. package/types/I1DChart.d.ts.map +0 -1
  25. package/types/I2DAggrChart.d.ts.map +0 -1
  26. package/types/I2DChart.d.ts.map +0 -1
  27. package/types/IGraph.d.ts.map +0 -1
  28. package/types/IHighlight.d.ts.map +0 -1
  29. package/types/IInput.d.ts.map +0 -1
  30. package/types/INDChart.d.ts.map +0 -1
  31. package/types/ITooltip.d.ts.map +0 -1
  32. package/types/ITree.d.ts.map +0 -1
  33. package/types/Tooltip.d.ts.map +0 -1
  34. package/types/__package__.d.ts.map +0 -1
  35. package/types/index.d.ts.map +0 -1
  36. package/types-3.4/I1DChart.d.ts +0 -2
  37. package/types-3.4/I2DAggrChart.d.ts +0 -2
  38. package/types-3.4/I2DChart.d.ts +0 -2
  39. package/types-3.4/IGraph.d.ts +0 -2
  40. package/types-3.4/IHighlight.d.ts +0 -5
  41. package/types-3.4/IInput.d.ts +0 -27
  42. package/types-3.4/INDChart.d.ts +0 -2
  43. package/types-3.4/ITooltip.d.ts +0 -45
  44. package/types-3.4/ITree.d.ts +0 -2
  45. package/types-3.4/Tooltip.d.ts +0 -2
  46. package/types-3.4/__package__.d.ts +0 -4
  47. package/types-3.4/index.d.ts +0 -11
package/dist/index.js CHANGED
@@ -1,762 +1,128 @@
1
- (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@hpcc-js/common')) :
3
- typeof define === 'function' && define.amd ? define(['exports', '@hpcc-js/common'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["@hpcc-js/api"] = {}, global["@hpcc-js/common"]));
5
- })(this, (function (exports, common) { 'use strict';
6
-
7
- var PKG_NAME = "@hpcc-js/api";
8
- var PKG_VERSION = "2.14.0";
9
- var BUILD_VERSION = "2.107.0";
10
-
11
- function I1DChart() {
12
- }
13
- I1DChart.prototype._dataFamily = "1D";
14
- I1DChart.prototype._palette = common.Palette.rainbow("default");
15
- // Events ---
16
- I1DChart.prototype.click = function (row, column, selected) {
17
- };
18
- I1DChart.prototype.dblclick = function (row, column, selected) {
19
- };
20
-
21
- function I2DChart() {
22
- }
23
- I2DChart.prototype._dataFamily = "2D";
24
- I2DChart.prototype._palette = common.Palette.ordinal("default");
25
- I2DChart.prototype.fillColor = function (row, column, value, origRow) {
26
- return this._palette(row[0]);
27
- };
28
- I2DChart.prototype.strokeColor = function (row, column, value, origRow) {
29
- return common.hsl(this.fillColor(row, column, value, origRow)).darker().toString();
30
- };
31
- I2DChart.prototype.textColor = function (row, column, value, origRow) {
32
- return common.Palette.textColor(this.fillColor(row, column, value, origRow));
33
- };
34
- // Events ---
35
- I2DChart.prototype.click = function (row, column, selected) {
36
- };
37
- I2DChart.prototype.dblclick = function (row, column, selected) {
38
- };
39
-
40
- function I2DAggrChart() {
41
- }
42
- I2DAggrChart.prototype._palette = common.Palette.rainbow("default");
43
- I2DAggrChart.prototype.fillColor = function (row, column, value) {
44
- return this._palette(row.length);
45
- };
46
- I2DAggrChart.prototype.strokeColor = function (row, column, value) {
47
- return common.hsl(this.fillColor(row, column, value)).darker().toString();
48
- };
49
- I2DAggrChart.prototype.textColor = function (row, column, value) {
50
- return common.Palette.textColor(this.fillColor(row, column, value));
51
- };
52
- // Events ---
53
- I2DAggrChart.prototype.click = function (row, column, selected) {
54
- };
55
- I2DAggrChart.prototype.dblclick = function (row, column, selected) {
56
- };
57
-
58
- function IGraph() {
59
- }
60
- IGraph.prototype._dataFamily = "graph";
61
- // Events ---
62
- IGraph.prototype.vertex_click = function (_row, _col, _sel, more) {
63
- if (more && more.vertex) ;
64
- };
65
- IGraph.prototype.vertex_dblclick = function (_row, _col, _sel, more) {
66
- if (more && more.vertex) ;
67
- };
68
- IGraph.prototype.edge_click = function (_row, _col, _sel, more) {
69
- if (more && more.edge) ;
70
- };
71
- IGraph.prototype.edge_dblclick = function (_row, _col, _sel, more) {
72
- if (more && more.edge) ;
73
- };
74
-
75
- function instanceOfIHighlight(w) {
76
- return typeof w.highlightColumn === "function";
77
- }
78
-
79
- // Use old school class declaration as this is a mixin ---
80
- function IInput() {
81
- }
82
- IInput.prototype = Object.create(common.Widget.prototype);
83
- IInput.prototype.constructor = IInput;
84
- // abstract target(): any;
85
- // abstract target(_: any): this;
86
- // Implementation ---
87
- IInput.prototype.isValid = function () {
88
- if (this.validate()) {
89
- var re = new RegExp(this.validate());
90
- if (!re.test(this.value())) {
91
- return false;
92
- }
93
- }
94
- return true;
95
- };
96
- IInput.prototype.hasValue = function () {
97
- if (typeof this.type === "function") {
98
- switch (this.type()) {
99
- case "radio":
100
- /* falls through */
101
- case "checkbox":
102
- if (this.value() && this.value() !== "false") {
103
- return true;
104
- }
105
- break;
106
- default:
107
- if (this.value()) {
108
- return true;
109
- }
110
- break;
111
- }
112
- return false;
113
- }
114
- return this.value() !== "";
115
- };
116
- // Events ---
117
- IInput.prototype.blur = function (_w) {
118
- };
119
- IInput.prototype.keyup = function (_w) {
120
- };
121
- IInput.prototype.focus = function (_w) {
122
- };
123
- IInput.prototype.click = function (_w) {
124
- };
125
- IInput.prototype.dblclick = function (_w) {
126
- };
127
- IInput.prototype.change = function (_w, complete) {
128
- };
129
- IInput.prototype.resetValue = function (w) {
130
- w.value(w._inputElement[0].node().value);
131
- };
132
- IInput.prototype.disable = function (disable) {
133
- this._inputElement.forEach(function (e, idx) {
134
- e.attr("disabled", disable ? "disabled" : null);
135
- });
136
- };
137
- IInput.prototype.setFocus = function () {
138
- if (this._inputElement.length) {
139
- this._inputElement[0].node().focus();
140
- }
141
- };
142
- IInput.prototype.publish("name", "", "string", "HTML name for the input");
143
- IInput.prototype.publish("label", "", "string", "Descriptive label");
144
- IInput.prototype.publish("value", "", "string", "Input Current Value");
145
- IInput.prototype.publish("validate", null, "string", "Input Validation");
146
-
147
- function INDChart() {
148
- }
149
- INDChart.prototype._dataFamily = "ND";
150
- INDChart.prototype._palette = common.Palette.ordinal("default");
151
- INDChart.prototype.fillColor = function (row, column, value, origRow) {
152
- return this._palette(column);
153
- };
154
- INDChart.prototype.strokeColor = function (row, column, value, origRow) {
155
- return common.hsl(this.fillColor(row, column, value, origRow)).darker().toString();
156
- };
157
- INDChart.prototype.textColor = function (row, column, value, origRow) {
158
- return common.Palette.textColor(this.fillColor(row, column, value, origRow));
159
- };
160
- // Events ---
161
- INDChart.prototype.click = function (row, column, selected) {
162
- };
163
- INDChart.prototype.dblclick = function (row, column, selected) {
164
- };
165
-
166
- // Based on https://github.com/GordonSmith/d3-tip forked from https://github.com/Caged/d3-tip
167
- function tip() {
168
- var direction = d3TipDirection;
169
- var offset = d3TipOffset;
170
- var html = d3TipHTML;
171
- var rootElement = functor(document.body);
172
- var node = initNode();
173
- var svg = null;
174
- var point = null;
175
- var target = null;
176
- var tip = function (vis) {
177
- svg = getSVGNode(vis);
178
- if (!svg)
179
- return;
180
- point = svg.createSVGPoint();
181
- var re = rootElement();
182
- if (!re)
183
- return;
184
- if (!node)
185
- return;
186
- re.appendChild(node);
187
- };
188
- // Public - show the tooltip on the screen
189
- //
190
- // Returns a tip
191
- tip.show = function (d, idx, arr) {
192
- target = arr[idx];
193
- var args = Array.prototype.slice.call(arguments);
194
- var content = html.apply(this, args);
195
- if (content === null) {
196
- return tip;
197
- }
198
- var poffset = offset.apply(this, args);
199
- var nodel = getNodeEl();
200
- var i = directions.length;
201
- var coords;
202
- var root_bbox = rootElement().getBoundingClientRect();
203
- nodel.html(content)
204
- .style("opacity", 1).style("pointer-events", "all");
205
- while (i--)
206
- nodel.classed(directions[i], false);
207
- var placement_success = false;
208
- var placement_overflow = {};
209
- var least_overflow_direction = directions[0];
210
- for (var i_1 = 0; i_1 < directions.length; i_1++) {
211
- placement_success = _placement_attempt(directions[i_1]);
212
- if (placement_success)
213
- break;
214
- }
215
- if (!placement_success) {
216
- nodel.classed("notick", true);
217
- var top_offset = _vertical_adjustment(placement_overflow[least_overflow_direction]);
218
- var left_offset = _horizontal_adjustment(placement_overflow[least_overflow_direction]);
219
- _placement_attempt(least_overflow_direction, top_offset, left_offset);
220
- }
221
- else {
222
- nodel.classed("notick", false);
223
- }
224
- return tip;
225
- function _horizontal_adjustment(overflow_obj) {
226
- if (overflow_obj.left > overflow_obj.right) {
227
- return overflow_obj.left > 0 ? -overflow_obj.left : 0;
228
- }
229
- else {
230
- return overflow_obj.right > 0 ? overflow_obj.right : 0;
231
- }
232
- }
233
- function _vertical_adjustment(overflow_obj) {
234
- if (overflow_obj.top > overflow_obj.bottom) {
235
- return overflow_obj.top > 0 ? -overflow_obj.top : 0;
236
- }
237
- else {
238
- return overflow_obj.bottom;
239
- }
240
- }
241
- function _placement_attempt(_dir, _top_offset, _left_offset) {
242
- _top_offset = _top_offset ? _top_offset : 0;
243
- _left_offset = _left_offset ? _left_offset : 0;
244
- nodel.style("white-space", "nowrap");
245
- coords = directionCallbacks.get(_dir).apply(this);
246
- nodel.classed(_dir, true)
247
- .style("top", (coords.top + poffset[0] - _top_offset) + "px")
248
- .style("left", (coords.left + poffset[1] - _left_offset) + "px");
249
- var nodel_bbox = nodel.node().getBoundingClientRect();
250
- var ret = nodel_bbox.top > root_bbox.top
251
- && nodel_bbox.left > root_bbox.left
252
- && nodel_bbox.bottom < root_bbox.bottom
253
- && nodel_bbox.right < root_bbox.right;
254
- placement_overflow[_dir] = {
255
- top: root_bbox.top - nodel_bbox.top,
256
- right: nodel_bbox.right - root_bbox.right,
257
- bottom: nodel_bbox.bottom - root_bbox.bottom,
258
- left: root_bbox.left - nodel_bbox.left
259
- };
260
- nodel.style("white-space", "normal");
261
- placement_overflow[_dir].total_overflow = Object.keys(placement_overflow[_dir])
262
- .filter(function (side) { return placement_overflow[_dir][side] > 0; })
263
- .reduce(function (sum, side) {
264
- var side_overflow = placement_overflow[_dir][side];
265
- return sum + side_overflow;
266
- }, 0);
267
- if (placement_overflow[least_overflow_direction].total_overflow > placement_overflow[_dir].total_overflow) {
268
- least_overflow_direction = _dir;
269
- }
270
- if (!ret) {
271
- nodel.classed(_dir, false);
272
- }
273
- return ret;
274
- }
275
- };
276
- // Public - hide the tooltip
277
- //
278
- // Returns a tip
279
- tip.hide = function () {
280
- var nodel = getNodeEl();
281
- nodel.style("opacity", 0).style("pointer-events", "none");
282
- return tip;
283
- };
284
- // Public: Proxy attr calls to the d3 tip container.
285
- // Sets or gets attribute value.
286
- //
287
- // n - name of the attribute
288
- // v - value of the attribute
289
- //
290
- // Returns tip or attribute value
291
- // eslint-disable-next-line no-unused-vars
292
- tip.attr = function (n, v) {
293
- if (arguments.length < 2 && typeof n === "string") {
294
- return getNodeEl().attr(n);
295
- }
296
- var args = Array.prototype.slice.call(arguments);
297
- common.selection.prototype.attr.apply(getNodeEl(), args);
298
- return tip;
299
- };
300
- // Public: Proxy style calls to the d3 tip container.
301
- // Sets or gets a style value.
302
- //
303
- // n - name of the property
304
- // v - value of the property
305
- //
306
- // Returns tip or style property value
307
- // eslint-disable-next-line no-unused-vars
308
- tip.style = function (n, v) {
309
- if (arguments.length < 2 && typeof n === "string") {
310
- return getNodeEl().style(n);
311
- }
312
- var args = Array.prototype.slice.call(arguments);
313
- common.selection.prototype.style.apply(getNodeEl(), args);
314
- return tip;
315
- };
316
- // Public: Set or get the direction of the tooltip
317
- //
318
- // v - One of n(north), s(south), e(east), or w(west), nw(northwest),
319
- // sw(southwest), ne(northeast) or se(southeast)
320
- //
321
- // Returns tip or direction
322
- tip.direction = function (v) {
323
- if (!arguments.length)
324
- return direction;
325
- direction = v == null ? v : functor(v);
326
- return tip;
327
- };
328
- // Public: Sets or gets the offset of the tip
329
- //
330
- // v - Array of [x, y] offset
331
- //
332
- // Returns offset or
333
- tip.offset = function (v) {
334
- if (!arguments.length)
335
- return offset;
336
- offset = v == null ? v : functor(v);
337
- return tip;
338
- };
339
- // Public: sets or gets the html value of the tooltip
340
- //
341
- // v - String value of the tip
342
- //
343
- // Returns html value or tip
344
- tip.html = function (v) {
345
- if (!arguments.length)
346
- return html;
347
- html = v == null ? v : functor(v);
348
- return tip;
349
- };
350
- // Public: sets or gets the root element anchor of the tooltip
351
- //
352
- // v - root element of the tooltip
353
- //
354
- // Returns root node of tip
355
- tip.rootElement = function (v) {
356
- if (!arguments.length)
357
- return rootElement;
358
- rootElement = functor(v);
359
- return tip;
360
- };
361
- // Public: destroys the tooltip and removes it from the DOM
362
- //
363
- // Returns a tip
364
- tip.destroy = function () {
365
- if (node) {
366
- getNodeEl().remove();
367
- node = null;
368
- }
369
- return tip;
370
- };
371
- function d3TipDirection() { return "n"; }
372
- function d3TipOffset() { return [0, 0]; }
373
- function d3TipHTML() { return " "; }
374
- var directionCallbacks = common.map({
375
- n: directionNorth,
376
- s: directionSouth,
377
- e: directionEast,
378
- w: directionWest,
379
- nw: directionNorthWest,
380
- ne: directionNorthEast,
381
- sw: directionSouthWest,
382
- se: directionSouthEast
383
- });
384
- var directions = directionCallbacks.keys();
385
- function directionNorth() {
386
- var bbox = getScreenBBox(window);
387
- return {
388
- top: bbox.n.y - node.offsetHeight,
389
- left: bbox.n.x - node.offsetWidth / 2
390
- };
391
- }
392
- function directionSouth() {
393
- var bbox = getScreenBBox(window);
394
- return {
395
- top: bbox.s.y + 8,
396
- left: bbox.s.x - node.offsetWidth / 2
397
- };
398
- }
399
- function directionEast() {
400
- var bbox = getScreenBBox(window);
401
- return {
402
- top: bbox.e.y - node.offsetHeight / 2,
403
- left: bbox.e.x + 8
404
- };
405
- }
406
- function directionWest() {
407
- var bbox = getScreenBBox(window);
408
- return {
409
- top: bbox.w.y - node.offsetHeight / 2,
410
- left: bbox.w.x - node.offsetWidth - 8
411
- };
412
- }
413
- function directionNorthWest() {
414
- var bbox = getScreenBBox(window);
415
- return {
416
- top: bbox.nw.y - node.offsetHeight,
417
- left: bbox.nw.x - node.offsetWidth
418
- };
419
- }
420
- function directionNorthEast() {
421
- var bbox = getScreenBBox(window);
422
- return {
423
- top: bbox.ne.y - node.offsetHeight,
424
- left: bbox.ne.x
425
- };
426
- }
427
- function directionSouthWest() {
428
- var bbox = getScreenBBox(window);
429
- return {
430
- top: bbox.sw.y,
431
- left: bbox.sw.x - node.offsetWidth
432
- };
433
- }
434
- function directionSouthEast() {
435
- var bbox = getScreenBBox(window);
436
- return {
437
- top: bbox.se.y,
438
- left: bbox.se.x
439
- };
440
- }
441
- function initNode() {
442
- var div = common.select(document.createElement("div"));
443
- div
444
- .attr("class", "d3-tip")
445
- .style("position", "absolute")
446
- .style("top", "0px")
447
- .style("opacity", 0)
448
- .style("pointer-events", "none")
449
- .style("box-sizing", "border-box");
450
- return div.node();
451
- }
452
- function getSVGNode(element) {
453
- var svgNode = element.node();
454
- if (!svgNode)
455
- return null;
456
- if (svgNode.tagName.toLowerCase() === "svg")
457
- return svgNode;
458
- return svgNode.ownerSVGElement;
459
- }
460
- function getNodeEl() {
461
- if (node == null) {
462
- node = initNode();
463
- // re-add node to DOM
464
- rootElement().appendChild(node);
465
- }
466
- return common.select(node);
467
- }
468
- // Private - gets the screen coordinates of a shape
469
- //
470
- // Given a shape on the screen, will return an SVGPoint for the directions
471
- // n(north), s(south), e(east), w(west), ne(northeast), se(southeast),
472
- // nw(northwest), sw(southwest).
473
- //
474
- // +-+-+
475
- // | |
476
- // + +
477
- // | |
478
- // +-+-+
479
- //
480
- // Returns an Object {n, s, e, w, nw, sw, ne, se}
481
- function getScreenBBox(targetShape) {
482
- var targetel = target || targetShape;
483
- while (targetel.getCTM == null && targetel.parentNode != null) {
484
- targetel = targetel.parentNode;
485
- }
486
- var bbox = {};
487
- var matrix = targetel.getCTM();
488
- var tbbox = targetel.getBBox();
489
- var width = tbbox.width;
490
- var height = tbbox.height;
491
- var x = tbbox.x;
492
- var y = tbbox.y;
493
- point.x = x;
494
- point.y = y;
495
- bbox.nw = point.matrixTransform(matrix);
496
- point.x += width;
497
- bbox.ne = point.matrixTransform(matrix);
498
- point.y += height;
499
- bbox.se = point.matrixTransform(matrix);
500
- point.x -= width;
501
- bbox.sw = point.matrixTransform(matrix);
502
- point.y -= height / 2;
503
- bbox.w = point.matrixTransform(matrix);
504
- point.x += width;
505
- bbox.e = point.matrixTransform(matrix);
506
- point.x -= width / 2;
507
- point.y -= height / 2;
508
- bbox.n = point.matrixTransform(matrix);
509
- point.y += height;
510
- bbox.s = point.matrixTransform(matrix);
511
- return bbox;
512
- }
513
- // Private - replace D3JS 3.X d3.functor() function
514
- function functor(v) {
515
- return typeof v === "function" ? v : function () {
516
- return v;
517
- };
518
- }
519
- return tip;
520
- }
521
-
522
- function styleInject(css, ref) {
523
- if ( ref === void 0 ) ref = {};
524
- var insertAt = ref.insertAt;
525
-
526
- if (typeof document === 'undefined') { return; }
527
-
528
- var head = document.head || document.getElementsByTagName('head')[0];
529
- var style = document.createElement('style');
530
- style.type = 'text/css';
531
-
532
- if (insertAt === 'top') {
533
- if (head.firstChild) {
534
- head.insertBefore(style, head.firstChild);
535
- } else {
536
- head.appendChild(style);
537
- }
538
- } else {
539
- head.appendChild(style);
540
- }
541
-
542
- if (style.styleSheet) {
543
- style.styleSheet.cssText = css;
544
- } else {
545
- style.appendChild(document.createTextNode(css));
546
- }
547
- }
548
-
549
- var css_248z = ".d3-tip{background:rgba(0,0,0,.66);border-radius:2px;color:#fff;font-weight:700;line-height:1;padding:12px;pointer-events:none!important;z-index:10}.d3-tip.hidden{visibility:hidden}.d3-tip:after{border:4px solid rgba(0,0,0,.66);box-sizing:border-box;content:\" \";display:inline-block;height:8px;margin:0;pointer-events:none!important;position:absolute;width:8px}.d3-tip.n:after{border-bottom-color:transparent;border-left-color:transparent;border-right-color:transparent;border-top-width:8px;left:calc(50% - 4px);top:100%}.d3-tip.e:after{border-bottom-color:transparent;border-left-color:transparent;border-right-width:8px;border-top-color:transparent;left:-12px;top:calc(50% - 4px)}.d3-tip.s{margin-top:8px}.d3-tip.s:after{border-bottom-width:8px;border-left-color:transparent;border-right-color:transparent;border-top-color:transparent;left:calc(50% - 4px);top:-12px}.d3-tip.w:after{border-bottom-color:transparent;border-left-width:8px;border-right-color:transparent;border-top-color:transparent;left:100%;top:calc(50% - 4px)}.d3-tip.notick:after{border-color:transparent!important}.common_Widget .over{stroke:rgba(0,0,0,.66);opacity:.66}.d3-tip.ITooltip-tooltipStyle-series-table{padding:0}.d3-tip .ITooltip-series-table td,.d3-tip .ITooltip-series-table th{border:1px solid #d1d1d1;padding:6px;text-align:left}.d3-tip .ITooltip-series-table .series-table-row-color{display:inline-block;height:10px;margin-right:10px;width:10px}.d3-tip .ITooltip-series-table .series-table-row-label{display:inline-block}.d3-tip .ITooltip-series-table th{background-color:#b3b3b3}.d3-tip .ITooltip-series-table td{background-color:#fff;color:#555;font-weight:400}.d3-tip .ITooltip-series-table td:first-child{border-right:0}table.ITooltip-series-table td:last-child{border-left:1px dotted #a3a3a3}";
550
- styleInject(css_248z);
551
-
552
- // Use old school class declaration as this is a mixin ---
553
- function ITooltip() {
554
- this.tooltip = tip();
555
- if (this.tooltipLabelFormat_exists()) {
556
- this._labelFormatter = common.format(this.tooltipLabelFormat());
557
- }
558
- if (this.tooltipValueFormat_exists()) {
559
- this._valueFormatter = common.format(this.tooltipValueFormat());
560
- }
561
- if (this.layerEnter) {
562
- var layerEnter_1 = this.layerEnter;
563
- this.layerEnter = function (_base, svgElement, _domElement) {
564
- if (!this._parentOverlay) {
565
- this._parentOverlay = _base._parentOverlay;
566
- }
567
- this.tooltipEnter(svgElement);
568
- layerEnter_1.apply(this, arguments);
569
- };
570
- var layerUpdate_1 = this.layerUpdate;
571
- this.layerUpdate = function (_base) {
572
- layerUpdate_1.apply(this, arguments);
573
- this.tooltipUpdate();
574
- };
575
- var layerExit_1 = this.layerExit;
576
- this.layerExit = function (_base) {
577
- this.tooltipExit();
578
- layerExit_1.apply(this, arguments);
579
- };
580
- }
581
- else {
582
- var enter_1 = this.enter;
583
- this.enter = function (_domNode, element) {
584
- this.tooltipEnter(element);
585
- enter_1.apply(this, arguments);
586
- };
587
- var update_1 = this.update;
588
- this.update = function (_domNode, _element) {
589
- update_1.apply(this, arguments);
590
- this.tooltipUpdate();
591
- };
592
- var exit_1 = this.exit;
593
- this.exit = function (_domNode, _element) {
594
- this.tooltipExit();
595
- exit_1.apply(this, arguments);
596
- };
597
- }
598
- }
599
- ITooltip.prototype = Object.create(common.Widget.prototype);
600
- ITooltip.prototype.constructor = ITooltip;
601
- // abstract target(): any;
602
- // abstract target(_: any): this;
603
- ITooltip.prototype.tooltipEnter = function (element) {
604
- var overlayElement = this.parentOverlay();
605
- if (!overlayElement.empty()) {
606
- this.tooltip.rootElement(overlayElement.node().parentNode);
607
- }
608
- element.call(this.tooltip);
609
- };
610
- ITooltip.prototype.tooltipUpdate = function () {
611
- var _this = this;
612
- this.tooltip.offset(function () {
613
- if (event && _this.tooltipFollowMouse()) {
614
- var d3tipElement = document.querySelector(".d3-tip"); // d3Tip offers no reference to the '.d3-tip' element...?
615
- d3tipElement.style.display = "block";
616
- d3tipElement.style.left = _this.tooltipOffset() + (event.clientX) + "px";
617
- d3tipElement.style.top = event.clientY + "px";
618
- return [];
619
- }
620
- switch (_this.tooltip.direction()()) {
621
- case "e":
622
- return [0, _this.tooltipOffset()];
623
- default:
624
- return [-_this.tooltipOffset(), 0];
625
- }
626
- });
627
- var classed = this.tooltip.attr("class");
628
- if (classed) {
629
- classed = classed.split(" notick").join("") + (this.tooltipTick() ? "" : " notick") + (this.tooltipStyle() === "none" ? " hidden" : "");
630
- classed = classed.split(" ")
631
- .filter(function (_class) {
632
- return _class.indexOf("ITooltip-tooltipStyle-") !== 0;
633
- })
634
- .join(" ");
635
- classed += " ITooltip-tooltipStyle-" + this.tooltipStyle();
636
- this.tooltip
637
- .attr("class", classed);
638
- }
639
- };
640
- ITooltip.prototype.tooltipExit = function () {
641
- if (this.tooltip) {
642
- this.tooltip.destroy();
643
- }
644
- };
645
- ITooltip.prototype._tooltipHTML = function (d) {
646
- return d;
647
- };
648
- ITooltip.prototype.tooltipHTML = function (_) {
649
- return this.tooltip.html(_);
650
- };
651
- ITooltip.prototype.tooltipFormat = function (opts) {
652
- if (opts === void 0) { opts = {}; }
653
- opts.label = opts.label === undefined ? "" : opts.label;
654
- if (this._labelFormatter) {
655
- opts.label = this._labelFormatter(opts.label) || "";
656
- }
657
- else if (this.formatData && this.parseData) {
658
- opts.label = this.formatData(this.parseData(opts.label));
659
- }
660
- opts.series = opts.series || "";
661
- if (opts.value instanceof Date) {
662
- opts.value = opts.value || "";
663
- }
664
- else if (this._valueFormatter) {
665
- opts.value = this._valueFormatter(opts.value) || "";
666
- }
667
- else if (this.formatValue && this.parseValue) {
668
- opts.value = this.formatValue(this.parseValue(opts.value));
669
- }
670
- switch (this.tooltipStyle()) {
671
- case "none":
672
- break;
673
- case "series-table":
674
- var html_1 = '<table class="ITooltip-series-table">'
675
- + "<thead>"
676
- + '<tr><th colspan="2">' + opts.label + "</th></tr>"
677
- + "</thead>"
678
- + "<tbody>";
679
- opts.arr.forEach(function (row) {
680
- html_1 += "<tr>";
681
- html_1 += "<td>";
682
- html_1 += '<div class="series-table-row-color" style="background-color:' + row.color + '"></div>';
683
- html_1 += '<div class="series-table-row-label">' + row.label + "</div>";
684
- html_1 += "</td>";
685
- html_1 += '<td><div class="series-table-row-value">' + row.value + "</div></td>";
686
- html_1 += "</tr>";
687
- });
688
- html_1 += "</tbody>";
689
- html_1 += "</table>";
690
- return html_1;
691
- default:
692
- if (opts.series) {
693
- return "<span style='color:" + this.tooltipSeriesColor() + "'>" + opts.series + "</span> / <span style='color:" + this.tooltipLabelColor() + "'>" + opts.label + "</span>: <span style='color:" + this.tooltipValueColor() + "'>" + opts.value + "</span>";
694
- }
695
- if (opts.label !== "") {
696
- return "<span style='color:" + this.tooltipLabelColor() + "'>" + opts.label + "</span>: <span style='color:" + this.tooltipValueColor() + "'>" + opts.value + "</span>";
697
- }
698
- return "<span style='color:" + this.tooltipValueColor() + "'>" + opts.value + "</span>";
699
- }
700
- };
701
- ITooltip.prototype.tooltipKeyValueFormat = function (titleKey, obj) {
702
- var body = "";
703
- for (var key in obj) {
704
- if (key !== titleKey) {
705
- var value = obj && obj[key] ? obj[key] : "";
706
- body += "<tr><td style=\"".concat(this.tooltipLabelColor_exists() ? "color:" + this.tooltipLabelColor() : "", "\">").concat(key, "</td><td style=\"font-weight:normal\">").concat(value, "</td></tr>");
707
- }
708
- }
709
- return "<table>\n <thead>\n <tr><th colspan=\"2\" style=\"font-weight:bold;font-size:16px\">".concat(obj[titleKey], "</th></tr>\n </thead>\n <tbody>\n ").concat(body, "\n </tbody>\n </table>");
710
- };
711
- ITooltip.prototype.publish("tooltipStyle", "default", "set", "Style mode", ["default", "none", "series-table"], {});
712
- ITooltip.prototype.publish("tooltipFollowMouse", false, "boolean", "If true, the tooltip will follow mouse movement", null, {});
713
- ITooltip.prototype.publish("tooltipLabelFormat", undefined, "string", "Format of tooltip label(s) (the domain axis)", null, {});
714
- ITooltip.prototype.publish("tooltipValueFormat", undefined, "string", "Number format of tooltip value(s)", null, {});
715
- ITooltip.prototype.publish("tooltipSeriesColor", "#EAFFFF", "html-color", "Color of tooltip series text", null, {});
716
- ITooltip.prototype.publish("tooltipLabelColor", "#CCFFFF", "html-color", "Color of tooltip label text (the domain axis)", null, {});
717
- ITooltip.prototype.publish("tooltipValueColor", "white", "html-color", "Color of tooltip value(s)", null, {});
718
- ITooltip.prototype.publish("tooltipTick", true, "boolean", "Show tooltip tick", null, {});
719
- ITooltip.prototype.publish("tooltipOffset", 8, "number", "Offset from the cursor", null, {});
720
- var tooltipLabelFormat = ITooltip.prototype.tooltipLabelFormat;
721
- ITooltip.prototype.tooltipLabelFormat = function (_) {
722
- var retVal = tooltipLabelFormat.apply(this, arguments);
723
- if (arguments.length) {
724
- this._labelFormatter = common.format(_);
725
- }
726
- return retVal;
727
- };
728
- var tooltipValueFormat = ITooltip.prototype.tooltipValueFormat;
729
- ITooltip.prototype.tooltipValueFormat = function (_) {
730
- var retVal = tooltipValueFormat.apply(this, arguments);
731
- if (arguments.length) {
732
- this._valueFormatter = common.format(_);
733
- }
734
- return retVal;
735
- };
736
-
737
- // Use old school class declaration as this is a mixin ---
738
- function ITree() {
739
- }
740
- ITree.prototype.constructor = ITree;
741
- // Events ---
742
- ITree.prototype.click = function (row, column, selected) {
743
- };
744
- ITree.prototype.dblclick = function (row, column, selected) {
745
- };
746
- ITree.prototype._palette = common.Palette.ordinal("default");
747
-
748
- exports.BUILD_VERSION = BUILD_VERSION;
749
- exports.I1DChart = I1DChart;
750
- exports.I2DAggrChart = I2DAggrChart;
751
- exports.I2DChart = I2DChart;
752
- exports.IGraph = IGraph;
753
- exports.IInput = IInput;
754
- exports.INDChart = INDChart;
755
- exports.ITooltip = ITooltip;
756
- exports.ITree = ITree;
757
- exports.PKG_NAME = PKG_NAME;
758
- exports.PKG_VERSION = PKG_VERSION;
759
- exports.instanceOfIHighlight = instanceOfIHighlight;
760
-
761
- }));
1
+ var dt=Object.defineProperty;var l=(t,o)=>dt(t,"name",{value:o,configurable:!0});var kt="@hpcc-js/api",Tt="3.2.0",Ft="3.2.0";import{Palette as ht}from"@hpcc-js/common";function W(){}l(W,"I1DChart");W.prototype._dataFamily="1D";W.prototype._palette=ht.rainbow("default");W.prototype.click=function(t,o,r){};W.prototype.dblclick=function(t,o,r){};import{Palette as $}from"@hpcc-js/common";import{hsl as yt}from"@hpcc-js/common";function C(){}l(C,"I2DChart");C.prototype._dataFamily="2D";C.prototype._palette=$.ordinal("default");C.prototype.fillColor=function(t,o,r,i){return this._palette(t[0])};C.prototype.strokeColor=function(t,o,r,i){return yt(this.fillColor(t,o,r,i)).darker().toString()};C.prototype.textColor=function(t,o,r,i){return $.textColor(this.fillColor(t,o,r,i))};C.prototype.click=function(t,o,r){};C.prototype.dblclick=function(t,o,r){};import{Palette as K}from"@hpcc-js/common";import{hsl as mt}from"@hpcc-js/common";function T(){}l(T,"I2DAggrChart");T.prototype._palette=K.rainbow("default");T.prototype.fillColor=function(t,o,r){return this._palette(t.length)};T.prototype.strokeColor=function(t,o,r){return mt(this.fillColor(t,o,r)).darker().toString()};T.prototype.textColor=function(t,o,r){return K.textColor(this.fillColor(t,o,r))};T.prototype.click=function(t,o,r){};T.prototype.dblclick=function(t,o,r){};function L(){}l(L,"IGraph");L.prototype._dataFamily="graph";L.prototype.vertex_click=function(t,o,r,i){i&&i.vertex};L.prototype.vertex_dblclick=function(t,o,r,i){i&&i.vertex};L.prototype.edge_click=function(t,o,r,i){i&&i.edge};L.prototype.edge_dblclick=function(t,o,r,i){i&&i.edge};function Ut(t){return typeof t.highlightColumn=="function"}l(Ut,"instanceOfIHighlight");import{Widget as bt}from"@hpcc-js/common";function f(){}l(f,"IInput");f.prototype=Object.create(bt.prototype);f.prototype.constructor=f;f.prototype.isValid=function(){return!(this.validate()&&!new RegExp(this.validate()).test(this.value()))};f.prototype.hasValue=function(){if(typeof this.type=="function"){switch(this.type()){case"radio":case"checkbox":if(this.value()&&this.value()!=="false")return!0;break;default:if(this.value())return!0;break}return!1}return this.value()!==""};f.prototype.blur=function(t){};f.prototype.keyup=function(t){};f.prototype.focus=function(t){};f.prototype.click=function(t){};f.prototype.dblclick=function(t){};f.prototype.change=function(t,o){};f.prototype.resetValue=function(t){t.value(t._inputElement[0].node().value)};f.prototype.disable=function(t){this._inputElement.forEach(function(o,r){o.attr("disabled",t?"disabled":null)})};f.prototype.setFocus=function(){this._inputElement.length&&this._inputElement[0].node().focus()};f.prototype.publish("name","","string","HTML name for the input");f.prototype.publish("label","","string","Descriptive label");f.prototype.publish("value","","string","Input Current Value");f.prototype.publish("validate",null,"string","Input Validation");import{Palette as j}from"@hpcc-js/common";import{hsl as gt}from"@hpcc-js/common";function I(){}l(I,"INDChart");I.prototype._dataFamily="ND";I.prototype._palette=j.ordinal("default");I.prototype.fillColor=function(t,o,r,i){return this._palette(o)};I.prototype.strokeColor=function(t,o,r,i){return gt(this.fillColor(t,o,r,i)).darker().toString()};I.prototype.textColor=function(t,o,r,i){return j.textColor(this.fillColor(t,o,r,i))};I.prototype.click=function(t,o,r){};I.prototype.dblclick=function(t,o,r){};import{Widget as wt}from"@hpcc-js/common";import{format as B}from"@hpcc-js/common";import{map as xt}from"@hpcc-js/common";import{select as q,selection as X}from"@hpcc-js/common";function Y(){let t=J,o=Q,r=Z,i=E(document.body),a=U(),D=null,c=null,P=null,p=l(function(e){if(D=st(e),!D)return;c=D.createSVGPoint();let u=i();u&&a&&u.appendChild(a)},"tip");p.show=function(e,u,d){P=d[u];let y=Array.prototype.slice.call(arguments),_=r.apply(this,y);if(_===null)return p;let v=o.apply(this,y),h=w(),O=F.length,V,g=i().getBoundingClientRect();for(h.html(_).style("opacity",1).style("pointer-events","all");O--;)h.classed(F[O],!1);let M=!1,m={},S=F[0];for(let n=0;n<F.length&&(M=G(F[n]),!M);n++);if(M)h.classed("notick",!1);else{h.classed("notick",!0);let n=ct(m[S]),k=pt(m[S]);G(S,n,k)}return p;function pt(n){return n.left>n.right?n.left>0?-n.left:0:n.right>0?n.right:0}function ct(n){return n.top>n.bottom?n.top>0?-n.top:0:n.bottom}function G(n,k,H){k=k||0,H=H||0,h.style("white-space","nowrap"),V=R.get(n).apply(this),h.classed(n,!0).style("top",V.top+v[0]-k+"px").style("left",V.left+v[1]-H+"px");let x=h.node().getBoundingClientRect(),z=x.top>g.top&&x.left>g.left&&x.bottom<g.bottom&&x.right<g.right;return m[n]={top:g.top-x.top,right:x.right-g.right,bottom:x.bottom-g.bottom,left:g.left-x.left},h.style("white-space","normal"),m[n].total_overflow=Object.keys(m[n]).filter(A=>m[n][A]>0).reduce((A,ut)=>{let ft=m[n][ut];return A+ft},0),m[S].total_overflow>m[n].total_overflow&&(S=n),z||h.classed(n,!1),z}},p.hide=function(){return w().style("opacity",0).style("pointer-events","none"),p},p.attr=function(e,u){if(arguments.length<2&&typeof e=="string")return w().attr(e);let d=Array.prototype.slice.call(arguments);return X.prototype.attr.apply(w(),d),p},p.style=function(e,u){if(arguments.length<2&&typeof e=="string")return w().style(e);let d=Array.prototype.slice.call(arguments);return X.prototype.style.apply(w(),d),p},p.direction=function(e){return arguments.length?(t=e==null?e:E(e),p):t},p.offset=function(e){return arguments.length?(o=e==null?e:E(e),p):o},p.html=function(e){return arguments.length?(r=e==null?e:E(e),p):r},p.rootElement=function(e){return arguments.length?(i=E(e),p):i},p.destroy=function(){return a&&(w().remove(),a=null),p};function J(){return"n"}l(J,"d3TipDirection");function Q(){return[0,0]}l(Q,"d3TipOffset");function Z(){return" "}l(Z,"d3TipHTML");let R=xt({n:tt,s:ot,e:et,w:rt,nw:lt,ne:it,sw:nt,se:at}),F=R.keys();function tt(){let e=b(window);return{top:e.n.y-a.offsetHeight,left:e.n.x-a.offsetWidth/2}}l(tt,"directionNorth");function ot(){let e=b(window);return{top:e.s.y+8,left:e.s.x-a.offsetWidth/2}}l(ot,"directionSouth");function et(){let e=b(window);return{top:e.e.y-a.offsetHeight/2,left:e.e.x+8}}l(et,"directionEast");function rt(){let e=b(window);return{top:e.w.y-a.offsetHeight/2,left:e.w.x-a.offsetWidth-8}}l(rt,"directionWest");function lt(){let e=b(window);return{top:e.nw.y-a.offsetHeight,left:e.nw.x-a.offsetWidth}}l(lt,"directionNorthWest");function it(){let e=b(window);return{top:e.ne.y-a.offsetHeight,left:e.ne.x}}l(it,"directionNorthEast");function nt(){let e=b(window);return{top:e.sw.y,left:e.sw.x-a.offsetWidth}}l(nt,"directionSouthWest");function at(){let e=b(window);return{top:e.se.y,left:e.se.x}}l(at,"directionSouthEast");function U(){let e=q(document.createElement("div"));return e.attr("class","d3-tip").style("position","absolute").style("top","0px").style("opacity",0).style("pointer-events","none").style("box-sizing","border-box"),e.node()}l(U,"initNode");function st(e){let u=e.node();return u?u.tagName.toLowerCase()==="svg"?u:u.ownerSVGElement:null}l(st,"getSVGNode");function w(){return a==null&&(a=U(),i().appendChild(a)),q(a)}l(w,"getNodeEl");function b(e){let u=P||e;for(;u.getCTM==null&&u.parentNode!=null;)u=u.parentNode;let d={},y=u.getCTM(),_=u.getBBox(),v=_.width,h=_.height,O=_.x,V=_.y;return c.x=O,c.y=V,d.nw=c.matrixTransform(y),c.x+=v,d.ne=c.matrixTransform(y),c.y+=h,d.se=c.matrixTransform(y),c.x-=v,d.sw=c.matrixTransform(y),c.y-=h/2,d.w=c.matrixTransform(y),c.x+=v,d.e=c.matrixTransform(y),c.x-=v/2,c.y-=h/2,d.n=c.matrixTransform(y),c.y+=h,d.s=c.matrixTransform(y),d}l(b,"getScreenBBox");function E(e){return typeof e=="function"?e:function(){return e}}return l(E,"functor"),p}l(Y,"tip");(function(){if(!document.getElementById("487fd6b2")){var t=document.createElement("style");t.id="487fd6b2",t.textContent=`.d3-tip {
2
+ line-height: 1;
3
+ font-weight: bold;
4
+ padding: 12px;
5
+ background: rgba(0, 0, 0, 0.66);
6
+ color: #fff;
7
+ border-radius: 2px;
8
+ pointer-events: none !important;
9
+ z-index:10;
10
+ }
11
+
12
+ .d3-tip.hidden {
13
+ visibility:hidden;
14
+ }
15
+
16
+ /* Creates a small triangle extender for the tooltip */
17
+ .d3-tip:after {
18
+ content: " ";
19
+ box-sizing: border-box;
20
+ display: inline-block;
21
+ border: 4px solid rgba(0, 0, 0, 0.66);
22
+ position: absolute;
23
+ pointer-events: none !important;
24
+ width: 8px;
25
+ height: 8px;
26
+ margin: 0;
27
+ }
28
+
29
+ /* Northward tooltips */
30
+ .d3-tip.n:after {
31
+ top: 100%;
32
+ left: calc(50% - 4px);
33
+ border-top-width: 8px;
34
+ border-right-color: transparent;
35
+ border-bottom-color: transparent;
36
+ border-left-color: transparent;
37
+ }
38
+
39
+ /* Eastward tooltips */
40
+ .d3-tip.e:after {
41
+ top: calc(50% - 4px);
42
+ left: -12px;
43
+ border-top-color: transparent;
44
+ border-right-width: 8px;
45
+ border-bottom-color: transparent;
46
+ border-left-color: transparent;
47
+ }
48
+
49
+ /* Southward tooltips */
50
+ .d3-tip.s {
51
+ margin-top: 8px;
52
+ }
53
+ .d3-tip.s:after {
54
+ top: -12px;
55
+ left: calc(50% - 4px);
56
+ border-top-color: transparent;
57
+ border-right-color: transparent;
58
+ border-bottom-width: 8px;
59
+ border-left-color: transparent;
60
+ }
61
+
62
+ /* Westward tooltips */
63
+ .d3-tip.w:after {
64
+ top: calc(50% - 4px);
65
+ left: 100%;
66
+ border-top-color: transparent;
67
+ border-right-color: transparent;
68
+ border-bottom-color: transparent;
69
+ border-left-width: 8px;
70
+ }
71
+
72
+ .d3-tip.notick:after {
73
+ border-color: transparent !important;
74
+ }
75
+
76
+ .common_Widget .over {
77
+ stroke: rgba(0, 0, 0, 0.66);
78
+ opacity: 0.66;
79
+ }
80
+
81
+ .d3-tip.ITooltip-tooltipStyle-series-table{
82
+ padding: 0;
83
+ }
84
+
85
+ .d3-tip .ITooltip-series-table th,
86
+ .d3-tip .ITooltip-series-table td{
87
+ padding: 6px;
88
+ text-align: left;
89
+ border: 1px solid #D1D1D1;
90
+ }
91
+
92
+ .d3-tip .ITooltip-series-table .series-table-row-color{
93
+ display: inline-block;
94
+ height: 10px;
95
+ width: 10px;
96
+ margin-right: 10px;
97
+ }
98
+
99
+ .d3-tip .ITooltip-series-table .series-table-row-label{
100
+ display: inline-block;
101
+ }
102
+
103
+ .d3-tip .ITooltip-series-table th{
104
+ background-color: #B3B3B3;
105
+ }
106
+
107
+ .d3-tip .ITooltip-series-table td{
108
+ background-color: #FFF;
109
+ color: #555;
110
+ font-weight: normal;
111
+ }
112
+
113
+ .d3-tip .ITooltip-series-table td:first-child{
114
+ border-right: 0;
115
+ }
116
+
117
+ table.ITooltip-series-table td:last-child{
118
+ border-left: 1px dotted #A3A3A3;
119
+ }
120
+ `,document.head.appendChild(t)}})();function s(){if(this.tooltip=Y(),this.tooltipLabelFormat_exists()&&(this._labelFormatter=B(this.tooltipLabelFormat())),this.tooltipValueFormat_exists()&&(this._valueFormatter=B(this.tooltipValueFormat())),this.layerEnter){let t=this.layerEnter;this.layerEnter=function(i,a,D){this._parentOverlay||(this._parentOverlay=i._parentOverlay),this.tooltipEnter(a),t.apply(this,arguments)};let o=this.layerUpdate;this.layerUpdate=function(i){o.apply(this,arguments),this.tooltipUpdate()};let r=this.layerExit;this.layerExit=function(i){this.tooltipExit(),r.apply(this,arguments)}}else{let t=this.enter;this.enter=function(i,a){this.tooltipEnter(a),t.apply(this,arguments)};let o=this.update;this.update=function(i,a){o.apply(this,arguments),this.tooltipUpdate()};let r=this.exit;this.exit=function(i,a){this.tooltipExit(),r.apply(this,arguments)}}}l(s,"ITooltip");s.prototype=Object.create(wt.prototype);s.prototype.constructor=s;s.prototype.tooltipEnter=function(t){let o=this.parentOverlay();o.empty()||this.tooltip.rootElement(o.node().parentNode),t.call(this.tooltip)};s.prototype.tooltipUpdate=function(){this.tooltip.offset(()=>{if(event&&this.tooltipFollowMouse()){let o=document.querySelector(".d3-tip");return o.style.display="block",o.style.left=this.tooltipOffset()+event.clientX+"px",o.style.top=event.clientY+"px",[]}switch(this.tooltip.direction()()){case"e":return[0,this.tooltipOffset()];default:return[-this.tooltipOffset(),0]}});let t=this.tooltip.attr("class");t&&(t=t.split(" notick").join("")+(this.tooltipTick()?"":" notick")+(this.tooltipStyle()==="none"?" hidden":""),t=t.split(" ").filter(function(o){return o.indexOf("ITooltip-tooltipStyle-")!==0}).join(" "),t+=" ITooltip-tooltipStyle-"+this.tooltipStyle(),this.tooltip.attr("class",t))};s.prototype.tooltipExit=function(){this.tooltip&&this.tooltip.destroy()};s.prototype._tooltipHTML=function(t){return t};s.prototype.tooltipHTML=function(t){return this.tooltip.html(t)};s.prototype.tooltipFormat=function(t={}){switch(t.label=t.label===void 0?"":t.label,this._labelFormatter?t.label=this._labelFormatter(t.label)||"":this.formatData&&this.parseData&&(t.label=this.formatData(this.parseData(t.label))),t.series=t.series||"",t.value instanceof Date?t.value=t.value||"":this._valueFormatter?t.value=this._valueFormatter(t.value)||"":this.formatValue&&this.parseValue&&(t.value=this.formatValue(this.parseValue(t.value))),this.tooltipStyle()){case"none":break;case"series-table":let o='<table class="ITooltip-series-table"><thead><tr><th colspan="2">'+t.label+"</th></tr></thead><tbody>";return t.arr.forEach(function(r){o+="<tr>",o+="<td>",o+='<div class="series-table-row-color" style="background-color:'+r.color+'"></div>',o+='<div class="series-table-row-label">'+r.label+"</div>",o+="</td>",o+='<td><div class="series-table-row-value">'+r.value+"</div></td>",o+="</tr>"}),o+="</tbody>",o+="</table>",o;default:return t.series?"<span style='color:"+this.tooltipSeriesColor()+"'>"+t.series+"</span> / <span style='color:"+this.tooltipLabelColor()+"'>"+t.label+"</span>: <span style='color:"+this.tooltipValueColor()+"'>"+t.value+"</span>":t.label!==""?"<span style='color:"+this.tooltipLabelColor()+"'>"+t.label+"</span>: <span style='color:"+this.tooltipValueColor()+"'>"+t.value+"</span>":"<span style='color:"+this.tooltipValueColor()+"'>"+t.value+"</span>"}};s.prototype.tooltipKeyValueFormat=function(t,o){let r="";for(let i in o)if(i!==t){let a=o&&o[i]?o[i]:"";r+=`<tr><td style="${this.tooltipLabelColor_exists()?"color:"+this.tooltipLabelColor():""}">${i}</td><td style="font-weight:normal">${a}</td></tr>`}return`<table>
121
+ <thead>
122
+ <tr><th colspan="2" style="font-weight:bold;font-size:16px">${o[t]}</th></tr>
123
+ </thead>
124
+ <tbody>
125
+ ${r}
126
+ </tbody>
127
+ </table>`};s.prototype.publish("tooltipStyle","default","set","Style mode",["default","none","series-table"],{});s.prototype.publish("tooltipFollowMouse",!1,"boolean","If true, the tooltip will follow mouse movement",null,{});s.prototype.publish("tooltipLabelFormat",void 0,"string","Format of tooltip label(s) (the domain axis)",null,{});s.prototype.publish("tooltipValueFormat",void 0,"string","Number format of tooltip value(s)",null,{});s.prototype.publish("tooltipSeriesColor","#EAFFFF","html-color","Color of tooltip series text",null,{});s.prototype.publish("tooltipLabelColor","#CCFFFF","html-color","Color of tooltip label text (the domain axis)",null,{});s.prototype.publish("tooltipValueColor","white","html-color","Color of tooltip value(s)",null,{});s.prototype.publish("tooltipTick",!0,"boolean","Show tooltip tick",null,{});s.prototype.publish("tooltipOffset",8,"number","Offset from the cursor",null,{});var _t=s.prototype.tooltipLabelFormat;s.prototype.tooltipLabelFormat=function(t){let o=_t.apply(this,arguments);return arguments.length&&(this._labelFormatter=B(t)),o};var vt=s.prototype.tooltipValueFormat;s.prototype.tooltipValueFormat=function(t){let o=vt.apply(this,arguments);return arguments.length&&(this._valueFormatter=B(t)),o};import{Palette as Ct}from"@hpcc-js/common";function N(){}l(N,"ITree");N.prototype.constructor=N;N.prototype.click=function(t,o,r){};N.prototype.dblclick=function(t,o,r){};N.prototype._palette=Ct.ordinal("default");export{Ft as BUILD_VERSION,W as I1DChart,T as I2DAggrChart,C as I2DChart,L as IGraph,f as IInput,I as INDChart,s as ITooltip,N as ITree,kt as PKG_NAME,Tt as PKG_VERSION,Ut as instanceOfIHighlight};
762
128
  //# sourceMappingURL=index.js.map