@operato/scene-scichart 8.0.0-alpha.1 → 8.0.0-alpha.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (31) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/db.sqlite +0 -0
  3. package/dist/charts/ox-scichart-multiple.d.ts +1 -0
  4. package/dist/charts/ox-scichart-multiple.js +23 -0
  5. package/dist/charts/ox-scichart-multiple.js.map +1 -1
  6. package/dist/charts/ox-scichart.d.ts +1 -0
  7. package/dist/charts/ox-scichart.js +14 -0
  8. package/dist/charts/ox-scichart.js.map +1 -1
  9. package/dist/charts/scichart-builder.js +44 -1
  10. package/dist/charts/scichart-builder.js.map +1 -1
  11. package/dist/scichart-multiple-timeseries.d.ts +1 -0
  12. package/dist/scichart-multiple-timeseries.js +5 -0
  13. package/dist/scichart-multiple-timeseries.js.map +1 -1
  14. package/dist/scichart-timeseries.d.ts +1 -0
  15. package/dist/scichart-timeseries.js +5 -0
  16. package/dist/scichart-timeseries.js.map +1 -1
  17. package/logs/.08636eb59927f12972f6774f5947c8507b3564c2-audit.json +3 -8
  18. package/logs/.5e5d741d8b7784a2fbad65eedc0fd46946aaf6f2-audit.json +3 -8
  19. package/logs/{application-2024-08-26-00.log → application-2024-09-10-23.log} +8 -10
  20. package/logs/connections-2024-09-10-23.log +50 -0
  21. package/package.json +2 -2
  22. package/schema.graphql +3 -0
  23. package/src/charts/ox-scichart-multiple.ts +28 -0
  24. package/src/charts/ox-scichart.ts +16 -0
  25. package/src/charts/scichart-builder.ts +47 -2
  26. package/src/scichart-multiple-timeseries.ts +5 -0
  27. package/src/scichart-timeseries.ts +5 -0
  28. package/tsconfig.tsbuildinfo +1 -1
  29. package/logs/application-2024-08-26-01.log +0 -317
  30. package/logs/connections-2024-08-26-00.log +0 -50
  31. package/logs/connections-2024-08-26-01.log +0 -150
@@ -1 +1 @@
1
- {"version":3,"file":"scichart-timeseries.js","sourceRoot":"","sources":["../src/scichart-timeseries.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,MAAM,GAAoB;IAC9B,OAAO,EAAE,KAAK;IACd,SAAS,EAAE,IAAI;IACf,SAAS,EAAE,IAAI;IACf,UAAU,EAAE;QACV;YACE,IAAI,EAAE,UAAU;YAChB,KAAK,EAAE,EAAE;YACT,IAAI,EAAE,OAAO;SACd;KACF;IACD,IAAI,EAAE,qCAAqC;CAC5C,CAAA;AAED,OAAO,sBAAsB,CAAA;AAE7B,OAAO,EAAE,SAAS,EAAE,oBAAoB,EAAsC,MAAM,wBAAwB,CAAA;AAI5G,MAAM,CAAC,OAAO,OAAO,kBAAmB,SAAQ,oBAAoB;IAClE,MAAM,KAAK,MAAM;QACf,OAAO,MAAM,CAAA;IACf,CAAC;IAED,oBAAoB,CAAC,QAAoB;QACvC,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC,KAAK,CAAA;QAElC,QAAQ,CAAC,MAAM,GAAG,KAAK,CAAA;QACvB,QAAQ,CAAC,IAAI,GAAG,IAAI,CAAA;IACtB,CAAC;IAED,IAAI,OAAO;QACT,OAAO,aAAa,CAAA;IACtB,CAAC;IAED,KAAK,CAAC,YAAY,CAAC,KAAiB,EAAE,MAAkB;QACtD,CAAC;QAAC,IAAI,CAAC,OAAsB,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAA;IAChD,CAAC;CACF;AAED,SAAS,CAAC,QAAQ,CAAC,qBAAqB,EAAE,kBAAkB,CAAC,CAAA","sourcesContent":["/*\n * Copyright © HatioLab Inc. All rights reserved.\n */\n\nconst NATURE: ComponentNature = {\n mutable: false,\n resizable: true,\n rotatable: true,\n properties: [\n {\n type: 'scichart',\n label: '',\n name: 'chart'\n }\n ],\n help: 'scene/component/scichart-timeseries'\n}\n\nimport './charts/ox-scichart'\n\nimport { Component, HTMLOverlayContainer, Properties, ComponentNature, error } from '@hatiolab/things-scene'\n\nimport { OxSciChart } from './charts/ox-scichart'\n\nexport default class ScichartTimeSeries extends HTMLOverlayContainer {\n static get nature() {\n return NATURE\n }\n\n setElementProperties(scichart: OxSciChart) {\n const { data, chart } = this.state\n\n scichart.config = chart\n scichart.data = data\n }\n\n get tagName() {\n return 'ox-scichart'\n }\n\n async onchangeData(after: Properties, before: Properties): Promise<void> {\n ;(this.element as OxSciChart).data = this.data\n }\n}\n\nComponent.register('scichart-timeseries', ScichartTimeSeries)\n"]}
1
+ {"version":3,"file":"scichart-timeseries.js","sourceRoot":"","sources":["../src/scichart-timeseries.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,MAAM,GAAoB;IAC9B,OAAO,EAAE,KAAK;IACd,SAAS,EAAE,IAAI;IACf,SAAS,EAAE,IAAI;IACf,UAAU,EAAE;QACV;YACE,IAAI,EAAE,UAAU;YAChB,KAAK,EAAE,EAAE;YACT,IAAI,EAAE,OAAO;SACd;KACF;IACD,IAAI,EAAE,qCAAqC;CAC5C,CAAA;AAED,OAAO,sBAAsB,CAAA;AAE7B,OAAO,EAAE,SAAS,EAAE,oBAAoB,EAAsC,MAAM,wBAAwB,CAAA;AAI5G,MAAM,CAAC,OAAO,OAAO,kBAAmB,SAAQ,oBAAoB;IAClE,MAAM,KAAK,MAAM;QACf,OAAO,MAAM,CAAA;IACf,CAAC;IAED,oBAAoB,CAAC,QAAoB;QACvC,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC,KAAK,CAAA;QAElC,QAAQ,CAAC,MAAM,GAAG,KAAK,CAAA;QACvB,QAAQ,CAAC,IAAI,GAAG,IAAI,CAAA;IACtB,CAAC;IAED,OAAO;;QACL,KAAK,CAAC,OAAO,EAAE,CACd;QAAA,MAAC,IAAI,CAAC,OAAsB,0CAAE,OAAO,EAAE,CAAA;IAC1C,CAAC;IAED,IAAI,OAAO;QACT,OAAO,aAAa,CAAA;IACtB,CAAC;IAED,KAAK,CAAC,YAAY,CAAC,KAAiB,EAAE,MAAkB;QACtD,CAAC;QAAC,IAAI,CAAC,OAAsB,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAA;IAChD,CAAC;CACF;AAED,SAAS,CAAC,QAAQ,CAAC,qBAAqB,EAAE,kBAAkB,CAAC,CAAA","sourcesContent":["/*\n * Copyright © HatioLab Inc. All rights reserved.\n */\n\nconst NATURE: ComponentNature = {\n mutable: false,\n resizable: true,\n rotatable: true,\n properties: [\n {\n type: 'scichart',\n label: '',\n name: 'chart'\n }\n ],\n help: 'scene/component/scichart-timeseries'\n}\n\nimport './charts/ox-scichart'\n\nimport { Component, HTMLOverlayContainer, Properties, ComponentNature, error } from '@hatiolab/things-scene'\n\nimport { OxSciChart } from './charts/ox-scichart'\n\nexport default class ScichartTimeSeries extends HTMLOverlayContainer {\n static get nature() {\n return NATURE\n }\n\n setElementProperties(scichart: OxSciChart) {\n const { data, chart } = this.state\n\n scichart.config = chart\n scichart.data = data\n }\n\n dispose() {\n super.dispose()\n ;(this.element as OxSciChart)?.dispose()\n }\n\n get tagName() {\n return 'ox-scichart'\n }\n\n async onchangeData(after: Properties, before: Properties): Promise<void> {\n ;(this.element as OxSciChart).data = this.data\n }\n}\n\nComponent.register('scichart-timeseries', ScichartTimeSeries)\n"]}
@@ -6,14 +6,9 @@
6
6
  "auditLog": "logs/.08636eb59927f12972f6774f5947c8507b3564c2-audit.json",
7
7
  "files": [
8
8
  {
9
- "date": 1724601435254,
10
- "name": "logs/application-2024-08-26-00.log",
11
- "hash": "4037025dba777894c55d5e4bc59e2297e1cd91be6e074c7f25426dddd97cbf7f"
12
- },
13
- {
14
- "date": 1724602619802,
15
- "name": "logs/application-2024-08-26-01.log",
16
- "hash": "a45c28889264712cfec060e8532b121389ad61ae766bd58a89c1856b1c862cb0"
9
+ "date": 1725979234139,
10
+ "name": "logs/application-2024-09-10-23.log",
11
+ "hash": "07d6de8388f92f930a04a82a8ee25b42aadc7af7a6a82b9a930afb68092e3c5f"
17
12
  }
18
13
  ],
19
14
  "hashType": "sha256"
@@ -6,14 +6,9 @@
6
6
  "auditLog": "logs/.5e5d741d8b7784a2fbad65eedc0fd46946aaf6f2-audit.json",
7
7
  "files": [
8
8
  {
9
- "date": 1724601437458,
10
- "name": "logs/connections-2024-08-26-00.log",
11
- "hash": "42a9ee628c97878de90cea6a346c8dac1603315c6e452c62ff3752fb5796cc66"
12
- },
13
- {
14
- "date": 1724602621749,
15
- "name": "logs/connections-2024-08-26-01.log",
16
- "hash": "a876641c5f2acc2c321351501cc4b653934383a4505bf6553d9b98a295344435"
9
+ "date": 1725979235985,
10
+ "name": "logs/connections-2024-09-10-23.log",
11
+ "hash": "b919c1329e044407cdbe5bf3a4aa6f9a323695bdea96001c3d4abf922566ad11"
17
12
  }
18
13
  ],
19
14
  "hashType": "sha256"
@@ -1,5 +1,5 @@
1
- 2024-08-26T00:57:16+09:00 info: File Storage is Ready.
2
- 2024-08-26T00:57:17+09:00 error: Error: Cannot find module 'oracledb'
1
+ 2024-09-10T23:40:35+09:00 info: File Storage is Ready.
2
+ 2024-09-10T23:40:36+09:00 error: Error: Cannot find module 'oracledb'
3
3
  Require stack:
4
4
  - /Users/super/Documents/GitHub/operato-scene/node_modules/@things-factory/integration-base/dist-server/engine/connector/oracle-connector.js
5
5
  - /Users/super/Documents/GitHub/operato-scene/node_modules/@things-factory/integration-base/dist-server/engine/connector/index.js
@@ -25,7 +25,7 @@ Require stack:
25
25
  at Module._extensions..js (node:internal/modules/cjs/loader:1416:10)
26
26
  at Module.load (node:internal/modules/cjs/loader:1208:32)
27
27
  at Module._load (node:internal/modules/cjs/loader:1024:12)
28
- 2024-08-26T00:57:18+09:00 error: Error: Cannot find module 'oracledb'
28
+ 2024-09-10T23:40:36+09:00 error: Error: Cannot find module 'oracledb'
29
29
  Require stack:
30
30
  - /Users/super/Documents/GitHub/operato-scene/node_modules/@things-factory/integration-base/dist-server/engine/task/oracle-procedure.js
31
31
  - /Users/super/Documents/GitHub/operato-scene/node_modules/@things-factory/integration-base/dist-server/engine/task/index.js
@@ -51,7 +51,7 @@ Require stack:
51
51
  at Module._extensions..js (node:internal/modules/cjs/loader:1416:10)
52
52
  at Module.load (node:internal/modules/cjs/loader:1208:32)
53
53
  at Module._load (node:internal/modules/cjs/loader:1024:12)
54
- 2024-08-26T00:57:18+09:00 error: Error: Cannot find module '@thiagoelg/node-printer'
54
+ 2024-09-10T23:40:36+09:00 error: Error: Cannot find module '@thiagoelg/node-printer'
55
55
  Require stack:
56
56
  - /Users/super/Documents/GitHub/operato-scene/node_modules/@things-factory/board-service/dist-server/controllers/print.js
57
57
  - /Users/super/Documents/GitHub/operato-scene/node_modules/@things-factory/board-service/dist-server/controllers/index.js
@@ -76,7 +76,7 @@ Require stack:
76
76
  at Module._extensions..js (node:internal/modules/cjs/loader:1416:10)
77
77
  at Module.load (node:internal/modules/cjs/loader:1208:32)
78
78
  at Module._load (node:internal/modules/cjs/loader:1024:12)
79
- 2024-08-26T00:57:18+09:00 error: Error: Cannot find module '@thiagoelg/node-printer'
79
+ 2024-09-10T23:40:36+09:00 error: Error: Cannot find module '@thiagoelg/node-printer'
80
80
  Require stack:
81
81
  - /Users/super/Documents/GitHub/operato-scene/node_modules/@things-factory/print-service/dist-server/middlewares/index.js
82
82
  - /Users/super/Documents/GitHub/operato-scene/node_modules/@things-factory/print-service/dist-server/index.js
@@ -100,8 +100,6 @@ Require stack:
100
100
  at Module._extensions..js (node:internal/modules/cjs/loader:1416:10)
101
101
  at Module.load (node:internal/modules/cjs/loader:1208:32)
102
102
  at Module._load (node:internal/modules/cjs/loader:1024:12)
103
- 2024-08-26T00:57:19+09:00 info: Default DataSource established
104
- 2024-08-26T00:57:20+09:00 info: 🚀 Server ready at http://0.0.0.0:3000/graphql
105
- 2024-08-26T00:57:20+09:00 info: 🚀 Subscriptions ready at ws://0.0.0.0:3000/graphql
106
- 2024-08-26T00:59:44+09:00 error: Error: read ECONNRESET
107
- at TCP.onStreamRead (node:internal/stream_base_commons:218:20)
103
+ 2024-09-10T23:40:37+09:00 info: Default DataSource established
104
+ 2024-09-10T23:40:38+09:00 info: 🚀 Server ready at http://0.0.0.0:3000/graphql
105
+ 2024-09-10T23:40:38+09:00 info: 🚀 Subscriptions ready at ws://0.0.0.0:3000/graphql
@@ -0,0 +1,50 @@
1
+ 2024-09-10T23:40:38+09:00 info: Initializing ConnectionManager...
2
+ 2024-09-10T23:40:38+09:00 info: Connector 'echo-back-server' started to ready
3
+ 2024-09-10T23:40:38+09:00 info: Connector 'echo-back' started to ready
4
+ 2024-09-10T23:40:38+09:00 info: Connector 'http-connector' started to ready
5
+ 2024-09-10T23:40:38+09:00 info: Connector 'graphql-connector' started to ready
6
+ 2024-09-10T23:40:38+09:00 info: Connector 'sqlite-connector' started to ready
7
+ 2024-09-10T23:40:38+09:00 info: Connector 'postgresql-connector' started to ready
8
+ 2024-09-10T23:40:38+09:00 info: Connector 'mqtt-connector' started to ready
9
+ 2024-09-10T23:40:38+09:00 info: Connector 'mssql-connector' started to ready
10
+ 2024-09-10T23:40:38+09:00 info: Connector 'oracle-connector' started to ready
11
+ 2024-09-10T23:40:38+09:00 info: Connector 'mysql-connector' started to ready
12
+ 2024-09-10T23:40:38+09:00 info: Connector 'socket-server' started to ready
13
+ 2024-09-10T23:40:38+09:00 info: Connector 'operato-connector' started to ready
14
+ 2024-09-10T23:40:38+09:00 info: Connector 'email-connector' started to ready
15
+ 2024-09-10T23:40:38+09:00 info: Connector 'influxdb-connector' started to ready
16
+ 2024-09-10T23:40:38+09:00 info: Connector 'msgraph-connector' started to ready
17
+ 2024-09-10T23:40:38+09:00 info: Connector 'proxy-connector' started to ready
18
+ 2024-09-10T23:40:38+09:00 info: echo-back-servers are ready
19
+ 2024-09-10T23:40:38+09:00 info: echo-back connections are ready
20
+ 2024-09-10T23:40:38+09:00 info: http-connector connections are ready
21
+ 2024-09-10T23:40:38+09:00 info: graphql-connector connections are ready
22
+ 2024-09-10T23:40:38+09:00 info: sqlite-connector connections are ready
23
+ 2024-09-10T23:40:38+09:00 info: postgresql-connector connections are ready
24
+ 2024-09-10T23:40:38+09:00 info: mqtt-connector connections are ready
25
+ 2024-09-10T23:40:38+09:00 info: mssql-connector connections are ready
26
+ 2024-09-10T23:40:38+09:00 info: oracle-connector connections are ready
27
+ 2024-09-10T23:40:38+09:00 info: mysql-connector connections are ready
28
+ 2024-09-10T23:40:38+09:00 info: socket servers are ready
29
+ 2024-09-10T23:40:38+09:00 info: operato-connector connections are ready
30
+ 2024-09-10T23:40:38+09:00 info: email connections are ready
31
+ 2024-09-10T23:40:38+09:00 info: influxdb connections are ready
32
+ 2024-09-10T23:40:38+09:00 info: msgraph-connector connections are ready
33
+ 2024-09-10T23:40:38+09:00 info: proxy-connector connections are ready
34
+ 2024-09-10T23:40:38+09:00 info: All connector for 'echo-back-server' ready
35
+ 2024-09-10T23:40:38+09:00 info: All connector for 'echo-back' ready
36
+ 2024-09-10T23:40:38+09:00 info: All connector for 'http-connector' ready
37
+ 2024-09-10T23:40:38+09:00 info: All connector for 'graphql-connector' ready
38
+ 2024-09-10T23:40:38+09:00 info: All connector for 'sqlite-connector' ready
39
+ 2024-09-10T23:40:38+09:00 info: All connector for 'postgresql-connector' ready
40
+ 2024-09-10T23:40:38+09:00 info: All connector for 'mqtt-connector' ready
41
+ 2024-09-10T23:40:38+09:00 info: All connector for 'mssql-connector' ready
42
+ 2024-09-10T23:40:38+09:00 info: All connector for 'oracle-connector' ready
43
+ 2024-09-10T23:40:38+09:00 info: All connector for 'mysql-connector' ready
44
+ 2024-09-10T23:40:38+09:00 info: All connector for 'socket-server' ready
45
+ 2024-09-10T23:40:38+09:00 info: All connector for 'operato-connector' ready
46
+ 2024-09-10T23:40:38+09:00 info: All connector for 'email-connector' ready
47
+ 2024-09-10T23:40:38+09:00 info: All connector for 'influxdb-connector' ready
48
+ 2024-09-10T23:40:38+09:00 info: All connector for 'msgraph-connector' ready
49
+ 2024-09-10T23:40:38+09:00 info: All connector for 'proxy-connector' ready
50
+ 2024-09-10T23:40:38+09:00 info: ConnectionManager initialization done:
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@operato/scene-scichart",
3
3
  "description": "scichart wrapping component",
4
- "version": "8.0.0-alpha.1",
4
+ "version": "8.0.0-alpha.5",
5
5
  "license": "MIT",
6
6
  "things-scene": true,
7
7
  "author": "heartyoh",
@@ -59,5 +59,5 @@
59
59
  "prettier --write"
60
60
  ]
61
61
  },
62
- "gitHead": "73793b35016b1c52bbf3b6e73c6320307bddaf16"
62
+ "gitHead": "940cd59207998b4a1d891081f8fe821f7516a9c6"
63
63
  }
package/schema.graphql CHANGED
@@ -201,6 +201,7 @@ type Attachment {
201
201
  refBy: String
202
202
  refType: String
203
203
  size: String!
204
+ tags: Object
204
205
  updatedAt: DateTimeISO!
205
206
  updater: User
206
207
  }
@@ -219,6 +220,7 @@ input AttachmentPatch {
219
220
  name: String
220
221
  refBy: String
221
222
  refType: String
223
+ tags: Object
222
224
  }
223
225
 
224
226
  """Entity for AttributeSet"""
@@ -2363,6 +2365,7 @@ input NewAttachment {
2363
2365
  file: Upload!
2364
2366
  refBy: String
2365
2367
  refType: String
2368
+ tags: Object
2366
2369
  }
2367
2370
 
2368
2371
  input NewAttributeSet {
@@ -95,6 +95,34 @@ export class OxSciChartMultiple extends LitElement {
95
95
  await this.createOverviewChart()
96
96
  }
97
97
 
98
+ dispose() {
99
+ // 그룹 차트 자원 해제
100
+ this.groupCharts.forEach(chart => {
101
+ if (chart.sciChartSurface) {
102
+ this.synchronizer.removeAxis(chart.sciChartSurface.xAxes.get(0))
103
+ this.verticalGroup.removeSurface(chart.sciChartSurface)
104
+
105
+ // 각 데이터 시리즈 명시적으로 해제
106
+ chart.dataSeries.forEach(ds => ds.delete())
107
+
108
+ // 차트 삭제
109
+ chart.sciChartSurface.delete()
110
+ }
111
+ })
112
+
113
+ // 오버뷰 차트 자원 해제
114
+ if (this.overviewChart) {
115
+ this.overviewChart.sciChartSurface.renderableSeries.clear()
116
+ this.overviewDataSeries.forEach(ds => ds.delete())
117
+ this.overviewChart.sciChartSurface.delete()
118
+ this.overviewDataSeries.length = 0
119
+ }
120
+
121
+ // 사용된 그룹, 오버뷰 데이터 초기화
122
+ this.groupCharts.length = 0
123
+ this.overviewChart = null
124
+ }
125
+
98
126
  async createOverviewChart() {
99
127
  const { chart, dataSeries } =
100
128
  (await buildSciChartOverview(
@@ -53,6 +53,22 @@ export class OxSciChart extends LitElement {
53
53
  this.dataSeries = dataSeries!
54
54
  }
55
55
 
56
+ dispose() {
57
+ // 데이터 시리즈 해제
58
+ this.dataSeries.forEach(ds => ds.delete())
59
+ this.dataSeries = []
60
+
61
+ // SciChartSurface 해제
62
+ if (this.chart?.sciChartSurface) {
63
+ this.chart.sciChartSurface.renderableSeries.clear() // 렌더러 시리즈 제거
64
+ this.chart.sciChartSurface.xAxes.clear() // X축 제거
65
+ this.chart.sciChartSurface.yAxes.clear() // Y축 제거
66
+ this.chart.sciChartSurface.delete() // SciChartSurface 삭제
67
+ }
68
+
69
+ this.chart = null // chart 객체 초기화
70
+ }
71
+
56
72
  async updated(changedProperties: Map<string | number | symbol, unknown>) {
57
73
  var needDataUpdate = false
58
74
 
@@ -49,13 +49,56 @@ import {
49
49
  } from 'scichart'
50
50
  import { AxisSynchroniser } from './axis-synchronizer'
51
51
 
52
- SciChartSurface.UseCommunityLicense()
53
-
54
52
  SciChartSurface.configure({
55
53
  dataUrl: `/node_modules/scichart/_wasm/scichart2d.data`,
56
54
  wasmUrl: `/node_modules/scichart/_wasm/scichart2d.wasm`
57
55
  })
58
56
 
57
+ var licenseInitialized: boolean = false
58
+
59
+ // 커뮤니티 라이선스 적용 함수
60
+ function useCommunityLicense() {
61
+ SciChartSurface.UseCommunityLicense()
62
+ }
63
+
64
+ // SciChart 라이선스 설정 함수
65
+ async function fetchSciChartLicense() {
66
+ try {
67
+ const response = await fetch('/frontend-config/scichart')
68
+ if (response.ok) {
69
+ const { licenseKey = '' } = (await response.json()) || {}
70
+
71
+ if (licenseKey) {
72
+ SciChartSurface.setRuntimeLicenseKey(licenseKey)
73
+ console.log('SciChart license key setting complete')
74
+ } else {
75
+ console.warn('License key not found. Using community version.')
76
+ useCommunityLicense()
77
+ }
78
+ } else {
79
+ console.warn('License server response not found. Using community version.')
80
+ useCommunityLicense()
81
+ }
82
+ } catch (error) {
83
+ console.error('Error fetching license. Using community version:', error)
84
+ useCommunityLicense()
85
+ }
86
+ }
87
+
88
+ // SciChart 초기화 함수
89
+ async function initializeSciChartLicense() {
90
+ if (!licenseInitialized) {
91
+ if (window.location.hostname === 'localhost') {
92
+ console.warn('Localhost detected. Using SciChart community license.')
93
+ useCommunityLicense() // localhost인 경우 커뮤니티 라이선스 적용
94
+ } else {
95
+ await fetchSciChartLicense() // 서버에서 라이선스 키 가져오기
96
+ }
97
+
98
+ licenseInitialized = true
99
+ }
100
+ }
101
+
59
102
  export const DEFAULT_COLOR = '#FF6600'
60
103
  const DEFAULT_STROKE = '#000000'
61
104
  const POINT_MARKER_SIZE = 10
@@ -265,6 +308,8 @@ export async function buildSciChart(
265
308
  ): Promise<{ chart: any; dataSeries: any[] } | undefined> {
266
309
  if (!config) return
267
310
 
311
+ await initializeSciChartLicense()
312
+
268
313
  const { type: chartType, options, data: fromData } = config
269
314
  const { datasets = [] } = fromData || {}
270
315
  var {
@@ -33,6 +33,11 @@ export default class ScichartMultipleTimeseries extends HTMLOverlayContainer {
33
33
  return NATURE
34
34
  }
35
35
 
36
+ dispose() {
37
+ super.dispose()
38
+ ;(this.element as OxSciChartMultiple)?.dispose()
39
+ }
40
+
36
41
  setElementProperties(scichart: OxSciChartMultiple) {
37
42
  const { data, chart, showOverview, visibleSeries } = this.state
38
43
 
@@ -34,6 +34,11 @@ export default class ScichartTimeSeries extends HTMLOverlayContainer {
34
34
  scichart.data = data
35
35
  }
36
36
 
37
+ dispose() {
38
+ super.dispose()
39
+ ;(this.element as OxSciChart)?.dispose()
40
+ }
41
+
37
42
  get tagName() {
38
43
  return 'ox-scichart'
39
44
  }