tsichart-core 1.0.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 (126) hide show
  1. package/LICENSE +22 -0
  2. package/README.MD +189 -0
  3. package/dist/AggregateExpression.d.ts +13 -0
  4. package/dist/AggregateExpression.js +70 -0
  5. package/dist/AvailabilityChart-i_efwXCX.js +488 -0
  6. package/dist/AvailabilityChart.d.ts +59 -0
  7. package/dist/AvailabilityChart.js +26 -0
  8. package/dist/ChartComponent-DTcc6aED.d.ts +80 -0
  9. package/dist/ChartComponent-DnKLTxWe.js +302 -0
  10. package/dist/ChartComponentData-D5wuQmmZ.d.ts +47 -0
  11. package/dist/ChartDataOptions-DBS28b1-.d.ts +38 -0
  12. package/dist/ChartDataOptions-DRd8NHra.js +49 -0
  13. package/dist/ChartVisualizationComponent-CG7e5xlc.js +23 -0
  14. package/dist/ChartVisualizationComponent-DBjiqR1n.d.ts +8 -0
  15. package/dist/ColorPicker-CH__K8xm.js +120 -0
  16. package/dist/ColorPicker.d.ts +28 -0
  17. package/dist/ColorPicker.js +6 -0
  18. package/dist/Component-CofgyEw0.js +401 -0
  19. package/dist/Component-Rp30sSAW.d.ts +226 -0
  20. package/dist/ContextMenu-DABSkTA2.js +197 -0
  21. package/dist/DateTimeButton-CMcCxc8x.d.ts +16 -0
  22. package/dist/DateTimeButton-Ca1487GR.js +38 -0
  23. package/dist/DateTimeButtonRange-DpgfhHQt.js +71 -0
  24. package/dist/DateTimeButtonRange.d.ts +19 -0
  25. package/dist/DateTimeButtonRange.js +15 -0
  26. package/dist/DateTimeButtonSingle-C6cTx5VO.js +48 -0
  27. package/dist/DateTimeButtonSingle.d.ts +17 -0
  28. package/dist/DateTimeButtonSingle.js +14 -0
  29. package/dist/DateTimePicker-BH6qiVfQ.js +532 -0
  30. package/dist/DateTimePicker.d.ts +69 -0
  31. package/dist/DateTimePicker.js +13 -0
  32. package/dist/EllipsisMenu-30FNqoIv.js +116 -0
  33. package/dist/EllipsisMenu.d.ts +20 -0
  34. package/dist/EllipsisMenu.js +6 -0
  35. package/dist/Enums-ChUuTtHV.d.ts +12 -0
  36. package/dist/EventsTable-a0XLbsMF.js +553 -0
  37. package/dist/EventsTable.d.ts +34 -0
  38. package/dist/EventsTable.js +10 -0
  39. package/dist/GeoProcessGraphic-AVAzyF7k.js +145 -0
  40. package/dist/GeoProcessGraphic.d.ts +34 -0
  41. package/dist/GeoProcessGraphic.js +7 -0
  42. package/dist/Grid-DfFAkeeV.js +874 -0
  43. package/dist/Grid.d.ts +43 -0
  44. package/dist/Grid.js +6 -0
  45. package/dist/GroupedBarChart-BspwM8r2.js +579 -0
  46. package/dist/GroupedBarChart.d.ts +22 -0
  47. package/dist/GroupedBarChart.js +17 -0
  48. package/dist/GroupedBarChartData-BRCyDxbA.js +121 -0
  49. package/dist/GroupedBarChartData-C0YQydrP.d.ts +20 -0
  50. package/dist/Heatmap-D8ET8Ue8.js +524 -0
  51. package/dist/Heatmap.d.ts +31 -0
  52. package/dist/Heatmap.js +14 -0
  53. package/dist/Hierarchy-QkWLHkxo.js +260 -0
  54. package/dist/Hierarchy.d.ts +39 -0
  55. package/dist/Hierarchy.js +6 -0
  56. package/dist/HierarchyNavigation-CR6YUilh.js +336 -0
  57. package/dist/HierarchyNavigation.d.ts +34 -0
  58. package/dist/HierarchyNavigation.js +6 -0
  59. package/dist/HistoryPlayback-BmA-54lT.d.ts +68 -0
  60. package/dist/HistoryPlayback-SjeQbAPq.js +175 -0
  61. package/dist/Interfaces-BKRQ685G.d.ts +6 -0
  62. package/dist/Legend-DlSXQXHF.js +497 -0
  63. package/dist/LineChart-CExEyjZa.js +3181 -0
  64. package/dist/LineChart.d.ts +163 -0
  65. package/dist/LineChart.js +18 -0
  66. package/dist/ModelAutocomplete-TRD16egq.js +100 -0
  67. package/dist/ModelAutocomplete.d.ts +12 -0
  68. package/dist/ModelAutocomplete.js +7 -0
  69. package/dist/ModelSearch-WEa7Ud20.js +189 -0
  70. package/dist/ModelSearch.d.ts +23 -0
  71. package/dist/ModelSearch.js +9 -0
  72. package/dist/PieChart-B1ZXk13Q.js +258 -0
  73. package/dist/PieChart.d.ts +26 -0
  74. package/dist/PieChart.js +17 -0
  75. package/dist/PlaybackControls-Dwt6dif9.js +195 -0
  76. package/dist/PlaybackControls.d.ts +39 -0
  77. package/dist/PlaybackControls.js +13 -0
  78. package/dist/ProcessGraphic-CixT-zZl.js +154 -0
  79. package/dist/ProcessGraphic.d.ts +31 -0
  80. package/dist/ProcessGraphic.js +7 -0
  81. package/dist/README.MD +189 -0
  82. package/dist/ScatterPlot-DrPoHNDJ.js +924 -0
  83. package/dist/ScatterPlot.d.ts +115 -0
  84. package/dist/ScatterPlot.js +17 -0
  85. package/dist/SingleDateTimePicker-7anflEq8.js +213 -0
  86. package/dist/SingleDateTimePicker.d.ts +45 -0
  87. package/dist/SingleDateTimePicker.js +12 -0
  88. package/dist/Slider-BtSdC4fj.js +186 -0
  89. package/dist/Slider.d.ts +31 -0
  90. package/dist/Slider.js +6 -0
  91. package/dist/TemporalXAxisComponent-CyiM5EH0.d.ts +23 -0
  92. package/dist/TemporalXAxisComponent-DkyVvASs.js +129 -0
  93. package/dist/TimezonePicker-ClfP1lBL.js +58 -0
  94. package/dist/TimezonePicker.d.ts +16 -0
  95. package/dist/TimezonePicker.js +10 -0
  96. package/dist/Tooltip-Fa-0Xekn.js +104 -0
  97. package/dist/TsqExpression.d.ts +36 -0
  98. package/dist/TsqExpression.js +89 -0
  99. package/dist/UXClient-DydSPZwM.js +230 -0
  100. package/dist/UXClient.d.ts +74 -0
  101. package/dist/UXClient.js +47 -0
  102. package/dist/Utils-BsPLzJBC.d.ts +104 -0
  103. package/dist/Utils-C_j8IgZh.js +1138 -0
  104. package/dist/Utils.d.ts +7 -0
  105. package/dist/Utils.js +7 -0
  106. package/dist/_tslib-5_9pMg1F.js +96 -0
  107. package/dist/package.json +106 -0
  108. package/dist/pikaday-DMSzaLH6.js +1252 -0
  109. package/dist/tsiclient.cjs.js +3 -0
  110. package/dist/tsiclient.cjs.js.LICENSE.txt +19 -0
  111. package/dist/tsiclient.cjs.js.map +1 -0
  112. package/dist/tsiclient.css +17323 -0
  113. package/dist/tsiclient.d.ts +46 -0
  114. package/dist/tsiclient.esm.js +3 -0
  115. package/dist/tsiclient.esm.js.LICENSE.txt +19 -0
  116. package/dist/tsiclient.esm.js.map +1 -0
  117. package/dist/tsiclient.js +58 -0
  118. package/dist/tsiclient.min.css +6 -0
  119. package/dist/tsiclient.min.css.map +1 -0
  120. package/dist/tsiclient.umd.js +3 -0
  121. package/dist/tsiclient.umd.js.LICENSE.txt +19 -0
  122. package/dist/tsiclient.umd.js.map +1 -0
  123. package/dist/tsiclient.umd.min.js +3 -0
  124. package/dist/tsiclient.umd.min.js.LICENSE.txt +19 -0
  125. package/dist/tsiclient.umd.min.js.map +1 -0
  126. package/package.json +106 -0
@@ -0,0 +1,302 @@
1
+ import { _ as __extends, d as __spreadArray } from './_tslib-5_9pMg1F.js';
2
+ import { U as Utils, G as GRIDCONTAINERCLASS, T as TooltipMeasureFormat, D as DataTypes, S as ShiftTypes } from './Utils-C_j8IgZh.js';
3
+ import { C as Component } from './Component-CofgyEw0.js';
4
+ import { C as ChartComponentData, G as Grid } from './Grid-DfFAkeeV.js';
5
+ import * as d3 from 'd3';
6
+ import Split from 'split.js';
7
+ import { E as EllipsisMenu } from './EllipsisMenu-30FNqoIv.js';
8
+
9
+ var ChartComponent = /** @class */ (function (_super) {
10
+ __extends(ChartComponent, _super);
11
+ function ChartComponent(renderTarget) {
12
+ var _this = _super.call(this, renderTarget) || this;
13
+ _this.MINWIDTH = 350;
14
+ _this.MINHEIGHT = 150;
15
+ _this.CONTROLSWIDTH = 200;
16
+ _this.GUTTERWIDTH = 6;
17
+ _this.chartControlsPanel = null;
18
+ _this.ellipsisContainer = null;
19
+ _this.ellipsisMenu = null;
20
+ _this.svgSelection = null;
21
+ _this.legendWidth = _this.CONTROLSWIDTH;
22
+ _this.downloadAsCSV = function (isScatterPlot) {
23
+ if (isScatterPlot === void 0) { isScatterPlot = false; }
24
+ Utils.downloadCSV(_this.chartComponentData.generateCSVString(_this.chartOptions.offset, _this.chartOptions.dateLocale, isScatterPlot ? _this.chartOptions.spMeasures : null));
25
+ };
26
+ _this.chartComponentData = new ChartComponentData();
27
+ return _this;
28
+ }
29
+ ChartComponent.prototype.showGrid = function () {
30
+ Grid.showGrid(this.renderTarget, this.chartOptions, this.aggregateExpressionOptions, this.chartComponentData);
31
+ };
32
+ ChartComponent.prototype.gatedShowGrid = function () {
33
+ if (this.isGridVisible()) {
34
+ this.showGrid();
35
+ }
36
+ };
37
+ ChartComponent.prototype.hideGrid = function () {
38
+ Grid.hideGrid(this.renderTarget);
39
+ };
40
+ ChartComponent.prototype.isGridVisible = function () {
41
+ return !d3.select(this.renderTarget).selectAll(".".concat(GRIDCONTAINERCLASS)).empty();
42
+ };
43
+ ChartComponent.prototype.drawEllipsisMenu = function (additionalEllipsisItems) {
44
+ var _this = this;
45
+ if (additionalEllipsisItems === void 0) { additionalEllipsisItems = []; }
46
+ if (this.chartOptions.canDownload || this.chartOptions.grid || (this.chartOptions.ellipsisItems && this.chartOptions.ellipsisItems.length > 0) || additionalEllipsisItems.length > 0) {
47
+ if (this.ellipsisContainer === null) {
48
+ this.ellipsisContainer = this.chartControlsPanel.append("div")
49
+ .attr("class", "tsi-ellipsisContainerDiv");
50
+ }
51
+ if (this.ellipsisMenu === null) {
52
+ this.ellipsisMenu = new EllipsisMenu(this.ellipsisContainer.node());
53
+ }
54
+ var ellipsisItems = [];
55
+ if (this.chartOptions.grid) {
56
+ ellipsisItems.push(Grid.createGridEllipsisOption(this.renderTarget, this.chartOptions, this.aggregateExpressionOptions, this.chartComponentData, this.getString("Display Grid")));
57
+ }
58
+ if (this.chartOptions.canDownload) {
59
+ ellipsisItems.push(Utils.createDownloadEllipsisOption(function () { return _this.chartComponentData.generateCSVString(_this.chartOptions.offset, _this.chartOptions.dateLocale); }, function () { return Utils.focusOnEllipsisButton(_this.renderTarget); }, this.getString("Download as CSV")));
60
+ }
61
+ if (this.chartOptions.ellipsisItems) {
62
+ ellipsisItems = ellipsisItems.concat(this.chartOptions.ellipsisItems);
63
+ }
64
+ this.ellipsisMenu.render(ellipsisItems.concat(additionalEllipsisItems), { theme: this.chartOptions.theme });
65
+ }
66
+ };
67
+ ChartComponent.prototype.removeControlPanel = function () {
68
+ if (this.chartControlsPanel) {
69
+ this.chartControlsPanel.remove();
70
+ }
71
+ this.chartControlsPanel = null;
72
+ this.ellipsisContainer = null;
73
+ this.ellipsisMenu = null;
74
+ };
75
+ ChartComponent.prototype.removeEllipsisMenu = function () {
76
+ if (this.ellipsisContainer) {
77
+ this.ellipsisContainer.remove();
78
+ }
79
+ this.ellipsisContainer = null;
80
+ this.ellipsisMenu = null;
81
+ };
82
+ ChartComponent.prototype.getWidth = function () {
83
+ return Math.max(d3.select(this.renderTarget).node().clientWidth, this.MINWIDTH);
84
+ };
85
+ ChartComponent.prototype.getVisibilityState = function () {
86
+ return this.chartComponentData.getVisibilityState();
87
+ };
88
+ ChartComponent.prototype.ellipsisItemsExist = function () {
89
+ return (this.chartOptions.canDownload || this.chartOptions.ellipsisItems.length > 0 || this.chartOptions.grid);
90
+ };
91
+ ChartComponent.prototype.getDataType = function (aggKey) {
92
+ return this.chartComponentData.getDataType(aggKey);
93
+ };
94
+ ChartComponent.prototype.getCDOFromAggKey = function (aggKey) {
95
+ var matches = this.aggregateExpressionOptions.filter(function (cDO) {
96
+ return cDO.aggKey === aggKey;
97
+ });
98
+ if (matches.length === 1) {
99
+ return matches[0];
100
+ }
101
+ return {};
102
+ };
103
+ ChartComponent.prototype.getFilteredMeasures = function (measureList, visibleMeasure, measureFormat, xyrMeasures) {
104
+ if (xyrMeasures === void 0) { xyrMeasures = null; }
105
+ var justVisibleMeasure = [visibleMeasure];
106
+ switch (measureFormat) {
107
+ case TooltipMeasureFormat.SingleValue:
108
+ return justVisibleMeasure;
109
+ case TooltipMeasureFormat.Scatter:
110
+ return xyrMeasures;
111
+ default:
112
+ if (measureList.length !== 3) {
113
+ return justVisibleMeasure;
114
+ }
115
+ var isAvgMinMax_1 = true;
116
+ measureList.forEach(function (measure) {
117
+ if (!(measure === 'avg' || measure === 'min' || measure === 'max')) {
118
+ isAvgMinMax_1 = false;
119
+ }
120
+ });
121
+ return isAvgMinMax_1 ? measureList.sort(function (m) { return m === 'min' ? -1 : (m === 'avg' ? 0 : 1); }) : justVisibleMeasure;
122
+ }
123
+ };
124
+ // to get alignment for data points between other types and linechart for tooltip formatting
125
+ ChartComponent.prototype.convertToTimeValueFormat = function (d) {
126
+ var measuresObject = {};
127
+ var measureType = d.measureType ? d.measureType : this.chartComponentData.displayState[d.aggKey].splitBys[d.splitBy].visibleType;
128
+ measuresObject[measureType] = d.val;
129
+ return {
130
+ aggregateKey: d.aggKey,
131
+ splitBy: d.splitBy,
132
+ aggregateName: this.chartComponentData.displayState[d.aggKey].name,
133
+ measures: measuresObject
134
+ };
135
+ };
136
+ ChartComponent.prototype.formatDate = function (date, shiftMillis) {
137
+ return Utils.timeFormat(this.chartComponentData.usesSeconds, this.chartComponentData.usesMillis, this.chartOptions.offset, this.chartOptions.is24HourTime, shiftMillis, null, this.chartOptions.dateLocale)(date);
138
+ };
139
+ ChartComponent.prototype.tooltipFormat = function (d, text, measureFormat, xyrMeasures) {
140
+ var _this = this;
141
+ if (xyrMeasures === void 0) { xyrMeasures = null; }
142
+ var dataType = this.getDataType(d.aggregateKey);
143
+ d.aggregateName;
144
+ var cDO = this.getCDOFromAggKey(d.aggregateKey);
145
+ var shiftMillis = this.chartComponentData.getTemporalShiftMillis(d.aggregateKey);
146
+ var formatDate = function (date) { return _this.formatDate(date, shiftMillis); };
147
+ var titleGroup = text.append("div")
148
+ .attr("class", "tsi-tooltipTitleGroup");
149
+ this.createTooltipSeriesInfo(d, titleGroup, cDO);
150
+ if (dataType === DataTypes.Categorical) {
151
+ titleGroup.append('h4')
152
+ .attr('class', 'tsi-tooltipSubtitle tsi-tooltipTimeStamp')
153
+ .text(formatDate(d.dateTime) + ' - ' + formatDate(d.endDate));
154
+ }
155
+ if (dataType === DataTypes.Events) {
156
+ titleGroup.append('h4')
157
+ .attr('class', 'tsi-tooltipSubtitle tsi-tooltipTimeStamp')
158
+ .text(formatDate(d.dateTime));
159
+ }
160
+ var tooltipAttrs = cDO.tooltipAttributes;
161
+ if (shiftMillis !== 0 && tooltipAttrs) {
162
+ var shiftTuple = this.chartComponentData.getTemporalShiftStringTuple(d.aggregateKey);
163
+ if (shiftTuple !== null) {
164
+ var keyString = this.getString(shiftTuple[0]);
165
+ var valueString = (keyString === ShiftTypes.startAt) ? this.formatDate(new Date(shiftTuple[1]), 0) : shiftTuple[1];
166
+ tooltipAttrs = __spreadArray(__spreadArray([], tooltipAttrs, true), [[keyString, valueString]], false);
167
+ }
168
+ }
169
+ if (tooltipAttrs && tooltipAttrs.length > 0) {
170
+ var attrsGroup_1 = text.append('div')
171
+ .attr('class', 'tsi-tooltipAttributeContainer tsi-tooltipFlexyBox');
172
+ tooltipAttrs.forEach(function (attrTuple, i) {
173
+ var timeShiftRow = attrsGroup_1.append('div')
174
+ .attr('class', 'tsi-tooltipAttribute tsi-tooltipFlexyItem');
175
+ timeShiftRow.append('div')
176
+ .attr('class', 'tsi-tooltipAttrTitle')
177
+ .text(attrTuple[0]);
178
+ timeShiftRow.append('div')
179
+ .attr('class', 'tsi-tooltipAttrValue')
180
+ .text(attrTuple[1]);
181
+ });
182
+ }
183
+ if (d.measures && Object.keys(d.measures).length) {
184
+ var formatValue_1 = (dataType === DataTypes.Events ? function (d) { return d; } : Utils.formatYAxisNumber);
185
+ if (dataType !== DataTypes.Numeric) {
186
+ var valueGroup_1 = text.append('table')
187
+ .attr('class', 'tsi-tooltipValues tsi-tooltipTable');
188
+ Object.keys(d.measures).forEach(function (measureType, i) {
189
+ if (!(dataType === DataTypes.Categorical) || d.measures[measureType] !== 0) {
190
+ valueGroup_1.append('tr').classed('tsi-tableSpacer', true);
191
+ var tr = valueGroup_1.append('tr')
192
+ .classed('tsi-visibleValue', (dataType === DataTypes.Numeric && (measureType === _this.chartComponentData.getVisibleMeasure(d.aggregateKey, d.splitBy))))
193
+ .style('border-left-color', Utils.getColorForValue(cDO, measureType));
194
+ tr.append('td')
195
+ .attr('class', 'tsi-valueLabel')
196
+ .text(measureType);
197
+ tr.append('td')
198
+ .attr('class', 'tsi-valueCell')
199
+ .text(formatValue_1(d.measures[measureType]));
200
+ }
201
+ });
202
+ }
203
+ else {
204
+ var valueGroup_2 = text.append('div')
205
+ .attr('class', 'tsi-tooltipFlexyBox');
206
+ var filteredMeasures = this.getFilteredMeasures(Object.keys(d.measures), this.chartComponentData.getVisibleMeasure(d.aggregateKey, d.splitBy), measureFormat, xyrMeasures);
207
+ filteredMeasures.forEach(function (measureType, i) {
208
+ var valueItem = valueGroup_2.append('div')
209
+ .attr('class', 'tsi-tooltipFlexyItem')
210
+ .classed('tsi-visibleValue', (dataType === DataTypes.Numeric &&
211
+ (measureType === _this.chartComponentData.getVisibleMeasure(d.aggregateKey, d.splitBy)) &&
212
+ (measureFormat !== TooltipMeasureFormat.Scatter)));
213
+ var measureTitle = valueItem.append('div')
214
+ .attr('class', 'tsi-tooltipMeasureTitle');
215
+ Utils.appendFormattedElementsFromString(measureTitle, measureType);
216
+ valueItem.append('div')
217
+ .attr('class', 'tsi-tooltipMeasureValue')
218
+ .text(formatValue_1(d.measures[measureType]));
219
+ });
220
+ }
221
+ }
222
+ };
223
+ ChartComponent.prototype.getSVGWidth = function () {
224
+ return this.chartWidth + this.chartMargins.left + this.chartMargins.right;
225
+ };
226
+ ChartComponent.prototype.getChartWidth = function (legendWidth) {
227
+ if (legendWidth === void 0) { legendWidth = this.CONTROLSWIDTH; }
228
+ legendWidth = this.legendWidth; // + this.GUTTERWIDTH;
229
+ return Math.max(1, this.width - this.chartMargins.left - this.chartMargins.right - (this.chartOptions.legend === "shown" ? legendWidth : 0));
230
+ };
231
+ ChartComponent.prototype.calcSVGWidth = function () {
232
+ return this.svgSelection.node().getBoundingClientRect().width;
233
+ };
234
+ ChartComponent.prototype.setControlsPanelWidth = function () {
235
+ if (!this.chartOptions.hideChartControlPanel && this.chartControlsPanel !== null) {
236
+ //either calculate expected or just use svg if it's in the DOM
237
+ var controlPanelWidth = this.svgSelection && this.svgSelection.node() ?
238
+ this.calcSVGWidth() :
239
+ this.getWidth() - (this.chartOptions.legend === 'shown' ? (this.legendWidth + this.GUTTERWIDTH) : 0);
240
+ this.chartControlsPanel.style("width", controlPanelWidth + "px");
241
+ }
242
+ };
243
+ ChartComponent.prototype.legendPostRenderProcess = function (legendState, chartElement, shouldSetControlsWidth, splitLegendOnDrag) {
244
+ if (splitLegendOnDrag === void 0) { splitLegendOnDrag = undefined; }
245
+ if (legendState === 'shown') {
246
+ this.splitLegendAndSVG(chartElement.node(), splitLegendOnDrag);
247
+ if (shouldSetControlsWidth) {
248
+ this.setControlsPanelWidth();
249
+ }
250
+ }
251
+ else {
252
+ d3.select(this.renderTarget).select('.tsi-resizeGutter').remove();
253
+ }
254
+ };
255
+ ChartComponent.prototype.splitLegendAndSVG = function (chartElement, onDrag) {
256
+ var _this = this;
257
+ if (onDrag === void 0) { onDrag = function () { }; }
258
+ var svgWidth = this.getSVGWidth();
259
+ var legendWidth = this.width - svgWidth;
260
+ d3.select(this.renderTarget).select('.tsi-resizeGutter').remove();
261
+ var legend = this.legendObject.legendElement;
262
+ Split([this.legendObject.legendElement.node(), chartElement], {
263
+ sizes: [legendWidth / this.width * 100, svgWidth / this.width * 100],
264
+ gutterSize: 2,
265
+ minSize: [200, 0],
266
+ snapOffset: 0,
267
+ cursor: 'e-resize',
268
+ onDragEnd: function (sizes) {
269
+ var legendWidth = _this.width * (sizes[0] / 100);
270
+ _this.legendWidth = legendWidth;
271
+ _this.chartWidth = _this.getChartWidth();
272
+ _this.draw(true);
273
+ legend.style('width', _this.legendWidth + 'px');
274
+ d3.select(_this.renderTarget).select('.tsi-resizeGutter')
275
+ .classed('tsi-isDragging', false);
276
+ },
277
+ onDragStart: function () {
278
+ d3.select(_this.renderTarget).select('.tsi-resizeGutter')
279
+ .classed('tsi-isDragging', true);
280
+ },
281
+ onDrag: function () {
282
+ if (!_this.chartOptions.hideChartControlPanel && _this.chartControlsPanel !== null) {
283
+ var svgLeftOffset = _this.calcSVGWidth();
284
+ _this.chartControlsPanel.style("width", Math.max(svgLeftOffset, _this.chartMargins.left + 8) + "px"); //8px to account for the width of the icon
285
+ }
286
+ onDrag();
287
+ },
288
+ gutter: function (index, direction) {
289
+ var gutter = document.createElement('div');
290
+ gutter.className = "gutter tsi-resizeGutter";
291
+ return gutter;
292
+ },
293
+ direction: 'horizontal'
294
+ });
295
+ // explicitly set the width of the legend to a pixel value
296
+ var calcedLegendWidth = legend.node().getBoundingClientRect().width;
297
+ legend.style("width", calcedLegendWidth + "px");
298
+ };
299
+ return ChartComponent;
300
+ }(Component));
301
+
302
+ export { ChartComponent as C };
@@ -0,0 +1,47 @@
1
+ declare class ChartComponentData {
2
+ data: any;
3
+ displayState: any;
4
+ timeArrays: any;
5
+ visibleTSCount: number;
6
+ visibleTAs: any;
7
+ allValues: any;
8
+ allNumericValues: any;
9
+ filteredAggregates: any;
10
+ usesSeconds: boolean;
11
+ usesMillis: boolean;
12
+ fromMillis: number;
13
+ toMillis: number;
14
+ stickiedKey: any;
15
+ allTimestampsArray: any;
16
+ isFromHeatmap: boolean;
17
+ constructor();
18
+ protected getSwimlane: (aggKey: any) => any;
19
+ protected setAllTimestampsArray(): void;
20
+ getDataType(aggKey: any): any;
21
+ private fillColors;
22
+ private getVisibleType;
23
+ mergeDataToDisplayStateAndTimeArrays(data: any, aggregateExpressionOptions?: any): void;
24
+ private determineMeasureTypes;
25
+ getTemporalShiftStringTuple(aggKey: any): any[];
26
+ getTemporalShiftMillis(aggKey: any): number;
27
+ doesTimeArrayUseSeconds(timeArray: any): any;
28
+ doesTimeArrayUseMillis(timeArray: any): any;
29
+ setAllValuesAndVisibleTAs(): Date[];
30
+ findLastTimestampWithValue(aggKey: any, splitBy: any): any;
31
+ private findFirstBucket;
32
+ private getNumberOfPaddedBuckets;
33
+ convertAggregateToArray(agg: any, aggKey: string, aggName: string, splitBy: string, from: Date, to: Date, bucketSize: number, shiftValue: number): Array<any>;
34
+ isSplitByVisible(aggI: string, splitBy: string): any;
35
+ isPossibleEnvelope(aggKey: string, splitBy: string): boolean;
36
+ getVisibleMeasure(aggI: string, splitBy: string): any;
37
+ getAggVisible(aggKey: any): boolean;
38
+ getSplitByVisible(aggKey: any, splitBy: any): any;
39
+ aggHasVisibleSplitBys(aggKey: any): boolean;
40
+ valueAtTS(aggKey: any, splitByName: any, ts: any): any;
41
+ setFilteredAggregates(): void;
42
+ private guessValueType;
43
+ generateCSVString(offset?: number, dateLocale?: string, spMeasures?: any): string;
44
+ getVisibilityState(): any[];
45
+ }
46
+
47
+ export { ChartComponentData as C };
@@ -0,0 +1,38 @@
1
+ import { H as HorizontalMarker } from './Interfaces-BKRQ685G.js';
2
+
3
+ declare class ChartDataOptions {
4
+ searchSpan: any;
5
+ color: string | Function;
6
+ alias: string;
7
+ contextMenu: any;
8
+ measureTypes: Array<string>;
9
+ interpolationFunction: string;
10
+ yExtent: any;
11
+ includeEnvelope: boolean;
12
+ includeDots: boolean;
13
+ visibilityState: Array<any>;
14
+ timeShift: string;
15
+ startAt: string;
16
+ dataType: string;
17
+ valueMapping: any;
18
+ height: number;
19
+ onElementClick: any;
20
+ eventElementType: any;
21
+ rollupCategoricalValues: boolean;
22
+ tooltipAttributes: Array<any>;
23
+ positionX: number;
24
+ positionY: number;
25
+ swimLane: number;
26
+ variableAlias: any;
27
+ connectPoints: boolean;
28
+ pointConnectionMeasure: string;
29
+ positionXVariableName: string;
30
+ positionYVariableName: string;
31
+ image: string;
32
+ isRawData: boolean;
33
+ isVariableAliasShownOnTooltip: boolean;
34
+ horizontalMarkers: Array<HorizontalMarker>;
35
+ constructor(optionsObject: Object);
36
+ }
37
+
38
+ export { ChartDataOptions as C };
@@ -0,0 +1,49 @@
1
+ import { I as InterpolationFunctions, U as Utils, D as DataTypes, E as EventElementTypes } from './Utils-C_j8IgZh.js';
2
+
3
+ var DEFAULT_HEIGHT = 40;
4
+ // Represents an expression that is suitable for use as the expression options parameter in a chart component
5
+ var ChartDataOptions = /** @class */ (function () {
6
+ function ChartDataOptions(optionsObject) {
7
+ this.interpolationFunction = InterpolationFunctions.None;
8
+ this.yExtent = null;
9
+ this.includeEnvelope = false;
10
+ this.includeDots = false;
11
+ this.visibilityState = null;
12
+ this.connectPoints = false;
13
+ this.pointConnectionMeasure = '';
14
+ this.searchSpan = Utils.getValueOrDefault(optionsObject, 'searchSpan');
15
+ this.measureTypes = Utils.getValueOrDefault(optionsObject, 'measureTypes');
16
+ this.color = Utils.getValueOrDefault(optionsObject, 'color');
17
+ this.alias = Utils.getValueOrDefault(optionsObject, 'alias');
18
+ this.contextMenu = Utils.getValueOrDefault(optionsObject, 'contextMenu', []);
19
+ this.interpolationFunction = Utils.getValueOrDefault(optionsObject, 'interpolationFunction', InterpolationFunctions.None);
20
+ this.includeEnvelope = Utils.getValueOrDefault(optionsObject, 'includeEnvelope', false);
21
+ this.includeDots = Utils.getValueOrDefault(optionsObject, 'includeDots', false);
22
+ this.visibilityState = Utils.getValueOrDefault(optionsObject, 'visibilityState');
23
+ this.yExtent = Utils.getValueOrDefault(optionsObject, 'yExtent');
24
+ this.timeShift = Utils.getValueOrDefault(optionsObject, 'timeShift', '');
25
+ this.dataType = Utils.getValueOrDefault(optionsObject, 'dataType', DataTypes.Numeric);
26
+ this.valueMapping = Utils.getValueOrDefault(optionsObject, 'valueMapping', {});
27
+ this.height = Utils.getValueOrDefault(optionsObject, 'height', DEFAULT_HEIGHT);
28
+ this.onElementClick = Utils.getValueOrDefault(optionsObject, 'onElementClick', null);
29
+ this.eventElementType = Utils.getValueOrDefault(optionsObject, 'eventElementType', EventElementTypes.Diamond);
30
+ this.rollupCategoricalValues = Utils.getValueOrDefault(optionsObject, 'rollupCategoricalValues', false);
31
+ this.tooltipAttributes = Utils.getValueOrDefault(optionsObject, 'tooltipAttributes', []);
32
+ this.positionX = Utils.getValueOrDefault(optionsObject, 'positionX', 0);
33
+ this.positionY = Utils.getValueOrDefault(optionsObject, 'positionY', 0);
34
+ this.swimLane = Utils.getValueOrDefault(optionsObject, 'swimLane', null);
35
+ this.variableAlias = Utils.getValueOrDefault(optionsObject, 'variableAlias', null);
36
+ this.connectPoints = Utils.getValueOrDefault(optionsObject, "connectPoints", false);
37
+ this.pointConnectionMeasure = Utils.getValueOrDefault(optionsObject, 'pointConnectionMeasure', '');
38
+ this.positionXVariableName = Utils.getValueOrDefault(optionsObject, 'positionXVariableName', null);
39
+ this.positionYVariableName = Utils.getValueOrDefault(optionsObject, 'positionYVariableName', null);
40
+ this.image = Utils.getValueOrDefault(optionsObject, 'image', null);
41
+ this.startAt = Utils.getValueOrDefault(optionsObject, 'startAt', null);
42
+ this.isRawData = Utils.getValueOrDefault(optionsObject, 'isRawData', false);
43
+ this.isVariableAliasShownOnTooltip = Utils.getValueOrDefault(optionsObject, 'isVariableAliasShownOnTooltip', true);
44
+ this.horizontalMarkers = Utils.getValueOrDefault(optionsObject, 'horizontalMarkers', []);
45
+ }
46
+ return ChartDataOptions;
47
+ }());
48
+
49
+ export { ChartDataOptions as C };
@@ -0,0 +1,23 @@
1
+ import { _ as __extends } from './_tslib-5_9pMg1F.js';
2
+ import { U as Utils } from './Utils-C_j8IgZh.js';
3
+ import { C as ChartComponent } from './ChartComponent-DnKLTxWe.js';
4
+ import { C as ChartDataOptions } from './ChartDataOptions-DRd8NHra.js';
5
+
6
+ var ChartVisualizationComponent = /** @class */ (function (_super) {
7
+ __extends(ChartVisualizationComponent, _super);
8
+ function ChartVisualizationComponent(renderTarget) {
9
+ return _super.call(this, renderTarget) || this;
10
+ }
11
+ ChartVisualizationComponent.prototype.render = function (data, options, aggregateExpressionOptions) {
12
+ this.data = Utils.standardizeTSStrings(data);
13
+ this.chartOptions.setOptions(options);
14
+ this.aggregateExpressionOptions = data.map(function (d, i) {
15
+ return Object.assign(d, aggregateExpressionOptions && i in aggregateExpressionOptions ?
16
+ new ChartDataOptions(aggregateExpressionOptions[i]) :
17
+ new ChartDataOptions({}));
18
+ });
19
+ };
20
+ return ChartVisualizationComponent;
21
+ }(ChartComponent));
22
+
23
+ export { ChartVisualizationComponent as C };
@@ -0,0 +1,8 @@
1
+ import { C as ChartComponent } from './ChartComponent-DTcc6aED.js';
2
+
3
+ declare class ChartVisualizationComponent extends ChartComponent {
4
+ constructor(renderTarget: Element);
5
+ render(data: any, options: any, aggregateExpressionOptions: any): void;
6
+ }
7
+
8
+ export { ChartVisualizationComponent as C };
@@ -0,0 +1,120 @@
1
+ import { _ as __extends } from './_tslib-5_9pMg1F.js';
2
+ import * as d3 from 'd3';
3
+ import { C as Component } from './Component-CofgyEw0.js';
4
+ import { U as Utils, K as KeyCodes } from './Utils-C_j8IgZh.js';
5
+
6
+ var ColorPicker = /** @class */ (function (_super) {
7
+ __extends(ColorPicker, _super);
8
+ function ColorPicker(renderTarget, componentId) {
9
+ if (componentId === void 0) { componentId = Utils.guid(); }
10
+ var _this = _super.call(this, renderTarget) || this;
11
+ _this.getSelectedColorValue = function () {
12
+ return _this.selectedColor;
13
+ };
14
+ _this.showColorGrid = function () {
15
+ _this.colorPickerElem.select(".tsi-colorGrid").style("display", "flex");
16
+ _this.isColorGridVisible = true;
17
+ _this.colorPickerElem.selectAll(".tsi-colorItem").nodes()[0].focus();
18
+ _this.colorPickerElem.select(".tsi-colorPickerButton").attr("aria-expanded", true);
19
+ };
20
+ _this.hideColorGrid = function (withFocusBackToPickerButton) {
21
+ if (withFocusBackToPickerButton === void 0) { withFocusBackToPickerButton = false; }
22
+ _this.colorPickerElem.select(".tsi-colorGrid").style("display", "none");
23
+ _this.isColorGridVisible = false;
24
+ _this.colorPickerElem.select(".tsi-colorPickerButton").attr("aria-expanded", false);
25
+ if (withFocusBackToPickerButton) {
26
+ _this.colorPickerElem.select(".tsi-colorPickerButton").node().focus();
27
+ }
28
+ };
29
+ _this.setSelectedColor = function (cStr, gridItem) {
30
+ _this.colorPickerElem.select(".tsi-selectedColor").classed("tsi-noColor", false);
31
+ _this.colorPickerElem.select(".tsi-selectedColor").style("background-color", cStr);
32
+ _this.colorPickerElem.select(".tsi-selectedColorValue").text(cStr);
33
+ _this.colorPickerElem.select(".tsi-colorItem.tsi-selected").classed("tsi-selected", false);
34
+ _this.colorPickerElem.select(".tsi-colorItem.tsi-selected").attr("aria-selected", false);
35
+ _this.colorPickerElem.select(".tsi-colorPickerButton").attr("aria-label", (_this.selectedColor ? _this.selectedColor : _this.getString('No color')) + ' ' + _this.getString('Select color'));
36
+ gridItem.classed("tsi-selected", true);
37
+ gridItem.attr("aria-selected", true);
38
+ _this.selectedColor = cStr;
39
+ };
40
+ _this.getColorPickerElem = function () {
41
+ return _this.colorPickerElem;
42
+ };
43
+ _this.componentId = componentId;
44
+ return _this;
45
+ }
46
+ ColorPicker.prototype.render = function (options) {
47
+ var _this = this;
48
+ if (options === void 0) { options = {}; }
49
+ this.chartOptions.setOptions(options);
50
+ this.selectedColor = this.chartOptions.defaultColor;
51
+ if (this.chartOptions.colors.indexOf(this.selectedColor) === -1) {
52
+ this.chartOptions.colors.push(this.selectedColor);
53
+ }
54
+ this.colorPickerElem = d3.select(this.renderTarget).classed("tsi-colorPicker", true);
55
+ this.colorPickerElem.text('');
56
+ _super.prototype.themify.call(this, this.colorPickerElem, this.chartOptions.theme);
57
+ // color selection button
58
+ var colorPickerButton = this.colorPickerElem.append('button').classed("tsi-colorPickerButton", true)
59
+ .attr("title", this.getString('Select color'))
60
+ .attr("aria-label", (this.selectedColor ? this.selectedColor : this.getString('No color')) + ' ' + this.getString('Select color'))
61
+ .attr("aria-controls", "tsi-colorGrid_".concat(this.componentId))
62
+ .on('click', function (event) {
63
+ if (_this.isColorGridVisible) {
64
+ _this.hideColorGrid(true);
65
+ }
66
+ else {
67
+ _this.chartOptions.onClick(event);
68
+ _this.showColorGrid();
69
+ }
70
+ });
71
+ if (this.selectedColor) {
72
+ colorPickerButton.append('div').classed("tsi-selectedColor", true).style("background-color", this.selectedColor);
73
+ }
74
+ else {
75
+ colorPickerButton.append('div').classed("tsi-selectedColor", true).classed("tsi-noColor", true);
76
+ }
77
+ colorPickerButton.append('span').classed("tsi-selectedColorValue", true).classed("hidden", this.chartOptions.isColorValueHidden)
78
+ .attr("id", "tsi-selectedColorValue_".concat(this.componentId))
79
+ .text(this.selectedColor ? this.selectedColor : this.getString('No color'));
80
+ // color grid
81
+ var colorGridElem = this.colorPickerElem.append('div').classed("tsi-colorGrid", true).attr("id", "tsi-colorGrid_".concat(this.componentId)).attr("role", "grid");
82
+ var colorGridRowElem = colorGridElem.append('div').classed("tsi-colorGridRow", true).attr("role", "row");
83
+ this.chartOptions.colors.forEach(function (c, idx) {
84
+ var gridItem = colorGridRowElem.append('div').classed("tsi-colorItem", true).classed("tsi-selected", c === _this.selectedColor)
85
+ .attr("tabindex", 0)
86
+ .attr("role", "gridcell")
87
+ .attr("aria-label", c)
88
+ .attr("aria-selected", c === _this.selectedColor)
89
+ .style("background-color", c)
90
+ .on('click', function (event) {
91
+ event.preventDefault();
92
+ event.stopPropagation();
93
+ _this.chartOptions.onSelect(c);
94
+ _this.hideColorGrid(true);
95
+ _this.setSelectedColor(c, gridItem);
96
+ })
97
+ .on('keydown', function (event) {
98
+ if (event.keyCode === KeyCodes.Tab && !event.shiftKey && idx === _this.chartOptions.colors.length - 1) { // tab
99
+ event.preventDefault();
100
+ _this.colorPickerElem.selectAll(".tsi-colorItem").nodes()[0].focus();
101
+ }
102
+ else if (event.keyCode === KeyCodes.Enter) {
103
+ event.preventDefault();
104
+ event.stopPropagation();
105
+ _this.chartOptions.onSelect(c);
106
+ _this.hideColorGrid(true);
107
+ _this.setSelectedColor(c, gridItem);
108
+ }
109
+ else if (event.keyCode === KeyCodes.Esc) {
110
+ event.preventDefault();
111
+ event.stopPropagation();
112
+ _this.hideColorGrid(true);
113
+ }
114
+ });
115
+ });
116
+ };
117
+ return ColorPicker;
118
+ }(Component));
119
+
120
+ export { ColorPicker as C };
@@ -0,0 +1,28 @@
1
+ import { C as Component } from './Component-Rp30sSAW.js';
2
+ import './Enums-ChUuTtHV.js';
3
+ import './Interfaces-BKRQ685G.js';
4
+
5
+ interface ColorPickerOptions {
6
+ theme?: string;
7
+ numberOfColors?: number;
8
+ colors?: Array<string>;
9
+ defaultColor?: string;
10
+ isColorValueHidden?: boolean;
11
+ onSelect?: (colorHex: string) => void;
12
+ onClick?: (event: any) => void;
13
+ }
14
+ declare class ColorPicker extends Component {
15
+ private colorPickerElem;
16
+ private selectedColor;
17
+ private isColorGridVisible;
18
+ private componentId;
19
+ constructor(renderTarget: Element, componentId?: string);
20
+ render(options?: ColorPickerOptions): void;
21
+ getSelectedColorValue: () => string;
22
+ private showColorGrid;
23
+ hideColorGrid: (withFocusBackToPickerButton?: boolean) => void;
24
+ private setSelectedColor;
25
+ getColorPickerElem: () => any;
26
+ }
27
+
28
+ export { ColorPicker as default };
@@ -0,0 +1,6 @@
1
+ export { C as default } from './ColorPicker-CH__K8xm.js';
2
+ import './_tslib-5_9pMg1F.js';
3
+ import 'd3';
4
+ import './Component-CofgyEw0.js';
5
+ import './Utils-C_j8IgZh.js';
6
+ import 'moment-timezone';