@oanda/labs-order-book-widget 1.0.173 → 1.0.174
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/CHANGELOG.md +684 -0
- package/dist/main/OrderBookWidget/ChartWithData.js +4 -4
- package/dist/main/OrderBookWidget/ChartWithData.js.map +1 -1
- package/dist/main/OrderBookWidget/Main.js +11 -11
- package/dist/main/OrderBookWidget/Main.js.map +1 -1
- package/dist/main/OrderBookWidget/OrderBookWidget.js +9 -9
- package/dist/main/OrderBookWidget/OrderBookWidget.js.map +1 -1
- package/dist/main/OrderBookWidget/components/Chart/Chart.js +14 -14
- package/dist/main/OrderBookWidget/components/Chart/Chart.js.map +1 -1
- package/dist/main/OrderBookWidget/components/Chart/formatters.js.map +1 -1
- package/dist/main/OrderBookWidget/components/Chart/getOption.js.map +1 -1
- package/dist/main/OrderBookWidget/components/Chart/types.js.map +1 -1
- package/dist/main/OrderBookWidget/config.js.map +1 -1
- package/dist/main/OrderBookWidget/render.js +9 -9
- package/dist/main/OrderBookWidget/render.js.map +1 -1
- package/dist/main/OrderBookWidget/types.js.map +1 -1
- package/dist/main/gql/getOrderPositionBooks.js +5 -1
- package/dist/main/gql/getOrderPositionBooks.js.map +1 -1
- package/dist/main/gql/types/fragment-masking.js.map +1 -1
- package/dist/main/gql/types/gql.js +1 -1
- package/dist/main/gql/types/gql.js.map +1 -1
- package/dist/main/gql/types/graphql.js +114 -114
- package/dist/main/gql/types/graphql.js.map +1 -1
- package/dist/main/gql/types/index.js.map +1 -1
- package/dist/main/index.js +8 -8
- package/dist/main/index.js.map +1 -1
- package/dist/main/translations/index.js +1 -1
- package/dist/main/translations/index.js.map +1 -1
- package/dist/main/translations/translations.js.map +1 -1
- package/dist/module/OrderBookWidget/ChartWithData.js +4 -4
- package/dist/module/OrderBookWidget/ChartWithData.js.map +1 -1
- package/dist/module/OrderBookWidget/Main.js +10 -10
- package/dist/module/OrderBookWidget/Main.js.map +1 -1
- package/dist/module/OrderBookWidget/OrderBookWidget.js +9 -9
- package/dist/module/OrderBookWidget/OrderBookWidget.js.map +1 -1
- package/dist/module/OrderBookWidget/components/Chart/Chart.js +14 -14
- package/dist/module/OrderBookWidget/components/Chart/Chart.js.map +1 -1
- package/dist/module/OrderBookWidget/components/Chart/formatters.js.map +1 -1
- package/dist/module/OrderBookWidget/components/Chart/getOption.js +1 -1
- package/dist/module/OrderBookWidget/components/Chart/getOption.js.map +1 -1
- package/dist/module/OrderBookWidget/components/Chart/types.js.map +1 -1
- package/dist/module/OrderBookWidget/config.js +1 -1
- package/dist/module/OrderBookWidget/config.js.map +1 -1
- package/dist/module/OrderBookWidget/render.js +10 -10
- package/dist/module/OrderBookWidget/render.js.map +1 -1
- package/dist/module/OrderBookWidget/types.js.map +1 -1
- package/dist/module/gql/getOrderPositionBooks.js +5 -1
- package/dist/module/gql/getOrderPositionBooks.js.map +1 -1
- package/dist/module/gql/types/fragment-masking.js.map +1 -1
- package/dist/module/gql/types/gql.js +1 -1
- package/dist/module/gql/types/gql.js.map +1 -1
- package/dist/module/gql/types/graphql.js +114 -114
- package/dist/module/gql/types/graphql.js.map +1 -1
- package/dist/module/gql/types/index.js +2 -2
- package/dist/module/gql/types/index.js.map +1 -1
- package/dist/module/index.js +1 -1
- package/dist/module/index.js.map +1 -1
- package/dist/module/translations/index.js +1 -1
- package/dist/module/translations/index.js.map +1 -1
- package/dist/module/translations/translations.js.map +1 -1
- package/dist/types/OrderBookWidget/ChartWithData.d.ts +2 -2
- package/dist/types/OrderBookWidget/Main.d.ts +1 -1
- package/dist/types/OrderBookWidget/OrderBookWidget.d.ts +1 -1
- package/dist/types/OrderBookWidget/components/Chart/Chart.d.ts +1 -1
- package/dist/types/OrderBookWidget/components/Chart/formatters.d.ts +1 -1
- package/dist/types/OrderBookWidget/components/Chart/getOption.d.ts +1 -1
- package/dist/types/OrderBookWidget/components/Chart/types.d.ts +2 -2
- package/dist/types/OrderBookWidget/config.d.ts +1 -1
- package/dist/types/OrderBookWidget/types.d.ts +2 -2
- package/dist/types/gql/types/gql.d.ts +2 -2
- package/dist/types/gql/types/index.d.ts +2 -2
- package/dist/types/index.d.ts +1 -1
- package/dist/types/translations/index.d.ts +2 -2
- package/package.json +3 -3
- package/src/OrderBookWidget/ChartWithData.tsx +40 -39
- package/src/OrderBookWidget/Main.tsx +48 -30
- package/src/OrderBookWidget/OrderBookWidget.tsx +8 -8
- package/src/OrderBookWidget/components/Chart/Chart.tsx +41 -29
- package/src/OrderBookWidget/components/Chart/formatters.ts +11 -4
- package/src/OrderBookWidget/components/Chart/getOption.ts +205 -188
- package/src/OrderBookWidget/components/Chart/types.ts +10 -13
- package/src/OrderBookWidget/config.ts +76 -53
- package/src/OrderBookWidget/render.tsx +81 -52
- package/src/OrderBookWidget/types.ts +3 -2
- package/src/gql/getOrderPositionBooks.ts +5 -1
- package/src/gql/types/fragment-masking.ts +41 -21
- package/src/gql/types/gql.ts +7 -3
- package/src/gql/types/graphql.ts +165 -44
- package/src/gql/types/index.ts +2 -2
- package/src/index.ts +1 -1
- package/src/translations/index.ts +4 -4
- package/src/translations/translations.ts +1 -3
- package/test/Main.test.tsx +12 -9
- package/test/chartOptions.test.ts +18 -12
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import { useQuery } from '@apollo/client';
|
|
3
|
-
import classnames from 'classnames';
|
|
4
2
|
import {
|
|
5
3
|
ChartError,
|
|
6
4
|
LastUpdated,
|
|
@@ -10,23 +8,27 @@ import {
|
|
|
10
8
|
useLayoutProvider,
|
|
11
9
|
} from '@oanda/labs-widget-common';
|
|
12
10
|
import { useLocale } from '@oanda/mono-i18n';
|
|
13
|
-
import
|
|
11
|
+
import classnames from 'classnames';
|
|
12
|
+
import React from 'react';
|
|
13
|
+
|
|
14
14
|
import { getOrderPositionBooks } from '../gql/getOrderPositionBooks';
|
|
15
|
-
import {
|
|
15
|
+
import type {
|
|
16
|
+
GetOrderPositionBooksQuery,
|
|
17
|
+
GetOrderPositionBooksQueryVariables,
|
|
18
|
+
} from '../gql/types/graphql';
|
|
19
|
+
import { BookType } from '../gql/types/graphql';
|
|
16
20
|
import { Chart } from './components/Chart/Chart';
|
|
17
21
|
import { instrumentPrecisionConfig } from './config';
|
|
22
|
+
import type { ChartWithDataProps } from './types';
|
|
18
23
|
|
|
19
|
-
const ChartWithData = ({
|
|
20
|
-
instrument,
|
|
21
|
-
bookType,
|
|
22
|
-
}: ChartWithDataProps) => {
|
|
24
|
+
const ChartWithData = ({ instrument, bookType }: ChartWithDataProps) => {
|
|
23
25
|
const { lang } = useLocale();
|
|
24
26
|
const { size } = useLayoutProvider();
|
|
25
27
|
const isDesktop = size === Size.DESKTOP;
|
|
26
28
|
|
|
27
29
|
const { loading, data, error } = useQuery<
|
|
28
|
-
|
|
29
|
-
|
|
30
|
+
GetOrderPositionBooksQuery,
|
|
31
|
+
GetOrderPositionBooksQueryVariables
|
|
30
32
|
>(getOrderPositionBooks, {
|
|
31
33
|
variables: {
|
|
32
34
|
instrument,
|
|
@@ -41,38 +43,37 @@ const ChartWithData = ({
|
|
|
41
43
|
|
|
42
44
|
return (
|
|
43
45
|
<>
|
|
44
|
-
<div
|
|
45
|
-
'lw-
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
<div
|
|
47
|
+
className={classnames('lw-relative lw-w-full', {
|
|
48
|
+
'lw-h-[450px]': isDesktop,
|
|
49
|
+
'lw-h-[390px]': !isDesktop,
|
|
50
|
+
})}
|
|
48
51
|
>
|
|
49
52
|
{isError && (
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
</div>
|
|
53
|
+
<div
|
|
54
|
+
className={classnames(
|
|
55
|
+
'lw-absolute lw-left-0 lw-top-0 lw-flex lw-w-full lw-items-center lw-justify-center lw-border lw-border-solid lw-border-border-primary',
|
|
56
|
+
{
|
|
57
|
+
'lw-h-full': isDesktop,
|
|
58
|
+
'lw-h-[calc(100%-40px)]': !isDesktop,
|
|
59
|
+
}
|
|
60
|
+
)}
|
|
61
|
+
>
|
|
62
|
+
<ChartError />
|
|
63
|
+
</div>
|
|
62
64
|
)}
|
|
63
65
|
{loading && (
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
</div>
|
|
66
|
+
<div
|
|
67
|
+
className={classnames(
|
|
68
|
+
'lw-absolute lw-left-0 lw-top-0 lw-flex lw-w-full lw-items-center lw-justify-center lw-border lw-border-solid lw-border-border-primary',
|
|
69
|
+
{
|
|
70
|
+
'lw-h-full': isDesktop,
|
|
71
|
+
'lw-h-[calc(100%-40px)]': !isDesktop,
|
|
72
|
+
}
|
|
73
|
+
)}
|
|
74
|
+
>
|
|
75
|
+
<Spinner size={SpinnerSize.lg} />
|
|
76
|
+
</div>
|
|
76
77
|
)}
|
|
77
78
|
{!isError && data && (
|
|
78
79
|
<div className="lw-absolute lw-left-0 lw-top-0 lw-flex lw-h-full lw-w-full">
|
|
@@ -86,7 +87,7 @@ const ChartWithData = ({
|
|
|
86
87
|
</div>
|
|
87
88
|
<div className="lw-mt-2 lw-h-8">
|
|
88
89
|
{!loading && !isError && (
|
|
89
|
-
<LastUpdated
|
|
90
|
+
<LastUpdated labelCallback={lang} timestamp={updatedAt} />
|
|
90
91
|
)}
|
|
91
92
|
</div>
|
|
92
93
|
</>
|
|
@@ -1,16 +1,27 @@
|
|
|
1
|
-
import React, { useState } from 'react';
|
|
2
|
-
import classnames from 'classnames';
|
|
3
1
|
import {
|
|
4
|
-
Select,
|
|
2
|
+
Select,
|
|
3
|
+
Size,
|
|
4
|
+
Tabs,
|
|
5
|
+
useLayoutProvider,
|
|
5
6
|
} from '@oanda/labs-widget-common';
|
|
6
7
|
import { useLocale } from '@oanda/mono-i18n';
|
|
7
|
-
import
|
|
8
|
+
import classnames from 'classnames';
|
|
9
|
+
import React, { useState } from 'react';
|
|
10
|
+
|
|
8
11
|
import { BookType, Division } from '../gql/types/graphql';
|
|
9
|
-
import { instrumentSelectConfig, instrumentSelectConfigOC, navigationConfig } from './config';
|
|
10
12
|
import { ChartWithData } from './ChartWithData';
|
|
13
|
+
import {
|
|
14
|
+
instrumentSelectConfig,
|
|
15
|
+
instrumentSelectConfigOC,
|
|
16
|
+
navigationConfig,
|
|
17
|
+
} from './config';
|
|
18
|
+
import type { InstrumentId, MainProps } from './types';
|
|
11
19
|
|
|
12
20
|
const Main = ({ instrument, division }: MainProps) => {
|
|
13
|
-
const selectConfig =
|
|
21
|
+
const selectConfig =
|
|
22
|
+
division === Division.Oc
|
|
23
|
+
? instrumentSelectConfigOC
|
|
24
|
+
: instrumentSelectConfig;
|
|
14
25
|
const { size } = useLayoutProvider();
|
|
15
26
|
const isDesktop = size === Size.DESKTOP;
|
|
16
27
|
const [bookType, setBookType] = useState(BookType.Order);
|
|
@@ -20,33 +31,40 @@ const Main = ({ instrument, division }: MainProps) => {
|
|
|
20
31
|
return (
|
|
21
32
|
<>
|
|
22
33
|
{size && (
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
handleClick={(e) => setBookType(e.currentTarget.value as BookType)}
|
|
27
|
-
labelCallback={lang}
|
|
28
|
-
items={navigationConfig}
|
|
29
|
-
mobileFullWidth
|
|
30
|
-
/>
|
|
31
|
-
{!instrument && (
|
|
32
|
-
<div className={classnames('lw-mb-6 lw-mt-12 ', {
|
|
33
|
-
'lw-w-full': !isDesktop,
|
|
34
|
-
'lw-w-[280px]': isDesktop,
|
|
35
|
-
})}
|
|
34
|
+
<div
|
|
35
|
+
className="lw-text-sm lw-tracking-normal"
|
|
36
|
+
data-testid="order-book-widget"
|
|
36
37
|
>
|
|
37
|
-
<
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
38
|
+
<Tabs
|
|
39
|
+
mobileFullWidth
|
|
40
|
+
activeTab={bookType}
|
|
41
|
+
handleClick={(e) => setBookType(e.currentTarget.value as BookType)}
|
|
42
|
+
items={navigationConfig}
|
|
43
|
+
labelCallback={lang}
|
|
44
|
+
/>
|
|
45
|
+
{!instrument && (
|
|
46
|
+
<div
|
|
47
|
+
className={classnames('lw-mb-6 lw-mt-12 ', {
|
|
48
|
+
'lw-w-full': !isDesktop,
|
|
49
|
+
'lw-w-[280px]': isDesktop,
|
|
50
|
+
})}
|
|
51
|
+
>
|
|
52
|
+
<Select
|
|
53
|
+
options={selectConfig}
|
|
54
|
+
searchPlaceholder={lang('search')}
|
|
55
|
+
selectLabel={lang('instrument')}
|
|
56
|
+
selectedOption={toolInstrument}
|
|
57
|
+
setSelectedOption={(val) =>
|
|
58
|
+
setToolInstrument(val as { id: InstrumentId; label: string })
|
|
59
|
+
}
|
|
60
|
+
/>
|
|
61
|
+
</div>
|
|
62
|
+
)}
|
|
63
|
+
<ChartWithData
|
|
64
|
+
bookType={bookType}
|
|
65
|
+
instrument={instrument || toolInstrument.id}
|
|
45
66
|
/>
|
|
46
67
|
</div>
|
|
47
|
-
)}
|
|
48
|
-
<ChartWithData instrument={instrument || toolInstrument.id} bookType={bookType} />
|
|
49
|
-
</div>
|
|
50
68
|
)}
|
|
51
69
|
</>
|
|
52
70
|
);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import { ApolloClient, InMemoryCache } from '@apollo/client';
|
|
3
2
|
import { WidgetProvider, WidgetWrapper } from '@oanda/labs-widget-common';
|
|
3
|
+
import React from 'react';
|
|
4
4
|
|
|
5
|
-
import { Main } from './Main';
|
|
6
|
-
import { OrderBookWidgetConfig } from './types';
|
|
7
5
|
import { translations } from '../translations';
|
|
6
|
+
import { Main } from './Main';
|
|
7
|
+
import type { OrderBookWidgetConfig } from './types';
|
|
8
8
|
|
|
9
9
|
const OrderBookWidget = ({
|
|
10
10
|
graphqlUrl,
|
|
@@ -22,17 +22,17 @@ const OrderBookWidget = ({
|
|
|
22
22
|
|
|
23
23
|
return (
|
|
24
24
|
<WidgetProvider
|
|
25
|
-
locale={locale}
|
|
26
|
-
translations={translations}
|
|
27
25
|
client={client}
|
|
26
|
+
locale={locale}
|
|
28
27
|
theme={theme}
|
|
28
|
+
translations={translations}
|
|
29
29
|
>
|
|
30
30
|
<WidgetWrapper
|
|
31
|
-
logoLink={logoLink}
|
|
32
|
-
linkArea="logo"
|
|
33
31
|
isParamError={isParamError}
|
|
32
|
+
linkArea="logo"
|
|
33
|
+
logoLink={logoLink}
|
|
34
34
|
>
|
|
35
|
-
<Main
|
|
35
|
+
<Main division={division} instrument={instrument} />
|
|
36
36
|
</WidgetWrapper>
|
|
37
37
|
</WidgetProvider>
|
|
38
38
|
);
|
|
@@ -1,24 +1,29 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import {
|
|
2
|
+
colorPalette,
|
|
3
|
+
getChartTheme,
|
|
4
|
+
Size,
|
|
5
|
+
Theme,
|
|
6
|
+
useLayoutProvider,
|
|
7
|
+
} from '@oanda/labs-widget-common';
|
|
8
|
+
import { useLocale } from '@oanda/mono-i18n';
|
|
4
9
|
import { CustomChart } from 'echarts/charts';
|
|
5
|
-
import { CanvasRenderer } from 'echarts/renderers';
|
|
6
10
|
import {
|
|
7
|
-
|
|
11
|
+
DatasetComponent,
|
|
12
|
+
DataZoomInsideComponent,
|
|
8
13
|
GraphicComponent,
|
|
9
|
-
|
|
10
|
-
TitleComponent,
|
|
14
|
+
GridSimpleComponent,
|
|
11
15
|
MarkLineComponent,
|
|
16
|
+
TitleComponent,
|
|
12
17
|
ToolboxComponent,
|
|
13
|
-
|
|
14
|
-
DatasetComponent,
|
|
18
|
+
TooltipComponent,
|
|
15
19
|
} from 'echarts/components';
|
|
16
|
-
import
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
import {
|
|
20
|
-
|
|
21
|
-
import {
|
|
20
|
+
import * as echarts from 'echarts/core';
|
|
21
|
+
import { CanvasRenderer } from 'echarts/renderers';
|
|
22
|
+
import ReactEChartsCore from 'echarts-for-react/lib/core';
|
|
23
|
+
import React, { useEffect, useRef } from 'react';
|
|
24
|
+
|
|
25
|
+
import { getOption, getResponsiveOption } from './getOption';
|
|
26
|
+
import type { ChartProps } from './types';
|
|
22
27
|
|
|
23
28
|
echarts.use([
|
|
24
29
|
GridSimpleComponent,
|
|
@@ -41,16 +46,16 @@ export const Chart = ({ data, isOrderBook, precision }: ChartProps) => {
|
|
|
41
46
|
const { isDark, size } = useLayoutProvider();
|
|
42
47
|
const isDesktop = size === Size.DESKTOP;
|
|
43
48
|
|
|
44
|
-
const echartRef = useRef(null);
|
|
49
|
+
const echartRef = useRef<ReactEChartsCore | null>(null);
|
|
45
50
|
|
|
46
51
|
useEffect(() => {
|
|
47
52
|
if (echartRef.current) {
|
|
48
|
-
|
|
49
|
-
const echartInstance = echartRef.current.getEchartsInstance() as echarts.EChartsType;
|
|
53
|
+
const echartInstance = echartRef.current.getEchartsInstance();
|
|
50
54
|
|
|
51
55
|
echartInstance.on('highlight', () => {
|
|
52
|
-
if (
|
|
53
|
-
echartInstance.getOption().color as echarts.Color[])[0] ===
|
|
56
|
+
if (
|
|
57
|
+
(echartInstance.getOption().color as echarts.Color[])[0] ===
|
|
58
|
+
colorPalette.bottleGreenLight
|
|
54
59
|
) {
|
|
55
60
|
echartInstance.setOption({
|
|
56
61
|
color: [
|
|
@@ -74,13 +79,15 @@ export const Chart = ({ data, isOrderBook, precision }: ChartProps) => {
|
|
|
74
79
|
|
|
75
80
|
useEffect(() => {
|
|
76
81
|
if (echartRef.current) {
|
|
77
|
-
|
|
78
|
-
const echartInstance = echartRef.current.getEchartsInstance() as echarts.EChartsType;
|
|
82
|
+
const echartInstance = echartRef.current.getEchartsInstance();
|
|
79
83
|
|
|
80
84
|
echartInstance.setOption(
|
|
81
85
|
getResponsiveOption({
|
|
82
|
-
isDark,
|
|
83
|
-
|
|
86
|
+
isDark,
|
|
87
|
+
isOrderBook,
|
|
88
|
+
isDesktop,
|
|
89
|
+
lang,
|
|
90
|
+
})
|
|
84
91
|
);
|
|
85
92
|
}
|
|
86
93
|
}, [echartRef, isDesktop, isDark, isOrderBook, lang]);
|
|
@@ -90,16 +97,21 @@ export const Chart = ({ data, isOrderBook, precision }: ChartProps) => {
|
|
|
90
97
|
<div>
|
|
91
98
|
{data && (
|
|
92
99
|
<ReactEChartsCore
|
|
93
|
-
echarts={echarts}
|
|
94
100
|
ref={echartRef}
|
|
95
|
-
|
|
101
|
+
echarts={echarts}
|
|
102
|
+
option={getOption({
|
|
103
|
+
data,
|
|
104
|
+
precision,
|
|
105
|
+
isDark,
|
|
106
|
+
isOrderBook,
|
|
107
|
+
isDesktop,
|
|
108
|
+
lang,
|
|
109
|
+
})}
|
|
96
110
|
style={{
|
|
97
111
|
height: isDesktop ? '450px' : '390px',
|
|
98
112
|
width: '100%',
|
|
99
113
|
}}
|
|
100
|
-
|
|
101
|
-
data, precision, isDark, isOrderBook, isDesktop, lang,
|
|
102
|
-
})}
|
|
114
|
+
theme={isDark ? 'dark_theme' : 'light_theme'}
|
|
103
115
|
/>
|
|
104
116
|
)}
|
|
105
117
|
</div>
|
|
@@ -1,11 +1,18 @@
|
|
|
1
|
-
import { TooltipFormatterType } from './types';
|
|
1
|
+
import type { TooltipFormatterType } from './types';
|
|
2
2
|
|
|
3
3
|
const tooltipFormatter: TooltipFormatterType = ({
|
|
4
|
-
data,
|
|
4
|
+
data,
|
|
5
|
+
precision,
|
|
6
|
+
isOrderBook,
|
|
7
|
+
lang,
|
|
5
8
|
}) => {
|
|
6
9
|
const priceText = `${lang('price')}: ${data[0].toFixed(precision)}`;
|
|
7
|
-
const buyText = data[1]
|
|
8
|
-
|
|
10
|
+
const buyText = data[1]
|
|
11
|
+
? `<br />${lang(isOrderBook ? 'buy' : 'long_positions')}: ${data[1]}%`
|
|
12
|
+
: '';
|
|
13
|
+
const sellText = data[2]
|
|
14
|
+
? `<br />${lang(isOrderBook ? 'sell' : 'short_positions')}: ${data[2] * -1}%`
|
|
15
|
+
: '';
|
|
9
16
|
|
|
10
17
|
return priceText + buyText + sellText;
|
|
11
18
|
};
|