@operato/scene-scichart 7.0.2 → 7.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (71) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/db.sqlite +0 -0
  3. package/dist/charts/ox-scichart.d.ts +2 -1
  4. package/dist/charts/ox-scichart.js +20 -9
  5. package/dist/charts/ox-scichart.js.map +1 -1
  6. package/dist/charts/scichart-builder.js +7 -2
  7. package/dist/charts/scichart-builder.js.map +1 -1
  8. package/dist/index.d.ts +0 -2
  9. package/dist/index.js +0 -2
  10. package/dist/index.js.map +1 -1
  11. package/dist/templates/index.d.ts +51 -0
  12. package/dist/templates/index.js +1 -3
  13. package/dist/templates/index.js.map +1 -1
  14. package/icons/scichart-timeseries.png +0 -0
  15. package/logs/.08636eb59927f12972f6774f5947c8507b3564c2-audit.json +6 -16
  16. package/logs/.5e5d741d8b7784a2fbad65eedc0fd46946aaf6f2-audit.json +6 -16
  17. package/logs/{application-2024-07-04-13.log → application-2024-07-08-22.log} +8 -8
  18. package/logs/{application-2024-07-04-00.log → application-2024-07-08-23.log} +36 -22
  19. package/logs/connections-2024-07-08-22.log +50 -0
  20. package/logs/connections-2024-07-08-23.log +100 -0
  21. package/package.json +2 -2
  22. package/src/charts/ox-scichart.ts +18 -8
  23. package/src/charts/scichart-builder.ts +10 -3
  24. package/src/index.ts +0 -2
  25. package/src/templates/index.ts +1 -3
  26. package/tsconfig.tsbuildinfo +1 -1
  27. package/cache/translations/system/en.json +0 -1
  28. package/cache/translations/system/ko.json +0 -1
  29. package/dist/charts/sci-candle-stick-chart.d.ts +0 -19
  30. package/dist/charts/sci-candle-stick-chart.js +0 -249
  31. package/dist/charts/sci-candle-stick-chart.js.map +0 -1
  32. package/dist/charts/volume-pallette-provider.d.ts +0 -12
  33. package/dist/charts/volume-pallette-provider.js +0 -21
  34. package/dist/charts/volume-pallette-provider.js.map +0 -1
  35. package/dist/data/binance-rest-client.d.ts +0 -14
  36. package/dist/data/binance-rest-client.js +0 -53
  37. package/dist/data/binance-rest-client.js.map +0 -1
  38. package/dist/scichart-candle-stick.d.ts +0 -10
  39. package/dist/scichart-candle-stick.js +0 -50
  40. package/dist/scichart-candle-stick.js.map +0 -1
  41. package/dist/scichart.d.ts +0 -21
  42. package/dist/scichart.js +0 -72
  43. package/dist/scichart.js.map +0 -1
  44. package/dist/templates/scichart-candle-stick.d.ts +0 -14
  45. package/dist/templates/scichart-candle-stick.js +0 -16
  46. package/dist/templates/scichart-candle-stick.js.map +0 -1
  47. package/dist/templates/scichart.d.ts +0 -14
  48. package/dist/templates/scichart.js +0 -16
  49. package/dist/templates/scichart.js.map +0 -1
  50. package/dist/themes/app-theme.d.ts +0 -56
  51. package/dist/themes/app-theme.js +0 -35
  52. package/dist/themes/app-theme.js.map +0 -1
  53. package/icons/scichart-candle-stick.png +0 -0
  54. package/icons/scichart.png +0 -0
  55. package/logs/application-2024-07-04-12.log +0 -107
  56. package/logs/application-2024-07-04-14.log +0 -210
  57. package/logs/connections-2024-07-04-00.log +0 -100
  58. package/logs/connections-2024-07-04-12.log +0 -50
  59. package/logs/connections-2024-07-04-13.log +0 -50
  60. package/logs/connections-2024-07-04-14.log +0 -100
  61. package/logs/system/.ff447eb42e255d0436b200b50a92dc6546166b36-audit.json +0 -20
  62. package/logs/system/scenario-/353/251/224/354/235/270 /354/247/221/354/247/204/352/270/260 /354/204/274/354/213/261 /353/215/260/354/235/264/355/204/260 /354/241/260/355/232/214 - /354/213/244/354/213/234/352/260/204-2024-07-04-00.log" +0 -7
  63. package/logs/system/scenario-/353/251/224/354/235/270 /354/247/221/354/247/204/352/270/260 /354/204/274/354/213/261 /353/215/260/354/235/264/355/204/260 /354/241/260/355/232/214 - /354/213/244/354/213/234/352/260/204-2024-07-04-12.log" +0 -14
  64. package/src/charts/sci-candle-stick-chart.ts +0 -306
  65. package/src/charts/volume-pallette-provider.ts +0 -41
  66. package/src/data/binance-rest-client.ts +0 -74
  67. package/src/scichart-candle-stick.ts +0 -60
  68. package/src/scichart.ts +0 -90
  69. package/src/templates/scichart-candle-stick.ts +0 -16
  70. package/src/templates/scichart.ts +0 -16
  71. package/src/themes/app-theme.ts +0 -72
@@ -1,50 +0,0 @@
1
- 2024-07-04T13:55:04+09:00 info: Initializing ConnectionManager...
2
- 2024-07-04T13:55:04+09:00 info: Connector 'echo-back-server' started to ready
3
- 2024-07-04T13:55:04+09:00 info: Connector 'echo-back' started to ready
4
- 2024-07-04T13:55:04+09:00 info: Connector 'http-connector' started to ready
5
- 2024-07-04T13:55:04+09:00 info: Connector 'graphql-connector' started to ready
6
- 2024-07-04T13:55:04+09:00 info: Connector 'sqlite-connector' started to ready
7
- 2024-07-04T13:55:04+09:00 info: Connector 'postgresql-connector' started to ready
8
- 2024-07-04T13:55:04+09:00 info: Connector 'mqtt-connector' started to ready
9
- 2024-07-04T13:55:04+09:00 info: Connector 'mssql-connector' started to ready
10
- 2024-07-04T13:55:04+09:00 info: Connector 'oracle-connector' started to ready
11
- 2024-07-04T13:55:04+09:00 info: Connector 'mysql-connector' started to ready
12
- 2024-07-04T13:55:04+09:00 info: Connector 'socket-server' started to ready
13
- 2024-07-04T13:55:04+09:00 info: Connector 'operato-connector' started to ready
14
- 2024-07-04T13:55:04+09:00 info: Connector 'email-connector' started to ready
15
- 2024-07-04T13:55:04+09:00 info: Connector 'influxdb-connector' started to ready
16
- 2024-07-04T13:55:04+09:00 info: Connector 'msgraph-connector' started to ready
17
- 2024-07-04T13:55:04+09:00 info: Connector 'proxy-connector' started to ready
18
- 2024-07-04T13:55:04+09:00 info: echo-back-servers are ready
19
- 2024-07-04T13:55:04+09:00 info: echo-back connections are ready
20
- 2024-07-04T13:55:04+09:00 info: http-connector connections are ready
21
- 2024-07-04T13:55:04+09:00 info: graphql-connector connections are ready
22
- 2024-07-04T13:55:04+09:00 info: sqlite-connector connections are ready
23
- 2024-07-04T13:55:04+09:00 info: postgresql-connector connections are ready
24
- 2024-07-04T13:55:04+09:00 info: mqtt-connector connections are ready
25
- 2024-07-04T13:55:04+09:00 info: mssql-connector connections are ready
26
- 2024-07-04T13:55:04+09:00 info: oracle-connector connections are ready
27
- 2024-07-04T13:55:04+09:00 info: mysql-connector connections are ready
28
- 2024-07-04T13:55:04+09:00 info: socket servers are ready
29
- 2024-07-04T13:55:04+09:00 info: operato-connector connections are ready
30
- 2024-07-04T13:55:04+09:00 info: email connections are ready
31
- 2024-07-04T13:55:04+09:00 info: influxdb connections are ready
32
- 2024-07-04T13:55:04+09:00 info: msgraph-connector connections are ready
33
- 2024-07-04T13:55:04+09:00 info: proxy-connector connections are ready
34
- 2024-07-04T13:55:04+09:00 info: All connector for 'echo-back-server' ready
35
- 2024-07-04T13:55:04+09:00 info: All connector for 'echo-back' ready
36
- 2024-07-04T13:55:04+09:00 info: All connector for 'http-connector' ready
37
- 2024-07-04T13:55:04+09:00 info: All connector for 'graphql-connector' ready
38
- 2024-07-04T13:55:04+09:00 info: All connector for 'sqlite-connector' ready
39
- 2024-07-04T13:55:04+09:00 info: All connector for 'postgresql-connector' ready
40
- 2024-07-04T13:55:04+09:00 info: All connector for 'mqtt-connector' ready
41
- 2024-07-04T13:55:04+09:00 info: All connector for 'mssql-connector' ready
42
- 2024-07-04T13:55:04+09:00 info: All connector for 'oracle-connector' ready
43
- 2024-07-04T13:55:04+09:00 info: All connector for 'mysql-connector' ready
44
- 2024-07-04T13:55:04+09:00 info: All connector for 'socket-server' ready
45
- 2024-07-04T13:55:04+09:00 info: All connector for 'operato-connector' ready
46
- 2024-07-04T13:55:04+09:00 info: All connector for 'email-connector' ready
47
- 2024-07-04T13:55:04+09:00 info: All connector for 'influxdb-connector' ready
48
- 2024-07-04T13:55:04+09:00 info: All connector for 'msgraph-connector' ready
49
- 2024-07-04T13:55:04+09:00 info: All connector for 'proxy-connector' ready
50
- 2024-07-04T13:55:04+09:00 info: ConnectionManager initialization done:
@@ -1,100 +0,0 @@
1
- 2024-07-04T14:04:58+09:00 info: Initializing ConnectionManager...
2
- 2024-07-04T14:04:58+09:00 info: Connector 'echo-back-server' started to ready
3
- 2024-07-04T14:04:58+09:00 info: Connector 'echo-back' started to ready
4
- 2024-07-04T14:04:58+09:00 info: Connector 'http-connector' started to ready
5
- 2024-07-04T14:04:58+09:00 info: Connector 'graphql-connector' started to ready
6
- 2024-07-04T14:04:58+09:00 info: Connector 'sqlite-connector' started to ready
7
- 2024-07-04T14:04:58+09:00 info: Connector 'postgresql-connector' started to ready
8
- 2024-07-04T14:04:58+09:00 info: Connector 'mqtt-connector' started to ready
9
- 2024-07-04T14:04:58+09:00 info: Connector 'mssql-connector' started to ready
10
- 2024-07-04T14:04:58+09:00 info: Connector 'oracle-connector' started to ready
11
- 2024-07-04T14:04:58+09:00 info: Connector 'mysql-connector' started to ready
12
- 2024-07-04T14:04:58+09:00 info: Connector 'socket-server' started to ready
13
- 2024-07-04T14:04:58+09:00 info: Connector 'operato-connector' started to ready
14
- 2024-07-04T14:04:58+09:00 info: Connector 'email-connector' started to ready
15
- 2024-07-04T14:04:58+09:00 info: Connector 'influxdb-connector' started to ready
16
- 2024-07-04T14:04:58+09:00 info: Connector 'msgraph-connector' started to ready
17
- 2024-07-04T14:04:58+09:00 info: Connector 'proxy-connector' started to ready
18
- 2024-07-04T14:04:58+09:00 info: echo-back-servers are ready
19
- 2024-07-04T14:04:58+09:00 info: echo-back connections are ready
20
- 2024-07-04T14:04:58+09:00 info: http-connector connections are ready
21
- 2024-07-04T14:04:58+09:00 info: graphql-connector connections are ready
22
- 2024-07-04T14:04:58+09:00 info: sqlite-connector connections are ready
23
- 2024-07-04T14:04:58+09:00 info: postgresql-connector connections are ready
24
- 2024-07-04T14:04:58+09:00 info: mqtt-connector connections are ready
25
- 2024-07-04T14:04:58+09:00 info: mssql-connector connections are ready
26
- 2024-07-04T14:04:58+09:00 info: oracle-connector connections are ready
27
- 2024-07-04T14:04:58+09:00 info: mysql-connector connections are ready
28
- 2024-07-04T14:04:58+09:00 info: socket servers are ready
29
- 2024-07-04T14:04:58+09:00 info: operato-connector connections are ready
30
- 2024-07-04T14:04:58+09:00 info: email connections are ready
31
- 2024-07-04T14:04:58+09:00 info: influxdb connections are ready
32
- 2024-07-04T14:04:58+09:00 info: msgraph-connector connections are ready
33
- 2024-07-04T14:04:58+09:00 info: proxy-connector connections are ready
34
- 2024-07-04T14:04:58+09:00 info: All connector for 'echo-back-server' ready
35
- 2024-07-04T14:04:58+09:00 info: All connector for 'echo-back' ready
36
- 2024-07-04T14:04:58+09:00 info: All connector for 'http-connector' ready
37
- 2024-07-04T14:04:58+09:00 info: All connector for 'graphql-connector' ready
38
- 2024-07-04T14:04:58+09:00 info: All connector for 'sqlite-connector' ready
39
- 2024-07-04T14:04:58+09:00 info: All connector for 'postgresql-connector' ready
40
- 2024-07-04T14:04:58+09:00 info: All connector for 'mqtt-connector' ready
41
- 2024-07-04T14:04:58+09:00 info: All connector for 'mssql-connector' ready
42
- 2024-07-04T14:04:58+09:00 info: All connector for 'oracle-connector' ready
43
- 2024-07-04T14:04:58+09:00 info: All connector for 'mysql-connector' ready
44
- 2024-07-04T14:04:58+09:00 info: All connector for 'socket-server' ready
45
- 2024-07-04T14:04:58+09:00 info: All connector for 'operato-connector' ready
46
- 2024-07-04T14:04:58+09:00 info: All connector for 'email-connector' ready
47
- 2024-07-04T14:04:58+09:00 info: All connector for 'influxdb-connector' ready
48
- 2024-07-04T14:04:58+09:00 info: All connector for 'msgraph-connector' ready
49
- 2024-07-04T14:04:58+09:00 info: All connector for 'proxy-connector' ready
50
- 2024-07-04T14:04:58+09:00 info: ConnectionManager initialization done:
51
- 2024-07-04T14:09:28+09:00 info: Initializing ConnectionManager...
52
- 2024-07-04T14:09:28+09:00 info: Connector 'echo-back-server' started to ready
53
- 2024-07-04T14:09:28+09:00 info: Connector 'echo-back' started to ready
54
- 2024-07-04T14:09:28+09:00 info: Connector 'http-connector' started to ready
55
- 2024-07-04T14:09:28+09:00 info: Connector 'graphql-connector' started to ready
56
- 2024-07-04T14:09:28+09:00 info: Connector 'sqlite-connector' started to ready
57
- 2024-07-04T14:09:28+09:00 info: Connector 'postgresql-connector' started to ready
58
- 2024-07-04T14:09:28+09:00 info: Connector 'mqtt-connector' started to ready
59
- 2024-07-04T14:09:28+09:00 info: Connector 'mssql-connector' started to ready
60
- 2024-07-04T14:09:28+09:00 info: Connector 'oracle-connector' started to ready
61
- 2024-07-04T14:09:28+09:00 info: Connector 'mysql-connector' started to ready
62
- 2024-07-04T14:09:28+09:00 info: Connector 'socket-server' started to ready
63
- 2024-07-04T14:09:28+09:00 info: Connector 'operato-connector' started to ready
64
- 2024-07-04T14:09:28+09:00 info: Connector 'email-connector' started to ready
65
- 2024-07-04T14:09:28+09:00 info: Connector 'influxdb-connector' started to ready
66
- 2024-07-04T14:09:28+09:00 info: Connector 'msgraph-connector' started to ready
67
- 2024-07-04T14:09:28+09:00 info: Connector 'proxy-connector' started to ready
68
- 2024-07-04T14:09:28+09:00 info: echo-back-servers are ready
69
- 2024-07-04T14:09:28+09:00 info: echo-back connections are ready
70
- 2024-07-04T14:09:28+09:00 info: http-connector connections are ready
71
- 2024-07-04T14:09:28+09:00 info: graphql-connector connections are ready
72
- 2024-07-04T14:09:28+09:00 info: sqlite-connector connections are ready
73
- 2024-07-04T14:09:28+09:00 info: postgresql-connector connections are ready
74
- 2024-07-04T14:09:28+09:00 info: mqtt-connector connections are ready
75
- 2024-07-04T14:09:28+09:00 info: mssql-connector connections are ready
76
- 2024-07-04T14:09:28+09:00 info: oracle-connector connections are ready
77
- 2024-07-04T14:09:28+09:00 info: mysql-connector connections are ready
78
- 2024-07-04T14:09:28+09:00 info: socket servers are ready
79
- 2024-07-04T14:09:28+09:00 info: operato-connector connections are ready
80
- 2024-07-04T14:09:28+09:00 info: email connections are ready
81
- 2024-07-04T14:09:28+09:00 info: influxdb connections are ready
82
- 2024-07-04T14:09:28+09:00 info: msgraph-connector connections are ready
83
- 2024-07-04T14:09:28+09:00 info: proxy-connector connections are ready
84
- 2024-07-04T14:09:28+09:00 info: All connector for 'echo-back-server' ready
85
- 2024-07-04T14:09:28+09:00 info: All connector for 'echo-back' ready
86
- 2024-07-04T14:09:28+09:00 info: All connector for 'http-connector' ready
87
- 2024-07-04T14:09:28+09:00 info: All connector for 'graphql-connector' ready
88
- 2024-07-04T14:09:28+09:00 info: All connector for 'sqlite-connector' ready
89
- 2024-07-04T14:09:28+09:00 info: All connector for 'postgresql-connector' ready
90
- 2024-07-04T14:09:28+09:00 info: All connector for 'mqtt-connector' ready
91
- 2024-07-04T14:09:28+09:00 info: All connector for 'mssql-connector' ready
92
- 2024-07-04T14:09:28+09:00 info: All connector for 'oracle-connector' ready
93
- 2024-07-04T14:09:28+09:00 info: All connector for 'mysql-connector' ready
94
- 2024-07-04T14:09:28+09:00 info: All connector for 'socket-server' ready
95
- 2024-07-04T14:09:28+09:00 info: All connector for 'operato-connector' ready
96
- 2024-07-04T14:09:28+09:00 info: All connector for 'email-connector' ready
97
- 2024-07-04T14:09:28+09:00 info: All connector for 'influxdb-connector' ready
98
- 2024-07-04T14:09:28+09:00 info: All connector for 'msgraph-connector' ready
99
- 2024-07-04T14:09:28+09:00 info: All connector for 'proxy-connector' ready
100
- 2024-07-04T14:09:28+09:00 info: ConnectionManager initialization done:
@@ -1,20 +0,0 @@
1
- {
2
- "keep": {
3
- "days": true,
4
- "amount": 14
5
- },
6
- "auditLog": "logs/system/.ff447eb42e255d0436b200b50a92dc6546166b36-audit.json",
7
- "files": [
8
- {
9
- "date": 1720019160895,
10
- "name": "logs/system/scenario-메인 집진기 센싱 데이터 조회 - 실시간-2024-07-04-00.log",
11
- "hash": "fe40d74a8a566acdaa09969df6135330a69600cb2c5c07fb654d42bff64708ba"
12
- },
13
- {
14
- "date": 1720064405142,
15
- "name": "logs/system/scenario-메인 집진기 센싱 데이터 조회 - 실시간-2024-07-04-12.log",
16
- "hash": "df0316e7fc6e32f69dd03411edcea77aca18f192c4f1990687a544794a0955f8"
17
- }
18
- ],
19
- "hashType": "sha256"
20
- }
@@ -1,7 +0,0 @@
1
- 2024-07-04T00:06:02+09:00 info: 메인 집진기 센싱 데이터 조회 - 실시간-1720019160891:[state changed] STOPPED => READY
2
- 2024-07-04T00:06:02+09:00 info: 메인 집진기 센싱 데이터 조회 - 실시간-1720019160891:[state changed] READY => STARTED
3
- 2024-07-04T00:06:02+09:00 info: Start 1 Rounds #######
4
- 2024-07-04T00:06:02+09:00 info: Step 'query'(d58dfbfd-4957-434b-bcda-5d5345f38a73) started.
5
- 2024-07-04T00:06:02+09:00 error: The connection with the given name(INFLUX-DB) cannot be found
6
- 2024-07-04T00:06:02+09:00 info: 메인 집진기 센싱 데이터 조회 - 실시간-1720019160891:[state changed] HALTED => UNLOADED
7
- 2024-07-04T00:06:02+09:00 info: 메인 집진기 센싱 데이터 조회 - 실시간-1720019160891:[state changed] HALTED => UNLOADED
@@ -1,14 +0,0 @@
1
- 2024-07-04T12:40:05+09:00 info: 메인 집진기 센싱 데이터 조회 - 실시간-1720064405136:[state changed] STOPPED => READY
2
- 2024-07-04T12:40:05+09:00 info: 메인 집진기 센싱 데이터 조회 - 실시간-1720064405136:[state changed] READY => STARTED
3
- 2024-07-04T12:40:05+09:00 info: Start 1 Rounds #######
4
- 2024-07-04T12:40:05+09:00 info: Step 'query'(d58dfbfd-4957-434b-bcda-5d5345f38a73) started.
5
- 2024-07-04T12:40:05+09:00 error: The connection with the given name(INFLUX-DB) cannot be found
6
- 2024-07-04T12:40:05+09:00 info: 메인 집진기 센싱 데이터 조회 - 실시간-1720064405136:[state changed] HALTED => UNLOADED
7
- 2024-07-04T12:40:05+09:00 info: 메인 집진기 센싱 데이터 조회 - 실시간-1720064405136:[state changed] HALTED => UNLOADED
8
- 2024-07-04T12:56:49+09:00 info: 메인 집진기 센싱 데이터 조회 - 실시간-1720065409903:[state changed] STOPPED => READY
9
- 2024-07-04T12:56:49+09:00 info: 메인 집진기 센싱 데이터 조회 - 실시간-1720065409903:[state changed] READY => STARTED
10
- 2024-07-04T12:56:49+09:00 info: Start 1 Rounds #######
11
- 2024-07-04T12:56:49+09:00 info: Step 'query'(d58dfbfd-4957-434b-bcda-5d5345f38a73) started.
12
- 2024-07-04T12:56:49+09:00 error: The connection with the given name(INFLUX-DB) cannot be found
13
- 2024-07-04T12:56:49+09:00 info: 메인 집진기 센싱 데이터 조회 - 실시간-1720065409903:[state changed] HALTED => UNLOADED
14
- 2024-07-04T12:56:49+09:00 info: 메인 집진기 센싱 데이터 조회 - 실시간-1720065409903:[state changed] HALTED => UNLOADED
@@ -1,306 +0,0 @@
1
- import { LitElement, PropertyValues, PropertyValueMap, css, html } from 'lit'
2
- import { customElement, property, query, state } from 'lit/decorators.js'
3
-
4
- import {
5
- SciChartSurface,
6
- NumberRange,
7
- NumericAxis,
8
- OhlcDataSeries,
9
- FastCandlestickRenderableSeries,
10
- ZoomPanModifier,
11
- ZoomExtentsModifier,
12
- MouseWheelZoomModifier,
13
- ENumericFormat,
14
- DateTimeNumericAxis,
15
- EAutoRange,
16
- FastLineRenderableSeries,
17
- XyMovingAverageFilter,
18
- SciChartOverview,
19
- CursorModifier,
20
- CursorTooltipSvgAnnotation,
21
- SeriesInfo,
22
- EDataSeriesType,
23
- ESeriesType,
24
- IRenderableSeries,
25
- FastMountainRenderableSeries,
26
- GradientParams,
27
- Point,
28
- OhlcSeriesInfo,
29
- FastColumnRenderableSeries,
30
- XyDataSeries,
31
- FastOhlcRenderableSeries
32
- } from 'scichart'
33
-
34
- import { appTheme } from '../themes/app-theme'
35
- import { VolumePaletteProvider } from './volume-pallette-provider'
36
- import { simpleBinanceRestClient } from '../data/binance-rest-client'
37
-
38
- const Y_AXIS_VOLUME_ID = 'Y_AXIS_VOLUME_ID'
39
-
40
- SciChartSurface.UseCommunityLicense()
41
- SciChartSurface.configure({
42
- dataUrl: `/node_modules/scichart/_wasm/scichart2d.data`,
43
- wasmUrl: `/node_modules/scichart/_wasm/scichart2d.wasm`
44
- })
45
-
46
- @customElement('sci-candle-stock-chart')
47
- export class SciCandleStockChart extends LitElement {
48
- static styles = [
49
- css`
50
- :host {
51
- display: flex;
52
- flex-direction: column;
53
-
54
- width: 100%;
55
- }
56
-
57
- #chart {
58
- flex: 8;
59
- }
60
-
61
- #overview {
62
- flex: 2;
63
- }
64
- `
65
- ]
66
-
67
- render() {
68
- return html`
69
- <div id="chart"></div>
70
- <div id="overview"></div>
71
- `
72
- }
73
-
74
- @property({ type: String, attribute: 'series-type' }) seriesType: 'candle-stick' | 'ohlc' = 'candle-stick'
75
-
76
- @state() candlestickChartSeries!: FastCandlestickRenderableSeries
77
- @state() ohlcChartSeries!: FastOhlcRenderableSeries
78
- @state() sciChartSurface?: SciChartSurface
79
- @state() sciChartOverview?: SciChartOverview
80
-
81
- @query('#chart') chart!: HTMLDivElement
82
- @query('#overview') overview!: HTMLDivElement
83
-
84
- disconnectedCallback(): void {
85
- if (this.sciChartSurface) {
86
- this.sciChartSurface.delete()
87
- this.sciChartOverview!.delete()
88
- this.sciChartSurface = undefined
89
- this.sciChartOverview = undefined
90
- return
91
- }
92
- }
93
-
94
- protected async firstUpdated(_changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>): Promise<void> {
95
- const { sciChartSurface, overview, candlestickSeries, ohlcSeries } = await this.build()
96
-
97
- this.candlestickChartSeries = candlestickSeries
98
- this.ohlcChartSeries = ohlcSeries
99
- this.sciChartSurface = sciChartSurface
100
- this.sciChartOverview = overview
101
-
102
- this.candlestickChartSeries.isVisible = this.seriesType == 'candle-stick'
103
- this.ohlcChartSeries.isVisible = this.seriesType == 'ohlc'
104
- }
105
-
106
- updated(changes: PropertyValues<this>) {
107
- if (changes.has('seriesType') && this.candlestickChartSeries) {
108
- this.candlestickChartSeries.isVisible = this.seriesType == 'candle-stick'
109
- this.ohlcChartSeries.isVisible = this.seriesType == 'ohlc'
110
- }
111
- }
112
-
113
- // Override the Renderableseries to display on the scichart overview
114
- private getOverviewSeries(defaultSeries: IRenderableSeries) {
115
- if (defaultSeries.type === ESeriesType.CandlestickSeries) {
116
- // Swap the default candlestick series on the overview chart for a mountain series. Same data
117
- return new FastMountainRenderableSeries(defaultSeries.parentSurface.webAssemblyContext2D, {
118
- dataSeries: defaultSeries.dataSeries,
119
- fillLinearGradient: new GradientParams(new Point(0, 0), new Point(0, 1), [
120
- { color: appTheme.VividSkyBlue + '77', offset: 0 },
121
- { color: 'Transparent', offset: 1 }
122
- ]),
123
- stroke: appTheme.VividSkyBlue
124
- })
125
- }
126
- }
127
-
128
- // Override the standard tooltip displayed by CursorModifier
129
- private getTooltipLegendTemplate(seriesInfos: SeriesInfo[], svgAnnotation: CursorTooltipSvgAnnotation) {
130
- let outputSvgString = ''
131
-
132
- // Foreach series there will be a seriesInfo supplied by SciChart. This contains info about the series under the house
133
- seriesInfos.forEach((seriesInfo, index) => {
134
- const y = 20 + index * 20
135
- const textColor = seriesInfo.stroke
136
- let legendText = seriesInfo.formattedYValue
137
- if (seriesInfo.dataSeriesType === EDataSeriesType.Ohlc) {
138
- const o = seriesInfo as OhlcSeriesInfo
139
- legendText = `Open=${o.formattedOpenValue} High=${o.formattedHighValue} Low=${o.formattedLowValue} Close=${o.formattedCloseValue}`
140
- }
141
- outputSvgString += `<text x="8" y="${y}" font-size="13" font-family="Verdana" fill="${textColor}">
142
- ${seriesInfo.seriesName}: ${legendText}
143
- </text>`
144
- })
145
-
146
- return `<svg width="100%" height="100%">
147
- ${outputSvgString}
148
- </svg>`
149
- }
150
-
151
- private async build() {
152
- // Create a SciChartSurface
153
- const { sciChartSurface, wasmContext } = await SciChartSurface.create(this.chart, {
154
- theme: appTheme.SciChartJsTheme
155
- })
156
-
157
- // Add an XAxis of type DateTimeAxis
158
- // Note for crypto data this is fine, but for stocks/forex you will need to use CategoryAxis which collapses gaps at weekends
159
- // In future we have a hybrid IndexDateAxis which 'magically' solves problems of different # of points in stock market datasetd with gaps
160
- const xAxis = new DateTimeNumericAxis(wasmContext, {
161
- // autoRange.never as we're setting visibleRange explicitly below. If you dont do this, leave this flag default
162
- autoRange: EAutoRange.Never
163
- })
164
- sciChartSurface.xAxes.add(xAxis)
165
-
166
- // Create a NumericAxis on the YAxis with 2 Decimal Places
167
- sciChartSurface.yAxes.add(
168
- new NumericAxis(wasmContext, {
169
- growBy: new NumberRange(0.1, 0.1),
170
- labelFormat: ENumericFormat.Decimal,
171
- labelPrecision: 2,
172
- labelPrefix: '$',
173
- autoRange: EAutoRange.Always
174
- })
175
- )
176
-
177
- // Create a secondary YAxis to host volume data on its own scale
178
- sciChartSurface.yAxes.add(
179
- new NumericAxis(wasmContext, {
180
- id: Y_AXIS_VOLUME_ID,
181
- growBy: new NumberRange(0, 4),
182
- isVisible: false,
183
- autoRange: EAutoRange.Always
184
- })
185
- )
186
-
187
- // Fetch data from now to 300 1hr candles ago
188
- const endDate = new Date(Date.now())
189
- const startDate = new Date()
190
- startDate.setHours(endDate.getHours() - 300)
191
- const priceBars = await simpleBinanceRestClient.getCandles('BTCUSDT', '1h', startDate, endDate)
192
-
193
- // Maps PriceBar { date, open, high, low, close, volume } to structure-of-arrays expected by scichart
194
- const xValues: number[] = []
195
- const openValues: number[] = []
196
- const highValues: number[] = []
197
- const lowValues: number[] = []
198
- const closeValues: number[] = []
199
- const volumeValues: number[] = []
200
- priceBars.forEach((priceBar: any) => {
201
- xValues.push(priceBar.date)
202
- openValues.push(priceBar.open)
203
- highValues.push(priceBar.high)
204
- lowValues.push(priceBar.low)
205
- closeValues.push(priceBar.close)
206
- volumeValues.push(priceBar.volume)
207
- })
208
-
209
- // Zoom to the latest 100 candles
210
- const startViewportRange = new Date()
211
- startViewportRange.setHours(startDate.getHours() - 100)
212
- xAxis.visibleRange = new NumberRange(startViewportRange.getTime() / 1000, endDate.getTime() / 1000)
213
-
214
- // Create and add the Candlestick series
215
- // The Candlestick Series requires a special dataseries type called OhlcDataSeries with o,h,l,c and date values
216
- const candleDataSeries = new OhlcDataSeries(wasmContext, {
217
- xValues,
218
- openValues,
219
- highValues,
220
- lowValues,
221
- closeValues,
222
- dataSeriesName: 'BTC/USDT'
223
- })
224
- const candlestickSeries = new FastCandlestickRenderableSeries(wasmContext, {
225
- dataSeries: candleDataSeries,
226
- stroke: appTheme.ForegroundColor, // used by cursorModifier below
227
- strokeThickness: 1,
228
- brushUp: appTheme.VividGreen + '77',
229
- brushDown: appTheme.MutedRed + '77',
230
- strokeUp: appTheme.VividGreen,
231
- strokeDown: appTheme.MutedRed
232
- })
233
- sciChartSurface.renderableSeries.add(candlestickSeries)
234
-
235
- // Add an Ohlcseries. this will be invisible to begin with
236
- const ohlcSeries = new FastOhlcRenderableSeries(wasmContext, {
237
- dataSeries: candleDataSeries,
238
- stroke: appTheme.ForegroundColor, // used by cursorModifier below
239
- strokeThickness: 1,
240
- dataPointWidth: 0.9,
241
- strokeUp: appTheme.VividGreen,
242
- strokeDown: appTheme.MutedRed,
243
- isVisible: false
244
- })
245
- sciChartSurface.renderableSeries.add(ohlcSeries)
246
-
247
- // Add some moving averages using SciChart's filters/transforms API
248
- // when candleDataSeries updates, XyMovingAverageFilter automatically recomputes
249
- sciChartSurface.renderableSeries.add(
250
- new FastLineRenderableSeries(wasmContext, {
251
- dataSeries: new XyMovingAverageFilter(candleDataSeries, {
252
- dataSeriesName: 'Moving Average (20)',
253
- length: 20
254
- }),
255
- stroke: appTheme.VividSkyBlue
256
- })
257
- )
258
-
259
- sciChartSurface.renderableSeries.add(
260
- new FastLineRenderableSeries(wasmContext, {
261
- dataSeries: new XyMovingAverageFilter(candleDataSeries, {
262
- dataSeriesName: 'Moving Average (50)',
263
- length: 50
264
- }),
265
- stroke: appTheme.VividPink
266
- })
267
- )
268
-
269
- // Add volume data onto the chart
270
- sciChartSurface.renderableSeries.add(
271
- new FastColumnRenderableSeries(wasmContext, {
272
- dataSeries: new XyDataSeries(wasmContext, { xValues, yValues: volumeValues, dataSeriesName: 'Volume' }),
273
- strokeThickness: 0,
274
- // This is how we get volume to scale - on a hidden YAxis
275
- yAxisId: Y_AXIS_VOLUME_ID,
276
- // This is how we colour volume bars red or green
277
- paletteProvider: new VolumePaletteProvider(
278
- candleDataSeries,
279
- appTheme.VividGreen + '77',
280
- appTheme.MutedRed + '77'
281
- )
282
- })
283
- )
284
-
285
- // Optional: Add some interactivity modifiers
286
- sciChartSurface.chartModifiers.add(
287
- new ZoomExtentsModifier(),
288
- new ZoomPanModifier(),
289
- new MouseWheelZoomModifier(),
290
- new CursorModifier({
291
- crosshairStroke: appTheme.VividOrange,
292
- axisLabelFill: appTheme.VividOrange,
293
- tooltipLegendTemplate: this.getTooltipLegendTemplate
294
- })
295
- )
296
-
297
- // Add Overview chart. This will automatically bind to the parent surface
298
- // displaying its series. Zooming the chart will zoom the overview and vice versa
299
- const overview = await SciChartOverview.create(sciChartSurface, this.overview, {
300
- theme: appTheme.SciChartJsTheme,
301
- transformRenderableSeries: this.getOverviewSeries as any
302
- })
303
-
304
- return { sciChartSurface, overview, candlestickSeries, ohlcSeries }
305
- }
306
- }
@@ -1,41 +0,0 @@
1
- import {
2
- OhlcDataSeries,
3
- IRenderableSeries,
4
- EFillPaletteMode,
5
- IFillPaletteProvider,
6
- IPointMetadata,
7
- parseColorToUIntArgb
8
- } from 'scichart'
9
-
10
- export class VolumePaletteProvider implements IFillPaletteProvider {
11
- fillPaletteMode: EFillPaletteMode = EFillPaletteMode.SOLID
12
- private ohlcDataSeries: OhlcDataSeries
13
- private upColorArgb: number
14
- private downColorArgb: number
15
-
16
- constructor(masterData: OhlcDataSeries, upColor: string, downColor: string) {
17
- this.upColorArgb = parseColorToUIntArgb(upColor)
18
- this.downColorArgb = parseColorToUIntArgb(downColor)
19
- this.ohlcDataSeries = masterData
20
- }
21
- onAttached(parentSeries: IRenderableSeries): void {}
22
- onDetached(): void {}
23
-
24
- // Return up or down color for the volume bars depending on Ohlc data
25
- overrideFillArgb(xValue: number, yValue: number, index: number, opacity?: number, metadata?: IPointMetadata): number {
26
- const isUpCandle =
27
- this.ohlcDataSeries.getNativeOpenValues().get(index) >= this.ohlcDataSeries.getNativeCloseValues().get(index)
28
- return isUpCandle ? this.upColorArgb : this.downColorArgb
29
- }
30
-
31
- // Override stroke as well, even though strokethickness is 0, because stroke is used if column thickness goes to 0.
32
- overrideStrokeArgb(
33
- xValue: number,
34
- yValue: number,
35
- index: number,
36
- opacity?: number,
37
- metadata?: IPointMetadata
38
- ): number {
39
- return this.overrideFillArgb(xValue, yValue, index, opacity, metadata)
40
- }
41
- }
@@ -1,74 +0,0 @@
1
- /**
2
- * Defines a price bar with Open, High, Low, Close and Date encoded as number
3
- */
4
- export type TPriceBar = {
5
- date: number
6
- open: number
7
- high: number
8
- low: number
9
- close: number
10
- volume: number
11
- }
12
-
13
- /**
14
- * Parses JSON candles into TPriceBar array
15
- * @param candles
16
- */
17
- const parseCandles = (candles: any[]): TPriceBar[] => {
18
- const priceBars: TPriceBar[] = []
19
-
20
- candles.forEach((candle: any) => {
21
- const [timestamp, open, high, low, close, volume] = candle
22
- const openValue = parseFloat(open)
23
- const highValue = parseFloat(high)
24
- const lowValue = parseFloat(low)
25
- const closeValue = parseFloat(close)
26
- const volumeValue = parseFloat(volume)
27
-
28
- priceBars.push({
29
- date: timestamp / 1000,
30
- open: openValue,
31
- high: highValue,
32
- low: lowValue,
33
- close: closeValue,
34
- volume: volumeValue
35
- })
36
- })
37
-
38
- return priceBars
39
- }
40
-
41
- /**
42
- * Fetches candles from Binance Rest API
43
- */
44
- const getCandles = async (
45
- symbol: string,
46
- interval: string,
47
- startTime?: Date,
48
- endTime?: Date,
49
- limit: number = 500
50
- ): Promise<TPriceBar[]> => {
51
- let url = `https://api.binance.us/api/v3/klines?symbol=${symbol}&interval=${interval}`
52
- if (startTime) {
53
- url += `&startTime=${startTime.getTime()}`
54
- }
55
- if (endTime) {
56
- url += `&endTime=${endTime.getTime()}`
57
- }
58
- if (limit) {
59
- url += `&limit=${limit}`
60
- }
61
- try {
62
- console.log(`SimpleBinanceClient: Fetching ${symbol} ${interval} from ${startTime} to ${endTime}`)
63
- const response = await fetch(url)
64
- const data = await response.json()
65
- return parseCandles(data)
66
- } catch (err) {
67
- console.error(err)
68
- return []
69
- }
70
- }
71
-
72
- export const simpleBinanceRestClient = {
73
- getCandles
74
- }
@@ -1,60 +0,0 @@
1
- /*
2
- * Copyright © HatioLab Inc. All rights reserved.
3
- */
4
-
5
- const NATURE = {
6
- mutable: false,
7
- resizable: true,
8
- rotatable: true,
9
- properties: [
10
- {
11
- type: 'select',
12
- label: 'series',
13
- name: 'series',
14
- property: {
15
- options: ['', 'candle-stick', 'ohlc']
16
- }
17
- }
18
- ]
19
- }
20
-
21
- import './charts/sci-candle-stick-chart'
22
- import { Component, HTMLOverlayContainer, Properties, ComponentNature, error } from '@hatiolab/things-scene'
23
-
24
- import { SciCandleStockChart } from './charts/sci-candle-stick-chart'
25
-
26
- export default class ScichartCandleStick extends HTMLOverlayContainer {
27
- static get nature(): ComponentNature {
28
- return NATURE
29
- }
30
-
31
- dispose() {
32
- super.dispose()
33
- }
34
-
35
- /*
36
- * 컴포넌트의 생성 또는 속성 변화 시에 호출되며,
37
- * 그에 따른 html element의 반영이 필요한 부분을 구현한다.
38
- *
39
- * ThingsComponent state => HTML element properties
40
- */
41
- setElementProperties(chart: SciCandleStockChart) {
42
- const { series = 'candle-stick' } = this.state
43
-
44
- chart.seriesType = series
45
- }
46
-
47
- /*
48
- * 컴포넌트가 ready 상태가 되거나, 컴포넌트의 속성이 변화될 시 setElementProperties 뒤에 호출된다.
49
- * 변화에 따른 기본적인 html 속성이 super.reposition()에서 진행되고, 그 밖의 작업이 필요할 때, 오버라이드 한다.
50
- */
51
- reposition() {
52
- super.reposition()
53
- }
54
-
55
- get tagName() {
56
- return 'sci-candle-stock-chart'
57
- }
58
- }
59
-
60
- Component.register('scichart-candle-stick', ScichartCandleStick)