react-native-wagmi-charts 2.4.1 → 2.5.2

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 (335) hide show
  1. package/README.md +6 -6
  2. package/lib/commonjs/charts/candle/Candle.js +1 -1
  3. package/lib/commonjs/charts/candle/Candle.js.map +1 -1
  4. package/lib/commonjs/charts/candle/Candles.js +1 -1
  5. package/lib/commonjs/charts/candle/Candles.js.map +1 -1
  6. package/lib/commonjs/charts/candle/Chart.js +1 -1
  7. package/lib/commonjs/charts/candle/Chart.js.map +1 -1
  8. package/lib/commonjs/charts/candle/Context.js +1 -1
  9. package/lib/commonjs/charts/candle/Context.js.map +1 -1
  10. package/lib/commonjs/charts/candle/Crosshair.js +1 -1
  11. package/lib/commonjs/charts/candle/Crosshair.js.map +1 -1
  12. package/lib/commonjs/charts/candle/CrosshairTooltip.js +1 -1
  13. package/lib/commonjs/charts/candle/CrosshairTooltip.js.map +1 -1
  14. package/lib/commonjs/charts/candle/DatetimeText.js +0 -3
  15. package/lib/commonjs/charts/candle/DatetimeText.js.map +1 -1
  16. package/lib/commonjs/charts/candle/Line.js +3 -5
  17. package/lib/commonjs/charts/candle/Line.js.map +1 -1
  18. package/lib/commonjs/charts/candle/PriceText.js +0 -3
  19. package/lib/commonjs/charts/candle/PriceText.js.map +1 -1
  20. package/lib/commonjs/charts/candle/index.js.map +1 -1
  21. package/lib/commonjs/charts/candle/types.js.map +1 -1
  22. package/lib/commonjs/charts/candle/useCandleData.js.map +1 -1
  23. package/lib/commonjs/charts/candle/useCandlestickChart.js +1 -1
  24. package/lib/commonjs/charts/candle/useCandlestickChart.js.map +1 -1
  25. package/lib/commonjs/charts/candle/useDatetime.js.map +1 -1
  26. package/lib/commonjs/charts/candle/usePrice.js.map +1 -1
  27. package/lib/commonjs/charts/candle/utils/getDomain.js.map +1 -1
  28. package/lib/commonjs/charts/candle/utils/getHeight.js.map +1 -1
  29. package/lib/commonjs/charts/candle/utils/getPrice.js.map +1 -1
  30. package/lib/commonjs/charts/candle/utils/getY.js.map +1 -1
  31. package/lib/commonjs/charts/candle/utils/index.js.map +1 -1
  32. package/lib/commonjs/charts/line/Chart.js +4 -5
  33. package/lib/commonjs/charts/line/Chart.js.map +1 -1
  34. package/lib/commonjs/charts/line/ChartPath.js +9 -3
  35. package/lib/commonjs/charts/line/ChartPath.js.map +1 -1
  36. package/lib/commonjs/charts/line/Context.js +3 -2
  37. package/lib/commonjs/charts/line/Context.js.map +1 -1
  38. package/lib/commonjs/charts/line/Cursor.js +3 -3
  39. package/lib/commonjs/charts/line/Cursor.js.map +1 -1
  40. package/lib/commonjs/charts/line/CursorCrosshair.js +1 -1
  41. package/lib/commonjs/charts/line/CursorCrosshair.js.map +1 -1
  42. package/lib/commonjs/charts/line/CursorLine.js +1 -1
  43. package/lib/commonjs/charts/line/CursorLine.js.map +1 -1
  44. package/lib/commonjs/charts/line/Data.js +3 -5
  45. package/lib/commonjs/charts/line/Data.js.map +1 -1
  46. package/lib/commonjs/charts/line/DatetimeText.js +0 -3
  47. package/lib/commonjs/charts/line/DatetimeText.js.map +1 -1
  48. package/lib/commonjs/charts/line/Dot.js +3 -3
  49. package/lib/commonjs/charts/line/Dot.js.map +1 -1
  50. package/lib/commonjs/charts/line/Gradient.js +1 -1
  51. package/lib/commonjs/charts/line/Gradient.js.map +1 -1
  52. package/lib/commonjs/charts/line/Group.js +2 -4
  53. package/lib/commonjs/charts/line/Group.js.map +1 -1
  54. package/lib/commonjs/charts/line/Highlight.js +1 -1
  55. package/lib/commonjs/charts/line/Highlight.js.map +1 -1
  56. package/lib/commonjs/charts/line/HorizontalLine.js +1 -1
  57. package/lib/commonjs/charts/line/HorizontalLine.js.map +1 -1
  58. package/lib/commonjs/charts/line/HoverTrap/index.js +1 -3
  59. package/lib/commonjs/charts/line/HoverTrap/index.js.map +1 -1
  60. package/lib/commonjs/charts/line/HoverTrap/index.web.js +3 -3
  61. package/lib/commonjs/charts/line/HoverTrap/index.web.js.map +1 -1
  62. package/lib/commonjs/charts/line/LineChartPathContext.js.map +1 -1
  63. package/lib/commonjs/charts/line/Path.js +1 -1
  64. package/lib/commonjs/charts/line/Path.js.map +1 -1
  65. package/lib/commonjs/charts/line/PriceText.js +0 -3
  66. package/lib/commonjs/charts/line/PriceText.js.map +1 -1
  67. package/lib/commonjs/charts/line/Tooltip.js +1 -1
  68. package/lib/commonjs/charts/line/Tooltip.js.map +1 -1
  69. package/lib/commonjs/charts/line/index.js.map +1 -1
  70. package/lib/commonjs/charts/line/types.js.map +1 -1
  71. package/lib/commonjs/charts/line/useAnimatedPath.js.map +1 -1
  72. package/lib/commonjs/charts/line/useCurrentY.js.map +1 -1
  73. package/lib/commonjs/charts/line/useDatetime.js +4 -2
  74. package/lib/commonjs/charts/line/useDatetime.js.map +1 -1
  75. package/lib/commonjs/charts/line/useLineChart.js +1 -1
  76. package/lib/commonjs/charts/line/useLineChart.js.map +1 -1
  77. package/lib/commonjs/charts/line/usePrice.js +6 -1
  78. package/lib/commonjs/charts/line/usePrice.js.map +1 -1
  79. package/lib/commonjs/charts/line/utils/getArea.js +2 -2
  80. package/lib/commonjs/charts/line/utils/getArea.js.map +1 -1
  81. package/lib/commonjs/charts/line/utils/getDomain.js.map +1 -1
  82. package/lib/commonjs/charts/line/utils/getPath.js +2 -2
  83. package/lib/commonjs/charts/line/utils/getPath.js.map +1 -1
  84. package/lib/commonjs/charts/line/utils/getXPositionForCurve.js +5 -1
  85. package/lib/commonjs/charts/line/utils/getXPositionForCurve.js.map +1 -1
  86. package/lib/commonjs/charts/line/utils/index.js.map +1 -1
  87. package/lib/commonjs/charts/line/utils/interpolatePath.js.map +1 -1
  88. package/lib/commonjs/charts/line/utils/lineChartDataPropToArray.js.map +1 -1
  89. package/lib/commonjs/components/AnimatedText.js +1 -1
  90. package/lib/commonjs/components/AnimatedText.js.map +1 -1
  91. package/lib/commonjs/index.js.map +1 -1
  92. package/lib/commonjs/utils/formatDatetime.js.map +1 -1
  93. package/lib/commonjs/utils/formatPrice.js.map +1 -1
  94. package/lib/commonjs/utils/index.js.map +1 -1
  95. package/lib/commonjs/utils/usePrevious.js +1 -1
  96. package/lib/commonjs/utils/usePrevious.js.map +1 -1
  97. package/lib/module/charts/candle/Candle.js.map +1 -1
  98. package/lib/module/charts/candle/Candles.js.map +1 -1
  99. package/lib/module/charts/candle/Chart.js.map +1 -1
  100. package/lib/module/charts/candle/Context.js.map +1 -1
  101. package/lib/module/charts/candle/Crosshair.js.map +1 -1
  102. package/lib/module/charts/candle/CrosshairTooltip.js.map +1 -1
  103. package/lib/module/charts/candle/DatetimeText.js +0 -1
  104. package/lib/module/charts/candle/DatetimeText.js.map +1 -1
  105. package/lib/module/charts/candle/Line.js +0 -1
  106. package/lib/module/charts/candle/Line.js.map +1 -1
  107. package/lib/module/charts/candle/PriceText.js +0 -1
  108. package/lib/module/charts/candle/PriceText.js.map +1 -1
  109. package/lib/module/charts/candle/index.js.map +1 -1
  110. package/lib/module/charts/candle/types.js.map +1 -1
  111. package/lib/module/charts/candle/useCandleData.js.map +1 -1
  112. package/lib/module/charts/candle/useCandlestickChart.js.map +1 -1
  113. package/lib/module/charts/candle/useDatetime.js.map +1 -1
  114. package/lib/module/charts/candle/usePrice.js.map +1 -1
  115. package/lib/module/charts/candle/utils/getDomain.js.map +1 -1
  116. package/lib/module/charts/candle/utils/getHeight.js.map +1 -1
  117. package/lib/module/charts/candle/utils/getPrice.js.map +1 -1
  118. package/lib/module/charts/candle/utils/getY.js.map +1 -1
  119. package/lib/module/charts/candle/utils/index.js.map +1 -1
  120. package/lib/module/charts/line/Chart.js +3 -4
  121. package/lib/module/charts/line/Chart.js.map +1 -1
  122. package/lib/module/charts/line/ChartPath.js +8 -2
  123. package/lib/module/charts/line/ChartPath.js.map +1 -1
  124. package/lib/module/charts/line/Context.js +2 -1
  125. package/lib/module/charts/line/Context.js.map +1 -1
  126. package/lib/module/charts/line/Cursor.js +2 -2
  127. package/lib/module/charts/line/Cursor.js.map +1 -1
  128. package/lib/module/charts/line/CursorCrosshair.js.map +1 -1
  129. package/lib/module/charts/line/CursorLine.js.map +1 -1
  130. package/lib/module/charts/line/Data.js +1 -1
  131. package/lib/module/charts/line/Data.js.map +1 -1
  132. package/lib/module/charts/line/DatetimeText.js +0 -1
  133. package/lib/module/charts/line/DatetimeText.js.map +1 -1
  134. package/lib/module/charts/line/Dot.js +2 -2
  135. package/lib/module/charts/line/Dot.js.map +1 -1
  136. package/lib/module/charts/line/Gradient.js.map +1 -1
  137. package/lib/module/charts/line/Group.js +0 -1
  138. package/lib/module/charts/line/Group.js.map +1 -1
  139. package/lib/module/charts/line/Highlight.js.map +1 -1
  140. package/lib/module/charts/line/HorizontalLine.js.map +1 -1
  141. package/lib/module/charts/line/HoverTrap/index.js +0 -1
  142. package/lib/module/charts/line/HoverTrap/index.js.map +1 -1
  143. package/lib/module/charts/line/HoverTrap/index.web.js +2 -2
  144. package/lib/module/charts/line/HoverTrap/index.web.js.map +1 -1
  145. package/lib/module/charts/line/LineChartPathContext.js.map +1 -1
  146. package/lib/module/charts/line/Path.js.map +1 -1
  147. package/lib/module/charts/line/PriceText.js +0 -1
  148. package/lib/module/charts/line/PriceText.js.map +1 -1
  149. package/lib/module/charts/line/Tooltip.js.map +1 -1
  150. package/lib/module/charts/line/index.js.map +1 -1
  151. package/lib/module/charts/line/types.js.map +1 -1
  152. package/lib/module/charts/line/useAnimatedPath.js.map +1 -1
  153. package/lib/module/charts/line/useCurrentY.js.map +1 -1
  154. package/lib/module/charts/line/useDatetime.js +4 -2
  155. package/lib/module/charts/line/useDatetime.js.map +1 -1
  156. package/lib/module/charts/line/useLineChart.js.map +1 -1
  157. package/lib/module/charts/line/usePrice.js +6 -1
  158. package/lib/module/charts/line/usePrice.js.map +1 -1
  159. package/lib/module/charts/line/utils/getArea.js +1 -1
  160. package/lib/module/charts/line/utils/getArea.js.map +1 -1
  161. package/lib/module/charts/line/utils/getDomain.js.map +1 -1
  162. package/lib/module/charts/line/utils/getPath.js +1 -1
  163. package/lib/module/charts/line/utils/getPath.js.map +1 -1
  164. package/lib/module/charts/line/utils/getXPositionForCurve.js +5 -1
  165. package/lib/module/charts/line/utils/getXPositionForCurve.js.map +1 -1
  166. package/lib/module/charts/line/utils/index.js.map +1 -1
  167. package/lib/module/charts/line/utils/interpolatePath.js.map +1 -1
  168. package/lib/module/charts/line/utils/lineChartDataPropToArray.js.map +1 -1
  169. package/lib/module/components/AnimatedText.js.map +1 -1
  170. package/lib/module/index.js.map +1 -1
  171. package/lib/module/utils/formatDatetime.js.map +1 -1
  172. package/lib/module/utils/formatPrice.js.map +1 -1
  173. package/lib/module/utils/index.js.map +1 -1
  174. package/lib/module/utils/usePrevious.js.map +1 -1
  175. package/lib/typescript/src/charts/candle/Candle.d.ts +2 -2
  176. package/lib/typescript/src/charts/candle/Candle.d.ts.map +1 -1
  177. package/lib/typescript/src/charts/candle/Candles.d.ts +1 -2
  178. package/lib/typescript/src/charts/candle/Candles.d.ts.map +1 -1
  179. package/lib/typescript/src/charts/candle/Chart.d.ts +1 -1
  180. package/lib/typescript/src/charts/candle/Chart.d.ts.map +1 -1
  181. package/lib/typescript/src/charts/candle/Context.d.ts +1 -1
  182. package/lib/typescript/src/charts/candle/Context.d.ts.map +1 -1
  183. package/lib/typescript/src/charts/candle/Crosshair.d.ts +1 -1
  184. package/lib/typescript/src/charts/candle/Crosshair.d.ts.map +1 -1
  185. package/lib/typescript/src/charts/candle/CrosshairTooltip.d.ts +4 -4
  186. package/lib/typescript/src/charts/candle/CrosshairTooltip.d.ts.map +1 -1
  187. package/lib/typescript/src/charts/candle/DatetimeText.d.ts +1 -2
  188. package/lib/typescript/src/charts/candle/DatetimeText.d.ts.map +1 -1
  189. package/lib/typescript/src/charts/candle/Line.d.ts +1 -2
  190. package/lib/typescript/src/charts/candle/Line.d.ts.map +1 -1
  191. package/lib/typescript/src/charts/candle/PriceText.d.ts +1 -2
  192. package/lib/typescript/src/charts/candle/PriceText.d.ts.map +1 -1
  193. package/lib/typescript/src/charts/candle/index.d.ts +2 -3
  194. package/lib/typescript/src/charts/candle/index.d.ts.map +1 -1
  195. package/lib/typescript/src/charts/candle/types.d.ts +3 -3
  196. package/lib/typescript/src/charts/candle/types.d.ts.map +1 -1
  197. package/lib/typescript/src/charts/candle/useCandleData.d.ts +2 -2
  198. package/lib/typescript/src/charts/candle/useCandleData.d.ts.map +1 -1
  199. package/lib/typescript/src/charts/candle/useDatetime.d.ts +3 -3
  200. package/lib/typescript/src/charts/candle/useDatetime.d.ts.map +1 -1
  201. package/lib/typescript/src/charts/candle/usePrice.d.ts +3 -3
  202. package/lib/typescript/src/charts/candle/usePrice.d.ts.map +1 -1
  203. package/lib/typescript/src/charts/line/Chart.d.ts +1 -1
  204. package/lib/typescript/src/charts/line/Chart.d.ts.map +1 -1
  205. package/lib/typescript/src/charts/line/ChartPath.d.ts +1 -1
  206. package/lib/typescript/src/charts/line/ChartPath.d.ts.map +1 -1
  207. package/lib/typescript/src/charts/line/Context.d.ts +1 -1
  208. package/lib/typescript/src/charts/line/Context.d.ts.map +1 -1
  209. package/lib/typescript/src/charts/line/Cursor.d.ts +1 -1
  210. package/lib/typescript/src/charts/line/Cursor.d.ts.map +1 -1
  211. package/lib/typescript/src/charts/line/CursorCrosshair.d.ts +1 -1
  212. package/lib/typescript/src/charts/line/CursorCrosshair.d.ts.map +1 -1
  213. package/lib/typescript/src/charts/line/CursorLine.d.ts +1 -1
  214. package/lib/typescript/src/charts/line/CursorLine.d.ts.map +1 -1
  215. package/lib/typescript/src/charts/line/Data.d.ts +3 -4
  216. package/lib/typescript/src/charts/line/Data.d.ts.map +1 -1
  217. package/lib/typescript/src/charts/line/DatetimeText.d.ts +1 -2
  218. package/lib/typescript/src/charts/line/DatetimeText.d.ts.map +1 -1
  219. package/lib/typescript/src/charts/line/Dot.d.ts +1 -2
  220. package/lib/typescript/src/charts/line/Dot.d.ts.map +1 -1
  221. package/lib/typescript/src/charts/line/Gradient.d.ts +1 -1
  222. package/lib/typescript/src/charts/line/Gradient.d.ts.map +1 -1
  223. package/lib/typescript/src/charts/line/Group.d.ts +1 -2
  224. package/lib/typescript/src/charts/line/Group.d.ts.map +1 -1
  225. package/lib/typescript/src/charts/line/Highlight.d.ts +1 -2
  226. package/lib/typescript/src/charts/line/Highlight.d.ts.map +1 -1
  227. package/lib/typescript/src/charts/line/HorizontalLine.d.ts +1 -2
  228. package/lib/typescript/src/charts/line/HorizontalLine.d.ts.map +1 -1
  229. package/lib/typescript/src/charts/line/HoverTrap/index.d.ts +1 -2
  230. package/lib/typescript/src/charts/line/HoverTrap/index.d.ts.map +1 -1
  231. package/lib/typescript/src/charts/line/HoverTrap/index.web.d.ts +1 -2
  232. package/lib/typescript/src/charts/line/HoverTrap/index.web.d.ts.map +1 -1
  233. package/lib/typescript/src/charts/line/Path.d.ts +1 -2
  234. package/lib/typescript/src/charts/line/Path.d.ts.map +1 -1
  235. package/lib/typescript/src/charts/line/PriceText.d.ts +1 -2
  236. package/lib/typescript/src/charts/line/PriceText.d.ts.map +1 -1
  237. package/lib/typescript/src/charts/line/Tooltip.d.ts +1 -1
  238. package/lib/typescript/src/charts/line/Tooltip.d.ts.map +1 -1
  239. package/lib/typescript/src/charts/line/index.d.ts +1 -2
  240. package/lib/typescript/src/charts/line/index.d.ts.map +1 -1
  241. package/lib/typescript/src/charts/line/types.d.ts +4 -4
  242. package/lib/typescript/src/charts/line/types.d.ts.map +1 -1
  243. package/lib/typescript/src/charts/line/useCurrentY.d.ts +1 -3
  244. package/lib/typescript/src/charts/line/useCurrentY.d.ts.map +1 -1
  245. package/lib/typescript/src/charts/line/useDatetime.d.ts +2 -6
  246. package/lib/typescript/src/charts/line/useDatetime.d.ts.map +1 -1
  247. package/lib/typescript/src/charts/line/useLineChart.d.ts +5 -13
  248. package/lib/typescript/src/charts/line/useLineChart.d.ts.map +1 -1
  249. package/lib/typescript/src/charts/line/usePrice.d.ts +2 -6
  250. package/lib/typescript/src/charts/line/usePrice.d.ts.map +1 -1
  251. package/lib/typescript/src/charts/line/utils/getXPositionForCurve.d.ts.map +1 -1
  252. package/lib/typescript/src/components/AnimatedText.d.ts +4 -5
  253. package/lib/typescript/src/components/AnimatedText.d.ts.map +1 -1
  254. package/package.json +19 -13
  255. package/src/charts/candle/Candle.tsx +2 -8
  256. package/src/charts/candle/Context.tsx +3 -4
  257. package/src/charts/candle/CrosshairTooltip.tsx +12 -5
  258. package/src/charts/candle/DatetimeText.tsx +0 -1
  259. package/src/charts/candle/Line.tsx +0 -1
  260. package/src/charts/candle/PriceText.tsx +0 -1
  261. package/src/charts/candle/types.ts +3 -3
  262. package/src/charts/candle/useCandleData.ts +4 -4
  263. package/src/charts/candle/useDatetime.ts +4 -3
  264. package/src/charts/candle/usePrice.ts +4 -3
  265. package/src/charts/line/Chart.tsx +4 -5
  266. package/src/charts/line/ChartPath.tsx +4 -0
  267. package/src/charts/line/Context.tsx +10 -7
  268. package/src/charts/line/Cursor.tsx +3 -3
  269. package/src/charts/line/Data.tsx +1 -1
  270. package/src/charts/line/DatetimeText.tsx +0 -1
  271. package/src/charts/line/Dot.tsx +2 -0
  272. package/src/charts/line/Group.tsx +0 -1
  273. package/src/charts/line/HoverTrap/index.tsx +0 -2
  274. package/src/charts/line/HoverTrap/index.web.tsx +2 -2
  275. package/src/charts/line/PriceText.tsx +0 -1
  276. package/src/charts/line/types.ts +4 -4
  277. package/src/charts/line/useDatetime.ts +7 -2
  278. package/src/charts/line/usePrice.ts +8 -2
  279. package/src/charts/line/utils/getArea.ts +1 -1
  280. package/src/charts/line/utils/getPath.ts +1 -1
  281. package/src/charts/line/utils/getXPositionForCurve.ts +11 -1
  282. package/src/components/AnimatedText.tsx +3 -3
  283. package/src/utils/formatPrice.ts +1 -1
  284. package/.DS_Store +0 -0
  285. package/.editorconfig +0 -15
  286. package/.gitattributes +0 -3
  287. package/.gitignore +0 -60
  288. package/.husky/pre-commit +0 -4
  289. package/.prettierrc.js +0 -5
  290. package/.yarnrc +0 -3
  291. package/babel.config.js +0 -3
  292. package/example/.expo/README.md +0 -8
  293. package/example/.expo/devices.json +0 -3
  294. package/example/README.md +0 -41
  295. package/example/app.json +0 -22
  296. package/example/babel.config.js +0 -23
  297. package/example/index.js +0 -8
  298. package/example/metro.config.js +0 -40
  299. package/example/package.json +0 -42
  300. package/example/src/App.tsx +0 -64
  301. package/example/src/CandlestickChart.tsx +0 -155
  302. package/example/src/LineChart.tsx +0 -268
  303. package/example/src/data/candlestick-data.json +0 -142
  304. package/example/src/data/candlestick-data2.json +0 -142
  305. package/example/src/data/line-data-non-linear-domain.json +0 -34
  306. package/example/src/data/line-data.json +0 -82
  307. package/example/src/data/line-data2.json +0 -82
  308. package/example/src/line-data-gh.json +0 -18
  309. package/example/tsconfig.json +0 -6
  310. package/example/webpack.config.js +0 -25
  311. package/example/yarn.lock +0 -9306
  312. package/lib/commonjs/charts/candle/HoverTrap/index.web.js +0 -106
  313. package/lib/commonjs/charts/candle/HoverTrap/index.web.js.map +0 -1
  314. package/lib/commonjs/charts/candle/utils.js +0 -50
  315. package/lib/commonjs/charts/candle/utils.js.map +0 -1
  316. package/lib/module/charts/candle/HoverTrap/index.web.js +0 -97
  317. package/lib/module/charts/candle/HoverTrap/index.web.js.map +0 -1
  318. package/lib/module/charts/candle/utils.js +0 -41
  319. package/lib/module/charts/candle/utils.js.map +0 -1
  320. package/lib/typescript/example/src/App.d.ts +0 -4
  321. package/lib/typescript/example/src/App.d.ts.map +0 -1
  322. package/lib/typescript/example/src/CandlestickChart.d.ts +0 -3
  323. package/lib/typescript/example/src/CandlestickChart.d.ts.map +0 -1
  324. package/lib/typescript/example/src/LineChart.d.ts +0 -3
  325. package/lib/typescript/example/src/LineChart.d.ts.map +0 -1
  326. package/lib/typescript/src/charts/candle/HoverTrap/index.web.d.ts +0 -3
  327. package/lib/typescript/src/charts/candle/HoverTrap/index.web.d.ts.map +0 -1
  328. package/lib/typescript/src/charts/candle/utils.d.ts +0 -18
  329. package/lib/typescript/src/charts/candle/utils.d.ts.map +0 -1
  330. package/scripts/bootstrap.js +0 -24
  331. package/src/charts/candle/HoverTrap/index.web.tsx +0 -109
  332. package/src/charts/candle/utils.ts +0 -56
  333. package/tsconfig.build.json +0 -5
  334. package/tsconfig.json +0 -28
  335. package/yarn.lock +0 -8529
@@ -1,42 +0,0 @@
1
- {
2
- "name": "react-native-wagmi-charts-example",
3
- "description": "Example app for react-native-wagmi-charts",
4
- "version": "0.0.1",
5
- "private": true,
6
- "main": "index",
7
- "scripts": {
8
- "android": "npx expo start --android",
9
- "ios": "npx expo start --ios",
10
- "web": "npx expo start --web",
11
- "start": "npx expo start",
12
- "test": "jest",
13
- "postinstall": "patch-package"
14
- },
15
- "dependencies": {
16
- "@types/react": "~18.2.14",
17
- "bumbag": "^2.2.1",
18
- "bumbag-native": "^2.3.0",
19
- "expo": "^49.0.0",
20
- "expo-haptics": "~12.4.0",
21
- "expo-splash-screen": "~0.20.5",
22
- "react": "18.2.0",
23
- "react-dom": "18.2.0",
24
- "react-native": "0.72.3",
25
- "react-native-gesture-handler": "~2.12.0",
26
- "react-native-reanimated": "~3.3.0",
27
- "react-native-svg": "13.9.0",
28
- "react-native-web": "~0.19.6"
29
- },
30
- "devDependencies": {
31
- "@babel/core": "^7.20.0",
32
- "@babel/runtime": "^7.20.0",
33
- "@expo/webpack-config": "^18.0.1",
34
- "babel-loader": "^8.2.3",
35
- "babel-plugin-module-resolver": "^4.1.0",
36
- "babel-preset-expo": "^9.5.0",
37
- "jsonfile": "^6.1.0",
38
- "patch-package": "^6.4.7",
39
- "postinstall-postinstall": "^2.1.0",
40
- "typescript": "^5.1.3"
41
- }
42
- }
@@ -1,64 +0,0 @@
1
- import * as React from 'react';
2
- import 'react-native-gesture-handler';
3
- import {
4
- Box,
5
- Button,
6
- Text,
7
- Heading,
8
- Level,
9
- Provider as BumbagNativeProvider,
10
- } from 'bumbag-native';
11
-
12
- import CandlestickChart from './CandlestickChart';
13
- import LineChart from './LineChart';
14
- import { GestureHandlerRootView } from 'react-native-gesture-handler';
15
-
16
- export default function App() {
17
- const [selected, setSelected] = React.useState('');
18
- return (
19
- <GestureHandlerRootView style={{ flex: 1 }}>
20
- <BumbagNativeProvider>
21
- <Box.Safe flex="1">
22
- <Level
23
- verticalBelow=""
24
- paddingX="major-2"
25
- paddingY="major-2"
26
- alignY="center"
27
- >
28
- <Heading.H5 key={'heading'}>
29
- React Native WAGMI Charts 💸
30
- </Heading.H5>
31
- {selected ? (
32
- <Button
33
- size="small"
34
- key="back-button"
35
- onPress={() => setSelected('')}
36
- >
37
- Back
38
- </Button>
39
- ) : null}
40
- </Level>
41
- <Box.Scroll>
42
- {!selected && (
43
- <Box paddingX="major-2" marginTop="major-6">
44
- <Heading.H6 marginBottom="major-2">
45
- Click a chart below to get started
46
- </Heading.H6>
47
- <Button onPress={() => setSelected('candlestick')}>
48
- <Text>Candlestick</Text>
49
- </Button>
50
- <Button onPress={() => setSelected('line')}>
51
- <Text>Line</Text>
52
- </Button>
53
- </Box>
54
- )}
55
- <Box marginTop="major-2">
56
- {selected === 'candlestick' && <CandlestickChart />}
57
- {selected === 'line' && <LineChart />}
58
- </Box>
59
- </Box.Scroll>
60
- </Box.Safe>
61
- </BumbagNativeProvider>
62
- </GestureHandlerRootView>
63
- );
64
- }
@@ -1,155 +0,0 @@
1
- import * as React from 'react';
2
- import { Platform } from 'react-native';
3
- import { Box, Button, Flex, Heading, Text, Stack } from 'bumbag-native';
4
- import { CandlestickChart, TCandle } from 'react-native-wagmi-charts';
5
- import * as haptics from 'expo-haptics';
6
-
7
- import mockData from './data/candlestick-data.json';
8
- import mockData2 from './data/candlestick-data2.json';
9
-
10
- function invokeHaptic() {
11
- if (['ios', 'android'].includes(Platform.OS)) {
12
- haptics.impactAsync(haptics.ImpactFeedbackStyle.Light);
13
- }
14
- }
15
-
16
- export default function App() {
17
- const [data, setData] = React.useState<TCandle[]>(mockData);
18
-
19
- return (
20
- <>
21
- <Heading.H5 paddingX="major-2" marginBottom="major-2">
22
- Candlestick Chart 🕯
23
- </Heading.H5>
24
- <CandlestickChart.Provider data={data}>
25
- <CandlestickChart>
26
- <CandlestickChart.Candles />
27
- <CandlestickChart.Crosshair onCurrentXChange={invokeHaptic}>
28
- <CandlestickChart.Tooltip />
29
- </CandlestickChart.Crosshair>
30
- </CandlestickChart>
31
- <Heading.H6>Load Data</Heading.H6>
32
- <Box marginTop="major-2">
33
- <Flex flexWrap={'wrap'}>
34
- <Button onPress={() => setData(mockData)}>candlestick-data</Button>
35
- <Button onPress={() => setData(mockData2)}>
36
- candlestick-data2
37
- </Button>
38
- </Flex>
39
- </Box>
40
- <Stack padding="major-2" spacing="major-1">
41
- <Heading.H6>PriceText</Heading.H6>
42
- <Box>
43
- <Text fontWeight="500">Formatted: </Text>
44
- <Flex>
45
- <Box flex="1">
46
- <Text fontSize="100">Current</Text>
47
- <CandlestickChart.PriceText />
48
- </Box>
49
- <Box flex="1">
50
- <Text fontSize="100">Open</Text>
51
- <CandlestickChart.PriceText type="open" />
52
- </Box>
53
- <Box flex="1">
54
- <Text fontSize="100">High</Text>
55
- <CandlestickChart.PriceText type="high" />
56
- </Box>
57
- <Box flex="1">
58
- <Text fontSize="100">Low</Text>
59
- <CandlestickChart.PriceText type="low" />
60
- </Box>
61
- <Box flex="1">
62
- <Text fontSize="100">Close</Text>
63
- <CandlestickChart.PriceText type="close" />
64
- </Box>
65
- </Flex>
66
- </Box>
67
- <Box>
68
- <Text fontWeight="500">Value: </Text>
69
- <Flex>
70
- <Box flex="1">
71
- <Text fontSize="100">Current</Text>
72
- <CandlestickChart.PriceText variant="value" />
73
- </Box>
74
- <Box flex="1">
75
- <Text fontSize="100">Open</Text>
76
- <CandlestickChart.PriceText type="open" variant="value" />
77
- </Box>
78
- <Box flex="1">
79
- <Text fontSize="100">High</Text>
80
- <CandlestickChart.PriceText type="high" variant="value" />
81
- </Box>
82
- <Box flex="1">
83
- <Text fontSize="100">Low</Text>
84
- <CandlestickChart.PriceText type="low" variant="value" />
85
- </Box>
86
- <Box flex="1">
87
- <Text fontSize="100">Close</Text>
88
- <CandlestickChart.PriceText type="close" variant="value" />
89
- </Box>
90
- </Flex>
91
- </Box>
92
- <Box>
93
- <Text fontWeight="500">Custom format: </Text>
94
- <Flex>
95
- <Box flex="1">
96
- <Text fontSize="100">Current</Text>
97
- <CandlestickChart.PriceText
98
- format={(d) => {
99
- 'worklet';
100
- return `$${d.formatted} AUD`;
101
- }}
102
- />
103
- </Box>
104
- <Box flex="1">
105
- <Text fontSize="100">Open</Text>
106
- <CandlestickChart.PriceText
107
- type="open"
108
- format={(d) => {
109
- 'worklet';
110
- return `$${d.formatted} AUD`;
111
- }}
112
- />
113
- </Box>
114
- <Box flex="1">
115
- <Text fontSize="100">Close</Text>
116
- <CandlestickChart.PriceText
117
- type="close"
118
- format={(d) => {
119
- 'worklet';
120
- return `$${d.formatted} AUD`;
121
- }}
122
- />
123
- </Box>
124
- </Flex>
125
- </Box>
126
- </Stack>
127
- <Stack padding="major-2" spacing="minor-1">
128
- <Heading.H6>DatetimeText</Heading.H6>
129
- <Flex>
130
- <Text fontWeight="500">Formatted: </Text>
131
- <CandlestickChart.DatetimeText />
132
- </Flex>
133
- <Flex>
134
- <Text fontWeight="500">Float: </Text>
135
- <CandlestickChart.DatetimeText variant="value" />
136
- </Flex>
137
- <Flex>
138
- <Text fontWeight="500">Custom format: </Text>
139
- <CandlestickChart.DatetimeText
140
- locale="en-AU"
141
- options={{
142
- year: 'numeric',
143
- month: 'numeric',
144
- day: 'numeric',
145
- hour: 'numeric',
146
- minute: 'numeric',
147
- second: 'numeric',
148
- }}
149
- />
150
- </Flex>
151
- </Stack>
152
- </CandlestickChart.Provider>
153
- </>
154
- );
155
- }
@@ -1,268 +0,0 @@
1
- import * as React from 'react';
2
- import * as haptics from 'expo-haptics';
3
-
4
- import { Box, Button, Flex, Heading, Stack, Text } from 'bumbag-native';
5
- import {
6
- LineChart,
7
- TLineChartDataProp,
8
- TLineChartPoint,
9
- } from 'react-native-wagmi-charts';
10
-
11
- import { Platform } from 'react-native';
12
- import mockData from './data/line-data.json';
13
- import mockData2 from './data/line-data2.json';
14
- import mockDataNonLinear from './data/line-data-non-linear-domain.json';
15
- import { useMemo } from 'react';
16
-
17
- function invokeHaptic() {
18
- if (['ios', 'android'].includes(Platform.OS)) {
19
- haptics.impactAsync(haptics.ImpactFeedbackStyle.Light);
20
- }
21
- }
22
-
23
- export default function App() {
24
- const [data, setData] = React.useState<TLineChartPoint[]>(mockData);
25
- const [multiData, toggleMultiData] = React.useReducer(
26
- (state) => !state,
27
- false
28
- );
29
- const [partialDay, togglePartialDay] = React.useReducer(
30
- (state) => !state,
31
- false
32
- );
33
-
34
- const [scaleRelativeToTime, setScaleRelativeToTime] = React.useState(false);
35
-
36
- const [yRange, setYRange] = React.useState<undefined | 'low' | 'high'>(
37
- undefined
38
- );
39
-
40
- const toggleYRange = () => {
41
- setYRange((domain) => {
42
- if (!domain) {
43
- return 'low';
44
- }
45
- if (domain === 'low') {
46
- return 'high';
47
- }
48
- return undefined;
49
- });
50
- };
51
-
52
- const [toggleMinMaxLabels, setToggleMinMaxLabels] = React.useState(false);
53
- const [toggleSnapToPoint, setToggleSnapToPoint] = React.useState(false);
54
- const [toggleHighlight, setToggleHighlight] = React.useState(false);
55
-
56
- let dataProp: TLineChartDataProp = data;
57
- const [min, max] = useMemo(() => {
58
- if (Array.isArray(dataProp)) {
59
- const values = dataProp.map((d) => d.value);
60
- const _min = Math.min(...values);
61
- const _max = Math.max(...values);
62
- return [
63
- values.findIndex((v) => v === _min),
64
- values.findIndex((v) => v === _max),
65
- ];
66
- }
67
- return [0, 0];
68
- }, [dataProp]);
69
-
70
- let chart = (
71
- <LineChart>
72
- <LineChart.Path color="black">
73
- {toggleMinMaxLabels && (
74
- <>
75
- <LineChart.Gradient color="black" />
76
- <LineChart.Tooltip position="top" at={max} />
77
- <LineChart.Tooltip position="bottom" at={min} yGutter={-10} />
78
- </>
79
- )}
80
- {toggleHighlight && (
81
- <LineChart.Highlight
82
- color="red"
83
- from={Math.floor(data.length / 3)}
84
- to={Math.floor(data.length * (2/3))}
85
- />
86
- )}
87
- </LineChart.Path>
88
- <LineChart.CursorCrosshair
89
- snapToPoint={toggleSnapToPoint}
90
- onActivated={invokeHaptic}
91
- onEnded={invokeHaptic}
92
- >
93
- <LineChart.Tooltip position="top" />
94
- <LineChart.HoverTrap />
95
- </LineChart.CursorCrosshair>
96
- </LineChart>
97
- );
98
-
99
- if (multiData) {
100
- dataProp = {
101
- one: mockData,
102
- two: mockData2,
103
- };
104
- chart = (
105
- <LineChart.Group>
106
- <LineChart id="one">
107
- <LineChart.Path animateOnMount="foreground" color="blue" />
108
- <LineChart.CursorCrosshair
109
- snapToPoint={toggleSnapToPoint}
110
- onActivated={invokeHaptic}
111
- onEnded={invokeHaptic}
112
- >
113
- <LineChart.Tooltip />
114
- </LineChart.CursorCrosshair>
115
- </LineChart>
116
- <LineChart id="two">
117
- <LineChart.Path color="red">
118
- <LineChart.Gradient color="black" />
119
- <LineChart.HorizontalLine at={{ index: 4 }} />
120
- </LineChart.Path>
121
- <LineChart.CursorCrosshair
122
- snapToPoint={toggleSnapToPoint}
123
- color="hotpink"
124
- onActivated={invokeHaptic}
125
- onEnded={invokeHaptic}
126
- >
127
- <LineChart.Tooltip />
128
- </LineChart.CursorCrosshair>
129
- </LineChart>
130
- </LineChart.Group>
131
- );
132
- }
133
-
134
- return (
135
- <>
136
- <Heading.H5 paddingX="major-2" marginBottom="major-2">
137
- Line Chart 📈
138
- </Heading.H5>
139
- <LineChart.Provider
140
- xDomain={
141
- scaleRelativeToTime
142
- ? [data[0].timestamp, data[data.length - 1].timestamp]
143
- : undefined
144
- }
145
- xLength={partialDay ? data.length * 2 : undefined}
146
- yRange={{
147
- min:
148
- yRange === 'low'
149
- ? Math.min(...data.map((d) => d.value)) / 1.1
150
- : undefined,
151
- max:
152
- yRange === 'high'
153
- ? Math.max(...data.map((d) => d.value)) * 1.1
154
- : undefined,
155
- }}
156
- data={dataProp}
157
- >
158
- {chart}
159
- <Box marginX="major-2" marginTop="major-2">
160
- <Heading.H6 marginBottom={'major-2'}>Load Data</Heading.H6>
161
- <Flex flexWrap={'wrap'}>
162
- <Button onPress={() => setData(mockData)}>Data 1</Button>
163
- <Button onPress={() => setData(mockData2)}>Data 2</Button>
164
- <Button onPress={() => setData(mockDataNonLinear)}>Data 3</Button>
165
- <Button onPress={() => setData([...mockData, ...mockData2])}>
166
- Data 1 + Data 2
167
- </Button>
168
- <Button onPress={() => setData([...mockData2, ...mockData])}>
169
- Data 2 + Data 1
170
- </Button>
171
- <Button
172
- onPress={() => setData([...mockData2, ...mockData, ...mockData2])}
173
- >
174
- Data 2 + Data 1 + Data 2
175
- </Button>
176
- <Button
177
- onPress={() =>
178
- setData([
179
- ...mockData2,
180
- ...mockData,
181
- ...mockData2,
182
- ...mockData,
183
- ...mockData,
184
- ...mockData2,
185
- ...mockData2,
186
- ...mockData,
187
- ...mockData2,
188
- ...mockData,
189
- ...mockData,
190
- ...mockData2,
191
- ])
192
- }
193
- >
194
- V large data
195
- </Button>
196
- <Button onPress={toggleYRange}>
197
- {`${yRange || 'Set'} Y Domain`}
198
- </Button>
199
- <Button onPress={toggleMultiData}>{`Multi Data`}</Button>
200
- <Button onPress={togglePartialDay}>{`Partial Day`}</Button>
201
- <Button onPress={() => setToggleHighlight((val) => !val)}>
202
- Toggle highlight
203
- </Button>
204
- <Button
205
- onPress={() => setToggleMinMaxLabels((p) => !p)}
206
- >{`Toggle min/max labels`}</Button>
207
- <Button
208
- onPress={() => {
209
- // Use with data 3 for best demonstration
210
- setScaleRelativeToTime((val) => !val);
211
- }}
212
- >
213
- {`Toggle ${scaleRelativeToTime ? 'off' : 'on'} XDomain`}
214
- </Button>
215
- <Button
216
- onPress={() => setToggleSnapToPoint((val) => !val)}
217
- >{`Toggle Snap ${toggleSnapToPoint ? 'Off' : 'On'}`}</Button>
218
- </Flex>
219
- </Box>
220
- {!multiData && (
221
- <Stack padding="major-2" spacing="major-1">
222
- <Heading.H6>PriceText</Heading.H6>
223
- <Flex>
224
- <Text fontWeight="500">Formatted: </Text>
225
- <LineChart.PriceText />
226
- </Flex>
227
- <Flex>
228
- <Text fontWeight="500">Value: </Text>
229
- <LineChart.PriceText variant="value" />
230
- </Flex>
231
- <Flex>
232
- <Text fontWeight="500">Custom format: </Text>
233
- <LineChart.PriceText
234
- format={(d) => {
235
- 'worklet';
236
- return d.formatted ? `$${d.formatted} AUD` : '';
237
- }}
238
- />
239
- </Flex>
240
- <Heading.H6>DatetimeText</Heading.H6>
241
- <Flex>
242
- <Text fontWeight="500">Formatted: </Text>
243
- <LineChart.DatetimeText />
244
- </Flex>
245
- <Flex>
246
- <Text fontWeight="500">Value: </Text>
247
- <LineChart.DatetimeText variant="value" />
248
- </Flex>
249
- <Flex>
250
- <Text fontWeight="500">Custom format: </Text>
251
- <LineChart.DatetimeText
252
- locale="en-AU"
253
- options={{
254
- year: 'numeric',
255
- month: 'numeric',
256
- day: 'numeric',
257
- hour: 'numeric',
258
- minute: 'numeric',
259
- second: 'numeric',
260
- }}
261
- />
262
- </Flex>
263
- </Stack>
264
- )}
265
- </LineChart.Provider>
266
- </>
267
- );
268
- }
@@ -1,142 +0,0 @@
1
- [
2
- {
3
- "timestamp": 1625945400000,
4
- "open": 33575.25,
5
- "high": 33600.52,
6
- "low": 33475.12,
7
- "close": 33520.11
8
- },
9
- {
10
- "timestamp": 1625946300000,
11
- "open": 33545.25,
12
- "high": 33560.52,
13
- "low": 33510.12,
14
- "close": 33520.11
15
- },
16
- {
17
- "timestamp": 1625947200000,
18
- "open": 33510.25,
19
- "high": 33515.52,
20
- "low": 33250.12,
21
- "close": 33250.11
22
- },
23
- {
24
- "timestamp": 1625948100000,
25
- "open": 33215.25,
26
- "high": 33430.52,
27
- "low": 33215.12,
28
- "close": 33420.11
29
- },
30
- {
31
- "timestamp": 1625949000000,
32
- "open": 33445.25,
33
- "high": 33520.52,
34
- "low": 33415.12,
35
- "close": 33440.11
36
- },
37
- {
38
- "timestamp": 1625949900000,
39
- "open": 33435.25,
40
- "high": 33465.52,
41
- "low": 33435.12,
42
- "close": 33455.11
43
- },
44
- {
45
- "timestamp": 1625950800000,
46
- "open": 33480.25,
47
- "high": 33480.52,
48
- "low": 33430.12,
49
- "close": 33445.11
50
- },
51
- {
52
- "timestamp": 1625951700000,
53
- "open": 33440.25,
54
- "high": 33545.52,
55
- "low": 33440.12,
56
- "close": 33510.11
57
- },
58
- {
59
- "timestamp": 1625952600000,
60
- "open": 33485.25,
61
- "high": 33520.52,
62
- "low": 33460.12,
63
- "close": 33515.11
64
- },
65
- {
66
- "timestamp": 1625953500000,
67
- "open": 33515.25,
68
- "high": 33550.52,
69
- "low": 33515.12,
70
- "close": 33540.11
71
- },
72
- {
73
- "timestamp": 1625954400000,
74
- "open": 33570.25,
75
- "high": 33645.52,
76
- "low": 33545.12,
77
- "close": 33645.11
78
- },
79
- {
80
- "timestamp": 1625955300000,
81
- "open": 33640.25,
82
- "high": 33665.52,
83
- "low": 33600.12,
84
- "close": 33630.11
85
- },
86
- {
87
- "timestamp": 1625956200000,
88
- "open": 33645.25,
89
- "high": 33670.52,
90
- "low": 33645.12,
91
- "close": 33660.11
92
- },
93
- {
94
- "timestamp": 1625957100000,
95
- "open": 33670.25,
96
- "high": 33785.52,
97
- "low": 33660.12,
98
- "close": 33745.11
99
- },
100
- {
101
- "timestamp": 1625958000000,
102
- "open": 33740.25,
103
- "high": 33780.52,
104
- "low": 33710.12,
105
- "close": 33780.11
106
- },
107
- {
108
- "timestamp": 1625958900000,
109
- "open": 33770.25,
110
- "high": 33770.52,
111
- "low": 33710.12,
112
- "close": 33710.11
113
- },
114
- {
115
- "timestamp": 1625959800000,
116
- "open": 33705.25,
117
- "high": 33760.52,
118
- "low": 33705.12,
119
- "close": 33750.11
120
- },
121
- {
122
- "timestamp": 1625960700000,
123
- "open": 33760.25,
124
- "high": 33785.52,
125
- "low": 33645.12,
126
- "close": 33650.11
127
- },
128
- {
129
- "timestamp": 1625961600000,
130
- "open": 33670.25,
131
- "high": 33835.52,
132
- "low": 33635.12,
133
- "close": 33825.11
134
- },
135
- {
136
- "timestamp": 1625962500000,
137
- "open": 33870.25,
138
- "high": 33930.52,
139
- "low": 33715.12,
140
- "close": 33770.11
141
- }
142
- ]