@oanda/labs-value-at-risk-widget 1.0.28 → 1.0.29
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 +120 -0
- package/dist/main/ValueAtRiskWidget/ChartWithData.js +2 -1
- package/dist/main/ValueAtRiskWidget/ChartWithData.js.map +1 -1
- package/dist/module/ValueAtRiskWidget/ChartWithData.js +2 -1
- package/dist/module/ValueAtRiskWidget/ChartWithData.js.map +1 -1
- package/package.json +3 -3
- package/src/ValueAtRiskWidget/ChartWithData.tsx +3 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,126 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## 1.0.29 (2024-07-05)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
## 1.0.136 (2024-07-03)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## 1.0.135 (2024-07-03)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
## 1.0.134 (2024-07-03)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
## 1.0.133 (2024-06-28)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
## 1.0.132 (2024-06-27)
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
## 1.0.131 (2024-06-27)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
## 1.0.130 (2024-06-26)
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
## 1.0.129 (2024-06-17)
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
## 1.0.128 (2024-06-17)
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
## 1.0.127 (2024-06-10)
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
## 1.0.126 (2024-05-29)
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
## 1.0.125 (2024-05-29)
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
## 1.0.124 (2024-05-29)
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
## 1.0.123 (2024-05-28)
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
## 1.0.122 (2024-05-27)
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
## 1.0.121 (2024-05-27)
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
## 1.0.120 (2024-05-24)
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
## 1.0.119 (2024-05-17)
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
## 1.0.118 (2024-05-09)
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
## 1.0.117 (2024-05-07)
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
## 1.0.116 (2024-04-23)
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
## 1.0.115 (2024-04-22)
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
## 1.0.114 (2024-04-19)
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
## 1.0.113 (2024-04-19)
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
## 1.0.112 (2024-04-15)
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
## 1.0.111 (2024-04-11)
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
## 1.0.110 (2024-04-05)
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
## 1.0.109 (2024-04-05)
|
|
119
|
+
|
|
120
|
+
**Note:** Version bump only for package @oanda/labs-value-at-risk-widget
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
|
|
6
126
|
## 1.0.28 (2024-07-03)
|
|
7
127
|
|
|
8
128
|
|
|
@@ -40,6 +40,7 @@ const ChartWithData = _ref => {
|
|
|
40
40
|
skip: !instrument
|
|
41
41
|
});
|
|
42
42
|
const showChart = data?.valueAtRiskChart?.down?.points && data.valueAtRiskChart.down.points.length > 0 && data?.valueAtRiskChart?.up?.points && data.valueAtRiskChart.up.points.length > 0;
|
|
43
|
+
const showError = !!error || !loading && !showChart;
|
|
43
44
|
return _react.default.createElement(_react.default.Fragment, null, (loading || !instrument) && _react.default.createElement("div", {
|
|
44
45
|
className: (0, _classnames.default)('lw-flex lw-w-full lw-items-center lw-border lw-border-solid lw-border-border-primary', {
|
|
45
46
|
'lw-h-[460px]': isDesktop,
|
|
@@ -54,7 +55,7 @@ const ChartWithData = _ref => {
|
|
|
54
55
|
data: data
|
|
55
56
|
}), _react.default.createElement(_Chart.Chart, {
|
|
56
57
|
values: data
|
|
57
|
-
})),
|
|
58
|
+
})), showError && _react.default.createElement("div", {
|
|
58
59
|
className: "lw-flex lw-h-[460px] lw-w-full lw-items-center lw-border lw-border-solid lw-border-border-primary"
|
|
59
60
|
}, _react.default.createElement(_labsWidgetCommon.ChartError, null)));
|
|
60
61
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChartWithData.js","names":["_react","_interopRequireWildcard","require","_classnames","_interopRequireDefault","_client","_labsWidgetCommon","_Chart","_getValueAtRiskChart","_Legend","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","ChartWithData","_ref","instrument","duration","bars","division","size","useContext","ThemeContext","isDesktop","Size","DESKTOP","loading","data","error","useQuery","getValueAtRiskChart","variables","fetchPolicy","skip","showChart","valueAtRiskChart","down","points","length","up","createElement","Fragment","className","classnames","Spinner","SpinnerSize","lg","Legend","Chart","values","ChartError","exports"],"sources":["../../../src/ValueAtRiskWidget/ChartWithData.tsx"],"sourcesContent":["import React, { useContext } from 'react';\nimport classnames from 'classnames';\nimport { useQuery } from '@apollo/client';\nimport {\n ChartError, Size, Spinner, SpinnerSize,\n ThemeContext,\n} from '@oanda/labs-widget-common';\nimport { Chart } from './components/Chart';\nimport { getValueAtRiskChart } from '../gql/getValueAtRiskChart';\nimport { ChartWithDataProps } from './types';\nimport { GetValueAtRiskChartQuery, GetValueAtRiskChartQueryVariables } from '../gql/types/graphql';\nimport { Legend } from './components/Legend';\n\nconst ChartWithData = ({\n instrument, duration, bars, division,\n}: ChartWithDataProps) => {\n const { size } = useContext(ThemeContext);\n const isDesktop = size === Size.DESKTOP;\n\n const { loading, data, error } = useQuery<\n GetValueAtRiskChartQuery, GetValueAtRiskChartQueryVariables>(getValueAtRiskChart, {\n variables: {\n instrument, division, duration, bars,\n },\n fetchPolicy: 'cache-and-network',\n skip: !instrument,\n });\n\n const showChart = data?.valueAtRiskChart?.down?.points\n && data.valueAtRiskChart.down.points.length > 0\n && data?.valueAtRiskChart?.up?.points\n && data.valueAtRiskChart.up.points.length > 0;\n\n return (\n <>\n {(loading || !instrument)\n && (\n <div className={classnames('lw-flex lw-w-full lw-items-center lw-border lw-border-solid lw-border-border-primary', {\n 'lw-h-[460px]': isDesktop,\n 'lw-h-[566px]': !isDesktop,\n })}\n >\n <Spinner size={SpinnerSize.lg} />\n </div>\n )}\n {!loading && showChart && (\n <div data-testid=\"value-at-risk-chart\" className=\"lw-relative\">\n <Legend data={data} />\n <Chart values={data} />\n </div>\n )}\n {
|
|
1
|
+
{"version":3,"file":"ChartWithData.js","names":["_react","_interopRequireWildcard","require","_classnames","_interopRequireDefault","_client","_labsWidgetCommon","_Chart","_getValueAtRiskChart","_Legend","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","ChartWithData","_ref","instrument","duration","bars","division","size","useContext","ThemeContext","isDesktop","Size","DESKTOP","loading","data","error","useQuery","getValueAtRiskChart","variables","fetchPolicy","skip","showChart","valueAtRiskChart","down","points","length","up","showError","createElement","Fragment","className","classnames","Spinner","SpinnerSize","lg","Legend","Chart","values","ChartError","exports"],"sources":["../../../src/ValueAtRiskWidget/ChartWithData.tsx"],"sourcesContent":["import React, { useContext } from 'react';\nimport classnames from 'classnames';\nimport { useQuery } from '@apollo/client';\nimport {\n ChartError, Size, Spinner, SpinnerSize,\n ThemeContext,\n} from '@oanda/labs-widget-common';\nimport { Chart } from './components/Chart';\nimport { getValueAtRiskChart } from '../gql/getValueAtRiskChart';\nimport { ChartWithDataProps } from './types';\nimport { GetValueAtRiskChartQuery, GetValueAtRiskChartQueryVariables } from '../gql/types/graphql';\nimport { Legend } from './components/Legend';\n\nconst ChartWithData = ({\n instrument, duration, bars, division,\n}: ChartWithDataProps) => {\n const { size } = useContext(ThemeContext);\n const isDesktop = size === Size.DESKTOP;\n\n const { loading, data, error } = useQuery<\n GetValueAtRiskChartQuery, GetValueAtRiskChartQueryVariables>(getValueAtRiskChart, {\n variables: {\n instrument, division, duration, bars,\n },\n fetchPolicy: 'cache-and-network',\n skip: !instrument,\n });\n\n const showChart = data?.valueAtRiskChart?.down?.points\n && data.valueAtRiskChart.down.points.length > 0\n && data?.valueAtRiskChart?.up?.points\n && data.valueAtRiskChart.up.points.length > 0;\n\n const showError = !!error || (!loading && !showChart);\n\n return (\n <>\n {(loading || !instrument)\n && (\n <div className={classnames('lw-flex lw-w-full lw-items-center lw-border lw-border-solid lw-border-border-primary', {\n 'lw-h-[460px]': isDesktop,\n 'lw-h-[566px]': !isDesktop,\n })}\n >\n <Spinner size={SpinnerSize.lg} />\n </div>\n )}\n {!loading && showChart && (\n <div data-testid=\"value-at-risk-chart\" className=\"lw-relative\">\n <Legend data={data} />\n <Chart values={data} />\n </div>\n )}\n {showError && (\n <div className=\"lw-flex lw-h-[460px] lw-w-full lw-items-center lw-border lw-border-solid lw-border-border-primary\">\n <ChartError />\n </div>\n )}\n </>\n );\n};\n\nexport { ChartWithData };\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,WAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,iBAAA,GAAAJ,OAAA;AAIA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,oBAAA,GAAAN,OAAA;AAGA,IAAAO,OAAA,GAAAP,OAAA;AAA6C,SAAAE,uBAAAM,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,yBAAAH,CAAA,6BAAAI,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAD,wBAAA,YAAAA,CAAAH,CAAA,WAAAA,CAAA,GAAAM,CAAA,GAAAD,CAAA,KAAAL,CAAA;AAAA,SAAAT,wBAAAS,CAAA,EAAAK,CAAA,SAAAA,CAAA,IAAAL,CAAA,IAAAA,CAAA,CAAAC,UAAA,SAAAD,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAE,OAAA,EAAAF,CAAA,QAAAM,CAAA,GAAAH,wBAAA,CAAAE,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAC,GAAA,CAAAP,CAAA,UAAAM,CAAA,CAAAE,GAAA,CAAAR,CAAA,OAAAS,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAf,CAAA,oBAAAe,CAAA,OAAAC,cAAA,CAAAC,IAAA,CAAAjB,CAAA,EAAAe,CAAA,SAAAG,CAAA,GAAAP,CAAA,G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AAU;EAErD,OACElD,MAAA,CAAAY,OAAA,CAAA6C,aAAA,CAAAzD,MAAA,CAAAY,OAAA,CAAA8C,QAAA,QACG,CAAChB,OAAO,IAAI,CAACV,UAAU,KAExBhC,MAAA,CAAAY,OAAA,CAAA6C,aAAA;IAAKE,SAAS,EAAE,IAAAC,mBAAU,EAAC,sFAAsF,EAAE;MACjH,cAAc,EAAErB,SAAS;MACzB,cAAc,EAAE,CAACA;IACnB,CAAC;EAAE,GAEDvC,MAAA,CAAAY,OAAA,CAAA6C,aAAA,CAACnD,iBAAA,CAAAuD,OAAO;IAACzB,IAAI,EAAE0B,6BAAW,CAACC;EAAG,CAAE,CAC7B,CACJ,EACA,CAACrB,OAAO,IAAIQ,SAAS,IACtBlD,MAAA,CAAAY,OAAA,CAAA6C,aAAA;IAAK,eAAY,qBAAqB;IAACE,SAAS,EAAC;EAAa,GAC5D3D,MAAA,CAAAY,OAAA,CAAA6C,aAAA,CAAChD,OAAA,CAAAuD,MAAM;IAACrB,IAAI,EAAEA;EAAK,CAAE,CAAC,EACtB3C,MAAA,CAAAY,OAAA,CAAA6C,aAAA,CAAClD,MAAA,CAAA0D,KAAK;IAACC,MAAM,EAAEvB;EAAK,CAAE,CACnB,CACJ,EACAa,SAAS,IACRxD,MAAA,CAAAY,OAAA,CAAA6C,aAAA;IAAKE,SAAS,EAAC;EAAmG,GAChH3D,MAAA,CAAAY,OAAA,CAAA6C,aAAA,CAACnD,iBAAA,CAAA6D,UAAU,MAAE,CACV,CAEP,CAAC;AAEP,CAAC;AAACC,OAAA,CAAAtC,aAAA,GAAAA,aAAA","ignoreList":[]}
|
|
@@ -31,6 +31,7 @@ const ChartWithData = _ref => {
|
|
|
31
31
|
skip: !instrument
|
|
32
32
|
});
|
|
33
33
|
const showChart = data?.valueAtRiskChart?.down?.points && data.valueAtRiskChart.down.points.length > 0 && data?.valueAtRiskChart?.up?.points && data.valueAtRiskChart.up.points.length > 0;
|
|
34
|
+
const showError = !!error || !loading && !showChart;
|
|
34
35
|
return React.createElement(React.Fragment, null, (loading || !instrument) && React.createElement("div", {
|
|
35
36
|
className: classnames('lw-flex lw-w-full lw-items-center lw-border lw-border-solid lw-border-border-primary', {
|
|
36
37
|
'lw-h-[460px]': isDesktop,
|
|
@@ -45,7 +46,7 @@ const ChartWithData = _ref => {
|
|
|
45
46
|
data: data
|
|
46
47
|
}), React.createElement(Chart, {
|
|
47
48
|
values: data
|
|
48
|
-
})),
|
|
49
|
+
})), showError && React.createElement("div", {
|
|
49
50
|
className: "lw-flex lw-h-[460px] lw-w-full lw-items-center lw-border lw-border-solid lw-border-border-primary"
|
|
50
51
|
}, React.createElement(ChartError, null)));
|
|
51
52
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChartWithData.js","names":["React","useContext","classnames","useQuery","ChartError","Size","Spinner","SpinnerSize","ThemeContext","Chart","getValueAtRiskChart","Legend","ChartWithData","_ref","instrument","duration","bars","division","size","isDesktop","DESKTOP","loading","data","error","variables","fetchPolicy","skip","showChart","valueAtRiskChart","down","points","length","up","createElement","Fragment","className","lg","values"],"sources":["../../../src/ValueAtRiskWidget/ChartWithData.tsx"],"sourcesContent":["import React, { useContext } from 'react';\nimport classnames from 'classnames';\nimport { useQuery } from '@apollo/client';\nimport {\n ChartError, Size, Spinner, SpinnerSize,\n ThemeContext,\n} from '@oanda/labs-widget-common';\nimport { Chart } from './components/Chart';\nimport { getValueAtRiskChart } from '../gql/getValueAtRiskChart';\nimport { ChartWithDataProps } from './types';\nimport { GetValueAtRiskChartQuery, GetValueAtRiskChartQueryVariables } from '../gql/types/graphql';\nimport { Legend } from './components/Legend';\n\nconst ChartWithData = ({\n instrument, duration, bars, division,\n}: ChartWithDataProps) => {\n const { size } = useContext(ThemeContext);\n const isDesktop = size === Size.DESKTOP;\n\n const { loading, data, error } = useQuery<\n GetValueAtRiskChartQuery, GetValueAtRiskChartQueryVariables>(getValueAtRiskChart, {\n variables: {\n instrument, division, duration, bars,\n },\n fetchPolicy: 'cache-and-network',\n skip: !instrument,\n });\n\n const showChart = data?.valueAtRiskChart?.down?.points\n && data.valueAtRiskChart.down.points.length > 0\n && data?.valueAtRiskChart?.up?.points\n && data.valueAtRiskChart.up.points.length > 0;\n\n return (\n <>\n {(loading || !instrument)\n && (\n <div className={classnames('lw-flex lw-w-full lw-items-center lw-border lw-border-solid lw-border-border-primary', {\n 'lw-h-[460px]': isDesktop,\n 'lw-h-[566px]': !isDesktop,\n })}\n >\n <Spinner size={SpinnerSize.lg} />\n </div>\n )}\n {!loading && showChart && (\n <div data-testid=\"value-at-risk-chart\" className=\"lw-relative\">\n <Legend data={data} />\n <Chart values={data} />\n </div>\n )}\n {
|
|
1
|
+
{"version":3,"file":"ChartWithData.js","names":["React","useContext","classnames","useQuery","ChartError","Size","Spinner","SpinnerSize","ThemeContext","Chart","getValueAtRiskChart","Legend","ChartWithData","_ref","instrument","duration","bars","division","size","isDesktop","DESKTOP","loading","data","error","variables","fetchPolicy","skip","showChart","valueAtRiskChart","down","points","length","up","showError","createElement","Fragment","className","lg","values"],"sources":["../../../src/ValueAtRiskWidget/ChartWithData.tsx"],"sourcesContent":["import React, { useContext } from 'react';\nimport classnames from 'classnames';\nimport { useQuery } from '@apollo/client';\nimport {\n ChartError, Size, Spinner, SpinnerSize,\n ThemeContext,\n} from '@oanda/labs-widget-common';\nimport { Chart } from './components/Chart';\nimport { getValueAtRiskChart } from '../gql/getValueAtRiskChart';\nimport { ChartWithDataProps } from './types';\nimport { GetValueAtRiskChartQuery, GetValueAtRiskChartQueryVariables } from '../gql/types/graphql';\nimport { Legend } from './components/Legend';\n\nconst ChartWithData = ({\n instrument, duration, bars, division,\n}: ChartWithDataProps) => {\n const { size } = useContext(ThemeContext);\n const isDesktop = size === Size.DESKTOP;\n\n const { loading, data, error } = useQuery<\n GetValueAtRiskChartQuery, GetValueAtRiskChartQueryVariables>(getValueAtRiskChart, {\n variables: {\n instrument, division, duration, bars,\n },\n fetchPolicy: 'cache-and-network',\n skip: !instrument,\n });\n\n const showChart = data?.valueAtRiskChart?.down?.points\n && data.valueAtRiskChart.down.points.length > 0\n && data?.valueAtRiskChart?.up?.points\n && data.valueAtRiskChart.up.points.length > 0;\n\n const showError = !!error || (!loading && !showChart);\n\n return (\n <>\n {(loading || !instrument)\n && (\n <div className={classnames('lw-flex lw-w-full lw-items-center lw-border lw-border-solid lw-border-border-primary', {\n 'lw-h-[460px]': isDesktop,\n 'lw-h-[566px]': !isDesktop,\n })}\n >\n <Spinner size={SpinnerSize.lg} />\n </div>\n )}\n {!loading && showChart && (\n <div data-testid=\"value-at-risk-chart\" className=\"lw-relative\">\n <Legend data={data} />\n <Chart values={data} />\n </div>\n )}\n {showError && (\n <div className=\"lw-flex lw-h-[460px] lw-w-full lw-items-center lw-border lw-border-solid lw-border-border-primary\">\n <ChartError />\n </div>\n )}\n </>\n );\n};\n\nexport { ChartWithData };\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,UAAU,QAAQ,OAAO;AACzC,OAAOC,UAAU,MAAM,YAAY;AACnC,SAASC,QAAQ,QAAQ,gBAAgB;AACzC,SACEC,UAAU,EAAEC,IAAI,EAAEC,OAAO,EAAEC,WAAW,EACtCC,YAAY,QACP,2BAA2B;AAClC,SAASC,KAAK,QAAQ,oBAAoB;AAC1C,SAASC,mBAAmB,QAAQ,4BAA4B;AAGhE,SAASC,MAAM,QAAQ,qBAAqB;AAE5C,MAAMC,aAAa,GAAGC,IAAA,IAEI;EAAA,IAFH;IACrBC,UAAU;IAAEC,QAAQ;IAAEC,IAAI;IAAEC;EACV,CAAC,GAAAJ,IAAA;EACnB,MAAM;IAAEK;EAAK,CAAC,GAAGjB,UAAU,CAACO,YAAY,CAAC;EACzC,MAAMW,SAAS,GAAGD,IAAI,KAAKb,IAAI,CAACe,OAAO;EAEvC,MAAM;IAAEC,OAAO;IAAEC,IAAI;IAAEC;EAAM,CAAC,GAAGpB,QAAQ,CACoBO,mBAAmB,EAAE;IAChFc,SAAS,EAA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CAEP,CAAC;AAEP,CAAC;AAED,SAASQ,aAAa","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oanda/labs-value-at-risk-widget",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.29",
|
|
4
4
|
"description": "Labs Value At Risk Widget",
|
|
5
5
|
"main": "dist/main/index.js",
|
|
6
6
|
"module": "dist/module/index.js",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"license": "UNLICENSED",
|
|
14
14
|
"dependencies": {
|
|
15
15
|
"@apollo/client": "3.7.17",
|
|
16
|
-
"@oanda/labs-widget-common": "^1.0.
|
|
16
|
+
"@oanda/labs-widget-common": "^1.0.137",
|
|
17
17
|
"@oanda/mono-i18n": "10.0.1",
|
|
18
18
|
"echarts": "5.5.0",
|
|
19
19
|
"echarts-for-react": "3.0.2",
|
|
@@ -24,5 +24,5 @@
|
|
|
24
24
|
"@graphql-codegen/client-preset": "4.1.0",
|
|
25
25
|
"@graphql-codegen/typescript": "4.0.1"
|
|
26
26
|
},
|
|
27
|
-
"gitHead": "
|
|
27
|
+
"gitHead": "6e5bed1a4bc82e3a66d48d167ad3179f0ac23819"
|
|
28
28
|
}
|
|
@@ -31,6 +31,8 @@ const ChartWithData = ({
|
|
|
31
31
|
&& data?.valueAtRiskChart?.up?.points
|
|
32
32
|
&& data.valueAtRiskChart.up.points.length > 0;
|
|
33
33
|
|
|
34
|
+
const showError = !!error || (!loading && !showChart);
|
|
35
|
+
|
|
34
36
|
return (
|
|
35
37
|
<>
|
|
36
38
|
{(loading || !instrument)
|
|
@@ -49,7 +51,7 @@ const ChartWithData = ({
|
|
|
49
51
|
<Chart values={data} />
|
|
50
52
|
</div>
|
|
51
53
|
)}
|
|
52
|
-
{
|
|
54
|
+
{showError && (
|
|
53
55
|
<div className="lw-flex lw-h-[460px] lw-w-full lw-items-center lw-border lw-border-solid lw-border-border-primary">
|
|
54
56
|
<ChartError />
|
|
55
57
|
</div>
|