binbot-charts 0.3.0 → 0.3.1
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.
|
@@ -23,7 +23,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
23
23
|
|
|
24
24
|
function TVChartContainer(_ref) {
|
|
25
25
|
let {
|
|
26
|
-
symbol = "
|
|
26
|
+
symbol = "BTCUSDT",
|
|
27
27
|
interval = "1h",
|
|
28
28
|
libraryPath = "/charting_library/",
|
|
29
29
|
timescaleMarks = [],
|
|
@@ -39,7 +39,7 @@ function TVChartContainer(_ref) {
|
|
|
39
39
|
const prevTimescaleMarks = (0, _react.useRef)(timescaleMarks);
|
|
40
40
|
(0, _react.useEffect)(() => {
|
|
41
41
|
if (!widgetState) {
|
|
42
|
-
initializeChart();
|
|
42
|
+
initializeChart("1h");
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
if (orderLines && orderLines.length > 0) {
|
|
@@ -56,10 +56,10 @@ function TVChartContainer(_ref) {
|
|
|
56
56
|
}
|
|
57
57
|
}, [orderLines, timescaleMarks]);
|
|
58
58
|
|
|
59
|
-
const initializeChart =
|
|
59
|
+
const initializeChart = interval => {
|
|
60
60
|
const widgetOptions = {
|
|
61
61
|
symbol: symbol,
|
|
62
|
-
datafeed: new _datafeed.default(timescaleMarks),
|
|
62
|
+
datafeed: new _datafeed.default(timescaleMarks, interval),
|
|
63
63
|
interval: interval,
|
|
64
64
|
container: containerRef.current,
|
|
65
65
|
library_path: libraryPath,
|
|
@@ -31,11 +31,18 @@ const getConfigurationData = async () => {
|
|
|
31
31
|
}]
|
|
32
32
|
};
|
|
33
33
|
};
|
|
34
|
+
/**
|
|
35
|
+
* @param timescale { Array }. timescaleMark objects
|
|
36
|
+
* @param interval { string }. Klines timescale from the list of Binance Enums
|
|
37
|
+
*/
|
|
38
|
+
|
|
34
39
|
|
|
35
40
|
class Datafeed {
|
|
36
41
|
constructor() {
|
|
37
42
|
let timescaleMarks = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
38
43
|
|
|
44
|
+
let _interval = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "1h";
|
|
45
|
+
|
|
39
46
|
_defineProperty(this, "onReady", async callback => {
|
|
40
47
|
this.configurationData = await getConfigurationData();
|
|
41
48
|
callback(this.configurationData);
|
|
@@ -151,6 +158,7 @@ class Datafeed {
|
|
|
151
158
|
|
|
152
159
|
this.streaming = null;
|
|
153
160
|
this.timescaleMarks = timescaleMarks;
|
|
161
|
+
this.interval = _interval;
|
|
154
162
|
}
|
|
155
163
|
|
|
156
164
|
getTimescaleMarks(symbolInfo, from, to, onDataCallback, resolution) {
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.3.
|
|
2
|
+
"version": "0.3.1",
|
|
3
3
|
"name": "binbot-charts",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"react": "^17.0.1",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"build": "rm -rf dist && NODE_ENV=production babel -d dist/components src/components --extensions \".js,.jsx\" && cp -r src/charting_library dist/charting_library",
|
|
19
19
|
"release": "yarn build && yarn publish"
|
|
20
20
|
},
|
|
21
|
-
"description": "Binbot charts is the default candlestick bars chart used in terminal.binbot.
|
|
21
|
+
"description": "Binbot charts is the default candlestick bars chart used in terminal.binbot.in to render bots graphically.",
|
|
22
22
|
"repository": {
|
|
23
23
|
"type": "git",
|
|
24
24
|
"url": "git+https://github.com/carkod/binbot-charts.git"
|