@oanda/labs-crowd-view-widget 1.0.70 → 1.0.72
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 +461 -5399
- package/dist/main/translations/sources/ja.json +1 -1
- package/dist/module/CrowdViewWidget/CrowdViewWidget.js +19 -12
- package/dist/module/CrowdViewWidget/CrowdViewWidget.js.map +1 -1
- package/dist/module/CrowdViewWidget/Main.js +37 -30
- package/dist/module/CrowdViewWidget/Main.js.map +1 -1
- package/dist/module/CrowdViewWidget/components/Chart/Chart.js +36 -29
- package/dist/module/CrowdViewWidget/components/Chart/Chart.js.map +1 -1
- package/dist/module/CrowdViewWidget/components/Chart/ChartWithData.js +30 -23
- package/dist/module/CrowdViewWidget/components/Chart/ChartWithData.js.map +1 -1
- package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getDataZoomConfig.js +11 -4
- package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getDataZoomConfig.js.map +1 -1
- package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getGridConfig.js +10 -3
- package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getGridConfig.js.map +1 -1
- package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getGridLines.js +21 -14
- package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getGridLines.js.map +1 -1
- package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getLabelsConfig.js +23 -15
- package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getLabelsConfig.js.map +1 -1
- package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getSeriesCandlestickConfig.js +16 -8
- package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getSeriesCandlestickConfig.js.map +1 -1
- package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getSeriesHeatmapConfig.js +10 -3
- package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getSeriesHeatmapConfig.js.map +1 -1
- package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getSeriesSentimentConfig.js +10 -3
- package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getSeriesSentimentConfig.js.map +1 -1
- package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getTooltipConfig.js +12 -5
- package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getTooltipConfig.js.map +1 -1
- package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getVisualMapConfig.js +13 -6
- package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getVisualMapConfig.js.map +1 -1
- package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getXAxisConfig.js +13 -6
- package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getXAxisConfig.js.map +1 -1
- package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getYAxisConfig.js +14 -7
- package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getYAxisConfig.js.map +1 -1
- package/dist/module/CrowdViewWidget/components/Chart/chartOptions/index.js +126 -11
- package/dist/module/CrowdViewWidget/components/Chart/chartOptions/index.js.map +1 -1
- package/dist/module/CrowdViewWidget/components/Chart/chartUtils/formatFullDate.js +8 -1
- package/dist/module/CrowdViewWidget/components/Chart/chartUtils/formatFullDate.js.map +1 -1
- package/dist/module/CrowdViewWidget/components/Chart/chartUtils/formatXAxisAdditionalLabel.js +8 -1
- package/dist/module/CrowdViewWidget/components/Chart/chartUtils/formatXAxisAdditionalLabel.js.map +1 -1
- package/dist/module/CrowdViewWidget/components/Chart/chartUtils/formatXAxisLabel.js +11 -4
- package/dist/module/CrowdViewWidget/components/Chart/chartUtils/formatXAxisLabel.js.map +1 -1
- package/dist/module/CrowdViewWidget/components/Chart/chartUtils/formatYAxisLabel.js +10 -3
- package/dist/module/CrowdViewWidget/components/Chart/chartUtils/formatYAxisLabel.js.map +1 -1
- package/dist/module/CrowdViewWidget/components/Chart/chartUtils/getChartStyles.js +15 -8
- package/dist/module/CrowdViewWidget/components/Chart/chartUtils/getChartStyles.js.map +1 -1
- package/dist/module/CrowdViewWidget/components/Chart/chartUtils/getGradientColor.js +11 -3
- package/dist/module/CrowdViewWidget/components/Chart/chartUtils/getGradientColor.js.map +1 -1
- package/dist/module/CrowdViewWidget/components/Chart/chartUtils/getLabelData.js +8 -1
- package/dist/module/CrowdViewWidget/components/Chart/chartUtils/getLabelData.js.map +1 -1
- package/dist/module/CrowdViewWidget/components/Chart/chartUtils/getRectColor.js +12 -5
- package/dist/module/CrowdViewWidget/components/Chart/chartUtils/getRectColor.js.map +1 -1
- package/dist/module/CrowdViewWidget/components/Chart/chartUtils/getTooltipFormatter.js +17 -10
- package/dist/module/CrowdViewWidget/components/Chart/chartUtils/getTooltipFormatter.js.map +1 -1
- package/dist/module/CrowdViewWidget/components/Chart/chartUtils/handleLabelUpdate.js +16 -9
- package/dist/module/CrowdViewWidget/components/Chart/chartUtils/handleLabelUpdate.js.map +1 -1
- package/dist/module/CrowdViewWidget/components/Chart/chartUtils/handleTooltipUpdate.js +8 -1
- package/dist/module/CrowdViewWidget/components/Chart/chartUtils/handleTooltipUpdate.js.map +1 -1
- package/dist/module/CrowdViewWidget/components/Chart/chartUtils/index.js +148 -13
- package/dist/module/CrowdViewWidget/components/Chart/chartUtils/index.js.map +1 -1
- package/dist/module/CrowdViewWidget/components/Chart/chartUtils/isDifferenceGreaterThanTwoWeeks.js +10 -3
- package/dist/module/CrowdViewWidget/components/Chart/chartUtils/isDifferenceGreaterThanTwoWeeks.js.map +1 -1
- package/dist/module/CrowdViewWidget/components/Chart/chartUtils/normalizeLocale.js +8 -1
- package/dist/module/CrowdViewWidget/components/Chart/chartUtils/normalizeLocale.js.map +1 -1
- package/dist/module/CrowdViewWidget/components/Chart/dataUtils/getBucketWidthMultiplayer.js +11 -4
- package/dist/module/CrowdViewWidget/components/Chart/dataUtils/getBucketWidthMultiplayer.js.map +1 -1
- package/dist/module/CrowdViewWidget/components/Chart/dataUtils/getInstrumentConfig.js +14 -7
- package/dist/module/CrowdViewWidget/components/Chart/dataUtils/getInstrumentConfig.js.map +1 -1
- package/dist/module/CrowdViewWidget/components/Chart/dataUtils/getTimeSpanForGranularity.js +14 -7
- package/dist/module/CrowdViewWidget/components/Chart/dataUtils/getTimeSpanForGranularity.js.map +1 -1
- package/dist/module/CrowdViewWidget/components/Chart/dataUtils/index.js +82 -7
- package/dist/module/CrowdViewWidget/components/Chart/dataUtils/index.js.map +1 -1
- package/dist/module/CrowdViewWidget/components/Chart/dataUtils/processOrderPositionBooks.js +8 -1
- package/dist/module/CrowdViewWidget/components/Chart/dataUtils/processOrderPositionBooks.js.map +1 -1
- package/dist/module/CrowdViewWidget/components/Chart/dataUtils/processPriceCandles.js +8 -1
- package/dist/module/CrowdViewWidget/components/Chart/dataUtils/processPriceCandles.js.map +1 -1
- package/dist/module/CrowdViewWidget/components/Chart/dataUtils/processSentiments.js +8 -1
- package/dist/module/CrowdViewWidget/components/Chart/dataUtils/processSentiments.js.map +1 -1
- package/dist/module/CrowdViewWidget/components/Chart/dataUtils/validateData.js +8 -1
- package/dist/module/CrowdViewWidget/components/Chart/dataUtils/validateData.js.map +1 -1
- package/dist/module/CrowdViewWidget/components/Chart/getOption.js +27 -20
- package/dist/module/CrowdViewWidget/components/Chart/getOption.js.map +1 -1
- package/dist/module/CrowdViewWidget/components/Chart/index.js +71 -6
- package/dist/module/CrowdViewWidget/components/Chart/index.js.map +1 -1
- package/dist/module/CrowdViewWidget/components/Chart/types.js +5 -1
- package/dist/module/CrowdViewWidget/components/Chart/useCrowdViewData.js +35 -28
- package/dist/module/CrowdViewWidget/components/Chart/useCrowdViewData.js.map +1 -1
- package/dist/module/CrowdViewWidget/components/Chart/useResizeObserver.js +13 -6
- package/dist/module/CrowdViewWidget/components/Chart/useResizeObserver.js.map +1 -1
- package/dist/module/CrowdViewWidget/components/Legend/Legend.js +23 -15
- package/dist/module/CrowdViewWidget/components/Legend/Legend.js.map +1 -1
- package/dist/module/CrowdViewWidget/components/Legend/LegendBar.js +17 -9
- package/dist/module/CrowdViewWidget/components/Legend/LegendBar.js.map +1 -1
- package/dist/module/CrowdViewWidget/components/Legend/index.js +27 -2
- package/dist/module/CrowdViewWidget/components/Legend/index.js.map +1 -1
- package/dist/module/CrowdViewWidget/components/index.js +27 -2
- package/dist/module/CrowdViewWidget/components/index.js.map +1 -1
- package/dist/module/CrowdViewWidget/constants.js +38 -31
- package/dist/module/CrowdViewWidget/constants.js.map +1 -1
- package/dist/module/CrowdViewWidget/index.js +27 -2
- package/dist/module/CrowdViewWidget/index.js.map +1 -1
- package/dist/module/CrowdViewWidget/render.js +13 -10
- package/dist/module/CrowdViewWidget/render.js.map +1 -1
- package/dist/module/CrowdViewWidget/selectConfig.js +49 -43
- package/dist/module/CrowdViewWidget/selectConfig.js.map +1 -1
- package/dist/module/CrowdViewWidget/types.js +7 -1
- package/dist/module/CrowdViewWidget/types.js.map +1 -1
- package/dist/module/gql/getOrderPositionBooks.js +8 -3
- package/dist/module/gql/getOrderPositionBooks.js.map +1 -1
- package/dist/module/gql/getPriceCandles.js +8 -3
- package/dist/module/gql/getPriceCandles.js.map +1 -1
- package/dist/module/gql/getSentiments.js +8 -3
- package/dist/module/gql/getSentiments.js.map +1 -1
- package/dist/module/gql/types/fragment-masking.js +11 -3
- package/dist/module/gql/types/fragment-masking.js.map +1 -1
- package/dist/module/gql/types/gql.js +9 -2
- package/dist/module/gql/types/gql.js.map +1 -1
- package/dist/module/gql/types/graphql.js +27 -21
- package/dist/module/gql/types/graphql.js.map +1 -1
- package/dist/module/gql/types/index.js +27 -2
- package/dist/module/gql/types/index.js.map +1 -1
- package/dist/module/index.js +16 -1
- package/dist/module/index.js.map +1 -1
- package/dist/module/translations/index.js +15 -8
- package/dist/module/translations/index.js.map +1 -1
- package/dist/module/translations/sources/ja.json +1 -1
- package/dist/module/translations/translations.js +7 -1
- package/dist/module/translations/translations.js.map +1 -1
- package/dist/types/gql/getOrderPositionBooks.d.ts +1 -1
- package/dist/types/gql/getPriceCandles.d.ts +1 -1
- package/dist/types/gql/getSentiments.d.ts +1 -1
- package/package.json +8 -4
- package/src/translations/sources/ja.json +1 -1
- package/tsconfig.types.json +2 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getGridConfig.js","names":["
|
|
1
|
+
{"version":3,"file":"getGridConfig.js","names":["_constants","require","getGridConfig","_ref","isDesktop","Y_SENTIMENT_LABEL_DESKTOP_SIZE","Y_SENTIMENT_LABEL_MOBILE_SIZE","Y_LABEL_SIZE_DESKTOP","Y_LABEL_SIZE_MOBILE","TOP_LABEL_SPACE_DESKTOP","TOP_LABEL_SPACE_MOBILE","MAIN_HEIGHT_DESKTOP","MAIN_HEIGHT_MOBILE","TOOLTIP_HEIGHT_MOBILE","TOOLTIP_HEIGHT_DESKTOP","CHART_CONFIG","mainHeight","position","left","right","top","height","id","name","exports"],"sources":["../../../../../../src/CrowdViewWidget/components/Chart/chartOptions/getGridConfig.ts"],"sourcesContent":["import type { GridComponentOption } from 'echarts';\n\nimport { CHART_CONFIG } from '../../../constants';\n\ninterface GetGridConfigParams {\n isDesktop: boolean;\n}\n\nexport const getGridConfig = ({\n isDesktop,\n}: GetGridConfigParams): GridComponentOption[] => {\n const {\n Y_SENTIMENT_LABEL_DESKTOP_SIZE,\n Y_SENTIMENT_LABEL_MOBILE_SIZE,\n Y_LABEL_SIZE_DESKTOP,\n Y_LABEL_SIZE_MOBILE,\n TOP_LABEL_SPACE_DESKTOP,\n TOP_LABEL_SPACE_MOBILE,\n MAIN_HEIGHT_DESKTOP,\n MAIN_HEIGHT_MOBILE,\n TOOLTIP_HEIGHT_MOBILE,\n TOOLTIP_HEIGHT_DESKTOP,\n } = CHART_CONFIG;\n\n const mainHeight = isDesktop ? MAIN_HEIGHT_DESKTOP : MAIN_HEIGHT_MOBILE;\n\n const position = {\n left: `${isDesktop ? Y_SENTIMENT_LABEL_DESKTOP_SIZE : Y_SENTIMENT_LABEL_MOBILE_SIZE}px`,\n right: `${isDesktop ? Y_LABEL_SIZE_DESKTOP : Y_LABEL_SIZE_MOBILE}px`,\n top: `${isDesktop ? TOP_LABEL_SPACE_DESKTOP + TOOLTIP_HEIGHT_DESKTOP : TOP_LABEL_SPACE_MOBILE + TOOLTIP_HEIGHT_MOBILE}px`,\n height: `${mainHeight}px`,\n };\n return [\n {\n id: 'main-grid',\n name: 'main-grid',\n ...position,\n },\n {\n id: 'sentiment-grid',\n name: 'sentiment-grid',\n ...position,\n },\n ];\n};\n"],"mappings":";;;;;;AAEA,IAAAA,UAAA,GAAAC,OAAA;AAMO,MAAMC,aAAa,GAAGC,IAAA,IAEqB;EAAA,IAFpB;IAC5BC;EACmB,CAAC,GAAAD,IAAA;EACpB,MAAM;IACJE,8BAA8B;IAC9BC,6BAA6B;IAC7BC,oBAAoB;IACpBC,mBAAmB;IACnBC,uBAAuB;IACvBC,sBAAsB;IACtBC,mBAAmB;IACnBC,kBAAkB;IAClBC,qBAAqB;IACrBC;EACF,CAAC,GAAGC,uBAAY;EAEhB,MAAMC,UAAU,GAAGZ,SAAS,GAAGO,mBAAmB,GAAGC,kBAAkB;EAEvE,MAAMK,QAAQ,GAAG;IACfC,IAAI,EAAE,GAAGd,SAAS,GAAGC,8BAA8B,GAAGC,6BAA6B,IAAI;IACvFa,KAAK,EAAE,GAAGf,SAAS,GAAGG,oBAAoB,GAAGC,mBAAmB,IAAI;IACpEY,GAAG,EAAE,GAAGhB,SAAS,GAAGK,uBAAuB,GAAGK,sBAAsB,GAAGJ,sBAAsB,GAAGG,qBAAqB,IAAI;IACzHQ,MAAM,EAAE,GAAGL,UAAU;EACvB,CAAC;EACD,OAAO,CACL;IACEM,EAAE,EAAE,WAAW;IACfC,IAAI,EAAE,WAAW;IACjB,GAAGN;EACL,CAAC,EACD;IACEK,EAAE,EAAE,gBAAgB;IACpBC,IAAI,EAAE,gBAAgB;IACtB,GAAGN;EACL,CAAC,CACF;AACH,CAAC;AAACO,OAAA,CAAAtB,aAAA,GAAAA,aAAA","ignoreList":[]}
|
|
@@ -1,6 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getGridLines = void 0;
|
|
7
|
+
var _labsWidgetCommon = require("@oanda/labs-widget-common");
|
|
8
|
+
var _constants = require("../../../constants");
|
|
9
|
+
const getGridLines = _ref => {
|
|
4
10
|
let {
|
|
5
11
|
isDark,
|
|
6
12
|
isDesktop
|
|
@@ -17,14 +23,14 @@ export const getGridLines = _ref => {
|
|
|
17
23
|
Y_LABEL_SIZE_DESKTOP,
|
|
18
24
|
Y_LABEL_SIZE_MOBILE,
|
|
19
25
|
TOP_LABEL_SPACE_MOBILE
|
|
20
|
-
} = CHART_CONFIG;
|
|
26
|
+
} = _constants.CHART_CONFIG;
|
|
21
27
|
const mainHeight = isDesktop ? MAIN_HEIGHT_DESKTOP : MAIN_HEIGHT_MOBILE;
|
|
22
28
|
const ySentimentLabelSize = isDesktop ? Y_SENTIMENT_LABEL_DESKTOP_SIZE : Y_SENTIMENT_LABEL_MOBILE_SIZE;
|
|
23
29
|
const yLabelSize = isDesktop ? Y_LABEL_SIZE_DESKTOP : Y_LABEL_SIZE_MOBILE;
|
|
24
|
-
const topMargin = isDesktop ? CHART_CONFIG.TOP_LABEL_SPACE_DESKTOP + TOOLTIP_HEIGHT_DESKTOP : TOP_LABEL_SPACE_MOBILE + TOOLTIP_HEIGHT_MOBILE;
|
|
30
|
+
const topMargin = isDesktop ? _constants.CHART_CONFIG.TOP_LABEL_SPACE_DESKTOP + TOOLTIP_HEIGHT_DESKTOP : TOP_LABEL_SPACE_MOBILE + TOOLTIP_HEIGHT_MOBILE;
|
|
25
31
|
const tooltipHeight = isDesktop ? TOOLTIP_HEIGHT_DESKTOP : TOOLTIP_HEIGHT_MOBILE;
|
|
26
32
|
return [{
|
|
27
|
-
...getLineCommons(isDark),
|
|
33
|
+
...(0, _labsWidgetCommon.getLineCommons)(isDark),
|
|
28
34
|
top: -2,
|
|
29
35
|
shape: {
|
|
30
36
|
x1: 0,
|
|
@@ -34,7 +40,7 @@ export const getGridLines = _ref => {
|
|
|
34
40
|
},
|
|
35
41
|
z: 30
|
|
36
42
|
}, {
|
|
37
|
-
...getLineCommons(isDark),
|
|
43
|
+
...(0, _labsWidgetCommon.getLineCommons)(isDark),
|
|
38
44
|
right: -2,
|
|
39
45
|
shape: {
|
|
40
46
|
x1: 0,
|
|
@@ -44,7 +50,7 @@ export const getGridLines = _ref => {
|
|
|
44
50
|
},
|
|
45
51
|
z: 30
|
|
46
52
|
}, {
|
|
47
|
-
...getLineCommons(isDark),
|
|
53
|
+
...(0, _labsWidgetCommon.getLineCommons)(isDark),
|
|
48
54
|
bottom: -2,
|
|
49
55
|
shape: {
|
|
50
56
|
x1: 0,
|
|
@@ -54,7 +60,7 @@ export const getGridLines = _ref => {
|
|
|
54
60
|
},
|
|
55
61
|
z: 30
|
|
56
62
|
}, {
|
|
57
|
-
...getLineCommons(isDark),
|
|
63
|
+
...(0, _labsWidgetCommon.getLineCommons)(isDark),
|
|
58
64
|
left: -2,
|
|
59
65
|
shape: {
|
|
60
66
|
x1: 0,
|
|
@@ -64,7 +70,7 @@ export const getGridLines = _ref => {
|
|
|
64
70
|
},
|
|
65
71
|
z: 30
|
|
66
72
|
}, {
|
|
67
|
-
...getLineCommons(isDark),
|
|
73
|
+
...(0, _labsWidgetCommon.getLineCommons)(isDark),
|
|
68
74
|
right: yLabelSize - 3,
|
|
69
75
|
top: topMargin - 2,
|
|
70
76
|
shape: {
|
|
@@ -75,7 +81,7 @@ export const getGridLines = _ref => {
|
|
|
75
81
|
},
|
|
76
82
|
z: 30
|
|
77
83
|
}, {
|
|
78
|
-
...getLineCommons(isDark),
|
|
84
|
+
...(0, _labsWidgetCommon.getLineCommons)(isDark),
|
|
79
85
|
left: ySentimentLabelSize - 2,
|
|
80
86
|
top: topMargin - 2,
|
|
81
87
|
shape: {
|
|
@@ -86,7 +92,7 @@ export const getGridLines = _ref => {
|
|
|
86
92
|
},
|
|
87
93
|
z: 30
|
|
88
94
|
}, {
|
|
89
|
-
...getLineCommons(isDark),
|
|
95
|
+
...(0, _labsWidgetCommon.getLineCommons)(isDark),
|
|
90
96
|
bottom: X_LABEL_SIZE - 3,
|
|
91
97
|
shape: {
|
|
92
98
|
x1: 0,
|
|
@@ -96,7 +102,7 @@ export const getGridLines = _ref => {
|
|
|
96
102
|
},
|
|
97
103
|
z: 30
|
|
98
104
|
}, {
|
|
99
|
-
...getLineCommons(isDark),
|
|
105
|
+
...(0, _labsWidgetCommon.getLineCommons)(isDark),
|
|
100
106
|
top: topMargin - 3,
|
|
101
107
|
shape: {
|
|
102
108
|
x1: 0,
|
|
@@ -106,7 +112,7 @@ export const getGridLines = _ref => {
|
|
|
106
112
|
},
|
|
107
113
|
z: 30
|
|
108
114
|
}, {
|
|
109
|
-
...getLineCommons(isDark),
|
|
115
|
+
...(0, _labsWidgetCommon.getLineCommons)(isDark),
|
|
110
116
|
top: tooltipHeight - 3,
|
|
111
117
|
shape: {
|
|
112
118
|
x1: 0,
|
|
@@ -117,4 +123,5 @@ export const getGridLines = _ref => {
|
|
|
117
123
|
z: 30
|
|
118
124
|
}];
|
|
119
125
|
};
|
|
126
|
+
exports.getGridLines = getGridLines;
|
|
120
127
|
//# sourceMappingURL=getGridLines.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getGridLines.js","names":["
|
|
1
|
+
{"version":3,"file":"getGridLines.js","names":["_labsWidgetCommon","require","_constants","getGridLines","_ref","isDark","isDesktop","WIDTH","MAIN_HEIGHT_DESKTOP","MAIN_HEIGHT_MOBILE","X_LABEL_SIZE","TOOLTIP_HEIGHT_MOBILE","TOOLTIP_HEIGHT_DESKTOP","Y_SENTIMENT_LABEL_DESKTOP_SIZE","Y_SENTIMENT_LABEL_MOBILE_SIZE","Y_LABEL_SIZE_DESKTOP","Y_LABEL_SIZE_MOBILE","TOP_LABEL_SPACE_MOBILE","CHART_CONFIG","mainHeight","ySentimentLabelSize","yLabelSize","topMargin","TOP_LABEL_SPACE_DESKTOP","tooltipHeight","getLineCommons","top","shape","x1","y1","x2","y2","z","right","bottom","left","exports"],"sources":["../../../../../../src/CrowdViewWidget/components/Chart/chartOptions/getGridLines.ts"],"sourcesContent":["import { getLineCommons } from '@oanda/labs-widget-common';\nimport type { GraphicComponentOption } from 'echarts';\n\nimport { CHART_CONFIG } from '../../../constants';\n\ninterface GetGridLinesParams {\n isDark: boolean;\n isDesktop: boolean;\n}\n\nexport const getGridLines = ({\n isDark,\n isDesktop,\n}: GetGridLinesParams): GraphicComponentOption[] => {\n const {\n WIDTH,\n MAIN_HEIGHT_DESKTOP,\n MAIN_HEIGHT_MOBILE,\n X_LABEL_SIZE,\n TOOLTIP_HEIGHT_MOBILE,\n TOOLTIP_HEIGHT_DESKTOP,\n Y_SENTIMENT_LABEL_DESKTOP_SIZE,\n Y_SENTIMENT_LABEL_MOBILE_SIZE,\n Y_LABEL_SIZE_DESKTOP,\n Y_LABEL_SIZE_MOBILE,\n TOP_LABEL_SPACE_MOBILE,\n } = CHART_CONFIG;\n\n const mainHeight = isDesktop ? MAIN_HEIGHT_DESKTOP : MAIN_HEIGHT_MOBILE;\n const ySentimentLabelSize = isDesktop\n ? Y_SENTIMENT_LABEL_DESKTOP_SIZE\n : Y_SENTIMENT_LABEL_MOBILE_SIZE;\n\n const yLabelSize = isDesktop ? Y_LABEL_SIZE_DESKTOP : Y_LABEL_SIZE_MOBILE;\n\n const topMargin = isDesktop\n ? CHART_CONFIG.TOP_LABEL_SPACE_DESKTOP + TOOLTIP_HEIGHT_DESKTOP\n : TOP_LABEL_SPACE_MOBILE + TOOLTIP_HEIGHT_MOBILE;\n\n const tooltipHeight = isDesktop\n ? TOOLTIP_HEIGHT_DESKTOP\n : TOOLTIP_HEIGHT_MOBILE;\n\n return [\n // Top\n {\n ...getLineCommons(isDark),\n top: -2,\n shape: {\n x1: 0,\n y1: 0,\n x2: WIDTH,\n y2: 0,\n },\n z: 30,\n },\n // Right\n {\n ...getLineCommons(isDark),\n right: -2,\n shape: {\n x1: 0,\n y1: 0,\n x2: 0,\n y2: mainHeight + topMargin + X_LABEL_SIZE + 2,\n },\n z: 30,\n },\n // Bottom\n {\n ...getLineCommons(isDark),\n bottom: -2,\n shape: {\n x1: 0,\n y1: 0,\n x2: WIDTH,\n y2: 0,\n },\n z: 30,\n },\n // Left\n {\n ...getLineCommons(isDark),\n left: -2,\n shape: {\n x1: 0,\n y1: 0,\n x2: 0,\n y2: mainHeight + X_LABEL_SIZE + topMargin + 2,\n },\n z: 30,\n },\n // Y Label\n {\n ...getLineCommons(isDark),\n right: yLabelSize - 3,\n top: topMargin - 2,\n shape: {\n x1: 0,\n y1: 0,\n x2: 0,\n y2: mainHeight,\n },\n z: 30,\n },\n // Y Sentiment Label\n {\n ...getLineCommons(isDark),\n left: ySentimentLabelSize - 2,\n top: topMargin - 2,\n shape: {\n x1: 0,\n y1: 0,\n x2: 0,\n y2: mainHeight,\n },\n z: 30,\n },\n // X Label\n {\n ...getLineCommons(isDark),\n bottom: X_LABEL_SIZE - 3,\n shape: {\n x1: 0,\n y1: 0,\n x2: WIDTH,\n y2: 0,\n },\n z: 30,\n },\n // X Mobile Label\n {\n ...getLineCommons(isDark),\n top: topMargin - 3,\n shape: {\n x1: 0,\n y1: 0,\n x2: WIDTH,\n y2: 0,\n },\n z: 30,\n },\n // Mobile tooltip,\n {\n ...getLineCommons(isDark),\n top: tooltipHeight - 3,\n shape: {\n x1: 0,\n y1: 0,\n x2: WIDTH,\n y2: 0,\n },\n z: 30,\n },\n ];\n};\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AAGA,IAAAC,UAAA,GAAAD,OAAA;AAOO,MAAME,YAAY,GAAGC,IAAA,IAGwB;EAAA,IAHvB;IAC3BC,MAAM;IACNC;EACkB,CAAC,GAAAF,IAAA;EACnB,MAAM;IACJG,KAAK;IACLC,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AAC;IAClBK,KAAK,EAAE;MACLC,EAAE,EAAE,CAAC;MACLC,EAAE,EAAE,CAAC;MACLC,EAAE,EAAEvB,KAAK;MACTwB,EAAE,EAAE;IACN,CAAC;IACDC,CAAC,EAAE;EACL,CAAC,EAED;IACE,GAAG,IAAAP,gCAAc,EAACpB,MAAM,CAAC;IACzBqB,GAAG,EAAEF,aAAa,GAAG,CAAC;IACtBG,KAAK,EAAE;MACLC,EAAE,EAAE,CAAC;MACLC,EAAE,EAAE,CAAC;MACLC,EAAE,EAAEvB,KAAK;MACTwB,EAAE,EAAE;IACN,CAAC;IACDC,CAAC,EAAE;EACL,CAAC,CACF;AACH,CAAC;AAACI,OAAA,CAAAjC,YAAA,GAAAA,YAAA","ignoreList":[]}
|
|
@@ -1,29 +1,36 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getLabelsConfig = void 0;
|
|
7
|
+
var _labsWidgetCommon = require("@oanda/labs-widget-common");
|
|
8
|
+
var _monoI18n = require("@oanda/mono-i18n");
|
|
9
|
+
var _chromaJs = _interopRequireDefault(require("chroma-js"));
|
|
10
|
+
var _constants = require("../../../constants");
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
+
const getLabelsConfig = _ref => {
|
|
6
13
|
let {
|
|
7
14
|
isDark,
|
|
8
15
|
isDesktop,
|
|
9
16
|
locale,
|
|
10
17
|
labelCallback
|
|
11
18
|
} = _ref;
|
|
12
|
-
const isJapanese = locale === Locale.ja;
|
|
13
|
-
const ySentimentLabelSize = isDesktop ? CHART_CONFIG.Y_SENTIMENT_LABEL_DESKTOP_SIZE : CHART_CONFIG.Y_SENTIMENT_LABEL_MOBILE_SIZE;
|
|
14
|
-
const yMainLabelSize = isDesktop ? CHART_CONFIG.Y_LABEL_SIZE_DESKTOP : CHART_CONFIG.Y_LABEL_SIZE_MOBILE;
|
|
15
|
-
const textColor = isDark ? colorPalette.white : colorPalette.black;
|
|
16
|
-
const labelBackgroundColor = isDark ? colorPalette.darkGray : colorPalette.white;
|
|
17
|
-
const backgroundColor = isDark ? colorPalette.black : colorPalette.white;
|
|
18
|
-
const shadowColor =
|
|
19
|
+
const isJapanese = locale === _monoI18n.Locale.ja;
|
|
20
|
+
const ySentimentLabelSize = isDesktop ? _constants.CHART_CONFIG.Y_SENTIMENT_LABEL_DESKTOP_SIZE : _constants.CHART_CONFIG.Y_SENTIMENT_LABEL_MOBILE_SIZE;
|
|
21
|
+
const yMainLabelSize = isDesktop ? _constants.CHART_CONFIG.Y_LABEL_SIZE_DESKTOP : _constants.CHART_CONFIG.Y_LABEL_SIZE_MOBILE;
|
|
22
|
+
const textColor = isDark ? _labsWidgetCommon.colorPalette.white : _labsWidgetCommon.colorPalette.black;
|
|
23
|
+
const labelBackgroundColor = isDark ? _labsWidgetCommon.colorPalette.darkGray : _labsWidgetCommon.colorPalette.white;
|
|
24
|
+
const backgroundColor = isDark ? _labsWidgetCommon.colorPalette.black : _labsWidgetCommon.colorPalette.white;
|
|
25
|
+
const shadowColor = (0, _chromaJs.default)(_labsWidgetCommon.colorPalette.black).alpha(0.1).hex();
|
|
19
26
|
const sentimentText = isJapanese && isDesktop ? labelCallback('sentiment').split('').join('\n') : labelCallback('sentiment').toUpperCase();
|
|
20
27
|
const priceText = isJapanese && isDesktop ? labelCallback('price').split('').join('\n') : labelCallback('price').toUpperCase();
|
|
21
28
|
const sentimentEstimatedWidth = 10 * sentimentText.length * 0.65;
|
|
22
29
|
const priceEstimatedWidth = 10 * priceText.length * 0.65;
|
|
23
30
|
const sentimentVerticalOffset = sentimentEstimatedWidth / 2;
|
|
24
31
|
const priceVerticalOffset = priceEstimatedWidth / 2;
|
|
25
|
-
const topMargin = isDesktop ? CHART_CONFIG.TOP_LABEL_SPACE_DESKTOP + CHART_CONFIG.TOOLTIP_HEIGHT_DESKTOP : CHART_CONFIG.TOP_LABEL_SPACE_MOBILE + CHART_CONFIG.TOOLTIP_HEIGHT_MOBILE;
|
|
26
|
-
const mainHeight = isDesktop ? CHART_CONFIG.MAIN_HEIGHT_DESKTOP : CHART_CONFIG.MAIN_HEIGHT_MOBILE;
|
|
32
|
+
const topMargin = isDesktop ? _constants.CHART_CONFIG.TOP_LABEL_SPACE_DESKTOP + _constants.CHART_CONFIG.TOOLTIP_HEIGHT_DESKTOP : _constants.CHART_CONFIG.TOP_LABEL_SPACE_MOBILE + _constants.CHART_CONFIG.TOOLTIP_HEIGHT_MOBILE;
|
|
33
|
+
const mainHeight = isDesktop ? _constants.CHART_CONFIG.MAIN_HEIGHT_DESKTOP : _constants.CHART_CONFIG.MAIN_HEIGHT_MOBILE;
|
|
27
34
|
return [{
|
|
28
35
|
type: 'group',
|
|
29
36
|
left: `${ySentimentLabelSize + 5}px'`,
|
|
@@ -154,7 +161,7 @@ export const getLabelsConfig = _ref => {
|
|
|
154
161
|
type: 'text',
|
|
155
162
|
z: 20,
|
|
156
163
|
left: 'center',
|
|
157
|
-
top: isDesktop ? CHART_CONFIG.TOOLTIP_HEIGHT_DESKTOP / 2 - 5 : CHART_CONFIG.TOOLTIP_HEIGHT_MOBILE / 2 - 5,
|
|
164
|
+
top: isDesktop ? _constants.CHART_CONFIG.TOOLTIP_HEIGHT_DESKTOP / 2 - 5 : _constants.CHART_CONFIG.TOOLTIP_HEIGHT_MOBILE / 2 - 5,
|
|
158
165
|
silent: true,
|
|
159
166
|
style: {
|
|
160
167
|
fontSize: isDesktop ? 12 : 11,
|
|
@@ -163,4 +170,5 @@ export const getLabelsConfig = _ref => {
|
|
|
163
170
|
}
|
|
164
171
|
}];
|
|
165
172
|
};
|
|
173
|
+
exports.getLabelsConfig = getLabelsConfig;
|
|
166
174
|
//# sourceMappingURL=getLabelsConfig.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getLabelsConfig.js","names":["colorPalette","Locale","chroma","CHART_CONFIG","getLabelsConfig","_ref","isDark","isDesktop","locale","labelCallback","isJapanese","ja","ySentimentLabelSize","Y_SENTIMENT_LABEL_DESKTOP_SIZE","Y_SENTIMENT_LABEL_MOBILE_SIZE","yMainLabelSize","Y_LABEL_SIZE_DESKTOP","Y_LABEL_SIZE_MOBILE","textColor","white","black","labelBackgroundColor","darkGray","backgroundColor","shadowColor","alpha","hex","sentimentText","split","join","toUpperCase","priceText","sentimentEstimatedWidth","length","priceEstimatedWidth","sentimentVerticalOffset","priceVerticalOffset","topMargin","TOP_LABEL_SPACE_DESKTOP","TOOLTIP_HEIGHT_DESKTOP","TOP_LABEL_SPACE_MOBILE","TOOLTIP_HEIGHT_MOBILE","mainHeight","MAIN_HEIGHT_DESKTOP","MAIN_HEIGHT_MOBILE","type","left","top","silent","children","z","right","shape","width","height","style","fill","shadowBlur","shadowOffsetX","shadowOffsetY","fontSize","fontFamily","fontWeight","text","rotation","Math","PI"],"sources":["../../../../../../src/CrowdViewWidget/components/Chart/chartOptions/getLabelsConfig.ts"],"sourcesContent":["import { colorPalette } from '@oanda/labs-widget-common';\nimport { Locale } from '@oanda/mono-i18n';\nimport chroma from 'chroma-js';\nimport type { GraphicComponentOption } from 'echarts';\n\nimport { CHART_CONFIG } from '../../../constants';\n\ninterface getLabelsConfigParams {\n isDark: boolean;\n isDesktop: boolean;\n locale: string;\n labelCallback: (key: string, params?: Record<string, unknown>) => string;\n}\n\nexport const getLabelsConfig = ({\n isDark,\n isDesktop,\n locale,\n labelCallback,\n}: getLabelsConfigParams): GraphicComponentOption[] => {\n const isJapanese = locale === Locale.ja;\n\n const ySentimentLabelSize = isDesktop\n ? CHART_CONFIG.Y_SENTIMENT_LABEL_DESKTOP_SIZE\n : CHART_CONFIG.Y_SENTIMENT_LABEL_MOBILE_SIZE;\n\n const yMainLabelSize = isDesktop\n ? CHART_CONFIG.Y_LABEL_SIZE_DESKTOP\n : CHART_CONFIG.Y_LABEL_SIZE_MOBILE;\n\n const textColor = isDark ? colorPalette.white : colorPalette.black;\n const labelBackgroundColor = isDark\n ? colorPalette.darkGray\n : colorPalette.white;\n const backgroundColor = isDark ? colorPalette.black : colorPalette.white;\n const shadowColor = chroma(colorPalette.black).alpha(0.1).hex();\n\n const sentimentText =\n isJapanese && isDesktop\n ? labelCallback('sentiment').split('').join('\\n')\n : labelCallback('sentiment').toUpperCase();\n const priceText =\n isJapanese && isDesktop\n ? labelCallback('price').split('').join('\\n')\n : labelCallback('price').toUpperCase();\n\n // Estimate text width for centering rotated text\n // Approximate: fontSize * characterCount * 0.65 (typical character width ratio)\n const sentimentEstimatedWidth = 10 * sentimentText.length * 0.65;\n const priceEstimatedWidth = 10 * priceText.length * 0.65;\n const sentimentVerticalOffset = sentimentEstimatedWidth / 2;\n const priceVerticalOffset = priceEstimatedWidth / 2;\n\n const topMargin = isDesktop\n ? CHART_CONFIG.TOP_LABEL_SPACE_DESKTOP + CHART_CONFIG.TOOLTIP_HEIGHT_DESKTOP\n : CHART_CONFIG.TOP_LABEL_SPACE_MOBILE + CHART_CONFIG.TOOLTIP_HEIGHT_MOBILE;\n\n const mainHeight = isDesktop\n ? CHART_CONFIG.MAIN_HEIGHT_DESKTOP\n : CHART_CONFIG.MAIN_HEIGHT_MOBILE;\n\n return [\n {\n type: 'group',\n left: `${ySentimentLabelSize + 5}px'`,\n top: `${topMargin + 5}px`,\n silent: true,\n children: [\n {\n type: 'rect',\n z: 100,\n right: 'center',\n top: 'middle',\n shape: {\n width: 50,\n height: 24,\n },\n style: {\n fill: labelBackgroundColor,\n shadowBlur: 8,\n shadowOffsetX: 0,\n shadowOffsetY: 1,\n shadowColor: shadowColor,\n },\n },\n {\n type: 'text',\n z: 100,\n right: 'center',\n top: 'middle',\n style: {\n fontSize: 11,\n fontFamily: 'Sofia W03',\n fontWeight: 500,\n fill: textColor,\n width: 70,\n height: 30,\n text: labelCallback('short'),\n },\n },\n ],\n },\n {\n type: 'group',\n left: `${ySentimentLabelSize + 5}px'`,\n top: `${topMargin + mainHeight - 24 - 5}px`,\n silent: true,\n children: [\n {\n type: 'rect',\n z: 100,\n right: 'center',\n top: 'middle',\n shape: {\n width: 50,\n height: 24,\n },\n style: {\n fill: labelBackgroundColor,\n shadowBlur: 8,\n shadowOffsetX: 0,\n shadowOffsetY: 1,\n shadowColor: shadowColor,\n },\n },\n {\n type: 'text',\n z: 100,\n right: 'center',\n top: 'middle',\n style: {\n fontSize: 11,\n fontFamily: 'Sofia W03',\n fontWeight: 500,\n fill: textColor,\n width: 70,\n height: 30,\n text: labelCallback('long'),\n },\n },\n ],\n },\n\n {\n type: 'text',\n z: 30,\n rotation: !isJapanese && isDesktop ? Math.PI / 2 : 0,\n left: `5px`,\n top: isDesktop\n ? `${topMargin + mainHeight / 2 - sentimentVerticalOffset}px`\n : `${topMargin - 16}px`,\n silent: true,\n style: {\n fontSize: 10,\n fontFamily: 'Sofia W03',\n fontWeight: 300,\n fill: textColor,\n text: sentimentText,\n },\n },\n {\n type: 'text',\n z: 30,\n rotation: !isJapanese && isDesktop ? -Math.PI / 2 : 0,\n right: `5px`,\n top: isDesktop\n ? `${topMargin + mainHeight / 2 - priceVerticalOffset}px`\n : `${topMargin - 16}px`,\n silent: true,\n style: {\n fontSize: 10,\n fontFamily: 'Sofia W03',\n fontWeight: 300,\n fill: textColor,\n text: priceText,\n },\n },\n {\n type: 'rect',\n z: 20,\n right: '0px',\n top: `${topMargin}px`,\n shape: {\n width: yMainLabelSize,\n height: mainHeight,\n },\n silent: true,\n style: {\n fill: backgroundColor,\n },\n },\n {\n type: 'rect',\n z: 20,\n left: '0px',\n top: `${topMargin}px`,\n shape: {\n width: ySentimentLabelSize,\n height: mainHeight,\n },\n silent: true,\n style: {\n fill: backgroundColor,\n },\n },\n {\n type: 'text',\n z: 20,\n left: 'center',\n top: isDesktop\n ? CHART_CONFIG.TOOLTIP_HEIGHT_DESKTOP / 2 - 5\n : CHART_CONFIG.TOOLTIP_HEIGHT_MOBILE / 2 - 5,\n silent: true,\n style: {\n fontSize: isDesktop ? 12 : 11,\n fill: textColor,\n text: isDesktop\n ? labelCallback('hover_chart_to_see_more_details')\n : labelCallback('tap_chart_to_see_more_details'),\n },\n },\n ];\n};\n"],"mappings":"AAAA,SAASA,YAAY,QAAQ,2BAA2B;AACxD,SAASC,MAAM,QAAQ,kBAAkB;AACzC,OAAOC,MAAM,MAAM,WAAW;AAG9B,SAASC,YAAY,QAAQ,oBAAoB;AASjD,OAAO,MAAMC,eAAe,GAAGC,IAAA,IAKwB;EAAA,IALvB;IAC9BC,MAAM;IACNC,SAAS;IACTC,MAAM;IACNC;EACqB,CAAC,GAAAJ,IAAA;EACtB,MAAMK,UAAU,GAAGF,MAAM,KAAKP,MAAM,CAACU,EAAE;EAEvC,MAAMC,mBAAmB,GAAGL,SAAS,GACjCJ,YAAY,CAACU,8BAA8B,GAC3CV,YAAY,CAACW,6BAA6B;EAE9C,MAAMC,cAAc,GAAGR,SAAS,GAC5BJ,YAAY,CAACa,oBAAoB,GACjCb,YAAY,CAACc,mBAAmB;EAEpC,MAAMC,SAAS,GAAGZ,MAAM,GAAGN,YAAY,CAACmB,KAAK,GAAGnB,YAAY,CAACoB,KAAK;EAClE,MAAMC,oBAAoB,GAAGf,MAAM,GAC/BN,YAAY,CAACsB,QAAQ,GACrBtB,YAAY,CAACmB,KAAK;EACtB,MAAMI,eAAe,GAAGjB,MAAM,GAAGN,YAAY,CAACoB,KAAK,GAAGpB,YAAY,CAACmB,KAAK;EACxE,MAAMK,WAAW,GAAGtB,MAAM,CAACF,YAAY,CAACoB,KAAK,CAAC,CAACK,KAAK,CAAC,GAAG,CAAC,CAACC,GAAG,CAAC,CAAC;EAE/D,MAAMC,aAAa,GACjBjB,UAAU,IAAIH,SAAS,GACnBE,aAAa,CAAC,WAAW,CAAC,CAACmB,KAAK,CAAC,EAAE,CAAC,CAACC,IAAI,CAAC,IAAI,CAAC,GAC/CpB,aAA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I;IACZO,KAAK,EAAE;MACLC,IAAI,EAAEjC;IACR;EACF,CAAC,EACD;IACEsB,IAAI,EAAE,MAAM;IACZK,CAAC,EAAE,EAAE;IACLJ,IAAI,EAAE,KAAK;IACXC,GAAG,EAAE,GAAGV,SAAS,IAAI;IACrBe,KAAK,EAAE;MACLC,KAAK,EAAEzC,mBAAmB;MAC1B0C,MAAM,EAAEZ;IACV,CAAC;IACDM,MAAM,EAAE,IAAI;IACZO,KAAK,EAAE;MACLC,IAAI,EAAEjC;IACR;EACF,CAAC,EACD;IACEsB,IAAI,EAAE,MAAM;IACZK,CAAC,EAAE,EAAE;IACLJ,IAAI,EAAE,QAAQ;IACdC,GAAG,EAAExC,SAAS,GACVJ,YAAY,CAACoC,sBAAsB,GAAG,CAAC,GAAG,CAAC,GAC3CpC,YAAY,CAACsC,qBAAqB,GAAG,CAAC,GAAG,CAAC;IAC9CO,MAAM,EAAE,IAAI;IACZO,KAAK,EAAE;MACLK,QAAQ,EAAErD,SAAS,GAAG,EAAE,GAAG,EAAE;MAC7BiD,IAAI,EAAEtC,SAAS;MACf6C,IAAI,EAAExD,SAAS,GACXE,aAAa,CAAC,iCAAiC,CAAC,GAChDA,aAAa,CAAC,+BAA+B;IACnD;EACF,CAAC,CACF;AACH,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"getLabelsConfig.js","names":["_labsWidgetCommon","require","_monoI18n","_chromaJs","_interopRequireDefault","_constants","e","__esModule","default","getLabelsConfig","_ref","isDark","isDesktop","locale","labelCallback","isJapanese","Locale","ja","ySentimentLabelSize","CHART_CONFIG","Y_SENTIMENT_LABEL_DESKTOP_SIZE","Y_SENTIMENT_LABEL_MOBILE_SIZE","yMainLabelSize","Y_LABEL_SIZE_DESKTOP","Y_LABEL_SIZE_MOBILE","textColor","colorPalette","white","black","labelBackgroundColor","darkGray","backgroundColor","shadowColor","chroma","alpha","hex","sentimentText","split","join","toUpperCase","priceText","sentimentEstimatedWidth","length","priceEstimatedWidth","sentimentVerticalOffset","priceVerticalOffset","topMargin","TOP_LABEL_SPACE_DESKTOP","TOOLTIP_HEIGHT_DESKTOP","TOP_LABEL_SPACE_MOBILE","TOOLTIP_HEIGHT_MOBILE","mainHeight","MAIN_HEIGHT_DESKTOP","MAIN_HEIGHT_MOBILE","type","left","top","silent","children","z","right","shape","width","height","style","fill","shadowBlur","shadowOffsetX","shadowOffsetY","fontSize","fontFamily","fontWeight","text","rotation","Math","PI","exports"],"sources":["../../../../../../src/CrowdViewWidget/components/Chart/chartOptions/getLabelsConfig.ts"],"sourcesContent":["import { colorPalette } from '@oanda/labs-widget-common';\nimport { Locale } from '@oanda/mono-i18n';\nimport chroma from 'chroma-js';\nimport type { GraphicComponentOption } from 'echarts';\n\nimport { CHART_CONFIG } from '../../../constants';\n\ninterface getLabelsConfigParams {\n isDark: boolean;\n isDesktop: boolean;\n locale: string;\n labelCallback: (key: string, params?: Record<string, unknown>) => string;\n}\n\nexport const getLabelsConfig = ({\n isDark,\n isDesktop,\n locale,\n labelCallback,\n}: getLabelsConfigParams): GraphicComponentOption[] => {\n const isJapanese = locale === Locale.ja;\n\n const ySentimentLabelSize = isDesktop\n ? CHART_CONFIG.Y_SENTIMENT_LABEL_DESKTOP_SIZE\n : CHART_CONFIG.Y_SENTIMENT_LABEL_MOBILE_SIZE;\n\n const yMainLabelSize = isDesktop\n ? CHART_CONFIG.Y_LABEL_SIZE_DESKTOP\n : CHART_CONFIG.Y_LABEL_SIZE_MOBILE;\n\n const textColor = isDark ? colorPalette.white : colorPalette.black;\n const labelBackgroundColor = isDark\n ? colorPalette.darkGray\n : colorPalette.white;\n const backgroundColor = isDark ? colorPalette.black : colorPalette.white;\n const shadowColor = chroma(colorPalette.black).alpha(0.1).hex();\n\n const sentimentText =\n isJapanese && isDesktop\n ? labelCallback('sentiment').split('').join('\\n')\n : labelCallback('sentiment').toUpperCase();\n const priceText =\n isJapanese && isDesktop\n ? labelCallback('price').split('').join('\\n')\n : labelCallback('price').toUpperCase();\n\n // Estimate text width for centering rotated text\n // Approximate: fontSize * characterCount * 0.65 (typical character width ratio)\n const sentimentEstimatedWidth = 10 * sentimentText.length * 0.65;\n const priceEstimatedWidth = 10 * priceText.length * 0.65;\n const sentimentVerticalOffset = sentimentEstimatedWidth / 2;\n const priceVerticalOffset = priceEstimatedWidth / 2;\n\n const topMargin = isDesktop\n ? CHART_CONFIG.TOP_LABEL_SPACE_DESKTOP + CHART_CONFIG.TOOLTIP_HEIGHT_DESKTOP\n : CHART_CONFIG.TOP_LABEL_SPACE_MOBILE + CHART_CONFIG.TOOLTIP_HEIGHT_MOBILE;\n\n const mainHeight = isDesktop\n ? CHART_CONFIG.MAIN_HEIGHT_DESKTOP\n : CHART_CONFIG.MAIN_HEIGHT_MOBILE;\n\n return [\n {\n type: 'group',\n left: `${ySentimentLabelSize + 5}px'`,\n top: `${topMargin + 5}px`,\n silent: true,\n children: [\n {\n type: 'rect',\n z: 100,\n right: 'center',\n top: 'middle',\n shape: {\n width: 50,\n height: 24,\n },\n style: {\n fill: labelBackgroundColor,\n shadowBlur: 8,\n shadowOffsetX: 0,\n shadowOffsetY: 1,\n shadowColor: shadowColor,\n },\n },\n {\n type: 'text',\n z: 100,\n right: 'center',\n top: 'middle',\n style: {\n fontSize: 11,\n fontFamily: 'Sofia W03',\n fontWeight: 500,\n fill: textColor,\n width: 70,\n height: 30,\n text: labelCallback('short'),\n },\n },\n ],\n },\n {\n type: 'group',\n left: `${ySentimentLabelSize + 5}px'`,\n top: `${topMargin + mainHeight - 24 - 5}px`,\n silent: true,\n children: [\n {\n type: 'rect',\n z: 100,\n right: 'center',\n top: 'middle',\n shape: {\n width: 50,\n height: 24,\n },\n style: {\n fill: labelBackgroundColor,\n shadowBlur: 8,\n shadowOffsetX: 0,\n shadowOffsetY: 1,\n shadowColor: shadowColor,\n },\n },\n {\n type: 'text',\n z: 100,\n right: 'center',\n top: 'middle',\n style: {\n fontSize: 11,\n fontFamily: 'Sofia W03',\n fontWeight: 500,\n fill: textColor,\n width: 70,\n height: 30,\n text: labelCallback('long'),\n },\n },\n ],\n },\n\n {\n type: 'text',\n z: 30,\n rotation: !isJapanese && isDesktop ? Math.PI / 2 : 0,\n left: `5px`,\n top: isDesktop\n ? `${topMargin + mainHeight / 2 - sentimentVerticalOffset}px`\n : `${topMargin - 16}px`,\n silent: true,\n style: {\n fontSize: 10,\n fontFamily: 'Sofia W03',\n fontWeight: 300,\n fill: textColor,\n text: sentimentText,\n },\n },\n {\n type: 'text',\n z: 30,\n rotation: !isJapanese && isDesktop ? -Math.PI / 2 : 0,\n right: `5px`,\n top: isDesktop\n ? `${topMargin + mainHeight / 2 - priceVerticalOffset}px`\n : `${topMargin - 16}px`,\n silent: true,\n style: {\n fontSize: 10,\n fontFamily: 'Sofia W03',\n fontWeight: 300,\n fill: textColor,\n text: priceText,\n },\n },\n {\n type: 'rect',\n z: 20,\n right: '0px',\n top: `${topMargin}px`,\n shape: {\n width: yMainLabelSize,\n height: mainHeight,\n },\n silent: true,\n style: {\n fill: backgroundColor,\n },\n },\n {\n type: 'rect',\n z: 20,\n left: '0px',\n top: `${topMargin}px`,\n shape: {\n width: ySentimentLabelSize,\n height: mainHeight,\n },\n silent: true,\n style: {\n fill: backgroundColor,\n },\n },\n {\n type: 'text',\n z: 20,\n left: 'center',\n top: isDesktop\n ? CHART_CONFIG.TOOLTIP_HEIGHT_DESKTOP / 2 - 5\n : CHART_CONFIG.TOOLTIP_HEIGHT_MOBILE / 2 - 5,\n silent: true,\n style: {\n fontSize: isDesktop ? 12 : 11,\n fill: textColor,\n text: isDesktop\n ? labelCallback('hover_chart_to_see_more_details')\n : labelCallback('tap_chart_to_see_more_details'),\n },\n },\n ];\n};\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAC,sBAAA,CAAAH,OAAA;AAGA,IAAAI,UAAA,GAAAJ,OAAA;AAAkD,SAAAG,uBAAA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MAC1B6C,MAAM,EAAEZ;IACV,CAAC;IACDM,MAAM,EAAE,IAAI;IACZO,KAAK,EAAE;MACLC,IAAI,EAAElC;IACR;EACF,CAAC,EACD;IACEuB,IAAI,EAAE,MAAM;IACZK,CAAC,EAAE,EAAE;IACLJ,IAAI,EAAE,QAAQ;IACdC,GAAG,EAAE5C,SAAS,GACVO,uBAAY,CAAC6B,sBAAsB,GAAG,CAAC,GAAG,CAAC,GAC3C7B,uBAAY,CAAC+B,qBAAqB,GAAG,CAAC,GAAG,CAAC;IAC9CO,MAAM,EAAE,IAAI;IACZO,KAAK,EAAE;MACLK,QAAQ,EAAEzD,SAAS,GAAG,EAAE,GAAG,EAAE;MAC7BqD,IAAI,EAAExC,SAAS;MACf+C,IAAI,EAAE5D,SAAS,GACXE,aAAa,CAAC,iCAAiC,CAAC,GAChDA,aAAa,CAAC,+BAA+B;IACnD;EACF,CAAC,CACF;AACH,CAAC;AAAC8D,OAAA,CAAAnE,eAAA,GAAAA,eAAA","ignoreList":[]}
|
package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getSeriesCandlestickConfig.js
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getSeriesCandlestickConfig = void 0;
|
|
7
|
+
var _monoI18n = require("@oanda/mono-i18n");
|
|
8
|
+
var _chromaJs = _interopRequireDefault(require("chroma-js"));
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
const getSeriesCandlestickConfig = _ref => {
|
|
4
11
|
let {
|
|
5
12
|
styles,
|
|
6
13
|
isLoading,
|
|
@@ -10,15 +17,15 @@ export const getSeriesCandlestickConfig = _ref => {
|
|
|
10
17
|
candleLongColor,
|
|
11
18
|
candleShortColor
|
|
12
19
|
} = styles;
|
|
13
|
-
const isJapanese = locale === Locale.ja;
|
|
20
|
+
const isJapanese = locale === _monoI18n.Locale.ja;
|
|
14
21
|
const itemStyle = isJapanese ? {
|
|
15
|
-
color:
|
|
16
|
-
color0:
|
|
22
|
+
color: (0, _chromaJs.default)(candleShortColor).desaturate().css(),
|
|
23
|
+
color0: (0, _chromaJs.default)(candleLongColor).desaturate().css(),
|
|
17
24
|
borderColor: candleShortColor,
|
|
18
25
|
borderColor0: candleLongColor
|
|
19
26
|
} : {
|
|
20
|
-
color:
|
|
21
|
-
color0:
|
|
27
|
+
color: (0, _chromaJs.default)(candleLongColor).desaturate().css(),
|
|
28
|
+
color0: (0, _chromaJs.default)(candleShortColor).desaturate().css(),
|
|
22
29
|
borderColor: candleLongColor,
|
|
23
30
|
borderColor0: candleShortColor
|
|
24
31
|
};
|
|
@@ -45,4 +52,5 @@ export const getSeriesCandlestickConfig = _ref => {
|
|
|
45
52
|
z: 3
|
|
46
53
|
};
|
|
47
54
|
};
|
|
55
|
+
exports.getSeriesCandlestickConfig = getSeriesCandlestickConfig;
|
|
48
56
|
//# sourceMappingURL=getSeriesCandlestickConfig.js.map
|
package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getSeriesCandlestickConfig.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getSeriesCandlestickConfig.js","names":["
|
|
1
|
+
{"version":3,"file":"getSeriesCandlestickConfig.js","names":["_monoI18n","require","_chromaJs","_interopRequireDefault","e","__esModule","default","getSeriesCandlestickConfig","_ref","styles","isLoading","locale","candleLongColor","candleShortColor","isJapanese","Locale","ja","itemStyle","color","chroma","desaturate","css","color0","borderColor","borderColor0","animation","type","id","xAxisIndex","yAxisIndex","silent","clip","large","encode","x","y","emphasis","z","exports"],"sources":["../../../../../../src/CrowdViewWidget/components/Chart/chartOptions/getSeriesCandlestickConfig.ts"],"sourcesContent":["import { Locale } from '@oanda/mono-i18n';\nimport chroma from 'chroma-js';\nimport type { CandlestickSeriesOption } from 'echarts';\n\nimport type { ChartStyles } from '../chartUtils/getChartStyles';\n\ninterface GetSeriesCandlestickConfigParams {\n styles: ChartStyles;\n isLoading: boolean;\n locale: string;\n}\n\nexport const getSeriesCandlestickConfig = ({\n styles,\n isLoading,\n locale,\n}: GetSeriesCandlestickConfigParams): CandlestickSeriesOption => {\n const { candleLongColor, candleShortColor } = styles;\n const isJapanese = locale === Locale.ja;\n\n const itemStyle = isJapanese\n ? {\n color: chroma(candleShortColor).desaturate().css(),\n color0: chroma(candleLongColor).desaturate().css(),\n borderColor: candleShortColor,\n borderColor0: candleLongColor,\n }\n : {\n color: chroma(candleLongColor).desaturate().css(),\n color0: chroma(candleShortColor).desaturate().css(),\n borderColor: candleLongColor,\n borderColor0: candleShortColor,\n };\n\n return {\n animation: isLoading,\n type: 'candlestick',\n id: 'candlestick',\n xAxisIndex: 0,\n yAxisIndex: 0,\n silent: true,\n clip: true,\n large: true,\n encode: {\n x: 'dates',\n y: ['open', 'close', 'low', 'high'],\n },\n itemStyle,\n emphasis: {\n itemStyle: {\n color: itemStyle.color,\n color0: itemStyle.color0,\n },\n },\n z: 3,\n };\n};\n"],"mappings":";;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAC,sBAAA,CAAAF,OAAA;AAA+B,SAAAE,uBAAAC,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAWxB,MAAMG,0BAA0B,GAAGC,IAAA,IAIuB;EAAA,IAJtB;IACzCC,MAAM;IACNC,SAAS;IACTC;EACgC,CAAC,GAAAH,IAAA;EACjC,MAAM;IAAEI,eAAe;IAAEC;EAAiB,CAAC,GAAGJ,MAAM;EACpD,MAAMK,UAAU,GAAGH,MAAM,KAAKI,gBAAM,CAACC,EAAE;EAEvC,MAAMC,SAAS,GAAGH,UAAU,GACxB;IACEI,KAAK,EAAE,IAAAC,iBAAM,EAACN,gBAAgB,CAAC,CAACO,UAAU,CAAC,CAAC,CAACC,GAAG,CAAC,CAAC;IAClDC,MAAM,EAAE,IAAAH,iBAAM,EAACP,eAAe,CAAC,CAACQ,UAAU,CAAC,CAAC,CAACC,GAAG,CAAC,CAAC;IAClDE,WAAW,EAAEV,gBAAgB;IAC7BW,YAAY,EAAEZ;EAChB,CAAC,GACD;IACEM,KAAK,EAAE,IAAAC,iBAAM,EAACP,eAAe,CAAC,CAACQ,UAAU,CAAC,CAAC,CAACC,GAAG,CAAC,CAAC;IACjDC,MAAM,EAAE,IAAAH,iBAAM,EAACN,gBAAgB,CAAC,CAACO,UAAU,CAAC,CAAC,CAACC,GAAG,CAAC,CAAC;IACnDE,WAAW,EAAEX,eAAe;IAC5BY,YAAY,EAAEX;EAChB,CAAC;EAEL,OAAO;IACLY,SAAS,EAAEf,SAAS;IACpBgB,IAAI,EAAE,aAAa;IACnBC,EAAE,EAAE,aAAa;IACjBC,UAAU,EAAE,CAAC;IACbC,UAAU,EAAE,CAAC;IACbC,MAAM,EAAE,IAAI;IACZC,IAAI,EAAE,IAAI;IACVC,KAAK,EAAE,IAAI;IACXC,MAAM,EAAE;MACNC,CAAC,EAAE,OAAO;MACVC,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM;IACpC,CAAC;IACDlB,SAAS;IACTmB,QAAQ,EAAE;MACRnB,SAAS,EAAE;QACTC,KAAK,EAAED,SAAS,CAACC,KAAK;QACtBI,MAAM,EAAEL,SAAS,CAACK;MACpB;IACF,CAAC;IACDe,CAAC,EAAE;EACL,CAAC;AACH,CAAC;AAACC,OAAA,CAAA/B,0BAAA,GAAAA,0BAAA","ignoreList":[]}
|
|
@@ -1,5 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getSeriesHeatmapConfig = void 0;
|
|
7
|
+
var _chartUtils = require("../chartUtils");
|
|
8
|
+
const getSeriesHeatmapConfig = _ref => {
|
|
3
9
|
let {
|
|
4
10
|
bucketWidth,
|
|
5
11
|
buckets,
|
|
@@ -48,7 +54,7 @@ export const getSeriesHeatmapConfig = _ref => {
|
|
|
48
54
|
y: start[1] - rectHeight
|
|
49
55
|
},
|
|
50
56
|
style: {
|
|
51
|
-
fill: getRectColor(sentiment, isDark, sentimentThresholdMin, sentimentThresholdMax)
|
|
57
|
+
fill: (0, _chartUtils.getRectColor)(sentiment, isDark, sentimentThresholdMin, sentimentThresholdMax)
|
|
52
58
|
},
|
|
53
59
|
enterFrom: {
|
|
54
60
|
shape: {},
|
|
@@ -73,4 +79,5 @@ export const getSeriesHeatmapConfig = _ref => {
|
|
|
73
79
|
z: 1
|
|
74
80
|
};
|
|
75
81
|
};
|
|
82
|
+
exports.getSeriesHeatmapConfig = getSeriesHeatmapConfig;
|
|
76
83
|
//# sourceMappingURL=getSeriesHeatmapConfig.js.map
|
package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getSeriesHeatmapConfig.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getSeriesHeatmapConfig.js","names":["
|
|
1
|
+
{"version":3,"file":"getSeriesHeatmapConfig.js","names":["_chartUtils","require","getSeriesHeatmapConfig","_ref","bucketWidth","buckets","isDark","sentimentThresholdMax","sentimentThresholdMin","isLoading","animation","type","id","name","xAxisIndex","yAxisIndex","encode","x","y","dimensions","clip","renderItem","params","api","animationDelay","dataIndexInside","dataInsideLength","xVal","value","bucketIndex","metaValues","rectWidth","rectHeight","size","items","map","_ref2","price","sentiment","start","coord","silent","shape","height","width","style","fill","getRectColor","enterFrom","opacity","enterAnimation","duration","delay","children","emphasisDisabled","z","exports"],"sources":["../../../../../../src/CrowdViewWidget/components/Chart/chartOptions/getSeriesHeatmapConfig.ts"],"sourcesContent":["import type {\n CustomSeriesOption,\n CustomSeriesRenderItemAPI,\n CustomSeriesRenderItemParams,\n} from 'echarts';\n\nimport { getRectColor } from '../chartUtils';\nimport type { Bucket } from '../types';\n\ninterface GetSeriesHeatmapConfigParams {\n bucketWidth: number;\n buckets: Bucket[][];\n isDark: boolean;\n sentimentThresholdMax: number;\n sentimentThresholdMin: number;\n isLoading: boolean;\n}\n\nexport const getSeriesHeatmapConfig = ({\n bucketWidth,\n buckets,\n isDark,\n sentimentThresholdMax,\n sentimentThresholdMin,\n isLoading,\n}: GetSeriesHeatmapConfigParams): CustomSeriesOption => {\n return {\n animation: isLoading,\n type: 'custom',\n id: 'heatmap',\n name: 'heatmap',\n xAxisIndex: 0,\n yAxisIndex: 0,\n encode: {\n x: 'dates',\n y: 'bookPrices',\n },\n dimensions: ['dates', 'bookPrices', 'bookIndexes'],\n clip: true,\n renderItem: (\n params: CustomSeriesRenderItemParams,\n api: CustomSeriesRenderItemAPI\n ) => {\n const animationDelay =\n (350 * params.dataIndexInside) / params.dataInsideLength;\n const xVal = api.value(0);\n const bucketIndex = api.value(2) as number;\n\n if (bucketIndex == null) {\n return null;\n }\n\n const metaValues = buckets[bucketIndex];\n\n if (!metaValues) {\n return null;\n }\n\n const [rectWidth, rectHeight] = api.size!([0, bucketWidth]) as number[];\n\n const items = metaValues.map(({ price, sentiment }: Bucket) => {\n const start = api.coord([xVal, price]);\n\n return {\n silent: true,\n shape: {\n height: rectHeight,\n width: rectWidth + 1,\n x: start[0] - rectWidth / 2,\n y: start[1] - rectHeight,\n },\n style: {\n fill: getRectColor(\n sentiment,\n isDark,\n sentimentThresholdMin,\n sentimentThresholdMax\n ),\n },\n enterFrom: {\n shape: {},\n style: {\n opacity: 0,\n },\n },\n enterAnimation: {\n duration: 150,\n delay: animationDelay,\n },\n type: 'rect' as const,\n };\n });\n\n return {\n children: items,\n emphasisDisabled: true,\n silent: true,\n type: 'group' as const,\n };\n },\n z: 1,\n };\n};\n"],"mappings":";;;;;;AAMA,IAAAA,WAAA,GAAAC,OAAA;AAYO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AEtC,OAAO;UACLI,MAAM,EAAE,IAAI;UACZC,KAAK,EAAE;YACLC,MAAM,EAAEX,UAAU;YAClBY,KAAK,EAAEb,SAAS,GAAG,CAAC;YACpBd,CAAC,EAAEsB,KAAK,CAAC,CAAC,CAAC,GAAGR,SAAS,GAAG,CAAC;YAC3Bb,CAAC,EAAEqB,KAAK,CAAC,CAAC,CAAC,GAAGP;UAChB,CAAC;UACDa,KAAK,EAAE;YACLC,IAAI,EAAE,IAAAC,wBAAY,EAChBT,SAAS,EACThC,MAAM,EACNE,qBAAqB,EACrBD,qBACF;UACF,CAAC;UACDyC,SAAS,EAAE;YACTN,KAAK,EAAE,CAAC,CAAC;YACTG,KAAK,EAAE;cACLI,OAAO,EAAE;YACX;UACF,CAAC;UACDC,cAAc,EAAE;YACdC,QAAQ,EAAE,GAAG;YACbC,KAAK,EAAE5B;UACT,CAAC;UACDb,IAAI,EAAE;QACR,CAAC;MACH,CAAC,CAAC;MAEF,OAAO;QACL0C,QAAQ,EAAEnB,KAAK;QACfoB,gBAAgB,EAAE,IAAI;QACtBb,MAAM,EAAE,IAAI;QACZ9B,IAAI,EAAE;MACR,CAAC;IACH,CAAC;IACD4C,CAAC,EAAE;EACL,CAAC;AACH,CAAC;AAACC,OAAA,CAAAtD,sBAAA,GAAAA,sBAAA","ignoreList":[]}
|
package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getSeriesSentimentConfig.js
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getSeriesSentimentConfig = void 0;
|
|
7
|
+
var _labsWidgetCommon = require("@oanda/labs-widget-common");
|
|
8
|
+
const getSeriesSentimentConfig = _ref => {
|
|
3
9
|
let {
|
|
4
10
|
styles,
|
|
5
11
|
isLoading
|
|
@@ -37,7 +43,7 @@ export const getSeriesSentimentConfig = _ref => {
|
|
|
37
43
|
show: false
|
|
38
44
|
},
|
|
39
45
|
lineStyle: {
|
|
40
|
-
color: colorPalette.grayLight,
|
|
46
|
+
color: _labsWidgetCommon.colorPalette.grayLight,
|
|
41
47
|
width: 1
|
|
42
48
|
},
|
|
43
49
|
data: [{
|
|
@@ -58,4 +64,5 @@ export const getSeriesSentimentConfig = _ref => {
|
|
|
58
64
|
silent: true
|
|
59
65
|
};
|
|
60
66
|
};
|
|
67
|
+
exports.getSeriesSentimentConfig = getSeriesSentimentConfig;
|
|
61
68
|
//# sourceMappingURL=getSeriesSentimentConfig.js.map
|
package/dist/module/CrowdViewWidget/components/Chart/chartOptions/getSeriesSentimentConfig.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getSeriesSentimentConfig.js","names":["
|
|
1
|
+
{"version":3,"file":"getSeriesSentimentConfig.js","names":["_labsWidgetCommon","require","getSeriesSentimentConfig","_ref","styles","isLoading","animation","animationDelay","type","id","name","xAxisIndex","yAxisIndex","encode","x","y","dimensions","lineStyle","width","sentimentOutlineWidth","opacity","shadowColor","sentimentOutlineColor","shadowBlur","emphasis","disabled","tooltip","show","markLine","silent","symbol","label","color","colorPalette","grayLight","data","yAxis","showSymbol","z","connectNulls","exports"],"sources":["../../../../../../src/CrowdViewWidget/components/Chart/chartOptions/getSeriesSentimentConfig.ts"],"sourcesContent":["import { colorPalette } from '@oanda/labs-widget-common';\nimport type { LineSeriesOption } from 'echarts';\n\nimport type { ChartStyles } from '../chartUtils';\n\ninterface GetSeriesSentimentConfigParams {\n styles: ChartStyles;\n isLoading: boolean;\n}\n\nexport const getSeriesSentimentConfig = ({\n styles,\n isLoading,\n}: GetSeriesSentimentConfigParams): LineSeriesOption => {\n return {\n animation: isLoading,\n animationDelay: 350,\n type: 'line',\n id: 'sentiment',\n name: 'sentiment',\n xAxisIndex: 1,\n yAxisIndex: 1,\n encode: {\n x: 'dates',\n y: 'sentimentLongs',\n },\n dimensions: ['dates', 'sentimentLongs', 'sentimentShorts'],\n lineStyle: {\n width: styles.sentimentOutlineWidth,\n opacity: 1,\n shadowColor: styles.sentimentOutlineColor,\n shadowBlur: 3,\n },\n emphasis: {\n disabled: true,\n },\n tooltip: {\n show: false,\n },\n markLine: {\n animation: isLoading,\n silent: true,\n symbol: ['none', 'none'],\n label: {\n show: false,\n },\n lineStyle: {\n color: colorPalette.grayLight,\n width: 1,\n },\n data: [\n {\n yAxis: 20,\n },\n {\n yAxis: 50,\n lineStyle: {\n width: 1,\n },\n },\n {\n yAxis: 80,\n },\n ],\n },\n showSymbol: false,\n symbol: 'none',\n z: 2,\n connectNulls: true,\n silent: true,\n };\n};\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AAUO,MAAMC,wBAAwB,GAAGC,IAAA,IAGgB;EAAA,IAHf;IACvCC,MAAM;IACNC;EAC8B,CAAC,GAAAF,IAAA;EAC/B,OAAO;IACLG,SAAS,EAAED,SAAS;IACpBE,cAAc,EAAE,GAAG;IACnBC,IAAI,EAAE,MAAM;IACZC,EAAE,EAAE,WAAW;IACfC,IAAI,EAAE,WAAW;IACjBC,UAAU,EAAE,CAAC;IACbC,UAAU,EAAE,CAAC;IACbC,MAAM,EAAE;MACNC,CAAC,EAAE,OAAO;MACVC,CAAC,EAAE;IACL,CAAC;IACDC,UAAU,EAAE,CAAC,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,CAAC;IAC1DC,SAAS,EAAE;MACTC,KAAK,EAAEd,MAAM,CAACe,qBAAqB;MACnCC,OAAO,EAAE,CAAC;MACVC,WAAW,EAAEjB,MAAM,CAACkB,qBAAqB;MACzCC,UAAU,EAAE;IACd,CAAC;IACDC,QAAQ,EAAE;MACRC,QAAQ,EAAE;IACZ,CAAC;IACDC,OAAO,EAAE;MACPC,IAAI,EAAE;IACR,CAAC;IACDC,QAAQ,EAAE;MACRtB,SAAS,EAAED,SAAS;MACpBwB,MAAM,EAAE,IAAI;MACZC,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;MACxBC,KAAK,EAAE;QACLJ,IAAI,EAAE;MACR,CAAC;MACDV,SAAS,EAAE;QACTe,KAAK,EAAEC,8BAAY,CAACC,SAAS;QAC7BhB,KAAK,EAAE;MACT,CAAC;MACDiB,IAAI,EAAE,CACJ;QACEC,KAAK,EAAE;MACT,CAAC,EACD;QACEA,KAAK,EAAE,EAAE;QACTnB,SAAS,EAAE;UACTC,KAAK,EAAE;QACT;MACF,CAAC,EACD;QACEkB,KAAK,EAAE;MACT,CAAC;IAEL,CAAC;IACDC,UAAU,EAAE,KAAK;IACjBP,MAAM,EAAE,MAAM;IACdQ,CAAC,EAAE,CAAC;IACJC,YAAY,EAAE,IAAI;IAClBV,MAAM,EAAE;EACV,CAAC;AACH,CAAC;AAACW,OAAA,CAAAtC,wBAAA,GAAAA,wBAAA","ignoreList":[]}
|
|
@@ -1,6 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getTooltipConfig = void 0;
|
|
7
|
+
var _monoI18n = require("@oanda/mono-i18n");
|
|
8
|
+
var _chartUtils = require("../chartUtils");
|
|
9
|
+
const getTooltipConfig = _ref => {
|
|
4
10
|
let {
|
|
5
11
|
bookType,
|
|
6
12
|
bucketWidth,
|
|
@@ -27,7 +33,7 @@ export const getTooltipConfig = _ref => {
|
|
|
27
33
|
},
|
|
28
34
|
alwaysShowContent: true,
|
|
29
35
|
trigger: 'axis',
|
|
30
|
-
formatter: params => getTooltipFormatter({
|
|
36
|
+
formatter: params => (0, _chartUtils.getTooltipFormatter)({
|
|
31
37
|
bookType,
|
|
32
38
|
bucketWidth,
|
|
33
39
|
buckets,
|
|
@@ -39,7 +45,7 @@ export const getTooltipConfig = _ref => {
|
|
|
39
45
|
isDesktop,
|
|
40
46
|
locale,
|
|
41
47
|
isDark,
|
|
42
|
-
isJapanese: locale === Locale.ja
|
|
48
|
+
isJapanese: locale === _monoI18n.Locale.ja
|
|
43
49
|
}),
|
|
44
50
|
hideDelay: 0,
|
|
45
51
|
axisPointer: {
|
|
@@ -57,4 +63,5 @@ export const getTooltipConfig = _ref => {
|
|
|
57
63
|
position: [0, 0]
|
|
58
64
|
};
|
|
59
65
|
};
|
|
66
|
+
exports.getTooltipConfig = getTooltipConfig;
|
|
60
67
|
//# sourceMappingURL=getTooltipConfig.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getTooltipConfig.js","names":["
|
|
1
|
+
{"version":3,"file":"getTooltipConfig.js","names":["_monoI18n","require","_chartUtils","getTooltipConfig","_ref","bookType","bucketWidth","buckets","labelCallback","selectedPriceRef","tooltipLinesColor","sentimentLongs","sentimentShorts","isDesktop","isDark","locale","backgroundColor","shadowColor","extraCssText","padding","textStyle","fontSize","lineHeight","alwaysShowContent","trigger","formatter","params","getTooltipFormatter","selectedPrice","current","isJapanese","Locale","ja","hideDelay","axisPointer","type","axis","lineStyle","color","crossStyle","z","confine","position","exports"],"sources":["../../../../../../src/CrowdViewWidget/components/Chart/chartOptions/getTooltipConfig.ts"],"sourcesContent":["import { Locale } from '@oanda/mono-i18n';\nimport type { TooltipComponentOption } from 'echarts';\n\nimport type { BookType } from '../../../../gql/types/graphql';\nimport { getTooltipFormatter } from '../chartUtils';\nimport type { Bucket, TooltipParam } from '../types';\n\ninterface GetTooltipConfigParams {\n bookType: BookType;\n bucketWidth: number;\n buckets: Bucket[][];\n labelCallback: (key: string, params?: Record<string, unknown>) => string;\n selectedPriceRef: { current: number };\n tooltipLinesColor: string;\n sentimentLongs: (number | null)[];\n sentimentShorts: (number | null)[];\n isDesktop: boolean;\n isDark: boolean;\n locale: string;\n}\n\nexport const getTooltipConfig = ({\n bookType,\n bucketWidth,\n buckets,\n labelCallback,\n selectedPriceRef,\n tooltipLinesColor,\n sentimentLongs,\n sentimentShorts,\n isDesktop,\n isDark,\n locale,\n}: GetTooltipConfigParams): TooltipComponentOption => ({\n backgroundColor: 'transparent',\n shadowColor: 'transparent',\n extraCssText: 'width: 100%; z-index: 5;',\n padding: 4,\n textStyle: isDesktop\n ? {\n fontSize: 12,\n }\n : {\n fontSize: 10,\n lineHeight: 12,\n },\n alwaysShowContent: true,\n trigger: 'axis' as const,\n formatter: (params) =>\n getTooltipFormatter({\n bookType,\n bucketWidth,\n buckets,\n labelCallback,\n params: params as unknown as TooltipParam[],\n selectedPrice: selectedPriceRef.current,\n sentimentLongs,\n sentimentShorts,\n isDesktop,\n locale,\n isDark,\n isJapanese: locale === Locale.ja,\n }),\n hideDelay: 0,\n axisPointer: {\n type: 'cross' as const,\n axis: 'x' as const,\n lineStyle: {\n color: tooltipLinesColor,\n },\n crossStyle: {\n color: tooltipLinesColor,\n },\n z: 30,\n },\n confine: true,\n position: [0, 0],\n});\n"],"mappings":";;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AAIA,IAAAC,WAAA,GAAAD,OAAA;AAiBO,MAAME,gBAAgB,GAAGC,IAAA;EAAA,IAAC;IAC/BC,QAAQ;IACRC,WAAW;IACXC,OAAO;IACPC,aAAa;IACbC,gBAAgB;IAChBC,iBAAiB;IACjBC,cAAc;IACdC,eAAe;IACfC,SAAS;IACTC,MAAM;IACNC;EACsB,CAAC,GAAAX,IAAA;EAAA,OAA8B;IACrDY,eAAe,EAAE,aAAa;IAC9BC,WAAW,EAAE,aAAa;IAC1BC,YAAY,EAAE,0BAA0B;IACxCC,OAAO,EAAE,CAAC;IACVC,SAAS,EAAEP,SAAS,GAChB;MACEQ,QAAQ,EAAE;IACZ,CAAC,GACD;MACEA,QAAQ,EAAE,EAAE;MACZC,UAAU,EAAE;IACd,CAAC;IACLC,iBAAiB,EAAE,IAAI;IACvBC,OAAO,EAAE,MAAe;IACxBC,SAAS,EAAGC,MAAM,IAChB,IAAAC,+BAAmB,EAAC;MAClBtB,QAAQ;MACRC,WAAW;MACXC,OAAO;MACPC,aAAa;MACbkB,MAAM,EAAEA,MAAmC;MAC3CE,aAAa,EAAEnB,gBAAgB,CAACoB,OAAO;MACvClB,cAAc;MACdC,eAAe;MACfC,SAAS;MACTE,MAAM;MACND,MAAM;MACNgB,UAAU,EAAEf,MAAM,KAAKgB,gBAAM,CAACC;IAChC,CAAC,CAAC;IACJC,SAAS,EAAE,CAAC;IACZC,WAAW,EAAE;MACXC,IAAI,EAAE,OAAgB;MACtBC,IAAI,EAAE,GAAY;MAClBC,SAAS,EAAE;QACTC,KAAK,EAAE5B;MACT,CAAC;MACD6B,UAAU,EAAE;QACVD,KAAK,EAAE5B;MACT,CAAC;MACD8B,CAAC,EAAE;IACL,CAAC;IACDC,OAAO,EAAE,IAAI;IACbC,QAAQ,EAAE,CAAC,CAAC,EAAE,CAAC;EACjB,CAAC;AAAA,CAAC;AAACC,OAAA,CAAAxC,gBAAA,GAAAA,gBAAA","ignoreList":[]}
|
|
@@ -1,5 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getVisualMapConfig = void 0;
|
|
7
|
+
var _constants = require("../../../constants");
|
|
8
|
+
const getVisualMapConfig = _ref => {
|
|
3
9
|
let {
|
|
4
10
|
sentimentLongColor,
|
|
5
11
|
sentimentShortColor
|
|
@@ -9,16 +15,17 @@ export const getVisualMapConfig = _ref => {
|
|
|
9
15
|
dimension: 1,
|
|
10
16
|
seriesId: 'sentiment',
|
|
11
17
|
pieces: [{
|
|
12
|
-
lt: CHART_CONFIG.SENTIMENT_MAX / 2,
|
|
18
|
+
lt: _constants.CHART_CONFIG.SENTIMENT_MAX / 2,
|
|
13
19
|
color: sentimentShortColor
|
|
14
20
|
}, {
|
|
15
|
-
gte: CHART_CONFIG.SENTIMENT_MAX / 2,
|
|
16
|
-
lte: CHART_CONFIG.SENTIMENT_MAX,
|
|
21
|
+
gte: _constants.CHART_CONFIG.SENTIMENT_MAX / 2,
|
|
22
|
+
lte: _constants.CHART_CONFIG.SENTIMENT_MAX,
|
|
17
23
|
color: sentimentLongColor
|
|
18
24
|
}, {
|
|
19
|
-
gt: CHART_CONFIG.SENTIMENT_MAX,
|
|
25
|
+
gt: _constants.CHART_CONFIG.SENTIMENT_MAX,
|
|
20
26
|
color: sentimentLongColor
|
|
21
27
|
}]
|
|
22
28
|
};
|
|
23
29
|
};
|
|
30
|
+
exports.getVisualMapConfig = getVisualMapConfig;
|
|
24
31
|
//# sourceMappingURL=getVisualMapConfig.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getVisualMapConfig.js","names":["
|
|
1
|
+
{"version":3,"file":"getVisualMapConfig.js","names":["_constants","require","getVisualMapConfig","_ref","sentimentLongColor","sentimentShortColor","show","dimension","seriesId","pieces","lt","CHART_CONFIG","SENTIMENT_MAX","color","gte","lte","gt","exports"],"sources":["../../../../../../src/CrowdViewWidget/components/Chart/chartOptions/getVisualMapConfig.ts"],"sourcesContent":["import type { VisualMapComponentOption } from 'echarts';\n\nimport { CHART_CONFIG } from '../../../constants';\n\ninterface GetVisualMapConfigParams {\n sentimentLongColor: string;\n sentimentShortColor: string;\n}\n\nexport const getVisualMapConfig = ({\n sentimentLongColor,\n sentimentShortColor,\n}: GetVisualMapConfigParams): VisualMapComponentOption => ({\n show: false,\n dimension: 1,\n seriesId: 'sentiment',\n pieces: [\n {\n lt: CHART_CONFIG.SENTIMENT_MAX / 2,\n color: sentimentShortColor,\n },\n {\n gte: CHART_CONFIG.SENTIMENT_MAX / 2,\n lte: CHART_CONFIG.SENTIMENT_MAX,\n color: sentimentLongColor,\n },\n {\n gt: CHART_CONFIG.SENTIMENT_MAX,\n color: sentimentLongColor,\n },\n ],\n});\n"],"mappings":";;;;;;AAEA,IAAAA,UAAA,GAAAC,OAAA;AAOO,MAAMC,kBAAkB,GAAGC,IAAA;EAAA,IAAC;IACjCC,kBAAkB;IAClBC;EACwB,CAAC,GAAAF,IAAA;EAAA,OAAgC;IACzDG,IAAI,EAAE,KAAK;IACXC,SAAS,EAAE,CAAC;IACZC,QAAQ,EAAE,WAAW;IACrBC,MAAM,EAAE,CACN;MACEC,EAAE,EAAEC,uBAAY,CAACC,aAAa,GAAG,CAAC;MAClCC,KAAK,EAAER;IACT,CAAC,EACD;MACES,GAAG,EAAEH,uBAAY,CAACC,aAAa,GAAG,CAAC;MACnCG,GAAG,EAAEJ,uBAAY,CAACC,aAAa;MAC/BC,KAAK,EAAET;IACT,CAAC,EACD;MACEY,EAAE,EAAEL,uBAAY,CAACC,aAAa;MAC9BC,KAAK,EAAET;IACT,CAAC;EAEL,CAAC;AAAA,CAAC;AAACa,OAAA,CAAAf,kBAAA,GAAAA,kBAAA","ignoreList":[]}
|