@oanda/labs-instruments-price-chart-widget 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (150) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/codegen.ts +18 -0
  3. package/dist/main/InstrumentsPriceChartWidget/InstrumentsPriceChartWidget.js +40 -0
  4. package/dist/main/InstrumentsPriceChartWidget/InstrumentsPriceChartWidget.js.map +1 -0
  5. package/dist/main/InstrumentsPriceChartWidget/Main.js +52 -0
  6. package/dist/main/InstrumentsPriceChartWidget/Main.js.map +1 -0
  7. package/dist/main/InstrumentsPriceChartWidget/components/Chart.js +39 -0
  8. package/dist/main/InstrumentsPriceChartWidget/components/Chart.js.map +1 -0
  9. package/dist/main/InstrumentsPriceChartWidget/components/constants.js +12 -0
  10. package/dist/main/InstrumentsPriceChartWidget/components/constants.js.map +1 -0
  11. package/dist/main/InstrumentsPriceChartWidget/components/formatters.js +15 -0
  12. package/dist/main/InstrumentsPriceChartWidget/components/formatters.js.map +1 -0
  13. package/dist/main/InstrumentsPriceChartWidget/components/getOption.js +119 -0
  14. package/dist/main/InstrumentsPriceChartWidget/components/getOption.js.map +1 -0
  15. package/dist/main/InstrumentsPriceChartWidget/components/types.js +6 -0
  16. package/dist/main/InstrumentsPriceChartWidget/components/types.js.map +1 -0
  17. package/dist/main/InstrumentsPriceChartWidget/config.js +44 -0
  18. package/dist/main/InstrumentsPriceChartWidget/config.js.map +1 -0
  19. package/dist/main/InstrumentsPriceChartWidget/index.js +28 -0
  20. package/dist/main/InstrumentsPriceChartWidget/index.js.map +1 -0
  21. package/dist/main/InstrumentsPriceChartWidget/render.js +42 -0
  22. package/dist/main/InstrumentsPriceChartWidget/render.js.map +1 -0
  23. package/dist/main/InstrumentsPriceChartWidget/types.js +16 -0
  24. package/dist/main/InstrumentsPriceChartWidget/types.js.map +1 -0
  25. package/dist/main/gql/mock/getPriceCandles.js +30 -0
  26. package/dist/main/gql/mock/getPriceCandles.js.map +1 -0
  27. package/dist/main/gql/mock/handlers.js +62 -0
  28. package/dist/main/gql/mock/handlers.js.map +1 -0
  29. package/dist/main/gql/mock/schema.graphqls +59 -0
  30. package/dist/main/gql/types/fragment-masking.js +23 -0
  31. package/dist/main/gql/types/fragment-masking.js.map +1 -0
  32. package/dist/main/gql/types/gql.js +17 -0
  33. package/dist/main/gql/types/gql.js.map +1 -0
  34. package/dist/main/gql/types/graphql.js +438 -0
  35. package/dist/main/gql/types/graphql.js.map +1 -0
  36. package/dist/main/gql/types/index.js +28 -0
  37. package/dist/main/gql/types/index.js.map +1 -0
  38. package/dist/main/gql/validateInstruments.js +16 -0
  39. package/dist/main/gql/validateInstruments.js.map +1 -0
  40. package/dist/main/index.js +17 -0
  41. package/dist/main/index.js.map +1 -0
  42. package/dist/main/translations/index.js +27 -0
  43. package/dist/main/translations/index.js.map +1 -0
  44. package/dist/main/translations/sources/en.json +2 -0
  45. package/dist/main/translations/sources/es.json +2 -0
  46. package/dist/main/translations/sources/th.json +2 -0
  47. package/dist/main/translations/sources/zh_TW.json +2 -0
  48. package/dist/main/translations/translations.js +8 -0
  49. package/dist/main/translations/translations.js.map +1 -0
  50. package/dist/module/InstrumentsPriceChartWidget/InstrumentsPriceChartWidget.js +33 -0
  51. package/dist/module/InstrumentsPriceChartWidget/InstrumentsPriceChartWidget.js.map +1 -0
  52. package/dist/module/InstrumentsPriceChartWidget/Main.js +44 -0
  53. package/dist/module/InstrumentsPriceChartWidget/Main.js.map +1 -0
  54. package/dist/module/InstrumentsPriceChartWidget/components/Chart.js +29 -0
  55. package/dist/module/InstrumentsPriceChartWidget/components/Chart.js.map +1 -0
  56. package/dist/module/InstrumentsPriceChartWidget/components/constants.js +6 -0
  57. package/dist/module/InstrumentsPriceChartWidget/components/constants.js.map +1 -0
  58. package/dist/module/InstrumentsPriceChartWidget/components/formatters.js +8 -0
  59. package/dist/module/InstrumentsPriceChartWidget/components/formatters.js.map +1 -0
  60. package/dist/module/InstrumentsPriceChartWidget/components/getOption.js +112 -0
  61. package/dist/module/InstrumentsPriceChartWidget/components/getOption.js.map +1 -0
  62. package/dist/module/InstrumentsPriceChartWidget/components/types.js +2 -0
  63. package/dist/module/InstrumentsPriceChartWidget/components/types.js.map +1 -0
  64. package/dist/module/InstrumentsPriceChartWidget/config.js +39 -0
  65. package/dist/module/InstrumentsPriceChartWidget/config.js.map +1 -0
  66. package/dist/module/InstrumentsPriceChartWidget/index.js +3 -0
  67. package/dist/module/InstrumentsPriceChartWidget/index.js.map +1 -0
  68. package/dist/module/InstrumentsPriceChartWidget/render.js +39 -0
  69. package/dist/module/InstrumentsPriceChartWidget/render.js.map +1 -0
  70. package/dist/module/InstrumentsPriceChartWidget/types.js +10 -0
  71. package/dist/module/InstrumentsPriceChartWidget/types.js.map +1 -0
  72. package/dist/module/gql/mock/getPriceCandles.js +25 -0
  73. package/dist/module/gql/mock/getPriceCandles.js.map +1 -0
  74. package/dist/module/gql/mock/handlers.js +56 -0
  75. package/dist/module/gql/mock/handlers.js.map +1 -0
  76. package/dist/module/gql/mock/schema.graphqls +59 -0
  77. package/dist/module/gql/types/fragment-masking.js +15 -0
  78. package/dist/module/gql/types/fragment-masking.js.map +1 -0
  79. package/dist/module/gql/types/gql.js +9 -0
  80. package/dist/module/gql/types/gql.js.map +1 -0
  81. package/dist/module/gql/types/graphql.js +432 -0
  82. package/dist/module/gql/types/graphql.js.map +1 -0
  83. package/dist/module/gql/types/index.js +3 -0
  84. package/dist/module/gql/types/index.js.map +1 -0
  85. package/dist/module/gql/validateInstruments.js +10 -0
  86. package/dist/module/gql/validateInstruments.js.map +1 -0
  87. package/dist/module/index.js +2 -0
  88. package/dist/module/index.js.map +1 -0
  89. package/dist/module/translations/index.js +20 -0
  90. package/dist/module/translations/index.js.map +1 -0
  91. package/dist/module/translations/sources/en.json +2 -0
  92. package/dist/module/translations/sources/es.json +2 -0
  93. package/dist/module/translations/sources/th.json +2 -0
  94. package/dist/module/translations/sources/zh_TW.json +2 -0
  95. package/dist/module/translations/translations.js +2 -0
  96. package/dist/module/translations/translations.js.map +1 -0
  97. package/dist/types/InstrumentsPriceChartWidget/InstrumentsPriceChartWidget.d.ts +4 -0
  98. package/dist/types/InstrumentsPriceChartWidget/Main.d.ts +4 -0
  99. package/dist/types/InstrumentsPriceChartWidget/components/Chart.d.ts +3 -0
  100. package/dist/types/InstrumentsPriceChartWidget/components/constants.d.ts +5 -0
  101. package/dist/types/InstrumentsPriceChartWidget/components/formatters.d.ts +1 -0
  102. package/dist/types/InstrumentsPriceChartWidget/components/getOption.d.ts +2 -0
  103. package/dist/types/InstrumentsPriceChartWidget/components/types.d.ts +14 -0
  104. package/dist/types/InstrumentsPriceChartWidget/config.d.ts +10 -0
  105. package/dist/types/InstrumentsPriceChartWidget/index.d.ts +2 -0
  106. package/dist/types/InstrumentsPriceChartWidget/render.d.ts +1 -0
  107. package/dist/types/InstrumentsPriceChartWidget/types.d.ts +15 -0
  108. package/dist/types/gql/mock/getPriceCandles.d.ts +2 -0
  109. package/dist/types/gql/mock/handlers.d.ts +1 -0
  110. package/dist/types/gql/types/fragment-masking.d.ts +15 -0
  111. package/dist/types/gql/types/gql.d.ts +47 -0
  112. package/dist/types/gql/types/graphql.d.ts +468 -0
  113. package/dist/types/gql/types/index.d.ts +2 -0
  114. package/dist/types/gql/validateInstruments.d.ts +1 -0
  115. package/dist/types/index.d.ts +1 -0
  116. package/dist/types/translations/index.d.ts +4 -0
  117. package/dist/types/translations/translations.d.ts +1 -0
  118. package/index.ts +1 -0
  119. package/lokalise.config.json +18 -0
  120. package/package.json +24 -0
  121. package/src/InstrumentsPriceChartWidget/InstrumentsPriceChartWidget.tsx +40 -0
  122. package/src/InstrumentsPriceChartWidget/Main.tsx +59 -0
  123. package/src/InstrumentsPriceChartWidget/components/Chart.tsx +47 -0
  124. package/src/InstrumentsPriceChartWidget/components/constants.ts +5 -0
  125. package/src/InstrumentsPriceChartWidget/components/formatters.ts +7 -0
  126. package/src/InstrumentsPriceChartWidget/components/getOption.ts +127 -0
  127. package/src/InstrumentsPriceChartWidget/components/types.ts +19 -0
  128. package/src/InstrumentsPriceChartWidget/config.ts +47 -0
  129. package/src/InstrumentsPriceChartWidget/index.ts +2 -0
  130. package/src/InstrumentsPriceChartWidget/render.tsx +52 -0
  131. package/src/InstrumentsPriceChartWidget/types.ts +20 -0
  132. package/src/gql/mock/getPriceCandles.ts +26 -0
  133. package/src/gql/mock/handlers.ts +66 -0
  134. package/src/gql/mock/schema.graphqls +59 -0
  135. package/src/gql/types/fragment-masking.ts +86 -0
  136. package/src/gql/types/gql.ts +54 -0
  137. package/src/gql/types/graphql.ts +723 -0
  138. package/src/gql/types/index.ts +2 -0
  139. package/src/gql/validateInstruments.ts +10 -0
  140. package/src/index.ts +1 -0
  141. package/src/translations/index.ts +17 -0
  142. package/src/translations/sources/en.json +2 -0
  143. package/src/translations/sources/es.json +2 -0
  144. package/src/translations/sources/th.json +2 -0
  145. package/src/translations/sources/zh_TW.json +2 -0
  146. package/src/translations/translations.ts +1 -0
  147. package/test/Main.test.tsx +26 -0
  148. package/test/mocks/chartMock.ts +52 -0
  149. package/test/mocks/index.ts +1 -0
  150. package/tsconfig.types.json +12 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"graphql.js","names":["AssetClassName","exports","BookType","CorrelationTimeUnit","CurrencyName","CurrencyPowerBalanceTimeUnit","DataSource","Division","Granularity","InstrumentDataSource","Region","Sort","TimeSpan","TopicalSort","ValueAtRiskBars","ValueAtRiskDuration","VolatilityChartTimeSpan","VolatilityChartTimeUnit","GetPriceCandlesDocument","kind","definitions","operation","name","value","variableDefinitions","variable","type","selectionSet","selections","arguments","ValidateInstrumentsDocument"],"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 }> = {\n [K in keyof T]: T[K];\n};\nexport type MakeOptional<T, K extends keyof T> = Omit<T, K> & {\n [SubKey in K]?: Maybe<T[SubKey]>;\n};\nexport type MakeMaybe<T, K extends keyof T> = Omit<T, K> & {\n [SubKey in K]: Maybe<T[SubKey]>;\n};\nexport type MakeEmpty<\n T extends { [key: string]: unknown },\n K extends keyof T,\n> = { [_ in K]?: never };\nexport type Incremental<T> =\n | T\n | {\n [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never;\n };\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: Array<Instrument>;\n name: Scalars['String']['output'];\n};\n\nexport enum AssetClassName {\n Commodities = 'COMMODITIES',\n Cryptocurrency = 'CRYPTOCURRENCY',\n Currency = 'CURRENCY',\n EquityShares = 'EQUITY_SHARES',\n Etfs = 'ETFS',\n Indices = 'INDICES',\n Rates = 'RATES',\n}\n\nexport enum BookType {\n Order = 'ORDER',\n Position = 'POSITION',\n}\n\nexport type Candle = {\n __typename?: 'Candle';\n high: Scalars['Float']['output'];\n};\n\nexport type CandlesData = {\n __typename?: 'CandlesData';\n candle: Candle;\n time: Scalars['String']['output'];\n timeSpan: TimeSpan;\n unixTime: Scalars['Int']['output'];\n};\n\nexport type CorrelationHeatmap = {\n __typename?: 'CorrelationHeatmap';\n baseInstrument: Instrument;\n heatmap: Array<Heatmap>;\n};\n\nexport type CorrelationMatrix = {\n __typename?: 'CorrelationMatrix';\n baseTimeUnit: CorrelationTimeUnit;\n matrix: Array<Matrix>;\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 updatedAt: Scalars['String']['output'];\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 updatedAt: Scalars['String']['output'];\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 Opt = 'OPT',\n Otms = 'OTMS',\n}\n\nexport enum Granularity {\n Day_1 = 'DAY_1',\n Hour_1 = 'HOUR_1',\n Hour_4 = 'HOUR_4',\n Minute_5 = 'MINUTE_5',\n Minute_15 = 'MINUTE_15',\n Minute_30 = 'MINUTE_30',\n}\n\nexport type Heatmap = {\n __typename?: 'Heatmap';\n instrument: Instrument;\n timeCorrelation: Array<TimeCorrelation>;\n};\n\nexport type Instrument = {\n __typename?: 'Instrument';\n displayName: Scalars['String']['output'];\n name: Scalars['String']['output'];\n};\n\nexport type InstrumentCorrelation = {\n __typename?: 'InstrumentCorrelation';\n instrument: Instrument;\n value?: Maybe<Scalars['Float']['output']>;\n};\n\nexport enum InstrumentDataSource {\n Mt5 = 'MT5',\n V20 = 'V20',\n}\n\nexport type InstrumentTableResult = {\n __typename?: 'InstrumentTableResult';\n instruments: Array<Instrument>;\n totalCount: Scalars['Int']['output'];\n};\n\nexport type Matrix = {\n __typename?: 'Matrix';\n instrument: Instrument;\n instrumentCorrelation: Array<InstrumentCorrelation>;\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 correlationMatrix: CorrelationMatrix;\n currencyPowerBalance?: Maybe<Array<CurrencyPowerBalance>>;\n currencyStrength?: Maybe<Array<CurrencyStrength>>;\n getPriceCandles: Array<CandlesData>;\n isAllowedPartner?: Maybe<Scalars['Boolean']['output']>;\n mapInstrumentNames?: Maybe<Array<Maybe<Instrument>>>;\n orderPositionBooks: Array<Maybe<OrderPositionData>>;\n resolveInstrumentsByDivision?: Maybe<Array<Instrument>>;\n resolveInstrumentsWithFilters?: Maybe<InstrumentTableResult>;\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 valueAtRiskAssetClasses?: Maybe<Array<AssetClass>>;\n valueAtRiskChart?: Maybe<ValueAtRiskChart>;\n volatilityChart?: Maybe<Array<Maybe<VolatilityChart>>>;\n volatilityChartAssetClasses?: Maybe<Array<AssetClass>>;\n};\n\nexport type QueryAssetClassesArgs = {\n division: Division;\n};\n\nexport type QueryCorrelationHeatmapArgs = {\n division: Division;\n instruments?: InputMaybe<Array<InputMaybe<Scalars['String']['input']>>>;\n timeSpans?: InputMaybe<Array<InputMaybe<CorrelationTimeUnit>>>;\n};\n\nexport type QueryCorrelationMatrixArgs = {\n division: Division;\n instruments?: InputMaybe<Array<InputMaybe<Scalars['String']['input']>>>;\n};\n\nexport type QueryCurrencyPowerBalanceArgs = {\n timeUnit: CurrencyPowerBalanceTimeUnit;\n};\n\nexport type QueryGetPriceCandlesArgs = {\n division?: InputMaybe<Division>;\n granularity: Granularity;\n instrument: Scalars['String']['input'];\n timeSpan: TimeSpan;\n};\n\nexport type QueryIsAllowedPartnerArgs = {\n url: Scalars['String']['input'];\n};\n\nexport type QueryMapInstrumentNamesArgs = {\n division?: InputMaybe<Division>;\n instruments: Array<InputMaybe<Scalars['String']['input']>>;\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\nexport type QueryResolveInstrumentsByDivisionArgs = {\n division: Division;\n instruments: Array<InputMaybe<Scalars['String']['input']>>;\n};\n\nexport type QueryResolveInstrumentsWithFiltersArgs = {\n assetClass?: InputMaybe<Array<InputMaybe<AssetClassName>>>;\n count?: InputMaybe<Scalars['Int']['input']>;\n dataSource?: InputMaybe<InstrumentDataSource>;\n division: Division;\n instruments?: InputMaybe<Array<InputMaybe<Scalars['String']['input']>>>;\n offset?: InputMaybe<Scalars['Int']['input']>;\n searchPattern?: InputMaybe<Scalars['String']['input']>;\n};\n\nexport type QuerySentimentArgs = {\n division?: InputMaybe<Division>;\n name: Scalars['String']['input'];\n};\n\nexport type QuerySentimentListArgs = {\n division?: InputMaybe<Division>;\n sort?: InputMaybe<Sort>;\n};\n\nexport type QueryTopicalInstrumentsArgs = {\n assetClass?: InputMaybe<AssetClassName>;\n count?: InputMaybe<Scalars['Int']['input']>;\n division?: InputMaybe<Division>;\n offset?: InputMaybe<Scalars['Int']['input']>;\n sort: TopicalSort;\n};\n\nexport type QueryTopicalInstrumentsChartsArgs = {\n division?: InputMaybe<Division>;\n instruments?: InputMaybe<Array<Scalars['String']['input']>>;\n};\n\nexport type QueryTopicalInstrumentsTotalCountArgs = {\n assetClass?: InputMaybe<AssetClassName>;\n division?: InputMaybe<Division>;\n sort: TopicalSort;\n};\n\nexport type QueryValueAtRiskAssetClassesArgs = {\n division?: InputMaybe<Division>;\n};\n\nexport type QueryValueAtRiskChartArgs = {\n bars: ValueAtRiskBars;\n division?: InputMaybe<Division>;\n duration: ValueAtRiskDuration;\n instrument: Scalars['String']['input'];\n};\n\nexport type QueryVolatilityChartArgs = {\n division?: InputMaybe<Division>;\n instrument: Scalars['String']['input'];\n timeSpan: VolatilityChartTimeSpan;\n timeUnit: VolatilityChartTimeUnit;\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 TimeCorrelation = {\n __typename?: 'TimeCorrelation';\n timeUnit: CorrelationTimeUnit;\n value?: Maybe<Scalars['Float']['output']>;\n};\n\nexport enum TimeSpan {\n Day_1 = 'DAY_1',\n Day_2 = 'DAY_2',\n Hour_1 = 'HOUR_1',\n Hour_12 = 'HOUR_12',\n Month_1 = 'MONTH_1',\n Month_3 = 'MONTH_3',\n Month_6 = 'MONTH_6',\n Week_1 = 'WEEK_1',\n Week_2 = 'WEEK_2',\n Week_3 = 'WEEK_3',\n Year_1 = 'YEAR_1',\n}\n\nexport type TopicalInstrument = {\n __typename?: 'TopicalInstrument';\n assetClass?: Maybe<AssetClassName>;\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 enum ValueAtRiskBars {\n C100 = 'C100',\n C200 = 'C200',\n C300 = 'C300',\n}\n\nexport type ValueAtRiskChart = {\n __typename?: 'ValueAtRiskChart';\n down: ValueAtRiskChartData;\n up: ValueAtRiskChartData;\n};\n\nexport type ValueAtRiskChartData = {\n __typename?: 'ValueAtRiskChartData';\n average: Scalars['Float']['output'];\n max: Scalars['Float']['output'];\n median: Scalars['Float']['output'];\n points?: Maybe<Array<ValueAtRiskChartPoint>>;\n threshold: Scalars['Float']['output'];\n};\n\nexport type ValueAtRiskChartPoint = {\n __typename?: 'ValueAtRiskChartPoint';\n percent: Scalars['Float']['output'];\n pips: Scalars['Float']['output'];\n};\n\nexport enum ValueAtRiskDuration {\n C1 = 'C1',\n C2 = 'C2',\n C3 = 'C3',\n C4 = 'C4',\n C5 = 'C5',\n C10 = 'C10',\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 updatedAt: 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 GetPriceCandlesQueryVariables = Exact<{\n division?: InputMaybe<Division>;\n instrument: Scalars['String']['input'];\n granularity: Granularity;\n timeSpan: TimeSpan;\n}>;\n\nexport type GetPriceCandlesQuery = {\n __typename?: 'Query';\n getPriceCandles: Array<{\n __typename?: 'CandlesData';\n time: string;\n unixTime: number;\n timeSpan: TimeSpan;\n candle: { __typename?: 'Candle'; high: number };\n }>;\n};\n\nexport type ValidateInstrumentsQueryVariables = Exact<{\n instruments:\n | Array<InputMaybe<Scalars['String']['input']>>\n | InputMaybe<Scalars['String']['input']>;\n division?: InputMaybe<Division>;\n}>;\n\nexport type ValidateInstrumentsQuery = {\n __typename?: 'Query';\n mapInstrumentNames?: Array<{\n __typename?: 'Instrument';\n name: string;\n displayName: string;\n } | null> | null;\n};\n\nexport const GetPriceCandlesDocument = {\n kind: 'Document',\n definitions: [\n {\n kind: 'OperationDefinition',\n operation: 'query',\n name: { kind: 'Name', value: 'GetPriceCandles' },\n variableDefinitions: [\n {\n kind: 'VariableDefinition',\n variable: {\n kind: 'Variable',\n name: { kind: 'Name', value: 'division' },\n },\n type: {\n kind: 'NamedType',\n name: { kind: 'Name', value: 'Division' },\n },\n },\n {\n kind: 'VariableDefinition',\n variable: {\n kind: 'Variable',\n name: { kind: 'Name', value: 'instrument' },\n },\n type: {\n kind: 'NonNullType',\n type: {\n kind: 'NamedType',\n name: { kind: 'Name', value: 'String' },\n },\n },\n },\n {\n kind: 'VariableDefinition',\n variable: {\n kind: 'Variable',\n name: { kind: 'Name', value: 'granularity' },\n },\n type: {\n kind: 'NonNullType',\n type: {\n kind: 'NamedType',\n name: { kind: 'Name', value: 'Granularity' },\n },\n },\n },\n {\n kind: 'VariableDefinition',\n variable: {\n kind: 'Variable',\n name: { kind: 'Name', value: 'timeSpan' },\n },\n type: {\n kind: 'NonNullType',\n type: {\n kind: 'NamedType',\n name: { kind: 'Name', value: 'TimeSpan' },\n },\n },\n },\n ],\n selectionSet: {\n kind: 'SelectionSet',\n selections: [\n {\n kind: 'Field',\n name: { kind: 'Name', value: 'getPriceCandles' },\n arguments: [\n {\n kind: 'Argument',\n name: { kind: 'Name', value: 'division' },\n value: {\n kind: 'Variable',\n name: { kind: 'Name', value: 'division' },\n },\n },\n {\n kind: 'Argument',\n name: { kind: 'Name', value: 'instrument' },\n value: {\n kind: 'Variable',\n name: { kind: 'Name', value: 'instrument' },\n },\n },\n {\n kind: 'Argument',\n name: { kind: 'Name', value: 'granularity' },\n value: {\n kind: 'Variable',\n name: { kind: 'Name', value: 'granularity' },\n },\n },\n {\n kind: 'Argument',\n name: { kind: 'Name', value: 'timeSpan' },\n value: {\n kind: 'Variable',\n name: { kind: 'Name', value: 'timeSpan' },\n },\n },\n ],\n selectionSet: {\n kind: 'SelectionSet',\n selections: [\n { kind: 'Field', name: { kind: 'Name', value: 'time' } },\n { kind: 'Field', name: { kind: 'Name', value: 'unixTime' } },\n {\n kind: 'Field',\n name: { kind: 'Name', value: 'candle' },\n selectionSet: {\n kind: 'SelectionSet',\n selections: [\n { kind: 'Field', name: { kind: 'Name', value: 'high' } },\n ],\n },\n },\n { kind: 'Field', name: { kind: 'Name', value: 'timeSpan' } },\n ],\n },\n },\n ],\n },\n },\n ],\n} as unknown as DocumentNode<\n GetPriceCandlesQuery,\n GetPriceCandlesQueryVariables\n>;\nexport const ValidateInstrumentsDocument = {\n kind: 'Document',\n definitions: [\n {\n kind: 'OperationDefinition',\n operation: 'query',\n name: { kind: 'Name', value: 'validateInstruments' },\n variableDefinitions: [\n {\n kind: 'VariableDefinition',\n variable: {\n kind: 'Variable',\n name: { kind: 'Name', value: 'instruments' },\n },\n type: {\n kind: 'NonNullType',\n type: {\n kind: 'ListType',\n type: {\n kind: 'NamedType',\n name: { kind: 'Name', value: 'String' },\n },\n },\n },\n },\n {\n kind: 'VariableDefinition',\n variable: {\n kind: 'Variable',\n name: { kind: 'Name', value: 'division' },\n },\n type: {\n kind: 'NamedType',\n name: { kind: 'Name', value: 'Division' },\n },\n },\n ],\n selectionSet: {\n kind: 'SelectionSet',\n selections: [\n {\n kind: 'Field',\n name: { kind: 'Name', value: 'mapInstrumentNames' },\n arguments: [\n {\n kind: 'Argument',\n name: { kind: 'Name', value: 'instruments' },\n value: {\n kind: 'Variable',\n name: { kind: 'Name', value: 'instruments' },\n },\n },\n {\n kind: 'Argument',\n name: { kind: 'Name', value: 'division' },\n value: {\n kind: 'Variable',\n name: { kind: 'Name', value: 'division' },\n },\n },\n ],\n selectionSet: {\n kind: 'SelectionSet',\n selections: [\n { kind: 'Field', name: { kind: 'Name', value: 'name' } },\n { kind: 'Field', name: { kind: 'Name', value: 'displayName' } },\n ],\n },\n },\n ],\n },\n },\n ],\n} as unknown as DocumentNode<\n ValidateInstrumentsQuery,\n ValidateInstrumentsQueryVariables\n>;\n"],"mappings":";;;;;;IAqCYA,cAAc,GAAAC,OAAA,CAAAD,cAAA,aAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAA,OAAdA,cAAc;AAAA;AAAA,IAUdE,QAAQ,GAAAD,OAAA,CAAAC,QAAA,aAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAAA,OAARA,QAAQ;AAAA;AAAA,IA8BRC,mBAAmB,GAAAF,OAAA,CAAAE,mBAAA,aAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAnBA,mBA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U;YAChBG,IAAI,EAAE;cAAEH,IAAI,EAAE,MAAM;cAAEI,KAAK,EAAE;YAAW;UAC1C;QACF,CAAC,CACF;QACDI,YAAY,EAAE;UACZR,IAAI,EAAE,cAAc;UACpBS,UAAU,EAAE,CACV;YAAET,IAAI,EAAE,OAAO;YAAEG,IAAI,EAAE;cAAEH,IAAI,EAAE,MAAM;cAAEI,KAAK,EAAE;YAAO;UAAE,CAAC,EACxD;YAAEJ,IAAI,EAAE,OAAO;YAAEG,IAAI,EAAE;cAAEH,IAAI,EAAE,MAAM;cAAEI,KAAK,EAAE;YAAc;UAAE,CAAC;QAEnE;MACF,CAAC;IAEL;EACF,CAAC;AAEL,CAGC","ignoreList":[]}
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _fragmentMasking = require("./fragment-masking");
7
+ Object.keys(_fragmentMasking).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ if (key in exports && exports[key] === _fragmentMasking[key]) return;
10
+ Object.defineProperty(exports, key, {
11
+ enumerable: true,
12
+ get: function () {
13
+ return _fragmentMasking[key];
14
+ }
15
+ });
16
+ });
17
+ var _gql = require("./gql");
18
+ Object.keys(_gql).forEach(function (key) {
19
+ if (key === "default" || key === "__esModule") return;
20
+ if (key in exports && exports[key] === _gql[key]) return;
21
+ Object.defineProperty(exports, key, {
22
+ enumerable: true,
23
+ get: function () {
24
+ return _gql[key];
25
+ }
26
+ });
27
+ });
28
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["_fragmentMasking","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_gql"],"sources":["../../../../src/gql/types/index.ts"],"sourcesContent":["export * from './fragment-masking';\nexport * from './gql';\n"],"mappings":";;;;;AAAA,IAAAA,gBAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,gBAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,gBAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,gBAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,IAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,IAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,IAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,IAAA,CAAAL,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.validateInstruments = void 0;
7
+ var _client = require("@apollo/client");
8
+ const validateInstruments = exports.validateInstruments = (0, _client.gql)`
9
+ query validateInstruments($instruments: [String]!, $division: Division) {
10
+ mapInstrumentNames(instruments: $instruments, division: $division) {
11
+ name
12
+ displayName
13
+ }
14
+ }
15
+ `;
16
+ //# sourceMappingURL=validateInstruments.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validateInstruments.js","names":["_client","require","validateInstruments","exports","gql"],"sources":["../../../src/gql/validateInstruments.ts"],"sourcesContent":["import { gql } from '@apollo/client';\n\nexport const validateInstruments = gql`\n query validateInstruments($instruments: [String]!, $division: Division) {\n mapInstrumentNames(instruments: $instruments, division: $division) {\n name\n displayName\n }\n }\n`;\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAEO,MAAMC,mBAAmB,GAAAC,OAAA,CAAAD,mBAAA,GAAG,IAAAE,WAAG;AACtC;AACA;AACA;AACA;AACA;AACA;AACA,CAAC","ignoreList":[]}
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _InstrumentsPriceChartWidget = require("./InstrumentsPriceChartWidget");
7
+ Object.keys(_InstrumentsPriceChartWidget).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ if (key in exports && exports[key] === _InstrumentsPriceChartWidget[key]) return;
10
+ Object.defineProperty(exports, key, {
11
+ enumerable: true,
12
+ get: function () {
13
+ return _InstrumentsPriceChartWidget[key];
14
+ }
15
+ });
16
+ });
17
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["_InstrumentsPriceChartWidget","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get"],"sources":["../../src/index.ts"],"sourcesContent":["export * from './InstrumentsPriceChartWidget';\n"],"mappings":";;;;;AAAA,IAAAA,4BAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,4BAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,4BAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,4BAAA,CAAAK,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.translations = void 0;
7
+ var _monoI18n = require("@oanda/mono-i18n");
8
+ var _en = _interopRequireDefault(require("./sources/en.json"));
9
+ var _es = _interopRequireDefault(require("./sources/es.json"));
10
+ var _th = _interopRequireDefault(require("./sources/th.json"));
11
+ var _zh_TW = _interopRequireDefault(require("./sources/zh_TW.json"));
12
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
13
+ const translations = exports.translations = {
14
+ [_monoI18n.Locale.en]: {
15
+ translation: _en.default
16
+ },
17
+ [_monoI18n.Locale.zhTW]: {
18
+ translation: _zh_TW.default
19
+ },
20
+ [_monoI18n.Locale.es]: {
21
+ translation: _es.default
22
+ },
23
+ [_monoI18n.Locale.th]: {
24
+ translation: _th.default
25
+ }
26
+ };
27
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["_monoI18n","require","_en","_interopRequireDefault","_es","_th","_zh_TW","e","__esModule","default","translations","exports","Locale","en","translation","zhTW","es","th"],"sources":["../../../src/translations/index.ts"],"sourcesContent":["import type { Translations } from '@oanda/mono-i18n';\nimport { Locale } from '@oanda/mono-i18n';\n\nimport en from './sources/en.json';\nimport es from './sources/es.json';\nimport th from './sources/th.json';\nimport zhTW from './sources/zh_TW.json';\nimport type { defaultTranslations } from './translations';\n\nexport type TranslationKey = keyof typeof defaultTranslations;\n\nexport const translations: Translations = {\n [Locale.en]: { translation: en },\n [Locale.zhTW]: { translation: zhTW },\n [Locale.es]: { translation: es },\n [Locale.th]: { translation: th },\n};\n"],"mappings":";;;;;;AACA,IAAAA,SAAA,GAAAC,OAAA;AAEA,IAAAC,GAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,GAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,GAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,MAAA,GAAAH,sBAAA,CAAAF,OAAA;AAAwC,SAAAE,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAKjC,MAAMG,YAA0B,GAAAC,OAAA,CAAAD,YAAA,GAAG;EACxC,CAACE,gBAAM,CAACC,EAAE,GAAG;IAAEC,WAAW,EAAED;EAAG,CAAC;EAChC,CAACD,gBAAM,CAACG,IAAI,GAAG;IAAED,WAAW,EAAEC;EAAK,CAAC;EACpC,CAACH,gBAAM,CAACI,EAAE,GAAG;IAAEF,WAAW,EAAEE;EAAG,CAAC;EAChC,CAACJ,gBAAM,CAACK,EAAE,GAAG;IAAEH,WAAW,EAAEG;EAAG;AACjC,CAAC","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ {
2
+ }
@@ -0,0 +1,2 @@
1
+ {
2
+ }
@@ -0,0 +1,2 @@
1
+ {
2
+ }
@@ -0,0 +1,2 @@
1
+ {
2
+ }
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.defaultTranslations = void 0;
7
+ const defaultTranslations = exports.defaultTranslations = {};
8
+ //# sourceMappingURL=translations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"translations.js","names":["defaultTranslations","exports"],"sources":["../../../src/translations/translations.ts"],"sourcesContent":["export const defaultTranslations = {};\n"],"mappings":";;;;;;AAAO,MAAMA,mBAAmB,GAAAC,OAAA,CAAAD,mBAAA,GAAG,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,33 @@
1
+ import { ApolloClient, InMemoryCache } from '@apollo/client';
2
+ import { WidgetProvider, WidgetWrapper } from '@oanda/labs-widget-common';
3
+ import React from 'react';
4
+ import { translations } from '../translations';
5
+ import { Main } from './Main';
6
+ const InstrumentsPriceChartWidget = _ref => {
7
+ let {
8
+ graphqlUrl,
9
+ locale,
10
+ theme,
11
+ isParamError,
12
+ logoLink,
13
+ division
14
+ } = _ref;
15
+ const client = new ApolloClient({
16
+ uri: graphqlUrl,
17
+ cache: new InMemoryCache()
18
+ });
19
+ return React.createElement(WidgetProvider, {
20
+ client: client,
21
+ locale: locale,
22
+ theme: theme,
23
+ translations: translations
24
+ }, React.createElement(WidgetWrapper, {
25
+ isParamError: isParamError,
26
+ linkArea: "logo",
27
+ logoLink: logoLink
28
+ }, React.createElement(Main, {
29
+ division: division
30
+ })));
31
+ };
32
+ export { InstrumentsPriceChartWidget };
33
+ //# sourceMappingURL=InstrumentsPriceChartWidget.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InstrumentsPriceChartWidget.js","names":["ApolloClient","InMemoryCache","WidgetProvider","WidgetWrapper","React","translations","Main","InstrumentsPriceChartWidget","_ref","graphqlUrl","locale","theme","isParamError","logoLink","division","client","uri","cache","createElement","linkArea"],"sources":["../../../src/InstrumentsPriceChartWidget/InstrumentsPriceChartWidget.tsx"],"sourcesContent":["import { ApolloClient, InMemoryCache } from '@apollo/client';\nimport { WidgetProvider, WidgetWrapper } from '@oanda/labs-widget-common';\nimport React from 'react';\n\nimport { translations } from '../translations';\nimport { Main } from './Main';\nimport type { InstrumentsPriceChartConfig } from './types';\n\nconst InstrumentsPriceChartWidget = ({\n graphqlUrl,\n locale,\n theme,\n isParamError,\n logoLink,\n division,\n}: InstrumentsPriceChartConfig) => {\n const client = new ApolloClient({\n uri: graphqlUrl,\n cache: new InMemoryCache(),\n });\n\n return (\n <WidgetProvider\n client={client}\n locale={locale}\n theme={theme}\n translations={translations}\n >\n <WidgetWrapper\n isParamError={isParamError}\n linkArea=\"logo\"\n logoLink={logoLink}\n >\n <Main division={division} />\n </WidgetWrapper>\n </WidgetProvider>\n );\n};\n\nexport { InstrumentsPriceChartWidget };\n"],"mappings":"AAAA,SAASA,YAAY,EAAEC,aAAa,QAAQ,gBAAgB;AAC5D,SAASC,cAAc,EAAEC,aAAa,QAAQ,2BAA2B;AACzE,OAAOC,KAAK,MAAM,OAAO;AAEzB,SAASC,YAAY,QAAQ,iBAAiB;AAC9C,SAASC,IAAI,QAAQ,QAAQ;AAG7B,MAAMC,2BAA2B,GAAGC,IAAA,IAOD;EAAA,IAPE;IACnCC,UAAU;IACVC,MAAM;IACNC,KAAK;IACLC,YAAY;IACZC,QAAQ;IACRC;EAC2B,CAAC,GAAAN,IAAA;EAC5B,MAAMO,MAAM,GAAG,IAAIf,YAAY,CAAC;IAC9BgB,GAAG,EAAEP,UAAU;IACfQ,KAAK,EAAE,IAAIhB,aAAa,CAAC;EAC3B,CAAC,CAAC;EAEF,OACEG,KAAA,CAAAc,aAAA,CAAChB,cAAc;IACba,MAAM,EAAEA,MAAO;IACfL,MAAM,EAAEA,MAAO;IACfC,KAAK,EAAEA,KAAM;IACbN,YAAY,EAAEA;EAAa,GAE3BD,KAAA,CAAAc,aAAA,CAACf,aAAa;IACZS,YAAY,EAAEA,YAAa;IAC3BO,QAAQ,EAAC,MAAM;IACfN,QAAQ,EAAEA;EAAS,GAEnBT,KAAA,CAAAc,aAAA,CAACZ,IAAI;IAACQ,QAAQ,EAAEA;EAAS,CAAE,CACd,CACD,CAAC;AAErB,CAAC;AAED,SAASP,2BAA2B","ignoreList":[]}
@@ -0,0 +1,44 @@
1
+ import { useQuery } from '@apollo/client';
2
+ import { Spinner, SpinnerSize, TimeUnitSwitch } from '@oanda/labs-widget-common';
3
+ import React, { useState } from 'react';
4
+ import { getPriceCandles } from '../gql/mock/getPriceCandles';
5
+ import { Chart } from './components/Chart';
6
+ import { timeUnitConfig } from './config';
7
+ import { TimeSpanSubset } from './types';
8
+ const Main = _ref => {
9
+ let {
10
+ division
11
+ } = _ref;
12
+ const [selectedTimeUnit, setSelectedTimeUnit] = useState(TimeSpanSubset.Day_1);
13
+ const {
14
+ loading,
15
+ data,
16
+ error
17
+ } = useQuery(getPriceCandles, {
18
+ variables: {
19
+ timeSpan: TimeSpanSubset.Day_1,
20
+ division
21
+ },
22
+ fetchPolicy: 'cache-and-network'
23
+ });
24
+ const showError = data?.getPriceCandles.length === 0 || !data?.getPriceCandles || !!error;
25
+ return React.createElement("div", {
26
+ "data-testid": "instruments-price-chart-wrapper"
27
+ }, loading && React.createElement("div", {
28
+ className: "lw-mb-[50px] lw-flex lw-h-[425px] lw-w-full lw-items-center lw-border lw-border-solid lw-border-border-primary"
29
+ }, React.createElement(Spinner, {
30
+ size: SpinnerSize.lg
31
+ })), !loading && !showError && React.createElement("div", {
32
+ "data-testid": "instruments-price-chart-widget"
33
+ }, React.createElement("div", {
34
+ className: "lw-flex lw-pt-2"
35
+ }, React.createElement(TimeUnitSwitch, {
36
+ callback: setSelectedTimeUnit,
37
+ options: timeUnitConfig,
38
+ selected: selectedTimeUnit
39
+ })), React.createElement(Chart, {
40
+ values: data?.getPriceCandles
41
+ })));
42
+ };
43
+ export { Main };
44
+ //# sourceMappingURL=Main.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Main.js","names":["useQuery","Spinner","SpinnerSize","TimeUnitSwitch","React","useState","getPriceCandles","Chart","timeUnitConfig","TimeSpanSubset","Main","_ref","division","selectedTimeUnit","setSelectedTimeUnit","Day_1","loading","data","error","variables","timeSpan","fetchPolicy","showError","length","createElement","className","size","lg","callback","options","selected","values"],"sources":["../../../src/InstrumentsPriceChartWidget/Main.tsx"],"sourcesContent":["import { useQuery } from '@apollo/client';\nimport {\n Spinner,\n SpinnerSize,\n TimeUnitSwitch,\n} from '@oanda/labs-widget-common';\nimport React, { useState } from 'react';\n\nimport { getPriceCandles } from '../gql/mock/getPriceCandles';\nimport { type GetPriceCandlesQuery } from '../gql/types/graphql';\nimport { Chart } from './components/Chart';\nimport { timeUnitConfig } from './config';\nimport { type MainProps, TimeSpanSubset } from './types';\n\nconst Main = ({ division }: MainProps) => {\n const [selectedTimeUnit, setSelectedTimeUnit] = useState(\n TimeSpanSubset.Day_1\n );\n\n const { loading, data, error } = useQuery<GetPriceCandlesQuery>(\n getPriceCandles,\n {\n variables: {\n timeSpan: TimeSpanSubset.Day_1,\n division,\n },\n fetchPolicy: 'cache-and-network',\n }\n );\n\n const showError =\n data?.getPriceCandles.length === 0 || !data?.getPriceCandles || !!error;\n\n return (\n <div data-testid=\"instruments-price-chart-wrapper\">\n {loading && (\n <div className=\"lw-mb-[50px] lw-flex lw-h-[425px] lw-w-full lw-items-center lw-border lw-border-solid lw-border-border-primary\">\n <Spinner size={SpinnerSize.lg} />\n </div>\n )}\n\n {!loading && !showError && (\n <div data-testid=\"instruments-price-chart-widget\">\n <div className=\"lw-flex lw-pt-2\">\n <TimeUnitSwitch<TimeSpanSubset>\n callback={setSelectedTimeUnit}\n options={timeUnitConfig}\n selected={selectedTimeUnit}\n />\n </div>\n\n <Chart values={data?.getPriceCandles} />\n </div>\n )}\n </div>\n );\n};\n\nexport { Main };\n"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,gBAAgB;AACzC,SACEC,OAAO,EACPC,WAAW,EACXC,cAAc,QACT,2BAA2B;AAClC,OAAOC,KAAK,IAAIC,QAAQ,QAAQ,OAAO;AAEvC,SAASC,eAAe,QAAQ,6BAA6B;AAE7D,SAASC,KAAK,QAAQ,oBAAoB;AAC1C,SAASC,cAAc,QAAQ,UAAU;AACzC,SAAyBC,cAAc,QAAQ,SAAS;AAExD,MAAMC,IAAI,GAAGC,IAAA,IAA6B;EAAA,IAA5B;IAAEC;EAAoB,CAAC,GAAAD,IAAA;EACnC,MAAM,CAACE,gBAAgB,EAAEC,mBAAmB,CAAC,GAAGT,QAAQ,CACtDI,cAAc,CAACM,KACjB,CAAC;EAED,MAAM;IAAEC,OAAO;IAAEC,IAAI;IAAEC;EAAM,CAAC,GAAGlB,QAAQ,CACvCM,eAAe,EACf;IACEa,SAAS,EAAE;MACTC,QAAQ,EAAEX,cAAc,CAACM,KAAK;MAC9BH;IACF,CAAC;IACDS,WAAW,EAAE;EACf,CACF,CAAC;EAED,MAAMC,SAAS,GACbL,IAAI,EAAEX,eAAe,CAACiB,MAAM,KAAK,CAAC,IAAI,CAACN,IAAI,EAAEX,eAAe,IAAI,CAAC,CAACY,KAAK;EAEzE,OACEd,KAAA,CAAAoB,aAAA;IAAK,eAAY;EAAiC,GAC/CR,OAAO,IACNZ,KAAA,CAAAoB,aAAA;IAAKC,SAAS,EAAC;EAAgH,GAC7HrB,KAAA,CAAAoB,aAAA,CAACvB,OAAO;IAACyB,IAAI,EAAExB,WAAW,CAACyB;EAAG,CAAE,CAC7B,CACN,EAEA,CAACX,OAAO,IAAI,CAACM,SAAS,IACrBlB,KAAA,CAAAoB,aAAA;IAAK,eAAY;EAAgC,GAC/CpB,KAAA,CAAAoB,aAAA;IAAKC,SAAS,EAAC;EAAiB,GAC9BrB,KAAA,CAAAoB,aAAA,CAACrB,cAAc;IACbyB,QAAQ,EAAEd,mBAAoB;IAC9Be,OAAO,EAAErB,cAAe;IACxBsB,QAAQ,EAAEjB;EAAiB,CAC5B,CACE,CAAC,EAENT,KAAA,CAAAoB,aAAA,CAACjB,KAAK;IAACwB,MAAM,EAAEd,IAAI,EAAEX;EAAgB,CAAE,CACpC,CAEJ,CAAC;AAEV,CAAC;AAED,SAASI,IAAI","ignoreList":[]}
@@ -0,0 +1,29 @@
1
+ import { BaseChart, getChartTheme, Theme, useLayoutProvider } from '@oanda/labs-widget-common';
2
+ import { CustomChart, LineChart } from 'echarts/charts';
3
+ import { DatasetComponent, GraphicComponent, GridSimpleComponent } from 'echarts/components';
4
+ import * as echarts from 'echarts/core';
5
+ import { CanvasRenderer } from 'echarts/renderers';
6
+ import React from 'react';
7
+ import { CHART_HEIGHT } from './constants';
8
+ import { getOption } from './getOption';
9
+ echarts.use([GridSimpleComponent, GraphicComponent, LineChart, DatasetComponent, CustomChart, CanvasRenderer]);
10
+ echarts.registerTheme('dark_theme', getChartTheme(Theme.Dark));
11
+ echarts.registerTheme('light_theme', getChartTheme(Theme.Light));
12
+ export const Chart = _ref => {
13
+ let {
14
+ values
15
+ } = _ref;
16
+ const {
17
+ isDark
18
+ } = useLayoutProvider();
19
+ return React.createElement(BaseChart, {
20
+ chartHeight: CHART_HEIGHT,
21
+ echarts: echarts,
22
+ isDark: isDark,
23
+ option: getOption({
24
+ values,
25
+ isDark
26
+ })
27
+ });
28
+ };
29
+ //# sourceMappingURL=Chart.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Chart.js","names":["BaseChart","getChartTheme","Theme","useLayoutProvider","CustomChart","LineChart","DatasetComponent","GraphicComponent","GridSimpleComponent","echarts","CanvasRenderer","React","CHART_HEIGHT","getOption","use","registerTheme","Dark","Light","Chart","_ref","values","isDark","createElement","chartHeight","option"],"sources":["../../../../src/InstrumentsPriceChartWidget/components/Chart.tsx"],"sourcesContent":["import {\n BaseChart,\n getChartTheme,\n Theme,\n useLayoutProvider,\n} from '@oanda/labs-widget-common';\nimport { CustomChart, LineChart } from 'echarts/charts';\nimport {\n DatasetComponent,\n GraphicComponent,\n GridSimpleComponent,\n} from 'echarts/components';\nimport * as echarts from 'echarts/core';\nimport { CanvasRenderer } from 'echarts/renderers';\nimport React from 'react';\n\nimport { CHART_HEIGHT } from './constants';\nimport { getOption } from './getOption';\nimport type { ChartProps } from './types';\n\necharts.use([\n GridSimpleComponent,\n GraphicComponent,\n LineChart,\n DatasetComponent,\n CustomChart,\n CanvasRenderer,\n]);\n\necharts.registerTheme('dark_theme', getChartTheme(Theme.Dark));\necharts.registerTheme('light_theme', getChartTheme(Theme.Light));\n\nexport const Chart = ({ values }: ChartProps) => {\n const { isDark } = useLayoutProvider();\n\n return (\n <BaseChart\n chartHeight={CHART_HEIGHT}\n echarts={echarts}\n isDark={isDark}\n option={getOption({\n values,\n isDark,\n })}\n />\n );\n};\n"],"mappings":"AAAA,SACEA,SAAS,EACTC,aAAa,EACbC,KAAK,EACLC,iBAAiB,QACZ,2BAA2B;AAClC,SAASC,WAAW,EAAEC,SAAS,QAAQ,gBAAgB;AACvD,SACEC,gBAAgB,EAChBC,gBAAgB,EAChBC,mBAAmB,QACd,oBAAoB;AAC3B,OAAO,KAAKC,OAAO,MAAM,cAAc;AACvC,SAASC,cAAc,QAAQ,mBAAmB;AAClD,OAAOC,KAAK,MAAM,OAAO;AAEzB,SAASC,YAAY,QAAQ,aAAa;AAC1C,SAASC,SAAS,QAAQ,aAAa;AAGvCJ,OAAO,CAACK,GAAG,CAAC,CACVN,mBAAmB,EACnBD,gBAAgB,EAChBF,SAAS,EACTC,gBAAgB,EAChBF,WAAW,EACXM,cAAc,CACf,CAAC;AAEFD,OAAO,CAACM,aAAa,CAAC,YAAY,EAAEd,aAAa,CAACC,KAAK,CAACc,IAAI,CAAC,CAAC;AAC9DP,OAAO,CAACM,aAAa,CAAC,aAAa,EAAEd,aAAa,CAACC,KAAK,CAACe,KAAK,CAAC,CAAC;AAEhE,OAAO,MAAMC,KAAK,GAAGC,IAAA,IAA4B;EAAA,IAA3B;IAAEC;EAAmB,CAAC,GAAAD,IAAA;EAC1C,MAAM;IAAEE;EAAO,CAAC,GAAGlB,iBAAiB,CAAC,CAAC;EAEtC,OACEQ,KAAA,CAAAW,aAAA,CAACtB,SAAS;IACRuB,WAAW,EAAEX,YAAa;IAC1BH,OAAO,EAAEA,OAAQ;IACjBY,MAAM,EAAEA,MAAO;IACfG,MAAM,EAAEX,SAAS,CAAC;MAChBO,MAAM;MACNC;IACF,CAAC;EAAE,CACJ,CAAC;AAEN,CAAC","ignoreList":[]}
@@ -0,0 +1,6 @@
1
+ export const X_LABEL_SIZE = 40;
2
+ export const Y_LABEL_SIZE_DESKTOP = 45;
3
+ export const CHART_WIDTH = 9999;
4
+ export const CHART_HEIGHT = 425;
5
+ export const CHART_INTERVAL = 0.01;
6
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","names":["X_LABEL_SIZE","Y_LABEL_SIZE_DESKTOP","CHART_WIDTH","CHART_HEIGHT","CHART_INTERVAL"],"sources":["../../../../src/InstrumentsPriceChartWidget/components/constants.ts"],"sourcesContent":["export const X_LABEL_SIZE = 40;\nexport const Y_LABEL_SIZE_DESKTOP = 45;\nexport const CHART_WIDTH = 9999;\nexport const CHART_HEIGHT = 425;\nexport const CHART_INTERVAL = 0.01;\n"],"mappings":"AAAA,OAAO,MAAMA,YAAY,GAAG,EAAE;AAC9B,OAAO,MAAMC,oBAAoB,GAAG,EAAE;AACtC,OAAO,MAAMC,WAAW,GAAG,IAAI;AAC/B,OAAO,MAAMC,YAAY,GAAG,GAAG;AAC/B,OAAO,MAAMC,cAAc,GAAG,IAAI","ignoreList":[]}
@@ -0,0 +1,8 @@
1
+ export const dailyFormatter = timestamp => {
2
+ const date = new Date(timestamp);
3
+ return date.toLocaleTimeString(undefined, {
4
+ hour: 'numeric',
5
+ hour12: true
6
+ });
7
+ };
8
+ //# sourceMappingURL=formatters.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formatters.js","names":["dailyFormatter","timestamp","date","Date","toLocaleTimeString","undefined","hour","hour12"],"sources":["../../../../src/InstrumentsPriceChartWidget/components/formatters.ts"],"sourcesContent":["export const dailyFormatter = (timestamp: string) => {\n const date = new Date(timestamp);\n return date.toLocaleTimeString(undefined, {\n hour: 'numeric',\n hour12: true,\n });\n};\n"],"mappings":"AAAA,OAAO,MAAMA,cAAc,GAAIC,SAAiB,IAAK;EACnD,MAAMC,IAAI,GAAG,IAAIC,IAAI,CAACF,SAAS,CAAC;EAChC,OAAOC,IAAI,CAACE,kBAAkB,CAACC,SAAS,EAAE;IACxCC,IAAI,EAAE,SAAS;IACfC,MAAM,EAAE;EACV,CAAC,CAAC;AACJ,CAAC","ignoreList":[]}
@@ -0,0 +1,112 @@
1
+ import { colorPalette, getGridLines, getLineCommons } from '@oanda/labs-widget-common';
2
+ import { CHART_HEIGHT, CHART_INTERVAL, CHART_WIDTH, X_LABEL_SIZE, Y_LABEL_SIZE_DESKTOP } from './constants';
3
+ import { dailyFormatter } from './formatters';
4
+ export const getOption = _ref => {
5
+ let {
6
+ values,
7
+ isDark
8
+ } = _ref;
9
+ const priceValues = values.map(d => d.candle.high);
10
+ const timestamps = values.map(d => dailyFormatter(d.time));
11
+ const labelInterval = Math.max(1, Math.floor(timestamps.length / 6));
12
+ const gridLines = getGridLines({
13
+ isDark,
14
+ chartWidth: CHART_WIDTH,
15
+ chartHeight: CHART_HEIGHT,
16
+ xLabelsSize: X_LABEL_SIZE,
17
+ yLabelSize: Y_LABEL_SIZE_DESKTOP,
18
+ bottomLeftBox: false
19
+ });
20
+ return {
21
+ xAxis: {
22
+ type: 'category',
23
+ boundaryGap: false,
24
+ data: timestamps,
25
+ axisTick: {
26
+ show: false
27
+ },
28
+ axisLabel: {
29
+ margin: 10,
30
+ interval: index => index % labelInterval === 0,
31
+ formatter: (value, index) => index % labelInterval === 0 ? value : ''
32
+ },
33
+ splitLine: {
34
+ show: true,
35
+ interval: index => index % labelInterval === 0
36
+ }
37
+ },
38
+ yAxis: {
39
+ type: 'value',
40
+ position: 'right',
41
+ min: value => Math.floor(value.min * 100) / 100 - CHART_INTERVAL,
42
+ max: value => Math.ceil(value.max * 100) / 100 + CHART_INTERVAL,
43
+ interval: CHART_INTERVAL,
44
+ axisLine: {
45
+ show: false
46
+ },
47
+ axisTick: {
48
+ show: false
49
+ },
50
+ axisLabel: {
51
+ margin: 8,
52
+ formatter: value => {
53
+ const dataMin = Math.floor(Math.min(...priceValues) * 100) / 100;
54
+ const dataMax = Math.ceil(Math.max(...priceValues) * 100) / 100;
55
+ if (value < dataMin || value > dataMax) {
56
+ return '';
57
+ }
58
+ return value.toFixed(2);
59
+ }
60
+ },
61
+ splitLine: {
62
+ show: true
63
+ }
64
+ },
65
+ series: [{
66
+ name: 'price-close',
67
+ type: 'line',
68
+ data: priceValues,
69
+ smooth: true,
70
+ symbol: 'none',
71
+ lineStyle: {
72
+ color: colorPalette.navyBlue,
73
+ width: 2
74
+ },
75
+ areaStyle: {
76
+ color: {
77
+ type: 'linear',
78
+ x: 0,
79
+ y: 0,
80
+ x2: 0,
81
+ y2: 1,
82
+ colorStops: [{
83
+ offset: 0,
84
+ color: colorPalette.brightBlue30
85
+ }, {
86
+ offset: 1,
87
+ color: colorPalette.brightBlue
88
+ }]
89
+ }
90
+ }
91
+ }],
92
+ grid: [{
93
+ name: 'main-grid',
94
+ top: 0,
95
+ left: 0,
96
+ right: `${Y_LABEL_SIZE_DESKTOP}px`,
97
+ bottom: `${X_LABEL_SIZE}px`
98
+ }],
99
+ graphic: [...gridLines, {
100
+ ...getLineCommons(isDark),
101
+ top: 0,
102
+ right: 0,
103
+ shape: {
104
+ x1: 0,
105
+ y1: 0,
106
+ x2: 0,
107
+ y2: 0
108
+ }
109
+ }]
110
+ };
111
+ };
112
+ //# sourceMappingURL=getOption.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getOption.js","names":["colorPalette","getGridLines","getLineCommons","CHART_HEIGHT","CHART_INTERVAL","CHART_WIDTH","X_LABEL_SIZE","Y_LABEL_SIZE_DESKTOP","dailyFormatter","getOption","_ref","values","isDark","priceValues","map","d","candle","high","timestamps","time","labelInterval","Math","max","floor","length","gridLines","chartWidth","chartHeight","xLabelsSize","yLabelSize","bottomLeftBox","xAxis","type","boundaryGap","data","axisTick","show","axisLabel","margin","interval","index","formatter","value","splitLine","yAxis","position","min","ceil","axisLine","dataMin","dataMax","toFixed","series","name","smooth","symbol","lineStyle","color","navyBlue","width","areaStyle","x","y","x2","y2","colorStops","offset","brightBlue30","brightBlue","grid","top","left","right","bottom","graphic","shape","x1","y1"],"sources":["../../../../src/InstrumentsPriceChartWidget/components/getOption.ts"],"sourcesContent":["import {\n colorPalette,\n getGridLines,\n getLineCommons,\n} from '@oanda/labs-widget-common';\n\nimport {\n CHART_HEIGHT,\n CHART_INTERVAL,\n CHART_WIDTH,\n X_LABEL_SIZE,\n Y_LABEL_SIZE_DESKTOP,\n} from './constants';\nimport { dailyFormatter } from './formatters';\nimport type { ChartValue, GetOptionType } from './types';\n\nexport const getOption: GetOptionType = ({ values, isDark }) => {\n const priceValues = values.map((d) => d.candle.high);\n\n const timestamps = values.map((d) => dailyFormatter(d.time));\n\n const labelInterval = Math.max(1, Math.floor(timestamps.length / 6));\n\n const gridLines = getGridLines({\n isDark,\n chartWidth: CHART_WIDTH,\n chartHeight: CHART_HEIGHT,\n xLabelsSize: X_LABEL_SIZE,\n yLabelSize: Y_LABEL_SIZE_DESKTOP,\n bottomLeftBox: false,\n });\n\n return {\n xAxis: {\n type: 'category',\n boundaryGap: false,\n data: timestamps,\n axisTick: {\n show: false,\n },\n axisLabel: {\n margin: 10,\n interval: (index: number) => index % labelInterval === 0,\n formatter: (value: string, index: number) =>\n index % labelInterval === 0 ? value : '',\n },\n splitLine: {\n show: true,\n interval: (index: number) => index % labelInterval === 0,\n },\n },\n yAxis: {\n type: 'value',\n position: 'right',\n min: (value: ChartValue) =>\n Math.floor(value.min * 100) / 100 - CHART_INTERVAL,\n max: (value: ChartValue) =>\n Math.ceil(value.max * 100) / 100 + CHART_INTERVAL,\n interval: CHART_INTERVAL,\n axisLine: { show: false },\n axisTick: { show: false },\n axisLabel: {\n margin: 8,\n formatter: (value: number) => {\n const dataMin = Math.floor(Math.min(...priceValues) * 100) / 100;\n const dataMax = Math.ceil(Math.max(...priceValues) * 100) / 100;\n if (value < dataMin || value > dataMax) {\n return '';\n }\n return value.toFixed(2);\n },\n },\n splitLine: {\n show: true,\n },\n },\n series: [\n {\n name: 'price-close',\n type: 'line',\n data: priceValues,\n smooth: true,\n symbol: 'none',\n lineStyle: {\n color: colorPalette.navyBlue,\n width: 2,\n },\n areaStyle: {\n color: {\n type: 'linear',\n x: 0,\n y: 0,\n x2: 0,\n y2: 1,\n colorStops: [\n { offset: 0, color: colorPalette.brightBlue30 },\n { offset: 1, color: colorPalette.brightBlue },\n ],\n },\n },\n },\n ],\n grid: [\n {\n name: 'main-grid',\n top: 0,\n left: 0,\n right: `${Y_LABEL_SIZE_DESKTOP}px`,\n bottom: `${X_LABEL_SIZE}px`,\n },\n ],\n graphic: [\n ...gridLines,\n {\n ...getLineCommons(isDark),\n top: 0,\n right: 0,\n shape: {\n x1: 0,\n y1: 0,\n x2: 0,\n y2: 0,\n },\n },\n ],\n };\n};\n"],"mappings":"AAAA,SACEA,YAAY,EACZC,YAAY,EACZC,cAAc,QACT,2BAA2B;AAElC,SACEC,YAAY,EACZC,cAA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,EAAE;MACT,CAAC;MACDC,SAAS,EAAE;QACTH,KAAK,EAAE;UACLzB,IAAI,EAAE,QAAQ;UACd6B,CAAC,EAAE,CAAC;UACJC,CAAC,EAAE,CAAC;UACJC,EAAE,EAAE,CAAC;UACLC,EAAE,EAAE,CAAC;UACLC,UAAU,EAAE,CACV;YAAEC,MAAM,EAAE,CAAC;YAAET,KAAK,EAAEzD,YAAY,CAACmE;UAAa,CAAC,EAC/C;YAAED,MAAM,EAAE,CAAC;YAAET,KAAK,EAAEzD,YAAY,CAACoE;UAAW,CAAC;QAEjD;MACF;IACF,CAAC,CACF;IACDC,IAAI,EAAE,CACJ;MACEhB,IAAI,EAAE,WAAW;MACjBiB,GAAG,EAAE,CAAC;MACNC,IAAI,EAAE,CAAC;MACPC,KAAK,EAAE,GAAGjE,oBAAoB,IAAI;MAClCkE,MAAM,EAAE,GAAGnE,YAAY;IACzB,CAAC,CACF;IACDoE,OAAO,EAAE,CACP,GAAGjD,SAAS,EACZ;MACE,GAAGvB,cAAc,CAACU,MAAM,CAAC;MACzB0D,GAAG,EAAE,CAAC;MACNE,KAAK,EAAE,CAAC;MACRG,KAAK,EAAE;QACLC,EAAE,EAAE,CAAC;QACLC,EAAE,EAAE,CAAC;QACLd,EAAE,EAAE,CAAC;QACLC,EAAE,EAAE;MACN;IACF,CAAC;EAEL,CAAC;AACH,CAAC","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","names":[],"sources":["../../../../src/InstrumentsPriceChartWidget/components/types.ts"],"sourcesContent":["import type { EChartsOption } from 'echarts';\n\nimport type { CandlesData } from '../../gql/types/graphql';\n\nexport interface ChartProps {\n values: CandlesData[];\n}\n\nexport interface GetOptionProps {\n values: CandlesData[];\n isDark: boolean;\n}\n\nexport type GetOptionType = (props: GetOptionProps) => EChartsOption;\n\nexport interface ChartValue {\n min: number;\n max: number;\n}\n"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,39 @@
1
+ import { TimeSpanSubset } from './types';
2
+ const timeUnitConfig = [{
3
+ value: TimeSpanSubset.Day_1,
4
+ label: '1d',
5
+ tooltipLabel: {
6
+ translationKey: 'day',
7
+ count: 1
8
+ }
9
+ }, {
10
+ value: TimeSpanSubset.Week_1,
11
+ label: '1w',
12
+ tooltipLabel: {
13
+ translationKey: 'week',
14
+ count: 1
15
+ }
16
+ }, {
17
+ value: TimeSpanSubset.Month_1,
18
+ label: '1m',
19
+ tooltipLabel: {
20
+ translationKey: 'month',
21
+ count: 1
22
+ }
23
+ }, {
24
+ value: TimeSpanSubset.Month_6,
25
+ label: '6m',
26
+ tooltipLabel: {
27
+ translationKey: 'month',
28
+ count: 6
29
+ }
30
+ }, {
31
+ value: TimeSpanSubset.Year_1,
32
+ label: '1y',
33
+ tooltipLabel: {
34
+ translationKey: 'year',
35
+ count: 1
36
+ }
37
+ }];
38
+ export { timeUnitConfig };
39
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.js","names":["TimeSpanSubset","timeUnitConfig","value","Day_1","label","tooltipLabel","translationKey","count","Week_1","Month_1","Month_6","Year_1"],"sources":["../../../src/InstrumentsPriceChartWidget/config.ts"],"sourcesContent":["import { TimeSpanSubset } from './types';\n\nconst timeUnitConfig = [\n {\n value: TimeSpanSubset.Day_1,\n label: '1d',\n tooltipLabel: {\n translationKey: 'day',\n count: 1,\n },\n },\n {\n value: TimeSpanSubset.Week_1,\n label: '1w',\n tooltipLabel: {\n translationKey: 'week',\n count: 1,\n },\n },\n {\n value: TimeSpanSubset.Month_1,\n label: '1m',\n tooltipLabel: {\n translationKey: 'month',\n count: 1,\n },\n },\n\n {\n value: TimeSpanSubset.Month_6,\n label: '6m',\n tooltipLabel: {\n translationKey: 'month',\n count: 6,\n },\n },\n {\n value: TimeSpanSubset.Year_1,\n label: '1y',\n tooltipLabel: {\n translationKey: 'year',\n count: 1,\n },\n },\n];\n\nexport { timeUnitConfig };\n"],"mappings":"AAAA,SAASA,cAAc,QAAQ,SAAS;AAExC,MAAMC,cAAc,GAAG,CACrB;EACEC,KAAK,EAAEF,cAAc,CAACG,KAAK;EAC3BC,KAAK,EAAE,IAAI;EACXC,YAAY,EAAE;IACZC,cAAc,EAAE,KAAK;IACrBC,KAAK,EAAE;EACT;AACF,CAAC,EACD;EACEL,KAAK,EAAEF,cAAc,CAACQ,MAAM;EAC5BJ,KAAK,EAAE,IAAI;EACXC,YAAY,EAAE;IACZC,cAAc,EAAE,MAAM;IACtBC,KAAK,EAAE;EACT;AACF,CAAC,EACD;EACEL,KAAK,EAAEF,cAAc,CAACS,OAAO;EAC7BL,KAAK,EAAE,IAAI;EACXC,YAAY,EAAE;IACZC,cAAc,EAAE,OAAO;IACvBC,KAAK,EAAE;EACT;AACF,CAAC,EAED;EACEL,KAAK,EAAEF,cAAc,CAACU,OAAO;EAC7BN,KAAK,EAAE,IAAI;EACXC,YAAY,EAAE;IACZC,cAAc,EAAE,OAAO;IACvBC,KAAK,EAAE;EACT;AACF,CAAC,EACD;EACEL,KAAK,EAAEF,cAAc,CAACW,MAAM;EAC5BP,KAAK,EAAE,IAAI;EACXC,YAAY,EAAE;IACZC,cAAc,EAAE,MAAM;IACtBC,KAAK,EAAE;EACT;AACF,CAAC,CACF;AAED,SAASN,cAAc","ignoreList":[]}
@@ -0,0 +1,3 @@
1
+ export * from './InstrumentsPriceChartWidget';
2
+ export * from './types';
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../src/InstrumentsPriceChartWidget/index.ts"],"sourcesContent":["export * from './InstrumentsPriceChartWidget';\nexport * from './types';\n"],"mappings":"AAAA,cAAc,+BAA+B;AAC7C,cAAc,SAAS","ignoreList":[]}
@@ -0,0 +1,39 @@
1
+ import { validateLocale, validateToolParams } from '@oanda/labs-widget-common';
2
+ import React from 'react';
3
+ import { createRoot } from 'react-dom/client';
4
+ import { Division } from '../gql/types/graphql';
5
+ import { InstrumentsPriceChartWidget } from './InstrumentsPriceChartWidget';
6
+ const {
7
+ graphqlUrl
8
+ } = window.widgetsConfig || {};
9
+ const dataInstrumentsPriceChartParamsElements = document.querySelectorAll('div[data-instruments-price-chart-params]');
10
+ dataInstrumentsPriceChartParamsElements.forEach(element => {
11
+ const root = createRoot(element);
12
+ const params = element.getAttribute('data-instruments-price-chart-params');
13
+ const mode = element.getAttribute('data-mode');
14
+ const {
15
+ division,
16
+ locale
17
+ } = JSON.parse(params);
18
+ const isParamError = validateToolParams({
19
+ division,
20
+ locale,
21
+ graphqlUrl
22
+ }, [{
23
+ name: 'locale',
24
+ valueCheck: value => validateLocale(value)
25
+ }, {
26
+ name: 'division',
27
+ valueCheck: value => Object.values(Division).includes(value)
28
+ }, {
29
+ name: 'graphqlUrl'
30
+ }]);
31
+ root.render(React.createElement(InstrumentsPriceChartWidget, {
32
+ division: division,
33
+ graphqlUrl: graphqlUrl,
34
+ isParamError: isParamError,
35
+ locale: locale,
36
+ theme: mode
37
+ }));
38
+ });
39
+ //# sourceMappingURL=render.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"render.js","names":["validateLocale","validateToolParams","React","createRoot","Division","InstrumentsPriceChartWidget","graphqlUrl","window","widgetsConfig","dataInstrumentsPriceChartParamsElements","document","querySelectorAll","forEach","element","root","params","getAttribute","mode","division","locale","JSON","parse","isParamError","name","valueCheck","value","Object","values","includes","render","createElement","theme"],"sources":["../../../src/InstrumentsPriceChartWidget/render.tsx"],"sourcesContent":["import type { Theme } from '@oanda/labs-widget-common';\nimport { validateLocale, validateToolParams } from '@oanda/labs-widget-common';\nimport React from 'react';\nimport { createRoot } from 'react-dom/client';\n\nimport { Division } from '../gql/types/graphql';\nimport { InstrumentsPriceChartWidget } from './InstrumentsPriceChartWidget';\n\nconst { graphqlUrl } = window.widgetsConfig || {};\n\nconst dataInstrumentsPriceChartParamsElements = document.querySelectorAll(\n 'div[data-instruments-price-chart-params]'\n);\n\ndataInstrumentsPriceChartParamsElements.forEach((element) => {\n const root = createRoot(element);\n const params = element.getAttribute('data-instruments-price-chart-params');\n const mode = element.getAttribute('data-mode');\n const { division, locale } = JSON.parse(params as string);\n\n const isParamError = validateToolParams(\n {\n division,\n locale,\n graphqlUrl,\n },\n [\n {\n name: 'locale',\n valueCheck: (value: string | undefined) => validateLocale(value),\n },\n {\n name: 'division',\n valueCheck: (value: Division) =>\n Object.values(Division).includes(value),\n },\n {\n name: 'graphqlUrl',\n },\n ]\n );\n\n root.render(\n <InstrumentsPriceChartWidget\n division={division}\n graphqlUrl={graphqlUrl}\n isParamError={isParamError}\n locale={locale}\n theme={mode as Theme}\n />\n );\n});\n"],"mappings":"AACA,SAASA,cAAc,EAAEC,kBAAkB,QAAQ,2BAA2B;AAC9E,OAAOC,KAAK,MAAM,OAAO;AACzB,SAASC,UAAU,QAAQ,kBAAkB;AAE7C,SAASC,QAAQ,QAAQ,sBAAsB;AAC/C,SAASC,2BAA2B,QAAQ,+BAA+B;AAE3E,MAAM;EAAEC;AAAW,CAAC,GAAGC,MAAM,CAACC,aAAa,IAAI,CAAC,CAAC;AAEjD,MAAMC,uCAAuC,GAAGC,QAAQ,CAACC,gBAAgB,CACvE,0CACF,CAAC;AAEDF,uCAAuC,CAACG,OAAO,CAAEC,OAAO,IAAK;EAC3D,MAAMC,IAAI,GAAGX,UAAU,CAACU,OAAO,CAAC;EAChC,MAAME,MAAM,GAAGF,OAAO,CAACG,YAAY,CAAC,qCAAqC,CAAC;EAC1E,MAAMC,IAAI,GAAGJ,OAAO,CAACG,YAAY,CAAC,WAAW,CAAC;EAC9C,MAAM;IAAEE,QAAQ;IAAEC;EAAO,CAAC,GAAGC,IAAI,CAACC,KAAK,CAACN,MAAgB,CAAC;EAEzD,MAAMO,YAAY,GAAGrB,kBAAkB,CACrC;IACEiB,QAAQ;IACRC,MAAM;IACNb;EACF,CAAC,EACD,CACE;IACEiB,IAAI,EAAE,QAAQ;IACdC,U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