@oanda/labs-order-book-widget 1.0.88 → 1.0.90
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +692 -0
- package/dist/main/OrderBookWidget/ChartWithData.js +12 -2
- package/dist/main/OrderBookWidget/ChartWithData.js.map +1 -1
- package/dist/main/OrderBookWidget/components/Chart/getOption.js +2 -1
- package/dist/main/OrderBookWidget/components/Chart/getOption.js.map +1 -1
- package/dist/main/OrderBookWidget/constants.js +8 -0
- package/dist/main/OrderBookWidget/constants.js.map +1 -0
- package/dist/main/gql/getOrderPositionBooks.js +1 -1
- package/dist/main/gql/getOrderPositionBooks.js.map +1 -1
- package/dist/main/gql/types/gql.js +1 -1
- package/dist/main/gql/types/gql.js.map +1 -1
- package/dist/main/gql/types/graphql.js +40 -1
- package/dist/main/gql/types/graphql.js.map +1 -1
- package/dist/main/translations/sources/en.json +2 -0
- package/dist/main/translations/sources/zh_TW.json +2 -0
- package/dist/module/OrderBookWidget/ChartWithData.js +13 -3
- package/dist/module/OrderBookWidget/ChartWithData.js.map +1 -1
- package/dist/module/OrderBookWidget/components/Chart/getOption.js +2 -1
- package/dist/module/OrderBookWidget/components/Chart/getOption.js.map +1 -1
- package/dist/module/OrderBookWidget/constants.js +3 -0
- package/dist/module/OrderBookWidget/constants.js.map +1 -0
- package/dist/module/gql/getOrderPositionBooks.js +1 -1
- package/dist/module/gql/getOrderPositionBooks.js.map +1 -1
- package/dist/module/gql/types/gql.js +1 -1
- package/dist/module/gql/types/gql.js.map +1 -1
- package/dist/module/gql/types/graphql.js +39 -0
- package/dist/module/gql/types/graphql.js.map +1 -1
- package/dist/module/translations/sources/en.json +2 -0
- package/dist/module/translations/sources/zh_TW.json +2 -0
- package/dist/types/OrderBookWidget/constants.d.ts +2 -0
- package/dist/types/gql/types/gql.d.ts +2 -2
- package/dist/types/gql/types/graphql.d.ts +87 -9
- package/package.json +3 -3
- package/src/OrderBookWidget/ChartWithData.tsx +51 -40
- package/src/OrderBookWidget/components/Chart/getOption.ts +2 -1
- package/src/OrderBookWidget/constants.ts +3 -0
- package/src/gql/getOrderPositionBooks.ts +1 -0
- package/src/gql/types/gql.ts +2 -2
- package/src/gql/types/graphql.ts +101 -11
- package/src/translations/sources/en.json +2 -0
- package/src/translations/sources/zh_TW.json +2 -0
- package/test/Main.test.tsx +11 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChartWithData.js","names":["_react","_interopRequireWildcard","require","_client","_classnames","_interopRequireDefault","_labsWidgetCommon","_getOrderPositionBooks","_graphql","_Chart","_config","obj","__esModule","default","_getRequireWildcardCache","e","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","ChartWithData","_ref","_data$orderPositionBo","instrument","bookType","size","useContext","ThemeContext","isDesktop","Size","DESKTOP","loading","data","error","useQuery","getOrderPositionBooks","variables","recentHours","fetchPolicy","isError","orderPositionBooks","price","createElement","className","classnames","ChartError","Spinner","SpinnerSize","lg","Chart","isOrderBook","BookType","Order","precision","instrumentPrecisionConfig","exports"],"sources":["../../../src/OrderBookWidget/ChartWithData.tsx"],"sourcesContent":["import React, { useContext } from 'react';\nimport { useQuery } from '@apollo/client';\nimport classnames from 'classnames';\nimport {\n ChartError, Size, Spinner, SpinnerSize, ThemeContext,\n} from '@oanda/labs-widget-common';\nimport { ChartWithDataProps } from './types';\nimport { getOrderPositionBooks } from '../gql/getOrderPositionBooks';\nimport { GetOrderPositionBooksQuery, GetOrderPositionBooksQueryVariables, BookType } from '../gql/types/graphql';\nimport { Chart } from './components/Chart/Chart';\nimport { instrumentPrecisionConfig } from './config';\n\nconst ChartWithData = ({\n instrument,\n bookType,\n}: ChartWithDataProps) => {\n const { size } = useContext(ThemeContext);\n const isDesktop = size === Size.DESKTOP;\n\n const { loading, data, error } = useQuery<\n GetOrderPositionBooksQuery,\n GetOrderPositionBooksQueryVariables\n >(getOrderPositionBooks, {\n variables: {\n instrument,\n bookType,\n recentHours: 1,\n },\n fetchPolicy: 'network-only',\n });\n\n const isError = (!loading && !data?.orderPositionBooks[0]?.price) || !!error;\n\n return (\n <div className={classnames('lw-relative lw-w-full', {\n
|
|
1
|
+
{"version":3,"file":"ChartWithData.js","names":["_react","_interopRequireWildcard","require","_client","_classnames","_interopRequireDefault","_labsWidgetCommon","_monoI18n","_getOrderPositionBooks","_graphql","_Chart","_config","_constants","obj","__esModule","default","_getRequireWildcardCache","e","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","ChartWithData","_ref","_data$orderPositionBo","_data$orderPositionBo2","instrument","bookType","lang","useLocale","size","useContext","ThemeContext","isDesktop","Size","DESKTOP","loading","data","error","useQuery","getOrderPositionBooks","variables","recentHours","fetchPolicy","isError","orderPositionBooks","price","updatedAt","time","createElement","Fragment","className","classnames","ChartError","Spinner","SpinnerSize","lg","Chart","isOrderBook","BookType","Order","precision","instrumentPrecisionConfig","InfoBox","text","concat","formatUpdatedTimestamp","EMPTY_VALUE","exports"],"sources":["../../../src/OrderBookWidget/ChartWithData.tsx"],"sourcesContent":["import React, { useContext } from 'react';\nimport { useQuery } from '@apollo/client';\nimport classnames from 'classnames';\nimport {\n ChartError, InfoBox, Size, Spinner, SpinnerSize, ThemeContext, formatUpdatedTimestamp,\n} from '@oanda/labs-widget-common';\nimport { useLocale } from '@oanda/mono-i18n';\nimport { ChartWithDataProps } from './types';\nimport { getOrderPositionBooks } from '../gql/getOrderPositionBooks';\nimport { GetOrderPositionBooksQuery, GetOrderPositionBooksQueryVariables, BookType } from '../gql/types/graphql';\nimport { Chart } from './components/Chart/Chart';\nimport { instrumentPrecisionConfig } from './config';\nimport { EMPTY_VALUE } from './constants';\n\nconst ChartWithData = ({\n instrument,\n bookType,\n}: ChartWithDataProps) => {\n const { lang } = useLocale();\n const { size } = useContext(ThemeContext);\n const isDesktop = size === Size.DESKTOP;\n\n const { loading, data, error } = useQuery<\n GetOrderPositionBooksQuery,\n GetOrderPositionBooksQueryVariables\n >(getOrderPositionBooks, {\n variables: {\n instrument,\n bookType,\n recentHours: 1,\n },\n fetchPolicy: 'network-only',\n });\n\n const isError = (!loading && !data?.orderPositionBooks[0]?.price) || !!error;\n const updatedAt = data?.orderPositionBooks[0]?.time;\n\n return (\n <>\n <div className={classnames('lw-relative lw-w-full', {\n 'lw-h-[450px]': isDesktop,\n 'lw-h-[390px]': !isDesktop,\n })}\n >\n {isError && (\n <div className={\n classnames(\n 'lw-absolute lw-left-0 lw-top-0 lw-flex lw-w-full lw-items-center lw-justify-center lw-border lw-border-solid lw-border-border-primary',\n {\n 'lw-h-full': isDesktop,\n 'lw-h-[calc(100%-40px)]': !isDesktop,\n },\n )\n }\n >\n <ChartError />\n </div>\n )}\n {loading && (\n <div className={\n classnames(\n 'lw-absolute lw-left-0 lw-top-0 lw-flex lw-w-full lw-items-center lw-justify-center lw-border lw-border-solid lw-border-border-primary',\n {\n 'lw-h-full': isDesktop,\n 'lw-h-[calc(100%-40px)]': !isDesktop,\n },\n )\n }\n >\n <Spinner size={SpinnerSize.lg} />\n </div>\n )}\n {!isError && data && (\n <div className=\"lw-absolute lw-left-0 lw-top-0 lw-flex lw-h-full lw-w-full\">\n <Chart\n data={data}\n isOrderBook={bookType === BookType.Order}\n precision={instrumentPrecisionConfig[instrument]}\n />\n </div>\n )}\n </div>\n {!isError && (\n <div className=\"lw-mt-2 lw-h-8\">\n <InfoBox text={`${lang('last_updated')}: ${updatedAt ? formatUpdatedTimestamp(updatedAt, lang('today')) : EMPTY_VALUE}`} />\n </div>\n )}\n </>\n );\n};\n\nexport { ChartWithData };\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,iBAAA,GAAAJ,OAAA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,GAAG,IAAAmB,wCAAsB,EAACnB,SAAS,EAAEnB,IAAI,CAAC,OAAO,CAAC,CAAC,GAAGuC,sBAAW;EAAG,CAAE,CACvH,CAEL,CAAC;AAEP,CAAC;AAACC,OAAA,CAAA9C,aAAA,GAAAA,aAAA"}
|
|
@@ -299,6 +299,7 @@ const getOption = _ref2 => {
|
|
|
299
299
|
silent: true,
|
|
300
300
|
precision,
|
|
301
301
|
symbol: ['none', 'triangle'],
|
|
302
|
+
symbolOffset: [0, [0, isDesktop ? 0 : -10]],
|
|
302
303
|
symbolRotate: 90,
|
|
303
304
|
symbolSize: [20, 10],
|
|
304
305
|
lineStyle: {
|
|
@@ -306,9 +307,9 @@ const getOption = _ref2 => {
|
|
|
306
307
|
width: 1
|
|
307
308
|
},
|
|
308
309
|
label: {
|
|
310
|
+
distance: isDesktop ? 5 : -5,
|
|
309
311
|
overflow: 'truncate',
|
|
310
312
|
width: isDesktop ? undefined : _constants.Y_LABEL_SIZE_MOBILE,
|
|
311
|
-
padding: isDesktop ? [5, 15, 5, 15] : [5, 12, 5, 5],
|
|
312
313
|
color: isDark ? _labsWidgetCommon.colorPalette.black : _labsWidgetCommon.colorPalette.white,
|
|
313
314
|
backgroundColor: isDark ? _labsWidgetCommon.colorPalette.orange : _labsWidgetCommon.colorPalette.bottleGreenDark
|
|
314
315
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getOption.js","names":["_labsWidgetCommon","require","_constants","_formatters","getResponsiveOption","_ref","isDark","isOrderBook","isDesktop","lang","desktopGridLines","getGridLines","chartWidth","CHART_WIDTH","chartHeight","CHART_HEIGHT_DESKTOP","CHART_HEIGHT_MOBILE","xLabelsSize","X_LABEL_SIZE","ZOOM_CONTROL_HEIGHT","yLabelSize","Y_LABEL_SIZE_DESKTOP","Y_LABEL_SIZE_MOBILE","bottomLeftBox","marginBottom","grid","name","top","left","right","concat","bottom","yAxis","axisLabel","margin","series","type","id","markLine","label","padding","graphic","silent","children","z","shape","width","height","style","fill","colorPalette","darkGray","white","shadowBlur","shadowOffsetX","shadowOffsetY","shadowColor","black","text","exports","getOption","_ref2","_data$orderPositionBo","_data$orderPositionBo2","_data$orderPositionBo3","data","precision","buckets","orderPositionBooks","bucketWidth","price","bucketPrecision","toString","split","length","dataset","map","item","Number","longCountPercent","shortCountPercent","zoomInitialStartValue","INITIAL_BARS","zoomInitialEndValue","max","Math","min","abs","range","animation","color","bottleGreenLight","orange","raspberryDark","title","toUpperCase","textStyle","fontSize","toolbox","feature","getZoomControls","resetStartValue","resetEndValue","dataZoom","realtime","startValue","endValue","yAxisIndex","minValueSpan","tooltip","trigger","axisPointer","axis","formatter","val","tooltipFormatter","extraCssText","xAxis","splitNumber","axisTick","show","axisLine","showMinLabel","showMaxLabel","value","position","overflow","toFixed","source","clip","encode","x","y","renderItem","params","api","yValue","xStart","coord","xEnd","bucketWidthHeight","size","rectShape","emphasis","visual","symbol","symbolRotate","symbolSize","lineStyle","bottleGreenDark","undefined","backgroundColor"],"sources":["../../../../../src/OrderBookWidget/components/Chart/getOption.ts"],"sourcesContent":["import { colorPalette, getGridLines, getZoomControls } from '@oanda/labs-widget-common';\nimport {\n INITIAL_BARS,\n CHART_WIDTH,\n CHART_HEIGHT_DESKTOP,\n CHART_HEIGHT_MOBILE,\n X_LABEL_SIZE,\n Y_LABEL_SIZE_DESKTOP,\n Y_LABEL_SIZE_MOBILE,\n ZOOM_CONTROL_HEIGHT,\n} from './constants';\nimport { GetOptionType, GetResponsiveOptionsProps } from './types';\nimport { tooltipFormatter } from './formatters';\n\nexport const getResponsiveOption = (\n {\n isDark, isOrderBook, isDesktop, lang,\n }\n : GetResponsiveOptionsProps,\n) => {\n const desktopGridLines = getGridLines({\n isDark,\n chartWidth: CHART_WIDTH,\n chartHeight: isDesktop ? CHART_HEIGHT_DESKTOP : CHART_HEIGHT_MOBILE,\n xLabelsSize: isDesktop ? X_LABEL_SIZE : X_LABEL_SIZE + ZOOM_CONTROL_HEIGHT,\n yLabelSize: isDesktop ? Y_LABEL_SIZE_DESKTOP : Y_LABEL_SIZE_MOBILE,\n bottomLeftBox: isDesktop,\n marginBottom: isDesktop ? 0 : ZOOM_CONTROL_HEIGHT,\n });\n\n return {\n grid: [\n {\n name: 'main-grid',\n top: '48px',\n left: '0px',\n right: `${isDesktop ? Y_LABEL_SIZE_DESKTOP : Y_LABEL_SIZE_MOBILE}px`,\n bottom: `${isDesktop ? X_LABEL_SIZE : X_LABEL_SIZE + ZOOM_CONTROL_HEIGHT}px`,\n },\n ],\n yAxis: {\n axisLabel: {\n margin: isDesktop ? 10 : 0,\n },\n },\n series: [\n {\n type: 'custom',\n name: 'current-price',\n id: 'current-price',\n markLine: {\n label: {\n padding: isDesktop ? [5, 15, 5, 15] : [5, 12, 5, 5],\n },\n },\n },\n ],\n graphic: [\n ...desktopGridLines,\n {\n type: 'group',\n left: '8px',\n top: '56px',\n silent: true,\n children: [\n {\n type: 'rect',\n z: 100,\n left: 'center',\n top: 'middle',\n shape: {\n width: 70,\n height: 30,\n },\n style: {\n fill: isDark ? colorPalette.darkGray : colorPalette.white,\n shadowBlur: 8,\n shadowOffsetX: 0,\n shadowOffsetY: 1,\n shadowColor: 'rgba(0,0,0,0.1)',\n },\n },\n {\n type: 'text',\n z: 100,\n left: 'center',\n top: 'middle',\n style: {\n fill: isDark ? colorPalette.white : colorPalette.black,\n width: 70,\n height: 30,\n text: lang(isOrderBook ? 'sell' : 'short'),\n },\n },\n ],\n },\n {\n type: 'group',\n right: `${(isDesktop ? Y_LABEL_SIZE_DESKTOP : Y_LABEL_SIZE_MOBILE) + 8}px'`,\n top: '56px',\n silent: true,\n children: [\n {\n type: 'rect',\n z: 100,\n right: 'center',\n top: 'middle',\n shape: {\n width: 70,\n height: 30,\n },\n style: {\n fill: isDark ? colorPalette.darkGray : colorPalette.white,\n shadowBlur: 8,\n shadowOffsetX: 0,\n shadowOffsetY: 1,\n shadowColor: 'rgba(0,0,0,0.1)',\n },\n },\n {\n type: 'text',\n z: 100,\n right: 'center',\n top: 'middle',\n style: {\n fill: isDark ? colorPalette.white : colorPalette.black,\n width: 70,\n height: 30,\n text: lang(isOrderBook ? 'buy' : 'long'),\n },\n },\n ],\n },\n ],\n };\n};\n\nexport const getOption: GetOptionType = ({\n data, precision, isDark, isOrderBook, isDesktop, lang,\n}) => {\n const buckets = data.orderPositionBooks[0]?.buckets || [];\n const bucketWidth = data.orderPositionBooks[0]?.bucketWidth!;\n const price = data.orderPositionBooks[0]?.price!;\n const bucketPrecision = bucketWidth.toString().split('.')[1].length || 0;\n\n const dataset = buckets.map((item) => ([\n item!.price,\n Number(item!.longCountPercent),\n Number(item!.shortCountPercent) * -1,\n ]));\n\n const zoomInitialStartValue = price - (bucketWidth * INITIAL_BARS * 0.5);\n const zoomInitialEndValue = price + (bucketWidth * INITIAL_BARS * 0.5);\n\n const max = Math.max(...dataset.map((item) => item[1]));\n const min = Math.abs(Math.min(...dataset.map((item) => item[2])));\n\n const range = max > min ? max : min;\n\n return (\n {\n animation: false,\n color: [\n colorPalette.bottleGreenLight,\n isDark ? colorPalette.orange : colorPalette.raspberryDark,\n ],\n title: {\n text: lang(isOrderBook ? 'open_orders' : 'open_positions').toUpperCase(),\n padding: 20,\n textStyle: {\n fontSize: 14,\n },\n },\n toolbox: {\n feature: getZoomControls({\n resetStartValue: zoomInitialStartValue,\n resetEndValue: zoomInitialEndValue,\n }),\n },\n dataZoom: [\n {\n type: 'inside',\n realtime: true,\n startValue: zoomInitialStartValue,\n endValue: zoomInitialEndValue,\n\n yAxisIndex: 0,\n minValueSpan: 10 * bucketWidth,\n },\n ],\n tooltip: {\n trigger: 'axis',\n axisPointer: {\n axis: 'y',\n },\n formatter: (val) => tooltipFormatter({\n data: (val as { data: number[] }[])[0].data,\n precision: bucketPrecision,\n isOrderBook,\n lang,\n }),\n extraCssText: 'z-index: 1',\n },\n grid: [\n {\n name: 'main-grid',\n top: '48px',\n left: '0px',\n right: `${isDesktop ? Y_LABEL_SIZE_DESKTOP : Y_LABEL_SIZE_MOBILE}px`,\n bottom: `${isDesktop ? X_LABEL_SIZE : X_LABEL_SIZE + ZOOM_CONTROL_HEIGHT}px`,\n },\n ],\n xAxis: {\n type: 'value',\n min: range * -1.05,\n max: range * 1.05,\n splitNumber: 5,\n axisTick: { show: false },\n axisLine: { show: false },\n axisLabel: {\n padding: [7, 16, 0, 16],\n showMinLabel: false,\n showMaxLabel: false,\n formatter: (value) => (value === 0 ? '%' : `${Math.abs(value)}%`),\n },\n },\n yAxis: {\n type: 'value',\n position: 'right',\n axisLine: { show: false },\n axisTick: { show: false },\n axisLabel: {\n overflow: 'truncate',\n width: (isDesktop ? Y_LABEL_SIZE_DESKTOP : Y_LABEL_SIZE_MOBILE) - 10,\n margin: isDesktop ? 10 : 0,\n showMaxLabel: false,\n showMinLabel: false,\n padding: [0, 0, 0, 10],\n formatter: (value) => value.toFixed(bucketPrecision),\n },\n },\n dataset: {\n source: dataset,\n },\n series: [\n {\n type: 'custom',\n name: 'sell-short',\n id: 'sell-short',\n clip: true,\n encode: {\n x: 1,\n y: 0,\n tooltip: 1,\n },\n renderItem: (params, api) => {\n const yValue = api.value(0);\n const xStart = api.coord([api.value(1), yValue]);\n const xEnd = api.coord([0, yValue]);\n const bucketWidthHeight = api.size ? (api.size([0, bucketWidth]) as number[])[1] : 0;\n const height = bucketWidthHeight > 4 ? bucketWidthHeight * 0.8 : bucketWidthHeight;\n\n const rectShape = {\n x: xStart[0] + 0.5,\n y: xStart[1] - height / 2,\n width: xEnd[0] - xStart[0],\n height,\n };\n\n return {\n type: 'rect',\n shape: rectShape,\n emphasis: {\n style: {\n fill: colorPalette.bottleGreenLight,\n },\n },\n style: {\n fill: api.visual('color'),\n },\n };\n },\n },\n {\n type: 'custom',\n name: 'buy-long',\n id: 'buy-long',\n clip: true,\n encode: {\n x: 1,\n y: 0,\n tooltip: 2,\n },\n renderItem: (params, api) => {\n const yValue = api.value(0);\n const xStart = api.coord([api.value(2), yValue]);\n const xEnd = api.coord([0, yValue]);\n const bucketWidthHeight = api.size ? (api.size([0, bucketWidth]) as number[])[1] : 0;\n const height = bucketWidthHeight > 4 ? bucketWidthHeight * 0.8 : bucketWidthHeight;\n\n const rectShape = {\n x: xStart[0] - 0.5,\n y: xStart[1] - height / 2,\n width: xEnd[0] - xStart[0],\n height,\n };\n\n return {\n type: 'rect',\n shape: rectShape,\n emphasis: {\n style: {\n fill: isDark ? colorPalette.orange : colorPalette.raspberryDark,\n },\n },\n style: {\n fill: api.visual('color'),\n },\n };\n },\n },\n {\n type: 'custom',\n name: 'current-price',\n id: 'current-price',\n markLine: {\n animation: false,\n silent: true,\n precision,\n symbol: ['none', 'triangle'],\n symbolRotate: 90,\n symbolSize: [20, 10],\n lineStyle: {\n color: isDark ? colorPalette.orange : colorPalette.bottleGreenDark,\n width: 1,\n },\n label: {\n overflow: 'truncate',\n width: isDesktop ? undefined : Y_LABEL_SIZE_MOBILE,\n padding: isDesktop ? [5, 15, 5, 15] : [5, 12, 5, 5],\n color: isDark ? colorPalette.black : colorPalette.white,\n backgroundColor: isDark ? colorPalette.orange : colorPalette.bottleGreenDark,\n },\n data: [\n {\n yAxis: price,\n },\n ],\n },\n renderItem: () => null,\n },\n ],\n }\n );\n};\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AAWA,IAAAE,WAAA,GAAAF,OAAA;AAEO,MAAMG,mBAAmB,GAAGC,IAAA,IAK9B;EAAA,IAJH;IACEC,MAAM;IAAEC,WAAW;IAAEC,SAAS;IAAEC;EAER,CAAC,GAAAJ,IAAA;EAE3B,MAAMK,gBAAgB,GAAG,IAAAC,8BAAY,EAAC;IACpCL,MAAM;IACNM,UAAU,EAAEC,sBAAW;IACvBC,WAAW,EAAEN,SAAS,GAAGO,+BAAoB,GAAGC,8BAAmB;IACnEC,WAAW,EAAET,SAAS,GAAGU,uBAAY,GAAGA,uBAAY,GAAGC,8BAAmB;IAC1EC,UA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G,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC;UACnDkF,KAAK,EAAEpF,MAAM,GAAG4C,8BAAY,CAACO,KAAK,GAAGP,8BAAY,CAACE,KAAK;UACvDmG,eAAe,EAAEjJ,MAAM,GAAG4C,8BAAY,CAAC0C,MAAM,GAAG1C,8BAAY,CAACmG;QAC/D,CAAC;QACDpF,IAAI,EAAE,CACJ;UACEjC,KAAK,EAAEsC;QACT,CAAC;MAEL,CAAC;MACD+D,UAAU,EAAEA,CAAA,KAAM;IACpB,CAAC;EAEL,CAAC;AAEL,CAAC;AAAC1E,OAAA,CAAAC,SAAA,GAAAA,SAAA"}
|
|
1
|
+
{"version":3,"file":"getOption.js","names":["_labsWidgetCommon","require","_constants","_formatters","getResponsiveOption","_ref","isDark","isOrderBook","isDesktop","lang","desktopGridLines","getGridLines","chartWidth","CHART_WIDTH","chartHeight","CHART_HEIGHT_DESKTOP","CHART_HEIGHT_MOBILE","xLabelsSize","X_LABEL_SIZE","ZOOM_CONTROL_HEIGHT","yLabelSize","Y_LABEL_SIZE_DESKTOP","Y_LABEL_SIZE_MOBILE","bottomLeftBox","marginBottom","grid","name","top","left","right","concat","bottom","yAxis","axisLabel","margin","series","type","id","markLine","label","padding","graphic","silent","children","z","shape","width","height","style","fill","colorPalette","darkGray","white","shadowBlur","shadowOffsetX","shadowOffsetY","shadowColor","black","text","exports","getOption","_ref2","_data$orderPositionBo","_data$orderPositionBo2","_data$orderPositionBo3","data","precision","buckets","orderPositionBooks","bucketWidth","price","bucketPrecision","toString","split","length","dataset","map","item","Number","longCountPercent","shortCountPercent","zoomInitialStartValue","INITIAL_BARS","zoomInitialEndValue","max","Math","min","abs","range","animation","color","bottleGreenLight","orange","raspberryDark","title","toUpperCase","textStyle","fontSize","toolbox","feature","getZoomControls","resetStartValue","resetEndValue","dataZoom","realtime","startValue","endValue","yAxisIndex","minValueSpan","tooltip","trigger","axisPointer","axis","formatter","val","tooltipFormatter","extraCssText","xAxis","splitNumber","axisTick","show","axisLine","showMinLabel","showMaxLabel","value","position","overflow","toFixed","source","clip","encode","x","y","renderItem","params","api","yValue","xStart","coord","xEnd","bucketWidthHeight","size","rectShape","emphasis","visual","symbol","symbolOffset","symbolRotate","symbolSize","lineStyle","bottleGreenDark","distance","undefined","backgroundColor"],"sources":["../../../../../src/OrderBookWidget/components/Chart/getOption.ts"],"sourcesContent":["import { colorPalette, getGridLines, getZoomControls } from '@oanda/labs-widget-common';\nimport {\n INITIAL_BARS,\n CHART_WIDTH,\n CHART_HEIGHT_DESKTOP,\n CHART_HEIGHT_MOBILE,\n X_LABEL_SIZE,\n Y_LABEL_SIZE_DESKTOP,\n Y_LABEL_SIZE_MOBILE,\n ZOOM_CONTROL_HEIGHT,\n} from './constants';\nimport { GetOptionType, GetResponsiveOptionsProps } from './types';\nimport { tooltipFormatter } from './formatters';\n\nexport const getResponsiveOption = (\n {\n isDark, isOrderBook, isDesktop, lang,\n }\n : GetResponsiveOptionsProps,\n) => {\n const desktopGridLines = getGridLines({\n isDark,\n chartWidth: CHART_WIDTH,\n chartHeight: isDesktop ? CHART_HEIGHT_DESKTOP : CHART_HEIGHT_MOBILE,\n xLabelsSize: isDesktop ? X_LABEL_SIZE : X_LABEL_SIZE + ZOOM_CONTROL_HEIGHT,\n yLabelSize: isDesktop ? Y_LABEL_SIZE_DESKTOP : Y_LABEL_SIZE_MOBILE,\n bottomLeftBox: isDesktop,\n marginBottom: isDesktop ? 0 : ZOOM_CONTROL_HEIGHT,\n });\n\n return {\n grid: [\n {\n name: 'main-grid',\n top: '48px',\n left: '0px',\n right: `${isDesktop ? Y_LABEL_SIZE_DESKTOP : Y_LABEL_SIZE_MOBILE}px`,\n bottom: `${isDesktop ? X_LABEL_SIZE : X_LABEL_SIZE + ZOOM_CONTROL_HEIGHT}px`,\n },\n ],\n yAxis: {\n axisLabel: {\n margin: isDesktop ? 10 : 0,\n },\n },\n series: [\n {\n type: 'custom',\n name: 'current-price',\n id: 'current-price',\n markLine: {\n label: {\n padding: isDesktop ? [5, 15, 5, 15] : [5, 12, 5, 5],\n },\n },\n },\n ],\n graphic: [\n ...desktopGridLines,\n {\n type: 'group',\n left: '8px',\n top: '56px',\n silent: true,\n children: [\n {\n type: 'rect',\n z: 100,\n left: 'center',\n top: 'middle',\n shape: {\n width: 70,\n height: 30,\n },\n style: {\n fill: isDark ? colorPalette.darkGray : colorPalette.white,\n shadowBlur: 8,\n shadowOffsetX: 0,\n shadowOffsetY: 1,\n shadowColor: 'rgba(0,0,0,0.1)',\n },\n },\n {\n type: 'text',\n z: 100,\n left: 'center',\n top: 'middle',\n style: {\n fill: isDark ? colorPalette.white : colorPalette.black,\n width: 70,\n height: 30,\n text: lang(isOrderBook ? 'sell' : 'short'),\n },\n },\n ],\n },\n {\n type: 'group',\n right: `${(isDesktop ? Y_LABEL_SIZE_DESKTOP : Y_LABEL_SIZE_MOBILE) + 8}px'`,\n top: '56px',\n silent: true,\n children: [\n {\n type: 'rect',\n z: 100,\n right: 'center',\n top: 'middle',\n shape: {\n width: 70,\n height: 30,\n },\n style: {\n fill: isDark ? colorPalette.darkGray : colorPalette.white,\n shadowBlur: 8,\n shadowOffsetX: 0,\n shadowOffsetY: 1,\n shadowColor: 'rgba(0,0,0,0.1)',\n },\n },\n {\n type: 'text',\n z: 100,\n right: 'center',\n top: 'middle',\n style: {\n fill: isDark ? colorPalette.white : colorPalette.black,\n width: 70,\n height: 30,\n text: lang(isOrderBook ? 'buy' : 'long'),\n },\n },\n ],\n },\n ],\n };\n};\n\nexport const getOption: GetOptionType = ({\n data, precision, isDark, isOrderBook, isDesktop, lang,\n}) => {\n const buckets = data.orderPositionBooks[0]?.buckets || [];\n const bucketWidth = data.orderPositionBooks[0]?.bucketWidth!;\n const price = data.orderPositionBooks[0]?.price!;\n const bucketPrecision = bucketWidth.toString().split('.')[1].length || 0;\n\n const dataset = buckets.map((item) => ([\n item!.price,\n Number(item!.longCountPercent),\n Number(item!.shortCountPercent) * -1,\n ]));\n\n const zoomInitialStartValue = price - (bucketWidth * INITIAL_BARS * 0.5);\n const zoomInitialEndValue = price + (bucketWidth * INITIAL_BARS * 0.5);\n\n const max = Math.max(...dataset.map((item) => item[1]));\n const min = Math.abs(Math.min(...dataset.map((item) => item[2])));\n\n const range = max > min ? max : min;\n\n return (\n {\n animation: false,\n color: [\n colorPalette.bottleGreenLight,\n isDark ? colorPalette.orange : colorPalette.raspberryDark,\n ],\n title: {\n text: lang(isOrderBook ? 'open_orders' : 'open_positions').toUpperCase(),\n padding: 20,\n textStyle: {\n fontSize: 14,\n },\n },\n toolbox: {\n feature: getZoomControls({\n resetStartValue: zoomInitialStartValue,\n resetEndValue: zoomInitialEndValue,\n }),\n },\n dataZoom: [\n {\n type: 'inside',\n realtime: true,\n startValue: zoomInitialStartValue,\n endValue: zoomInitialEndValue,\n\n yAxisIndex: 0,\n minValueSpan: 10 * bucketWidth,\n },\n ],\n tooltip: {\n trigger: 'axis',\n axisPointer: {\n axis: 'y',\n },\n formatter: (val) => tooltipFormatter({\n data: (val as { data: number[] }[])[0].data,\n precision: bucketPrecision,\n isOrderBook,\n lang,\n }),\n extraCssText: 'z-index: 1',\n },\n grid: [\n {\n name: 'main-grid',\n top: '48px',\n left: '0px',\n right: `${isDesktop ? Y_LABEL_SIZE_DESKTOP : Y_LABEL_SIZE_MOBILE}px`,\n bottom: `${isDesktop ? X_LABEL_SIZE : X_LABEL_SIZE + ZOOM_CONTROL_HEIGHT}px`,\n },\n ],\n xAxis: {\n type: 'value',\n min: range * -1.05,\n max: range * 1.05,\n splitNumber: 5,\n axisTick: { show: false },\n axisLine: { show: false },\n axisLabel: {\n padding: [7, 16, 0, 16],\n showMinLabel: false,\n showMaxLabel: false,\n formatter: (value) => (value === 0 ? '%' : `${Math.abs(value)}%`),\n },\n },\n yAxis: {\n type: 'value',\n position: 'right',\n axisLine: { show: false },\n axisTick: { show: false },\n axisLabel: {\n overflow: 'truncate',\n width: (isDesktop ? Y_LABEL_SIZE_DESKTOP : Y_LABEL_SIZE_MOBILE) - 10,\n margin: isDesktop ? 10 : 0,\n showMaxLabel: false,\n showMinLabel: false,\n padding: [0, 0, 0, 10],\n formatter: (value) => value.toFixed(bucketPrecision),\n },\n },\n dataset: {\n source: dataset,\n },\n series: [\n {\n type: 'custom',\n name: 'sell-short',\n id: 'sell-short',\n clip: true,\n encode: {\n x: 1,\n y: 0,\n tooltip: 1,\n },\n renderItem: (params, api) => {\n const yValue = api.value(0);\n const xStart = api.coord([api.value(1), yValue]);\n const xEnd = api.coord([0, yValue]);\n const bucketWidthHeight = api.size ? (api.size([0, bucketWidth]) as number[])[1] : 0;\n const height = bucketWidthHeight > 4 ? bucketWidthHeight * 0.8 : bucketWidthHeight;\n\n const rectShape = {\n x: xStart[0] + 0.5,\n y: xStart[1] - height / 2,\n width: xEnd[0] - xStart[0],\n height,\n };\n\n return {\n type: 'rect',\n shape: rectShape,\n emphasis: {\n style: {\n fill: colorPalette.bottleGreenLight,\n },\n },\n style: {\n fill: api.visual('color'),\n },\n };\n },\n },\n {\n type: 'custom',\n name: 'buy-long',\n id: 'buy-long',\n clip: true,\n encode: {\n x: 1,\n y: 0,\n tooltip: 2,\n },\n renderItem: (params, api) => {\n const yValue = api.value(0);\n const xStart = api.coord([api.value(2), yValue]);\n const xEnd = api.coord([0, yValue]);\n const bucketWidthHeight = api.size ? (api.size([0, bucketWidth]) as number[])[1] : 0;\n const height = bucketWidthHeight > 4 ? bucketWidthHeight * 0.8 : bucketWidthHeight;\n\n const rectShape = {\n x: xStart[0] - 0.5,\n y: xStart[1] - height / 2,\n width: xEnd[0] - xStart[0],\n height,\n };\n\n return {\n type: 'rect',\n shape: rectShape,\n emphasis: {\n style: {\n fill: isDark ? colorPalette.orange : colorPalette.raspberryDark,\n },\n },\n style: {\n fill: api.visual('color'),\n },\n };\n },\n },\n {\n type: 'custom',\n name: 'current-price',\n id: 'current-price',\n markLine: {\n animation: false,\n silent: true,\n precision,\n symbol: ['none', 'triangle'],\n symbolOffset: [0, [0, isDesktop ? 0 : -10]] as unknown as number,\n symbolRotate: 90,\n symbolSize: [20, 10],\n lineStyle: {\n color: isDark ? colorPalette.orange : colorPalette.bottleGreenDark,\n width: 1,\n },\n label: {\n distance: isDesktop ? 5 : -5,\n overflow: 'truncate',\n width: isDesktop ? undefined : Y_LABEL_SIZE_MOBILE,\n color: isDark ? colorPalette.black : colorPalette.white,\n backgroundColor: isDark ? colorPalette.orange : colorPalette.bottleGreenDark,\n },\n data: [\n {\n yAxis: price,\n },\n ],\n },\n renderItem: () => null,\n },\n ],\n }\n );\n};\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AAWA,IAAAE,WAAA,GAAAF,OAAA;AAEO,MAAMG,mBAAmB,GAAGC,IAAA,IAK9B;EAAA,IAJH;IACEC,MAAM;IAAEC,WAAW;IAAEC,SAAS;IAAEC;EAER,CAAC,GAAAJ,IAAA;EAE3B,MAAMK,gBAAgB,GAAG,IAAAC,8BAAY,EAAC;IACpCL,MAAM;IACNM,UAAU,EAAEC,sBAAW;IACvBC,WAAW,EAAEN,SAAS,GAAGO,+BAAoB,GAAGC,8BAAmB;IACnEC,WAAW,EAAET,SAAS,GAAGU,uBAAY,GAAGA,uBAAY,GAAGC,8BAAmB;IAC1EC,UAAU,EAAEZ,SAAS,GAAGa,+BAAoB,GAAGC,8BAAmB;IAClEC,aAAa,EAAEf,SAAS;IACxBgB,YAAY,EAAEhB,SAAS,GAAG,CAAC,GAAGW;EAChC,CAAC,CAAC;EAEF,OAAO;IACLM,IAAI,EAAE,CACJ;MACEC,IAAI,EAAE,WAAW;MACjBC,GAAG,EAAE,MAAM;MACXC,IAAI,EAAE,KAAK;MACXC,KAAK,KAAAC,MAAA,CAAKtB,SAAS,GAAGa,+BAAoB,GAAGC,8BAAmB,OAAI;MACpES,MAAM,KAAAD,MAAA,CAAKtB,SAAS,GAAGU,uBAAY,GAAGA,uBAAY,GAAG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,OAAA,CAAAC,SAAA,GAAAA,SAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","names":["EMPTY_VALUE","exports"],"sources":["../../../src/OrderBookWidget/constants.ts"],"sourcesContent":["const EMPTY_VALUE = '\\u2014';\n\nexport { EMPTY_VALUE };\n"],"mappings":";;;;;;AAAA,MAAMA,WAAW,GAAAC,OAAA,CAAAD,WAAA,GAAG,QAAQ"}
|
|
@@ -7,5 +7,5 @@ exports.getOrderPositionBooks = void 0;
|
|
|
7
7
|
var _client = require("@apollo/client");
|
|
8
8
|
var _templateObject;
|
|
9
9
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
10
|
-
const getOrderPositionBooks = exports.getOrderPositionBooks = (0, _client.gql)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n query GetOrderPositionBooks($instrument: String!, $bookType: BookType!, $recentHours: Int) {\n orderPositionBooks(\n instrument: $instrument\n bookType: $bookType\n recentHours: $recentHours\n ) {\n bucketWidth\n price\n buckets {\n price\n longCountPercent\n shortCountPercent\n }\n }\n }\n"])));
|
|
10
|
+
const getOrderPositionBooks = exports.getOrderPositionBooks = (0, _client.gql)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n query GetOrderPositionBooks($instrument: String!, $bookType: BookType!, $recentHours: Int) {\n orderPositionBooks(\n instrument: $instrument\n bookType: $bookType\n recentHours: $recentHours\n ) {\n bucketWidth\n price\n time\n buckets {\n price\n longCountPercent\n shortCountPercent\n }\n }\n }\n"])));
|
|
11
11
|
//# sourceMappingURL=getOrderPositionBooks.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getOrderPositionBooks.js","names":["_client","require","_templateObject","_taggedTemplateLiteral","strings","raw","slice","Object","freeze","defineProperties","value","getOrderPositionBooks","exports","gql"],"sources":["../../../src/gql/getOrderPositionBooks.ts"],"sourcesContent":["import { gql } from '@apollo/client';\n\nconst getOrderPositionBooks = gql`\n query GetOrderPositionBooks($instrument: String!, $bookType: BookType!, $recentHours: Int) {\n orderPositionBooks(\n instrument: $instrument\n bookType: $bookType\n recentHours: $recentHours\n ) {\n bucketWidth\n price\n buckets {\n price\n longCountPercent\n shortCountPercent\n }\n }\n }\n`;\n\nexport { getOrderPositionBooks };\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAAqC,IAAAC,eAAA;AAAA,SAAAC,uBAAAC,OAAA,EAAAC,GAAA,SAAAA,GAAA,IAAAA,GAAA,GAAAD,OAAA,CAAAE,KAAA,cAAAC,MAAA,CAAAC,MAAA,CAAAD,MAAA,CAAAE,gBAAA,CAAAL,OAAA,IAAAC,GAAA,IAAAK,KAAA,EAAAH,MAAA,CAAAC,MAAA,CAAAH,GAAA;AAErC,MAAMM,qBAAqB,GAAAC,OAAA,CAAAD,qBAAA,OAAGE,WAAG,EAAAX,eAAA,KAAAA,eAAA,GAAAC,sBAAA,
|
|
1
|
+
{"version":3,"file":"getOrderPositionBooks.js","names":["_client","require","_templateObject","_taggedTemplateLiteral","strings","raw","slice","Object","freeze","defineProperties","value","getOrderPositionBooks","exports","gql"],"sources":["../../../src/gql/getOrderPositionBooks.ts"],"sourcesContent":["import { gql } from '@apollo/client';\n\nconst getOrderPositionBooks = gql`\n query GetOrderPositionBooks($instrument: String!, $bookType: BookType!, $recentHours: Int) {\n orderPositionBooks(\n instrument: $instrument\n bookType: $bookType\n recentHours: $recentHours\n ) {\n bucketWidth\n price\n time\n buckets {\n price\n longCountPercent\n shortCountPercent\n }\n }\n }\n`;\n\nexport { getOrderPositionBooks };\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAAqC,IAAAC,eAAA;AAAA,SAAAC,uBAAAC,OAAA,EAAAC,GAAA,SAAAA,GAAA,IAAAA,GAAA,GAAAD,OAAA,CAAAE,KAAA,cAAAC,MAAA,CAAAC,MAAA,CAAAD,MAAA,CAAAE,gBAAA,CAAAL,OAAA,IAAAC,GAAA,IAAAK,KAAA,EAAAH,MAAA,CAAAC,MAAA,CAAAH,GAAA;AAErC,MAAMM,qBAAqB,GAAAC,OAAA,CAAAD,qBAAA,OAAGE,WAAG,EAAAX,eAAA,KAAAA,eAAA,GAAAC,sBAAA,6XAiBhC"}
|
|
@@ -8,7 +8,7 @@ var types = _interopRequireWildcard(require("./graphql"));
|
|
|
8
8
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
9
9
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
10
10
|
const documents = {
|
|
11
|
-
"\n query GetOrderPositionBooks($instrument: String!, $bookType: BookType!, $recentHours: Int) {\n orderPositionBooks(\n instrument: $instrument\n bookType: $bookType\n recentHours: $recentHours\n ) {\n bucketWidth\n price\n buckets {\n price\n longCountPercent\n shortCountPercent\n }\n }\n }\n": types.GetOrderPositionBooksDocument
|
|
11
|
+
"\n query GetOrderPositionBooks($instrument: String!, $bookType: BookType!, $recentHours: Int) {\n orderPositionBooks(\n instrument: $instrument\n bookType: $bookType\n recentHours: $recentHours\n ) {\n bucketWidth\n price\n time\n buckets {\n price\n longCountPercent\n shortCountPercent\n }\n }\n }\n": types.GetOrderPositionBooksDocument
|
|
12
12
|
};
|
|
13
13
|
function graphql(source) {
|
|
14
14
|
var _source;
|
|
@@ -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","prototype","hasOwnProperty","call","i","set","documents","GetOrderPositionBooksDocument","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 GetOrderPositionBooks($instrument: String!, $bookType: BookType!, $recentHours: Int) {\\n orderPositionBooks(\\n instrument: $instrument\\n bookType: $bookType\\n recentHours: $recentHours\\n ) {\\n bucketWidth\\n price\\n buckets {\\n price\\n longCountPercent\\n shortCountPercent\\n }\\n }\\n }\\n\": types.GetOrderPositionBooksDocument,\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(source: \"\\n query GetOrderPositionBooks($instrument: String!, $bookType: BookType!, $recentHours: Int) {\\n orderPositionBooks(\\n instrument: $instrument\\n bookType: $bookType\\n recentHours: $recentHours\\n ) {\\n bucketWidth\\n price\\n buckets {\\n price\\n longCountPercent\\n shortCountPercent\\n }\\n }\\n }\\n\"): (typeof documents)[\"\\n query GetOrderPositionBooks($instrument: String!, $bookType: BookType!, $recentHours: Int) {\\n orderPositionBooks(\\n instrument: $instrument\\n bookType: $bookType\\n recentHours: $recentHours\\n ) {\\n bucketWidth\\n price\\n buckets {\\n price\\n longCountPercent\\n shortCountPercent\\n }\\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>> = TDocumentNode extends DocumentNode< infer TType, any> ? TType : never;"],"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,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAjB,CAAA,EAAAc,CAAA,SAAAI,CAAA,GAAAR,CAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAb,CAAA,EAAAc,CAAA,UAAAI,CAAA,KAAAA,CAAA,CAAAX,GAAA,IAAAW,CAAA,CAAAC,GAAA,IAAAR,MAAA,CAAAC,cAAA,CAAAJ,CAAA,EAAAM,CAAA,EAAAI,CAAA,IAAAV,CAAA,CAAAM,CAAA,IAAAd,CAAA,CAAAc,CAAA,YAAAN,CAAA,CAAAH,OAAA,GAAAL,CAAA,EAAAG,CAAA,IAAAA,CAAA,CAAAgB,GAAA,CAAAnB,CAAA,EAAAQ,CAAA,GAAAA,CAAA;AAanC,MAAMY,SAAS,GAAG;EACd,
|
|
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","prototype","hasOwnProperty","call","i","set","documents","GetOrderPositionBooksDocument","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 GetOrderPositionBooks($instrument: String!, $bookType: BookType!, $recentHours: Int) {\\n orderPositionBooks(\\n instrument: $instrument\\n bookType: $bookType\\n recentHours: $recentHours\\n ) {\\n bucketWidth\\n price\\n time\\n buckets {\\n price\\n longCountPercent\\n shortCountPercent\\n }\\n }\\n }\\n\": types.GetOrderPositionBooksDocument,\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(source: \"\\n query GetOrderPositionBooks($instrument: String!, $bookType: BookType!, $recentHours: Int) {\\n orderPositionBooks(\\n instrument: $instrument\\n bookType: $bookType\\n recentHours: $recentHours\\n ) {\\n bucketWidth\\n price\\n time\\n buckets {\\n price\\n longCountPercent\\n shortCountPercent\\n }\\n }\\n }\\n\"): (typeof documents)[\"\\n query GetOrderPositionBooks($instrument: String!, $bookType: BookType!, $recentHours: Int) {\\n orderPositionBooks(\\n instrument: $instrument\\n bookType: $bookType\\n recentHours: $recentHours\\n ) {\\n bucketWidth\\n price\\n time\\n buckets {\\n price\\n longCountPercent\\n shortCountPercent\\n }\\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>> = TDocumentNode extends DocumentNode< infer TType, any> ? TType : never;"],"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,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAjB,CAAA,EAAAc,CAAA,SAAAI,CAAA,GAAAR,CAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAb,CAAA,EAAAc,CAAA,UAAAI,CAAA,KAAAA,CAAA,CAAAX,GAAA,IAAAW,CAAA,CAAAC,GAAA,IAAAR,MAAA,CAAAC,cAAA,CAAAJ,CAAA,EAAAM,CAAA,EAAAI,CAAA,IAAAV,CAAA,CAAAM,CAAA,IAAAd,CAAA,CAAAc,CAAA,YAAAN,CAAA,CAAAH,OAAA,GAAAL,CAAA,EAAAG,CAAA,IAAAA,CAAA,CAAAgB,GAAA,CAAAnB,CAAA,EAAAQ,CAAA,GAAAA,CAAA;AAanC,MAAMY,SAAS,GAAG;EACd,uXAAuX,EAAExB,KAAK,CAACyB;AACnY,CAAC;AAqBM,SAASC,OAAOA,CAACC,MAAc,EAAE;EAAA,IAAAC,OAAA;EACtC,QAAAA,OAAA,GAAQJ,SAAS,CAASG,MAAM,CAAC,cAAAC,OAAA,cAAAA,OAAA,GAAI,CAAC,CAAC;AACzC"}
|
|
@@ -3,12 +3,45 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.VolatilityChartTimeUnit = exports.VolatilityChartTimeSpan = exports.TopicalSort = exports.Sort = exports.Region = exports.GetOrderPositionBooksDocument = exports.Division = exports.DataSource = exports.BookType = void 0;
|
|
6
|
+
exports.VolatilityChartTimeUnit = exports.VolatilityChartTimeSpan = exports.TopicalSort = exports.Sort = exports.Region = exports.GetOrderPositionBooksDocument = exports.Division = exports.DataSource = exports.CurrencyPowerBalanceTimeUnit = exports.CurrencyName = exports.CorrelationTimeUnit = exports.BookType = void 0;
|
|
7
7
|
let BookType = exports.BookType = function (BookType) {
|
|
8
8
|
BookType["Order"] = "ORDER";
|
|
9
9
|
BookType["Position"] = "POSITION";
|
|
10
10
|
return BookType;
|
|
11
11
|
}({});
|
|
12
|
+
let CorrelationTimeUnit = exports.CorrelationTimeUnit = function (CorrelationTimeUnit) {
|
|
13
|
+
CorrelationTimeUnit["H1"] = "H1";
|
|
14
|
+
CorrelationTimeUnit["H4"] = "H4";
|
|
15
|
+
CorrelationTimeUnit["H24"] = "H24";
|
|
16
|
+
CorrelationTimeUnit["M1"] = "M1";
|
|
17
|
+
CorrelationTimeUnit["M3"] = "M3";
|
|
18
|
+
CorrelationTimeUnit["M6"] = "M6";
|
|
19
|
+
CorrelationTimeUnit["W1"] = "W1";
|
|
20
|
+
CorrelationTimeUnit["Y1"] = "Y1";
|
|
21
|
+
return CorrelationTimeUnit;
|
|
22
|
+
}({});
|
|
23
|
+
let CurrencyName = exports.CurrencyName = function (CurrencyName) {
|
|
24
|
+
CurrencyName["Aud"] = "AUD";
|
|
25
|
+
CurrencyName["Cad"] = "CAD";
|
|
26
|
+
CurrencyName["Chf"] = "CHF";
|
|
27
|
+
CurrencyName["Eur"] = "EUR";
|
|
28
|
+
CurrencyName["Gbp"] = "GBP";
|
|
29
|
+
CurrencyName["Jpy"] = "JPY";
|
|
30
|
+
CurrencyName["Nzd"] = "NZD";
|
|
31
|
+
CurrencyName["Usd"] = "USD";
|
|
32
|
+
return CurrencyName;
|
|
33
|
+
}({});
|
|
34
|
+
let CurrencyPowerBalanceTimeUnit = exports.CurrencyPowerBalanceTimeUnit = function (CurrencyPowerBalanceTimeUnit) {
|
|
35
|
+
CurrencyPowerBalanceTimeUnit["CurrentDay"] = "CURRENT_DAY";
|
|
36
|
+
CurrencyPowerBalanceTimeUnit["H4"] = "H4";
|
|
37
|
+
CurrencyPowerBalanceTimeUnit["H8"] = "H8";
|
|
38
|
+
CurrencyPowerBalanceTimeUnit["H24"] = "H24";
|
|
39
|
+
CurrencyPowerBalanceTimeUnit["M1"] = "M1";
|
|
40
|
+
CurrencyPowerBalanceTimeUnit["M3"] = "M3";
|
|
41
|
+
CurrencyPowerBalanceTimeUnit["PreviousDay"] = "PREVIOUS_DAY";
|
|
42
|
+
CurrencyPowerBalanceTimeUnit["W1"] = "W1";
|
|
43
|
+
return CurrencyPowerBalanceTimeUnit;
|
|
44
|
+
}({});
|
|
12
45
|
let DataSource = exports.DataSource = function (DataSource) {
|
|
13
46
|
DataSource["Ny4"] = "NY4";
|
|
14
47
|
DataSource["Ty3"] = "TY3";
|
|
@@ -185,6 +218,12 @@ const GetOrderPositionBooksDocument = exports.GetOrderPositionBooksDocument = {
|
|
|
185
218
|
"kind": "Name",
|
|
186
219
|
"value": "price"
|
|
187
220
|
}
|
|
221
|
+
}, {
|
|
222
|
+
"kind": "Field",
|
|
223
|
+
"name": {
|
|
224
|
+
"kind": "Name",
|
|
225
|
+
"value": "time"
|
|
226
|
+
}
|
|
188
227
|
}, {
|
|
189
228
|
"kind": "Field",
|
|
190
229
|
"name": {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graphql.js","names":["BookType","exports","DataSource","Division","Region","Sort","TopicalSort","VolatilityChartTimeSpan","VolatilityChartTimeUnit","GetOrderPositionBooksDocument"],"sources":["../../../../src/gql/types/graphql.ts"],"sourcesContent":["/* eslint-disable */\nimport { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core';\nexport type Maybe<T> = T | null;\nexport type InputMaybe<T> = Maybe<T>;\nexport type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };\nexport type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]> };\nexport type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]: Maybe<T[SubKey]> };\nexport type MakeEmpty<T extends { [key: string]: unknown }, K extends keyof T> = { [_ in K]?: never };\nexport type Incremental<T> = T | { [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never };\n/** All built-in and custom scalars, mapped to their actual values */\nexport type Scalars = {\n ID: { input: string; output: string; }\n String: { input: string; output: string; }\n Boolean: { input: boolean; output: boolean; }\n Int: { input: number; output: number; }\n Float: { input: number; output: number; }\n};\n\nexport type AssetClass = {\n __typename?: 'AssetClass';\n instruments?: Maybe<Array<Maybe<Instrument>>>;\n name?: Maybe<Scalars['String']['output']>;\n};\n\nexport enum BookType {\n Order = 'ORDER',\n Position = 'POSITION'\n}\n\nexport enum DataSource {\n Ny4 = 'NY4',\n Ty3 = 'TY3'\n}\n\nexport enum Division {\n Oap = 'OAP',\n Oau = 'OAU',\n Oc = 'OC',\n Ocan = 'OCAN',\n Oel = 'OEL',\n Ogm = 'OGM',\n Oj = 'OJ',\n Otms = 'OTMS'\n}\n\nexport type Instrument = {\n __typename?: 'Instrument';\n displayName?: Maybe<Scalars['String']['output']>;\n name?: Maybe<Scalars['String']['output']>;\n};\n\nexport type OrderPositionBucket = {\n __typename?: 'OrderPositionBucket';\n longCountPercent: Scalars['Float']['output'];\n price: Scalars['Float']['output'];\n shortCountPercent: Scalars['Float']['output'];\n};\n\nexport type OrderPositionData = {\n __typename?: 'OrderPositionData';\n bucketWidth: Scalars['Float']['output'];\n buckets: Array<Maybe<OrderPositionBucket>>;\n dataSource?: Maybe<Scalars['String']['output']>;\n instrument: Scalars['String']['output'];\n price: Scalars['Float']['output'];\n region?: Maybe<Scalars['String']['output']>;\n time: Scalars['String']['output'];\n unixTime: Scalars['Int']['output'];\n};\n\nexport type Query = {\n __typename?: 'Query';\n assetClasses?: Maybe<Array<Maybe<AssetClass>>>;\n orderPositionBooks: Array<Maybe<OrderPositionData>>;\n sentiment?: Maybe<Array<SentimentInstrument>>;\n sentimentList?: Maybe<Array<SentimentInstrument>>;\n topicalInstruments?: Maybe<Array<TopicalInstrument>>;\n topicalInstrumentsCharts?: Maybe<Array<TopicalInstrumentChart>>;\n topicalInstrumentsTotalCount: Scalars['Int']['output'];\n volatilityChart?: Maybe<Array<Maybe<VolatilityChart>>>;\n volatilityChartAssetClasses?: Maybe<Array<VolatilityChartAssetClass>>;\n};\n\n\nexport type QueryAssetClassesArgs = {\n division: Division;\n};\n\n\nexport type QueryOrderPositionBooksArgs = {\n bookType: BookType;\n dataSource?: InputMaybe<DataSource>;\n instrument: Scalars['String']['input'];\n recentHours?: InputMaybe<Scalars['Int']['input']>;\n region?: InputMaybe<Region>;\n};\n\n\nexport type QuerySentimentArgs = {\n division?: InputMaybe<Division>;\n name: Scalars['String']['input'];\n};\n\n\nexport type QuerySentimentListArgs = {\n division?: InputMaybe<Division>;\n sort?: InputMaybe<Sort>;\n};\n\n\nexport type QueryTopicalInstrumentsArgs = {\n count?: InputMaybe<Scalars['Int']['input']>;\n division?: InputMaybe<Division>;\n offset?: InputMaybe<Scalars['Int']['input']>;\n sort: TopicalSort;\n};\n\n\nexport type QueryTopicalInstrumentsChartsArgs = {\n division?: InputMaybe<Division>;\n instruments?: InputMaybe<Array<Scalars['String']['input']>>;\n};\n\n\nexport type QueryTopicalInstrumentsTotalCountArgs = {\n division?: InputMaybe<Division>;\n sort: TopicalSort;\n};\n\n\nexport type QueryVolatilityChartArgs = {\n division?: InputMaybe<Division>;\n instrument: Scalars['String']['input'];\n timeSpan: VolatilityChartTimeSpan;\n timeUnit: VolatilityChartTimeUnit;\n};\n\n\nexport type QueryVolatilityChartAssetClassesArgs = {\n division?: InputMaybe<Division>;\n};\n\nexport enum Region {\n Amer = 'AMER',\n Apac = 'APAC',\n Emea = 'EMEA'\n}\n\nexport type Sentiment = {\n __typename?: 'Sentiment';\n longPercent: Scalars['Float']['output'];\n shortPercent: Scalars['Float']['output'];\n};\n\nexport type SentimentInstrument = {\n __typename?: 'SentimentInstrument';\n displayName: Scalars['String']['output'];\n name: Scalars['String']['output'];\n sentiment: Sentiment;\n};\n\nexport enum Sort {\n Bearish = 'BEARISH',\n Bullish = 'BULLISH'\n}\n\nexport type TopicalInstrument = {\n __typename?: 'TopicalInstrument';\n displayName: Scalars['String']['output'];\n name: Scalars['String']['output'];\n sentiment: TopicalInstrumentSentiment;\n updatedAt: Scalars['String']['output'];\n};\n\nexport type TopicalInstrumentChart = {\n __typename?: 'TopicalInstrumentChart';\n chart?: Maybe<Array<Scalars['Float']['output']>>;\n name: Scalars['String']['output'];\n};\n\nexport type TopicalInstrumentSentiment = {\n __typename?: 'TopicalInstrumentSentiment';\n longPercent: Scalars['Float']['output'];\n shortPercent: Scalars['Float']['output'];\n};\n\nexport enum TopicalSort {\n Bearish = 'BEARISH',\n Bullish = 'BULLISH',\n Hot = 'HOT',\n Popular = 'POPULAR',\n Volatile = 'VOLATILE'\n}\n\nexport type VolatilityChart = {\n __typename?: 'VolatilityChart';\n pips: Scalars['Float']['output'];\n /** Time point - hour in format hh:mm, Date in UTC, Week in format 'Mo' */\n point: Scalars['String']['output'];\n};\n\nexport type VolatilityChartAssetClass = {\n __typename?: 'VolatilityChartAssetClass';\n instruments?: Maybe<Array<Maybe<VolatilityChartInstrument>>>;\n name: Scalars['String']['output'];\n};\n\nexport type VolatilityChartInstrument = {\n __typename?: 'VolatilityChartInstrument';\n displayName: Scalars['String']['output'];\n name: Scalars['String']['output'];\n};\n\nexport enum VolatilityChartTimeSpan {\n D5 = 'D5',\n D10 = 'D10',\n M1 = 'M1',\n M3 = 'M3',\n W5 = 'W5',\n W10 = 'W10'\n}\n\nexport enum VolatilityChartTimeUnit {\n D = 'D',\n H = 'H',\n W = 'W'\n}\n\nexport type GetOrderPositionBooksQueryVariables = Exact<{\n instrument: Scalars['String']['input'];\n bookType: BookType;\n recentHours?: InputMaybe<Scalars['Int']['input']>;\n}>;\n\n\nexport type GetOrderPositionBooksQuery = { __typename?: 'Query', orderPositionBooks: Array<{ __typename?: 'OrderPositionData', bucketWidth: number, price: number, buckets: Array<{ __typename?: 'OrderPositionBucket', price: number, longCountPercent: number, shortCountPercent: number } | null> } | null> };\n\n\nexport const GetOrderPositionBooksDocument = {\"kind\":\"Document\",\"definitions\":[{\"kind\":\"OperationDefinition\",\"operation\":\"query\",\"name\":{\"kind\":\"Name\",\"value\":\"GetOrderPositionBooks\"},\"variableDefinitions\":[{\"kind\":\"VariableDefinition\",\"variable\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"instrument\"}},\"type\":{\"kind\":\"NonNullType\",\"type\":{\"kind\":\"NamedType\",\"name\":{\"kind\":\"Name\",\"value\":\"String\"}}}},{\"kind\":\"VariableDefinition\",\"variable\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"bookType\"}},\"type\":{\"kind\":\"NonNullType\",\"type\":{\"kind\":\"NamedType\",\"name\":{\"kind\":\"Name\",\"value\":\"BookType\"}}}},{\"kind\":\"VariableDefinition\",\"variable\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"recentHours\"}},\"type\":{\"kind\":\"NamedType\",\"name\":{\"kind\":\"Name\",\"value\":\"Int\"}}}],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"orderPositionBooks\"},\"arguments\":[{\"kind\":\"Argument\",\"name\":{\"kind\":\"Name\",\"value\":\"instrument\"},\"value\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"instrument\"}}},{\"kind\":\"Argument\",\"name\":{\"kind\":\"Name\",\"value\":\"bookType\"},\"value\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"bookType\"}}},{\"kind\":\"Argument\",\"name\":{\"kind\":\"Name\",\"value\":\"recentHours\"},\"value\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"recentHours\"}}}],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"bucketWidth\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"price\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"buckets\"},\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"price\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"longCountPercent\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"shortCountPercent\"}}]}}]}}]}}]} as unknown as DocumentNode<GetOrderPositionBooksQuery, GetOrderPositionBooksQueryVariables>;"],"mappings":";;;;;;IAwBYA,QAAQ,GAAAC,OAAA,CAAAD,QAAA,aAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAAA,OAARA,QAAQ;AAAA;AAAA,IAKRE,UAAU,GAAAD,OAAA,CAAAC,UAAA,aAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;EAAA,OAAVA,UAAU;AAAA;AAAA,IAKVC,QAAQ,GAAAF,OAAA,CAAAE,QAAA,aAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAAA,OAARA,QAAQ;AAAA;AAAA,IA4GRC,MAAM,GAAAH,OAAA,CAAAG,MAAA,aAANA,MAAM;EAANA,MAAM;EAANA,MAAM;EAANA,MAAM;EAAA,OAANA,MAAM;AAAA;AAAA,IAmBNC,IAAI,GAAAJ,OAAA,CAAAI,IAAA,aAAJA,IAAI;EAAJA,IAAI;EAAJA,IAAI;EAAA,OAAJA,IAAI;AAAA;AAAA,IAyBJC,WAAW,GAAAL,OAAA,CAAAK,WAAA,aAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAA,OAAXA,WAAW;AAAA;AAAA,IA2BXC,uBAAuB,GAAAN,OAAA,CAAAM,uBAAA,aAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAA,OAAvBA,uBAAuB;AAAA;AAAA,IASvBC,uBAAuB,GAAAP,OAAA,CAAAO,uBAAA,aAAvBA,uBAAuB;EAAvBA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AAC,MAAM,EAAC,MAAM;cAAC,OAAO,EAAC;YAAS,CAAC;YAAC,cAAc,EAAC;cAAC,MAAM,EAAC,cAAc;cAAC,YAAY,EAAC,CAAC;gBAAC,MAAM,EAAC,OAAO;gBAAC,MAAM,EAAC;kBAAC,MAAM,EAAC,MAAM;kBAAC,OAAO,EAAC;gBAAO;cAAC,CAAC,EAAC;gBAAC,MAAM,EAAC,OAAO;gBAAC,MAAM,EAAC;kBAAC,MAAM,EAAC,MAAM;kBAAC,OAAO,EAAC;gBAAkB;cAAC,CAAC,EAAC;gBAAC,MAAM,EAAC,OAAO;gBAAC,MAAM,EAAC;kBAAC,MAAM,EAAC,MAAM;kBAAC,OAAO,EAAC;gBAAmB;cAAC,CAAC;YAAC;UAAC,CAAC;QAAC;MAAC,CAAC;IAAC;EAAC,CAAC;AAAC,CAA6F"}
|
|
1
|
+
{"version":3,"file":"graphql.js","names":["BookType","exports","CorrelationTimeUnit","CurrencyName","CurrencyPowerBalanceTimeUnit","DataSource","Division","Region","Sort","TopicalSort","VolatilityChartTimeSpan","VolatilityChartTimeUnit","GetOrderPositionBooksDocument"],"sources":["../../../../src/gql/types/graphql.ts"],"sourcesContent":["/* eslint-disable */\nimport { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core';\nexport type Maybe<T> = T | null;\nexport type InputMaybe<T> = Maybe<T>;\nexport type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };\nexport type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]> };\nexport type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]: Maybe<T[SubKey]> };\nexport type MakeEmpty<T extends { [key: string]: unknown }, K extends keyof T> = { [_ in K]?: never };\nexport type Incremental<T> = T | { [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never };\n/** All built-in and custom scalars, mapped to their actual values */\nexport type Scalars = {\n ID: { input: string; output: string; }\n String: { input: string; output: string; }\n Boolean: { input: boolean; output: boolean; }\n Int: { input: number; output: number; }\n Float: { input: number; output: number; }\n};\n\nexport type AssetClass = {\n __typename?: 'AssetClass';\n instruments?: Maybe<Array<Maybe<Instrument>>>;\n name?: Maybe<Scalars['String']['output']>;\n};\n\nexport enum BookType {\n Order = 'ORDER',\n Position = 'POSITION'\n}\n\nexport type Correlation = {\n __typename?: 'Correlation';\n timeUnit: CorrelationTimeUnit;\n value: Scalars['Float']['output'];\n};\n\nexport type CorrelationHeatmap = {\n __typename?: 'CorrelationHeatmap';\n baseInstrument: Scalars['String']['output'];\n heatmap: Array<Heatmap>;\n};\n\nexport enum CorrelationTimeUnit {\n H1 = 'H1',\n H4 = 'H4',\n H24 = 'H24',\n M1 = 'M1',\n M3 = 'M3',\n M6 = 'M6',\n W1 = 'W1',\n Y1 = 'Y1'\n}\n\nexport enum CurrencyName {\n Aud = 'AUD',\n Cad = 'CAD',\n Chf = 'CHF',\n Eur = 'EUR',\n Gbp = 'GBP',\n Jpy = 'JPY',\n Nzd = 'NZD',\n Usd = 'USD'\n}\n\nexport type CurrencyPower = {\n __typename?: 'CurrencyPower';\n /** UTC Timestamp */\n point: Scalars['String']['output'];\n price: Scalars['Float']['output'];\n};\n\nexport type CurrencyPowerBalance = {\n __typename?: 'CurrencyPowerBalance';\n currency: CurrencyName;\n power: Array<CurrencyPower>;\n};\n\nexport enum CurrencyPowerBalanceTimeUnit {\n CurrentDay = 'CURRENT_DAY',\n H4 = 'H4',\n H8 = 'H8',\n H24 = 'H24',\n M1 = 'M1',\n M3 = 'M3',\n PreviousDay = 'PREVIOUS_DAY',\n W1 = 'W1'\n}\n\nexport type CurrencyStrength = {\n __typename?: 'CurrencyStrength';\n currency: CurrencyName;\n strengthRelation?: Maybe<Array<StrengthRelation>>;\n};\n\nexport enum DataSource {\n Ny4 = 'NY4',\n Ty3 = 'TY3'\n}\n\nexport enum Division {\n Oap = 'OAP',\n Oau = 'OAU',\n Oc = 'OC',\n Ocan = 'OCAN',\n Oel = 'OEL',\n Ogm = 'OGM',\n Oj = 'OJ',\n Otms = 'OTMS'\n}\n\nexport type Heatmap = {\n __typename?: 'Heatmap';\n correlation: Array<Correlation>;\n instrument: Scalars['String']['output'];\n};\n\nexport type Instrument = {\n __typename?: 'Instrument';\n displayName?: Maybe<Scalars['String']['output']>;\n name?: Maybe<Scalars['String']['output']>;\n};\n\nexport type OrderPositionBucket = {\n __typename?: 'OrderPositionBucket';\n longCountPercent: Scalars['Float']['output'];\n price: Scalars['Float']['output'];\n shortCountPercent: Scalars['Float']['output'];\n};\n\nexport type OrderPositionData = {\n __typename?: 'OrderPositionData';\n bucketWidth: Scalars['Float']['output'];\n buckets: Array<Maybe<OrderPositionBucket>>;\n dataSource?: Maybe<Scalars['String']['output']>;\n instrument: Scalars['String']['output'];\n price?: Maybe<Scalars['Float']['output']>;\n region?: Maybe<Scalars['String']['output']>;\n time: Scalars['String']['output'];\n unixTime: Scalars['Int']['output'];\n};\n\nexport type Query = {\n __typename?: 'Query';\n assetClasses?: Maybe<Array<Maybe<AssetClass>>>;\n correlationHeatmap: CorrelationHeatmap;\n currencyPowerBalance?: Maybe<Array<CurrencyPowerBalance>>;\n currencyStrength?: Maybe<Array<CurrencyStrength>>;\n orderPositionBooks: Array<Maybe<OrderPositionData>>;\n sentiment?: Maybe<Array<SentimentInstrument>>;\n sentimentList?: Maybe<Array<SentimentInstrument>>;\n topicalInstruments?: Maybe<Array<TopicalInstrument>>;\n topicalInstrumentsCharts?: Maybe<Array<TopicalInstrumentChart>>;\n topicalInstrumentsTotalCount: Scalars['Int']['output'];\n volatilityChart?: Maybe<Array<Maybe<VolatilityChart>>>;\n volatilityChartAssetClasses?: Maybe<Array<VolatilityChartAssetClass>>;\n};\n\n\nexport type QueryAssetClassesArgs = {\n division: Division;\n};\n\n\nexport type QueryCorrelationHeatmapArgs = {\n division: Division;\n};\n\n\nexport type QueryCurrencyPowerBalanceArgs = {\n timeUnit: CurrencyPowerBalanceTimeUnit;\n};\n\n\nexport type QueryOrderPositionBooksArgs = {\n bookType: BookType;\n dataSource?: InputMaybe<DataSource>;\n instrument: Scalars['String']['input'];\n recentHours?: InputMaybe<Scalars['Int']['input']>;\n region?: InputMaybe<Region>;\n};\n\n\nexport type QuerySentimentArgs = {\n division?: InputMaybe<Division>;\n name: Scalars['String']['input'];\n};\n\n\nexport type QuerySentimentListArgs = {\n division?: InputMaybe<Division>;\n sort?: InputMaybe<Sort>;\n};\n\n\nexport type QueryTopicalInstrumentsArgs = {\n count?: InputMaybe<Scalars['Int']['input']>;\n division?: InputMaybe<Division>;\n offset?: InputMaybe<Scalars['Int']['input']>;\n sort: TopicalSort;\n};\n\n\nexport type QueryTopicalInstrumentsChartsArgs = {\n division?: InputMaybe<Division>;\n instruments?: InputMaybe<Array<Scalars['String']['input']>>;\n};\n\n\nexport type QueryTopicalInstrumentsTotalCountArgs = {\n division?: InputMaybe<Division>;\n sort: TopicalSort;\n};\n\n\nexport type QueryVolatilityChartArgs = {\n division?: InputMaybe<Division>;\n instrument: Scalars['String']['input'];\n timeSpan: VolatilityChartTimeSpan;\n timeUnit: VolatilityChartTimeUnit;\n};\n\n\nexport type QueryVolatilityChartAssetClassesArgs = {\n division?: InputMaybe<Division>;\n};\n\nexport enum Region {\n Amer = 'AMER',\n Apac = 'APAC',\n Emea = 'EMEA'\n}\n\nexport type Sentiment = {\n __typename?: 'Sentiment';\n longPercent: Scalars['Float']['output'];\n shortPercent: Scalars['Float']['output'];\n};\n\nexport type SentimentInstrument = {\n __typename?: 'SentimentInstrument';\n displayName: Scalars['String']['output'];\n name: Scalars['String']['output'];\n sentiment: Sentiment;\n updatedAt: Scalars['String']['output'];\n};\n\nexport enum Sort {\n Bearish = 'BEARISH',\n Bullish = 'BULLISH'\n}\n\nexport type StrengthRelation = {\n __typename?: 'StrengthRelation';\n currency: CurrencyName;\n percentage: Scalars['Float']['output'];\n};\n\nexport type TopicalInstrument = {\n __typename?: 'TopicalInstrument';\n displayName: Scalars['String']['output'];\n name: Scalars['String']['output'];\n sentiment: Sentiment;\n updatedAt: Scalars['String']['output'];\n};\n\nexport type TopicalInstrumentChart = {\n __typename?: 'TopicalInstrumentChart';\n chart?: Maybe<Array<Scalars['Float']['output']>>;\n name: Scalars['String']['output'];\n};\n\nexport enum TopicalSort {\n Bearish = 'BEARISH',\n Bullish = 'BULLISH',\n Hot = 'HOT',\n Popular = 'POPULAR',\n Volatile = 'VOLATILE'\n}\n\nexport type VolatilityChart = {\n __typename?: 'VolatilityChart';\n pips: Scalars['Float']['output'];\n /** Time point - hour in format hh:mm, Date in UTC, Week in format 'Mo' */\n point: Scalars['String']['output'];\n};\n\nexport type VolatilityChartAssetClass = {\n __typename?: 'VolatilityChartAssetClass';\n instruments: Array<VolatilityChartInstrument>;\n name: Scalars['String']['output'];\n};\n\nexport type VolatilityChartInstrument = {\n __typename?: 'VolatilityChartInstrument';\n displayName: Scalars['String']['output'];\n name: Scalars['String']['output'];\n};\n\nexport enum VolatilityChartTimeSpan {\n /** Valid for: H */\n D5 = 'D5',\n /** Valid for: H */\n D10 = 'D10',\n /** Valid for: D */\n M1 = 'M1',\n /** Valid for: D */\n M3 = 'M3',\n /** Valid for: W */\n W5 = 'W5',\n /** Valid for: W */\n W10 = 'W10'\n}\n\nexport enum VolatilityChartTimeUnit {\n D = 'D',\n H = 'H',\n W = 'W'\n}\n\nexport type GetOrderPositionBooksQueryVariables = Exact<{\n instrument: Scalars['String']['input'];\n bookType: BookType;\n recentHours?: InputMaybe<Scalars['Int']['input']>;\n}>;\n\n\nexport type GetOrderPositionBooksQuery = { __typename?: 'Query', orderPositionBooks: Array<{ __typename?: 'OrderPositionData', bucketWidth: number, price?: number | null, time: string, buckets: Array<{ __typename?: 'OrderPositionBucket', price: number, longCountPercent: number, shortCountPercent: number } | null> } | null> };\n\n\nexport const GetOrderPositionBooksDocument = {\"kind\":\"Document\",\"definitions\":[{\"kind\":\"OperationDefinition\",\"operation\":\"query\",\"name\":{\"kind\":\"Name\",\"value\":\"GetOrderPositionBooks\"},\"variableDefinitions\":[{\"kind\":\"VariableDefinition\",\"variable\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"instrument\"}},\"type\":{\"kind\":\"NonNullType\",\"type\":{\"kind\":\"NamedType\",\"name\":{\"kind\":\"Name\",\"value\":\"String\"}}}},{\"kind\":\"VariableDefinition\",\"variable\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"bookType\"}},\"type\":{\"kind\":\"NonNullType\",\"type\":{\"kind\":\"NamedType\",\"name\":{\"kind\":\"Name\",\"value\":\"BookType\"}}}},{\"kind\":\"VariableDefinition\",\"variable\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"recentHours\"}},\"type\":{\"kind\":\"NamedType\",\"name\":{\"kind\":\"Name\",\"value\":\"Int\"}}}],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"orderPositionBooks\"},\"arguments\":[{\"kind\":\"Argument\",\"name\":{\"kind\":\"Name\",\"value\":\"instrument\"},\"value\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"instrument\"}}},{\"kind\":\"Argument\",\"name\":{\"kind\":\"Name\",\"value\":\"bookType\"},\"value\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"bookType\"}}},{\"kind\":\"Argument\",\"name\":{\"kind\":\"Name\",\"value\":\"recentHours\"},\"value\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"recentHours\"}}}],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"bucketWidth\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"price\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"time\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"buckets\"},\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"price\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"longCountPercent\"}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"shortCountPercent\"}}]}}]}}]}}]} as unknown as DocumentNode<GetOrderPositionBooksQuery, GetOrderPositionBooksQueryVariables>;"],"mappings":";;;;;;IAwBYA,QAAQ,GAAAC,OAAA,CAAAD,QAAA,aAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAAA,OAARA,QAAQ;AAAA;AAAA,IAiBRE,mBAAmB,GAAAD,OAAA,CAAAC,mBAAA,aAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAA,OAAnBA,mBAAmB;AAAA;AAAA,IAWnBC,YAAY,GAAAF,OAAA,CAAAE,YAAA,aAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAA,OAAZA,YAAY;AAAA;AAAA,IAwBZC,4BAA4B,GAAAH,OAAA,CAAAG,4BAAA,aAA5BA,4BAA4B;EAA5BA,4BAA4B;EAA5BA,4BAA4B;EAA5BA,4BAA4B;EAA5BA,4BAA4B;EAA5BA,4BAA4B;EAA5BA,4BAA4B;EAA5BA,4BAA4B;EAA5BA,4BAA4B;EAAA,OAA5BA,4BAA4B;AAAA;AAAA,IAiB5BC,UAAU,GAAAJ,OAAA,CAAAI,UAAA,aAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;EAAA,OAAVA,UAAU;AAAA;AAAA,IAKVC,QAAQ,GAAAL,OAAA,CAAAK,QAAA,aAARA,QAAQ;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AC,EAAC;gBAAC,MAAM,EAAC,OAAO;gBAAC,MAAM,EAAC;kBAAC,MAAM,EAAC,MAAM;kBAAC,OAAO,EAAC;gBAAmB;cAAC,CAAC;YAAC;UAAC,CAAC;QAAC;MAAC,CAAC;IAAC;EAAC,CAAC;AAAC,CAA6F"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
"buy": "Buy",
|
|
3
3
|
"data_unavailable": "Data unavailable",
|
|
4
4
|
"instrument": "Instrument",
|
|
5
|
+
"last_updated": "Last updated",
|
|
5
6
|
"long": "Long",
|
|
6
7
|
"long_positions": "Long Positions",
|
|
7
8
|
"open_orders": "Open Orders",
|
|
@@ -15,6 +16,7 @@
|
|
|
15
16
|
"sell_orders": "Sell Orders",
|
|
16
17
|
"short": "Short",
|
|
17
18
|
"short_positions": "Short Positions",
|
|
19
|
+
"today": "Today",
|
|
18
20
|
"zoom_in": "Zoom In",
|
|
19
21
|
"zoom_out": "Zoom Out"
|
|
20
22
|
}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
"buy": "買進",
|
|
3
3
|
"data_unavailable": "沒有數據",
|
|
4
4
|
"instrument": "金融工具",
|
|
5
|
+
"last_updated": "最後更新",
|
|
5
6
|
"long": "長",
|
|
6
7
|
"long_positions": "長倉",
|
|
7
8
|
"open_orders": "開盤市價單",
|
|
@@ -15,6 +16,7 @@
|
|
|
15
16
|
"sell_orders": "賣單",
|
|
16
17
|
"short": "短",
|
|
17
18
|
"short_positions": "短倉",
|
|
19
|
+
"today": "今日",
|
|
18
20
|
"zoom_in": "放大",
|
|
19
21
|
"zoom_out": "縮小"
|
|
20
22
|
}
|
|
@@ -1,17 +1,22 @@
|
|
|
1
1
|
import React, { useContext } from 'react';
|
|
2
2
|
import { useQuery } from '@apollo/client';
|
|
3
3
|
import classnames from 'classnames';
|
|
4
|
-
import { ChartError, Size, Spinner, SpinnerSize, ThemeContext } from '@oanda/labs-widget-common';
|
|
4
|
+
import { ChartError, InfoBox, Size, Spinner, SpinnerSize, ThemeContext, formatUpdatedTimestamp } from '@oanda/labs-widget-common';
|
|
5
|
+
import { useLocale } from '@oanda/mono-i18n';
|
|
5
6
|
import { getOrderPositionBooks } from '../gql/getOrderPositionBooks';
|
|
6
7
|
import { BookType } from '../gql/types/graphql';
|
|
7
8
|
import { Chart } from './components/Chart/Chart';
|
|
8
9
|
import { instrumentPrecisionConfig } from './config';
|
|
10
|
+
import { EMPTY_VALUE } from './constants';
|
|
9
11
|
const ChartWithData = _ref => {
|
|
10
|
-
var _data$orderPositionBo;
|
|
12
|
+
var _data$orderPositionBo, _data$orderPositionBo2;
|
|
11
13
|
let {
|
|
12
14
|
instrument,
|
|
13
15
|
bookType
|
|
14
16
|
} = _ref;
|
|
17
|
+
const {
|
|
18
|
+
lang
|
|
19
|
+
} = useLocale();
|
|
15
20
|
const {
|
|
16
21
|
size
|
|
17
22
|
} = useContext(ThemeContext);
|
|
@@ -29,7 +34,8 @@ const ChartWithData = _ref => {
|
|
|
29
34
|
fetchPolicy: 'network-only'
|
|
30
35
|
});
|
|
31
36
|
const isError = !loading && !(data !== null && data !== void 0 && (_data$orderPositionBo = data.orderPositionBooks[0]) !== null && _data$orderPositionBo !== void 0 && _data$orderPositionBo.price) || !!error;
|
|
32
|
-
|
|
37
|
+
const updatedAt = data === null || data === void 0 || (_data$orderPositionBo2 = data.orderPositionBooks[0]) === null || _data$orderPositionBo2 === void 0 ? void 0 : _data$orderPositionBo2.time;
|
|
38
|
+
return React.createElement(React.Fragment, null, React.createElement("div", {
|
|
33
39
|
className: classnames('lw-relative lw-w-full', {
|
|
34
40
|
'lw-h-[450px]': isDesktop,
|
|
35
41
|
'lw-h-[390px]': !isDesktop
|
|
@@ -52,6 +58,10 @@ const ChartWithData = _ref => {
|
|
|
52
58
|
data: data,
|
|
53
59
|
isOrderBook: bookType === BookType.Order,
|
|
54
60
|
precision: instrumentPrecisionConfig[instrument]
|
|
61
|
+
}))), !isError && React.createElement("div", {
|
|
62
|
+
className: "lw-mt-2 lw-h-8"
|
|
63
|
+
}, React.createElement(InfoBox, {
|
|
64
|
+
text: "".concat(lang('last_updated'), ": ").concat(updatedAt ? formatUpdatedTimestamp(updatedAt, lang('today')) : EMPTY_VALUE)
|
|
55
65
|
})));
|
|
56
66
|
};
|
|
57
67
|
export { ChartWithData };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChartWithData.js","names":["React","useContext","useQuery","classnames","ChartError","Size","Spinner","SpinnerSize","ThemeContext","getOrderPositionBooks","BookType","Chart","instrumentPrecisionConfig","ChartWithData","_ref","_data$orderPositionBo","instrument","bookType","size","isDesktop","DESKTOP","loading","data","error","variables","recentHours","fetchPolicy","isError","orderPositionBooks","price","createElement","className","lg","isOrderBook","Order","precision"],"sources":["../../../src/OrderBookWidget/ChartWithData.tsx"],"sourcesContent":["import React, { useContext } from 'react';\nimport { useQuery } from '@apollo/client';\nimport classnames from 'classnames';\nimport {\n ChartError, Size, Spinner, SpinnerSize, ThemeContext,\n} from '@oanda/labs-widget-common';\nimport { ChartWithDataProps } from './types';\nimport { getOrderPositionBooks } from '../gql/getOrderPositionBooks';\nimport { GetOrderPositionBooksQuery, GetOrderPositionBooksQueryVariables, BookType } from '../gql/types/graphql';\nimport { Chart } from './components/Chart/Chart';\nimport { instrumentPrecisionConfig } from './config';\n\nconst ChartWithData = ({\n instrument,\n bookType,\n}: ChartWithDataProps) => {\n const { size } = useContext(ThemeContext);\n const isDesktop = size === Size.DESKTOP;\n\n const { loading, data, error } = useQuery<\n GetOrderPositionBooksQuery,\n GetOrderPositionBooksQueryVariables\n >(getOrderPositionBooks, {\n variables: {\n instrument,\n bookType,\n recentHours: 1,\n },\n fetchPolicy: 'network-only',\n });\n\n const isError = (!loading && !data?.orderPositionBooks[0]?.price) || !!error;\n\n return (\n <div className={classnames('lw-relative lw-w-full', {\n
|
|
1
|
+
{"version":3,"file":"ChartWithData.js","names":["React","useContext","useQuery","classnames","ChartError","InfoBox","Size","Spinner","SpinnerSize","ThemeContext","formatUpdatedTimestamp","useLocale","getOrderPositionBooks","BookType","Chart","instrumentPrecisionConfig","EMPTY_VALUE","ChartWithData","_ref","_data$orderPositionBo","_data$orderPositionBo2","instrument","bookType","lang","size","isDesktop","DESKTOP","loading","data","error","variables","recentHours","fetchPolicy","isError","orderPositionBooks","price","updatedAt","time","createElement","Fragment","className","lg","isOrderBook","Order","precision","text","concat"],"sources":["../../../src/OrderBookWidget/ChartWithData.tsx"],"sourcesContent":["import React, { useContext } from 'react';\nimport { useQuery } from '@apollo/client';\nimport classnames from 'classnames';\nimport {\n ChartError, InfoBox, Size, Spinner, SpinnerSize, ThemeContext, formatUpdatedTimestamp,\n} from '@oanda/labs-widget-common';\nimport { useLocale } from '@oanda/mono-i18n';\nimport { ChartWithDataProps } from './types';\nimport { getOrderPositionBooks } from '../gql/getOrderPositionBooks';\nimport { GetOrderPositionBooksQuery, GetOrderPositionBooksQueryVariables, BookType } from '../gql/types/graphql';\nimport { Chart } from './components/Chart/Chart';\nimport { instrumentPrecisionConfig } from './config';\nimport { EMPTY_VALUE } from './constants';\n\nconst ChartWithData = ({\n instrument,\n bookType,\n}: ChartWithDataProps) => {\n const { lang } = useLocale();\n const { size } = useContext(ThemeContext);\n const isDesktop = size === Size.DESKTOP;\n\n const { loading, data, error } = useQuery<\n GetOrderPositionBooksQuery,\n GetOrderPositionBooksQueryVariables\n >(getOrderPositionBooks, {\n variables: {\n instrument,\n bookType,\n recentHours: 1,\n },\n fetchPolicy: 'network-only',\n });\n\n const isError = (!loading && !data?.orderPositionBooks[0]?.price) || !!error;\n const updatedAt = data?.orderPositionBooks[0]?.time;\n\n return (\n <>\n <div className={classnames('lw-relative lw-w-full', {\n 'lw-h-[450px]': isDesktop,\n 'lw-h-[390px]': !isDesktop,\n })}\n >\n {isError && (\n <div className={\n classnames(\n 'lw-absolute lw-left-0 lw-top-0 lw-flex lw-w-full lw-items-center lw-justify-center lw-border lw-border-solid lw-border-border-primary',\n {\n 'lw-h-full': isDesktop,\n 'lw-h-[calc(100%-40px)]': !isDesktop,\n },\n )\n }\n >\n <ChartError />\n </div>\n )}\n {loading && (\n <div className={\n classnames(\n 'lw-absolute lw-left-0 lw-top-0 lw-flex lw-w-full lw-items-center lw-justify-center lw-border lw-border-solid lw-border-border-primary',\n {\n 'lw-h-full': isDesktop,\n 'lw-h-[calc(100%-40px)]': !isDesktop,\n },\n )\n }\n >\n <Spinner size={SpinnerSize.lg} />\n </div>\n )}\n {!isError && data && (\n <div className=\"lw-absolute lw-left-0 lw-top-0 lw-flex lw-h-full lw-w-full\">\n <Chart\n data={data}\n isOrderBook={bookType === BookType.Order}\n precision={instrumentPrecisionConfig[instrument]}\n />\n </div>\n )}\n </div>\n {!isError && (\n <div className=\"lw-mt-2 lw-h-8\">\n <InfoBox text={`${lang('last_updated')}: ${updatedAt ? formatUpdatedTimestamp(updatedAt, lang('today')) : EMPTY_VALUE}`} />\n </div>\n )}\n </>\n );\n};\n\nexport { ChartWithData };\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,UAAU,QAAQ,OAAO;AACzC,SAASC,QAAQ,QAAQ,gBAAgB;AACzC,OAAOC,UAAU,MAAM,YAAY;AACnC,SACEC,UAAU,EAAEC,OAAO,EAAEC,IAAI,EAAEC,OAAO,EAAEC,WAAW,EAAEC,YAAY,EAAEC,sBAAsB,QAChF,2BAA2B;AAClC,SAASC,SAAS,QAAQ,kBAAkB;AAE5C,SAASC,qBAAqB,QAAQ,8BAA8B;AACpE,SAA0EC,QAAQ,QAAQ,sBAAsB;AAChH,SAASC,KAAK,QAAQ,0BAA0B;AAChD,SAASC,yBAAyB,QAAQ,UAAU;AACpD,SAASC,WAAW,QAAQ,aAAa;AAEzC,MAAMC,aAAa,GAAGC,IAAA,IAGI;EAAA,IAAAC,qBAAA,EAAAC,sBAAA;EAAA,IAHH;IACrBC,UAAU;IACVC;EACkB,CAAC,GAAAJ,IAAA;EACnB,MAAM;IAAEK;EAAK,CAAC,GAAGZ,SAAS,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AAS;MACtB,wBAAwB,EAAE,CAACA;IAC7B,CACF;EACD,GAECzB,KAAA,CAAAsC,aAAA,CAAC/B,OAAO;IAACiB,IAAI,EAAEhB,WAAW,CAACiC;EAAG,CAAE,CAC7B,CACJ,EACA,CAACR,OAAO,IAAIL,IAAI,IACf5B,KAAA,CAAAsC,aAAA;IAAKE,SAAS,EAAC;EAA4D,GACzExC,KAAA,CAAAsC,aAAA,CAACxB,KAAK;IACJc,IAAI,EAAEA,IAAK;IACXc,WAAW,EAAEpB,QAAQ,KAAKT,QAAQ,CAAC8B,KAAM;IACzCC,SAAS,EAAE7B,yBAAyB,CAACM,UAAU;EAAE,CAClD,CACE,CAEJ,CAAC,EACL,CAACY,OAAO,IACTjC,KAAA,CAAAsC,aAAA;IAAKE,SAAS,EAAC;EAAgB,GAC7BxC,KAAA,CAAAsC,aAAA,CAACjC,OAAO;IAACwC,IAAI,KAAAC,MAAA,CAAKvB,IAAI,CAAC,cAAc,CAAC,QAAAuB,MAAA,CAAKV,SAAS,GAAG1B,sBAAsB,CAAC0B,SAAS,EAAEb,IAAI,CAAC,OAAO,CAAC,CAAC,GAAGP,WAAW;EAAG,CAAE,CACvH,CAEL,CAAC;AAEP,CAAC;AAED,SAASC,aAAa"}
|
|
@@ -292,6 +292,7 @@ export const getOption = _ref2 => {
|
|
|
292
292
|
silent: true,
|
|
293
293
|
precision,
|
|
294
294
|
symbol: ['none', 'triangle'],
|
|
295
|
+
symbolOffset: [0, [0, isDesktop ? 0 : -10]],
|
|
295
296
|
symbolRotate: 90,
|
|
296
297
|
symbolSize: [20, 10],
|
|
297
298
|
lineStyle: {
|
|
@@ -299,9 +300,9 @@ export const getOption = _ref2 => {
|
|
|
299
300
|
width: 1
|
|
300
301
|
},
|
|
301
302
|
label: {
|
|
303
|
+
distance: isDesktop ? 5 : -5,
|
|
302
304
|
overflow: 'truncate',
|
|
303
305
|
width: isDesktop ? undefined : Y_LABEL_SIZE_MOBILE,
|
|
304
|
-
padding: isDesktop ? [5, 15, 5, 15] : [5, 12, 5, 5],
|
|
305
306
|
color: isDark ? colorPalette.black : colorPalette.white,
|
|
306
307
|
backgroundColor: isDark ? colorPalette.orange : colorPalette.bottleGreenDark
|
|
307
308
|
},
|