@oanda/labs-currency-strength-widget 1.0.93 → 1.0.95

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.
Files changed (34) hide show
  1. package/CHANGELOG.md +764 -0
  2. package/dist/main/CurrencyStrengthWidget/ChartsWithData.js +11 -15
  3. package/dist/main/CurrencyStrengthWidget/ChartsWithData.js.map +1 -1
  4. package/dist/main/CurrencyStrengthWidget/Main.js +2 -2
  5. package/dist/main/CurrencyStrengthWidget/Main.js.map +1 -1
  6. package/dist/main/CurrencyStrengthWidget/components/Chart/Chart.js +1 -1
  7. package/dist/main/CurrencyStrengthWidget/components/Chart/Chart.js.map +1 -1
  8. package/dist/main/CurrencyStrengthWidget/components/Chart/formatters.js +5 -1
  9. package/dist/main/CurrencyStrengthWidget/components/Chart/formatters.js.map +1 -1
  10. package/dist/main/CurrencyStrengthWidget/components/Chart/getOption.js +3 -3
  11. package/dist/main/CurrencyStrengthWidget/components/Chart/getOption.js.map +1 -1
  12. package/dist/main/gql/getCurrencyStrength.js +12 -3
  13. package/dist/main/gql/getCurrencyStrength.js.map +1 -1
  14. package/dist/main/gql/types/fragment-masking.js +2 -3
  15. package/dist/main/gql/types/fragment-masking.js.map +1 -1
  16. package/dist/main/gql/types/gql.js +1 -2
  17. package/dist/main/gql/types/gql.js.map +1 -1
  18. package/dist/module/CurrencyStrengthWidget/ChartsWithData.js +11 -15
  19. package/dist/module/CurrencyStrengthWidget/ChartsWithData.js.map +1 -1
  20. package/dist/module/CurrencyStrengthWidget/Main.js +2 -2
  21. package/dist/module/CurrencyStrengthWidget/Main.js.map +1 -1
  22. package/dist/module/CurrencyStrengthWidget/components/Chart/Chart.js +1 -1
  23. package/dist/module/CurrencyStrengthWidget/components/Chart/Chart.js.map +1 -1
  24. package/dist/module/CurrencyStrengthWidget/components/Chart/formatters.js +5 -1
  25. package/dist/module/CurrencyStrengthWidget/components/Chart/formatters.js.map +1 -1
  26. package/dist/module/CurrencyStrengthWidget/components/Chart/getOption.js +3 -3
  27. package/dist/module/CurrencyStrengthWidget/components/Chart/getOption.js.map +1 -1
  28. package/dist/module/gql/getCurrencyStrength.js +12 -3
  29. package/dist/module/gql/getCurrencyStrength.js.map +1 -1
  30. package/dist/module/gql/types/fragment-masking.js +2 -3
  31. package/dist/module/gql/types/fragment-masking.js.map +1 -1
  32. package/dist/module/gql/types/gql.js +1 -2
  33. package/dist/module/gql/types/gql.js.map +1 -1
  34. package/package.json +3 -3
@@ -14,7 +14,6 @@ var _Chart = require("./components/Chart");
14
14
  var _formatters = require("./components/Chart/formatters");
15
15
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
16
16
  const ChartWithData = _ref => {
17
- var _data$currencyStrengt, _data$currencyStrengt2, _data$currencyStrengt3, _data$currencyStrengt4, _;
18
17
  let {
19
18
  currency
20
19
  } = _ref;
@@ -32,9 +31,9 @@ const ChartWithData = _ref => {
32
31
  } = (0, _client.useQuery)(_getCurrencyStrength.getCurrencyStrength, {
33
32
  fetchPolicy: 'cache-and-network'
34
33
  });
35
- const showChart = (data === null || data === void 0 ? void 0 : data.currencyStrength) && (data === null || data === void 0 || (_data$currencyStrengt = data.currencyStrength) === null || _data$currencyStrengt === void 0 ? void 0 : _data$currencyStrengt.length) > 0;
36
- const showError = (data === null || data === void 0 || (_data$currencyStrengt2 = data.currencyStrength) === null || _data$currencyStrengt2 === void 0 ? void 0 : _data$currencyStrengt2.length) === 0 || error;
37
- const currencyData = currency ? data === null || data === void 0 || (_data$currencyStrengt3 = data.currencyStrength) === null || _data$currencyStrengt3 === void 0 ? void 0 : _data$currencyStrengt3.filter(item => item.currency === currency) : data === null || data === void 0 || (_data$currencyStrengt4 = data.currencyStrength) === null || _data$currencyStrengt4 === void 0 ? void 0 : _data$currencyStrengt4.slice().sort(_formatters.sortCurrencies);
34
+ const showChart = data?.currencyStrength && data?.currencyStrength?.length > 0;
35
+ const showError = data?.currencyStrength?.length === 0 || error;
36
+ const currencyData = currency ? data?.currencyStrength?.filter(item => item.currency === currency) : data?.currencyStrength?.slice().sort(_formatters.sortCurrencies);
38
37
  return _react.default.createElement(_react.default.Fragment, null, loading && _react.default.createElement("div", {
39
38
  className: (0, _classnames.default)('lw-flex lw-w-full lw-items-center lw-border lw-border-solid lw-border-border-primary', {
40
39
  'lw-h-[461px]': !currency,
@@ -48,16 +47,13 @@ const ChartWithData = _ref => {
48
47
  'lw-grid-cols-1': !isDesktop || currency
49
48
  }),
50
49
  "data-testid": "currency-strength-chart-wrapper"
51
- }, currencyData && currencyData.map(item => {
52
- var _item$strengthRelatio;
53
- return _react.default.createElement("div", {
54
- key: item.currency,
55
- className: "lw-flex lw-h-[135px] lw-flex-1 lw-items-center lw-justify-center"
56
- }, _react.default.createElement(_Chart.Chart, {
57
- currency: item.currency,
58
- values: (_item$strengthRelatio = item.strengthRelation) === null || _item$strengthRelatio === void 0 ? void 0 : _item$strengthRelatio.slice().sort(_formatters.sortCurrencies)
59
- }));
60
- })), !loading && showError && _react.default.createElement("div", {
50
+ }, currencyData && currencyData.map(item => _react.default.createElement("div", {
51
+ key: item.currency,
52
+ className: "lw-flex lw-h-[135px] lw-flex-1 lw-items-center lw-justify-center"
53
+ }, _react.default.createElement(_Chart.Chart, {
54
+ currency: item.currency,
55
+ values: item.strengthRelation?.slice().sort(_formatters.sortCurrencies)
56
+ })))), !loading && showError && _react.default.createElement("div", {
61
57
  className: (0, _classnames.default)('lw-flex lw-w-full lw-items-center lw-border lw-border-solid lw-border-border-primary', {
62
58
  'lw-h-[425px]': !currency,
63
59
  'lw-h-[135px]': currency
@@ -66,7 +62,7 @@ const ChartWithData = _ref => {
66
62
  className: "lw-mt-2 lw-h-8"
67
63
  }, _react.default.createElement(_labsWidgetCommon.LastUpdated, {
68
64
  labelCallback: lang,
69
- timestamp: data === null || data === void 0 || (_ = data.currencyStrength[0]) === null || _ === void 0 ? void 0 : _.updatedAt
65
+ timestamp: data?.currencyStrength[0]?.updatedAt
70
66
  })));
71
67
  };
72
68
  exports.ChartWithData = ChartWithData;
@@ -1 +1 @@
1
- {"version":3,"file":"ChartsWithData.js","names":["_client","require","_labsWidgetCommon","_monoI18n","_classnames","_interopRequireDefault","_react","_getCurrencyStrength","_Chart","_formatters","e","__esModule","default","ChartWithData","_ref","_data$currencyStrengt","_data$currencyStrengt2","_data$currencyStrengt3","_data$currencyStrengt4","_","currency","size","useLayoutProvider","isDesktop","Size","DESKTOP","lang","useLocale","loading","data","error","useQuery","getCurrencyStrength","fetchPolicy","showChart","currencyStrength","length","showError","currencyData","filter","item","slice","sort","sortCurrencies","createElement","Fragment","className","classnames","Spinner","SpinnerSize","lg","map","_item$strengthRelatio","key","Chart","values","strengthRelation","ChartError","LastUpdated","labelCallback","timestamp","updatedAt","exports"],"sources":["../../../src/CurrencyStrengthWidget/ChartsWithData.tsx"],"sourcesContent":["import { useQuery } from '@apollo/client';\nimport {\n ChartError,\n LastUpdated,\n Size,\n Spinner,\n SpinnerSize,\n useLayoutProvider,\n} from '@oanda/labs-widget-common';\nimport { useLocale } from '@oanda/mono-i18n';\nimport classnames from 'classnames';\nimport React from 'react';\n\nimport { getCurrencyStrength } from '../gql/getCurrencyStrength';\nimport type { GetCurrencyStrengthQuery } from '../gql/types/graphql';\nimport { Chart } from './components/Chart';\nimport { sortCurrencies } from './components/Chart/formatters';\nimport type { WidgetProps } from './types';\n\nconst ChartWithData = ({ currency }: WidgetProps) => {\n const { size } = useLayoutProvider();\n const isDesktop = size === Size.DESKTOP;\n const { lang } = useLocale();\n const { loading, data, error } = useQuery<GetCurrencyStrengthQuery>(\n getCurrencyStrength,\n {\n fetchPolicy: 'cache-and-network',\n }\n );\n\n const showChart =\n data?.currencyStrength && data?.currencyStrength?.length > 0;\n const showError = data?.currencyStrength?.length === 0 || error;\n\n const currencyData = currency\n ? data?.currencyStrength?.filter((item) => item.currency === currency)\n : data?.currencyStrength?.slice().sort(sortCurrencies);\n\n return (\n <>\n {loading && (\n <div\n className={classnames(\n 'lw-flex lw-w-full lw-items-center lw-border lw-border-solid lw-border-border-primary',\n {\n 'lw-h-[461px]': !currency,\n 'lw-h-[135px]': currency,\n }\n )}\n >\n <Spinner size={SpinnerSize.lg} />\n </div>\n )}\n {!loading && showChart && (\n <div\n className={classnames('lw-grid lw-place-content-center lw-gap-7', {\n 'lw-grid-cols-3 ': isDesktop && !currency,\n 'lw-grid-cols-1': !isDesktop || currency,\n })}\n data-testid=\"currency-strength-chart-wrapper\"\n >\n {currencyData &&\n currencyData.map((item) => (\n <div\n key={item.currency}\n className=\"lw-flex lw-h-[135px] lw-flex-1 lw-items-center lw-justify-center\"\n >\n <Chart\n currency={item.currency}\n values={item.strengthRelation?.slice().sort(sortCurrencies)!}\n />\n </div>\n ))}\n </div>\n )}\n {!loading && showError && (\n <div\n className={classnames(\n 'lw-flex lw-w-full lw-items-center lw-border lw-border-solid lw-border-border-primary',\n {\n 'lw-h-[425px]': !currency,\n 'lw-h-[135px]': currency,\n }\n )}\n >\n <ChartError />\n </div>\n )}\n {!loading && !showError && (\n <div className=\"lw-mt-2 lw-h-8\">\n <LastUpdated\n labelCallback={lang}\n timestamp={data?.currencyStrength![0]?.updatedAt}\n />\n </div>\n )}\n </>\n );\n};\n\nexport { ChartWithData };\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAD,OAAA;AAQA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAD,sBAAA,CAAAJ,OAAA;AAEA,IAAAM,oBAAA,GAAAN,OAAA;AAEA,IAAAO,MAAA,GAAAP,OAAA;AACA,IAAAQ,WAAA,GAAAR,OAAA;AAA+D,SAAAI,uBAAAK,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAG/D,MAAMG,aAAa,GAAGC,IAAA,IAA+B;EAAA,I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ACE,cAAc,EAAE,CAAC3B,QAAQ;MACzB,cAAc,EAAEA;IAClB,CACF;EAAE,GAEFd,MAAA,CAAAM,OAAA,CAAAgC,aAAA,CAAC1C,iBAAA,CAAAuD,UAAU,MAAE,CACV,CACN,EACA,CAAC7B,OAAO,IAAI,CAACS,SAAS,IACrB/B,MAAA,CAAAM,OAAA,CAAAgC,aAAA;IAAKE,SAAS,EAAC;EAAgB,GAC7BxC,MAAA,CAAAM,OAAA,CAAAgC,aAAA,CAAC1C,iBAAA,CAAAwD,WAAW;IACVC,aAAa,EAAEjC,IAAK;IACpBkC,SAAS,EAAE/B,IAAI,aAAJA,IAAI,gBAAAV,CAAA,GAAJU,IAAI,CAAEM,gBAAgB,CAAE,CAAC,CAAC,cAAAhB,CAAA,uBAA1BA,CAAA,CAA4B0C;EAAU,CAClD,CACE,CAEP,CAAC;AAEP,CAAC;AAACC,OAAA,CAAAjD,aAAA,GAAAA,aAAA","ignoreList":[]}
1
+ {"version":3,"file":"ChartsWithData.js","names":["_client","require","_labsWidgetCommon","_monoI18n","_classnames","_interopRequireDefault","_react","_getCurrencyStrength","_Chart","_formatters","e","__esModule","default","ChartWithData","_ref","currency","size","useLayoutProvider","isDesktop","Size","DESKTOP","lang","useLocale","loading","data","error","useQuery","getCurrencyStrength","fetchPolicy","showChart","currencyStrength","length","showError","currencyData","filter","item","slice","sort","sortCurrencies","createElement","Fragment","className","classnames","Spinner","SpinnerSize","lg","map","key","Chart","values","strengthRelation","ChartError","LastUpdated","labelCallback","timestamp","updatedAt","exports"],"sources":["../../../src/CurrencyStrengthWidget/ChartsWithData.tsx"],"sourcesContent":["import { useQuery } from '@apollo/client';\nimport {\n ChartError,\n LastUpdated,\n Size,\n Spinner,\n SpinnerSize,\n useLayoutProvider,\n} from '@oanda/labs-widget-common';\nimport { useLocale } from '@oanda/mono-i18n';\nimport classnames from 'classnames';\nimport React from 'react';\n\nimport { getCurrencyStrength } from '../gql/getCurrencyStrength';\nimport type { GetCurrencyStrengthQuery } from '../gql/types/graphql';\nimport { Chart } from './components/Chart';\nimport { sortCurrencies } from './components/Chart/formatters';\nimport type { WidgetProps } from './types';\n\nconst ChartWithData = ({ currency }: WidgetProps) => {\n const { size } = useLayoutProvider();\n const isDesktop = size === Size.DESKTOP;\n const { lang } = useLocale();\n const { loading, data, error } = useQuery<GetCurrencyStrengthQuery>(\n getCurrencyStrength,\n {\n fetchPolicy: 'cache-and-network',\n }\n );\n\n const showChart =\n data?.currencyStrength && data?.currencyStrength?.length > 0;\n const showError = data?.currencyStrength?.length === 0 || error;\n\n const currencyData = currency\n ? data?.currencyStrength?.filter((item) => item.currency === currency)\n : data?.currencyStrength?.slice().sort(sortCurrencies);\n\n return (\n <>\n {loading && (\n <div\n className={classnames(\n 'lw-flex lw-w-full lw-items-center lw-border lw-border-solid lw-border-border-primary',\n {\n 'lw-h-[461px]': !currency,\n 'lw-h-[135px]': currency,\n }\n )}\n >\n <Spinner size={SpinnerSize.lg} />\n </div>\n )}\n {!loading && showChart && (\n <div\n className={classnames('lw-grid lw-place-content-center lw-gap-7', {\n 'lw-grid-cols-3 ': isDesktop && !currency,\n 'lw-grid-cols-1': !isDesktop || currency,\n })}\n data-testid=\"currency-strength-chart-wrapper\"\n >\n {currencyData &&\n currencyData.map((item) => (\n <div\n key={item.currency}\n className=\"lw-flex lw-h-[135px] lw-flex-1 lw-items-center lw-justify-center\"\n >\n <Chart\n currency={item.currency}\n values={item.strengthRelation?.slice().sort(sortCurrencies)!}\n />\n </div>\n ))}\n </div>\n )}\n {!loading && showError && (\n <div\n className={classnames(\n 'lw-flex lw-w-full lw-items-center lw-border lw-border-solid lw-border-border-primary',\n {\n 'lw-h-[425px]': !currency,\n 'lw-h-[135px]': currency,\n }\n )}\n >\n <ChartError />\n </div>\n )}\n {!loading && !showError && (\n <div className=\"lw-mt-2 lw-h-8\">\n <LastUpdated\n labelCallback={lang}\n timestamp={data?.currencyStrength![0]?.updatedAt}\n />\n </div>\n )}\n </>\n );\n};\n\n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cAAc,EAAEA;IAClB,CACF;EAAE,GAEFT,MAAA,CAAAM,OAAA,CAAA2B,aAAA,CAACrC,iBAAA,CAAAiD,UAAU,MAAE,CACV,CACN,EACA,CAAC5B,OAAO,IAAI,CAACS,SAAS,IACrB1B,MAAA,CAAAM,OAAA,CAAA2B,aAAA;IAAKE,SAAS,EAAC;EAAgB,GAC7BnC,MAAA,CAAAM,OAAA,CAAA2B,aAAA,CAACrC,iBAAA,CAAAkD,WAAW;IACVC,aAAa,EAAEhC,IAAK;IACpBiC,SAAS,EAAE9B,IAAI,EAAEM,gBAAgB,CAAE,CAAC,CAAC,EAAEyB;EAAU,CAClD,CACE,CAEP,CAAC;AAEP,CAAC;AAACC,OAAA,CAAA3C,aAAA,GAAAA,aAAA","ignoreList":[]}
@@ -23,9 +23,9 @@ const Main = _ref => {
23
23
  "data-testid": "currency-strength-wrapper"
24
24
  }, _react.default.createElement("div", {
25
25
  className: "lw-mb-8 lw-flex lw-justify-center lw-font-sans lw-text-lg lw-font-bold"
26
- }, _react.default.createElement("span", null, "".concat(lang('daily'), " (").concat(lang('minute', {
26
+ }, _react.default.createElement("span", null, `${lang('daily')} (${lang('minute', {
27
27
  count: 5
28
- }), ")"))), _react.default.createElement(_ChartsWithData.ChartWithData, {
28
+ })})`)), _react.default.createElement(_ChartsWithData.ChartWithData, {
29
29
  currency: currency
30
30
  })));
31
31
  };
@@ -1 +1 @@
1
- {"version":3,"file":"Main.js","names":["_labsWidgetCommon","require","_monoI18n","_react","_interopRequireDefault","_ChartsWithData","e","__esModule","default","Main","_ref","currency","lang","useLocale","size","useLayoutProvider","createElement","Fragment","className","concat","count","ChartWithData","exports"],"sources":["../../../src/CurrencyStrengthWidget/Main.tsx"],"sourcesContent":["import { useLayoutProvider } from '@oanda/labs-widget-common';\nimport { useLocale } from '@oanda/mono-i18n';\nimport React from 'react';\n\nimport { ChartWithData } from './ChartsWithData';\nimport type { WidgetProps } from './types';\n\nconst Main = ({ currency }: WidgetProps) => {\n const { lang } = useLocale();\n const { size } = useLayoutProvider();\n\n return (\n <>\n {size && (\n <div data-testid=\"currency-strength-wrapper\">\n <div className=\"lw-mb-8 lw-flex lw-justify-center lw-font-sans lw-text-lg lw-font-bold\">\n <span>{`${lang('daily')} (${lang('minute', { count: 5 })})`}</span>\n </div>\n <ChartWithData currency={currency} />\n </div>\n )}\n </>\n );\n};\n\nexport { Main };\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAC,sBAAA,CAAAH,OAAA;AAEA,IAAAI,eAAA,GAAAJ,OAAA;AAAiD,SAAAG,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAGjD,MAAMG,IAAI,GAAGC,IAAA,IAA+B;EAAA,IAA9B;IAAEC;EAAsB,CAAC,GAAAD,IAAA;EACrC,MAAM;IAAEE;EAAK,CAAC,GAAG,IAAAC,mBAAS,EAAC,CAAC;EAC5B,MAAM;IAAEC;EAAK,CAAC,GAAG,IAAAC,mCAAiB,EAAC,CAAC;EAEpC,OACEZ,MAAA,CAAAK,OAAA,CAAAQ,aAAA,CAAAb,MAAA,CAAAK,OAAA,CAAAS,QAAA,QACGH,IAAI,IACHX,MAAA,CAAAK,OAAA,CAAAQ,aAAA;IAAK,eAAY;EAA2B,GAC1Cb,MAAA,CAAAK,OAAA,CAAAQ,aAAA;IAAKE,SAAS,EAAC;EAAwE,GACrFf,MAAA,CAAAK,OAAA,CAAAQ,aAAA,kBAAAG,MAAA,CAAUP,IAAI,CAAC,OAAO,CAAC,QAAAO,MAAA,CAAKP,IAAI,CAAC,QAAQ,EAAE;IAAEQ,KAAK,EAAE;EAAE,CAAC,CAAC,MAAU,CAC/D,CAAC,EACNjB,MAAA,CAAAK,OAAA,CAAAQ,aAAA,CAACX,eAAA,CAAAgB,aAAa;IAACV,QAAQ,EAAEA;EAAS,CAAE,CACjC,CAEP,CAAC;AAEP,CAAC;AAACW,OAAA,CAAAb,IAAA,GAAAA,IAAA","ignoreList":[]}
1
+ {"version":3,"file":"Main.js","names":["_labsWidgetCommon","require","_monoI18n","_react","_interopRequireDefault","_ChartsWithData","e","__esModule","default","Main","_ref","currency","lang","useLocale","size","useLayoutProvider","createElement","Fragment","className","count","ChartWithData","exports"],"sources":["../../../src/CurrencyStrengthWidget/Main.tsx"],"sourcesContent":["import { useLayoutProvider } from '@oanda/labs-widget-common';\nimport { useLocale } from '@oanda/mono-i18n';\nimport React from 'react';\n\nimport { ChartWithData } from './ChartsWithData';\nimport type { WidgetProps } from './types';\n\nconst Main = ({ currency }: WidgetProps) => {\n const { lang } = useLocale();\n const { size } = useLayoutProvider();\n\n return (\n <>\n {size && (\n <div data-testid=\"currency-strength-wrapper\">\n <div className=\"lw-mb-8 lw-flex lw-justify-center lw-font-sans lw-text-lg lw-font-bold\">\n <span>{`${lang('daily')} (${lang('minute', { count: 5 })})`}</span>\n </div>\n <ChartWithData currency={currency} />\n </div>\n )}\n </>\n );\n};\n\nexport { Main };\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAC,sBAAA,CAAAH,OAAA;AAEA,IAAAI,eAAA,GAAAJ,OAAA;AAAiD,SAAAG,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAGjD,MAAMG,IAAI,GAAGC,IAAA,IAA+B;EAAA,IAA9B;IAAEC;EAAsB,CAAC,GAAAD,IAAA;EACrC,MAAM;IAAEE;EAAK,CAAC,GAAG,IAAAC,mBAAS,EAAC,CAAC;EAC5B,MAAM;IAAEC;EAAK,CAAC,GAAG,IAAAC,mCAAiB,EAAC,CAAC;EAEpC,OACEZ,MAAA,CAAAK,OAAA,CAAAQ,aAAA,CAAAb,MAAA,CAAAK,OAAA,CAAAS,QAAA,QACGH,IAAI,IACHX,MAAA,CAAAK,OAAA,CAAAQ,aAAA;IAAK,eAAY;EAA2B,GAC1Cb,MAAA,CAAAK,OAAA,CAAAQ,aAAA;IAAKE,SAAS,EAAC;EAAwE,GACrFf,MAAA,CAAAK,OAAA,CAAAQ,aAAA,eAAO,GAAGJ,IAAI,CAAC,OAAO,CAAC,KAAKA,IAAI,CAAC,QAAQ,EAAE;IAAEO,KAAK,EAAE;EAAE,CAAC,CAAC,GAAU,CAC/D,CAAC,EACNhB,MAAA,CAAAK,OAAA,CAAAQ,aAAA,CAACX,eAAA,CAAAe,aAAa;IAACT,QAAQ,EAAEA;EAAS,CAAE,CACjC,CAEP,CAAC;AAEP,CAAC;AAACU,OAAA,CAAAZ,IAAA,GAAAA,IAAA","ignoreList":[]}
@@ -40,7 +40,7 @@ const Chart = _ref => {
40
40
  isDark
41
41
  }),
42
42
  style: {
43
- height: "".concat(_constants.CHART_HEIGHT, "px"),
43
+ height: `${_constants.CHART_HEIGHT}px`,
44
44
  width: '100%'
45
45
  },
46
46
  theme: isDark ? 'dark_theme' : 'light_theme'
@@ -1 +1 @@
1
- {"version":3,"file":"Chart.js","names":["_labsWidgetCommon","require","_monoI18n","_charts","_components","echarts","_interopRequireWildcard","_renderers","_core2","_interopRequireDefault","_react","_constants","_getOption","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","use","GridSimpleComponent","GraphicComponent","TooltipComponent","TitleComponent","BarChart","CanvasRenderer","registerTheme","getChartTheme","Theme","Dark","Light","Chart","_ref","values","currency","lang","useLocale","isDark","useLayoutProvider","createElement","option","getOption","style","height","concat","CHART_HEIGHT","width","theme","exports"],"sources":["../../../../../src/CurrencyStrengthWidget/components/Chart/Chart.tsx"],"sourcesContent":["import {\n getChartTheme,\n Theme,\n useLayoutProvider,\n} from '@oanda/labs-widget-common';\nimport { useLocale } from '@oanda/mono-i18n';\nimport { BarChart } from 'echarts/charts';\nimport {\n GraphicComponent,\n GridSimpleComponent,\n TitleComponent,\n TooltipComponent,\n} from 'echarts/components';\nimport * as echarts from 'echarts/core';\nimport { CanvasRenderer } from 'echarts/renderers';\nimport ReactEChartsCore from 'echarts-for-react/lib/core';\nimport React from 'react';\n\nimport { CHART_HEIGHT } from './constants';\nimport { getOption } from './getOption';\nimport type { ChartProps } from './types';\n\necharts.use([\n GridSimpleComponent,\n GraphicComponent,\n TooltipComponent,\n TitleComponent,\n BarChart,\n CanvasRenderer,\n]);\n\necharts.registerTheme('dark_theme', getChartTheme(Theme.Dark));\necharts.registerTheme('light_theme', getChartTheme(Theme.Light));\n\nconst Chart = ({ values, currency }: ChartProps) => {\n const { lang } = useLocale();\n const { isDark } = useLayoutProvider();\n\n return (\n <ReactEChartsCore\n echarts={echarts}\n option={getOption({\n values,\n currency,\n lang,\n isDark,\n })}\n style={{\n height: `${CHART_HEIGHT}px`,\n width: '100%',\n }}\n theme={isDark ? 'dark_theme' : 'light_theme'}\n />\n );\n};\n\nexport { Chart };\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AAKA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AAMA,IAAAI,OAAA,GAAAC,uBAAA,CAAAL,OAAA;AACA,IAAAM,UAAA,GAAAN,OAAA;AACA,IAAAO,MAAA,GAAAC,sBAAA,CAAAR,OAAA;AACA,IAAAS,MAAA,GAAAD,sBAAA,CAAAR,OAAA;AAEA,IAAAU,UAAA,GAAAV,OAAA;AACA,IAAAW,UAAA,GAAAX,OAAA;AAAwC,SAAAQ,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,yBAAAH,CAAA,6BAAAI,OAAA,m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K,CAACC,IAAI,CAAC,CAAC;AAC9DtC,OAAO,CAACmC,aAAa,CAAC,aAAa,EAAE,IAAAC,+BAAa,EAACC,uBAAK,CAACE,KAAK,CAAC,CAAC;AAEhE,MAAMC,KAAK,GAAGC,IAAA,IAAsC;EAAA,IAArC;IAAEC,MAAM;IAAEC;EAAqB,CAAC,GAAAF,IAAA;EAC7C,MAAM;IAAEG;EAAK,CAAC,GAAG,IAAAC,mBAAS,EAAC,CAAC;EAC5B,MAAM;IAAEC;EAAO,CAAC,GAAG,IAAAC,mCAAiB,EAAC,CAAC;EAEtC,OACE1C,MAAA,CAAAK,OAAA,CAAAsC,aAAA,CAAC7C,MAAA,CAAAO,OAAgB;IACfV,OAAO,EAAEA,OAAQ;IACjBiD,MAAM,EAAE,IAAAC,oBAAS,EAAC;MAChBR,MAAM;MACNC,QAAQ;MACRC,IAAI;MACJE;IACF,CAAC,CAAE;IACHK,KAAK,EAAE;MACLC,MAAM,KAAAC,MAAA,CAAKC,uBAAY,OAAI;MAC3BC,KAAK,EAAE;IACT,CAAE;IACFC,KAAK,EAAEV,MAAM,GAAG,YAAY,GAAG;EAAc,CAC9C,CAAC;AAEN,CAAC;AAACW,OAAA,CAAAjB,KAAA,GAAAA,KAAA","ignoreList":[]}
1
+ {"version":3,"file":"Chart.js","names":["_labsWidgetCommon","require","_monoI18n","_charts","_components","echarts","_interopRequireWildcard","_renderers","_core2","_interopRequireDefault","_react","_constants","_getOption","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","use","GridSimpleComponent","GraphicComponent","TooltipComponent","TitleComponent","BarChart","CanvasRenderer","registerTheme","getChartTheme","Theme","Dark","Light","Chart","_ref","values","currency","lang","useLocale","isDark","useLayoutProvider","createElement","option","getOption","style","height","CHART_HEIGHT","width","theme","exports"],"sources":["../../../../../src/CurrencyStrengthWidget/components/Chart/Chart.tsx"],"sourcesContent":["import {\n getChartTheme,\n Theme,\n useLayoutProvider,\n} from '@oanda/labs-widget-common';\nimport { useLocale } from '@oanda/mono-i18n';\nimport { BarChart } from 'echarts/charts';\nimport {\n GraphicComponent,\n GridSimpleComponent,\n TitleComponent,\n TooltipComponent,\n} from 'echarts/components';\nimport * as echarts from 'echarts/core';\nimport { CanvasRenderer } from 'echarts/renderers';\nimport ReactEChartsCore from 'echarts-for-react/lib/core';\nimport React from 'react';\n\nimport { CHART_HEIGHT } from './constants';\nimport { getOption } from './getOption';\nimport type { ChartProps } from './types';\n\necharts.use([\n GridSimpleComponent,\n GraphicComponent,\n TooltipComponent,\n TitleComponent,\n BarChart,\n CanvasRenderer,\n]);\n\necharts.registerTheme('dark_theme', getChartTheme(Theme.Dark));\necharts.registerTheme('light_theme', getChartTheme(Theme.Light));\n\nconst Chart = ({ values, currency }: ChartProps) => {\n const { lang } = useLocale();\n const { isDark } = useLayoutProvider();\n\n return (\n <ReactEChartsCore\n echarts={echarts}\n option={getOption({\n values,\n currency,\n lang,\n isDark,\n })}\n style={{\n height: `${CHART_HEIGHT}px`,\n width: '100%',\n }}\n theme={isDark ? 'dark_theme' : 'light_theme'}\n />\n );\n};\n\nexport { Chart };\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AAKA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AAMA,IAAAI,OAAA,GAAAC,uBAAA,CAAAL,OAAA;AACA,IAAAM,UAAA,GAAAN,OAAA;AACA,IAAAO,MAAA,GAAAC,sBAAA,CAAAR,OAAA;AACA,IAAAS,MAAA,GAAAD,sBAAA,CAAAR,OAAA;AAEA,IAAAU,UAAA,GAAAV,OAAA;AACA,IAAAW,UAAA,GAAAX,OAAA;AAAwC,SAAAQ,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAA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a,CAAC,YAAY,EAAE,IAAAC,+BAAa,EAACC,uBAAK,CAACC,IAAI,CAAC,CAAC;AAC9DtC,OAAO,CAACmC,aAAa,CAAC,aAAa,EAAE,IAAAC,+BAAa,EAACC,uBAAK,CAACE,KAAK,CAAC,CAAC;AAEhE,MAAMC,KAAK,GAAGC,IAAA,IAAsC;EAAA,IAArC;IAAEC,MAAM;IAAEC;EAAqB,CAAC,GAAAF,IAAA;EAC7C,MAAM;IAAEG;EAAK,CAAC,GAAG,IAAAC,mBAAS,EAAC,CAAC;EAC5B,MAAM;IAAEC;EAAO,CAAC,GAAG,IAAAC,mCAAiB,EAAC,CAAC;EAEtC,OACE1C,MAAA,CAAAK,OAAA,CAAAsC,aAAA,CAAC7C,MAAA,CAAAO,OAAgB;IACfV,OAAO,EAAEA,OAAQ;IACjBiD,MAAM,EAAE,IAAAC,oBAAS,EAAC;MAChBR,MAAM;MACNC,QAAQ;MACRC,IAAI;MACJE;IACF,CAAC,CAAE;IACHK,KAAK,EAAE;MACLC,MAAM,EAAE,GAAGC,uBAAY,IAAI;MAC3BC,KAAK,EAAE;IACT,CAAE;IACFC,KAAK,EAAET,MAAM,GAAG,YAAY,GAAG;EAAc,CAC9C,CAAC;AAEN,CAAC;AAACU,OAAA,CAAAhB,KAAA,GAAAA,KAAA","ignoreList":[]}
@@ -13,7 +13,11 @@ const tooltipFormatter = _ref => {
13
13
  currency,
14
14
  lang
15
15
  } = _ref;
16
- return "\n<div>\n <div style=\"margin-bottom:5px;\">".concat(currency, " ").concat(lang('vs'), " ").concat(name, "</div>\n <div style=\"display:flex;align-items:center;\">").concat(marker, " ").concat(value, "%</div>\n</div>");
16
+ return `
17
+ <div>
18
+ <div style="margin-bottom:5px;">${currency} ${lang('vs')} ${name}</div>
19
+ <div style="display:flex;align-items:center;">${marker} ${value}%</div>
20
+ </div>`;
17
21
  };
18
22
  exports.tooltipFormatter = tooltipFormatter;
19
23
  const sortCurrencies = (a, b) => _constants.instrumentsConfig.indexOf(a.currency) - _constants.instrumentsConfig.indexOf(b.currency);
@@ -1 +1 @@
1
- {"version":3,"file":"formatters.js","names":["_constants","require","tooltipFormatter","_ref","marker","name","value","currency","lang","concat","exports","sortCurrencies","a","b","instrumentsConfig","indexOf"],"sources":["../../../../../src/CurrencyStrengthWidget/components/Chart/formatters.ts"],"sourcesContent":["import { instrumentsConfig } from './constants';\nimport type { SortingParams, TooltipFormatterParams } from './types';\n\nconst tooltipFormatter = ({\n marker,\n name,\n value,\n currency,\n lang,\n}: TooltipFormatterParams) => `\n<div>\n <div style=\"margin-bottom:5px;\">${currency} ${lang('vs')} ${name}</div>\n <div style=\"display:flex;align-items:center;\">${marker} ${value}%</div>\n</div>`;\n\nconst sortCurrencies = (a: SortingParams, b: SortingParams) =>\n instrumentsConfig.indexOf(a.currency) - instrumentsConfig.indexOf(b.currency);\n\nexport { sortCurrencies, tooltipFormatter };\n"],"mappings":";;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AAGA,MAAMC,gBAAgB,GAAGC,IAAA;EAAA,IAAC;IACxBC,MAAM;IACNC,IAAI;IACJC,KAAK;IACLC,QAAQ;IACRC;EACsB,CAAC,GAAAL,IAAA;EAAA,uDAAAM,MAAA,CAEWF,QAAQ,OAAAE,MAAA,CAAID,IAAI,CAAC,IAAI,CAAC,OAAAC,MAAA,CAAIJ,IAAI,gEAAAI,MAAA,CAChBL,MAAM,OAAAK,MAAA,CAAIH,KAAK;AAAA,CAC1D;AAACI,OAAA,CAAAR,gBAAA,GAAAA,gBAAA;AAER,MAAMS,cAAc,GAAGA,CAACC,CAAgB,EAAEC,CAAgB,KACxDC,4BAAiB,CAACC,OAAO,CAACH,CAAC,CAACL,QAAQ,CAAC,GAAGO,4BAAiB,CAACC,OAAO,CAACF,CAAC,CAACN,QAAQ,CAAC;AAACG,OAAA,CAAAC,cAAA,GAAAA,cAAA","ignoreList":[]}
1
+ {"version":3,"file":"formatters.js","names":["_constants","require","tooltipFormatter","_ref","marker","name","value","currency","lang","exports","sortCurrencies","a","b","instrumentsConfig","indexOf"],"sources":["../../../../../src/CurrencyStrengthWidget/components/Chart/formatters.ts"],"sourcesContent":["import { instrumentsConfig } from './constants';\nimport type { SortingParams, TooltipFormatterParams } from './types';\n\nconst tooltipFormatter = ({\n marker,\n name,\n value,\n currency,\n lang,\n}: TooltipFormatterParams) => `\n<div>\n <div style=\"margin-bottom:5px;\">${currency} ${lang('vs')} ${name}</div>\n <div style=\"display:flex;align-items:center;\">${marker} ${value}%</div>\n</div>`;\n\nconst sortCurrencies = (a: SortingParams, b: SortingParams) =>\n instrumentsConfig.indexOf(a.currency) - instrumentsConfig.indexOf(b.currency);\n\nexport { sortCurrencies, tooltipFormatter };\n"],"mappings":";;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AAGA,MAAMC,gBAAgB,GAAGC,IAAA;EAAA,IAAC;IACxBC,MAAM;IACNC,IAAI;IACJC,KAAK;IACLC,QAAQ;IACRC;EACsB,CAAC,GAAAL,IAAA;EAAA,OAAK;AAC9B;AACA,oCAAoCI,QAAQ,IAAIC,IAAI,CAAC,IAAI,CAAC,IAAIH,IAAI;AAClE,kDAAkDD,MAAM,IAAIE,KAAK;AACjE,OAAO;AAAA;AAACG,OAAA,CAAAP,gBAAA,GAAAA,gBAAA;AAER,MAAMQ,cAAc,GAAGA,CAACC,CAAgB,EAAEC,CAAgB,KACxDC,4BAAiB,CAACC,OAAO,CAACH,CAAC,CAACJ,QAAQ,CAAC,GAAGM,4BAAiB,CAACC,OAAO,CAACF,CAAC,CAACL,QAAQ,CAAC;AAACE,OAAA,CAAAC,cAAA,GAAAA,cAAA","ignoreList":[]}
@@ -28,7 +28,7 @@ const getOption = _ref => {
28
28
  animation: false,
29
29
  title: {
30
30
  left: 'center',
31
- text: "".concat(currency, " vs"),
31
+ text: `${currency} vs`,
32
32
  textStyle: {
33
33
  fontSize: 12,
34
34
  lineHeight: 20,
@@ -39,8 +39,8 @@ const getOption = _ref => {
39
39
  name: 'main-grid',
40
40
  top: '30px',
41
41
  right: '0px',
42
- left: "".concat(_constants.Y_LABEL_SIZE, "px"),
43
- bottom: "".concat(_constants.X_LABEL_SIZE, "px")
42
+ left: `${_constants.Y_LABEL_SIZE}px`,
43
+ bottom: `${_constants.X_LABEL_SIZE}px`
44
44
  }],
45
45
  graphic: [...gridLines],
46
46
  tooltip: {
@@ -1 +1 @@
1
- {"version":3,"file":"getOption.js","names":["_labsWidgetCommon","require","_constants","_formatters","getOption","_ref","values","currency","isDark","lang","currencies","map","item","percentages","percentage","barColors","darkBarColors","lightBarColors","gridLines","getGridLines","chartWidth","CHART_WIDTH","chartHeight","CHART_HEIGHT","xLabelsSize","yLabelSize","animation","title","left","text","concat","textStyle","fontSize","lineHeight","fontWeight","grid","name","top","right","Y_LABEL_SIZE","bottom","X_LABEL_SIZE","graphic","tooltip","trigger","formatter","_ref2","marker","value","tooltipFormatter","axisPointer","axis","extraCssText","xAxis","type","data","axisTick","show","axisLine","splitLine","axisLabel","yAxis","position","min","Math","floor","max","ceil","interval","series","emphasis","disabled","itemStyle","opacity","color","_ref3","positive","negative","zero","exports"],"sources":["../../../../../src/CurrencyStrengthWidget/components/Chart/getOption.ts"],"sourcesContent":["import { getGridLines } from '@oanda/labs-widget-common';\n\nimport {\n CHART_HEIGHT,\n CHART_WIDTH,\n darkBarColors,\n lightBarColors,\n X_LABEL_SIZE,\n Y_LABEL_SIZE,\n} from './constants';\nimport { tooltipFormatter } from './formatters';\nimport type { GetOptionProps } from './types';\n\nexport const getOption = ({\n values,\n currency,\n isDark,\n lang,\n}: GetOptionProps) => {\n const currencies = values.map((item) => item.currency);\n const percentages = values.map((item) => item.percentage);\n const barColors = isDark ? darkBarColors : lightBarColors;\n\n const gridLines = getGridLines({\n isDark,\n chartWidth: CHART_WIDTH,\n chartHeight: CHART_HEIGHT,\n xLabelsSize: -2,\n yLabelSize: -3,\n });\n\n return {\n animation: false,\n title: {\n left: 'center',\n text: `${currency} vs`,\n textStyle: {\n fontSize: 12,\n lineHeight: 20,\n fontWeight: 400,\n },\n },\n grid: [\n {\n name: 'main-grid',\n top: '30px',\n right: '0px',\n left: `${Y_LABEL_SIZE}px`,\n bottom: `${X_LABEL_SIZE}px`,\n },\n ],\n graphic: [...gridLines],\n tooltip: {\n trigger: 'axis',\n formatter: ([{ marker, name, value }]: {\n marker: string;\n name: string;\n value: number;\n }[]) =>\n tooltipFormatter({\n lang,\n currency,\n marker,\n name,\n value,\n }),\n axisPointer: {\n axis: 'x',\n },\n extraCssText: 'z-index: 1',\n },\n xAxis: {\n type: 'category',\n data: currencies,\n axisTick: { show: false },\n axisLine: { show: false },\n splitLine: { show: false },\n axisLabel: {\n fontSize: 10,\n },\n },\n yAxis: {\n type: 'value',\n position: 'left',\n min: Math.floor(Math.min(...percentages)),\n max: Math.ceil(Math.max(...percentages)),\n interval: 1,\n axisLine: { show: false },\n axisTick: { show: false },\n axisLabel: {\n formatter: '{value}%',\n fontSize: 10,\n },\n },\n series: [\n {\n data: percentages,\n type: 'bar',\n emphasis: {\n disabled: true,\n },\n itemStyle: {\n opacity: 1,\n color: ({ data }: { data: number }) => {\n if (data > 0) {\n return barColors.positive;\n }\n if (data < 0) {\n return barColors.negative;\n }\n return barColors.zero;\n },\n },\n },\n ],\n };\n};\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AAEA,IAAAC,UAAA,GAAAD,OAAA;AAQA,IAAAE,WAAA,GAAAF,OAAA;AAGO,MAAMG,SAAS,GAAGC,IAAA,IAKH;EAAA,IALI;IACxBC,MAAM;IACNC,QAAQ;IACRC,MAAM;IACNC;EACc,CAAC,GAAAJ,IAAA;EACf,MAAMK,UAAU,GAAGJ,MAAM,CAACK,GAAG,CAAEC,IAAI,IAAKA,IAAI,CAACL,QAAQ,CAAC;EACtD,MAAMM,WAAW,GAAGP,MAAM,CAACK,GAAG,CAAEC,IAAI,IAAKA,IAAI,CAACE,UAAU,CAAC;EACzD,MAAMC,SAAS,GAAGP,MAAM,GAA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,IAAI,EAAE;MAAM,CAAC;MAC1BG,SAAS,EAAE;QACT5B,QAAQ,EAAE;MACZ;IACF,CAAC;IACD6B,KAAK,EAAE;MACLP,IAAI,EAAE,OAAO;MACbQ,QAAQ,EAAE,MAAM;MAChBC,GAAG,EAAEC,IAAI,CAACC,KAAK,CAACD,IAAI,CAACD,GAAG,CAAC,GAAGlD,WAAW,CAAC,CAAC;MACzCqD,GAAG,EAAEF,IAAI,CAACG,IAAI,CAACH,IAAI,CAACE,GAAG,CAAC,GAAGrD,WAAW,CAAC,CAAC;MACxCuD,QAAQ,EAAE,CAAC;MACXV,QAAQ,EAAE;QAAED,IAAI,EAAE;MAAM,CAAC;MACzBD,QAAQ,EAAE;QAAEC,IAAI,EAAE;MAAM,CAAC;MACzBG,SAAS,EAAE;QACTf,SAAS,EAAE,UAAU;QACrBb,QAAQ,EAAE;MACZ;IACF,CAAC;IACDqC,MAAM,EAAE,CACN;MACEd,IAAI,EAAE1C,WAAW;MACjByC,IAAI,EAAE,KAAK;MACXgB,QAAQ,EAAE;QACRC,QAAQ,EAAE;MACZ,CAAC;MACDC,SAAS,EAAE;QACTC,OAAO,EAAE,CAAC;QACVC,KAAK,EAAEC,KAAA,IAAgC;UAAA,IAA/B;YAAEpB;UAAuB,CAAC,GAAAoB,KAAA;UAChC,IAAIpB,IAAI,GAAG,CAAC,EAAE;YACZ,OAAOxC,SAAS,CAAC6D,QAAQ;UAC3B;UACA,IAAIrB,IAAI,GAAG,CAAC,EAAE;YACZ,OAAOxC,SAAS,CAAC8D,QAAQ;UAC3B;UACA,OAAO9D,SAAS,CAAC+D,IAAI;QACvB;MACF;IACF,CAAC;EAEL,CAAC;AACH,CAAC;AAACC,OAAA,CAAA3E,SAAA,GAAAA,SAAA","ignoreList":[]}
1
+ {"version":3,"file":"getOption.js","names":["_labsWidgetCommon","require","_constants","_formatters","getOption","_ref","values","currency","isDark","lang","currencies","map","item","percentages","percentage","barColors","darkBarColors","lightBarColors","gridLines","getGridLines","chartWidth","CHART_WIDTH","chartHeight","CHART_HEIGHT","xLabelsSize","yLabelSize","animation","title","left","text","textStyle","fontSize","lineHeight","fontWeight","grid","name","top","right","Y_LABEL_SIZE","bottom","X_LABEL_SIZE","graphic","tooltip","trigger","formatter","_ref2","marker","value","tooltipFormatter","axisPointer","axis","extraCssText","xAxis","type","data","axisTick","show","axisLine","splitLine","axisLabel","yAxis","position","min","Math","floor","max","ceil","interval","series","emphasis","disabled","itemStyle","opacity","color","_ref3","positive","negative","zero","exports"],"sources":["../../../../../src/CurrencyStrengthWidget/components/Chart/getOption.ts"],"sourcesContent":["import { getGridLines } from '@oanda/labs-widget-common';\n\nimport {\n CHART_HEIGHT,\n CHART_WIDTH,\n darkBarColors,\n lightBarColors,\n X_LABEL_SIZE,\n Y_LABEL_SIZE,\n} from './constants';\nimport { tooltipFormatter } from './formatters';\nimport type { GetOptionProps } from './types';\n\nexport const getOption = ({\n values,\n currency,\n isDark,\n lang,\n}: GetOptionProps) => {\n const currencies = values.map((item) => item.currency);\n const percentages = values.map((item) => item.percentage);\n const barColors = isDark ? darkBarColors : lightBarColors;\n\n const gridLines = getGridLines({\n isDark,\n chartWidth: CHART_WIDTH,\n chartHeight: CHART_HEIGHT,\n xLabelsSize: -2,\n yLabelSize: -3,\n });\n\n return {\n animation: false,\n title: {\n left: 'center',\n text: `${currency} vs`,\n textStyle: {\n fontSize: 12,\n lineHeight: 20,\n fontWeight: 400,\n },\n },\n grid: [\n {\n name: 'main-grid',\n top: '30px',\n right: '0px',\n left: `${Y_LABEL_SIZE}px`,\n bottom: `${X_LABEL_SIZE}px`,\n },\n ],\n graphic: [...gridLines],\n tooltip: {\n trigger: 'axis',\n formatter: ([{ marker, name, value }]: {\n marker: string;\n name: string;\n value: number;\n }[]) =>\n tooltipFormatter({\n lang,\n currency,\n marker,\n name,\n value,\n }),\n axisPointer: {\n axis: 'x',\n },\n extraCssText: 'z-index: 1',\n },\n xAxis: {\n type: 'category',\n data: currencies,\n axisTick: { show: false },\n axisLine: { show: false },\n splitLine: { show: false },\n axisLabel: {\n fontSize: 10,\n },\n },\n yAxis: {\n type: 'value',\n position: 'left',\n min: Math.floor(Math.min(...percentages)),\n max: Math.ceil(Math.max(...percentages)),\n interval: 1,\n axisLine: { show: false },\n axisTick: { show: false },\n axisLabel: {\n formatter: '{value}%',\n fontSize: 10,\n },\n },\n series: [\n {\n data: percentages,\n type: 'bar',\n emphasis: {\n disabled: true,\n },\n itemStyle: {\n opacity: 1,\n color: ({ data }: { data: number }) => {\n if (data > 0) {\n return barColors.positive;\n }\n if (data < 0) {\n return barColors.negative;\n }\n return barColors.zero;\n },\n },\n },\n ],\n };\n};\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AAEA,IAAAC,UAAA,GAAAD,OAAA;AAQA,IAAAE,WAAA,GAAAF,OAAA;AAGO,MAAMG,SAAS,GAAGC,IAAA,IAKH;EAAA,IALI;IACxBC,MAAM;IACNC,QAAQ;IACRC,MAAM;IACNC;EACc,CAAC,GAAAJ,IAAA;EACf,MAAMK,UAAU,GAAGJ,MAAM,CAACK,GAAG,CAAEC,IAAI,IAAKA,IAAI,CAACL,QAAQ,CAAC;EACtD,MAAMM,WAAW,GAAGP,MAAM,CAACK,GAAG,CAAEC,IAAI,IAAKA,IAAI,CAACE,UAAU,CAAC;EACzD,MAAMC,SAAS,GAAGP,MAAM,GAAGQ,wBAAa,GAAGC,yBAAc;EAEzD,MAAMC,SAAS,GAAG,IAAAC,8BAAY,EAAC;IAC7BX,MAAM;IACNY,UAAU,EAAEC,sBAAW;IACvBC,WAAW,EAAEC,uBAAY;IACzBC,WAAW,EAAE,CAAC,CAAC;IACfC,UAAU,EAAE,CAAC;EACf,CAAC,CAAC;EAEF,OAAO;IACLC,SAAS,EAAE,KAAK;IAChBC,KAAK,EAAE;MACLC,IAAI,EAAE,QAAQ;MACdC,IAAI,EAAE,GAAGtB,QAAQ,KAAK;MACtBuB,SAAS,EAAE;QACTC,QAAQ,EA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QAAED,IAAI,EAAE;MAAM,CAAC;MACzBD,QAAQ,EAAE;QAAEC,IAAI,EAAE;MAAM,CAAC;MACzBG,SAAS,EAAE;QACTf,SAAS,EAAE,UAAU;QACrBb,QAAQ,EAAE;MACZ;IACF,CAAC;IACDqC,MAAM,EAAE,CACN;MACEd,IAAI,EAAEzC,WAAW;MACjBwC,IAAI,EAAE,KAAK;MACXgB,QAAQ,EAAE;QACRC,QAAQ,EAAE;MACZ,CAAC;MACDC,SAAS,EAAE;QACTC,OAAO,EAAE,CAAC;QACVC,KAAK,EAAEC,KAAA,IAAgC;UAAA,IAA/B;YAAEpB;UAAuB,CAAC,GAAAoB,KAAA;UAChC,IAAIpB,IAAI,GAAG,CAAC,EAAE;YACZ,OAAOvC,SAAS,CAAC4D,QAAQ;UAC3B;UACA,IAAIrB,IAAI,GAAG,CAAC,EAAE;YACZ,OAAOvC,SAAS,CAAC6D,QAAQ;UAC3B;UACA,OAAO7D,SAAS,CAAC8D,IAAI;QACvB;MACF;IACF,CAAC;EAEL,CAAC;AACH,CAAC;AAACC,OAAA,CAAA1E,SAAA,GAAAA,SAAA","ignoreList":[]}
@@ -5,7 +5,16 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.getCurrencyStrength = void 0;
7
7
  var _client = require("@apollo/client");
8
- var _templateObject;
9
- function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
10
- const getCurrencyStrength = exports.getCurrencyStrength = (0, _client.gql)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n query GetCurrencyStrength {\n currencyStrength {\n currency\n strengthRelation {\n currency\n percentage\n }\n updatedAt\n }\n }\n"])));
8
+ const getCurrencyStrength = exports.getCurrencyStrength = (0, _client.gql)`
9
+ query GetCurrencyStrength {
10
+ currencyStrength {
11
+ currency
12
+ strengthRelation {
13
+ currency
14
+ percentage
15
+ }
16
+ updatedAt
17
+ }
18
+ }
19
+ `;
11
20
  //# sourceMappingURL=getCurrencyStrength.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"getCurrencyStrength.js","names":["_client","require","_templateObject","_taggedTemplateLiteral","e","t","slice","Object","freeze","defineProperties","raw","value","getCurrencyStrength","exports","gql"],"sources":["../../../src/gql/getCurrencyStrength.ts"],"sourcesContent":["import { gql } from '@apollo/client';\n\nconst getCurrencyStrength = gql`\n query GetCurrencyStrength {\n currencyStrength {\n currency\n strengthRelation {\n currency\n percentage\n }\n updatedAt\n }\n }\n`;\n\nexport { getCurrencyStrength };\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAAqC,IAAAC,eAAA;AAAA,SAAAC,uBAAAC,CAAA,EAAAC,CAAA,WAAAA,CAAA,KAAAA,CAAA,GAAAD,CAAA,CAAAE,KAAA,MAAAC,MAAA,CAAAC,MAAA,CAAAD,MAAA,CAAAE,gBAAA,CAAAL,CAAA,IAAAM,GAAA,IAAAC,KAAA,EAAAJ,MAAA,CAAAC,MAAA,CAAAH,CAAA;AAErC,MAAMO,mBAAmB,GAAAC,OAAA,CAAAD,mBAAA,OAAGE,WAAG,EAAAZ,eAAA,KAAAA,eAAA,GAAAC,sBAAA,uLAW9B","ignoreList":[]}
1
+ {"version":3,"file":"getCurrencyStrength.js","names":["_client","require","getCurrencyStrength","exports","gql"],"sources":["../../../src/gql/getCurrencyStrength.ts"],"sourcesContent":["import { gql } from '@apollo/client';\n\nconst getCurrencyStrength = gql`\n query GetCurrencyStrength {\n currencyStrength {\n currency\n strengthRelation {\n currency\n percentage\n }\n updatedAt\n }\n }\n`;\n\nexport { getCurrencyStrength };\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAEA,MAAMC,mBAAmB,GAAAC,OAAA,CAAAD,mBAAA,GAAG,IAAAE,WAAG;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC","ignoreList":[]}
@@ -13,11 +13,10 @@ function makeFragmentData(data, _fragment) {
13
13
  return data;
14
14
  }
15
15
  function isFragmentReady(queryNode, fragmentNode, data) {
16
- var _meta__, _fragDef$name;
17
- const deferredFields = (_meta__ = queryNode.__meta__) === null || _meta__ === void 0 ? void 0 : _meta__.deferredFields;
16
+ const deferredFields = queryNode.__meta__?.deferredFields;
18
17
  if (!deferredFields) return true;
19
18
  const fragDef = fragmentNode.definitions[0];
20
- const fragName = fragDef === null || fragDef === void 0 || (_fragDef$name = fragDef.name) === null || _fragDef$name === void 0 ? void 0 : _fragDef$name.value;
19
+ const fragName = fragDef?.name?.value;
21
20
  const fields = fragName && deferredFields[fragName] || [];
22
21
  return fields.length > 0 && fields.every(field => data && field in data);
23
22
  }
@@ -1 +1 @@
1
- {"version":3,"file":"fragment-masking.js","names":["useFragment","_documentNode","fragmentType","makeFragmentData","data","_fragment","isFragmentReady","queryNode","fragmentNode","_meta__","_fragDef$name","deferredFields","__meta__","fragDef","definitions","fragName","name","value","fields","length","every","field"],"sources":["../../../../src/gql/types/fragment-masking.ts"],"sourcesContent":["import {\n ResultOf,\n DocumentTypeDecoration,\n TypedDocumentNode,\n} from '@graphql-typed-document-node/core';\nimport { FragmentDefinitionNode } from 'graphql';\nimport { Incremental } from './graphql';\n\nexport type FragmentType<\n TDocumentType extends DocumentTypeDecoration<any, any>,\n> =\n TDocumentType extends DocumentTypeDecoration<infer TType, any>\n ? [TType] extends [{ ' $fragmentName'?: infer TKey }]\n ? TKey extends string\n ? { ' $fragmentRefs'?: { [key in TKey]: TType } }\n : never\n : never\n : never;\n\n// return non-nullable if `fragmentType` is non-nullable\nexport function useFragment<TType>(\n _documentNode: DocumentTypeDecoration<TType, any>,\n fragmentType: FragmentType<DocumentTypeDecoration<TType, any>>\n): TType;\n// return nullable if `fragmentType` is nullable\nexport function useFragment<TType>(\n _documentNode: DocumentTypeDecoration<TType, any>,\n fragmentType:\n | FragmentType<DocumentTypeDecoration<TType, any>>\n | null\n | undefined\n): TType | null | undefined;\n// return array of non-nullable if `fragmentType` is array of non-nullable\nexport function useFragment<TType>(\n _documentNode: DocumentTypeDecoration<TType, any>,\n fragmentType: ReadonlyArray<FragmentType<DocumentTypeDecoration<TType, any>>>\n): ReadonlyArray<TType>;\n// return array of nullable if `fragmentType` is array of nullable\nexport function useFragment<TType>(\n _documentNode: DocumentTypeDecoration<TType, any>,\n fragmentType:\n | ReadonlyArray<FragmentType<DocumentTypeDecoration<TType, any>>>\n | null\n | undefined\n): ReadonlyArray<TType> | null | undefined;\nexport function useFragment<TType>(\n _documentNode: DocumentTypeDecoration<TType, any>,\n fragmentType:\n | FragmentType<DocumentTypeDecoration<TType, any>>\n | ReadonlyArray<FragmentType<DocumentTypeDecoration<TType, any>>>\n | null\n | undefined\n): TType | ReadonlyArray<TType> | null | undefined {\n return fragmentType as any;\n}\n\nexport function makeFragmentData<\n F extends DocumentTypeDecoration<any, any>,\n FT extends ResultOf<F>,\n>(data: FT, _fragment: F): FragmentType<F> {\n return data as FragmentType<F>;\n}\nexport function isFragmentReady<TQuery, TFrag>(\n queryNode: DocumentTypeDecoration<TQuery, any>,\n fragmentNode: TypedDocumentNode<TFrag>,\n data:\n | FragmentType<TypedDocumentNode<Incremental<TFrag>, any>>\n | null\n | undefined\n): data is FragmentType<typeof fragmentNode> {\n const deferredFields = (\n queryNode as {\n __meta__?: { deferredFields: Record<string, (keyof TFrag)[]> };\n }\n ).__meta__?.deferredFields;\n\n if (!deferredFields) return true;\n\n const fragDef = fragmentNode.definitions[0] as\n | FragmentDefinitionNode\n | undefined;\n const fragName = fragDef?.name?.value;\n\n const fields = (fragName && deferredFields[fragName]) || [];\n return fields.length > 0 && fields.every((field) => data && field in data);\n}\n"],"mappings":";;;;;;;;AA6CO,SAASA,WAAWA,CACzBC,aAAiD,EACjDC,YAIa,EACoC;EACjD,OAAOA,YAAY;AACrB;AAEO,SAASC,gBAAgBA,CAG9BC,IAAQ,EAAEC,SAAY,EAAmB;EACzC,OAAOD,IAAI;AACb;AACO,SAASE,eAAeA,CAC7BC,SAA8C,EAC9CC,YAAsC,EACtCJ,IAGa,EAC8B;EAAA,IAAAK,OAAA,EAAAC,aAAA;EAC3C,MAAMC,cAAc,IAAAF,OAAA,GAClBF,SAAS,CAGTK,QAAQ,cAAAH,OAAA,uBAJaA,OAAA,CAIXE,cAAc;EAE1B,IAAI,CAACA,cAAc,EAAE,OAAO,IAAI;EAEhC,MAAME,OAAO,GAAGL,YAAY,CAACM,WAAW,CAAC,CAAC,CAE7B;EACb,MAAMC,QAAQ,GAAGF,OAAO,aAAPA,OAAO,gBAAAH,aAAA,GAAPG,OAAO,CAAEG,IAAI,cAAAN,aAAA,uBAAbA,aAAA,CAAeO,KAAK;EAErC,MAAMC,MAAM,GAAIH,QAAQ,IAAIJ,cAAc,CAACI,QAAQ,CAAC,IAAK,EAAE;EAC3D,OAAOG,MAAM,CAACC,MAAM,GAAG,CAAC,IAAID,MAAM,CAACE,KAAK,CAAEC,KAAK,IAAKjB,IAAI,IAAIiB,KAAK,IAAIjB,IAAI,CAAC;AAC5E","ignoreList":[]}
1
+ {"version":3,"file":"fragment-masking.js","names":["useFragment","_documentNode","fragmentType","makeFragmentData","data","_fragment","isFragmentReady","queryNode","fragmentNode","deferredFields","__meta__","fragDef","definitions","fragName","name","value","fields","length","every","field"],"sources":["../../../../src/gql/types/fragment-masking.ts"],"sourcesContent":["import {\n ResultOf,\n DocumentTypeDecoration,\n TypedDocumentNode,\n} from '@graphql-typed-document-node/core';\nimport { FragmentDefinitionNode } from 'graphql';\nimport { Incremental } from './graphql';\n\nexport type FragmentType<\n TDocumentType extends DocumentTypeDecoration<any, any>,\n> =\n TDocumentType extends DocumentTypeDecoration<infer TType, any>\n ? [TType] extends [{ ' $fragmentName'?: infer TKey }]\n ? TKey extends string\n ? { ' $fragmentRefs'?: { [key in TKey]: TType } }\n : never\n : never\n : never;\n\n// return non-nullable if `fragmentType` is non-nullable\nexport function useFragment<TType>(\n _documentNode: DocumentTypeDecoration<TType, any>,\n fragmentType: FragmentType<DocumentTypeDecoration<TType, any>>\n): TType;\n// return nullable if `fragmentType` is nullable\nexport function useFragment<TType>(\n _documentNode: DocumentTypeDecoration<TType, any>,\n fragmentType:\n | FragmentType<DocumentTypeDecoration<TType, any>>\n | null\n | undefined\n): TType | null | undefined;\n// return array of non-nullable if `fragmentType` is array of non-nullable\nexport function useFragment<TType>(\n _documentNode: DocumentTypeDecoration<TType, any>,\n fragmentType: ReadonlyArray<FragmentType<DocumentTypeDecoration<TType, any>>>\n): ReadonlyArray<TType>;\n// return array of nullable if `fragmentType` is array of nullable\nexport function useFragment<TType>(\n _documentNode: DocumentTypeDecoration<TType, any>,\n fragmentType:\n | ReadonlyArray<FragmentType<DocumentTypeDecoration<TType, any>>>\n | null\n | undefined\n): ReadonlyArray<TType> | null | undefined;\nexport function useFragment<TType>(\n _documentNode: DocumentTypeDecoration<TType, any>,\n fragmentType:\n | FragmentType<DocumentTypeDecoration<TType, any>>\n | ReadonlyArray<FragmentType<DocumentTypeDecoration<TType, any>>>\n | null\n | undefined\n): TType | ReadonlyArray<TType> | null | undefined {\n return fragmentType as any;\n}\n\nexport function makeFragmentData<\n F extends DocumentTypeDecoration<any, any>,\n FT extends ResultOf<F>,\n>(data: FT, _fragment: F): FragmentType<F> {\n return data as FragmentType<F>;\n}\nexport function isFragmentReady<TQuery, TFrag>(\n queryNode: DocumentTypeDecoration<TQuery, any>,\n fragmentNode: TypedDocumentNode<TFrag>,\n data:\n | FragmentType<TypedDocumentNode<Incremental<TFrag>, any>>\n | null\n | undefined\n): data is FragmentType<typeof fragmentNode> {\n const deferredFields = (\n queryNode as {\n __meta__?: { deferredFields: Record<string, (keyof TFrag)[]> };\n }\n ).__meta__?.deferredFields;\n\n if (!deferredFields) return true;\n\n const fragDef = fragmentNode.definitions[0] as\n | FragmentDefinitionNode\n | undefined;\n const fragName = fragDef?.name?.value;\n\n const fields = (fragName && deferredFields[fragName]) || [];\n return fields.length > 0 && fields.every((field) => data && field in data);\n}\n"],"mappings":";;;;;;;;AA6CO,SAASA,WAAWA,CACzBC,aAAiD,EACjDC,YAIa,EACoC;EACjD,OAAOA,YAAY;AACrB;AAEO,SAASC,gBAAgBA,CAG9BC,IAAQ,EAAEC,SAAY,EAAmB;EACzC,OAAOD,IAAI;AACb;AACO,SAASE,eAAeA,CAC7BC,SAA8C,EAC9CC,YAAsC,EACtCJ,IAGa,EAC8B;EAC3C,MAAMK,cAAc,GAClBF,SAAS,CAGTG,QAAQ,EAAED,cAAc;EAE1B,IAAI,CAACA,cAAc,EAAE,OAAO,IAAI;EAEhC,MAAME,OAAO,GAAGH,YAAY,CAACI,WAAW,CAAC,CAAC,CAE7B;EACb,MAAMC,QAAQ,GAAGF,OAAO,EAAEG,IAAI,EAAEC,KAAK;EAErC,MAAMC,MAAM,GAAIH,QAAQ,IAAIJ,cAAc,CAACI,QAAQ,CAAC,IAAK,EAAE;EAC3D,OAAOG,MAAM,CAACC,MAAM,GAAG,CAAC,IAAID,MAAM,CAACE,KAAK,CAAEC,KAAK,IAAKf,IAAI,IAAIe,KAAK,IAAIf,IAAI,CAAC;AAC5E","ignoreList":[]}
@@ -11,7 +11,6 @@ const documents = {
11
11
  '\n query GetCurrencyStrength {\n currencyStrength {\n currency\n strengthRelation {\n currency\n percentage\n }\n updatedAt\n }\n }\n': types.GetCurrencyStrengthDocument
12
12
  };
13
13
  function graphql(source) {
14
- var _source;
15
- return (_source = documents[source]) !== null && _source !== void 0 ? _source : {};
14
+ return documents[source] ?? {};
16
15
  }
17
16
  //# sourceMappingURL=gql.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"gql.js","names":["types","_interopRequireWildcard","require","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","documents","GetCurrencyStrengthDocument","graphql","source","_source"],"sources":["../../../../src/gql/types/gql.ts"],"sourcesContent":["/* eslint-disable */\nimport * as types from './graphql';\nimport { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core';\n\n/**\n * Map of all GraphQL operations in the project.\n *\n * This map has several performance disadvantages:\n * 1. It is not tree-shakeable, so it will include all operations in the project.\n * 2. It is not minifiable, so the string of a GraphQL query will be multiple times inside the bundle.\n * 3. It does not support dead code elimination, so it will add unused operations.\n *\n * Therefore it is highly recommended to use the babel or swc plugin for production.\n */\nconst documents = {\n '\\n query GetCurrencyStrength {\\n currencyStrength {\\n currency\\n strengthRelation {\\n currency\\n percentage\\n }\\n updatedAt\\n }\\n }\\n':\n types.GetCurrencyStrengthDocument,\n};\n\n/**\n * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.\n *\n *\n * @example\n * ```ts\n * const query = graphql(`query GetUser($id: ID!) { user(id: $id) { name } }`);\n * ```\n *\n * The query argument is unknown!\n * Please regenerate the types.\n */\nexport function graphql(source: string): unknown;\n\n/**\n * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.\n */\nexport function graphql(\n source: '\\n query GetCurrencyStrength {\\n currencyStrength {\\n currency\\n strengthRelation {\\n currency\\n percentage\\n }\\n updatedAt\\n }\\n }\\n'\n): (typeof documents)['\\n query GetCurrencyStrength {\\n currencyStrength {\\n currency\\n strengthRelation {\\n currency\\n percentage\\n }\\n updatedAt\\n }\\n }\\n'];\n\nexport function graphql(source: string) {\n return (documents as any)[source] ?? {};\n}\n\nexport type DocumentType<TDocumentNode extends DocumentNode<any, any>> =\n TDocumentNode extends DocumentNode<infer TType, any> ? TType : never;\n"],"mappings":";;;;;;AACA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AAAmC,SAAAC,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAH,wBAAAG,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAd,CAAA,oBAAAc,CAAA,OAAAC,cAAA,CAAAC,IAAA,CAAAhB,CAAA,EAAAc,CAAA,SAAAG,CAAA,GAAAP,CAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAb,CAAA,EAAAc,CAAA,UAAAG,CAAA,KAAAA,CAAA,CAAAV,GAAA,IAAAU,CAAA,CAAAC,GAAA,IAAAP,MAAA,CAAAC,cAAA,CAAAJ,CAAA,EAAAM,CAAA,EAAAG,CAAA,IAAAT,CAAA,CAAAM,CAAA,IAAAd,CAAA,CAAAc,CAAA,YAAAN,CAAA,CAAAH,OAAA,GAAAL,CAAA,EAAAG,CAAA,IAAAA,CAAA,CAAAe,GAAA,CAAAlB,CAAA,EAAAQ,CAAA,GAAAA,CAAA;AAanC,MAAMW,SAAS,GAAG;EAChB,iLAAiL,EAC/KvB,KAAK,CAACwB;AACV,CAAC;AAuBM,SAASC,OAAOA,CAACC,MAAc,EAAE;EAAA,IAAAC,OAAA;EACtC,QAAAA,OAAA,GAAQJ,SAAS,CAASG,MAAM,CAAC,cAAAC,OAAA,cAAAA,OAAA,GAAI,CAAC,CAAC;AACzC","ignoreList":[]}
1
+ {"version":3,"file":"gql.js","names":["types","_interopRequireWildcard","require","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","documents","GetCurrencyStrengthDocument","graphql","source"],"sources":["../../../../src/gql/types/gql.ts"],"sourcesContent":["/* eslint-disable */\nimport * as types from './graphql';\nimport { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core';\n\n/**\n * Map of all GraphQL operations in the project.\n *\n * This map has several performance disadvantages:\n * 1. It is not tree-shakeable, so it will include all operations in the project.\n * 2. It is not minifiable, so the string of a GraphQL query will be multiple times inside the bundle.\n * 3. It does not support dead code elimination, so it will add unused operations.\n *\n * Therefore it is highly recommended to use the babel or swc plugin for production.\n */\nconst documents = {\n '\\n query GetCurrencyStrength {\\n currencyStrength {\\n currency\\n strengthRelation {\\n currency\\n percentage\\n }\\n updatedAt\\n }\\n }\\n':\n types.GetCurrencyStrengthDocument,\n};\n\n/**\n * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.\n *\n *\n * @example\n * ```ts\n * const query = graphql(`query GetUser($id: ID!) { user(id: $id) { name } }`);\n * ```\n *\n * The query argument is unknown!\n * Please regenerate the types.\n */\nexport function graphql(source: string): unknown;\n\n/**\n * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.\n */\nexport function graphql(\n source: '\\n query GetCurrencyStrength {\\n currencyStrength {\\n currency\\n strengthRelation {\\n currency\\n percentage\\n }\\n updatedAt\\n }\\n }\\n'\n): (typeof documents)['\\n query GetCurrencyStrength {\\n currencyStrength {\\n currency\\n strengthRelation {\\n currency\\n percentage\\n }\\n updatedAt\\n }\\n }\\n'];\n\nexport function graphql(source: string) {\n return (documents as any)[source] ?? {};\n}\n\nexport type DocumentType<TDocumentNode extends DocumentNode<any, any>> =\n TDocumentNode extends DocumentNode<infer TType, any> ? TType : never;\n"],"mappings":";;;;;;AACA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AAAmC,SAAAC,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAH,wBAAAG,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAd,CAAA,oBAAAc,CAAA,OAAAC,cAAA,CAAAC,IAAA,CAAAhB,CAAA,EAAAc,CAAA,SAAAG,CAAA,GAAAP,CAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAb,CAAA,EAAAc,CAAA,UAAAG,CAAA,KAAAA,CAAA,CAAAV,GAAA,IAAAU,CAAA,CAAAC,GAAA,IAAAP,MAAA,CAAAC,cAAA,CAAAJ,CAAA,EAAAM,CAAA,EAAAG,CAAA,IAAAT,CAAA,CAAAM,CAAA,IAAAd,CAAA,CAAAc,CAAA,YAAAN,CAAA,CAAAH,OAAA,GAAAL,CAAA,EAAAG,CAAA,IAAAA,CAAA,CAAAe,GAAA,CAAAlB,CAAA,EAAAQ,CAAA,GAAAA,CAAA;AAanC,MAAMW,SAAS,GAAG;EAChB,iLAAiL,EAC/KvB,KAAK,CAACwB;AACV,CAAC;AAuBM,SAASC,OAAOA,CAACC,MAAc,EAAE;EACtC,OAAQH,SAAS,CAASG,MAAM,CAAC,IAAI,CAAC,CAAC;AACzC","ignoreList":[]}
@@ -7,7 +7,6 @@ import { getCurrencyStrength } from '../gql/getCurrencyStrength';
7
7
  import { Chart } from './components/Chart';
8
8
  import { sortCurrencies } from './components/Chart/formatters';
9
9
  const ChartWithData = _ref => {
10
- var _data$currencyStrengt, _data$currencyStrengt2, _data$currencyStrengt3, _data$currencyStrengt4, _;
11
10
  let {
12
11
  currency
13
12
  } = _ref;
@@ -25,9 +24,9 @@ const ChartWithData = _ref => {
25
24
  } = useQuery(getCurrencyStrength, {
26
25
  fetchPolicy: 'cache-and-network'
27
26
  });
28
- const showChart = (data === null || data === void 0 ? void 0 : data.currencyStrength) && (data === null || data === void 0 || (_data$currencyStrengt = data.currencyStrength) === null || _data$currencyStrengt === void 0 ? void 0 : _data$currencyStrengt.length) > 0;
29
- const showError = (data === null || data === void 0 || (_data$currencyStrengt2 = data.currencyStrength) === null || _data$currencyStrengt2 === void 0 ? void 0 : _data$currencyStrengt2.length) === 0 || error;
30
- const currencyData = currency ? data === null || data === void 0 || (_data$currencyStrengt3 = data.currencyStrength) === null || _data$currencyStrengt3 === void 0 ? void 0 : _data$currencyStrengt3.filter(item => item.currency === currency) : data === null || data === void 0 || (_data$currencyStrengt4 = data.currencyStrength) === null || _data$currencyStrengt4 === void 0 ? void 0 : _data$currencyStrengt4.slice().sort(sortCurrencies);
27
+ const showChart = data?.currencyStrength && data?.currencyStrength?.length > 0;
28
+ const showError = data?.currencyStrength?.length === 0 || error;
29
+ const currencyData = currency ? data?.currencyStrength?.filter(item => item.currency === currency) : data?.currencyStrength?.slice().sort(sortCurrencies);
31
30
  return React.createElement(React.Fragment, null, loading && React.createElement("div", {
32
31
  className: classnames('lw-flex lw-w-full lw-items-center lw-border lw-border-solid lw-border-border-primary', {
33
32
  'lw-h-[461px]': !currency,
@@ -41,16 +40,13 @@ const ChartWithData = _ref => {
41
40
  'lw-grid-cols-1': !isDesktop || currency
42
41
  }),
43
42
  "data-testid": "currency-strength-chart-wrapper"
44
- }, currencyData && currencyData.map(item => {
45
- var _item$strengthRelatio;
46
- return React.createElement("div", {
47
- key: item.currency,
48
- className: "lw-flex lw-h-[135px] lw-flex-1 lw-items-center lw-justify-center"
49
- }, React.createElement(Chart, {
50
- currency: item.currency,
51
- values: (_item$strengthRelatio = item.strengthRelation) === null || _item$strengthRelatio === void 0 ? void 0 : _item$strengthRelatio.slice().sort(sortCurrencies)
52
- }));
53
- })), !loading && showError && React.createElement("div", {
43
+ }, currencyData && currencyData.map(item => React.createElement("div", {
44
+ key: item.currency,
45
+ className: "lw-flex lw-h-[135px] lw-flex-1 lw-items-center lw-justify-center"
46
+ }, React.createElement(Chart, {
47
+ currency: item.currency,
48
+ values: item.strengthRelation?.slice().sort(sortCurrencies)
49
+ })))), !loading && showError && React.createElement("div", {
54
50
  className: classnames('lw-flex lw-w-full lw-items-center lw-border lw-border-solid lw-border-border-primary', {
55
51
  'lw-h-[425px]': !currency,
56
52
  'lw-h-[135px]': currency
@@ -59,7 +55,7 @@ const ChartWithData = _ref => {
59
55
  className: "lw-mt-2 lw-h-8"
60
56
  }, React.createElement(LastUpdated, {
61
57
  labelCallback: lang,
62
- timestamp: data === null || data === void 0 || (_ = data.currencyStrength[0]) === null || _ === void 0 ? void 0 : _.updatedAt
58
+ timestamp: data?.currencyStrength[0]?.updatedAt
63
59
  })));
64
60
  };
65
61
  export { ChartWithData };
@@ -1 +1 @@
1
- {"version":3,"file":"ChartsWithData.js","names":["useQuery","ChartError","LastUpdated","Size","Spinner","SpinnerSize","useLayoutProvider","useLocale","classnames","React","getCurrencyStrength","Chart","sortCurrencies","ChartWithData","_ref","_data$currencyStrengt","_data$currencyStrengt2","_data$currencyStrengt3","_data$currencyStrengt4","_","currency","size","isDesktop","DESKTOP","lang","loading","data","error","fetchPolicy","showChart","currencyStrength","length","showError","currencyData","filter","item","slice","sort","createElement","Fragment","className","lg","map","_item$strengthRelatio","key","values","strengthRelation","labelCallback","timestamp","updatedAt"],"sources":["../../../src/CurrencyStrengthWidget/ChartsWithData.tsx"],"sourcesContent":["import { useQuery } from '@apollo/client';\nimport {\n ChartError,\n LastUpdated,\n Size,\n Spinner,\n SpinnerSize,\n useLayoutProvider,\n} from '@oanda/labs-widget-common';\nimport { useLocale } from '@oanda/mono-i18n';\nimport classnames from 'classnames';\nimport React from 'react';\n\nimport { getCurrencyStrength } from '../gql/getCurrencyStrength';\nimport type { GetCurrencyStrengthQuery } from '../gql/types/graphql';\nimport { Chart } from './components/Chart';\nimport { sortCurrencies } from './components/Chart/formatters';\nimport type { WidgetProps } from './types';\n\nconst ChartWithData = ({ currency }: WidgetProps) => {\n const { size } = useLayoutProvider();\n const isDesktop = size === Size.DESKTOP;\n const { lang } = useLocale();\n const { loading, data, error } = useQuery<GetCurrencyStrengthQuery>(\n getCurrencyStrength,\n {\n fetchPolicy: 'cache-and-network',\n }\n );\n\n const showChart =\n data?.currencyStrength && data?.currencyStrength?.length > 0;\n const showError = data?.currencyStrength?.length === 0 || error;\n\n const currencyData = currency\n ? data?.currencyStrength?.filter((item) => item.currency === currency)\n : data?.currencyStrength?.slice().sort(sortCurrencies);\n\n return (\n <>\n {loading && (\n <div\n className={classnames(\n 'lw-flex lw-w-full lw-items-center lw-border lw-border-solid lw-border-border-primary',\n {\n 'lw-h-[461px]': !currency,\n 'lw-h-[135px]': currency,\n }\n )}\n >\n <Spinner size={SpinnerSize.lg} />\n </div>\n )}\n {!loading && showChart && (\n <div\n className={classnames('lw-grid lw-place-content-center lw-gap-7', {\n 'lw-grid-cols-3 ': isDesktop && !currency,\n 'lw-grid-cols-1': !isDesktop || currency,\n })}\n data-testid=\"currency-strength-chart-wrapper\"\n >\n {currencyData &&\n currencyData.map((item) => (\n <div\n key={item.currency}\n className=\"lw-flex lw-h-[135px] lw-flex-1 lw-items-center lw-justify-center\"\n >\n <Chart\n currency={item.currency}\n values={item.strengthRelation?.slice().sort(sortCurrencies)!}\n />\n </div>\n ))}\n </div>\n )}\n {!loading && showError && (\n <div\n className={classnames(\n 'lw-flex lw-w-full lw-items-center lw-border lw-border-solid lw-border-border-primary',\n {\n 'lw-h-[425px]': !currency,\n 'lw-h-[135px]': currency,\n }\n )}\n >\n <ChartError />\n </div>\n )}\n {!loading && !showError && (\n <div className=\"lw-mt-2 lw-h-8\">\n <LastUpdated\n labelCallback={lang}\n timestamp={data?.currencyStrength![0]?.updatedAt}\n />\n </div>\n )}\n </>\n );\n};\n\nexport { ChartWithData };\n"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,gBAAgB;AACzC,SACEC,UAAU,EACVC,WAAW,EACXC,IAAI,EACJC,OAAO,EACPC,WAAW,EACXC,iBAAiB,QACZ,2BAA2B;AAClC,SAASC,SAAS,QAAQ,kBAAkB;AAC5C,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,KAAK,MAAM,OAAO;AAEzB,SAASC,mBAAmB,QAAQ,4BAA4B;AAEhE,SAASC,KAAK,QAAQ,oBAAoB;AAC1C,SAASC,cAAc,QAAQ,+BAA+B;AAG9D,MAAMC,aAAa,GAAGC,IAAA,IAA+B;EAAA,IAAAC,qBAAA,EAAAC,sBAAA,EAAAC,sBAAA,EAAAC,sBAAA,EAAAC,CAAA;EAAA,IAA9B;IAAEC;EAAsB,CAAC,GAAAN,IAAA;EAC9C,MAAM;IAAEO;EAAK,CAAC,GAAGf,iBAAiB,CAAC,CAAC;EACpC,MAAMgB,SAAS,GAAGD,IAAI,KAAKlB,IAAI,CAACoB,OAAO;EACvC,MAAM;IAAEC;EAAK,CAAC,GAAGjB,SAAS,CAAC,CAAC;EAC5B,MAAM;IAAEkB,OAAO;IAAEC,IAAI;IAAEC;EAAM,CAAC,GAAG3B,QAAQ,CACvCU,mBAAmB,EACnB;IACEkB,WAAW,EAAE;EACf,CACF,CAAC;EAED,MAAMC,SAAS,GACb,CAAAH,IAAI,aAAJA,IAAI,uBAAJA,IAAI,CAAEI,gBAAgB,KAAI,CAAAJ,IAAI,aAAJA,IAAI,gBAAAX,qBAAA,GAAJW,IAAI,CAAEI,gBAAgB,cAAAf,qBAAA,uBAAtBA,qBAAA,CAAwBgB,MAAM,IAAG,CAAC;EAC9D,MAAMC,SAAS,GAAG,CAAAN,IAAI,aAAJA,IAAI,gB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AAA,CAAC3B,KAAK;MACJS,QAAQ,EAAEe,IAAI,CAACf,QAAS;MACxByB,MAAM,GAAAF,qBAAA,GAAER,IAAI,CAACW,gBAAgB,cAAAH,qBAAA,uBAArBA,qBAAA,CAAuBP,KAAK,CAAC,CAAC,CAACC,IAAI,CAACzB,cAAc;IAAG,CAC9D,CACE,CAAC;EAAA,CACP,CACA,CACN,EACA,CAACa,OAAO,IAAIO,SAAS,IACpBvB,KAAA,CAAA6B,aAAA;IACEE,SAAS,EAAEhC,UAAU,CACnB,sFAAsF,EACtF;MACE,cAAc,EAAE,CAACY,QAAQ;MACzB,cAAc,EAAEA;IAClB,CACF;EAAE,GAEFX,KAAA,CAAA6B,aAAA,CAACrC,UAAU,MAAE,CACV,CACN,EACA,CAACwB,OAAO,IAAI,CAACO,SAAS,IACrBvB,KAAA,CAAA6B,aAAA;IAAKE,SAAS,EAAC;EAAgB,GAC7B/B,KAAA,CAAA6B,aAAA,CAACpC,WAAW;IACV6C,aAAa,EAAEvB,IAAK;IACpBwB,SAAS,EAAEtB,IAAI,aAAJA,IAAI,gBAAAP,CAAA,GAAJO,IAAI,CAAEI,gBAAgB,CAAE,CAAC,CAAC,cAAAX,CAAA,uBAA1BA,CAAA,CAA4B8B;EAAU,CAClD,CACE,CAEP,CAAC;AAEP,CAAC;AAED,SAASpC,aAAa","ignoreList":[]}
1
+ {"version":3,"file":"ChartsWithData.js","names":["useQuery","ChartError","LastUpdated","Size","Spinner","SpinnerSize","useLayoutProvider","useLocale","classnames","React","getCurrencyStrength","Chart","sortCurrencies","ChartWithData","_ref","currency","size","isDesktop","DESKTOP","lang","loading","data","error","fetchPolicy","showChart","currencyStrength","length","showError","currencyData","filter","item","slice","sort","createElement","Fragment","className","lg","map","key","values","strengthRelation","labelCallback","timestamp","updatedAt"],"sources":["../../../src/CurrencyStrengthWidget/ChartsWithData.tsx"],"sourcesContent":["import { useQuery } from '@apollo/client';\nimport {\n ChartError,\n LastUpdated,\n Size,\n Spinner,\n SpinnerSize,\n useLayoutProvider,\n} from '@oanda/labs-widget-common';\nimport { useLocale } from '@oanda/mono-i18n';\nimport classnames from 'classnames';\nimport React from 'react';\n\nimport { getCurrencyStrength } from '../gql/getCurrencyStrength';\nimport type { GetCurrencyStrengthQuery } from '../gql/types/graphql';\nimport { Chart } from './components/Chart';\nimport { sortCurrencies } from './components/Chart/formatters';\nimport type { WidgetProps } from './types';\n\nconst ChartWithData = ({ currency }: WidgetProps) => {\n const { size } = useLayoutProvider();\n const isDesktop = size === Size.DESKTOP;\n const { lang } = useLocale();\n const { loading, data, error } = useQuery<GetCurrencyStrengthQuery>(\n getCurrencyStrength,\n {\n fetchPolicy: 'cache-and-network',\n }\n );\n\n const showChart =\n data?.currencyStrength && data?.currencyStrength?.length > 0;\n const showError = data?.currencyStrength?.length === 0 || error;\n\n const currencyData = currency\n ? data?.currencyStrength?.filter((item) => item.currency === currency)\n : data?.currencyStrength?.slice().sort(sortCurrencies);\n\n return (\n <>\n {loading && (\n <div\n className={classnames(\n 'lw-flex lw-w-full lw-items-center lw-border lw-border-solid lw-border-border-primary',\n {\n 'lw-h-[461px]': !currency,\n 'lw-h-[135px]': currency,\n }\n )}\n >\n <Spinner size={SpinnerSize.lg} />\n </div>\n )}\n {!loading && showChart && (\n <div\n className={classnames('lw-grid lw-place-content-center lw-gap-7', {\n 'lw-grid-cols-3 ': isDesktop && !currency,\n 'lw-grid-cols-1': !isDesktop || currency,\n })}\n data-testid=\"currency-strength-chart-wrapper\"\n >\n {currencyData &&\n currencyData.map((item) => (\n <div\n key={item.currency}\n className=\"lw-flex lw-h-[135px] lw-flex-1 lw-items-center lw-justify-center\"\n >\n <Chart\n currency={item.currency}\n values={item.strengthRelation?.slice().sort(sortCurrencies)!}\n />\n </div>\n ))}\n </div>\n )}\n {!loading && showError && (\n <div\n className={classnames(\n 'lw-flex lw-w-full lw-items-center lw-border lw-border-solid lw-border-border-primary',\n {\n 'lw-h-[425px]': !currency,\n 'lw-h-[135px]': currency,\n }\n )}\n >\n <ChartError />\n </div>\n )}\n {!loading && !showError && (\n <div className=\"lw-mt-2 lw-h-8\">\n <LastUpdated\n labelCallback={lang}\n timestamp={data?.currencyStrength![0]?.updatedAt}\n />\n </div>\n )}\n </>\n );\n};\n\nexport { ChartWithData };\n"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,gBAAgB;AACzC,SACEC,UAAU,EACVC,WAAW,EACXC,IAAI,EACJC,OAAO,EACPC,WAAW,EACXC,iBAAiB,QACZ,2BAA2B;AAClC,SAASC,SAAS,QAAQ,kBAAkB;AAC5C,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,KAAK,MAAM,OAAO;AAEzB,SAASC,mBAAmB,QAAQ,4BAA4B;AAEhE,SAASC,KAAK,QAAQ,oBAAoB;AAC1C,SAASC,cAAc,QAAQ,+BAA+B;AAG9D,MAAMC,aAAa,GAAGC,IAAA,IAA+B;EAAA,IAA9B;IAAEC;EAAsB,CAAC,GAAAD,IAAA;EAC9C,MAAM;IAAEE;EAAK,CAAC,GAAGV,iBAAiB,CAAC,CAAC;EACpC,MAAMW,SAAS,GAAGD,IAAI,KAAKb,IAAI,CAACe,OAAO;EACvC,MAAM;IAAEC;EAAK,CAAC,GAAGZ,SAAS,CAAC,CAAC;EAC5B,MAAM;IAAEa,OAAO;IAAEC,IAAI;IAAEC;EAAM,CAAC,GAAGtB,QAAQ,CACvCU,mBAAmB,EACnB;IACEa,WAAW,EAAE;EACf,CACF,CAAC;EAED,MAAMC,SAAS,GACbH,IAAI,EAAEI,gBAAgB,IAAIJ,IAAI,EAAEI,gBAAgB,EAAEC,MAAM,GAAG,CAAC;EAC9D,MAAMC,SAAS,GAAGN,IAAI,EAAEI,gBAAgB,EAAEC,MAAM,KAAK,CAAC,IAAIJ,KAAK;EAE/D,MAAMM,YAAY,GAAGb,QAAQ,GACzBM,IAAI,EAAEI,gBAAgB,EAAEI,MAAM,CAAEC,IAAI,IAAKA,IAAI,CAACf,QAAQ,KAAKA,QAAQ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AI,CAACO,SAAS,IACrBlB,KAAA,CAAAwB,aAAA;IAAKE,SAAS,EAAC;EAAgB,GAC7B1B,KAAA,CAAAwB,aAAA,CAAC/B,WAAW;IACVuC,aAAa,EAAEtB,IAAK;IACpBuB,SAAS,EAAErB,IAAI,EAAEI,gBAAgB,CAAE,CAAC,CAAC,EAAEkB;EAAU,CAClD,CACE,CAEP,CAAC;AAEP,CAAC;AAED,SAAS9B,aAAa","ignoreList":[]}
@@ -16,9 +16,9 @@ const Main = _ref => {
16
16
  "data-testid": "currency-strength-wrapper"
17
17
  }, React.createElement("div", {
18
18
  className: "lw-mb-8 lw-flex lw-justify-center lw-font-sans lw-text-lg lw-font-bold"
19
- }, React.createElement("span", null, "".concat(lang('daily'), " (").concat(lang('minute', {
19
+ }, React.createElement("span", null, `${lang('daily')} (${lang('minute', {
20
20
  count: 5
21
- }), ")"))), React.createElement(ChartWithData, {
21
+ })})`)), React.createElement(ChartWithData, {
22
22
  currency: currency
23
23
  })));
24
24
  };
@@ -1 +1 @@
1
- {"version":3,"file":"Main.js","names":["useLayoutProvider","useLocale","React","ChartWithData","Main","_ref","currency","lang","size","createElement","Fragment","className","concat","count"],"sources":["../../../src/CurrencyStrengthWidget/Main.tsx"],"sourcesContent":["import { useLayoutProvider } from '@oanda/labs-widget-common';\nimport { useLocale } from '@oanda/mono-i18n';\nimport React from 'react';\n\nimport { ChartWithData } from './ChartsWithData';\nimport type { WidgetProps } from './types';\n\nconst Main = ({ currency }: WidgetProps) => {\n const { lang } = useLocale();\n const { size } = useLayoutProvider();\n\n return (\n <>\n {size && (\n <div data-testid=\"currency-strength-wrapper\">\n <div className=\"lw-mb-8 lw-flex lw-justify-center lw-font-sans lw-text-lg lw-font-bold\">\n <span>{`${lang('daily')} (${lang('minute', { count: 5 })})`}</span>\n </div>\n <ChartWithData currency={currency} />\n </div>\n )}\n </>\n );\n};\n\nexport { Main };\n"],"mappings":"AAAA,SAASA,iBAAiB,QAAQ,2BAA2B;AAC7D,SAASC,SAAS,QAAQ,kBAAkB;AAC5C,OAAOC,KAAK,MAAM,OAAO;AAEzB,SAASC,aAAa,QAAQ,kBAAkB;AAGhD,MAAMC,IAAI,GAAGC,IAAA,IAA+B;EAAA,IAA9B;IAAEC;EAAsB,CAAC,GAAAD,IAAA;EACrC,MAAM;IAAEE;EAAK,CAAC,GAAGN,SAAS,CAAC,CAAC;EAC5B,MAAM;IAAEO;EAAK,CAAC,GAAGR,iBAAiB,CAAC,CAAC;EAEpC,OACEE,KAAA,CAAAO,aAAA,CAAAP,KAAA,CAAAQ,QAAA,QACGF,IAAI,IACHN,KAAA,CAAAO,aAAA;IAAK,eAAY;EAA2B,GAC1CP,KAAA,CAAAO,aAAA;IAAKE,SAAS,EAAC;EAAwE,GACrFT,KAAA,CAAAO,aAAA,kBAAAG,MAAA,CAAUL,IAAI,CAAC,OAAO,CAAC,QAAAK,MAAA,CAAKL,IAAI,CAAC,QAAQ,EAAE;IAAEM,KAAK,EAAE;EAAE,CAAC,CAAC,MAAU,CAC/D,CAAC,EACNX,KAAA,CAAAO,aAAA,CAACN,aAAa;IAACG,QAAQ,EAAEA;EAAS,CAAE,CACjC,CAEP,CAAC;AAEP,CAAC;AAED,SAASF,IAAI","ignoreList":[]}
1
+ {"version":3,"file":"Main.js","names":["useLayoutProvider","useLocale","React","ChartWithData","Main","_ref","currency","lang","size","createElement","Fragment","className","count"],"sources":["../../../src/CurrencyStrengthWidget/Main.tsx"],"sourcesContent":["import { useLayoutProvider } from '@oanda/labs-widget-common';\nimport { useLocale } from '@oanda/mono-i18n';\nimport React from 'react';\n\nimport { ChartWithData } from './ChartsWithData';\nimport type { WidgetProps } from './types';\n\nconst Main = ({ currency }: WidgetProps) => {\n const { lang } = useLocale();\n const { size } = useLayoutProvider();\n\n return (\n <>\n {size && (\n <div data-testid=\"currency-strength-wrapper\">\n <div className=\"lw-mb-8 lw-flex lw-justify-center lw-font-sans lw-text-lg lw-font-bold\">\n <span>{`${lang('daily')} (${lang('minute', { count: 5 })})`}</span>\n </div>\n <ChartWithData currency={currency} />\n </div>\n )}\n </>\n );\n};\n\nexport { Main };\n"],"mappings":"AAAA,SAASA,iBAAiB,QAAQ,2BAA2B;AAC7D,SAASC,SAAS,QAAQ,kBAAkB;AAC5C,OAAOC,KAAK,MAAM,OAAO;AAEzB,SAASC,aAAa,QAAQ,kBAAkB;AAGhD,MAAMC,IAAI,GAAGC,IAAA,IAA+B;EAAA,IAA9B;IAAEC;EAAsB,CAAC,GAAAD,IAAA;EACrC,MAAM;IAAEE;EAAK,CAAC,GAAGN,SAAS,CAAC,CAAC;EAC5B,MAAM;IAAEO;EAAK,CAAC,GAAGR,iBAAiB,CAAC,CAAC;EAEpC,OACEE,KAAA,CAAAO,aAAA,CAAAP,KAAA,CAAAQ,QAAA,QACGF,IAAI,IACHN,KAAA,CAAAO,aAAA;IAAK,eAAY;EAA2B,GAC1CP,KAAA,CAAAO,aAAA;IAAKE,SAAS,EAAC;EAAwE,GACrFT,KAAA,CAAAO,aAAA,eAAO,GAAGF,IAAI,CAAC,OAAO,CAAC,KAAKA,IAAI,CAAC,QAAQ,EAAE;IAAEK,KAAK,EAAE;EAAE,CAAC,CAAC,GAAU,CAC/D,CAAC,EACNV,KAAA,CAAAO,aAAA,CAACN,aAAa;IAACG,QAAQ,EAAEA;EAAS,CAAE,CACjC,CAEP,CAAC;AAEP,CAAC;AAED,SAASF,IAAI","ignoreList":[]}
@@ -31,7 +31,7 @@ const Chart = _ref => {
31
31
  isDark
32
32
  }),
33
33
  style: {
34
- height: "".concat(CHART_HEIGHT, "px"),
34
+ height: `${CHART_HEIGHT}px`,
35
35
  width: '100%'
36
36
  },
37
37
  theme: isDark ? 'dark_theme' : 'light_theme'
@@ -1 +1 @@
1
- {"version":3,"file":"Chart.js","names":["getChartTheme","Theme","useLayoutProvider","useLocale","BarChart","GraphicComponent","GridSimpleComponent","TitleComponent","TooltipComponent","echarts","CanvasRenderer","ReactEChartsCore","React","CHART_HEIGHT","getOption","use","registerTheme","Dark","Light","Chart","_ref","values","currency","lang","isDark","createElement","option","style","height","concat","width","theme"],"sources":["../../../../../src/CurrencyStrengthWidget/components/Chart/Chart.tsx"],"sourcesContent":["import {\n getChartTheme,\n Theme,\n useLayoutProvider,\n} from '@oanda/labs-widget-common';\nimport { useLocale } from '@oanda/mono-i18n';\nimport { BarChart } from 'echarts/charts';\nimport {\n GraphicComponent,\n GridSimpleComponent,\n TitleComponent,\n TooltipComponent,\n} from 'echarts/components';\nimport * as echarts from 'echarts/core';\nimport { CanvasRenderer } from 'echarts/renderers';\nimport ReactEChartsCore from 'echarts-for-react/lib/core';\nimport React from 'react';\n\nimport { CHART_HEIGHT } from './constants';\nimport { getOption } from './getOption';\nimport type { ChartProps } from './types';\n\necharts.use([\n GridSimpleComponent,\n GraphicComponent,\n TooltipComponent,\n TitleComponent,\n BarChart,\n CanvasRenderer,\n]);\n\necharts.registerTheme('dark_theme', getChartTheme(Theme.Dark));\necharts.registerTheme('light_theme', getChartTheme(Theme.Light));\n\nconst Chart = ({ values, currency }: ChartProps) => {\n const { lang } = useLocale();\n const { isDark } = useLayoutProvider();\n\n return (\n <ReactEChartsCore\n echarts={echarts}\n option={getOption({\n values,\n currency,\n lang,\n isDark,\n })}\n style={{\n height: `${CHART_HEIGHT}px`,\n width: '100%',\n }}\n theme={isDark ? 'dark_theme' : 'light_theme'}\n />\n );\n};\n\nexport { Chart };\n"],"mappings":"AAAA,SACEA,aAAa,EACbC,KAAK,EACLC,iBAAiB,QACZ,2BAA2B;AAClC,SAASC,SAAS,QAAQ,kBAAkB;AAC5C,SAASC,QAAQ,QAAQ,gBAAgB;AACzC,SACEC,gBAAgB,EAChBC,mBAAmB,EACnBC,cAAc,EACdC,gBAAgB,QACX,oBAAoB;AAC3B,OAAO,KAAKC,OAAO,MAAM,cAAc;AACvC,SAASC,cAAc,QAAQ,mBAAmB;AAClD,OAAOC,gBAAgB,MAAM,4BAA4B;AACzD,OAAOC,KAAK,MAAM,OAAO;AAEzB,SAASC,YAAY,QAAQ,aAAa;AAC1C,SAASC,SAAS,QAAQ,aAAa;AAGvCL,OAAO,CAACM,GAAG,CAAC,CACVT,mBAAmB,EACnBD,gBAAgB,EAChBG,gBAAgB,EAChBD,cAAc,EACdH,QAAQ,EACRM,cAAc,CACf,CAAC;AAEFD,OAAO,CAACO,aAAa,CAAC,YAAY,EAAEhB,aAAa,CAACC,KAAK,CAACgB,IAAI,CAAC,CAAC;AAC9DR,OAAO,CAACO,aAAa,CAAC,aAAa,EAAEhB,aAAa,CAACC,KAAK,CAACiB,KAAK,CAAC,CAAC;AAEhE,MAAMC,KAAK,GAAGC,IAAA,IAAsC;EAAA,IAArC;IAAEC,MAAM;IAAEC;EAAqB,CAAC,GAAAF,IAAA;EAC7C,MAAM;IAAEG;EAAK,CAAC,GAAGpB,SAAS,CAAC,CAAC;EAC5B,MAAM;IAAEqB;EAAO,CAAC,GAAGtB,iBAAiB,CAAC,CAAC;EAEtC,OACEU,KAAA,CAAAa,aAAA,CAACd,gBAAgB;IACfF,OAAO,EAAEA,OAAQ;IACjBiB,MAAM,EAAEZ,SAAS,CAAC;MAChBO,MAAM;MACNC,QAAQ;MACRC,IAAI;MACJC;IACF,CAAC,CAAE;IACHG,KAAK,EAAE;MACLC,MAAM,KAAAC,MAAA,CAAKhB,YAAY,OAAI;MAC3BiB,KAAK,EAAE;IACT,CAAE;IACFC,KAAK,EAAEP,MAAM,GAAG,YAAY,GAAG;EAAc,CAC9C,CAAC;AAEN,CAAC;AAED,SAASL,KAAK","ignoreList":[]}
1
+ {"version":3,"file":"Chart.js","names":["getChartTheme","Theme","useLayoutProvider","useLocale","BarChart","GraphicComponent","GridSimpleComponent","TitleComponent","TooltipComponent","echarts","CanvasRenderer","ReactEChartsCore","React","CHART_HEIGHT","getOption","use","registerTheme","Dark","Light","Chart","_ref","values","currency","lang","isDark","createElement","option","style","height","width","theme"],"sources":["../../../../../src/CurrencyStrengthWidget/components/Chart/Chart.tsx"],"sourcesContent":["import {\n getChartTheme,\n Theme,\n useLayoutProvider,\n} from '@oanda/labs-widget-common';\nimport { useLocale } from '@oanda/mono-i18n';\nimport { BarChart } from 'echarts/charts';\nimport {\n GraphicComponent,\n GridSimpleComponent,\n TitleComponent,\n TooltipComponent,\n} from 'echarts/components';\nimport * as echarts from 'echarts/core';\nimport { CanvasRenderer } from 'echarts/renderers';\nimport ReactEChartsCore from 'echarts-for-react/lib/core';\nimport React from 'react';\n\nimport { CHART_HEIGHT } from './constants';\nimport { getOption } from './getOption';\nimport type { ChartProps } from './types';\n\necharts.use([\n GridSimpleComponent,\n GraphicComponent,\n TooltipComponent,\n TitleComponent,\n BarChart,\n CanvasRenderer,\n]);\n\necharts.registerTheme('dark_theme', getChartTheme(Theme.Dark));\necharts.registerTheme('light_theme', getChartTheme(Theme.Light));\n\nconst Chart = ({ values, currency }: ChartProps) => {\n const { lang } = useLocale();\n const { isDark } = useLayoutProvider();\n\n return (\n <ReactEChartsCore\n echarts={echarts}\n option={getOption({\n values,\n currency,\n lang,\n isDark,\n })}\n style={{\n height: `${CHART_HEIGHT}px`,\n width: '100%',\n }}\n theme={isDark ? 'dark_theme' : 'light_theme'}\n />\n );\n};\n\nexport { Chart };\n"],"mappings":"AAAA,SACEA,aAAa,EACbC,KAAK,EACLC,iBAAiB,QACZ,2BAA2B;AAClC,SAASC,SAAS,QAAQ,kBAAkB;AAC5C,SAASC,QAAQ,QAAQ,gBAAgB;AACzC,SACEC,gBAAgB,EAChBC,mBAAmB,EACnBC,cAAc,EACdC,gBAAgB,QACX,oBAAoB;AAC3B,OAAO,KAAKC,OAAO,MAAM,cAAc;AACvC,SAASC,cAAc,QAAQ,mBAAmB;AAClD,OAAOC,gBAAgB,MAAM,4BAA4B;AACzD,OAAOC,KAAK,MAAM,OAAO;AAEzB,SAASC,YAAY,QAAQ,aAAa;AAC1C,SAASC,SAAS,QAAQ,aAAa;AAGvCL,OAAO,CAACM,GAAG,CAAC,CACVT,mBAAmB,EACnBD,gBAAgB,EAChBG,gBAAgB,EAChBD,cAAc,EACdH,QAAQ,EACRM,cAAc,CACf,CAAC;AAEFD,OAAO,CAACO,aAAa,CAAC,YAAY,EAAEhB,aAAa,CAACC,KAAK,CAACgB,IAAI,CAAC,CAAC;AAC9DR,OAAO,CAACO,aAAa,CAAC,aAAa,EAAEhB,aAAa,CAACC,KAAK,CAACiB,KAAK,CAAC,CAAC;AAEhE,MAAMC,KAAK,GAAGC,IAAA,IAAsC;EAAA,IAArC;IAAEC,MAAM;IAAEC;EAAqB,CAAC,GAAAF,IAAA;EAC7C,MAAM;IAAEG;EAAK,CAAC,GAAGpB,SAAS,CAAC,CAAC;EAC5B,MAAM;IAAEqB;EAAO,CAAC,GAAGtB,iBAAiB,CAAC,CAAC;EAEtC,OACEU,KAAA,CAAAa,aAAA,CAACd,gBAAgB;IACfF,OAAO,EAAEA,OAAQ;IACjBiB,MAAM,EAAEZ,SAAS,CAAC;MAChBO,MAAM;MACNC,QAAQ;MACRC,IAAI;MACJC;IACF,CAAC,CAAE;IACHG,KAAK,EAAE;MACLC,MAAM,EAAE,GAAGf,YAAY,IAAI;MAC3BgB,KAAK,EAAE;IACT,CAAE;IACFC,KAAK,EAAEN,MAAM,GAAG,YAAY,GAAG;EAAc,CAC9C,CAAC;AAEN,CAAC;AAED,SAASL,KAAK","ignoreList":[]}
@@ -7,7 +7,11 @@ const tooltipFormatter = _ref => {
7
7
  currency,
8
8
  lang
9
9
  } = _ref;
10
- return "\n<div>\n <div style=\"margin-bottom:5px;\">".concat(currency, " ").concat(lang('vs'), " ").concat(name, "</div>\n <div style=\"display:flex;align-items:center;\">").concat(marker, " ").concat(value, "%</div>\n</div>");
10
+ return `
11
+ <div>
12
+ <div style="margin-bottom:5px;">${currency} ${lang('vs')} ${name}</div>
13
+ <div style="display:flex;align-items:center;">${marker} ${value}%</div>
14
+ </div>`;
11
15
  };
12
16
  const sortCurrencies = (a, b) => instrumentsConfig.indexOf(a.currency) - instrumentsConfig.indexOf(b.currency);
13
17
  export { sortCurrencies, tooltipFormatter };
@@ -1 +1 @@
1
- {"version":3,"file":"formatters.js","names":["instrumentsConfig","tooltipFormatter","_ref","marker","name","value","currency","lang","concat","sortCurrencies","a","b","indexOf"],"sources":["../../../../../src/CurrencyStrengthWidget/components/Chart/formatters.ts"],"sourcesContent":["import { instrumentsConfig } from './constants';\nimport type { SortingParams, TooltipFormatterParams } from './types';\n\nconst tooltipFormatter = ({\n marker,\n name,\n value,\n currency,\n lang,\n}: TooltipFormatterParams) => `\n<div>\n <div style=\"margin-bottom:5px;\">${currency} ${lang('vs')} ${name}</div>\n <div style=\"display:flex;align-items:center;\">${marker} ${value}%</div>\n</div>`;\n\nconst sortCurrencies = (a: SortingParams, b: SortingParams) =>\n instrumentsConfig.indexOf(a.currency) - instrumentsConfig.indexOf(b.currency);\n\nexport { sortCurrencies, tooltipFormatter };\n"],"mappings":"AAAA,SAASA,iBAAiB,QAAQ,aAAa;AAG/C,MAAMC,gBAAgB,GAAGC,IAAA;EAAA,IAAC;IACxBC,MAAM;IACNC,IAAI;IACJC,KAAK;IACLC,QAAQ;IACRC;EACsB,CAAC,GAAAL,IAAA;EAAA,uDAAAM,MAAA,CAEWF,QAAQ,OAAAE,MAAA,CAAID,IAAI,CAAC,IAAI,CAAC,OAAAC,MAAA,CAAIJ,IAAI,gEAAAI,MAAA,CAChBL,MAAM,OAAAK,MAAA,CAAIH,KAAK;AAAA,CAC1D;AAEP,MAAMI,cAAc,GAAGA,CAACC,CAAgB,EAAEC,CAAgB,KACxDX,iBAAiB,CAACY,OAAO,CAACF,CAAC,CAACJ,QAAQ,CAAC,GAAGN,iBAAiB,CAACY,OAAO,CAACD,CAAC,CAACL,QAAQ,CAAC;AAE/E,SAASG,cAAc,EAAER,gBAAgB","ignoreList":[]}
1
+ {"version":3,"file":"formatters.js","names":["instrumentsConfig","tooltipFormatter","_ref","marker","name","value","currency","lang","sortCurrencies","a","b","indexOf"],"sources":["../../../../../src/CurrencyStrengthWidget/components/Chart/formatters.ts"],"sourcesContent":["import { instrumentsConfig } from './constants';\nimport type { SortingParams, TooltipFormatterParams } from './types';\n\nconst tooltipFormatter = ({\n marker,\n name,\n value,\n currency,\n lang,\n}: TooltipFormatterParams) => `\n<div>\n <div style=\"margin-bottom:5px;\">${currency} ${lang('vs')} ${name}</div>\n <div style=\"display:flex;align-items:center;\">${marker} ${value}%</div>\n</div>`;\n\nconst sortCurrencies = (a: SortingParams, b: SortingParams) =>\n instrumentsConfig.indexOf(a.currency) - instrumentsConfig.indexOf(b.currency);\n\nexport { sortCurrencies, tooltipFormatter };\n"],"mappings":"AAAA,SAASA,iBAAiB,QAAQ,aAAa;AAG/C,MAAMC,gBAAgB,GAAGC,IAAA;EAAA,IAAC;IACxBC,MAAM;IACNC,IAAI;IACJC,KAAK;IACLC,QAAQ;IACRC;EACsB,CAAC,GAAAL,IAAA;EAAA,OAAK;AAC9B;AACA,oCAAoCI,QAAQ,IAAIC,IAAI,CAAC,IAAI,CAAC,IAAIH,IAAI;AAClE,kDAAkDD,MAAM,IAAIE,KAAK;AACjE,OAAO;AAAA;AAEP,MAAMG,cAAc,GAAGA,CAACC,CAAgB,EAAEC,CAAgB,KACxDV,iBAAiB,CAACW,OAAO,CAACF,CAAC,CAACH,QAAQ,CAAC,GAAGN,iBAAiB,CAACW,OAAO,CAACD,CAAC,CAACJ,QAAQ,CAAC;AAE/E,SAASE,cAAc,EAAEP,gBAAgB","ignoreList":[]}
@@ -22,7 +22,7 @@ export const getOption = _ref => {
22
22
  animation: false,
23
23
  title: {
24
24
  left: 'center',
25
- text: "".concat(currency, " vs"),
25
+ text: `${currency} vs`,
26
26
  textStyle: {
27
27
  fontSize: 12,
28
28
  lineHeight: 20,
@@ -33,8 +33,8 @@ export const getOption = _ref => {
33
33
  name: 'main-grid',
34
34
  top: '30px',
35
35
  right: '0px',
36
- left: "".concat(Y_LABEL_SIZE, "px"),
37
- bottom: "".concat(X_LABEL_SIZE, "px")
36
+ left: `${Y_LABEL_SIZE}px`,
37
+ bottom: `${X_LABEL_SIZE}px`
38
38
  }],
39
39
  graphic: [...gridLines],
40
40
  tooltip: {
@@ -1 +1 @@
1
- {"version":3,"file":"getOption.js","names":["getGridLines","CHART_HEIGHT","CHART_WIDTH","darkBarColors","lightBarColors","X_LABEL_SIZE","Y_LABEL_SIZE","tooltipFormatter","getOption","_ref","values","currency","isDark","lang","currencies","map","item","percentages","percentage","barColors","gridLines","chartWidth","chartHeight","xLabelsSize","yLabelSize","animation","title","left","text","concat","textStyle","fontSize","lineHeight","fontWeight","grid","name","top","right","bottom","graphic","tooltip","trigger","formatter","_ref2","marker","value","axisPointer","axis","extraCssText","xAxis","type","data","axisTick","show","axisLine","splitLine","axisLabel","yAxis","position","min","Math","floor","max","ceil","interval","series","emphasis","disabled","itemStyle","opacity","color","_ref3","positive","negative","zero"],"sources":["../../../../../src/CurrencyStrengthWidget/components/Chart/getOption.ts"],"sourcesContent":["import { getGridLines } from '@oanda/labs-widget-common';\n\nimport {\n CHART_HEIGHT,\n CHART_WIDTH,\n darkBarColors,\n lightBarColors,\n X_LABEL_SIZE,\n Y_LABEL_SIZE,\n} from './constants';\nimport { tooltipFormatter } from './formatters';\nimport type { GetOptionProps } from './types';\n\nexport const getOption = ({\n values,\n currency,\n isDark,\n lang,\n}: GetOptionProps) => {\n const currencies = values.map((item) => item.currency);\n const percentages = values.map((item) => item.percentage);\n const barColors = isDark ? darkBarColors : lightBarColors;\n\n const gridLines = getGridLines({\n isDark,\n chartWidth: CHART_WIDTH,\n chartHeight: CHART_HEIGHT,\n xLabelsSize: -2,\n yLabelSize: -3,\n });\n\n return {\n animation: false,\n title: {\n left: 'center',\n text: `${currency} vs`,\n textStyle: {\n fontSize: 12,\n lineHeight: 20,\n fontWeight: 400,\n },\n },\n grid: [\n {\n name: 'main-grid',\n top: '30px',\n right: '0px',\n left: `${Y_LABEL_SIZE}px`,\n bottom: `${X_LABEL_SIZE}px`,\n },\n ],\n graphic: [...gridLines],\n tooltip: {\n trigger: 'axis',\n formatter: ([{ marker, name, value }]: {\n marker: string;\n name: string;\n value: number;\n }[]) =>\n tooltipFormatter({\n lang,\n currency,\n marker,\n name,\n value,\n }),\n axisPointer: {\n axis: 'x',\n },\n extraCssText: 'z-index: 1',\n },\n xAxis: {\n type: 'category',\n data: currencies,\n axisTick: { show: false },\n axisLine: { show: false },\n splitLine: { show: false },\n axisLabel: {\n fontSize: 10,\n },\n },\n yAxis: {\n type: 'value',\n position: 'left',\n min: Math.floor(Math.min(...percentages)),\n max: Math.ceil(Math.max(...percentages)),\n interval: 1,\n axisLine: { show: false },\n axisTick: { show: false },\n axisLabel: {\n formatter: '{value}%',\n fontSize: 10,\n },\n },\n series: [\n {\n data: percentages,\n type: 'bar',\n emphasis: {\n disabled: true,\n },\n itemStyle: {\n opacity: 1,\n color: ({ data }: { data: number }) => {\n if (data > 0) {\n return barColors.positive;\n }\n if (data < 0) {\n return barColors.negative;\n }\n return barColors.zero;\n },\n },\n },\n ],\n };\n};\n"],"mappings":"AAAA,SAASA,YAAY,QAAQ,2BAA2B;AAExD,SACEC,YAAY,EACZC,WAAW,EACXC,aAAa,EACbC,cAAc,EACdC,YAAY,EACZC,YAAY,QACP,aAAa;AACpB,SAASC,gBAAgB,QAAQ,cAAc;AAG/C,OAAO,MAAMC,SAAS,GAAGC,IAAA,IAKH;EAAA,IALI;IACxBC,MAAM;IACNC,QAAQ;IACRC,MAAM;IACNC;EACc,CAAC,GAAAJ,IAAA;EACf,MAAMK,UAAU,GAAGJ,MAAM,CAACK,GAAG,CAAEC,IAAI,IAAKA,IAAI,CAACL,QAAQ,CAAC;EACtD,MAAMM,WAAW,GAAGP,MAAM,CAACK,GAAG,CAAEC,IAAI,IAAKA,IAAI,CAACE,UAAU,CAAC;EACzD,MAAMC,SAAS,GAAGP,MAAM,GAAGT,aAAa,GAAGC,cAAc;EAEzD,MAAMgB,SAAS,GAAGpB,YAAY,CAAC;IAC7BY,MAAM;IACNS,UAAU,EAAEnB,WAAW;IACvBoB,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MACbQ,QAAQ,EAAE,MAAM;MAChBC,GAAG,EAAEC,IAAI,CAACC,KAAK,CAACD,IAAI,CAACD,GAAG,CAAC,GAAG1C,WAAW,CAAC,CAAC;MACzC6C,GAAG,EAAEF,IAAI,CAACG,IAAI,CAACH,IAAI,CAACE,GAAG,CAAC,GAAG7C,WAAW,CAAC,CAAC;MACxC+C,QAAQ,EAAE,CAAC;MACXV,QAAQ,EAAE;QAAED,IAAI,EAAE;MAAM,CAAC;MACzBD,QAAQ,EAAE;QAAEC,IAAI,EAAE;MAAM,CAAC;MACzBG,SAAS,EAAE;QACTd,SAAS,EAAE,UAAU;QACrBX,QAAQ,EAAE;MACZ;IACF,CAAC;IACDkC,MAAM,EAAE,CACN;MACEd,IAAI,EAAElC,WAAW;MACjBiC,IAAI,EAAE,KAAK;MACXgB,QAAQ,EAAE;QACRC,QAAQ,EAAE;MACZ,CAAC;MACDC,SAAS,EAAE;QACTC,OAAO,EAAE,CAAC;QACVC,KAAK,EAAEC,KAAA,IAAgC;UAAA,IAA/B;YAAEpB;UAAuB,CAAC,GAAAoB,KAAA;UAChC,IAAIpB,IAAI,GAAG,CAAC,EAAE;YACZ,OAAOhC,SAAS,CAACqD,QAAQ;UAC3B;UACA,IAAIrB,IAAI,GAAG,CAAC,EAAE;YACZ,OAAOhC,SAAS,CAACsD,QAAQ;UAC3B;UACA,OAAOtD,SAAS,CAACuD,IAAI;QACvB;MACF;IACF,CAAC;EAEL,CAAC;AACH,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"getOption.js","names":["getGridLines","CHART_HEIGHT","CHART_WIDTH","darkBarColors","lightBarColors","X_LABEL_SIZE","Y_LABEL_SIZE","tooltipFormatter","getOption","_ref","values","currency","isDark","lang","currencies","map","item","percentages","percentage","barColors","gridLines","chartWidth","chartHeight","xLabelsSize","yLabelSize","animation","title","left","text","textStyle","fontSize","lineHeight","fontWeight","grid","name","top","right","bottom","graphic","tooltip","trigger","formatter","_ref2","marker","value","axisPointer","axis","extraCssText","xAxis","type","data","axisTick","show","axisLine","splitLine","axisLabel","yAxis","position","min","Math","floor","max","ceil","interval","series","emphasis","disabled","itemStyle","opacity","color","_ref3","positive","negative","zero"],"sources":["../../../../../src/CurrencyStrengthWidget/components/Chart/getOption.ts"],"sourcesContent":["import { getGridLines } from '@oanda/labs-widget-common';\n\nimport {\n CHART_HEIGHT,\n CHART_WIDTH,\n darkBarColors,\n lightBarColors,\n X_LABEL_SIZE,\n Y_LABEL_SIZE,\n} from './constants';\nimport { tooltipFormatter } from './formatters';\nimport type { GetOptionProps } from './types';\n\nexport const getOption = ({\n values,\n currency,\n isDark,\n lang,\n}: GetOptionProps) => {\n const currencies = values.map((item) => item.currency);\n const percentages = values.map((item) => item.percentage);\n const barColors = isDark ? darkBarColors : lightBarColors;\n\n const gridLines = getGridLines({\n isDark,\n chartWidth: CHART_WIDTH,\n chartHeight: CHART_HEIGHT,\n xLabelsSize: -2,\n yLabelSize: -3,\n });\n\n return {\n animation: false,\n title: {\n left: 'center',\n text: `${currency} vs`,\n textStyle: {\n fontSize: 12,\n lineHeight: 20,\n fontWeight: 400,\n },\n },\n grid: [\n {\n name: 'main-grid',\n top: '30px',\n right: '0px',\n left: `${Y_LABEL_SIZE}px`,\n bottom: `${X_LABEL_SIZE}px`,\n },\n ],\n graphic: [...gridLines],\n tooltip: {\n trigger: 'axis',\n formatter: ([{ marker, name, value }]: {\n marker: string;\n name: string;\n value: number;\n }[]) =>\n tooltipFormatter({\n lang,\n currency,\n marker,\n name,\n value,\n }),\n axisPointer: {\n axis: 'x',\n },\n extraCssText: 'z-index: 1',\n },\n xAxis: {\n type: 'category',\n data: currencies,\n axisTick: { show: false },\n axisLine: { show: false },\n splitLine: { show: false },\n axisLabel: {\n fontSize: 10,\n },\n },\n yAxis: {\n type: 'value',\n position: 'left',\n min: Math.floor(Math.min(...percentages)),\n max: Math.ceil(Math.max(...percentages)),\n interval: 1,\n axisLine: { show: false },\n axisTick: { show: false },\n axisLabel: {\n formatter: '{value}%',\n fontSize: 10,\n },\n },\n series: [\n {\n data: percentages,\n type: 'bar',\n emphasis: {\n disabled: true,\n },\n itemStyle: {\n opacity: 1,\n color: ({ data }: { data: number }) => {\n if (data > 0) {\n return barColors.positive;\n }\n if (data < 0) {\n return barColors.negative;\n }\n return barColors.zero;\n },\n },\n },\n ],\n };\n};\n"],"mappings":"AAAA,SAASA,YAAY,QAAQ,2BAA2B;AAExD,SACEC,YAAY,EACZC,WAAW,EACXC,aAAa,EACbC,cAAc,EACdC,YAAY,EACZC,YAAY,QACP,aAAa;AACpB,SAASC,gBAAgB,QAAQ,cAAc;AAG/C,OAAO,MAAMC,SAAS,GAAGC,IAAA,IAKH;EAAA,IALI;IACxBC,MAAM;IACNC,QAAQ;IACRC,MAAM;IACNC;EACc,CAAC,GAAAJ,IAAA;EACf,MAAMK,UAAU,GAAGJ,MAAM,CAACK,GAAG,CAAEC,IAAI,IAAKA,IAAI,CAACL,QAAQ,CAAC;EACtD,MAAMM,WAAW,GAAGP,MAAM,CAACK,GAAG,CAAEC,IAAI,IAAKA,IAAI,CAACE,UAAU,CAAC;EACzD,MAAMC,SAAS,GAAGP,MAAM,GAAGT,aAAa,GAAGC,cAAc;EAEzD,MAAMgB,SAAS,GAAGpB,YAAY,CAAC;IAC7BY,MAAM;IACNS,UAAU,EAAEnB,WAAW;IACvBoB,WAAW,EAAErB,YAAY;IACzBsB,WAAW,EAAE,CAAC,CAAC;IACfC,UAAU,EAAE,CAAC;EACf,CAAC,CAAC;EAEF,OAAO;IACLC,SAAS,EAAE,KAAK;IAChBC,KAAK,EAAE;MACLC,IAAI,EAAE,QAAQ;MACdC,IAAI,EAAE,GAAGjB,QAAQ,KAAK;MACtBkB,SAAS,EAAE;QACTC,QAAQ,EAAE,EAAE;QACZC,UAAU,EAAE,EAAE;QACdC,UAAU,EAAE;MACd;IACF,CAAC;IACDC,IAAI,EAAE,CACJ;MACEC,IAAI,EAAE,WAAW;MACjBC,GAAG,EAAE,MAAM;MACXC,K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