binbot-charts 0.2.28 → 0.2.31
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.
|
@@ -51,9 +51,16 @@ function TVChartContainer(_ref) {
|
|
|
51
51
|
}, [orderLines]);
|
|
52
52
|
|
|
53
53
|
const initializeChart = () => {
|
|
54
|
+
const testTimescaleMarks = [{
|
|
55
|
+
id: "tsm4",
|
|
56
|
+
time: 1662301800,
|
|
57
|
+
color: "red",
|
|
58
|
+
label: "B",
|
|
59
|
+
tooltip: ["Safety Order 4"]
|
|
60
|
+
}];
|
|
54
61
|
const widgetOptions = {
|
|
55
62
|
symbol: symbol,
|
|
56
|
-
datafeed: new _datafeed.default(
|
|
63
|
+
datafeed: new _datafeed.default(testTimescaleMarks),
|
|
57
64
|
interval: interval,
|
|
58
65
|
container: containerRef.current,
|
|
59
66
|
library_path: libraryPath,
|
|
@@ -32,8 +32,7 @@ const getConfigurationData = async () => {
|
|
|
32
32
|
class Datafeed {
|
|
33
33
|
constructor() {
|
|
34
34
|
let timescaleMarks = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
35
|
-
let
|
|
36
|
-
let interval = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "1h";
|
|
35
|
+
let interval = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "1h";
|
|
37
36
|
|
|
38
37
|
_defineProperty(this, "onReady", async callback => {
|
|
39
38
|
this.configurationData = await getConfigurationData();
|
|
@@ -133,10 +132,9 @@ class Datafeed {
|
|
|
133
132
|
(0, _streaming.unsubscribeFromStream)(subscriberUID);
|
|
134
133
|
});
|
|
135
134
|
|
|
136
|
-
this.timescaleMarks = timescaleMarks;
|
|
137
|
-
this.lineOrders = lineOrders;
|
|
138
135
|
this.streaming = null;
|
|
139
136
|
this.interval = interval;
|
|
137
|
+
this.timescaleMarks = timescaleMarks;
|
|
140
138
|
}
|
|
141
139
|
|
|
142
140
|
getTimescaleMarks(symbolInfo, from, to, onDataCallback, resolution) {
|
|
@@ -144,8 +142,10 @@ class Datafeed {
|
|
|
144
142
|
let timescaleMarks = [];
|
|
145
143
|
this.timescaleMarks.forEach(mark => {
|
|
146
144
|
let time = new Date(mark.time * 1000);
|
|
147
|
-
time.
|
|
148
|
-
|
|
145
|
+
time.setMinutes(0);
|
|
146
|
+
time.setSeconds(0);
|
|
147
|
+
time.setMilliseconds(0);
|
|
148
|
+
const roundFloor = time.getTime() / 1000;
|
|
149
149
|
mark.time = roundFloor;
|
|
150
150
|
timescaleMarks.push(mark);
|
|
151
151
|
});
|
package/package.json
CHANGED