@hpcc-js/api 2.9.2 → 2.11.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.
- package/dist/index.es6.js +233 -243
- package/dist/index.es6.js.map +1 -1
- package/dist/index.js +233 -243
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -16
- package/dist/index.min.js.map +1 -1
- package/package.json +3 -3
- package/src/IInput.ts +59 -59
- package/src/ITooltip.ts +164 -143
- package/src/ITree.ts +10 -8
- package/src/__package__.ts +2 -2
- package/types/IInput.d.ts +5 -17
- package/types/IInput.d.ts.map +1 -1
- package/types/ITooltip.d.ts +8 -26
- package/types/ITooltip.d.ts.map +1 -1
- package/types/ITree.d.ts +1 -5
- package/types/ITree.d.ts.map +1 -1
- package/types/__package__.d.ts +2 -2
- package/types/__package__.d.ts.map +1 -1
- package/types-3.4/IInput.d.ts +5 -17
- package/types-3.4/ITooltip.d.ts +8 -26
- package/types-3.4/ITree.d.ts +1 -5
- package/types-3.4/__package__.d.ts +2 -2
package/dist/index.es6.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Palette, hsl, Widget, select, selection, map, format } from '@hpcc-js/common';
|
|
2
2
|
|
|
3
3
|
var PKG_NAME = "@hpcc-js/api";
|
|
4
|
-
var PKG_VERSION = "2.
|
|
5
|
-
var BUILD_VERSION = "2.
|
|
4
|
+
var PKG_VERSION = "2.11.0";
|
|
5
|
+
var BUILD_VERSION = "2.103.2";
|
|
6
6
|
|
|
7
7
|
function I1DChart() {
|
|
8
8
|
}
|
|
@@ -72,100 +72,69 @@ function instanceOfIHighlight(w) {
|
|
|
72
72
|
return typeof w.highlightColumn === "function";
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
79
|
-
purpose with or without fee is hereby granted.
|
|
80
|
-
|
|
81
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
82
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
83
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
84
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
85
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
86
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
87
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
88
|
-
***************************************************************************** */
|
|
89
|
-
/* global Reflect, Promise */
|
|
90
|
-
|
|
91
|
-
var extendStatics = function(d, b) {
|
|
92
|
-
extendStatics = Object.setPrototypeOf ||
|
|
93
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
94
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
95
|
-
return extendStatics(d, b);
|
|
96
|
-
};
|
|
97
|
-
|
|
98
|
-
function __extends(d, b) {
|
|
99
|
-
if (typeof b !== "function" && b !== null)
|
|
100
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
101
|
-
extendStatics(d, b);
|
|
102
|
-
function __() { this.constructor = d; }
|
|
103
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
75
|
+
// Use old school class declaration as this is a mixin ---
|
|
76
|
+
function IInput() {
|
|
104
77
|
}
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
if (this.
|
|
114
|
-
var re = new RegExp(this.validate());
|
|
115
|
-
if (!re.test(this.value())) {
|
|
116
|
-
return false;
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
return true;
|
|
120
|
-
};
|
|
121
|
-
IInput.prototype.hasValue = function () {
|
|
122
|
-
if (typeof this.type === "function") {
|
|
123
|
-
switch (this.type()) {
|
|
124
|
-
case "radio":
|
|
125
|
-
/* falls through */
|
|
126
|
-
case "checkbox":
|
|
127
|
-
if (this.value() && this.value() !== "false") {
|
|
128
|
-
return true;
|
|
129
|
-
}
|
|
130
|
-
break;
|
|
131
|
-
default:
|
|
132
|
-
if (this.value()) {
|
|
133
|
-
return true;
|
|
134
|
-
}
|
|
135
|
-
break;
|
|
136
|
-
}
|
|
78
|
+
IInput.prototype = Object.create(Widget.prototype);
|
|
79
|
+
IInput.prototype.constructor = IInput;
|
|
80
|
+
// abstract target(): any;
|
|
81
|
+
// abstract target(_: any): this;
|
|
82
|
+
// Implementation ---
|
|
83
|
+
IInput.prototype.isValid = function () {
|
|
84
|
+
if (this.validate()) {
|
|
85
|
+
var re = new RegExp(this.validate());
|
|
86
|
+
if (!re.test(this.value())) {
|
|
137
87
|
return false;
|
|
138
88
|
}
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
IInput.prototype.disable = function (disable) {
|
|
158
|
-
this._inputElement.forEach(function (e, idx) {
|
|
159
|
-
e.attr("disabled", disable ? "disabled" : null);
|
|
160
|
-
});
|
|
161
|
-
};
|
|
162
|
-
IInput.prototype.setFocus = function () {
|
|
163
|
-
if (this._inputElement.length) {
|
|
164
|
-
this._inputElement[0].node().focus();
|
|
89
|
+
}
|
|
90
|
+
return true;
|
|
91
|
+
};
|
|
92
|
+
IInput.prototype.hasValue = function () {
|
|
93
|
+
if (typeof this.type === "function") {
|
|
94
|
+
switch (this.type()) {
|
|
95
|
+
case "radio":
|
|
96
|
+
/* falls through */
|
|
97
|
+
case "checkbox":
|
|
98
|
+
if (this.value() && this.value() !== "false") {
|
|
99
|
+
return true;
|
|
100
|
+
}
|
|
101
|
+
break;
|
|
102
|
+
default:
|
|
103
|
+
if (this.value()) {
|
|
104
|
+
return true;
|
|
105
|
+
}
|
|
106
|
+
break;
|
|
165
107
|
}
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
108
|
+
return false;
|
|
109
|
+
}
|
|
110
|
+
return this.value() !== "";
|
|
111
|
+
};
|
|
112
|
+
// Events ---
|
|
113
|
+
IInput.prototype.blur = function (_w) {
|
|
114
|
+
};
|
|
115
|
+
IInput.prototype.keyup = function (_w) {
|
|
116
|
+
};
|
|
117
|
+
IInput.prototype.focus = function (_w) {
|
|
118
|
+
};
|
|
119
|
+
IInput.prototype.click = function (_w) {
|
|
120
|
+
};
|
|
121
|
+
IInput.prototype.dblclick = function (_w) {
|
|
122
|
+
};
|
|
123
|
+
IInput.prototype.change = function (_w, complete) {
|
|
124
|
+
};
|
|
125
|
+
IInput.prototype.resetValue = function (w) {
|
|
126
|
+
w.value(w._inputElement[0].node().value);
|
|
127
|
+
};
|
|
128
|
+
IInput.prototype.disable = function (disable) {
|
|
129
|
+
this._inputElement.forEach(function (e, idx) {
|
|
130
|
+
e.attr("disabled", disable ? "disabled" : null);
|
|
131
|
+
});
|
|
132
|
+
};
|
|
133
|
+
IInput.prototype.setFocus = function () {
|
|
134
|
+
if (this._inputElement.length) {
|
|
135
|
+
this._inputElement[0].node().focus();
|
|
136
|
+
}
|
|
137
|
+
};
|
|
169
138
|
IInput.prototype.publish("name", "", "string", "HTML name for the input");
|
|
170
139
|
IInput.prototype.publish("label", "", "string", "Descriptive label");
|
|
171
140
|
IInput.prototype.publish("value", "", "string", "Input Current Value");
|
|
@@ -576,160 +545,182 @@ function styleInject(css, ref) {
|
|
|
576
545
|
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-right-color:transparent;border-top-width:8px;left:calc(50% - 4px);top:100%}.d3-tip.e:after,.d3-tip.n:after{border-bottom-color:transparent;border-left-color:transparent}.d3-tip.e:after{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;left:calc(50% - 4px);top:-12px}.d3-tip.s:after,.d3-tip.w:after{border-right-color:transparent;border-top-color:transparent}.d3-tip.w:after{border-bottom-color:transparent;border-left-width:8px;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}";
|
|
577
546
|
styleInject(css_248z);
|
|
578
547
|
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
_this._valueFormatter = format(_this.tooltipValueFormat());
|
|
585
|
-
if (_this.layerEnter) {
|
|
586
|
-
var layerEnter_1 = _this.layerEnter;
|
|
587
|
-
_this.layerEnter = function (_base, svgElement, _domElement) {
|
|
588
|
-
if (!this._parentOverlay) {
|
|
589
|
-
this._parentOverlay = _base._parentOverlay;
|
|
590
|
-
}
|
|
591
|
-
this.tooltipEnter(svgElement);
|
|
592
|
-
layerEnter_1.apply(this, arguments);
|
|
593
|
-
};
|
|
594
|
-
var layerUpdate_1 = _this.layerUpdate;
|
|
595
|
-
_this.layerUpdate = function (_base) {
|
|
596
|
-
layerUpdate_1.apply(this, arguments);
|
|
597
|
-
this.tooltipUpdate();
|
|
598
|
-
};
|
|
599
|
-
var layerExit_1 = _this.layerExit;
|
|
600
|
-
_this.layerExit = function (_base) {
|
|
601
|
-
this.tooltipExit();
|
|
602
|
-
layerExit_1.apply(this, arguments);
|
|
603
|
-
};
|
|
604
|
-
}
|
|
605
|
-
else {
|
|
606
|
-
var enter_1 = _this.enter;
|
|
607
|
-
_this.enter = function (_domNode, element) {
|
|
608
|
-
this.tooltipEnter(element);
|
|
609
|
-
enter_1.apply(this, arguments);
|
|
610
|
-
};
|
|
611
|
-
var update_1 = _this.update;
|
|
612
|
-
_this.update = function (_domNode, _element) {
|
|
613
|
-
update_1.apply(this, arguments);
|
|
614
|
-
this.tooltipUpdate();
|
|
615
|
-
};
|
|
616
|
-
var exit_1 = _this.exit;
|
|
617
|
-
_this.exit = function (_domNode, _element) {
|
|
618
|
-
this.tooltipExit();
|
|
619
|
-
exit_1.apply(this, arguments);
|
|
620
|
-
};
|
|
621
|
-
}
|
|
622
|
-
return _this;
|
|
548
|
+
// Use old school class declaration as this is a mixin ---
|
|
549
|
+
function ITooltip() {
|
|
550
|
+
this.tooltip = tip();
|
|
551
|
+
if (this.tooltipLabelFormat_exists()) {
|
|
552
|
+
this._labelFormatter = format(this.tooltipLabelFormat());
|
|
623
553
|
}
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
var _this = this;
|
|
633
|
-
this.tooltip.offset(function () {
|
|
634
|
-
if (event && _this.tooltipFollowMouse()) {
|
|
635
|
-
var d3tipElement = document.querySelector(".d3-tip"); // d3Tip offers no reference to the '.d3-tip' element...?
|
|
636
|
-
d3tipElement.style.display = "block";
|
|
637
|
-
d3tipElement.style.left = _this.tooltipOffset() + (event.clientX) + "px";
|
|
638
|
-
d3tipElement.style.top = event.clientY + "px";
|
|
639
|
-
return [];
|
|
640
|
-
}
|
|
641
|
-
switch (_this.tooltip.direction()()) {
|
|
642
|
-
case "e":
|
|
643
|
-
return [0, _this.tooltipOffset()];
|
|
644
|
-
default:
|
|
645
|
-
return [-_this.tooltipOffset(), 0];
|
|
554
|
+
if (this.tooltipValueFormat_exists()) {
|
|
555
|
+
this._valueFormatter = format(this.tooltipValueFormat());
|
|
556
|
+
}
|
|
557
|
+
if (this.layerEnter) {
|
|
558
|
+
var layerEnter_1 = this.layerEnter;
|
|
559
|
+
this.layerEnter = function (_base, svgElement, _domElement) {
|
|
560
|
+
if (!this._parentOverlay) {
|
|
561
|
+
this._parentOverlay = _base._parentOverlay;
|
|
646
562
|
}
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
this.
|
|
658
|
-
|
|
659
|
-
}
|
|
660
|
-
}
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
563
|
+
this.tooltipEnter(svgElement);
|
|
564
|
+
layerEnter_1.apply(this, arguments);
|
|
565
|
+
};
|
|
566
|
+
var layerUpdate_1 = this.layerUpdate;
|
|
567
|
+
this.layerUpdate = function (_base) {
|
|
568
|
+
layerUpdate_1.apply(this, arguments);
|
|
569
|
+
this.tooltipUpdate();
|
|
570
|
+
};
|
|
571
|
+
var layerExit_1 = this.layerExit;
|
|
572
|
+
this.layerExit = function (_base) {
|
|
573
|
+
this.tooltipExit();
|
|
574
|
+
layerExit_1.apply(this, arguments);
|
|
575
|
+
};
|
|
576
|
+
}
|
|
577
|
+
else {
|
|
578
|
+
var enter_1 = this.enter;
|
|
579
|
+
this.enter = function (_domNode, element) {
|
|
580
|
+
this.tooltipEnter(element);
|
|
581
|
+
enter_1.apply(this, arguments);
|
|
582
|
+
};
|
|
583
|
+
var update_1 = this.update;
|
|
584
|
+
this.update = function (_domNode, _element) {
|
|
585
|
+
update_1.apply(this, arguments);
|
|
586
|
+
this.tooltipUpdate();
|
|
587
|
+
};
|
|
588
|
+
var exit_1 = this.exit;
|
|
589
|
+
this.exit = function (_domNode, _element) {
|
|
590
|
+
this.tooltipExit();
|
|
591
|
+
exit_1.apply(this, arguments);
|
|
592
|
+
};
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
ITooltip.prototype = Object.create(Widget.prototype);
|
|
596
|
+
ITooltip.prototype.constructor = ITooltip;
|
|
597
|
+
// abstract target(): any;
|
|
598
|
+
// abstract target(_: any): this;
|
|
599
|
+
ITooltip.prototype.tooltipEnter = function (element) {
|
|
600
|
+
var overlayElement = this.parentOverlay();
|
|
601
|
+
if (!overlayElement.empty()) {
|
|
602
|
+
this.tooltip.rootElement(overlayElement.node().parentNode);
|
|
603
|
+
}
|
|
604
|
+
element.call(this.tooltip);
|
|
605
|
+
};
|
|
606
|
+
ITooltip.prototype.tooltipUpdate = function () {
|
|
607
|
+
var _this = this;
|
|
608
|
+
this.tooltip.offset(function () {
|
|
609
|
+
if (event && _this.tooltipFollowMouse()) {
|
|
610
|
+
var d3tipElement = document.querySelector(".d3-tip"); // d3Tip offers no reference to the '.d3-tip' element...?
|
|
611
|
+
d3tipElement.style.display = "block";
|
|
612
|
+
d3tipElement.style.left = _this.tooltipOffset() + (event.clientX) + "px";
|
|
613
|
+
d3tipElement.style.top = event.clientY + "px";
|
|
614
|
+
return [];
|
|
681
615
|
}
|
|
682
|
-
switch (
|
|
683
|
-
case "
|
|
684
|
-
|
|
685
|
-
case "series-table":
|
|
686
|
-
var html_1 = '<table class="ITooltip-series-table">'
|
|
687
|
-
+ "<thead>"
|
|
688
|
-
+ '<tr><th colspan="2">' + opts.label + "</th></tr>"
|
|
689
|
-
+ "</thead>"
|
|
690
|
-
+ "<tbody>";
|
|
691
|
-
opts.arr.forEach(function (row) {
|
|
692
|
-
html_1 += "<tr>";
|
|
693
|
-
html_1 += "<td>";
|
|
694
|
-
html_1 += '<div class="series-table-row-color" style="background-color:' + row.color + '"></div>';
|
|
695
|
-
html_1 += '<div class="series-table-row-label">' + row.label + "</div>";
|
|
696
|
-
html_1 += "</td>";
|
|
697
|
-
html_1 += '<td><div class="series-table-row-value">' + row.value + "</div></td>";
|
|
698
|
-
html_1 += "</tr>";
|
|
699
|
-
});
|
|
700
|
-
html_1 += "</tbody>";
|
|
701
|
-
html_1 += "</table>";
|
|
702
|
-
return html_1;
|
|
616
|
+
switch (_this.tooltip.direction()()) {
|
|
617
|
+
case "e":
|
|
618
|
+
return [0, _this.tooltipOffset()];
|
|
703
619
|
default:
|
|
704
|
-
|
|
705
|
-
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>";
|
|
706
|
-
}
|
|
707
|
-
if (opts.label !== "") {
|
|
708
|
-
return "<span style='color:" + this.tooltipLabelColor() + "'>" + opts.label + "</span>: <span style='color:" + this.tooltipValueColor() + "'>" + opts.value + "</span>";
|
|
709
|
-
}
|
|
710
|
-
return "<span style='color:" + this.tooltipValueColor() + "'>" + opts.value + "</span>";
|
|
620
|
+
return [-_this.tooltipOffset(), 0];
|
|
711
621
|
}
|
|
712
|
-
};
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
622
|
+
});
|
|
623
|
+
var classed = this.tooltip.attr("class");
|
|
624
|
+
if (classed) {
|
|
625
|
+
classed = classed.split(" notick").join("") + (this.tooltipTick() ? "" : " notick") + (this.tooltipStyle() === "none" ? " hidden" : "");
|
|
626
|
+
classed = classed.split(" ")
|
|
627
|
+
.filter(function (_class) {
|
|
628
|
+
return _class.indexOf("ITooltip-tooltipStyle-") !== 0;
|
|
629
|
+
})
|
|
630
|
+
.join(" ");
|
|
631
|
+
classed += " ITooltip-tooltipStyle-" + this.tooltipStyle();
|
|
632
|
+
this.tooltip
|
|
633
|
+
.attr("class", classed);
|
|
634
|
+
}
|
|
635
|
+
};
|
|
636
|
+
ITooltip.prototype.tooltipExit = function () {
|
|
637
|
+
if (this.tooltip) {
|
|
638
|
+
this.tooltip.destroy();
|
|
639
|
+
}
|
|
640
|
+
};
|
|
641
|
+
ITooltip.prototype._tooltipHTML = function (d) {
|
|
642
|
+
return d;
|
|
643
|
+
};
|
|
644
|
+
ITooltip.prototype.tooltipHTML = function (_) {
|
|
645
|
+
return this.tooltip.html(_);
|
|
646
|
+
};
|
|
647
|
+
ITooltip.prototype.tooltipFormat = function (opts) {
|
|
648
|
+
if (opts === void 0) { opts = {}; }
|
|
649
|
+
opts.label = opts.label === undefined ? "" : opts.label;
|
|
650
|
+
if (this._labelFormatter) {
|
|
651
|
+
opts.label = this._labelFormatter(opts.label) || "";
|
|
652
|
+
}
|
|
653
|
+
else if (this.formatData && this.parseData) {
|
|
654
|
+
opts.label = this.formatData(this.parseData(opts.label));
|
|
655
|
+
}
|
|
656
|
+
opts.series = opts.series || "";
|
|
657
|
+
if (opts.value instanceof Date) {
|
|
658
|
+
opts.value = opts.value || "";
|
|
659
|
+
}
|
|
660
|
+
else if (this._valueFormatter) {
|
|
661
|
+
opts.value = this._valueFormatter(opts.value) || "";
|
|
662
|
+
}
|
|
663
|
+
else if (this.formatValue && this.parseValue) {
|
|
664
|
+
opts.value = this.formatValue(this.parseValue(opts.value));
|
|
665
|
+
}
|
|
666
|
+
switch (this.tooltipStyle()) {
|
|
667
|
+
case "none":
|
|
668
|
+
break;
|
|
669
|
+
case "series-table":
|
|
670
|
+
var html_1 = '<table class="ITooltip-series-table">'
|
|
671
|
+
+ "<thead>"
|
|
672
|
+
+ '<tr><th colspan="2">' + opts.label + "</th></tr>"
|
|
673
|
+
+ "</thead>"
|
|
674
|
+
+ "<tbody>";
|
|
675
|
+
opts.arr.forEach(function (row) {
|
|
676
|
+
html_1 += "<tr>";
|
|
677
|
+
html_1 += "<td>";
|
|
678
|
+
html_1 += '<div class="series-table-row-color" style="background-color:' + row.color + '"></div>';
|
|
679
|
+
html_1 += '<div class="series-table-row-label">' + row.label + "</div>";
|
|
680
|
+
html_1 += "</td>";
|
|
681
|
+
html_1 += '<td><div class="series-table-row-value">' + row.value + "</div></td>";
|
|
682
|
+
html_1 += "</tr>";
|
|
683
|
+
});
|
|
684
|
+
html_1 += "</tbody>";
|
|
685
|
+
html_1 += "</table>";
|
|
686
|
+
return html_1;
|
|
687
|
+
default:
|
|
688
|
+
if (opts.series) {
|
|
689
|
+
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>";
|
|
690
|
+
}
|
|
691
|
+
if (opts.label !== "") {
|
|
692
|
+
return "<span style='color:" + this.tooltipLabelColor() + "'>" + opts.label + "</span>: <span style='color:" + this.tooltipValueColor() + "'>" + opts.value + "</span>";
|
|
719
693
|
}
|
|
694
|
+
return "<span style='color:" + this.tooltipValueColor() + "'>" + opts.value + "</span>";
|
|
695
|
+
}
|
|
696
|
+
};
|
|
697
|
+
ITooltip.prototype.tooltipKeyValueFormat = function (titleKey, obj) {
|
|
698
|
+
var body = "";
|
|
699
|
+
for (var key in obj) {
|
|
700
|
+
if (key !== titleKey) {
|
|
701
|
+
var value = obj && obj[key] ? obj[key] : "";
|
|
702
|
+
body += "<tr><td style=\"".concat(this.tooltipLabelColor_exists() ? "color:" + this.tooltipLabelColor() : "", "\">").concat(key, "</td><td style=\"font-weight:normal\">").concat(value, "</td></tr>");
|
|
720
703
|
}
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
}(Widget));
|
|
704
|
+
}
|
|
705
|
+
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>");
|
|
706
|
+
};
|
|
725
707
|
ITooltip.prototype.publish("tooltipStyle", "default", "set", "Style mode", ["default", "none", "series-table"], {});
|
|
726
708
|
ITooltip.prototype.publish("tooltipFollowMouse", false, "boolean", "If true, the tooltip will follow mouse movement", null, {});
|
|
727
|
-
ITooltip.prototype.publish("
|
|
709
|
+
ITooltip.prototype.publish("tooltipLabelFormat", undefined, "string", "Format of tooltip label(s) (the domain axis)", null, {});
|
|
710
|
+
ITooltip.prototype.publish("tooltipValueFormat", undefined, "string", "Number format of tooltip value(s)", null, {});
|
|
728
711
|
ITooltip.prototype.publish("tooltipSeriesColor", "#EAFFFF", "html-color", "Color of tooltip series text", null, {});
|
|
729
|
-
ITooltip.prototype.publish("tooltipLabelColor", "#CCFFFF", "html-color", "Color of tooltip label text", null, {});
|
|
712
|
+
ITooltip.prototype.publish("tooltipLabelColor", "#CCFFFF", "html-color", "Color of tooltip label text (the domain axis)", null, {});
|
|
730
713
|
ITooltip.prototype.publish("tooltipValueColor", "white", "html-color", "Color of tooltip value(s)", null, {});
|
|
731
714
|
ITooltip.prototype.publish("tooltipTick", true, "boolean", "Show tooltip tick", null, {});
|
|
732
715
|
ITooltip.prototype.publish("tooltipOffset", 8, "number", "Offset from the cursor", null, {});
|
|
716
|
+
var tooltipLabelFormat = ITooltip.prototype.tooltipLabelFormat;
|
|
717
|
+
ITooltip.prototype.tooltipLabelFormat = function (_) {
|
|
718
|
+
var retVal = tooltipLabelFormat.apply(this, arguments);
|
|
719
|
+
if (arguments.length) {
|
|
720
|
+
this._labelFormatter = format(_);
|
|
721
|
+
}
|
|
722
|
+
return retVal;
|
|
723
|
+
};
|
|
733
724
|
var tooltipValueFormat = ITooltip.prototype.tooltipValueFormat;
|
|
734
725
|
ITooltip.prototype.tooltipValueFormat = function (_) {
|
|
735
726
|
var retVal = tooltipValueFormat.apply(this, arguments);
|
|
@@ -739,16 +730,15 @@ ITooltip.prototype.tooltipValueFormat = function (_) {
|
|
|
739
730
|
return retVal;
|
|
740
731
|
};
|
|
741
732
|
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
}());
|
|
733
|
+
// Use old school class declaration as this is a mixin ---
|
|
734
|
+
function ITree() {
|
|
735
|
+
}
|
|
736
|
+
ITree.prototype.constructor = ITree;
|
|
737
|
+
// Events ---
|
|
738
|
+
ITree.prototype.click = function (row, column, selected) {
|
|
739
|
+
};
|
|
740
|
+
ITree.prototype.dblclick = function (row, column, selected) {
|
|
741
|
+
};
|
|
752
742
|
ITree.prototype._palette = Palette.ordinal("default");
|
|
753
743
|
|
|
754
744
|
export { BUILD_VERSION, I1DChart, I2DAggrChart, I2DChart, IGraph, IInput, INDChart, ITooltip, ITree, PKG_NAME, PKG_VERSION, instanceOfIHighlight };
|