@obitrain/charts 0.10.0 → 0.10.3

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 (153) hide show
  1. package/README.md +79 -0
  2. package/lib/commonjs/Charts/BottomAxis/AxisLine.js +5 -5
  3. package/lib/commonjs/Charts/BottomAxis/AxisLine.js.map +1 -1
  4. package/lib/commonjs/Charts/BottomAxis/BottomAxis.js +3 -3
  5. package/lib/commonjs/Charts/BottomAxis/BottomAxis.js.map +1 -1
  6. package/lib/commonjs/Charts/BottomAxis/Tick.js +2 -2
  7. package/lib/commonjs/Charts/BottomAxis/Tick.js.map +1 -1
  8. package/lib/commonjs/Charts/BottomAxis/index.js +3 -3
  9. package/lib/commonjs/Charts/Cursor.js +5 -6
  10. package/lib/commonjs/Charts/Cursor.js.map +1 -1
  11. package/lib/commonjs/Charts/Linechart/index.js +2 -0
  12. package/lib/commonjs/Charts/Linechart/index.js.map +1 -1
  13. package/lib/commonjs/Charts/ZoomableLinechart/ScalablePath.js +4 -11
  14. package/lib/commonjs/Charts/ZoomableLinechart/ScalablePath.js.map +1 -1
  15. package/lib/commonjs/Charts/ZoomableLinechart/index.js +1 -1
  16. package/lib/commonjs/Charts/gesture.js +28 -34
  17. package/lib/commonjs/Charts/gesture.js.map +1 -1
  18. package/lib/commonjs/Charts/graphUtils.js +25 -22
  19. package/lib/commonjs/Charts/graphUtils.js.map +1 -1
  20. package/lib/commonjs/Charts/index.js +13 -13
  21. package/lib/commonjs/Charts/index.js.map +1 -1
  22. package/lib/commonjs/Charts/maths.js.map +1 -1
  23. package/lib/commonjs/dateUtils.js +11 -15
  24. package/lib/commonjs/dateUtils.js.map +1 -1
  25. package/lib/commonjs/index.js +6 -6
  26. package/lib/commonjs/index.js.map +1 -1
  27. package/lib/commonjs/textUtils.js +1 -1
  28. package/lib/commonjs/textUtils.js.map +1 -1
  29. package/lib/module/Charts/BottomAxis/AxisLine.js +5 -5
  30. package/lib/module/Charts/BottomAxis/AxisLine.js.map +1 -1
  31. package/lib/module/Charts/BottomAxis/BottomAxis.js +3 -3
  32. package/lib/module/Charts/BottomAxis/BottomAxis.js.map +1 -1
  33. package/lib/module/Charts/BottomAxis/Tick.js +2 -2
  34. package/lib/module/Charts/BottomAxis/Tick.js.map +1 -1
  35. package/lib/module/Charts/BottomAxis/index.js +3 -3
  36. package/lib/module/Charts/BottomAxis/index.js.map +1 -1
  37. package/lib/module/Charts/Cursor.js +5 -6
  38. package/lib/module/Charts/Cursor.js.map +1 -1
  39. package/lib/module/Charts/Linechart/index.js +2 -0
  40. package/lib/module/Charts/Linechart/index.js.map +1 -1
  41. package/lib/module/Charts/ZoomableLinechart/ScalablePath.js +4 -11
  42. package/lib/module/Charts/ZoomableLinechart/ScalablePath.js.map +1 -1
  43. package/lib/module/Charts/ZoomableLinechart/index.js +1 -1
  44. package/lib/module/Charts/ZoomableLinechart/index.js.map +1 -1
  45. package/lib/module/Charts/gesture.js +29 -35
  46. package/lib/module/Charts/gesture.js.map +1 -1
  47. package/lib/module/Charts/graphUtils.js +26 -22
  48. package/lib/module/Charts/graphUtils.js.map +1 -1
  49. package/lib/module/Charts/index.js +7 -7
  50. package/lib/module/Charts/index.js.map +1 -1
  51. package/lib/module/Charts/maths.js.map +1 -1
  52. package/lib/module/dateUtils.js +10 -14
  53. package/lib/module/dateUtils.js.map +1 -1
  54. package/lib/module/index.js +3 -3
  55. package/lib/module/index.js.map +1 -1
  56. package/lib/module/package.json +1 -0
  57. package/lib/module/textUtils.js +1 -1
  58. package/lib/module/textUtils.js.map +1 -1
  59. package/lib/typescript/commonjs/package.json +1 -0
  60. package/lib/typescript/commonjs/src/Charts/BottomAxis/AxisLine.d.ts.map +1 -0
  61. package/lib/typescript/commonjs/src/Charts/BottomAxis/BottomAxis.d.ts.map +1 -0
  62. package/lib/typescript/commonjs/src/Charts/BottomAxis/Tick.d.ts.map +1 -0
  63. package/lib/typescript/commonjs/src/Charts/BottomAxis/index.d.ts.map +1 -0
  64. package/lib/typescript/{src → commonjs/src}/Charts/Cursor.d.ts +1 -1
  65. package/lib/typescript/commonjs/src/Charts/Cursor.d.ts.map +1 -0
  66. package/lib/typescript/{src → commonjs/src}/Charts/Linechart/index.d.ts +10 -4
  67. package/lib/typescript/commonjs/src/Charts/Linechart/index.d.ts.map +1 -0
  68. package/lib/typescript/commonjs/src/Charts/ZoomableLinechart/ScalablePath.d.ts.map +1 -0
  69. package/lib/typescript/commonjs/src/Charts/ZoomableLinechart/index.d.ts.map +1 -0
  70. package/lib/typescript/commonjs/src/Charts/gesture.d.ts.map +1 -0
  71. package/lib/typescript/{src → commonjs/src}/Charts/graphUtils.d.ts +5 -3
  72. package/lib/typescript/commonjs/src/Charts/graphUtils.d.ts.map +1 -0
  73. package/lib/typescript/{src → commonjs/src}/Charts/index.d.ts +4 -3
  74. package/lib/typescript/commonjs/src/Charts/index.d.ts.map +1 -0
  75. package/lib/typescript/{src → commonjs/src}/Charts/maths.d.ts +1 -2
  76. package/lib/typescript/commonjs/src/Charts/maths.d.ts.map +1 -0
  77. package/lib/typescript/commonjs/src/Charts/types.d.ts.map +1 -0
  78. package/lib/typescript/commonjs/src/dateUtils.d.ts.map +1 -0
  79. package/lib/typescript/commonjs/src/index.d.ts.map +1 -0
  80. package/lib/typescript/commonjs/src/textUtils.d.ts.map +1 -0
  81. package/lib/typescript/module/package.json +1 -0
  82. package/lib/typescript/module/src/Charts/BottomAxis/AxisLine.d.ts +15 -0
  83. package/lib/typescript/module/src/Charts/BottomAxis/AxisLine.d.ts.map +1 -0
  84. package/lib/typescript/module/src/Charts/BottomAxis/BottomAxis.d.ts +17 -0
  85. package/lib/typescript/module/src/Charts/BottomAxis/BottomAxis.d.ts.map +1 -0
  86. package/lib/typescript/module/src/Charts/BottomAxis/Tick.d.ts +14 -0
  87. package/lib/typescript/module/src/Charts/BottomAxis/Tick.d.ts.map +1 -0
  88. package/lib/typescript/module/src/Charts/BottomAxis/index.d.ts +4 -0
  89. package/lib/typescript/module/src/Charts/BottomAxis/index.d.ts.map +1 -0
  90. package/lib/typescript/module/src/Charts/Cursor.d.ts +14 -0
  91. package/lib/typescript/module/src/Charts/Cursor.d.ts.map +1 -0
  92. package/lib/typescript/module/src/Charts/Linechart/index.d.ts +31 -0
  93. package/lib/typescript/module/src/Charts/Linechart/index.d.ts.map +1 -0
  94. package/lib/typescript/module/src/Charts/ZoomableLinechart/ScalablePath.d.ts +14 -0
  95. package/lib/typescript/module/src/Charts/ZoomableLinechart/ScalablePath.d.ts.map +1 -0
  96. package/lib/typescript/module/src/Charts/ZoomableLinechart/index.d.ts +23 -0
  97. package/lib/typescript/module/src/Charts/ZoomableLinechart/index.d.ts.map +1 -0
  98. package/lib/typescript/module/src/Charts/gesture.d.ts +54 -0
  99. package/lib/typescript/module/src/Charts/gesture.d.ts.map +1 -0
  100. package/lib/typescript/module/src/Charts/graphUtils.d.ts +45 -0
  101. package/lib/typescript/module/src/Charts/graphUtils.d.ts.map +1 -0
  102. package/lib/typescript/module/src/Charts/index.d.ts +15 -0
  103. package/lib/typescript/module/src/Charts/index.d.ts.map +1 -0
  104. package/lib/typescript/module/src/Charts/maths.d.ts +18 -0
  105. package/lib/typescript/module/src/Charts/maths.d.ts.map +1 -0
  106. package/lib/typescript/module/src/Charts/types.d.ts +14 -0
  107. package/lib/typescript/module/src/Charts/types.d.ts.map +1 -0
  108. package/lib/typescript/module/src/dateUtils.d.ts +37 -0
  109. package/lib/typescript/module/src/dateUtils.d.ts.map +1 -0
  110. package/lib/typescript/module/src/index.d.ts +5 -0
  111. package/lib/typescript/module/src/index.d.ts.map +1 -0
  112. package/lib/typescript/module/src/textUtils.d.ts +3 -0
  113. package/lib/typescript/module/src/textUtils.d.ts.map +1 -0
  114. package/package.json +74 -86
  115. package/src/Charts/BottomAxis/AxisLine.tsx +4 -4
  116. package/src/Charts/BottomAxis/BottomAxis.tsx +1 -1
  117. package/src/Charts/BottomAxis/Tick.tsx +10 -13
  118. package/src/Charts/Cursor.tsx +15 -16
  119. package/src/Charts/Linechart/index.tsx +8 -4
  120. package/src/Charts/ZoomableLinechart/ScalablePath.tsx +9 -17
  121. package/src/Charts/gesture.ts +40 -39
  122. package/src/Charts/graphUtils.ts +32 -27
  123. package/src/Charts/index.tsx +22 -3
  124. package/src/Charts/maths.ts +5 -3
  125. package/src/dateUtils.ts +9 -16
  126. package/src/textUtils.ts +1 -1
  127. package/lib/typescript/src/Charts/BottomAxis/AxisLine.d.ts.map +0 -1
  128. package/lib/typescript/src/Charts/BottomAxis/BottomAxis.d.ts.map +0 -1
  129. package/lib/typescript/src/Charts/BottomAxis/Tick.d.ts.map +0 -1
  130. package/lib/typescript/src/Charts/BottomAxis/index.d.ts.map +0 -1
  131. package/lib/typescript/src/Charts/Cursor.d.ts.map +0 -1
  132. package/lib/typescript/src/Charts/Linechart/index.d.ts.map +0 -1
  133. package/lib/typescript/src/Charts/ZoomableLinechart/ScalablePath.d.ts.map +0 -1
  134. package/lib/typescript/src/Charts/ZoomableLinechart/index.d.ts.map +0 -1
  135. package/lib/typescript/src/Charts/gesture.d.ts.map +0 -1
  136. package/lib/typescript/src/Charts/graphUtils.d.ts.map +0 -1
  137. package/lib/typescript/src/Charts/index.d.ts.map +0 -1
  138. package/lib/typescript/src/Charts/maths.d.ts.map +0 -1
  139. package/lib/typescript/src/Charts/types.d.ts.map +0 -1
  140. package/lib/typescript/src/dateUtils.d.ts.map +0 -1
  141. package/lib/typescript/src/index.d.ts.map +0 -1
  142. package/lib/typescript/src/textUtils.d.ts.map +0 -1
  143. /package/lib/typescript/{src → commonjs/src}/Charts/BottomAxis/AxisLine.d.ts +0 -0
  144. /package/lib/typescript/{src → commonjs/src}/Charts/BottomAxis/BottomAxis.d.ts +0 -0
  145. /package/lib/typescript/{src → commonjs/src}/Charts/BottomAxis/Tick.d.ts +0 -0
  146. /package/lib/typescript/{src → commonjs/src}/Charts/BottomAxis/index.d.ts +0 -0
  147. /package/lib/typescript/{src → commonjs/src}/Charts/ZoomableLinechart/ScalablePath.d.ts +0 -0
  148. /package/lib/typescript/{src → commonjs/src}/Charts/ZoomableLinechart/index.d.ts +0 -0
  149. /package/lib/typescript/{src → commonjs/src}/Charts/gesture.d.ts +0 -0
  150. /package/lib/typescript/{src → commonjs/src}/Charts/types.d.ts +0 -0
  151. /package/lib/typescript/{src → commonjs/src}/dateUtils.d.ts +0 -0
  152. /package/lib/typescript/{src → commonjs/src}/index.d.ts +0 -0
  153. /package/lib/typescript/{src → commonjs/src}/textUtils.d.ts +0 -0
@@ -3,15 +3,17 @@ import { type ScaleLinear } from 'd3-scale';
3
3
  import * as shape from 'd3-shape';
4
4
  import { type SharedValue } from 'react-native-reanimated';
5
5
  import type { AnimatedDot, DataPoint } from './types';
6
- export type Config = {
6
+ export type BuildGraphConfig = {
7
7
  minX?: number;
8
8
  maxX?: number;
9
9
  minY?: number;
10
10
  maxY?: number;
11
11
  curve?: shape.CurveFactory | shape.CurveFactoryLineOnly;
12
12
  };
13
+ /** @deprecated Use {@link BuildGraphConfig} instead */
14
+ export type Config = BuildGraphConfig;
13
15
  export type GraphData = {
14
- data: [number, number][];
16
+ data: [x: number, y: number][];
15
17
  minY: number;
16
18
  maxY: number;
17
19
  path: string;
@@ -20,7 +22,7 @@ export type GraphData = {
20
22
  scaleX: ScaleLinear<number, number, never>;
21
23
  scaleY: ScaleLinear<number, number, never>;
22
24
  };
23
- export declare const buildGraph: (data: [number, number][], width: number, height: number, config?: Config) => GraphData;
25
+ export declare const buildGraph: (data: [x: number, y: number][], width: number, height: number, config?: BuildGraphConfig) => GraphData;
24
26
  /**
25
27
  * For now, only support commands of type:
26
28
  * - PathVerb.Move
@@ -0,0 +1 @@
1
+ {"version":3,"file":"graphUtils.d.ts","sourceRoot":"","sources":["../../../../../src/Charts/graphUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,WAAW,EAChB,KAAK,MAAM,EACZ,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAe,KAAK,WAAW,EAAE,M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AAW,CAAC,MAAM,CAAC,KAC3B,WAAW,EA+Cb,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC,YAAY,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAClC,IAAI,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC1B,UAAU,EAAE,SAAS,EAAE,EAAE,CAAC;IAC1B,IAAI,EAAE,WAAW,EAAE,CAAC;IACpB,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,MAAM,CAAC;IACxC,WAAW,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,MAAM,CAAC;CAC5C,CAAC;AAEF,eAAO,MAAM,0BAA0B,YAAsB,MAAM,WAGlE,CAAC;AACF,eAAO,MAAM,4BAA4B,aAAuB,MAAM,WAGrE,CAAC;AAEF,eAAO,MAAM,iBAAiB,UAAoB,oBAAoB,SAqCrE,CAAC"}
@@ -1,14 +1,15 @@
1
1
  export { AxisLine, BottomAxis, Tick } from './BottomAxis';
2
+ export type { AxisLineProps, BottomAxisProps, TickProps, } from './BottomAxis';
2
3
  export { Cursor } from './Cursor';
3
4
  export type { CursorProps } from './Cursor';
4
5
  export { LineChart } from './Linechart';
5
6
  export type { LineChartProps, LinePath } from './Linechart';
6
7
  export { ScalablePath, ZoomableLineChart } from './ZoomableLinechart';
7
- export type { ZoomableLineChartProps } from './ZoomableLinechart';
8
+ export type { ScalablePathProps, ZoomableLineChartProps, } from './ZoomableLinechart';
8
9
  export { getClosestPoint, getPositionWl, useCursorGesture, useScalableGesture, useUpdateAxis, } from './gesture';
9
- export type { UseCursorGestureProps } from './gesture';
10
+ export type { AxisGestureProps, ScalableGesture, UpdateAxisProps, UseCursorGestureProps, } from './gesture';
10
11
  export { buildGraph, defaultOpacityTransitionWl, defaultTranslateTransitionWl, scaleCommands, useDotsTransition, } from './graphUtils';
11
- export type { Config, GraphData, UseDotAnimationProps } from './graphUtils';
12
+ export type { BuildGraphConfig, Config, GraphData, UseDotAnimationProps, } from './graphUtils';
12
13
  export { commandsToBezier, cubicBezierYForX, getYForX, magnitude, normalize, selectCurve, } from './maths';
13
14
  export type { AnimatedDot, DataPoint, LineGraphType } from './types';
14
15
  //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/Charts/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAC1D,YAAY,EACV,aAAa,EACb,eAAe,EACf,SAAS,GACV,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,YAAY,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,YAAY,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACtE,YAAY,EACV,iBAAiB,EACjB,sBAAsB,GACvB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,eAAe,EACf,aAAa,EACb,gBAAgB,EAChB,kBAAkB,EAClB,aAAa,GACd,MAAM,WAAW,CAAC;AACnB,YAAY,EACV,gBAAgB,EAChB,eAAe,EACf,eAAe,EACf,qBAAqB,GACtB,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,UAAU,EACV,0BAA0B,EAC1B,4BAA4B,EAC5B,aAAa,EACb,iBAAiB,GAClB,MAAM,cAAc,CAAC;AACtB,YAAY,EACV,gBAAgB,EAEhB,MAAM,EACN,SAAS,EACT,oBAAoB,GACrB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,QAAQ,EACR,SAAS,EACT,SAAS,EACT,WAAW,GACZ,MAAM,SAAS,CAAC;AACjB,YAAY,EAAE,WAAW,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC"}
@@ -1,4 +1,4 @@
1
- import type { PathCommand, Vector } from '@shopify/react-native-skia';
1
+ import type { PathCommand, SkPoint, Vector } from '@shopify/react-native-skia';
2
2
  export declare const cubicBezierYForX: (x: number, a: Vector, b: Vector, c: Vector, d: Vector, precision?: number) => number;
3
3
  interface Cubic {
4
4
  from: Vector;
@@ -12,7 +12,6 @@ export declare const selectCurve: (cmds: PathCommand[], x: number) => Cubic | un
12
12
  */
13
13
  export declare const commandsToBezier: (cmds: PathCommand[]) => PathCommand[];
14
14
  export declare const getYForX: (cmds: PathCommand[], x: number, precision?: number) => number | undefined;
15
- import { type SkPoint } from '@shopify/react-native-skia';
16
15
  export declare const magnitude: (p: SkPoint) => number;
17
16
  export declare const normalize: (p: SkPoint) => SkPoint;
18
17
  export {};
@@ -0,0 +1 @@
1
+ {"version":3,"file":"maths.d.ts","sourceRoot":"","sources":["../../../../../src/Charts/maths.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,WAAW,EACX,OAAO,EACP,MAAM,EACP,MAAM,4BAA4B,CAAC;AAqHpC,eAAO,MAAM,gBAAgB,MACxB,MAAM,KACN,MAAM,KACN,MAAM,KACN,MAAM,KACN,MAAM,yBAER,MAcF,CAAC;AAEF,UAAU,KAAK;IACb,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,eAAO,MAAM,WAAW,SAChB,WAAW,EAAE,KAChB,MAAM,KACR,KAAK,GAAG,SA6BV,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB,SAAU,WAAW,EAAE,KAAG,WAAW,EAmCjE,CAAC;AAEF,eAAO,MAAM,QAAQ,SACb,WAAW,EAAE,KAChB,MAAM,yBAER,MAAM,GAAG,SAOX,CAAC;AAIF,eAAO,MAAM,SAAS,MAAO,OAAO,KAAG,MACL,CAAC;AAEnC,eAAO,MAAM,SAAS,MAAO,OAAO,KAEG,OACtC,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/Charts/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,MAAM,MAAM,aAAa,GAAG,SAAS,CAAC;AAEtC,MAAM,MAAM,SAAS,GAAG;IACtB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACvB,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACvB,OAAO,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CAC9B,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dateUtils.d.ts","sourceRoot":"","sources":["../../../../src/dateUtils.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,GAAG,KAAK,GAAG,OAAO,GAAG,WAAW,GAAG,MAAM,GAAG,KAAK,CAAC;AAEvE,eAAO,MAAM,gBAAgB,UACpB,MAAM,YACH,MAAM,KACf,MAGF,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,eAAe,SACpB,IAAI,aACC,SAAS,KACnB,MAmBF,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,SAAS,EAAE,SAAS,6BAWpE;AAED,wBAAgB,WAAW,CACzB,KAAK,EAAE,IAAI,EAAE,EACb,UAAU,EAAE,MAAM,EAClB,WAAW,GAAE,MAAU,GACtB;IAAE,KAAK,EAAE,IAAI,EAAE,CAAC;IAAC,OAAO,EAAE,MAAM,EAAE,CAAA;CAAE,CAqDtC;AAED,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,IAAI,EAAE,EACb,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,SAAS,GACnB,GAAG,CAAC,MAAM,EAAE;IAAE,KAAK,EAAE,IAAI,EAAE,CAAC;IAAC,OAAO,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC,CAqBnD"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.tsx"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,YAAY,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC7C,cAAc,aAAa,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"textUtils.d.ts","sourceRoot":"","sources":["../../../../src/textUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,WAAW,EACjB,MAAM,yBAAyB,CAAC;AAOjC,eAAO,MAAM,oBAAoB,eACpB,MAAM,KAChB,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAO3C,CAAC"}
@@ -0,0 +1 @@
1
+ {"type":"module"}
@@ -0,0 +1,15 @@
1
+ import { type Color } from '@shopify/react-native-skia';
2
+ import { type FC } from 'react';
3
+ import { type SharedValue } from 'react-native-reanimated';
4
+ export type AxisLineProps = {
5
+ width: number;
6
+ focalX: SharedValue<number>;
7
+ scale: SharedValue<number>;
8
+ offsetX: SharedValue<number>;
9
+ strokeWidth?: number;
10
+ offsetY?: number;
11
+ color?: Color;
12
+ };
13
+ declare const AxisLine: FC<AxisLineProps>;
14
+ export { AxisLine };
15
+ //# sourceMappingURL=AxisLine.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AxisLine.d.ts","sourceRoot":"","sources":["../../../../../../src/Charts/BottomAxis/AxisLine.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAa,KAAK,KAAK,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAEhC,OAAO,EAAmB,KAAK,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAG5E,MAAM,MAAM,aAAa,GAAG;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC5B,KAAK,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC3B,OAAO,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC7B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,KAAK,CAAC;CACf,CAAC;AAEF,QAAA,MAAM,QAAQ,EAAE,EAAE,CAAC,aAAa,CAqB/B,CAAC;AAEF,OAAO,EAAE,QAAQ,EAAE,CAAC"}
@@ -0,0 +1,17 @@
1
+ import { type SkFont } from '@shopify/react-native-skia';
2
+ import { type FC } from 'react';
3
+ import { type StyleProp, type ViewStyle } from 'react-native';
4
+ import type { SharedValue } from 'react-native-reanimated';
5
+ export type BottomAxisProps = {
6
+ labels: string[];
7
+ width: number;
8
+ scale: SharedValue<number>;
9
+ focalX: SharedValue<number>;
10
+ offsetX: SharedValue<number>;
11
+ offsetY?: number;
12
+ style?: StyleProp<ViewStyle>;
13
+ font: SkFont;
14
+ };
15
+ declare const BottomAxis: FC<BottomAxisProps>;
16
+ export { BottomAxis };
17
+ //# sourceMappingURL=BottomAxis.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BottomAxis.d.ts","sourceRoot":"","sources":["../../../../../../src/Charts/BottomAxis/BottomAxis.tsx"],"names":[],"mappings":"AACA,OAAO,EAAU,KAAK,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAI3D,MAAM,MAAM,eAAe,GAAG;IAC5B,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IAEd,KAAK,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC3B,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC5B,OAAO,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,QAAA,MAAM,UAAU,EAAE,EAAE,CAAC,eAAe,CAkBnC,CAAC;AAEF,OAAO,EAAE,UAAU,EAAE,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { type SkFont } from '@shopify/react-native-skia';
2
+ import React from 'react';
3
+ import { type SharedValue } from 'react-native-reanimated';
4
+ export type TickProps = {
5
+ initPosition: number;
6
+ label: string;
7
+ scale: SharedValue<number>;
8
+ focalX: SharedValue<number>;
9
+ offsetX: SharedValue<number>;
10
+ offsetY?: number;
11
+ font: SkFont;
12
+ };
13
+ export declare const Tick: React.FC<TickProps>;
14
+ //# sourceMappingURL=Tick.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Tick.d.ts","sourceRoot":"","sources":["../../../../../../src/Charts/BottomAxis/Tick.tsx"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,MAAM,EACZ,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAmB,KAAK,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAG5E,MAAM,MAAM,SAAS,GAAG;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC3B,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC5B,OAAO,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,SAAS,CA6BpC,CAAC"}
@@ -0,0 +1,4 @@
1
+ export { AxisLine, type AxisLineProps } from './AxisLine.js';
2
+ export { BottomAxis, type BottomAxisProps } from './BottomAxis.js';
3
+ export { Tick, type TickProps } from './Tick.js';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/Charts/BottomAxis/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,KAAK,aAAa,EAAE,MAAM,eAAY,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,iBAAc,CAAC;AAChE,OAAO,EAAE,IAAI,EAAE,KAAK,SAAS,EAAE,MAAM,WAAQ,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { type PathCommand } from '@shopify/react-native-skia';
2
+ import type { FC } from 'react';
3
+ import { type SharedValue } from 'react-native-reanimated';
4
+ export type CursorProps = {
5
+ commands?: SharedValue<PathCommand[]>;
6
+ positionX: SharedValue<number>;
7
+ size?: number;
8
+ color?: string;
9
+ currentValue?: SharedValue<number> | SharedValue<number | undefined>;
10
+ translateY?: SharedValue<number | undefined>;
11
+ };
12
+ declare const Cursor: FC<CursorProps>;
13
+ export { Cursor };
14
+ //# sourceMappingURL=Cursor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Cursor.d.ts","sourceRoot":"","sources":["../../../../../src/Charts/Cursor.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAU,KAAK,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EAAmB,KAAK,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAK5E,MAAM,MAAM,WAAW,GAAG;IACxB,QAAQ,CAAC,EAAE,WAAW,CAAC,WAAW,EAAE,CAAC,CAAC;IACtC,SAAS,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC/B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,WAAW,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IACrE,UAAU,CAAC,EAAE,WAAW,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;CAC9C,CAAC;AAEF,QAAA,MAAM,MAAM,EAAE,EAAE,CAAC,WAAW,CA+B3B,CAAC;AAEF,OAAO,EAAE,MAAM,EAAE,CAAC"}
@@ -0,0 +1,31 @@
1
+ import { type SkPath } from '@shopify/react-native-skia';
2
+ import type { FC } from 'react';
3
+ import React from 'react';
4
+ import type { StyleProp, ViewStyle } from 'react-native';
5
+ import type { SharedValue } from 'react-native-reanimated';
6
+ export type LinePath = {
7
+ path: SkPath | SharedValue<SkPath>;
8
+ color: string;
9
+ id?: string;
10
+ };
11
+ type LineChartBaseProps = {
12
+ height: number;
13
+ width: number;
14
+ style?: StyleProp<ViewStyle>;
15
+ offsetY?: number;
16
+ offsetX?: number;
17
+ background?: React.ReactNode;
18
+ children?: React.ReactNode;
19
+ };
20
+ export type LineChartProps = LineChartBaseProps & ({
21
+ path: SkPath | SharedValue<SkPath>;
22
+ paths?: LinePath[];
23
+ color?: string;
24
+ } | {
25
+ paths: LinePath[];
26
+ path?: SkPath | SharedValue<SkPath>;
27
+ color?: string;
28
+ });
29
+ declare const LineChart: FC<LineChartProps>;
30
+ export { LineChart };
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AAA;CAAE,CAC7E,CAAC;AAEJ,QAAA,MAAM,SAAS,EAAE,EAAE,CAAC,cAAc,CAmDjC,CAAC;AAEF,OAAO,EAAE,SAAS,EAAE,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { Path, type SkPath } from '@shopify/react-native-skia';
2
+ import { type FC } from 'react';
3
+ import { type SharedValue } from 'react-native-reanimated';
4
+ export type ScalablePathProps = {
5
+ path: SharedValue<SkPath>;
6
+ scale: SharedValue<number>;
7
+ focalX: SharedValue<number>;
8
+ offsetX: SharedValue<number>;
9
+ color?: string;
10
+ pathProps?: Omit<React.ComponentProps<typeof Path>, 'color'>;
11
+ };
12
+ declare const ScalablePath: FC<ScalablePathProps>;
13
+ export { ScalablePath };
14
+ //# sourceMappingURL=ScalablePath.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ScalablePath.d.ts","sourceRoot":"","sources":["../../../../../../src/Charts/ZoomableLinechart/ScalablePath.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAQ,KAAK,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACrE,OAAO,EAAE,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EAAmB,KAAK,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE5E,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC1B,KAAK,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC3B,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC5B,OAAO,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,IAAI,CAAC,EAAE,OAAO,CAAC,CAAC;CAC9D,CAAC;AAEF,QAAA,MAAM,YAAY,EAAE,EAAE,CAAC,iBAAiB,CAyBvC,CAAC;AAEF,OAAO,EAAE,YAAY,EAAE,CAAC"}
@@ -0,0 +1,23 @@
1
+ import { type SkPath } from '@shopify/react-native-skia';
2
+ import type { FC } from 'react';
3
+ import React from 'react';
4
+ import type { StyleProp, ViewStyle } from 'react-native';
5
+ import type { SharedValue } from 'react-native-reanimated';
6
+ import { ScalablePath, type ScalablePathProps } from './ScalablePath.js';
7
+ export { ScalablePath };
8
+ export type { ScalablePathProps };
9
+ export type ZoomableLineChartProps = {
10
+ height: number;
11
+ width: number;
12
+ offsetX: SharedValue<number>;
13
+ scale: SharedValue<number>;
14
+ focalX: SharedValue<number>;
15
+ offsetY?: number;
16
+ style?: StyleProp<ViewStyle>;
17
+ path: SharedValue<SkPath>;
18
+ children?: React.ReactNode;
19
+ color?: string;
20
+ };
21
+ declare const ZoomableLineChart: FC<ZoomableLineChartProps>;
22
+ export { ZoomableLineChart };
23
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/Charts/ZoomableLinechart/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACxE,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,KAAK,iBAAiB,EAAE,MAAM,mBAAgB,CAAC;AAEtE,OAAO,EAAE,YAAY,EAAE,CAAC;AACxB,YAAY,EAAE,iBAAiB,EAAE,CAAC;AAElC,MAAM,MAAM,sBAAsB,GAAG;IACnC,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC7B,KAAK,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC3B,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC5B,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,IAAI,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC1B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,QAAA,MAAM,iBAAiB,EAAE,EAAE,CAAC,sBAAsB,CAmBjD,CAAC;AAEF,OAAO,EAAE,iBAAiB,EAAE,CAAC"}
@@ -0,0 +1,54 @@
1
+ import { type PanGesture, type PinchGesture } from 'react-native-gesture-handler';
2
+ import { type SharedValue } from 'react-native-reanimated';
3
+ import type { DataPoint } from './types.js';
4
+ /**
5
+ * Get the position of a point on the axis,
6
+ * given the current focal, scale and offset
7
+ */
8
+ export declare const getPositionWl: (position: number, focalX: number, scale: number, offsetX: number) => number;
9
+ export type AxisGestureProps = {
10
+ width: number;
11
+ startOffset?: number;
12
+ startScale?: number;
13
+ };
14
+ export type ScalableGesture = {
15
+ scale: SharedValue<number>;
16
+ focalX: SharedValue<number>;
17
+ pinchGesture: PinchGesture;
18
+ panGesture: PanGesture;
19
+ offsetX: SharedValue<number>;
20
+ reset: () => void;
21
+ };
22
+ /**
23
+ * Return utilities for zooming and panning the axis
24
+ */
25
+ export declare const useScalableGesture: (props: AxisGestureProps) => ScalableGesture;
26
+ export type UpdateAxisProps = {
27
+ scale: SharedValue<number>;
28
+ scales: number[];
29
+ onScaleChange?: (index: number) => void;
30
+ };
31
+ export declare const useUpdateAxis: (props: UpdateAxisProps) => {
32
+ currentIndex: SharedValue<number>;
33
+ };
34
+ export type UseCursorGestureProps = {
35
+ width: number;
36
+ height: number;
37
+ points?: SharedValue<DataPoint[]>;
38
+ closestDataPoint?: SharedValue<DataPoint>;
39
+ isContinuous?: boolean;
40
+ };
41
+ /**
42
+ * Get the closest point for a given x value
43
+ */
44
+ export declare const getClosestPoint: (x: number, dataPoints: DataPoint[]) => DataPoint;
45
+ /**
46
+ * Get gesture utilities for the cursor
47
+ */
48
+ export declare const useCursorGesture: (props: UseCursorGestureProps) => {
49
+ panGesture: import("react-native-gesture-handler/lib/typescript/handlers/gestures/panGesture").PanGesture;
50
+ tapGesture: import("react-native-gesture-handler/lib/typescript/handlers/gestures/tapGesture").TapGesture;
51
+ xPosition: SharedValue<number>;
52
+ yPosition: SharedValue<number>;
53
+ };
54
+ //# sourceMappingURL=gesture.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gesture.d.ts","sourceRoot":"","sources":["../../../../../src/Charts/gesture.ts"],"names":[],"mappings":"AAEA,OAAO,EAAW,KAAK,UAAU,EAAE,KAAK,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC3F,OAAO,EAIH,KAAK,WAAW,EACnB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAS,CAAC;AAEzC;;;GAGG;AACH,eAAO,MAAM,aAAa,aACd,MAAM,UACR,MAAM,SACP,MAAM,WACJ,MAAM,WAIhB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC1B,KAAK,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC3B,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC5B,YAAY,EAAE,YAAY,CAAC;IAC3B,UAAU,EAAE,UAAU,CAAC;IACvB,OAAO,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC7B,KAAK,EAAE,MAAM,IAAI,CAAC;CACrB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,kBAAkB,UAAW,gBAAgB,KAAG,eAyF5D,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC3B,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACzC,CAAC;AAEF,eAAO,MAAM,aAAa,UAAoB,eAAe;;CA2B5D,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,WAAW,CAAC,SAAS,EAAE,CAAC,CAAC;IAClC,gBAAgB,CAAC,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;IAC1C,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe,MACvB,MAAM,cACG,SAAS,EAAE,KACtB,SAiBF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB,UAAoB,qBAAqB;;;;;CAgDrE,CAAC"}
@@ -0,0 +1,45 @@
1
+ import { type PathCommand, type SkPath } from '@shopify/react-native-skia';
2
+ import { type ScaleLinear } from 'd3-scale';
3
+ import * as shape from 'd3-shape';
4
+ import { type SharedValue } from 'react-native-reanimated';
5
+ import type { AnimatedDot, DataPoint } from './types.js';
6
+ export type BuildGraphConfig = {
7
+ minX?: number;
8
+ maxX?: number;
9
+ minY?: number;
10
+ maxY?: number;
11
+ curve?: shape.CurveFactory | shape.CurveFactoryLineOnly;
12
+ };
13
+ /** @deprecated Use {@link BuildGraphConfig} instead */
14
+ export type Config = BuildGraphConfig;
15
+ export type GraphData = {
16
+ data: [x: number, y: number][];
17
+ minY: number;
18
+ maxY: number;
19
+ path: string;
20
+ skiaPath: SkPath;
21
+ dataPoints: DataPoint[];
22
+ scaleX: ScaleLinear<number, number, never>;
23
+ scaleY: ScaleLinear<number, number, never>;
24
+ };
25
+ export declare const buildGraph: (data: [x: number, y: number][], width: number, height: number, config?: BuildGraphConfig) => GraphData;
26
+ /**
27
+ * For now, only support commands of type:
28
+ * - PathVerb.Move
29
+ * - PathVerb.Cubic
30
+ * - PathVerb.Quad
31
+ * - PathVerb.Line
32
+ */
33
+ export declare const scaleCommands: (commands: PathCommand[], scaleX: SharedValue<number>, focalX: SharedValue<number>, offsetX: SharedValue<number>, scaleY?: SharedValue<number>) => PathCommand[];
34
+ export type UseDotAnimationProps = {
35
+ currentGraph: SharedValue<number>;
36
+ path: SharedValue<SkPath>;
37
+ dataPoints: DataPoint[][];
38
+ dots: AnimatedDot[];
39
+ opacityWl?: (opacity: number) => number;
40
+ translateWl?: (position: number) => number;
41
+ };
42
+ export declare const defaultOpacityTransitionWl: (opacity: number) => number;
43
+ export declare const defaultTranslateTransitionWl: (position: number) => number;
44
+ export declare const useDotsTransition: (props: UseDotAnimationProps) => void;
45
+ //# sourceMappingURL=graphUtils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"graphUtils.d.ts","sourceRoot":"","sources":["../../../../../src/Charts/graphUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,WAAW,EAChB,KAAK,MAAM,EACZ,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAe,KAAK,WAAW,EAAE,MAAM,UAAU,CAAC;AACzD,OAAO,KAAK,KAAK,MAAM,UAAU,CAAC;AAClC,OAAO,EAGL,KAAK,WAAW,EACjB,MAAM,yBAAyB,CAAC;AAGjC,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,YAAS,CAAC;AAEtD,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;I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Q,EAAE,MAAM,KAAK,MAAM,CAAC;CAC5C,CAAC;AAEF,eAAO,MAAM,0BAA0B,YAAsB,MAAM,WAGlE,CAAC;AACF,eAAO,MAAM,4BAA4B,aAAuB,MAAM,WAGrE,CAAC;AAEF,eAAO,MAAM,iBAAiB,UAAoB,oBAAoB,SAqCrE,CAAC"}
@@ -0,0 +1,15 @@
1
+ export { AxisLine, BottomAxis, Tick } from './BottomAxis/index.js';
2
+ export type { AxisLineProps, BottomAxisProps, TickProps, } from './BottomAxis/index.js';
3
+ export { Cursor } from './Cursor.js';
4
+ export type { CursorProps } from './Cursor.js';
5
+ export { LineChart } from './Linechart/index.js';
6
+ export type { LineChartProps, LinePath } from './Linechart/index.js';
7
+ export { ScalablePath, ZoomableLineChart } from './ZoomableLinechart/index.js';
8
+ export type { ScalablePathProps, ZoomableLineChartProps, } from './ZoomableLinechart/index.js';
9
+ export { getClosestPoint, getPositionWl, useCursorGesture, useScalableGesture, useUpdateAxis, } from './gesture.js';
10
+ export type { AxisGestureProps, ScalableGesture, UpdateAxisProps, UseCursorGestureProps, } from './gesture.js';
11
+ export { buildGraph, defaultOpacityTransitionWl, defaultTranslateTransitionWl, scaleCommands, useDotsTransition, } from './graphUtils.js';
12
+ export type { BuildGraphConfig, Config, GraphData, UseDotAnimationProps, } from './graphUtils.js';
13
+ export { commandsToBezier, cubicBezierYForX, getYForX, magnitude, normalize, selectCurve, } from './maths.js';
14
+ export type { AnimatedDot, DataPoint, LineGraphType } from './types.js';
15
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/Charts/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,uBAAc,CAAC;AAC1D,YAAY,EACV,aAAa,EACb,eAAe,EACf,SAAS,GACV,MAAM,uBAAc,CAAC;AACtB,OAAO,EAAE,MAAM,EAAE,MAAM,aAAU,CAAC;AAClC,YAAY,EAAE,WAAW,EAAE,MAAM,aAAU,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAa,CAAC;AACxC,YAAY,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,sBAAa,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,8BAAqB,CAAC;AACtE,YAAY,EACV,iBAAiB,EACjB,sBAAsB,GACvB,MAAM,8BAAqB,CAAC;AAC7B,OAAO,EACL,eAAe,EACf,aAAa,EACb,gBAAgB,EAChB,kBAAkB,EAClB,aAAa,GACd,MAAM,cAAW,CAAC;AACnB,YAAY,EACV,gBAAgB,EAChB,eAAe,EACf,eAAe,EACf,qBAAqB,GACtB,MAAM,cAAW,CAAC;AACnB,OAAO,EACL,UAAU,EACV,0BAA0B,EAC1B,4BAA4B,EAC5B,aAAa,EACb,iBAAiB,GAClB,MAAM,iBAAc,CAAC;AACtB,YAAY,EACV,gBAAgB,EAEhB,MAAM,EACN,SAAS,EACT,oBAAoB,GACrB,MAAM,iBAAc,CAAC;AACtB,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,QAAQ,EACR,SAAS,EACT,SAAS,EACT,WAAW,GACZ,MAAM,YAAS,CAAC;AACjB,YAAY,EAAE,WAAW,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,YAAS,CAAC"}
@@ -0,0 +1,18 @@
1
+ import type { PathCommand, SkPoint, Vector } from '@shopify/react-native-skia';
2
+ export declare const cubicBezierYForX: (x: number, a: Vector, b: Vector, c: Vector, d: Vector, precision?: number) => number;
3
+ interface Cubic {
4
+ from: Vector;
5
+ c1: Vector;
6
+ c2: Vector;
7
+ to: Vector;
8
+ }
9
+ export declare const selectCurve: (cmds: PathCommand[], x: number) => Cubic | undefined;
10
+ /**
11
+ * Convert commands to cubic bezier
12
+ */
13
+ export declare const commandsToBezier: (cmds: PathCommand[]) => PathCommand[];
14
+ export declare const getYForX: (cmds: PathCommand[], x: number, precision?: number) => number | undefined;
15
+ export declare const magnitude: (p: SkPoint) => number;
16
+ export declare const normalize: (p: SkPoint) => SkPoint;
17
+ export {};
18
+ //# sourceMappingURL=maths.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"maths.d.ts","sourceRoot":"","sources":["../../../../../src/Charts/maths.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,WAAW,EACX,OAAO,EACP,MAAM,EACP,MAAM,4BAA4B,CAAC;AAqHpC,eAAO,MAAM,gBAAgB,MACxB,MAAM,KACN,MAAM,KACN,MAAM,KACN,MAAM,KACN,MAAM,yBAER,MAcF,CAAC;AAEF,UAAU,KAAK;IACb,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,eAAO,MAAM,WAAW,SAChB,WAAW,EAAE,KAChB,MAAM,KACR,KAAK,GAAG,SA6BV,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB,SAAU,WAAW,EAAE,KAAG,WAAW,EAmCjE,CAAC;AAEF,eAAO,MAAM,QAAQ,SACb,WAAW,EAAE,KAChB,MAAM,yBAER,MAAM,GAAG,SAOX,CAAC;AAIF,eAAO,MAAM,SAAS,MAAO,OAAO,KAAG,MACL,CAAC;AAEnC,eAAO,MAAM,SAAS,MAAO,OAAO,KAEG,OACtC,CAAC"}
@@ -0,0 +1,14 @@
1
+ import type { SharedValue } from 'react-native-reanimated';
2
+ import type { GraphData } from './graphUtils.js';
3
+ export type LineGraphType = GraphData;
4
+ export type DataPoint = {
5
+ x: number;
6
+ y: number;
7
+ value: number;
8
+ };
9
+ export type AnimatedDot = {
10
+ x: SharedValue<number>;
11
+ y: SharedValue<number>;
12
+ opacity: SharedValue<number>;
13
+ };
14
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/Charts/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAc,CAAC;AAE9C,MAAM,MAAM,aAAa,GAAG,SAAS,CAAC;AAEtC,MAAM,MAAM,SAAS,GAAG;IACtB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACvB,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACvB,OAAO,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CAC9B,CAAC"}
@@ -0,0 +1,37 @@
1
+ export type DateRange = 'day' | 'month' | 'trimester' | 'year' | 'all';
2
+ export declare const getMonthInterval: (month: number, nbMonths: number) => string;
3
+ /**
4
+ * Get the date interval based on the date range.
5
+ * For example, for the date 2021-01-01:
6
+ * - day: 2021-01-01
7
+ * - month: 2021-01
8
+ * - trimester: 2021-01
9
+ * - year: 2021
10
+ * @param date
11
+ * @param dateRange
12
+ * @returns
13
+ */
14
+ export declare const getDateInterval: (date: Date, dateRange: DateRange) => string;
15
+ /**
16
+ * Groups an array of Date objects by a specific time interval (day, month, trimester, year)
17
+ * and calculates the earliest and latest dates within each interval.
18
+ * For instance, given the dates [2021-01-01, 2021-01-25, 2021-03-01, 2021-10-01]:
19
+ * - month: { '2021-01': [2021-01-01, 2021-01-25],
20
+ * '2021-03': [2021-03-01, 2021-03-01],
21
+ '2021-10': [2021-10-01, 2021-10-01] }
22
+
23
+ * @param {Date[]} dates - An array of dates to group and find boundary dates for.
24
+ * @returns {Map<string, [Date, Date]>} - A map where each key represents an interval
25
+ * as a string (formatted according to the interval type, e.g., '2021', '2021-03', '2021-01-01'),
26
+ * and each value is a tuple containing the earliest and latest dates within that interval.
27
+ */
28
+ export declare function getDateBoundaries(dates: Date[], dateRange: DateRange): Map<string, [Date, Date]>;
29
+ export declare function sampleDates(dates: Date[], sampleSize: number, indexOffset?: number): {
30
+ dates: Date[];
31
+ indexes: number[];
32
+ };
33
+ export declare function sampleDatesByRange(dates: Date[], sampleSize: number, dateRange: DateRange): Map<string, {
34
+ dates: Date[];
35
+ indexes: number[];
36
+ }>;
37
+ //# sourceMappingURL=dateUtils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dateUtils.d.ts","sourceRoot":"","sources":["../../../../src/dateUtils.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,GAAG,KAAK,GAAG,OAAO,GAAG,WAAW,GAAG,MAAM,GAAG,KAAK,CAAC;AAEvE,eAAO,MAAM,gBAAgB,UACpB,MAAM,YACH,MAAM,KACf,MAGF,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,eAAe,SACpB,IAAI,aACC,SAAS,KACnB,MAmBF,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,SAAS,EAAE,SAAS,6BAWpE;AAED,wBAAgB,WAAW,CACzB,KAAK,EAAE,IAAI,EAAE,EACb,UAAU,EAAE,MAAM,EAClB,WAAW,GAAE,MAAU,GACtB;IAAE,KAAK,EAAE,IAAI,EAAE,CAAC;IAAC,OAAO,EAAE,MAAM,EAAE,CAAA;CAAE,CAqDtC;AAED,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,IAAI,EAAE,EACb,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,SAAS,GACnB,GAAG,CAAC,MAAM,EAAE;IAAE,KAAK,EAAE,IAAI,EAAE,CAAC;IAAC,OAAO,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC,CAqBnD"}
@@ -0,0 +1,5 @@
1
+ export * from './Charts/index.js';
2
+ export * from './dateUtils.js';
3
+ export type { DateRange } from './dateUtils.js';
4
+ export * from './textUtils.js';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.tsx"],"names":[],"mappings":"AAAA,cAAc,mBAAU,CAAC;AACzB,cAAc,gBAAa,CAAC;AAC5B,YAAY,EAAE,SAAS,EAAE,MAAM,gBAAa,CAAC;AAC7C,cAAc,gBAAa,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { type SharedValue } from 'react-native-reanimated';
2
+ export declare const useSharedNumberToStr: (initValue?: number) => [SharedValue<number>, SharedValue<string>];
3
+ //# sourceMappingURL=textUtils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"textUtils.d.ts","sourceRoot":"","sources":["../../../../src/textUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,WAAW,EACjB,MAAM,yBAAyB,CAAC;AAOjC,eAAO,MAAM,oBAAoB,eACpB,MAAM,KAChB,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAO3C,CAAC"}