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.
- package/LICENSE +22 -0
- package/README.MD +189 -0
- package/dist/AggregateExpression.d.ts +13 -0
- package/dist/AggregateExpression.js +70 -0
- package/dist/AvailabilityChart-i_efwXCX.js +488 -0
- package/dist/AvailabilityChart.d.ts +59 -0
- package/dist/AvailabilityChart.js +26 -0
- package/dist/ChartComponent-DTcc6aED.d.ts +80 -0
- package/dist/ChartComponent-DnKLTxWe.js +302 -0
- package/dist/ChartComponentData-D5wuQmmZ.d.ts +47 -0
- package/dist/ChartDataOptions-DBS28b1-.d.ts +38 -0
- package/dist/ChartDataOptions-DRd8NHra.js +49 -0
- package/dist/ChartVisualizationComponent-CG7e5xlc.js +23 -0
- package/dist/ChartVisualizationComponent-DBjiqR1n.d.ts +8 -0
- package/dist/ColorPicker-CH__K8xm.js +120 -0
- package/dist/ColorPicker.d.ts +28 -0
- package/dist/ColorPicker.js +6 -0
- package/dist/Component-CofgyEw0.js +401 -0
- package/dist/Component-Rp30sSAW.d.ts +226 -0
- package/dist/ContextMenu-DABSkTA2.js +197 -0
- package/dist/DateTimeButton-CMcCxc8x.d.ts +16 -0
- package/dist/DateTimeButton-Ca1487GR.js +38 -0
- package/dist/DateTimeButtonRange-DpgfhHQt.js +71 -0
- package/dist/DateTimeButtonRange.d.ts +19 -0
- package/dist/DateTimeButtonRange.js +15 -0
- package/dist/DateTimeButtonSingle-C6cTx5VO.js +48 -0
- package/dist/DateTimeButtonSingle.d.ts +17 -0
- package/dist/DateTimeButtonSingle.js +14 -0
- package/dist/DateTimePicker-BH6qiVfQ.js +532 -0
- package/dist/DateTimePicker.d.ts +69 -0
- package/dist/DateTimePicker.js +13 -0
- package/dist/EllipsisMenu-30FNqoIv.js +116 -0
- package/dist/EllipsisMenu.d.ts +20 -0
- package/dist/EllipsisMenu.js +6 -0
- package/dist/Enums-ChUuTtHV.d.ts +12 -0
- package/dist/EventsTable-a0XLbsMF.js +553 -0
- package/dist/EventsTable.d.ts +34 -0
- package/dist/EventsTable.js +10 -0
- package/dist/GeoProcessGraphic-AVAzyF7k.js +145 -0
- package/dist/GeoProcessGraphic.d.ts +34 -0
- package/dist/GeoProcessGraphic.js +7 -0
- package/dist/Grid-DfFAkeeV.js +874 -0
- package/dist/Grid.d.ts +43 -0
- package/dist/Grid.js +6 -0
- package/dist/GroupedBarChart-BspwM8r2.js +579 -0
- package/dist/GroupedBarChart.d.ts +22 -0
- package/dist/GroupedBarChart.js +17 -0
- package/dist/GroupedBarChartData-BRCyDxbA.js +121 -0
- package/dist/GroupedBarChartData-C0YQydrP.d.ts +20 -0
- package/dist/Heatmap-D8ET8Ue8.js +524 -0
- package/dist/Heatmap.d.ts +31 -0
- package/dist/Heatmap.js +14 -0
- package/dist/Hierarchy-QkWLHkxo.js +260 -0
- package/dist/Hierarchy.d.ts +39 -0
- package/dist/Hierarchy.js +6 -0
- package/dist/HierarchyNavigation-CR6YUilh.js +336 -0
- package/dist/HierarchyNavigation.d.ts +34 -0
- package/dist/HierarchyNavigation.js +6 -0
- package/dist/HistoryPlayback-BmA-54lT.d.ts +68 -0
- package/dist/HistoryPlayback-SjeQbAPq.js +175 -0
- package/dist/Interfaces-BKRQ685G.d.ts +6 -0
- package/dist/Legend-DlSXQXHF.js +497 -0
- package/dist/LineChart-CExEyjZa.js +3181 -0
- package/dist/LineChart.d.ts +163 -0
- package/dist/LineChart.js +18 -0
- package/dist/ModelAutocomplete-TRD16egq.js +100 -0
- package/dist/ModelAutocomplete.d.ts +12 -0
- package/dist/ModelAutocomplete.js +7 -0
- package/dist/ModelSearch-WEa7Ud20.js +189 -0
- package/dist/ModelSearch.d.ts +23 -0
- package/dist/ModelSearch.js +9 -0
- package/dist/PieChart-B1ZXk13Q.js +258 -0
- package/dist/PieChart.d.ts +26 -0
- package/dist/PieChart.js +17 -0
- package/dist/PlaybackControls-Dwt6dif9.js +195 -0
- package/dist/PlaybackControls.d.ts +39 -0
- package/dist/PlaybackControls.js +13 -0
- package/dist/ProcessGraphic-CixT-zZl.js +154 -0
- package/dist/ProcessGraphic.d.ts +31 -0
- package/dist/ProcessGraphic.js +7 -0
- package/dist/README.MD +189 -0
- package/dist/ScatterPlot-DrPoHNDJ.js +924 -0
- package/dist/ScatterPlot.d.ts +115 -0
- package/dist/ScatterPlot.js +17 -0
- package/dist/SingleDateTimePicker-7anflEq8.js +213 -0
- package/dist/SingleDateTimePicker.d.ts +45 -0
- package/dist/SingleDateTimePicker.js +12 -0
- package/dist/Slider-BtSdC4fj.js +186 -0
- package/dist/Slider.d.ts +31 -0
- package/dist/Slider.js +6 -0
- package/dist/TemporalXAxisComponent-CyiM5EH0.d.ts +23 -0
- package/dist/TemporalXAxisComponent-DkyVvASs.js +129 -0
- package/dist/TimezonePicker-ClfP1lBL.js +58 -0
- package/dist/TimezonePicker.d.ts +16 -0
- package/dist/TimezonePicker.js +10 -0
- package/dist/Tooltip-Fa-0Xekn.js +104 -0
- package/dist/TsqExpression.d.ts +36 -0
- package/dist/TsqExpression.js +89 -0
- package/dist/UXClient-DydSPZwM.js +230 -0
- package/dist/UXClient.d.ts +74 -0
- package/dist/UXClient.js +47 -0
- package/dist/Utils-BsPLzJBC.d.ts +104 -0
- package/dist/Utils-C_j8IgZh.js +1138 -0
- package/dist/Utils.d.ts +7 -0
- package/dist/Utils.js +7 -0
- package/dist/_tslib-5_9pMg1F.js +96 -0
- package/dist/package.json +106 -0
- package/dist/pikaday-DMSzaLH6.js +1252 -0
- package/dist/tsiclient.cjs.js +3 -0
- package/dist/tsiclient.cjs.js.LICENSE.txt +19 -0
- package/dist/tsiclient.cjs.js.map +1 -0
- package/dist/tsiclient.css +17323 -0
- package/dist/tsiclient.d.ts +46 -0
- package/dist/tsiclient.esm.js +3 -0
- package/dist/tsiclient.esm.js.LICENSE.txt +19 -0
- package/dist/tsiclient.esm.js.map +1 -0
- package/dist/tsiclient.js +58 -0
- package/dist/tsiclient.min.css +6 -0
- package/dist/tsiclient.min.css.map +1 -0
- package/dist/tsiclient.umd.js +3 -0
- package/dist/tsiclient.umd.js.LICENSE.txt +19 -0
- package/dist/tsiclient.umd.js.map +1 -0
- package/dist/tsiclient.umd.min.js +3 -0
- package/dist/tsiclient.umd.min.js.LICENSE.txt +19 -0
- package/dist/tsiclient.umd.min.js.map +1 -0
- package/package.json +106 -0
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import { _ as __extends } from './_tslib-5_9pMg1F.js';
|
|
2
|
+
import * as d3 from 'd3';
|
|
3
|
+
import { H as HistoryPlayback } from './HistoryPlayback-SjeQbAPq.js';
|
|
4
|
+
import { U as Utils } from './Utils-C_j8IgZh.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 };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { H as HistoryPlayback, G as GraphicInfo } from './HistoryPlayback-BmA-54lT.js';
|
|
2
|
+
import TsqExpression from './TsqExpression.js';
|
|
3
|
+
import 'd3';
|
|
4
|
+
import './Component-Rp30sSAW.js';
|
|
5
|
+
import './Enums-ChUuTtHV.js';
|
|
6
|
+
import './Interfaces-BKRQ685G.js';
|
|
7
|
+
import './PlaybackControls.js';
|
|
8
|
+
import './ChartDataOptions-DBS28b1-.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 };
|
package/dist/README.MD
ADDED
|
@@ -0,0 +1,189 @@
|
|
|
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
|
+
[](https://opensource.org/licenses/MIT) [](https://badge.fury.io/js/@tsichart/core)
|
|
18
|
+
|
|
19
|
+
## Installation
|
|
20
|
+
|
|
21
|
+
### NPM
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
npm install @tsichart/core
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### Yarn
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
yarn add @tsichart/core
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### CDN
|
|
34
|
+
|
|
35
|
+
You can also load directly from a CDN:
|
|
36
|
+
|
|
37
|
+
```html
|
|
38
|
+
<script src="https://unpkg.com/@tsichart/core@latest/tsiclient.js"></script>
|
|
39
|
+
<link rel="stylesheet" type="text/css" href="https://unpkg.com/@tsichart/core@latest/tsiclient.css">
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Quick Start
|
|
43
|
+
|
|
44
|
+
### Import All Components
|
|
45
|
+
|
|
46
|
+
```js
|
|
47
|
+
import TsiClient from "@tsichart/core";
|
|
48
|
+
import "@tsichart/core/tsiclient.css";
|
|
49
|
+
|
|
50
|
+
// Create a line chart
|
|
51
|
+
let tsiClient = new TsiClient();
|
|
52
|
+
let lineChart = new tsiClient.ux.LineChart(document.getElementById('chart'));
|
|
53
|
+
|
|
54
|
+
// Prepare your data
|
|
55
|
+
const data = [{
|
|
56
|
+
"Series1": {
|
|
57
|
+
"": {
|
|
58
|
+
"2023-01-01T00:00:00Z": { avg: 10 },
|
|
59
|
+
"2023-01-01T01:00:00Z": { avg: 15 },
|
|
60
|
+
"2023-01-01T02:00:00Z": { avg: 13 }
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}];
|
|
64
|
+
|
|
65
|
+
// Render the chart
|
|
66
|
+
lineChart.render(data, { theme: 'light', legend: 'compact' });
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### Import Individual Components (Recommended for Tree-shaking)
|
|
70
|
+
|
|
71
|
+
```js
|
|
72
|
+
import LineChart from '@tsichart/core/LineChart';
|
|
73
|
+
import '@tsichart/core/tsiclient.css';
|
|
74
|
+
|
|
75
|
+
// Create and render chart
|
|
76
|
+
let lineChart = new LineChart(document.getElementById('chart'));
|
|
77
|
+
lineChart.render(data, { theme: 'light' });
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## Available Components
|
|
81
|
+
|
|
82
|
+
**tsiclient** provides the following visualization components:
|
|
83
|
+
|
|
84
|
+
- **LineChart** - Render time series data as lines
|
|
85
|
+
- **BarChart** - Display time series data as bars with timestamp slider
|
|
86
|
+
- **PieChart** - Show time series data as pie charts with timestamp slider
|
|
87
|
+
- **Heatmap** - Visualize time series data as a heatmap
|
|
88
|
+
- **ScatterPlot** - Plot time series data points as a scatter plot
|
|
89
|
+
- **AvailabilityChart** - Display data availability over time
|
|
90
|
+
- **Grid** - Render time series data in a tabular format
|
|
91
|
+
- **Hierarchy** - Display hierarchical data structures
|
|
92
|
+
- **EventsTable** - Show events in a table format
|
|
93
|
+
- **DateTimePicker** - UI component for selecting date/time ranges
|
|
94
|
+
- **TimezonePicker** - UI component for timezone selection
|
|
95
|
+
- **Slider** - Time slider component
|
|
96
|
+
- **ModelSearch** - Search component for time series models
|
|
97
|
+
- **HierarchyNavigation** - Navigate hierarchical time series data
|
|
98
|
+
- **ProcessGraphic** - Display process graphics with data overlays
|
|
99
|
+
- **ColorPicker** - Color selection component
|
|
100
|
+
- And more...
|
|
101
|
+
|
|
102
|
+
For detailed usage examples and API documentation, see the [UX Components documentation](docs/UX.md).
|
|
103
|
+
|
|
104
|
+
## Data Format
|
|
105
|
+
|
|
106
|
+
All components work with a consistent JSON data structure. Here's the basic format:
|
|
107
|
+
|
|
108
|
+
```js
|
|
109
|
+
const data = [{
|
|
110
|
+
"SeriesName": {
|
|
111
|
+
"SplitByValue": { // Use empty string "" if no split
|
|
112
|
+
"2023-01-01T00:00:00Z": {
|
|
113
|
+
avg: 10, // Your metric values
|
|
114
|
+
min: 8,
|
|
115
|
+
max: 12
|
|
116
|
+
},
|
|
117
|
+
"2023-01-01T01:00:00Z": {
|
|
118
|
+
avg: 15,
|
|
119
|
+
min: 13,
|
|
120
|
+
max: 17
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}];
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
**You are responsible for:**
|
|
128
|
+
- Fetching time series data from your data source (API, database, etc.)
|
|
129
|
+
- Transforming your data into the expected format
|
|
130
|
+
- Handling any authentication/authorization
|
|
131
|
+
|
|
132
|
+
See the [UX Components documentation](docs/UX.md) for detailed format specifications for each chart type.
|
|
133
|
+
|
|
134
|
+
## Resources
|
|
135
|
+
|
|
136
|
+
* [Full API Documentation](docs/UX.md)
|
|
137
|
+
* [Live Examples](pages/examples/) - Check the `pages/examples/` directory for working examples
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
## Contributing
|
|
141
|
+
|
|
142
|
+
Contributions are welcome! This is a community-maintained project. Please feel free to:
|
|
143
|
+
|
|
144
|
+
- Report bugs and request features via [GitHub Issues](https://github.com/yourusername/tsichart-core/issues)
|
|
145
|
+
- Submit pull requests
|
|
146
|
+
- Improve documentation
|
|
147
|
+
- Share examples of your usage
|
|
148
|
+
|
|
149
|
+
## License
|
|
150
|
+
|
|
151
|
+
MIT License - see [LICENSE](LICENSE) file for details.
|
|
152
|
+
|
|
153
|
+
Original work Copyright (c) Microsoft Corporation
|
|
154
|
+
Modified work Copyright (c) 2024 [Your Name]
|
|
155
|
+
|
|
156
|
+
## Acknowledgments
|
|
157
|
+
|
|
158
|
+
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.
|
|
159
|
+
|
|
160
|
+
**TSI** now stands for **Time Series Interactive** - reflecting the library's focus on interactive data visualization rather than a specific cloud service.
|
|
161
|
+
|
|
162
|
+
## Migration from Original TSIClient
|
|
163
|
+
|
|
164
|
+
If you're migrating from the original Microsoft `tsiclient` package:
|
|
165
|
+
|
|
166
|
+
1. **Package name change**: Update your imports from `tsiclient` to `@tsichart/core`
|
|
167
|
+
2. **No breaking changes to component APIs**: The chart components work the same way
|
|
168
|
+
3. **Remove server calls**: You'll need to handle data fetching yourself (Azure TSI service was retired)
|
|
169
|
+
4. **Update documentation references**: Use the new documentation instead of Azure TSI docs
|
|
170
|
+
- The `tsiClient.server` object and all related methods have been removed
|
|
171
|
+
- Focus is now exclusively on client-side visualization components
|
|
172
|
+
|
|
173
|
+
**Version 1.3.0:**
|
|
174
|
+
Starting with version 1.3.0, discrete events and state transitions will be represented just like numeric time series in the LineChart component. This may be a breaking change for users representing non-numeric series in the line chart using the "events" and "states" Chart Options. For usage instructions, consult [this example](https://tsiclientsample.azurewebsites.net/noauth/multipleseriestypes.html) and the associated [documentation](https://github.com/microsoft/tsiclient/blob/master/docs/UX.md#line-chart).
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
## Contributing
|
|
178
|
+
|
|
179
|
+
This project welcomes contributions and suggestions. Most contributions require you to agree to a
|
|
180
|
+
Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us
|
|
181
|
+
the rights to use your contribution. For details, visit https://cla.microsoft.com.
|
|
182
|
+
|
|
183
|
+
When you submit a pull request, a CLA-bot will automatically determine whether you need to provide
|
|
184
|
+
a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions
|
|
185
|
+
provided by the bot. You will only need to do this once across all repos using our CLA.
|
|
186
|
+
|
|
187
|
+
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
|
|
188
|
+
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or
|
|
189
|
+
contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
|