@operato/scene-scichart 8.0.0-beta.1 → 8.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.
@@ -1,51 +0,0 @@
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: 'scichart',
12
- label: '',
13
- name: 'chart'
14
- }
15
- ],
16
- help: 'scene/component/scichart-timeseries'
17
- }
18
-
19
- import './charts/ox-scichart'
20
-
21
- import { Component, HTMLOverlayContainer, Properties, ComponentNature, error } from '@hatiolab/things-scene'
22
-
23
- import { OxSciChart } from './charts/ox-scichart'
24
-
25
- export default class ScichartTimeSeries extends HTMLOverlayContainer {
26
- static get nature() {
27
- return NATURE
28
- }
29
-
30
- setElementProperties(scichart: OxSciChart) {
31
- const { data, chart } = this.state
32
-
33
- scichart.config = chart
34
- scichart.data = data
35
- }
36
-
37
- dispose() {
38
- super.dispose()
39
- ;(this.element as OxSciChart)?.dispose()
40
- }
41
-
42
- get tagName() {
43
- return 'ox-scichart'
44
- }
45
-
46
- async onchangeData(after: Properties, before: Properties): Promise<void> {
47
- ;(this.element as OxSciChart).data = this.data
48
- }
49
- }
50
-
51
- Component.register('scichart-timeseries', ScichartTimeSeries)
@@ -1,4 +0,0 @@
1
- import scichartTimeseries from './scichart-timeseries'
2
- import scichartMultipleTimeseries from './scichart-multiple-timeseries'
3
-
4
- export default [scichartTimeseries, scichartMultipleTimeseries]
@@ -1,87 +0,0 @@
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: []
86
- }
87
- }
@@ -1,73 +0,0 @@
1
- const icon = new URL('../../icons/scichart-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-timeseries',
32
- description: 'scichart-timeseries',
33
- /* line|shape|textAndMedia|chartAndGauge|table|container|dataSource|IoT|3D|warehouse|form|etc */
34
- group: 'chartAndGauge',
35
- icon,
36
- model: {
37
- type: 'scichart-timeseries',
38
- left: 10,
39
- top: 10,
40
- width: 400,
41
- height: 300,
42
- data,
43
- chart: {
44
- type: 'timeseries',
45
- data: {
46
- datasets: [
47
- {
48
- dataKey: 'count',
49
- label: '',
50
- type: 'line',
51
- borderWidth: 1
52
- }
53
- ],
54
- labelDataKey: 'timestamp'
55
- },
56
- options: {
57
- scales: {
58
- xAxes: [
59
- {
60
- ticks: { beginAtZero: true }
61
- }
62
- ],
63
- yAxes: [
64
- {
65
- ticks: { beginAtZero: true }
66
- }
67
- ]
68
- },
69
- legend: { display: true }
70
- }
71
- }
72
- }
73
- }
package/tsconfig.json DELETED
@@ -1,23 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "es2018",
4
- "module": "esnext",
5
- "moduleResolution": "node",
6
- "noEmitOnError": true,
7
- "lib": ["es2019", "dom"],
8
- "strict": true,
9
- "esModuleInterop": false,
10
- "allowJs": true,
11
- "allowSyntheticDefaultImports": true,
12
- "experimentalDecorators": true,
13
- "importHelpers": true,
14
- "outDir": "dist",
15
- "sourceMap": true,
16
- "inlineSources": true,
17
- "rootDir": "src",
18
- "skipLibCheck": true,
19
- "declaration": true,
20
- "incremental": true
21
- },
22
- "include": ["**/*.ts", "*.d.ts"]
23
- }