@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.
Files changed (69) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/db.sqlite +0 -0
  3. package/dist/charts/axis-synchronizer.d.ts +10 -0
  4. package/dist/charts/axis-synchronizer.js +32 -0
  5. package/dist/charts/axis-synchronizer.js.map +1 -0
  6. package/dist/charts/ox-scichart-multiple.d.ts +40 -0
  7. package/dist/charts/ox-scichart-multiple.js +272 -0
  8. package/dist/charts/ox-scichart-multiple.js.map +1 -0
  9. package/dist/charts/ox-scichart.d.ts +1 -1
  10. package/dist/charts/ox-scichart.js.map +1 -1
  11. package/dist/charts/scichart-builder.d.ts +10 -1
  12. package/dist/charts/scichart-builder.js +154 -12
  13. package/dist/charts/scichart-builder.js.map +1 -1
  14. package/dist/index.d.ts +1 -0
  15. package/dist/index.js +1 -0
  16. package/dist/index.js.map +1 -1
  17. package/dist/scichart-multiple-timeseries.d.ts +14 -0
  18. package/dist/scichart-multiple-timeseries.js +60 -0
  19. package/dist/scichart-multiple-timeseries.js.map +1 -0
  20. package/dist/scichart-timeseries.d.ts +2 -11
  21. package/dist/scichart-timeseries.js +2 -42
  22. package/dist/scichart-timeseries.js.map +1 -1
  23. package/dist/templates/index.d.ts +2 -19
  24. package/dist/templates/index.js +2 -1
  25. package/dist/templates/index.js.map +1 -1
  26. package/dist/templates/scichart-multiple-timeseries.d.ts +53 -0
  27. package/dist/templates/scichart-multiple-timeseries.js +81 -0
  28. package/dist/templates/scichart-multiple-timeseries.js.map +1 -0
  29. package/dist/templates/scichart-timeseries.d.ts +2 -19
  30. package/dist/templates/scichart-timeseries.js +2 -19
  31. package/dist/templates/scichart-timeseries.js.map +1 -1
  32. package/helps/scene/component/scichart-multiple-timeseries.md +23 -0
  33. package/helps/scene/component/scichart-timeseries.md +18 -0
  34. package/icons/scichart-multiple-timeseries.png +0 -0
  35. package/logs/.08636eb59927f12972f6774f5947c8507b3564c2-audit.json +9 -9
  36. package/logs/.5e5d741d8b7784a2fbad65eedc0fd46946aaf6f2-audit.json +24 -9
  37. package/logs/{application-2024-07-08-22.log → application-2024-07-28-03.log} +9 -9
  38. package/logs/{application-2024-07-08-23.log → application-2024-07-28-17.log} +140 -43
  39. package/logs/{application-2024-07-09-15.log → application-2024-07-28-18.log} +18 -18
  40. package/logs/connections-2024-07-23-14.log +50 -0
  41. package/logs/connections-2024-07-25-23.log +50 -0
  42. package/logs/connections-2024-07-26-18.log +50 -0
  43. package/logs/connections-2024-07-28-03.log +50 -0
  44. package/logs/connections-2024-07-28-17.log +200 -0
  45. package/logs/connections-2024-07-28-18.log +100 -0
  46. package/package.json +2 -2
  47. package/schema.graphql +211 -0
  48. package/src/charts/axis-synchronizer.ts +37 -0
  49. package/src/charts/ox-scichart-multiple.ts +334 -0
  50. package/src/charts/ox-scichart.ts +1 -1
  51. package/src/charts/scichart-builder.ts +197 -11
  52. package/src/index.ts +1 -0
  53. package/src/scichart-multiple-timeseries.ts +74 -0
  54. package/src/scichart-timeseries.ts +3 -54
  55. package/src/templates/index.ts +2 -1
  56. package/src/templates/scichart-multiple-timeseries.ts +87 -0
  57. package/src/templates/scichart-timeseries.ts +2 -19
  58. package/things-scene.config.js +0 -2
  59. package/translations/en.json +3 -1
  60. package/translations/ja.json +3 -1
  61. package/translations/ko.json +3 -1
  62. package/translations/ms.json +3 -1
  63. package/translations/zh.json +3 -1
  64. package/tsconfig.tsbuildinfo +1 -1
  65. package/cache/translations/system/en.json +0 -1
  66. package/cache/translations/system/ko.json +0 -1
  67. package/logs/connections-2024-07-08-22.log +0 -50
  68. package/logs/connections-2024-07-08-23.log +0 -100
  69. 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
  }
@@ -1,3 +1,4 @@
1
1
  import scichartTimeseries from './scichart-timeseries'
2
+ import scichartMultipleTimeseries from './scichart-multiple-timeseries'
2
3
 
3
- export default [scichartTimeseries]
4
+ export default [scichartTimeseries, scichartMultipleTimeseries]
@@ -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: 'line' /* TODO change to 'timeseries' */,
44
+ type: 'timeseries',
45
45
  data: {
46
46
  datasets: [
47
47
  {
48
48
  dataKey: 'count',
49
- label: 'Line Series count',
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
  ]
@@ -1,9 +1,7 @@
1
1
  import editors from './dist/editors'
2
- // import groups from './dist/groups'
3
2
  import templates from './dist/templates'
4
3
 
5
4
  export default {
6
5
  templates,
7
6
  editors
8
- // groups
9
7
  }
@@ -1,3 +1,5 @@
1
1
  {
2
- "component.scichart-timeseries": "timeseries scichart"
2
+ "component.scichart-timeseries": "timeseries",
3
+ "component.scichart-multiple-timeseries": "multiple timeseries",
4
+ "label.show-overview": "show overview"
3
5
  }
@@ -1,3 +1,5 @@
1
1
  {
2
- "component.scichart-timeseries": "タイムシリーズ scichart"
2
+ "component.scichart-timeseries": "タイムシリーズ",
3
+ "component.scichart-multiple-timeseries": "マルチチャート タイムシリーズ",
4
+ "label.show-overview": "概要 表示"
3
5
  }
@@ -1,3 +1,5 @@
1
1
  {
2
- "component.scichart-timeseries": "타임시리즈 scichart"
2
+ "component.scichart-timeseries": "타임시리즈",
3
+ "component.scichart-multiple-timeseries": "다중차트 타임시리즈",
4
+ "label.show-overview": "오버뷰 보이기"
3
5
  }
@@ -1,3 +1,5 @@
1
1
  {
2
- "component.scichart-timeseries": "timeseries scichart"
2
+ "component.scichart-timeseries": "siri masa",
3
+ "component.scichart-multiple-timeseries": "masa siri berbilang carta",
4
+ "label.show-overview": "tunjukkan gambaran keseluruhan"
3
5
  }
@@ -1,3 +1,5 @@
1
1
  {
2
- "component.scichart-timeseries": "时间序列 scichart"
2
+ "component.scichart-timeseries": "时间序列",
3
+ "component.scichart-multiple-timeseries": "多图表 时间序列",
4
+ "label.show-overview": "显示 概述"
3
5
  }