tsichart-core 1.0.5 → 2.0.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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,154 +0,0 @@
1
- import { _ as __extends } from './_tslib-BYFmvNeL.js';
2
- import * as d3 from 'd3';
3
- import { H as HistoryPlayback } from './HistoryPlayback-D09bter3.js';
4
- import { U as Utils } from './Utils-DDGqSryb.js';
5
-
6
- var ProcessGraphic = /** @class */ (function (_super) {
7
- __extends(ProcessGraphic, _super);
8
- function ProcessGraphic(renderTarget) {
9
- var _this = _super.call(this, renderTarget) || this;
10
- _this.currentCancelTrigger = null;
11
- return _this;
12
- }
13
- ProcessGraphic.prototype.render = function (environmentFqdn, getToken, graphicSrc, data, chartOptions) {
14
- this.graphicSrc = graphicSrc;
15
- this.renderBase(environmentFqdn, getToken, data, chartOptions);
16
- };
17
- ProcessGraphic.prototype.loadResources = function () {
18
- var _this = this;
19
- return new Promise(function (resolve, reject) {
20
- var image = new Image();
21
- image.onload = function () {
22
- _this.graphic = image;
23
- _this.graphicOriginalWidth = image.width;
24
- _this.graphicOriginalHeight = image.height;
25
- _this.component.node().appendChild(_this.graphic);
26
- resolve(null);
27
- };
28
- image.onerror = function (errorMessage) {
29
- console.log(errorMessage);
30
- reject(errorMessage);
31
- };
32
- image.src = _this.graphicSrc;
33
- });
34
- };
35
- ProcessGraphic.prototype.draw = function () {
36
- var graphicContainerWidth = this.renderTarget.clientWidth;
37
- var graphicContainerHeight = this.renderTarget.clientHeight - this.playbackSliderHeight;
38
- this.componentContainer
39
- .style("width", "".concat(graphicContainerWidth, "px"))
40
- .style("height", "".concat(graphicContainerHeight, "px"));
41
- var resizedImageDim = this.getResizedImageDimensions(graphicContainerWidth, graphicContainerHeight, this.graphicOriginalWidth, this.graphicOriginalHeight);
42
- this.component
43
- .style("width", "".concat(resizedImageDim.width, "px"))
44
- .style("height", "".concat(resizedImageDim.height, "px"));
45
- this.drawBase();
46
- };
47
- ProcessGraphic.prototype.getResizedImageDimensions = function (containerWidth, containerHeight, imageWidth, imageHeight) {
48
- if (containerWidth >= imageWidth && containerHeight >= imageHeight) {
49
- return {
50
- width: imageWidth,
51
- height: imageHeight,
52
- };
53
- }
54
- // Calculate the factor we would need to multiply width by to make it fit in the container.
55
- // Do the same for height. The smallest of those two corresponds to the largest size reduction
56
- // needed. Multiply both width and height by the smallest factor to a) ensure we maintain the
57
- // aspect ratio of the image b) ensure the image fits inside the container.
58
- var widthFactor = containerWidth / imageWidth;
59
- var heightFactor = containerHeight / imageHeight;
60
- var resizeFactor = Math.min(widthFactor, heightFactor);
61
- return {
62
- width: imageWidth * resizeFactor,
63
- height: imageHeight * resizeFactor,
64
- };
65
- };
66
- ProcessGraphic.prototype.getDataPoints = function (results) {
67
- var _this = this;
68
- if (Array.isArray(results)) {
69
- var dataPoints = results.map(function (r, i) {
70
- var value = _this.parseTsqResponse(r);
71
- var color = typeof _this.tsqExpressions[i].color === "function"
72
- ? _this.tsqExpressions[i].color(value)
73
- : _this.tsqExpressions[i].color;
74
- return {
75
- value: value,
76
- alias: _this.tsqExpressions[i].alias,
77
- x: _this.tsqExpressions[i].positionX,
78
- y: _this.tsqExpressions[i].positionY,
79
- color: _this.sanitizeAttribute(color),
80
- onClick: _this.tsqExpressions[i].onElementClick,
81
- };
82
- });
83
- this.updateDataMarkers(dataPoints);
84
- }
85
- };
86
- ProcessGraphic.prototype.updateDataMarkers = function (graphicValues) {
87
- var _this = this;
88
- var textElements = this.component
89
- .selectAll("div")
90
- .data(graphicValues);
91
- var newElements = textElements
92
- .enter()
93
- .append("div")
94
- .classed("tsi-process-graphic-label", true);
95
- newElements.append("div").classed("title", true);
96
- newElements.append("div").classed("value", true);
97
- newElements
98
- .merge(textElements)
99
- .classed("tsi-dark", false)
100
- .classed("tsi-light", false)
101
- .classed(Utils.getTheme(this.chartOptions.theme), true)
102
- .style("left", function (tsqe) { return "".concat(tsqe.x, "%"); })
103
- .style("top", function (tsqe) { return "".concat(tsqe.y, "%"); });
104
- // Trigger glow css animation when values update.
105
- var highlightCssClass = "tsi-label-highlight";
106
- this.component
107
- .selectAll(".tsi-process-graphic-label")
108
- .data(graphicValues)
109
- .classed(highlightCssClass, true)
110
- .classed("clickable", function (tsqe) { return tsqe.onClick !== null; })
111
- .on("animationend", function () {
112
- d3.select(this).classed(highlightCssClass, false);
113
- })
114
- .on("click", function (event, tsqe) {
115
- if (typeof tsqe.onClick === "function") {
116
- tsqe.onClick({
117
- timeStamp: _this.playbackControls.currentTimeStamp,
118
- value: tsqe.value,
119
- color: tsqe.color,
120
- });
121
- }
122
- });
123
- this.component
124
- .selectAll(".title")
125
- .data(graphicValues)
126
- .text(function (tsqe) { return tsqe.alias || ""; });
127
- this.component
128
- .selectAll(".value")
129
- .data(graphicValues)
130
- .text(function (tsqe) {
131
- return tsqe.value !== null ? Utils.formatYAxisNumber(tsqe.value) : "--";
132
- })
133
- .style("color", function (tsqe) { return tsqe.color; });
134
- };
135
- ProcessGraphic.prototype.parseTsqResponse = function (response) {
136
- return response &&
137
- response.properties &&
138
- response.properties[0] &&
139
- response.properties[0].values
140
- ? response.properties[0].values[0]
141
- : null;
142
- };
143
- ProcessGraphic.prototype.sanitizeAttribute = function (str) {
144
- var sanitized = String(str);
145
- var illegalChars = ['"', "'", "?", "<", ">", ";"];
146
- illegalChars.forEach(function (c) {
147
- sanitized = sanitized.split(c).join("");
148
- });
149
- return sanitized;
150
- };
151
- return ProcessGraphic;
152
- }(HistoryPlayback));
153
-
154
- export { ProcessGraphic as P };
@@ -1,31 +0,0 @@
1
- import { H as HistoryPlayback, G as GraphicInfo } from './HistoryPlayback-DmJ6u7lU.js';
2
- import TsqExpression from './TsqExpression.js';
3
- import 'd3';
4
- import './Component-DXwYPoSo.js';
5
- import './Enums-DWpaQlXk.js';
6
- import './Interfaces-R_1l9lIT.js';
7
- import './PlaybackControls.js';
8
- import './ChartDataOptions-D0BJuRZy.js';
9
-
10
- declare class ProcessGraphic extends HistoryPlayback {
11
- private graphicSrc;
12
- constructor(renderTarget: Element);
13
- render(environmentFqdn: string, getToken: () => Promise<string>, graphicSrc: string, data: Array<TsqExpression>, chartOptions: any): void;
14
- protected loadResources(): Promise<GraphicInfo>;
15
- protected draw(): void;
16
- private getResizedImageDimensions;
17
- protected getDataPoints(results: Array<IProcessGraphicLabelInfo>): void;
18
- protected updateDataMarkers(graphicValues: Array<IProcessGraphicLabelInfo>): void;
19
- protected parseTsqResponse(response: any): any;
20
- protected sanitizeAttribute(str: any): string;
21
- }
22
- interface IProcessGraphicLabelInfo {
23
- value: number;
24
- alias: string;
25
- x: number;
26
- y: number;
27
- color: string;
28
- onClick: Function;
29
- }
30
-
31
- export { ProcessGraphic as default };
@@ -1,7 +0,0 @@
1
- export { P as default } from './ProcessGraphic-Cft1b4Mf.js';
2
- import './_tslib-BYFmvNeL.js';
3
- import 'd3';
4
- import './HistoryPlayback-D09bter3.js';
5
- import './Component-BgifJdKl.js';
6
- import './Utils-DDGqSryb.js';
7
- import 'moment-timezone';