tsichart-core 1.0.5 → 2.0.0-beta.2

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 (135) hide show
  1. package/LICENSE +22 -22
  2. package/README.md +80 -0
  3. package/dist/index.d.ts +1744 -0
  4. package/dist/index.js +14284 -0
  5. package/dist/index.js.map +1 -0
  6. package/dist/index.mjs +14209 -0
  7. package/dist/index.mjs.map +1 -0
  8. package/dist/{tsiclient.css → styles/index.css} +9498 -9497
  9. package/dist/styles/index.css.map +1 -0
  10. package/package.json +115 -124
  11. package/README.MD +0 -171
  12. package/dist/AggregateExpression.d.ts +0 -13
  13. package/dist/AggregateExpression.js +0 -70
  14. package/dist/AvailabilityChart-C8ewvn3T.js +0 -488
  15. package/dist/AvailabilityChart.d.ts +0 -59
  16. package/dist/AvailabilityChart.js +0 -26
  17. package/dist/ChartComponent-Dg8P-BTZ.js +0 -302
  18. package/dist/ChartComponent-ONNW31RL.d.ts +0 -80
  19. package/dist/ChartComponentData-DBW8_FnY.d.ts +0 -47
  20. package/dist/ChartDataOptions-CNTSB636.js +0 -49
  21. package/dist/ChartDataOptions-D0BJuRZy.d.ts +0 -38
  22. package/dist/ChartVisualizationComponent-CTs5Q_sg.js +0 -23
  23. package/dist/ChartVisualizationComponent-CpR8xZla.d.ts +0 -8
  24. package/dist/ColorPicker-0p6vkATj.js +0 -120
  25. package/dist/ColorPicker.d.ts +0 -28
  26. package/dist/ColorPicker.js +0 -6
  27. package/dist/Component-BgifJdKl.js +0 -401
  28. package/dist/Component-DXwYPoSo.d.ts +0 -226
  29. package/dist/ContextMenu-wqGGgAzp.js +0 -197
  30. package/dist/DateTimeButton-D7N8XG0S.js +0 -38
  31. package/dist/DateTimeButton-DfJL5kvr.d.ts +0 -16
  32. package/dist/DateTimeButtonRange-BM_J646m.js +0 -71
  33. package/dist/DateTimeButtonRange.d.ts +0 -19
  34. package/dist/DateTimeButtonRange.js +0 -15
  35. package/dist/DateTimeButtonSingle-BxMSitQG.js +0 -48
  36. package/dist/DateTimeButtonSingle.d.ts +0 -17
  37. package/dist/DateTimeButtonSingle.js +0 -14
  38. package/dist/DateTimePicker-BgTi-DY9.js +0 -532
  39. package/dist/DateTimePicker.d.ts +0 -69
  40. package/dist/DateTimePicker.js +0 -13
  41. package/dist/EllipsisMenu-CxJ0LoVm.js +0 -116
  42. package/dist/EllipsisMenu.d.ts +0 -20
  43. package/dist/EllipsisMenu.js +0 -6
  44. package/dist/Enums-DWpaQlXk.d.ts +0 -12
  45. package/dist/EventsTable-CsnBvvIW.js +0 -553
  46. package/dist/EventsTable.d.ts +0 -34
  47. package/dist/EventsTable.js +0 -10
  48. package/dist/GeoProcessGraphic-CUBMHIHX.js +0 -145
  49. package/dist/GeoProcessGraphic.d.ts +0 -34
  50. package/dist/GeoProcessGraphic.js +0 -7
  51. package/dist/Grid-uoHKTet9.js +0 -874
  52. package/dist/Grid.d.ts +0 -43
  53. package/dist/Grid.js +0 -6
  54. package/dist/GroupedBarChart-Bc3cGhgz.js +0 -579
  55. package/dist/GroupedBarChart.d.ts +0 -22
  56. package/dist/GroupedBarChart.js +0 -17
  57. package/dist/GroupedBarChartData-B7BTM9JH.d.ts +0 -20
  58. package/dist/GroupedBarChartData-Ml5JJimg.js +0 -121
  59. package/dist/Heatmap-5gFc_AVW.js +0 -524
  60. package/dist/Heatmap.d.ts +0 -31
  61. package/dist/Heatmap.js +0 -14
  62. package/dist/Hierarchy-C5ueDsus.js +0 -260
  63. package/dist/Hierarchy.d.ts +0 -39
  64. package/dist/Hierarchy.js +0 -6
  65. package/dist/HierarchyNavigation-C3Pwt0D6.js +0 -336
  66. package/dist/HierarchyNavigation.d.ts +0 -34
  67. package/dist/HierarchyNavigation.js +0 -6
  68. package/dist/HistoryPlayback-D09bter3.js +0 -175
  69. package/dist/HistoryPlayback-DmJ6u7lU.d.ts +0 -68
  70. package/dist/Interfaces-R_1l9lIT.d.ts +0 -6
  71. package/dist/Legend-gCIrAytG.js +0 -497
  72. package/dist/LineChart-CzDp5ULB.js +0 -3181
  73. package/dist/LineChart.d.ts +0 -163
  74. package/dist/LineChart.js +0 -18
  75. package/dist/ModelAutocomplete-lU71Ndju.js +0 -100
  76. package/dist/ModelAutocomplete.d.ts +0 -12
  77. package/dist/ModelAutocomplete.js +0 -7
  78. package/dist/ModelSearch-OF4DygOJ.js +0 -189
  79. package/dist/ModelSearch.d.ts +0 -23
  80. package/dist/ModelSearch.js +0 -9
  81. package/dist/PieChart-XLc9Itne.js +0 -258
  82. package/dist/PieChart.d.ts +0 -26
  83. package/dist/PieChart.js +0 -17
  84. package/dist/PlaybackControls-DbG9gExy.js +0 -195
  85. package/dist/PlaybackControls.d.ts +0 -39
  86. package/dist/PlaybackControls.js +0 -13
  87. package/dist/ProcessGraphic-Cft1b4Mf.js +0 -154
  88. package/dist/ProcessGraphic.d.ts +0 -31
  89. package/dist/ProcessGraphic.js +0 -7
  90. package/dist/ScatterPlot-CdnqSHq2.js +0 -924
  91. package/dist/ScatterPlot.d.ts +0 -115
  92. package/dist/ScatterPlot.js +0 -17
  93. package/dist/SingleDateTimePicker-Ddr-ogTk.js +0 -213
  94. package/dist/SingleDateTimePicker.d.ts +0 -45
  95. package/dist/SingleDateTimePicker.js +0 -12
  96. package/dist/Slider-CX0nvlqx.js +0 -186
  97. package/dist/Slider.d.ts +0 -31
  98. package/dist/Slider.js +0 -6
  99. package/dist/TemporalXAxisComponent-DXmMekYq.js +0 -129
  100. package/dist/TemporalXAxisComponent-PIeiJYUr.d.ts +0 -23
  101. package/dist/TimezonePicker-CQpXR5eb.js +0 -58
  102. package/dist/TimezonePicker.d.ts +0 -16
  103. package/dist/TimezonePicker.js +0 -10
  104. package/dist/Tooltip-C13k0eeH.js +0 -104
  105. package/dist/TsqExpression.d.ts +0 -36
  106. package/dist/TsqExpression.js +0 -89
  107. package/dist/UXClient-Bn1afElm.js +0 -230
  108. package/dist/UXClient.d.ts +0 -74
  109. package/dist/UXClient.js +0 -47
  110. package/dist/Utils-BcQeZOM3.d.ts +0 -104
  111. package/dist/Utils-DDGqSryb.js +0 -1138
  112. package/dist/Utils.d.ts +0 -7
  113. package/dist/Utils.js +0 -7
  114. package/dist/_tslib-BYFmvNeL.js +0 -96
  115. package/dist/pikaday-jh_aVtJs.js +0 -1252
  116. package/dist/tsiclient.cjs.js +0 -3
  117. package/dist/tsiclient.cjs.js.LICENSE.txt +0 -19
  118. package/dist/tsiclient.cjs.js.map +0 -1
  119. package/dist/tsiclient.d.ts +0 -46
  120. package/dist/tsiclient.esm.js +0 -3
  121. package/dist/tsiclient.esm.js.LICENSE.txt +0 -19
  122. package/dist/tsiclient.esm.js.map +0 -1
  123. package/dist/tsiclient.js +0 -58
  124. package/dist/tsiclient.min.css +0 -6
  125. package/dist/tsiclient.min.css.map +0 -1
  126. package/dist/tsiclient.umd.js +0 -3
  127. package/dist/tsiclient.umd.js.LICENSE.txt +0 -19
  128. package/dist/tsiclient.umd.js.map +0 -1
  129. package/dist/tsiclient.umd.min.js +0 -3
  130. package/dist/tsiclient.umd.min.js.LICENSE.txt +0 -19
  131. package/dist/tsiclient.umd.min.js.map +0 -1
  132. package/tsiclient.css +0 -17323
  133. package/tsiclient.d.ts +0 -46
  134. package/tsiclient.js +0 -58
  135. package/tsiclient.min.css +0 -6
@@ -1,129 +0,0 @@
1
- import { _ as __extends } from './_tslib-BYFmvNeL.js';
2
- import * as d3 from 'd3';
3
- import { U as Utils } from './Utils-DDGqSryb.js';
4
- import { C as ChartVisualizationComponent } from './ChartVisualizationComponent-CTs5Q_sg.js';
5
-
6
- var TemporalXAxisComponent = /** @class */ (function (_super) {
7
- __extends(TemporalXAxisComponent, _super);
8
- function TemporalXAxisComponent(renderTarget) {
9
- return _super.call(this, renderTarget) || this;
10
- }
11
- TemporalXAxisComponent.prototype.createOffsetXAxis = function () {
12
- var xCopy = this.x.copy();
13
- var rawStart = this.chartOptions.timeFrame ? (new Date(this.chartOptions.timeFrame[0])) : xCopy.domain()[0];
14
- var rawEnd = this.chartOptions.timeFrame ? (new Date(this.chartOptions.timeFrame[1])) : xCopy.domain()[1];
15
- xCopy.domain([
16
- new Date(rawStart), new Date(rawEnd)
17
- ]);
18
- return xCopy;
19
- };
20
- TemporalXAxisComponent.prototype.createXAxis = function (singleLineXAxisLabel, snapFirst, snapLast) {
21
- if (snapFirst === void 0) { snapFirst = false; }
22
- if (snapLast === void 0) { snapLast = false; }
23
- var offsetX = this.createOffsetXAxis();
24
- var ticks = offsetX.ticks(this.getXTickNumber(singleLineXAxisLabel));
25
- if (ticks.length <= 2) {
26
- ticks = this.x.domain();
27
- }
28
- if (snapFirst) {
29
- ticks[0] = this.x.domain()[0];
30
- }
31
- if (snapLast) {
32
- ticks[ticks.length - 1] = this.x.domain()[1];
33
- }
34
- this.smartTickFormat = this.createSmartTickFormat(ticks, offsetX);
35
- return d3.axisBottom(this.x)
36
- .tickValues(ticks)
37
- .tickFormat(Utils.timeFormat(this.labelFormatUsesSeconds(ticks), this.labelFormatUsesMillis(ticks), this.chartOptions.offset, this.chartOptions.is24HourTime, null, null, this.chartOptions.dateLocale));
38
- };
39
- TemporalXAxisComponent.prototype.getXTickNumber = function (singleLineXAxisLabel) {
40
- return Math.max((singleLineXAxisLabel ? Math.floor(this.chartWidth / 300) : Math.floor(this.chartWidth / 160)), 1);
41
- };
42
- TemporalXAxisComponent.prototype.labelFormatUsesSeconds = function (ticks) {
43
- if (ticks === void 0) { ticks = null; }
44
- var tickSpanSubMinute = ticks ? !this.isTickSpanGreaterThan(ticks, 59 * 1000) : false;
45
- return !this.chartOptions.minutesForTimeLabels && tickSpanSubMinute;
46
- };
47
- TemporalXAxisComponent.prototype.labelFormatUsesMillis = function (ticks) {
48
- if (ticks === void 0) { ticks = null; }
49
- var tickSpanSubSecond = ticks ? !this.isTickSpanGreaterThan(ticks, 999) : false;
50
- return !this.chartOptions.minutesForTimeLabels && tickSpanSubSecond;
51
- };
52
- TemporalXAxisComponent.prototype.updateXAxis = function (forceFirst, forceLast) {
53
- if (forceFirst === void 0) { forceFirst = false; }
54
- if (forceLast === void 0) { forceLast = false; }
55
- this.xAxisEntered.call(this.createXAxis(this.chartOptions.singleLineXAxisLabel, forceFirst, forceLast));
56
- this.updateAxisText(forceFirst, forceLast);
57
- };
58
- TemporalXAxisComponent.prototype.updateAxisText = function (forceFirst, forceLast) {
59
- if (forceFirst === void 0) { forceFirst = false; }
60
- if (forceLast === void 0) { forceLast = false; }
61
- //update text by applying function
62
- if (this.chartOptions.xAxisTimeFormat) {
63
- var indexOfLast_1 = this.xAxisEntered.selectAll('.tick').size() - 1;
64
- var self_1 = this;
65
- this.xAxisEntered.selectAll('.tick').each(function (d, i) {
66
- d3.select(this).select('text').text(function (d) {
67
- var momentTimeFormatString = String(self_1.chartOptions.xAxisTimeFormat(d, i, i === 0, i === indexOfLast_1));
68
- return Utils.timeFormat(self_1.labelFormatUsesSeconds(), self_1.labelFormatUsesMillis(), self_1.chartOptions.offset, self_1.chartOptions.is24HourTime, null, momentTimeFormatString, self_1.chartOptions.dateLocale)(d);
69
- });
70
- });
71
- }
72
- else {
73
- var indexOfLast_2 = this.xAxisEntered.selectAll('.tick').size() - 1;
74
- var self_2 = this;
75
- this.xAxisEntered.selectAll('.tick').each(function (d, i) {
76
- d3.select(this).select('text').text(function (d) {
77
- var momentTimeFormatString = String(self_2.smartTickFormat(d, i, i === 0, i === indexOfLast_2));
78
- //harcode format of first and last to include hours/minutes if force first/last
79
- if ((i === 0 && forceFirst) || (i === indexOfLast_2 && forceLast)) {
80
- momentTimeFormatString = 'L ' + Utils.subDateTimeFormat(self_2.chartOptions.is24HourTime, false, false);
81
- }
82
- return Utils.timeFormat(self_2.labelFormatUsesSeconds(), self_2.labelFormatUsesMillis(), self_2.chartOptions.offset, self_2.chartOptions.is24HourTime, null, momentTimeFormatString, self_2.chartOptions.dateLocale)(d);
83
- });
84
- });
85
- }
86
- if (!this.chartOptions.singleLineXAxisLabel)
87
- this.xAxisEntered.selectAll('text').call(Utils.splitTimeLabel);
88
- this.xAxisEntered.select(".domain").style("display", "none");
89
- };
90
- TemporalXAxisComponent.prototype.drawXAxis = function (yOffset, snapFirst, snapLast) {
91
- if (snapFirst === void 0) { snapFirst = false; }
92
- if (snapLast === void 0) { snapLast = false; }
93
- this.xAxisEntered = this.xAxis.enter()
94
- .append("g")
95
- .attr("class", "xAxis")
96
- .merge(this.xAxis)
97
- .attr("transform", "translate(0," + yOffset + ")")
98
- .call(this.createXAxis(this.chartOptions.singleLineXAxisLabel, snapFirst, snapLast));
99
- this.updateAxisText(snapFirst, snapLast);
100
- };
101
- TemporalXAxisComponent.prototype.isSameDate = function (d1, d2) {
102
- return (d1.getYear() === d2.getYear() && d1.getMonth() === d2.getMonth() && d1.getDate() === d2.getDate());
103
- };
104
- TemporalXAxisComponent.prototype.isTickSpanGreaterThan = function (ticks, minValue) {
105
- return (ticks[1].valueOf() - ticks[0].valueOf() >= minValue);
106
- };
107
- TemporalXAxisComponent.prototype.createSmartTickFormat = function (ticks, offsetX) {
108
- var _this = this;
109
- var spansMultipleDays = !this.isSameDate(offsetX.domain()[0], offsetX.domain()[1]);
110
- var lessTicksThanDays = this.isTickSpanGreaterThan(ticks, 23 * 60 * 60 * 1000);
111
- var timeFormat = Utils.subDateTimeFormat(this.chartOptions.is24HourTime, this.labelFormatUsesSeconds(ticks), this.labelFormatUsesMillis(ticks));
112
- return function (d, i, isFirst, isLast) {
113
- var timeAndDate = _this.chartOptions.singleLineXAxisLabel ? ('L ' + timeFormat) : (timeFormat + ' L');
114
- if (lessTicksThanDays) {
115
- return 'L';
116
- }
117
- if (isFirst || isLast) {
118
- return timeAndDate;
119
- }
120
- if (!spansMultipleDays) {
121
- return timeFormat;
122
- }
123
- return timeAndDate;
124
- };
125
- };
126
- return TemporalXAxisComponent;
127
- }(ChartVisualizationComponent));
128
-
129
- export { TemporalXAxisComponent as T };
@@ -1,23 +0,0 @@
1
- import { C as ChartVisualizationComponent } from './ChartVisualizationComponent-CpR8xZla.js';
2
-
3
- declare class TemporalXAxisComponent extends ChartVisualizationComponent {
4
- protected xAxis: any;
5
- protected x: any;
6
- protected chartHeight: any;
7
- private smartTickFormat;
8
- private xAxisEntered;
9
- constructor(renderTarget: Element);
10
- private createOffsetXAxis;
11
- private createXAxis;
12
- private getXTickNumber;
13
- private labelFormatUsesSeconds;
14
- private labelFormatUsesMillis;
15
- updateXAxis(forceFirst?: boolean, forceLast?: boolean): void;
16
- private updateAxisText;
17
- protected drawXAxis(yOffset: any, snapFirst?: boolean, snapLast?: boolean): void;
18
- private isSameDate;
19
- private isTickSpanGreaterThan;
20
- private createSmartTickFormat;
21
- }
22
-
23
- export { TemporalXAxisComponent as T };
@@ -1,58 +0,0 @@
1
- import { _ as __extends } from './_tslib-BYFmvNeL.js';
2
- import * as d3 from 'd3';
3
- import { C as ChartComponent } from './ChartComponent-Dg8P-BTZ.js';
4
- import { U as Utils } from './Utils-DDGqSryb.js';
5
- import moment from 'moment-timezone';
6
-
7
- var TimezonePicker = /** @class */ (function (_super) {
8
- __extends(TimezonePicker, _super);
9
- function TimezonePicker(renderTarget) {
10
- var _this = _super.call(this, renderTarget) || this;
11
- _this.timeZones = ["Local", "UTC", "Africa/Algiers", "Africa/Cairo", "Africa/Casablanca", "Africa/Harare", "Africa/Johannesburg", "Africa/Lagos", "Africa/Nairobi", "Africa/Windhoek", "America/Anchorage", "America/Bogota", "America/Buenos Aires", "America/Caracas", "America/Chicago", "America/Chihuahua", "America/Denver", "America/Edmonton", "America/Godthab", "America/Guatemala", "America/Halifax", "America/Indiana/Indianapolis", "America/Los Angeles", "America/Manaus", "America/Mexico City", "America/Montevideo", "America/New York", "America/Phoenix", "America/Santiago", "America/Sao Paulo", "America/St Johns", "America/Tijuana", "America/Toronto", "America/Vancouver", "America/Winnipeg", "Asia/Amman", "Asia/Beirut", "Asia/Baghdad", "Asia/Baku", "Asia/Bangkok", "Asia/Calcutta", "Asia/Colombo", "Asia/Dhaka", "Asia/Dubai", "Asia/Ho Chi Minh", "Asia/Hong Kong", "Asia/Irkutsk", "Asia/Istanbul", "Asia/Jakarta", "Asia/Jerusalem", "Asia/Kabul", "Asia/Karachi", "Asia/Kathmandu", "Asia/Krasnoyarsk", "Asia/Kuala Lumpur", "Asia/Kuwait", "Asia/Magadan", "Asia/Muscat", "Asia/Novosibirsk", "Asia/Qatar", "Asia/Rangoon", "Asia/Seoul", "Asia/Shanghai", "Asia/Singapore", "Asia/Taipei", "Asia/Tbilisi", "Asia/Tehran", "Asia/Tokyo", "Asia/Vladivostok", "Asia/Yakutsk", "Asia/Yekaterinburg", "Asia/Yerevan", "Atlantic/Azores", "Atlantic/Cape Verde", "Atlantic/South Georgia", "Australia/Adelaide", "Australia/Brisbane", "Australia/Canberra", "Australia/Darwin", "Australia/Hobart", "Australia/Melbourne", "Australia/Perth", "Australia/Queensland", "Australia/Sydney", "Europe/Amsterdam", "Europe/Andorra", "Europe/Athens", "Europe/Belfast", "Europe/Belgrade", "Europe/Berlin", "Europe/Brussels", "Europe/Budapest", "Europe/Dublin", "Europe/Helsinki", "Europe/Kiev", "Europe/Lisbon", "Europe/London", "Europe/Luxembourg", "Europe/Madrid", "Europe/Minsk", "Europe/Monaco", "Europe/Moscow", "Europe/Oslo", "Europe/Paris", "Europe/Rome", "Europe/Stockholm", "Europe/Vienna", "Europe/Warsaw", "Europe/Zurich", "Pacific/Auckland", "Pacific/Fiji", "Pacific/Guam", "Pacific/Honolulu", "Pacific/Midway", "Pacific/Tongatapu"];
12
- return _this;
13
- }
14
- TimezonePicker.prototype.sortTimezones = function () {
15
- var filteredTimezones = this.timeZones.filter(function (tz) {
16
- return !(tz.toLowerCase() == 'local' || tz == 'UTC');
17
- });
18
- filteredTimezones.sort(function (a, b) {
19
- var aOffset = moment.tz(new Date(), a.split(' ').join('_')).utcOffset();
20
- var bOffset = moment.tz(new Date(), b.split(' ').join('_')).utcOffset();
21
- if (aOffset < bOffset) {
22
- return -1;
23
- }
24
- if (aOffset > bOffset) {
25
- return 1;
26
- }
27
- return 0;
28
- });
29
- this.timeZones = ['Local', 'UTC'].concat(filteredTimezones);
30
- };
31
- TimezonePicker.prototype.render = function (onTimezoneSelect, defaultTimeZone) {
32
- var _this = this;
33
- if (defaultTimeZone === void 0) { defaultTimeZone = null; }
34
- this.targetElement = d3.select(this.renderTarget)
35
- .classed("tsi-timezonePicker", true);
36
- var timezoneSelection = this.targetElement.append("select")
37
- .attr("class", "tsi-timezonePicker tsi-select");
38
- this.sortTimezones();
39
- var options = timezoneSelection.selectAll("option")
40
- .data(this.timeZones)
41
- .enter()
42
- .append("option")
43
- .attr('value', function (d) { return d; })
44
- .text(function (tz) { return Utils.convertTimezoneToLabel(tz, _this.getString('Local')); });
45
- timezoneSelection.on("change", function (d) {
46
- var timezone = d3.select(this).node().value.replace(/\s/g, "_");
47
- onTimezoneSelect(timezone);
48
- });
49
- defaultTimeZone = defaultTimeZone.replace(/_/g, " ");
50
- if (defaultTimeZone != null) {
51
- options.filter(function (d) { return d == defaultTimeZone; }).attr("selected", true);
52
- }
53
- return;
54
- };
55
- return TimezonePicker;
56
- }(ChartComponent));
57
-
58
- export { TimezonePicker as T };
@@ -1,16 +0,0 @@
1
- import { C as ChartComponent } from './ChartComponent-ONNW31RL.js';
2
- import './Enums-DWpaQlXk.js';
3
- import './Component-DXwYPoSo.js';
4
- import './Interfaces-R_1l9lIT.js';
5
- import './ChartComponentData-DBW8_FnY.js';
6
- import './EllipsisMenu.js';
7
-
8
- declare class TimezonePicker extends ChartComponent {
9
- private targetElement;
10
- private timeZones;
11
- constructor(renderTarget: Element);
12
- private sortTimezones;
13
- render(onTimezoneSelect: any, defaultTimeZone?: string): void;
14
- }
15
-
16
- export { TimezonePicker as default };
@@ -1,10 +0,0 @@
1
- export { T as default } from './TimezonePicker-CQpXR5eb.js';
2
- import './_tslib-BYFmvNeL.js';
3
- import 'd3';
4
- import './ChartComponent-Dg8P-BTZ.js';
5
- import './Utils-DDGqSryb.js';
6
- import 'moment-timezone';
7
- import './Component-BgifJdKl.js';
8
- import './Grid-uoHKTet9.js';
9
- import 'split.js';
10
- import './EllipsisMenu-CxJ0LoVm.js';
@@ -1,104 +0,0 @@
1
- import { _ as __extends } from './_tslib-BYFmvNeL.js';
2
- import * as d3 from 'd3';
3
- import { C as Component } from './Component-BgifJdKl.js';
4
-
5
- var Tooltip = /** @class */ (function (_super) {
6
- __extends(Tooltip, _super);
7
- function Tooltip(renderTarget) {
8
- return _super.call(this, renderTarget) || this;
9
- }
10
- Tooltip.prototype.hide = function () {
11
- if (this.tooltipDiv) {
12
- this.tooltipDiv.style("display", "none");
13
- }
14
- };
15
- Tooltip.prototype.getSVGWidth = function () {
16
- return !this.renderTarget.select('.tsi-chartSVG').empty() ? this.renderTarget.select('.tsi-chartSVG').node().getBoundingClientRect().width : 0;
17
- };
18
- Tooltip.prototype.getSVGHeight = function () {
19
- return !this.renderTarget.select('.tsi-chartSVG').empty() ? this.renderTarget.select('.tsi-chartSVG').node().getBoundingClientRect().height : 0;
20
- };
21
- Tooltip.prototype.getLeftOffset = function (chartMargins) {
22
- //NOTE - this assumes that the svg's right border is the same as the render target's
23
- var renderTargetWidth = this.renderTarget.node().getBoundingClientRect().width;
24
- return (renderTargetWidth - this.getSVGWidth() + chartMargins.left);
25
- };
26
- Tooltip.prototype.getTopOffset = function (chartMargins) {
27
- //NOTE - this assumes that the svg's bottom border is the same as the render target's
28
- var renderTargetHeight = this.renderTarget.node().getBoundingClientRect().height;
29
- return (renderTargetHeight - this.getSVGHeight() + chartMargins.top);
30
- };
31
- Tooltip.prototype.isRightOffset = function (tooltipWidth, xPos, chartMarginLeft) {
32
- //NOTE - this assumes that the svg's right border is the same as the render target's
33
- this.renderTarget.node().getBoundingClientRect().width;
34
- return this.getSVGWidth() > (xPos + tooltipWidth + 20 + chartMarginLeft);
35
- };
36
- Tooltip.prototype.isTopOffset = function (tooltipHeight, yPos, chartMargins) {
37
- //NOTE - this assumes that the svg's bottom border is the same as the render target's
38
- var renderTargetHeight = this.renderTarget.node().getBoundingClientRect().height;
39
- var tooltipYPos = yPos + tooltipHeight + 20 + chartMargins.bottom + this.getTopOffset(chartMargins);
40
- return renderTargetHeight > tooltipYPos;
41
- };
42
- Tooltip.prototype.render = function (theme) {
43
- var _this = this;
44
- var self = this;
45
- var tooltip = this.renderTarget.selectAll('.tsi-tooltip').filter(function () {
46
- return (this.parentNode === self.renderTarget.node());
47
- }).data([theme]);
48
- this.tooltipDiv = tooltip.enter().append('div')
49
- .attr('class', 'tsi-tooltip')
50
- .merge(tooltip)
51
- .each(function (d) {
52
- d3.select(this).selectAll("*").remove();
53
- self.tooltipDivInner = d3.select(this).append('div')
54
- .attr('class', 'tsi-tooltipInner');
55
- });
56
- tooltip.exit().remove();
57
- _super.prototype.themify.call(this, this.tooltipDiv, theme);
58
- // Element width is an optional parameter which ensures that the tooltip doesn't interfere with the element
59
- // when positioning to the right
60
- this.draw = function (d, chartComponentData, xPos, yPos, chartMargins, addText, elementWidth, xOffset, yOffset, borderColor, isFromMarker) {
61
- if (elementWidth === void 0) { elementWidth = null; }
62
- if (xOffset === void 0) { xOffset = 20; }
63
- if (yOffset === void 0) { yOffset = 20; }
64
- if (borderColor === void 0) { borderColor = null; }
65
- if (isFromMarker === void 0) { isFromMarker = false; }
66
- _this.tooltipDiv.style("display", "block");
67
- _this.tooltipDivInner.text(null);
68
- _this.borderColor = borderColor;
69
- var leftOffset = isFromMarker ? 0 : _this.getLeftOffset(chartMargins);
70
- var topOffset = _this.getTopOffset(chartMargins);
71
- addText(_this.tooltipDivInner);
72
- _this.tooltipDiv.style("left", Math.round(xPos + leftOffset) + "px")
73
- .style("top", Math.round(yPos) + topOffset + "px");
74
- var tooltipWidth = _this.tooltipDiv.node().getBoundingClientRect().width;
75
- var tooltipHeight = _this.tooltipDiv.node().getBoundingClientRect().height;
76
- var translateX = _this.isRightOffset(tooltipWidth, xPos, chartMargins.left) ? xOffset :
77
- (-Math.round(tooltipWidth) - xOffset - (elementWidth !== null ? elementWidth : 0));
78
- translateX = Math.max(0 - xPos, translateX);
79
- var translateY = 0;
80
- if (_this.isTopOffset(tooltipHeight, yPos, chartMargins)) { // Place tooltip @ bottom of point
81
- translateY = yOffset;
82
- }
83
- else {
84
- if (!isFromMarker && Math.round(yPos) - yOffset + topOffset - Math.round(tooltipHeight) <= 0) { // Upper bound check to keep tooltip within chart
85
- translateY = -(Math.round(yPos) + topOffset);
86
- }
87
- else {
88
- translateY = (-Math.round(tooltipHeight) - yOffset); // Place tooltip @ top of point
89
- }
90
- }
91
- _this.tooltipDiv.style("transform", "translate(" + translateX + "px," + translateY + "px)");
92
- if (_this.borderColor) {
93
- _this.tooltipDivInner.style('border-left-color', _this.borderColor)
94
- .style('border-left-width', '5px');
95
- }
96
- else {
97
- _this.tooltipDivInner.style('border-left-width', '0');
98
- }
99
- };
100
- };
101
- return Tooltip;
102
- }(Component));
103
-
104
- export { Tooltip as T };
@@ -1,36 +0,0 @@
1
- import { C as ChartDataOptions } from './ChartDataOptions-D0BJuRZy.js';
2
- import './Interfaces-R_1l9lIT.js';
3
-
4
- declare class TsqExpression extends ChartDataOptions {
5
- private instanceObject;
6
- private variableObject;
7
- constructor(instanceObject: any, variableObject: any, searchSpan: any, colorOrOptionsObject: any, alias?: string, contextMenu?: Array<any>);
8
- toTsq(roundFromTo?: boolean, getEvents?: boolean, getSeries?: boolean): {
9
- getEvents: {};
10
- getSeries?: undefined;
11
- aggregateSeries?: undefined;
12
- } | {
13
- getSeries: {};
14
- getEvents?: undefined;
15
- aggregateSeries?: undefined;
16
- } | {
17
- aggregateSeries: {};
18
- getEvents?: undefined;
19
- getSeries?: undefined;
20
- };
21
- toStatsTsq(fromMillis: any, toMillis: any): {
22
- getEvents: {};
23
- getSeries?: undefined;
24
- aggregateSeries?: undefined;
25
- } | {
26
- getSeries: {};
27
- getEvents?: undefined;
28
- aggregateSeries?: undefined;
29
- } | {
30
- aggregateSeries: {};
31
- getEvents?: undefined;
32
- getSeries?: undefined;
33
- };
34
- }
35
-
36
- export { TsqExpression as default };
@@ -1,89 +0,0 @@
1
- import { _ as __extends, a as __assign } from './_tslib-BYFmvNeL.js';
2
- import { U as Utils } from './Utils-DDGqSryb.js';
3
- import { C as ChartDataOptions } from './ChartDataOptions-CNTSB636.js';
4
- import 'd3';
5
- import 'moment-timezone';
6
-
7
- var TsqExpression = /** @class */ (function (_super) {
8
- __extends(TsqExpression, _super);
9
- function TsqExpression(instanceObject, variableObject, searchSpan, colorOrOptionsObject, alias, contextMenu) {
10
- var _this = this;
11
- // This constructor should be called with the following parameters:
12
- // new TsqExpression(instanceObject, variableObject, searchSpan, optionsObject)
13
- // where the optionsObject should contain properties for color, alias, and contextMenu.
14
- //
15
- // However, to maintain backwards compatibility with older code, the constructor still
16
- // accepts the older set of parameters:
17
- // new TsqExpression(instanceObject, variableObject, searchSpan, color, alias, contextMenu)
18
- // Here we differentiate between both and call the parent class's constructor as appropriate.
19
- var optionsObject = (typeof (colorOrOptionsObject) === 'object' && !!colorOrOptionsObject)
20
- ? __assign(__assign({}, colorOrOptionsObject), { searchSpan: searchSpan, measureTypes: Object.keys(variableObject) }) : {
21
- color: colorOrOptionsObject,
22
- searchSpan: searchSpan,
23
- measureTypes: Object.keys(variableObject),
24
- alias: alias,
25
- contextMenu: contextMenu
26
- };
27
- _this = _super.call(this, optionsObject) || this;
28
- _this.instanceObject = instanceObject;
29
- _this.variableObject = variableObject;
30
- return _this;
31
- }
32
- TsqExpression.prototype.toTsq = function (roundFromTo, getEvents, getSeries) {
33
- if (roundFromTo === void 0) { roundFromTo = false; }
34
- if (getEvents === void 0) { getEvents = false; }
35
- if (getSeries === void 0) { getSeries = false; }
36
- var tsq = {};
37
- var shiftMillis = Utils.parseShift(this.timeShift, this.startAt, this.searchSpan);
38
- var fromMillis = this.searchSpan.from.valueOf() + shiftMillis;
39
- var toMillis = this.searchSpan.to.valueOf() + shiftMillis;
40
- if (roundFromTo) {
41
- var bucketSizeInMillis = Utils.parseTimeInput(this.searchSpan.bucketSize);
42
- var roundedFromMillis = Math.floor((fromMillis + 62135596800000) / (bucketSizeInMillis)) * (bucketSizeInMillis) - 62135596800000;
43
- var roundedToMillis = Math.ceil((toMillis + 62135596800000) / (bucketSizeInMillis)) * (bucketSizeInMillis) - 62135596800000;
44
- fromMillis = roundedFromMillis;
45
- toMillis = roundedToMillis;
46
- }
47
- tsq['searchSpan'] = { from: (new Date(fromMillis)).toISOString(), to: (new Date(toMillis)).toISOString() };
48
- tsq['timeSeriesId'] = this.instanceObject.timeSeriesId;
49
- if (getEvents) {
50
- return { getEvents: tsq };
51
- }
52
- else if (getSeries) {
53
- tsq['inlineVariables'] = __assign({}, this.variableObject);
54
- tsq['projectedVariables'] = Object.keys(this.variableObject);
55
- return { getSeries: tsq };
56
- }
57
- else {
58
- tsq['interval'] = Utils.bucketSizeToTsqInterval(this.searchSpan.bucketSize);
59
- tsq['inlineVariables'] = __assign({}, this.variableObject);
60
- tsq['projectedVariables'] = Object.keys(this.variableObject);
61
- return { aggregateSeries: tsq };
62
- }
63
- };
64
- // This method will create an API query payload for the variable statistics of the first inline variable
65
- // of this object, for numeric dataTypes. Categorical types work as expected.
66
- TsqExpression.prototype.toStatsTsq = function (fromMillis, toMillis) {
67
- var tsq = this.toTsq();
68
- var shiftMillis = Utils.parseShift(this.timeShift);
69
- fromMillis += shiftMillis;
70
- toMillis += shiftMillis;
71
- tsq.aggregateSeries['searchSpan'] = { from: (new Date(fromMillis)).toISOString(), to: (new Date(toMillis)).toISOString() };
72
- tsq.aggregateSeries['interval'] = 'P1000Y';
73
- if (this.dataType === 'numeric') {
74
- var inlineVariables_1 = { min: {}, max: {}, avg: {}, stDev: {} };
75
- var firstVariable_1 = tsq.aggregateSeries['inlineVariables'][Object.keys(tsq.aggregateSeries['inlineVariables'])[0]];
76
- Object.keys(inlineVariables_1).forEach(function (k) {
77
- inlineVariables_1[k] = JSON.parse(JSON.stringify(firstVariable_1));
78
- inlineVariables_1[k].aggregation.tsx = "".concat(k, "($value)");
79
- delete inlineVariables_1[k]['interpolation'];
80
- });
81
- tsq.aggregateSeries['inlineVariables'] = inlineVariables_1;
82
- tsq.aggregateSeries['projectedVariables'] = Object.keys(inlineVariables_1);
83
- }
84
- return tsq;
85
- };
86
- return TsqExpression;
87
- }(ChartDataOptions));
88
-
89
- export { TsqExpression as default };