tsichart-core 1.0.4 → 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 (133) 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} +9388 -9387
  9. package/dist/styles/index.css.map +1 -0
  10. package/package.json +115 -125
  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-vciRThEz.js +0 -488
  15. package/dist/AvailabilityChart.d.ts +0 -59
  16. package/dist/AvailabilityChart.js +0 -26
  17. package/dist/ChartComponent-BxPbycj0.js +0 -302
  18. package/dist/ChartComponent-L_dR-Eny.d.ts +0 -80
  19. package/dist/ChartComponentData-ClzAtU_E.d.ts +0 -47
  20. package/dist/ChartDataOptions-DBu_M5gU.d.ts +0 -38
  21. package/dist/ChartDataOptions-rcIzlQJO.js +0 -49
  22. package/dist/ChartVisualizationComponent-CswB2P7Z.d.ts +0 -8
  23. package/dist/ChartVisualizationComponent-NsvZCsc-.js +0 -23
  24. package/dist/ColorPicker-CUZt1uup.js +0 -120
  25. package/dist/ColorPicker.d.ts +0 -28
  26. package/dist/ColorPicker.js +0 -6
  27. package/dist/Component-C9fQU2ia.js +0 -401
  28. package/dist/Component-CdI_Pyko.d.ts +0 -226
  29. package/dist/ContextMenu-CP1qV7pP.js +0 -197
  30. package/dist/DateTimeButton-Ck71nL87.d.ts +0 -16
  31. package/dist/DateTimeButton-DnqhATyX.js +0 -38
  32. package/dist/DateTimeButtonRange-CT1zOoCf.js +0 -71
  33. package/dist/DateTimeButtonRange.d.ts +0 -19
  34. package/dist/DateTimeButtonRange.js +0 -15
  35. package/dist/DateTimeButtonSingle-DZk5fW35.js +0 -48
  36. package/dist/DateTimeButtonSingle.d.ts +0 -17
  37. package/dist/DateTimeButtonSingle.js +0 -14
  38. package/dist/DateTimePicker-CuGwz86U.js +0 -532
  39. package/dist/DateTimePicker.d.ts +0 -69
  40. package/dist/DateTimePicker.js +0 -13
  41. package/dist/EllipsisMenu-CNWSo-qQ.js +0 -116
  42. package/dist/EllipsisMenu.d.ts +0 -20
  43. package/dist/EllipsisMenu.js +0 -6
  44. package/dist/Enums-CEhu18PC.d.ts +0 -12
  45. package/dist/EventsTable-mjoOfc0E.js +0 -553
  46. package/dist/EventsTable.d.ts +0 -34
  47. package/dist/EventsTable.js +0 -10
  48. package/dist/GeoProcessGraphic-CSsTL4zj.js +0 -145
  49. package/dist/GeoProcessGraphic.d.ts +0 -34
  50. package/dist/GeoProcessGraphic.js +0 -7
  51. package/dist/Grid-ByDh3Qdn.js +0 -874
  52. package/dist/Grid.d.ts +0 -43
  53. package/dist/Grid.js +0 -6
  54. package/dist/GroupedBarChart-DrSrSHNj.js +0 -579
  55. package/dist/GroupedBarChart.d.ts +0 -22
  56. package/dist/GroupedBarChart.js +0 -17
  57. package/dist/GroupedBarChartData-CpJKvTDQ.js +0 -121
  58. package/dist/GroupedBarChartData-DK30DLVh.d.ts +0 -20
  59. package/dist/Heatmap-BbWcAgp6.js +0 -524
  60. package/dist/Heatmap.d.ts +0 -31
  61. package/dist/Heatmap.js +0 -14
  62. package/dist/Hierarchy-BsvoKnCY.js +0 -260
  63. package/dist/Hierarchy.d.ts +0 -39
  64. package/dist/Hierarchy.js +0 -6
  65. package/dist/HierarchyNavigation-C5yoj--u.js +0 -336
  66. package/dist/HierarchyNavigation.d.ts +0 -34
  67. package/dist/HierarchyNavigation.js +0 -6
  68. package/dist/HistoryPlayback-DIhAsAOi.d.ts +0 -68
  69. package/dist/HistoryPlayback-DiflRzRf.js +0 -175
  70. package/dist/Interfaces-CdAVFIA6.d.ts +0 -6
  71. package/dist/Legend-CQ5yaF8f.js +0 -497
  72. package/dist/LineChart-DcUenMrZ.js +0 -3181
  73. package/dist/LineChart.d.ts +0 -163
  74. package/dist/LineChart.js +0 -18
  75. package/dist/ModelAutocomplete-sxVy4m65.js +0 -100
  76. package/dist/ModelAutocomplete.d.ts +0 -12
  77. package/dist/ModelAutocomplete.js +0 -7
  78. package/dist/ModelSearch-DEg5KwKw.js +0 -189
  79. package/dist/ModelSearch.d.ts +0 -23
  80. package/dist/ModelSearch.js +0 -9
  81. package/dist/PieChart-DDxMXcXE.js +0 -258
  82. package/dist/PieChart.d.ts +0 -26
  83. package/dist/PieChart.js +0 -17
  84. package/dist/PlaybackControls-DSoUncDP.js +0 -195
  85. package/dist/PlaybackControls.d.ts +0 -39
  86. package/dist/PlaybackControls.js +0 -13
  87. package/dist/ProcessGraphic-1f-FoGDy.js +0 -154
  88. package/dist/ProcessGraphic.d.ts +0 -31
  89. package/dist/ProcessGraphic.js +0 -7
  90. package/dist/README.MD +0 -171
  91. package/dist/ScatterPlot-BAn6r8ml.js +0 -924
  92. package/dist/ScatterPlot.d.ts +0 -115
  93. package/dist/ScatterPlot.js +0 -17
  94. package/dist/SingleDateTimePicker-BrFB5iPu.js +0 -213
  95. package/dist/SingleDateTimePicker.d.ts +0 -45
  96. package/dist/SingleDateTimePicker.js +0 -12
  97. package/dist/Slider-BpNCqoBD.js +0 -186
  98. package/dist/Slider.d.ts +0 -31
  99. package/dist/Slider.js +0 -6
  100. package/dist/TemporalXAxisComponent-BsTQyVO6.js +0 -129
  101. package/dist/TemporalXAxisComponent-DohbI08i.d.ts +0 -23
  102. package/dist/TimezonePicker-DHkC2iKE.js +0 -58
  103. package/dist/TimezonePicker.d.ts +0 -16
  104. package/dist/TimezonePicker.js +0 -10
  105. package/dist/Tooltip-B-mIKo4g.js +0 -104
  106. package/dist/TsqExpression.d.ts +0 -36
  107. package/dist/TsqExpression.js +0 -89
  108. package/dist/UXClient-BTulvzpq.js +0 -230
  109. package/dist/UXClient.d.ts +0 -74
  110. package/dist/UXClient.js +0 -47
  111. package/dist/Utils-CdKMmmwx.js +0 -1138
  112. package/dist/Utils-ChzaAbch.d.ts +0 -104
  113. package/dist/Utils.d.ts +0 -7
  114. package/dist/Utils.js +0 -7
  115. package/dist/_tslib-DYvz7dIO.js +0 -96
  116. package/dist/package.json +0 -125
  117. package/dist/pikaday-C_DS7oEN.js +0 -1252
  118. package/dist/tsiclient.cjs.js +0 -3
  119. package/dist/tsiclient.cjs.js.LICENSE.txt +0 -19
  120. package/dist/tsiclient.cjs.js.map +0 -1
  121. package/dist/tsiclient.d.ts +0 -46
  122. package/dist/tsiclient.esm.js +0 -3
  123. package/dist/tsiclient.esm.js.LICENSE.txt +0 -19
  124. package/dist/tsiclient.esm.js.map +0 -1
  125. package/dist/tsiclient.js +0 -58
  126. package/dist/tsiclient.min.css +0 -6
  127. package/dist/tsiclient.min.css.map +0 -1
  128. package/dist/tsiclient.umd.js +0 -3
  129. package/dist/tsiclient.umd.js.LICENSE.txt +0 -19
  130. package/dist/tsiclient.umd.js.map +0 -1
  131. package/dist/tsiclient.umd.min.js +0 -3
  132. package/dist/tsiclient.umd.min.js.LICENSE.txt +0 -19
  133. package/dist/tsiclient.umd.min.js.map +0 -1
@@ -1,154 +0,0 @@
1
- import { _ as __extends } from './_tslib-DYvz7dIO.js';
2
- import * as d3 from 'd3';
3
- import { H as HistoryPlayback } from './HistoryPlayback-DiflRzRf.js';
4
- import { U as Utils } from './Utils-CdKMmmwx.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-DIhAsAOi.js';
2
- import TsqExpression from './TsqExpression.js';
3
- import 'd3';
4
- import './Component-CdI_Pyko.js';
5
- import './Enums-CEhu18PC.js';
6
- import './Interfaces-CdAVFIA6.js';
7
- import './PlaybackControls.js';
8
- import './ChartDataOptions-DBu_M5gU.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-1f-FoGDy.js';
2
- import './_tslib-DYvz7dIO.js';
3
- import 'd3';
4
- import './HistoryPlayback-DiflRzRf.js';
5
- import './Component-C9fQU2ia.js';
6
- import './Utils-CdKMmmwx.js';
7
- import 'moment-timezone';
package/dist/README.MD DELETED
@@ -1,171 +0,0 @@
1
- # @tsichart/core - Time Series Interactive Charts
2
-
3
- A powerful, flexible JavaScript library for visualizing time series data with **interactive** charts. Built with TypeScript and D3.js, this library provides a rich set of chart components including line charts, bar charts, pie charts, heatmaps, scatter plots, and more.
4
-
5
- ## Features
6
-
7
- ✨ **Rich Component Library** - 20+ pre-built, customizable chart components
8
- 📊 **Interactive Visualizations** - Tooltips, zooming, panning, and dynamic data updates
9
- 🎨 **Themeable** - Built-in light and dark themes with customization options
10
- 📱 **Responsive** - Charts adapt to different screen sizes
11
- 🎯 **TypeScript Support** - Full type definitions included
12
- 🌳 **Tree-shakeable** - Import only the components you need
13
- 📦 **Zero Configuration** - Works out of the box with sensible defaults
14
-
15
- **Note:** This library is a community-maintained fork of the original Microsoft Time Series Insights Client, rebranded as **Time Series Interactive Charts** and updated for generic time series visualization use cases.
16
-
17
- [![npm version](https://badge.fury.io/js/tsichart-core.svg)](https://www.npmjs.com/package/tsichart-core)
18
- [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
19
- [![GitHub](https://img.shields.io/badge/GitHub-Repository-blue?logo=github)](https://github.com/Aenas11/tsichart-core)
20
- [![Live Examples](https://img.shields.io/badge/Examples-Live%20Demo-green)](https://aenas11.github.io/tsichart-core/)
21
-
22
- ## Installation
23
-
24
- ### NPM
25
-
26
- ```bash
27
- npm install tsichart-core
28
- ```
29
-
30
- ### Yarn
31
-
32
- ```bash
33
- yarn add tsichart-core
34
- ```
35
-
36
- ## Quick Start
37
-
38
- ### Import All Components
39
-
40
- ```js
41
- import TsiClient from "tsichart-core";
42
- import "tsichart-core/tsiclient.css";
43
-
44
- // Create a line chart
45
- let tsiClient = new TsiClient();
46
- let lineChart = new tsiClient.ux.LineChart(document.getElementById('chart'));
47
-
48
- // Prepare your data
49
- const data = [{
50
- "Series1": {
51
- "": {
52
- "2023-01-01T00:00:00Z": { avg: 10 },
53
- "2023-01-01T01:00:00Z": { avg: 15 },
54
- "2023-01-01T02:00:00Z": { avg: 13 }
55
- }
56
- }
57
- }];
58
-
59
- // Render the chart
60
- lineChart.render(data, { theme: 'light', legend: 'compact' });
61
- ```
62
-
63
- ### Import Individual Components (Recommended for Tree-shaking)
64
-
65
- ```js
66
- import LineChart from 'tsichart-core/LineChart';
67
- import 'tsichart-core/tsiclient.css';
68
-
69
- // Create and render chart
70
- let lineChart = new LineChart(document.getElementById('chart'));
71
- lineChart.render(data, { theme: 'light' });
72
- ```
73
-
74
- ## Available Components
75
-
76
- **tsiclient** provides the following visualization components:
77
-
78
- - **LineChart** - Render time series data as lines
79
- - **BarChart** - Display time series data as bars with timestamp slider
80
- - **PieChart** - Show time series data as pie charts with timestamp slider
81
- - **Heatmap** - Visualize time series data as a heatmap
82
- - **ScatterPlot** - Plot time series data points as a scatter plot
83
- - **AvailabilityChart** - Display data availability over time
84
- - **Grid** - Render time series data in a tabular format
85
- - **Hierarchy** - Display hierarchical data structures
86
- - **EventsTable** - Show events in a table format
87
- - **DateTimePicker** - UI component for selecting date/time ranges
88
- - **TimezonePicker** - UI component for timezone selection
89
- - **Slider** - Time slider component
90
- - **ModelSearch** - Search component for time series models
91
- - **HierarchyNavigation** - Navigate hierarchical time series data
92
- - **ProcessGraphic** - Display process graphics with data overlays
93
- - **ColorPicker** - Color selection component
94
- - And more...
95
-
96
- For detailed usage examples and API documentation, see the [UX Components documentation](docs/UX.md).
97
-
98
- ## Data Format
99
-
100
- All components work with a consistent JSON data structure. Here's the basic format:
101
-
102
- ```js
103
- const data = [{
104
- "SeriesName": {
105
- "SplitByValue": { // Use empty string "" if no split
106
- "2023-01-01T00:00:00Z": {
107
- avg: 10, // Your metric values
108
- min: 8,
109
- max: 12
110
- },
111
- "2023-01-01T01:00:00Z": {
112
- avg: 15,
113
- min: 13,
114
- max: 17
115
- }
116
- }
117
- }
118
- }];
119
- ```
120
-
121
- **You are responsible for:**
122
- - Fetching time series data from your data source (API, database, etc.)
123
- - Transforming your data into the expected format
124
- - Handling any authentication/authorization
125
-
126
- See the [UX Components documentation](docs/UX.md) for detailed format specifications for each chart type.
127
-
128
- ## Resources
129
-
130
- * **[Live Examples](https://aenas11.github.io/tsichart-core/)** - Interactive examples hosted on GitHub Pages
131
- * [Full API Documentation](docs/UX.md)
132
- * [Example Source Code](pages/examples/) - Check the `pages/examples/` directory for working examples
133
-
134
-
135
- ## Contributing
136
-
137
- Contributions are welcome! This is a community-maintained project. Please feel free to:
138
-
139
- - Report bugs and request features via [GitHub Issues](https://github.com/Aenas11/tsichart-core/issues)
140
- - Submit pull requests
141
- - Improve documentation
142
- - Share examples of your usage
143
-
144
- ## License
145
-
146
- MIT License - see [LICENSE](LICENSE) file for details.
147
-
148
- Original work Copyright (c) Microsoft Corporation
149
- Modified work Copyright (c) 2024 [Alexander Sysoiev]
150
-
151
- ## Acknowledgments
152
-
153
- This library is based on the original Microsoft Time Series Insights (TSI) JavaScript SDK, which has been deprecated. We've rebranded it as **Time Series Interactive Charts** and modernized it for generic time series visualization use cases.
154
-
155
- **TSI** now stands for **Time Series Interactive** - reflecting the library's focus on interactive data visualization rather than a specific cloud service.
156
-
157
- ## Migration from Original TSIClient
158
-
159
- If you're migrating from the original Microsoft `tsiclient` package:
160
-
161
- 1. **Package name change**: Update your imports from `tsiclient` to `tsichart-core`
162
- 2. **No breaking changes to component APIs**: The chart components work the same way
163
- 3. **Remove server calls**: You'll need to handle data fetching yourself (Azure TSI service was retired)
164
- 4. **Update documentation references**: Use the new documentation instead of Azure TSI docs
165
- - The `tsiClient.server` object and all related methods have been removed
166
- - Focus is now exclusively on client-side visualization components
167
-
168
-
169
- ## Contributing
170
-
171
- This project welcomes contributions and suggestions.