binbot-charts 0.6.0 → 0.6.2
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.
- package/dist/TVChartContainer.js +300 -306
- package/dist/TVChartContainer.js.map +1 -1
- package/dist/TVChartContainer.mjs +300 -306
- package/dist/TVChartContainer.mjs.map +1 -1
- package/package.json +4 -4
package/dist/TVChartContainer.js
CHANGED
|
@@ -35,15 +35,15 @@ var __async = (__this, __arguments, generator) => {
|
|
|
35
35
|
var fulfilled = (value) => {
|
|
36
36
|
try {
|
|
37
37
|
step(generator.next(value));
|
|
38
|
-
} catch (
|
|
39
|
-
reject(
|
|
38
|
+
} catch (e2) {
|
|
39
|
+
reject(e2);
|
|
40
40
|
}
|
|
41
41
|
};
|
|
42
42
|
var rejected = (value) => {
|
|
43
43
|
try {
|
|
44
44
|
step(generator.throw(value));
|
|
45
|
-
} catch (
|
|
46
|
-
reject(
|
|
45
|
+
} catch (e2) {
|
|
46
|
+
reject(e2);
|
|
47
47
|
}
|
|
48
48
|
};
|
|
49
49
|
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
@@ -59,303 +59,299 @@ __export(TVChartContainer_exports, {
|
|
|
59
59
|
module.exports = __toCommonJS(TVChartContainer_exports);
|
|
60
60
|
var import_react2 = require("react");
|
|
61
61
|
|
|
62
|
-
// src/charting_library/charting_library.js
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
console.error(e4);
|
|
344
|
-
}
|
|
345
|
-
this._innerWindow().initializationFinished();
|
|
346
|
-
});
|
|
62
|
+
// src/charting_library/charting_library.esm.js
|
|
63
|
+
function e(t2, i2) {
|
|
64
|
+
const n2 = __spreadValues({}, t2);
|
|
65
|
+
for (const o2 in i2) "object" != typeof t2[o2] || null === t2[o2] || Array.isArray(t2[o2]) ? void 0 !== i2[o2] && (n2[o2] = i2[o2]) : n2[o2] = e(t2[o2], i2[o2]);
|
|
66
|
+
return n2;
|
|
67
|
+
}
|
|
68
|
+
var t = { mobile: { disabled_features: ["left_toolbar", "header_widget", "timeframes_toolbar", "edit_buttons_in_legend", "context_menus", "control_bar", "border_around_the_chart"], enabled_features: [] } };
|
|
69
|
+
var i = { width: 800, height: 500, interval: "1D", timezone: "Etc/UTC", container: "", library_path: "", locale: "en", widgetbar: { details: false, watchlist: false, watchlist_settings: { default_symbols: [] } }, overrides: { "mainSeriesProperties.showCountdown": false }, studies_overrides: {}, trading_customization: { position: {}, order: {} }, brokerConfig: { configFlags: {} }, fullscreen: false, autosize: false, disabled_features: [], enabled_features: [], debug: false, logo: {}, time_frames: [{ text: "5y", resolution: "1W" }, { text: "1y", resolution: "1W" }, { text: "6m", resolution: "120" }, { text: "3m", resolution: "60" }, { text: "1m", resolution: "30" }, { text: "5d", resolution: "5" }, { text: "1d", resolution: "1" }], client_id: "0", user_id: "0", charts_storage_api_version: "1.0", favorites: { intervals: [], chartTypes: [] } };
|
|
70
|
+
var n = false;
|
|
71
|
+
function o() {
|
|
72
|
+
return "CL v21.064 (internal id f0bc1e45 @ 2022-03-17T12:19:26.809Z)";
|
|
73
|
+
}
|
|
74
|
+
var s = class {
|
|
75
|
+
constructor(o2) {
|
|
76
|
+
if (this._id = `tradingview_${(1048576 * (1 + Math.random()) | 0).toString(16).substring(1)}`, this._ready = false, this._readyHandlers = [], this._onWindowResize = this._autoResizeChart.bind(this), !o2.datafeed) throw new Error("Datafeed is not defined");
|
|
77
|
+
if (this._options = e(i, o2), o2.preset) {
|
|
78
|
+
const e2 = t[o2.preset];
|
|
79
|
+
e2 ? (void 0 !== this._options.disabled_features ? this._options.disabled_features = this._options.disabled_features.concat(e2.disabled_features) : this._options.disabled_features = e2.disabled_features, void 0 !== this._options.enabled_features ? this._options.enabled_features = this._options.enabled_features.concat(e2.enabled_features) : this._options.enabled_features = e2.enabled_features) : console.warn("Unknown preset: `" + o2.preset + "`");
|
|
80
|
+
}
|
|
81
|
+
"Dark" === this._options.theme && void 0 === this._options.loading_screen && (this._options.loading_screen = { backgroundColor: "#131722" }), this._options.debug && (n || (n = true, console.log("Using CL v21.064 (internal id f0bc1e45 @ 2022-03-17T12:19:26.809Z)"))), this._create();
|
|
82
|
+
}
|
|
83
|
+
onChartReady(e2) {
|
|
84
|
+
this._ready ? e2.call(this) : this._readyHandlers.push(e2);
|
|
85
|
+
}
|
|
86
|
+
headerReady() {
|
|
87
|
+
return this._innerWindowLoaded.then(() => this._innerWindow().headerReady());
|
|
88
|
+
}
|
|
89
|
+
onGrayedObjectClicked(e2) {
|
|
90
|
+
this._doWhenInnerApiLoaded((t2) => {
|
|
91
|
+
t2.onGrayedObjectClicked(e2);
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
onShortcut(e2, t2) {
|
|
95
|
+
this._doWhenInnerWindowLoaded((i2) => {
|
|
96
|
+
i2.createShortcutAction(e2, t2);
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
subscribe(e2, t2) {
|
|
100
|
+
this._doWhenInnerApiLoaded((i2) => {
|
|
101
|
+
i2.subscribe(e2, t2);
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
unsubscribe(e2, t2) {
|
|
105
|
+
this._doWhenInnerApiLoaded((i2) => {
|
|
106
|
+
i2.unsubscribe(e2, t2);
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
chart(e2) {
|
|
110
|
+
return this._innerAPI().chart(e2);
|
|
111
|
+
}
|
|
112
|
+
getLanguage() {
|
|
113
|
+
return this._options.locale;
|
|
114
|
+
}
|
|
115
|
+
setSymbol(e2, t2, i2) {
|
|
116
|
+
this._innerAPI().changeSymbol(e2, t2, i2);
|
|
117
|
+
}
|
|
118
|
+
remove() {
|
|
119
|
+
window.removeEventListener("resize", this._onWindowResize), this._readyHandlers.splice(0, this._readyHandlers.length), delete window[this._id], this._iFrame.parentNode && this._iFrame.parentNode.removeChild(this._iFrame);
|
|
120
|
+
}
|
|
121
|
+
closePopupsAndDialogs() {
|
|
122
|
+
this._doWhenInnerApiLoaded((e2) => {
|
|
123
|
+
e2.closePopupsAndDialogs();
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
selectLineTool(e2) {
|
|
127
|
+
this._innerAPI().selectLineTool(e2);
|
|
128
|
+
}
|
|
129
|
+
selectedLineTool() {
|
|
130
|
+
return this._innerAPI().selectedLineTool();
|
|
131
|
+
}
|
|
132
|
+
save(e2) {
|
|
133
|
+
this._innerAPI().saveChart(e2);
|
|
134
|
+
}
|
|
135
|
+
load(e2, t2) {
|
|
136
|
+
this._innerAPI().loadChart({ json: e2, extendedData: t2 });
|
|
137
|
+
}
|
|
138
|
+
getSavedCharts(e2) {
|
|
139
|
+
this._innerAPI().getSavedCharts(e2);
|
|
140
|
+
}
|
|
141
|
+
loadChartFromServer(e2) {
|
|
142
|
+
this._innerAPI().loadChartFromServer(e2);
|
|
143
|
+
}
|
|
144
|
+
saveChartToServer(e2, t2, i2) {
|
|
145
|
+
this._innerAPI().saveChartToServer(e2, t2, i2);
|
|
146
|
+
}
|
|
147
|
+
removeChartFromServer(e2, t2) {
|
|
148
|
+
this._innerAPI().removeChartFromServer(e2, t2);
|
|
149
|
+
}
|
|
150
|
+
onContextMenu(e2) {
|
|
151
|
+
this._doWhenInnerApiLoaded((t2) => {
|
|
152
|
+
t2.onContextMenu(e2);
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
createButton(e2) {
|
|
156
|
+
return this._innerWindow().createButton(e2);
|
|
157
|
+
}
|
|
158
|
+
createDropdown(e2) {
|
|
159
|
+
return this._innerWindow().createDropdown(e2);
|
|
160
|
+
}
|
|
161
|
+
showNoticeDialog(e2) {
|
|
162
|
+
this._doWhenInnerApiLoaded((t2) => {
|
|
163
|
+
t2.showNoticeDialog(e2);
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
showConfirmDialog(e2) {
|
|
167
|
+
this._doWhenInnerApiLoaded((t2) => {
|
|
168
|
+
t2.showConfirmDialog(e2);
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
showLoadChartDialog() {
|
|
172
|
+
this._innerAPI().showLoadChartDialog();
|
|
173
|
+
}
|
|
174
|
+
showSaveAsChartDialog() {
|
|
175
|
+
this._innerAPI().showSaveAsChartDialog();
|
|
176
|
+
}
|
|
177
|
+
symbolInterval() {
|
|
178
|
+
return this._innerAPI().getSymbolInterval();
|
|
179
|
+
}
|
|
180
|
+
mainSeriesPriceFormatter() {
|
|
181
|
+
return this._innerAPI().mainSeriesPriceFormatter();
|
|
182
|
+
}
|
|
183
|
+
getIntervals() {
|
|
184
|
+
return this._innerAPI().getIntervals();
|
|
185
|
+
}
|
|
186
|
+
getStudiesList() {
|
|
187
|
+
return this._innerAPI().getStudiesList();
|
|
188
|
+
}
|
|
189
|
+
getStudyInputs(e2) {
|
|
190
|
+
return this._innerAPI().getStudyInputs(e2);
|
|
191
|
+
}
|
|
192
|
+
addCustomCSSFile(e2) {
|
|
193
|
+
this._innerWindow().addCustomCSSFile(e2);
|
|
194
|
+
}
|
|
195
|
+
applyOverrides(t2) {
|
|
196
|
+
this._options = e(this._options, { overrides: t2 }), this._doWhenInnerWindowLoaded((e2) => {
|
|
197
|
+
e2.applyOverrides(t2);
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
applyStudiesOverrides(e2) {
|
|
201
|
+
this._doWhenInnerWindowLoaded((t2) => {
|
|
202
|
+
t2.applyStudiesOverrides(e2);
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
watchList() {
|
|
206
|
+
return this._innerAPI().watchlist();
|
|
207
|
+
}
|
|
208
|
+
news() {
|
|
209
|
+
return this._innerAPI().news();
|
|
210
|
+
}
|
|
211
|
+
activeChart() {
|
|
212
|
+
return this._innerAPI().activeChart();
|
|
213
|
+
}
|
|
214
|
+
chartsCount() {
|
|
215
|
+
return this._innerAPI().chartsCount();
|
|
216
|
+
}
|
|
217
|
+
layout() {
|
|
218
|
+
return this._innerAPI().layout();
|
|
219
|
+
}
|
|
220
|
+
setLayout(e2) {
|
|
221
|
+
this._innerAPI().setLayout(e2);
|
|
222
|
+
}
|
|
223
|
+
layoutName() {
|
|
224
|
+
return this._innerAPI().layoutName();
|
|
225
|
+
}
|
|
226
|
+
changeTheme(e2, t2) {
|
|
227
|
+
return this._innerWindow().changeTheme(e2, t2);
|
|
228
|
+
}
|
|
229
|
+
getTheme() {
|
|
230
|
+
return this._innerWindow().getTheme();
|
|
231
|
+
}
|
|
232
|
+
takeScreenshot() {
|
|
233
|
+
this._doWhenInnerApiLoaded((e2) => {
|
|
234
|
+
e2.takeScreenshot();
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
lockAllDrawingTools() {
|
|
238
|
+
return this._innerAPI().lockAllDrawingTools();
|
|
239
|
+
}
|
|
240
|
+
hideAllDrawingTools() {
|
|
241
|
+
return this._innerAPI().hideAllDrawingTools();
|
|
242
|
+
}
|
|
243
|
+
drawOnAllCharts(e2) {
|
|
244
|
+
this._innerAPI().drawOnAllCharts(e2);
|
|
245
|
+
}
|
|
246
|
+
magnetEnabled() {
|
|
247
|
+
return this._innerAPI().magnetEnabled();
|
|
248
|
+
}
|
|
249
|
+
magnetMode() {
|
|
250
|
+
return this._innerAPI().magnetMode();
|
|
251
|
+
}
|
|
252
|
+
undoRedoState() {
|
|
253
|
+
return this._innerAPI().undoRedoState();
|
|
254
|
+
}
|
|
255
|
+
setIntervalLinkingEnabled(e2) {
|
|
256
|
+
this._innerAPI().setIntervalLinkingEnabled(e2);
|
|
257
|
+
}
|
|
258
|
+
setTimeFrame(e2) {
|
|
259
|
+
this._innerAPI().setTimeFrame(e2);
|
|
260
|
+
}
|
|
261
|
+
symbolSync() {
|
|
262
|
+
return this._innerAPI().symbolSync();
|
|
263
|
+
}
|
|
264
|
+
intervalSync() {
|
|
265
|
+
return this._innerAPI().intervalSync();
|
|
266
|
+
}
|
|
267
|
+
crosshairSync() {
|
|
268
|
+
return this._innerAPI().crosshairSync();
|
|
269
|
+
}
|
|
270
|
+
timeSync() {
|
|
271
|
+
return this._innerAPI().timeSync();
|
|
272
|
+
}
|
|
273
|
+
getAllFeatures() {
|
|
274
|
+
return this._innerWindow().getAllFeatures();
|
|
275
|
+
}
|
|
276
|
+
clearUndoHistory() {
|
|
277
|
+
return this._innerAPI().clearUndoHistory();
|
|
278
|
+
}
|
|
279
|
+
undo() {
|
|
280
|
+
return this._innerAPI().undo();
|
|
281
|
+
}
|
|
282
|
+
redo() {
|
|
283
|
+
return this._innerAPI().redo();
|
|
284
|
+
}
|
|
285
|
+
startFullscreen() {
|
|
286
|
+
this._innerAPI().startFullscreen();
|
|
287
|
+
}
|
|
288
|
+
exitFullscreen() {
|
|
289
|
+
this._innerAPI().exitFullscreen();
|
|
290
|
+
}
|
|
291
|
+
takeClientScreenshot(e2) {
|
|
292
|
+
return this._innerAPI().takeClientScreenshot(e2);
|
|
293
|
+
}
|
|
294
|
+
navigationButtonsVisibility() {
|
|
295
|
+
return this._innerWindow().getNavigationButtonsVisibility();
|
|
296
|
+
}
|
|
297
|
+
paneButtonsVisibility() {
|
|
298
|
+
return this._innerWindow().getPaneButtonsVisibility();
|
|
299
|
+
}
|
|
300
|
+
dateFormat() {
|
|
301
|
+
return this._innerWindow().getDateFormat();
|
|
302
|
+
}
|
|
303
|
+
_innerAPI() {
|
|
304
|
+
return this._innerWindow().tradingViewApi;
|
|
305
|
+
}
|
|
306
|
+
_innerWindow() {
|
|
307
|
+
return this._iFrame.contentWindow;
|
|
308
|
+
}
|
|
309
|
+
_doWhenInnerWindowLoaded(e2) {
|
|
310
|
+
this._ready ? e2(this._innerWindow()) : this._innerWindowLoaded.then(() => {
|
|
311
|
+
e2(this._innerWindow());
|
|
312
|
+
});
|
|
313
|
+
}
|
|
314
|
+
_doWhenInnerApiLoaded(e2) {
|
|
315
|
+
this._doWhenInnerWindowLoaded((t2) => {
|
|
316
|
+
t2.doWhenApiIsReady(() => e2(this._innerAPI()));
|
|
317
|
+
});
|
|
318
|
+
}
|
|
319
|
+
_autoResizeChart() {
|
|
320
|
+
this._options.fullscreen && (this._iFrame.style.height = window.innerHeight + "px");
|
|
321
|
+
}
|
|
322
|
+
_create() {
|
|
323
|
+
const e2 = this._render();
|
|
324
|
+
this._options.container_id && console.warn("`container_id` is now deprecated. Please use `container` instead to either still pass a string or an `HTMLElement`.");
|
|
325
|
+
const t2 = this._options.container_id || this._options.container, i2 = "string" == typeof t2 ? document.getElementById(t2) : t2;
|
|
326
|
+
if (null === i2) throw new Error(`There is no such element - #${this._options.container}`);
|
|
327
|
+
i2.innerHTML = e2, this._iFrame = i2.querySelector(`#${this._id}`);
|
|
328
|
+
const n2 = this._iFrame;
|
|
329
|
+
(this._options.autosize || this._options.fullscreen) && (n2.style.width = "100%", this._options.fullscreen || (n2.style.height = "100%")), window.addEventListener("resize", this._onWindowResize), this._onWindowResize(), this._innerWindowLoaded = new Promise((e3) => {
|
|
330
|
+
const t3 = () => {
|
|
331
|
+
n2.removeEventListener("load", t3, false), e3();
|
|
332
|
+
};
|
|
333
|
+
n2.addEventListener("load", t3, false);
|
|
334
|
+
}), this._innerWindowLoaded.then(() => {
|
|
335
|
+
this._innerWindow().widgetReady(() => {
|
|
336
|
+
this._ready = true;
|
|
337
|
+
for (const e3 of this._readyHandlers) try {
|
|
338
|
+
e3.call(this);
|
|
339
|
+
} catch (e4) {
|
|
340
|
+
console.error(e4);
|
|
341
|
+
}
|
|
342
|
+
this._innerWindow().initializationFinished();
|
|
347
343
|
});
|
|
348
|
-
}
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
}
|
|
344
|
+
});
|
|
345
|
+
}
|
|
346
|
+
_render() {
|
|
347
|
+
const e2 = window;
|
|
348
|
+
if (e2[this._id] = { datafeed: this._options.datafeed, customFormatters: this._options.custom_formatters || this._options.customFormatters, brokerFactory: this._options.broker_factory || this._options.brokerFactory, overrides: this._options.overrides, studiesOverrides: this._options.studies_overrides, tradingCustomization: this._options.trading_customization, disabledFeatures: this._options.disabled_features, enabledFeatures: this._options.enabled_features, brokerConfig: this._options.broker_config || this._options.brokerConfig, restConfig: this._options.restConfig, favorites: this._options.favorites, logo: this._options.logo, numeric_formatting: this._options.numeric_formatting, rss_news_feed: this._options.rss_news_feed, newsProvider: this._options.news_provider, loadLastChart: this._options.load_last_chart, saveLoadAdapter: this._options.save_load_adapter, loading_screen: this._options.loading_screen, settingsAdapter: this._options.settings_adapter, getCustomIndicators: this._options.custom_indicators_getter, additionalSymbolInfoFields: this._options.additional_symbol_info_fields, headerWidgetButtonsMode: this._options.header_widget_buttons_mode, symbolSearchComplete: this._options.symbol_search_complete }, this._options.saved_data) e2[this._id].chartContent = { json: this._options.saved_data }, this._options.saved_data_meta_info && (e2[this._id].chartContentExtendedData = this._options.saved_data_meta_info);
|
|
349
|
+
else if (!this._options.load_last_chart && !this._options.symbol) throw new Error("Symbol is not defined: either 'symbol' or 'load_last_chart' option must be set");
|
|
350
|
+
const t2 = (this._options.library_path || "") + `${encodeURIComponent(this._options.locale)}-tv-chart.f0bc1e45.html#symbol=` + encodeURIComponent(this._options.symbol || "") + "&interval=" + encodeURIComponent(this._options.interval) + (this._options.timeframe ? "&timeframe=" + encodeURIComponent(this._options.timeframe) : "") + (this._options.toolbar_bg ? "&toolbarbg=" + encodeURIComponent(this._options.toolbar_bg.replace("#", "")) : "") + (this._options.studies_access ? "&studiesAccess=" + encodeURIComponent(JSON.stringify(this._options.studies_access)) : "") + "&widgetbar=" + encodeURIComponent(JSON.stringify(this._options.widgetbar)) + (this._options.drawings_access ? "&drawingsAccess=" + encodeURIComponent(JSON.stringify(this._options.drawings_access)) : "") + "&timeFrames=" + encodeURIComponent(JSON.stringify(this._options.time_frames)) + "&locale=" + encodeURIComponent(this._options.locale) + "&uid=" + encodeURIComponent(this._id) + "&clientId=" + encodeURIComponent(String(this._options.client_id)) + "&userId=" + encodeURIComponent(String(this._options.user_id)) + (this._options.charts_storage_url ? "&chartsStorageUrl=" + encodeURIComponent(this._options.charts_storage_url) : "") + (this._options.charts_storage_api_version ? "&chartsStorageVer=" + encodeURIComponent(this._options.charts_storage_api_version) : "") + (this._options.custom_css_url ? "&customCSS=" + encodeURIComponent(this._options.custom_css_url) : "") + (this._options.auto_save_delay ? "&autoSaveDelay=" + encodeURIComponent(String(this._options.auto_save_delay)) : "") + "&debug=" + encodeURIComponent(String(this._options.debug)) + (this._options.snapshot_url ? "&snapshotUrl=" + encodeURIComponent(this._options.snapshot_url) : "") + (this._options.timezone ? "&timezone=" + encodeURIComponent(this._options.timezone) : "") + (this._options.study_count_limit ? "&studyCountLimit=" + encodeURIComponent(String(this._options.study_count_limit)) : "") + (this._options.symbol_search_request_delay ? "&ssreqdelay=" + encodeURIComponent(String(this._options.symbol_search_request_delay)) : "") + (this._options.compare_symbols ? "&compareSymbols=" + encodeURIComponent(JSON.stringify(this._options.compare_symbols)) : "") + (this._options.theme ? "&theme=" + encodeURIComponent(String(this._options.theme)) : "") + (this._options.header_widget_buttons_mode ? "&header_widget_buttons_mode=" + encodeURIComponent(String(this._options.header_widget_buttons_mode)) : "") + (this._options.time_scale ? "&time_scale=" + encodeURIComponent(JSON.stringify(this._options.time_scale)) : "");
|
|
351
|
+
return '<iframe id="' + this._id + '" name="' + this._id + '" src="' + t2 + '"' + (this._options.autosize || this._options.fullscreen ? "" : ' width="' + this._options.width + '" height="' + this._options.height + '"') + ' title="Financial Chart" frameborder="0" allowTransparency="true" scrolling="no" allowfullscreen style="display:block;"></iframe>';
|
|
352
|
+
}
|
|
353
|
+
};
|
|
354
|
+
window.TradingView = window.TradingView || {}, window.TradingView.version = o;
|
|
359
355
|
|
|
360
356
|
// src/components/helpers.js
|
|
361
357
|
var import_react = require("react");
|
|
@@ -386,7 +382,7 @@ function getAllSymbols(symbol) {
|
|
|
386
382
|
});
|
|
387
383
|
}
|
|
388
384
|
});
|
|
389
|
-
} catch (
|
|
385
|
+
} catch (e2) {
|
|
390
386
|
return newSymbols;
|
|
391
387
|
}
|
|
392
388
|
return newSymbols;
|
|
@@ -408,8 +404,8 @@ function setupSockets(subRequest) {
|
|
|
408
404
|
socket.onerror = (error) => {
|
|
409
405
|
console.log("[socket] Error:", error);
|
|
410
406
|
};
|
|
411
|
-
socket.onmessage = (
|
|
412
|
-
const data = JSON.parse(
|
|
407
|
+
socket.onmessage = (e2) => {
|
|
408
|
+
const data = JSON.parse(e2.data);
|
|
413
409
|
if (data.e == void 0) {
|
|
414
410
|
return;
|
|
415
411
|
}
|
|
@@ -497,7 +493,6 @@ function unsubscribeFromStream(subscriberUID) {
|
|
|
497
493
|
var getConfigurationData = () => __async(void 0, null, function* () {
|
|
498
494
|
return {
|
|
499
495
|
supports_marks: true,
|
|
500
|
-
supports_time: true,
|
|
501
496
|
supports_timescale_marks: true,
|
|
502
497
|
supports_time: true,
|
|
503
498
|
supported_resolutions: [
|
|
@@ -550,7 +545,6 @@ var Datafeed = class {
|
|
|
550
545
|
}
|
|
551
546
|
const symbolInfo = () => {
|
|
552
547
|
return {
|
|
553
|
-
ticker: symbolName,
|
|
554
548
|
name: symbolName,
|
|
555
549
|
ticker: symbolName,
|
|
556
550
|
description: symbolName,
|
|
@@ -708,7 +702,7 @@ var TVChartContainer = ({
|
|
|
708
702
|
"mainSeriesProperties.barStyle.dontDrawOpen": false
|
|
709
703
|
}
|
|
710
704
|
};
|
|
711
|
-
const tvWidget = new (
|
|
705
|
+
const tvWidget = new s(widgetOptions);
|
|
712
706
|
tvWidget.onChartReady(() => {
|
|
713
707
|
tvWidget.subscribe("onTick", (event) => onTick && onTick(event));
|
|
714
708
|
setWidgetState(tvWidget);
|