@operato/scene-scichart 7.0.5 → 7.1.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/CHANGELOG.md +19 -0
- package/db.sqlite +0 -0
- package/dist/charts/axis-synchronizer.d.ts +10 -0
- package/dist/charts/axis-synchronizer.js +32 -0
- package/dist/charts/axis-synchronizer.js.map +1 -0
- package/dist/charts/ox-scichart-multiple.d.ts +40 -0
- package/dist/charts/ox-scichart-multiple.js +272 -0
- package/dist/charts/ox-scichart-multiple.js.map +1 -0
- package/dist/charts/ox-scichart.d.ts +1 -1
- package/dist/charts/ox-scichart.js.map +1 -1
- package/dist/charts/scichart-builder.d.ts +10 -1
- package/dist/charts/scichart-builder.js +154 -12
- package/dist/charts/scichart-builder.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/scichart-multiple-timeseries.d.ts +14 -0
- package/dist/scichart-multiple-timeseries.js +60 -0
- package/dist/scichart-multiple-timeseries.js.map +1 -0
- package/dist/scichart-timeseries.d.ts +2 -11
- package/dist/scichart-timeseries.js +2 -42
- package/dist/scichart-timeseries.js.map +1 -1
- package/dist/templates/index.d.ts +2 -19
- package/dist/templates/index.js +2 -1
- package/dist/templates/index.js.map +1 -1
- package/dist/templates/scichart-multiple-timeseries.d.ts +53 -0
- package/dist/templates/scichart-multiple-timeseries.js +81 -0
- package/dist/templates/scichart-multiple-timeseries.js.map +1 -0
- package/dist/templates/scichart-timeseries.d.ts +2 -19
- package/dist/templates/scichart-timeseries.js +2 -19
- package/dist/templates/scichart-timeseries.js.map +1 -1
- package/helps/scene/component/scichart-multiple-timeseries.md +23 -0
- package/helps/scene/component/scichart-timeseries.md +18 -0
- package/icons/scichart-multiple-timeseries.png +0 -0
- package/logs/.08636eb59927f12972f6774f5947c8507b3564c2-audit.json +9 -9
- package/logs/.5e5d741d8b7784a2fbad65eedc0fd46946aaf6f2-audit.json +24 -9
- package/logs/{application-2024-07-08-22.log → application-2024-07-28-03.log} +9 -9
- package/logs/{application-2024-07-08-23.log → application-2024-07-28-17.log} +140 -43
- package/logs/{application-2024-07-09-15.log → application-2024-07-28-18.log} +18 -18
- package/logs/connections-2024-07-23-14.log +50 -0
- package/logs/connections-2024-07-25-23.log +50 -0
- package/logs/connections-2024-07-26-18.log +50 -0
- package/logs/connections-2024-07-28-03.log +50 -0
- package/logs/connections-2024-07-28-17.log +200 -0
- package/logs/connections-2024-07-28-18.log +100 -0
- package/package.json +2 -2
- package/schema.graphql +211 -0
- package/src/charts/axis-synchronizer.ts +37 -0
- package/src/charts/ox-scichart-multiple.ts +334 -0
- package/src/charts/ox-scichart.ts +1 -1
- package/src/charts/scichart-builder.ts +197 -11
- package/src/index.ts +1 -0
- package/src/scichart-multiple-timeseries.ts +74 -0
- package/src/scichart-timeseries.ts +3 -54
- package/src/templates/index.ts +2 -1
- package/src/templates/scichart-multiple-timeseries.ts +87 -0
- package/src/templates/scichart-timeseries.ts +2 -19
- package/things-scene.config.js +0 -2
- package/translations/en.json +3 -1
- package/translations/ja.json +3 -1
- package/translations/ko.json +3 -1
- package/translations/ms.json +3 -1
- package/translations/zh.json +3 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/cache/translations/system/en.json +0 -1
- package/cache/translations/system/ko.json +0 -1
- package/logs/connections-2024-07-08-22.log +0 -50
- package/logs/connections-2024-07-08-23.log +0 -100
- package/logs/connections-2024-07-09-15.log +0 -100
@@ -0,0 +1,74 @@
|
|
1
|
+
/*
|
2
|
+
* Copyright © HatioLab Inc. All rights reserved.
|
3
|
+
*/
|
4
|
+
|
5
|
+
const NATURE: ComponentNature = {
|
6
|
+
mutable: false,
|
7
|
+
resizable: true,
|
8
|
+
rotatable: true,
|
9
|
+
properties: [
|
10
|
+
{
|
11
|
+
type: 'boolean',
|
12
|
+
label: 'show-overview',
|
13
|
+
name: 'showOverview'
|
14
|
+
},
|
15
|
+
{
|
16
|
+
type: 'scichart',
|
17
|
+
label: '',
|
18
|
+
name: 'chart'
|
19
|
+
}
|
20
|
+
],
|
21
|
+
'value-property': 'visibleSeries',
|
22
|
+
help: 'scene/component/scichart-multiple-timeseries'
|
23
|
+
}
|
24
|
+
|
25
|
+
import './charts/ox-scichart-multiple'
|
26
|
+
|
27
|
+
import { Component, HTMLOverlayContainer, Properties, ComponentNature, error } from '@hatiolab/things-scene'
|
28
|
+
|
29
|
+
import { OxSciChartMultiple } from './charts/ox-scichart-multiple'
|
30
|
+
|
31
|
+
export default class ScichartMultipleTimeseries extends HTMLOverlayContainer {
|
32
|
+
static get nature() {
|
33
|
+
return NATURE
|
34
|
+
}
|
35
|
+
|
36
|
+
async oncreate_element(scichart: OxSciChartMultiple) {}
|
37
|
+
|
38
|
+
dispose() {
|
39
|
+
super.dispose()
|
40
|
+
}
|
41
|
+
|
42
|
+
setElementProperties(scichart: OxSciChartMultiple) {
|
43
|
+
const { data, chart, showOverview, visibleSeries } = this.state
|
44
|
+
|
45
|
+
scichart.config = chart
|
46
|
+
scichart.data = data
|
47
|
+
scichart.showOverview = showOverview
|
48
|
+
scichart.visibleSeries = visibleSeries || []
|
49
|
+
}
|
50
|
+
|
51
|
+
reposition() {
|
52
|
+
super.reposition()
|
53
|
+
}
|
54
|
+
|
55
|
+
get tagName() {
|
56
|
+
return 'ox-scichart-multiple'
|
57
|
+
}
|
58
|
+
|
59
|
+
get visibleSeries() {
|
60
|
+
const { visibleSeries } = this.state
|
61
|
+
return visibleSeries || []
|
62
|
+
}
|
63
|
+
|
64
|
+
set visibleSeries(visibleSeries: string[]) {
|
65
|
+
this.setState('visibleSeries', visibleSeries)
|
66
|
+
;(this.element as OxSciChartMultiple).visibleSeries = visibleSeries
|
67
|
+
}
|
68
|
+
|
69
|
+
async onchangeData(after: Properties, before: Properties): Promise<void> {
|
70
|
+
;(this.element as OxSciChartMultiple).data = this.data
|
71
|
+
}
|
72
|
+
}
|
73
|
+
|
74
|
+
Component.register('scichart-multiple-timeseries', ScichartMultipleTimeseries)
|
@@ -2,7 +2,7 @@
|
|
2
2
|
* Copyright © HatioLab Inc. All rights reserved.
|
3
3
|
*/
|
4
4
|
|
5
|
-
const NATURE = {
|
5
|
+
const NATURE: ComponentNature = {
|
6
6
|
mutable: false,
|
7
7
|
resizable: true,
|
8
8
|
rotatable: true,
|
@@ -12,7 +12,8 @@ const NATURE = {
|
|
12
12
|
label: '',
|
13
13
|
name: 'chart'
|
14
14
|
}
|
15
|
-
]
|
15
|
+
],
|
16
|
+
help: 'scene/component/scichart-timeseries'
|
16
17
|
}
|
17
18
|
|
18
19
|
import './charts/ox-scichart'
|
@@ -43,58 +44,6 @@ export default class ScichartTimeSeries extends HTMLOverlayContainer {
|
|
43
44
|
super.reposition()
|
44
45
|
}
|
45
46
|
|
46
|
-
// get dataSet(): { xValue: number; yValue: number }[] {
|
47
|
-
// var { attrX, attrY, data } = this.state
|
48
|
-
|
49
|
-
// if (!(data instanceof Array)) {
|
50
|
-
// return []
|
51
|
-
// }
|
52
|
-
|
53
|
-
// return data
|
54
|
-
// .map((item, i) => {
|
55
|
-
// if (!item || typeof item !== 'object') {
|
56
|
-
// return
|
57
|
-
// }
|
58
|
-
|
59
|
-
// console.log('Data item:', item) // 데이터 항목을 로그로 출력
|
60
|
-
// const xValue = new Date(item[attrX])
|
61
|
-
// console.log('Parsed Date:', xValue) // 파싱된 날짜를 로그로 출력
|
62
|
-
// if (isNaN(xValue.getTime())) {
|
63
|
-
// console.error('Invalid date:', item[attrX]) // 유효하지 않은 날짜를 로그로 출력
|
64
|
-
// return
|
65
|
-
// }
|
66
|
-
|
67
|
-
// return {
|
68
|
-
// xValue: xValue.getTime() / 1000, // 타임스탬프를 초 단위로 변환
|
69
|
-
// yValue: item[attrY]
|
70
|
-
// }
|
71
|
-
// })
|
72
|
-
// .filter(Boolean) as { xValue: number; yValue: number }[]
|
73
|
-
// }
|
74
|
-
|
75
|
-
// async onchangeData(after: Properties, before: Properties): Promise<void> {
|
76
|
-
// console.log('onchangeData called') // 데이터 변경 시 로그 출력
|
77
|
-
// this.updateDataSeries()
|
78
|
-
// this.surface?.sciChartSurface.zoomExtents()
|
79
|
-
// }
|
80
|
-
|
81
|
-
// updateDataSeries() {
|
82
|
-
// if (!this.dataSeries) return
|
83
|
-
|
84
|
-
// this.dataSeries.clear()
|
85
|
-
// const newData = this.dataSet
|
86
|
-
|
87
|
-
// console.log('Updating data series with:', newData) // 새 데이터 로그 출력
|
88
|
-
|
89
|
-
// this.dataSeries.appendRange(
|
90
|
-
// newData.map(d => d.xValue), // Date 객체를 타임스탬프로 변환
|
91
|
-
// newData.map(d => d.yValue)
|
92
|
-
// )
|
93
|
-
|
94
|
-
// this.surface?.sciChartSurface.zoomExtents() // 데이터 변경 후 영역 조정
|
95
|
-
// this.surface?.sciChartSurface.invalidateElement() // 차트를 다시 그리도록 요청
|
96
|
-
// }
|
97
|
-
|
98
47
|
get tagName() {
|
99
48
|
return 'ox-scichart'
|
100
49
|
}
|
package/src/templates/index.ts
CHANGED
@@ -0,0 +1,87 @@
|
|
1
|
+
const icon = new URL('../../icons/scichart-multiple-timeseries.png', import.meta.url).href
|
2
|
+
|
3
|
+
function getRandomInRange(min: number, max: number) {
|
4
|
+
return Math.floor(Math.random() * (max - min + 1)) + min
|
5
|
+
}
|
6
|
+
|
7
|
+
// 랜덤 데이터를 생성하는 함수
|
8
|
+
function generateRandomData(count: number) {
|
9
|
+
const randomData = []
|
10
|
+
const startTimestamp = Math.floor(Date.now()) // 현재 시간을 Unix 타임스탬프로 설정
|
11
|
+
|
12
|
+
for (let i = 0; i < count; i++) {
|
13
|
+
const timestamp = startTimestamp + i * 360 * 30 * 1000 // 3초씩 증가하는 타임스탬프 설정
|
14
|
+
const randomCount = getRandomInRange(5, 35) // count 값을 5에서 35 사이로 랜덤 생성
|
15
|
+
const randomAverage = getRandomInRange(50, 150) // average 값을 50에서 150 사이로 랜덤 생성
|
16
|
+
|
17
|
+
randomData.push({
|
18
|
+
timestamp: timestamp,
|
19
|
+
count: randomCount,
|
20
|
+
average: randomAverage
|
21
|
+
})
|
22
|
+
}
|
23
|
+
|
24
|
+
return randomData
|
25
|
+
}
|
26
|
+
|
27
|
+
// 100개의 랜덤 데이터를 생성
|
28
|
+
const data = generateRandomData(100)
|
29
|
+
|
30
|
+
export default {
|
31
|
+
type: 'scichart-multiple-timeseries',
|
32
|
+
description: 'scichart-multiple-timeseries',
|
33
|
+
/* line|shape|textAndMedia|chartAndGauge|table|container|dataSource|IoT|3D|warehouse|form|etc */
|
34
|
+
group: 'chartAndGauge',
|
35
|
+
icon,
|
36
|
+
model: {
|
37
|
+
type: 'scichart-multiple-timeseries',
|
38
|
+
left: 10,
|
39
|
+
top: 10,
|
40
|
+
width: 600,
|
41
|
+
height: 60,
|
42
|
+
data,
|
43
|
+
chart: {
|
44
|
+
type: 'timeseries',
|
45
|
+
data: {
|
46
|
+
datasets: [
|
47
|
+
{
|
48
|
+
dataKey: 'count',
|
49
|
+
label: '',
|
50
|
+
type: 'line',
|
51
|
+
borderWidth: 1,
|
52
|
+
color: 'green'
|
53
|
+
},
|
54
|
+
{
|
55
|
+
dataKey: 'average',
|
56
|
+
label: '',
|
57
|
+
type: 'line',
|
58
|
+
borderWidth: 1,
|
59
|
+
color: 'red'
|
60
|
+
}
|
61
|
+
],
|
62
|
+
labelDataKey: 'timestamp'
|
63
|
+
},
|
64
|
+
options: {
|
65
|
+
scales: {
|
66
|
+
xAxes: [
|
67
|
+
{
|
68
|
+
ticks: { beginAtZero: true }
|
69
|
+
}
|
70
|
+
],
|
71
|
+
yAxes: [
|
72
|
+
{
|
73
|
+
ticks: { beginAtZero: true }
|
74
|
+
}
|
75
|
+
]
|
76
|
+
},
|
77
|
+
legend: {
|
78
|
+
display: false
|
79
|
+
},
|
80
|
+
annotations: [],
|
81
|
+
tooltip: true
|
82
|
+
}
|
83
|
+
},
|
84
|
+
showOverview: true,
|
85
|
+
visibleSeries: ['count', 'average']
|
86
|
+
}
|
87
|
+
}
|
@@ -41,25 +41,14 @@ export default {
|
|
41
41
|
height: 300,
|
42
42
|
data,
|
43
43
|
chart: {
|
44
|
-
type: '
|
44
|
+
type: 'timeseries',
|
45
45
|
data: {
|
46
46
|
datasets: [
|
47
47
|
{
|
48
48
|
dataKey: 'count',
|
49
|
-
label: '
|
49
|
+
label: '',
|
50
50
|
type: 'line',
|
51
|
-
color: 'rgba(255, 99, 132, 1)',
|
52
51
|
borderWidth: 1
|
53
|
-
},
|
54
|
-
{
|
55
|
-
dataKey: 'average',
|
56
|
-
label: 'Line Series average',
|
57
|
-
type: 'line',
|
58
|
-
color: 'rgba(54, 162, 235, 1)',
|
59
|
-
fill: false,
|
60
|
-
lineTension: 0.4,
|
61
|
-
pointStyle: 'circle',
|
62
|
-
pointRadius: 3
|
63
52
|
}
|
64
53
|
],
|
65
54
|
labelDataKey: 'timestamp'
|
@@ -68,17 +57,11 @@ export default {
|
|
68
57
|
scales: {
|
69
58
|
xAxes: [
|
70
59
|
{
|
71
|
-
axisTitle: 'timestamp',
|
72
60
|
ticks: { beginAtZero: true }
|
73
61
|
}
|
74
62
|
],
|
75
63
|
yAxes: [
|
76
64
|
{
|
77
|
-
axisTitle: 'count',
|
78
|
-
ticks: { beginAtZero: true }
|
79
|
-
},
|
80
|
-
{
|
81
|
-
axisTitle: 'average',
|
82
65
|
ticks: { beginAtZero: true }
|
83
66
|
}
|
84
67
|
]
|
package/things-scene.config.js
CHANGED
package/translations/en.json
CHANGED
package/translations/ja.json
CHANGED
package/translations/ko.json
CHANGED
package/translations/ms.json
CHANGED
package/translations/zh.json
CHANGED