@operato/scene-scichart 7.3.10 → 7.3.19

Sign up to get free protection for your applications and to get access to all the features.
Files changed (34) hide show
  1. package/dist/charts/ox-scichart-multiple.d.ts +1 -1
  2. package/dist/charts/ox-scichart-multiple.js +1 -2
  3. package/dist/charts/ox-scichart-multiple.js.map +1 -1
  4. package/dist/charts/ox-scichart.d.ts +1 -1
  5. package/dist/charts/ox-scichart.js +1 -2
  6. package/dist/charts/ox-scichart.js.map +1 -1
  7. package/dist/scichart-multiple-timeseries.d.ts +1 -0
  8. package/dist/scichart-multiple-timeseries.js +5 -0
  9. package/dist/scichart-multiple-timeseries.js.map +1 -1
  10. package/dist/scichart-timeseries.d.ts +1 -0
  11. package/dist/scichart-timeseries.js +5 -0
  12. package/dist/scichart-timeseries.js.map +1 -1
  13. package/package.json +2 -2
  14. package/CHANGELOG.md +0 -250
  15. package/db.sqlite +0 -0
  16. package/logs/.08636eb59927f12972f6774f5947c8507b3564c2-audit.json +0 -15
  17. package/logs/.5e5d741d8b7784a2fbad65eedc0fd46946aaf6f2-audit.json +0 -15
  18. package/logs/application-2024-09-10-23.log +0 -105
  19. package/logs/connections-2024-09-10-23.log +0 -50
  20. package/schema.graphql +0 -4455
  21. package/src/charts/axis-synchronizer.ts +0 -37
  22. package/src/charts/ox-scichart-multiple.ts +0 -581
  23. package/src/charts/ox-scichart.ts +0 -157
  24. package/src/charts/scichart-builder.ts +0 -630
  25. package/src/editors/index.ts +0 -8
  26. package/src/groups/index.ts +0 -0
  27. package/src/index.ts +0 -2
  28. package/src/scichart-multiple-timeseries.ts +0 -64
  29. package/src/scichart-timeseries.ts +0 -46
  30. package/src/templates/index.ts +0 -4
  31. package/src/templates/scichart-multiple-timeseries.ts +0 -87
  32. package/src/templates/scichart-timeseries.ts +0 -73
  33. package/tsconfig.json +0 -23
  34. package/tsconfig.tsbuildinfo +0 -1
@@ -1,157 +0,0 @@
1
- import { LitElement, html, css } from 'lit'
2
- import { property, query, customElement } from 'lit/decorators.js'
3
- import { buildSciChart } from './scichart-builder'
4
-
5
- @customElement('ox-scichart')
6
- export class OxSciChart extends LitElement {
7
- @property({ type: Object }) config: OperatoChart.ChartConfig | null = null
8
- @property({ type: Array }) data: { [attr: string]: any }[] = []
9
-
10
- public chart: any = null
11
- private dataSeries: any[] = []
12
- /*
13
- [주의]
14
- ox-scichart container의 id를 글로벌 유니크하게 해야한다.
15
- SciChart가 특별히 container의 id를 기반으로 하위 컴포넌트를 구성하고 있기 때문이다.
16
- shadowDom 안에 있는 container 이더라도, 글로벌 유니크한 id를 제공해야 한다.
17
- 그렇지 않으면, 단 하나의 차트만 제대로 렌더링된다.
18
- */
19
- private containerId: string = 'ox-sci-chart' + ++OxSciChart.idx
20
-
21
- @query('.chart-container') container!: HTMLDivElement
22
-
23
- static idx: number = 0
24
-
25
- static styles = css`
26
- :host {
27
- display: block;
28
- width: 100%;
29
- height: 100%;
30
- }
31
-
32
- .chart-container {
33
- display: flex;
34
- width: 100%;
35
- height: 100%;
36
- }
37
-
38
- .chart-content {
39
- flex: 1;
40
- position: relative;
41
- }
42
- `
43
-
44
- async initializeSciChart() {
45
- if (this.chart) {
46
- this.chart.sciChartSurface?.delete()
47
- this.chart = null
48
- }
49
-
50
- const { chart, dataSeries } = (await buildSciChart(this.config, this.container, {}, {})) || {}
51
-
52
- this.chart = chart
53
- this.dataSeries = dataSeries!
54
- }
55
-
56
- disconnectedCallback(): void {
57
- super.disconnectedCallback()
58
-
59
- // 데이터 시리즈 해제
60
- this.dataSeries.forEach(ds => ds.delete())
61
- this.dataSeries = []
62
-
63
- // SciChartSurface 해제
64
- if (this.chart?.sciChartSurface) {
65
- this.chart.sciChartSurface.renderableSeries.clear() // 렌더러 시리즈 제거
66
- this.chart.sciChartSurface.xAxes.clear() // X축 제거
67
- this.chart.sciChartSurface.yAxes.clear() // Y축 제거
68
- this.chart.sciChartSurface.delete() // SciChartSurface 삭제
69
- }
70
-
71
- this.chart = null // chart 객체 초기화
72
- }
73
-
74
- async updated(changedProperties: Map<string | number | symbol, unknown>) {
75
- var needDataUpdate = false
76
-
77
- if (changedProperties.has('config') && this.config) {
78
- await this.initializeSciChart()
79
- needDataUpdate = true
80
- }
81
-
82
- if (changedProperties.has('data')) {
83
- needDataUpdate = true
84
- }
85
-
86
- if (needDataUpdate) {
87
- await this.updateDataSeries()
88
- }
89
- }
90
-
91
- updateDataSeries() {
92
- if (!this.dataSeries?.length) {
93
- return
94
- }
95
-
96
- this.dataSeries.forEach(ds => ds.clear())
97
- const newData = this.dataSet
98
-
99
- newData.forEach((data, index) => {
100
- const filteredData = data.filter(d => typeof d.yValue === 'number')
101
-
102
- if (filteredData.length > 0) {
103
- this.dataSeries[index].appendRange(
104
- filteredData.map(d => d.xValue),
105
- filteredData.map(d => d.yValue)
106
- )
107
- }
108
- })
109
-
110
- setTimeout(() => {
111
- this.chart?.sciChartSurface.zoomExtents()
112
- this.chart?.sciChartSurface.invalidateElement()
113
- }, 200)
114
- }
115
-
116
- get dataSet(): { xValue: number; yValue: number }[][] {
117
- const { config, data } = this
118
- const { datasets = [], labelDataKey: attrX } = config?.data || {}
119
-
120
- if (!(data instanceof Array) || !attrX) {
121
- return []
122
- }
123
-
124
- return datasets.map(dataset => {
125
- return data
126
- .map(item => {
127
- if (!item || typeof item !== 'object') {
128
- return
129
- }
130
-
131
- const xValue = new Date(item[attrX])
132
- if (isNaN(xValue.getTime())) {
133
- console.error('Invalid date:', item[attrX])
134
- return
135
- }
136
-
137
- return {
138
- xValue: xValue.getTime() / 1000,
139
- yValue: item[dataset.dataKey!]
140
- }
141
- })
142
- .filter(Boolean) as { xValue: number; yValue: number }[]
143
- })
144
- }
145
-
146
- async appendData(appendum: { [attr: string]: any }[]) {}
147
-
148
- render() {
149
- return html` <div id=${this.containerId} class="chart-container"></div> `
150
- }
151
- }
152
-
153
- declare global {
154
- interface HTMLElementTagNameMap {
155
- 'ox-scichart': OxSciChart
156
- }
157
- }