@operato/scene-scichart 7.3.9 → 7.3.13

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.
@@ -95,9 +95,7 @@ export class OxSciChartMultiple extends LitElement {
95
95
  await this.createOverviewChart()
96
96
  }
97
97
 
98
- disconnectedCallback(): void {
99
- super.disconnectedCallback()
100
-
98
+ dispose() {
101
99
  // 그룹 차트 자원 해제
102
100
  this.groupCharts.forEach(chart => {
103
101
  if (chart.sciChartSurface) {
@@ -53,9 +53,7 @@ export class OxSciChart extends LitElement {
53
53
  this.dataSeries = dataSeries!
54
54
  }
55
55
 
56
- disconnectedCallback(): void {
57
- super.disconnectedCallback()
58
-
56
+ dispose() {
59
57
  // 데이터 시리즈 해제
60
58
  this.dataSeries.forEach(ds => ds.delete())
61
59
  this.dataSeries = []
@@ -56,6 +56,12 @@ SciChartSurface.configure({
56
56
 
57
57
  var licenseInitialized: boolean = false
58
58
 
59
+ // 커뮤니티 라이선스 적용 함수
60
+ function useCommunityLicense() {
61
+ SciChartSurface.UseCommunityLicense()
62
+ }
63
+
64
+ // SciChart 라이선스 설정 함수
59
65
  async function fetchSciChartLicense() {
60
66
  try {
61
67
  const response = await fetch('/frontend-config/scichart')
@@ -66,23 +72,29 @@ async function fetchSciChartLicense() {
66
72
  SciChartSurface.setRuntimeLicenseKey(licenseKey)
67
73
  console.log('SciChart license key setting complete')
68
74
  } else {
69
- console.warn('SciChart license key is not set. Using community version.')
70
- SciChartSurface.UseCommunityLicense() // 커뮤니티 라이선스 설정
75
+ console.warn('License key not found. Using community version.')
76
+ useCommunityLicense()
71
77
  }
72
78
  } else {
73
79
  console.warn('License server response not found. Using community version.')
74
- SciChartSurface.UseCommunityLicense() // 커뮤니티 라이선스 설정
80
+ useCommunityLicense()
75
81
  }
76
82
  } catch (error) {
77
- console.error('License setting error. Using community version:', error)
78
- SciChartSurface.UseCommunityLicense() // 커뮤니티 라이선스 설정
83
+ console.error('Error fetching license. Using community version:', error)
84
+ useCommunityLicense()
79
85
  }
80
86
  }
81
87
 
88
+ // SciChart 초기화 함수
82
89
  async function initializeSciChartLicense() {
83
- // 라이선스 설정이 되어 있지 않으면 비동기적으로 설정
84
90
  if (!licenseInitialized) {
85
- await fetchSciChartLicense()
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
+
86
98
  licenseInitialized = true
87
99
  }
88
100
  }
@@ -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
  }