@obitrain/charts 0.10.4 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -4
- package/lib/commonjs/Charts/BottomAxis/AxisLine.js +1 -1
- package/lib/commonjs/Charts/BottomAxis/BottomAxis.js +54 -14
- package/lib/commonjs/Charts/BottomAxis/BottomAxis.js.map +1 -1
- package/lib/commonjs/Charts/BottomAxis/Tick.js +29 -13
- package/lib/commonjs/Charts/BottomAxis/Tick.js.map +1 -1
- package/lib/commonjs/Charts/BottomAxis/index.js.map +1 -1
- package/lib/commonjs/Charts/Cursor.js +33 -13
- package/lib/commonjs/Charts/Cursor.js.map +1 -1
- package/lib/commonjs/Charts/Dot.js +51 -0
- package/lib/commonjs/Charts/Dot.js.map +1 -0
- package/lib/commonjs/Charts/Dots.js +74 -0
- package/lib/commonjs/Charts/Dots.js.map +1 -0
- package/lib/commonjs/Charts/Linechart/index.js +1 -1
- package/lib/commonjs/Charts/YAxis.js +77 -0
- package/lib/commonjs/Charts/YAxis.js.map +1 -0
- package/lib/commonjs/Charts/ZoomableLinechart/ScalablePath.js +5 -4
- package/lib/commonjs/Charts/ZoomableLinechart/ScalablePath.js.map +1 -1
- package/lib/commonjs/Charts/ZoomableLinechart/index.js +1 -1
- package/lib/commonjs/Charts/gesture.js +90 -38
- package/lib/commonjs/Charts/gesture.js.map +1 -1
- package/lib/commonjs/Charts/graphUtils.js +69 -16
- package/lib/commonjs/Charts/graphUtils.js.map +1 -1
- package/lib/commonjs/Charts/index.js +39 -0
- package/lib/commonjs/Charts/index.js.map +1 -1
- package/lib/commonjs/Charts/maths.js +107 -16
- package/lib/commonjs/Charts/maths.js.map +1 -1
- package/lib/module/Charts/BottomAxis/AxisLine.js +1 -1
- package/lib/module/Charts/BottomAxis/AxisLine.js.map +1 -1
- package/lib/module/Charts/BottomAxis/BottomAxis.js +56 -15
- package/lib/module/Charts/BottomAxis/BottomAxis.js.map +1 -1
- package/lib/module/Charts/BottomAxis/Tick.js +29 -11
- package/lib/module/Charts/BottomAxis/Tick.js.map +1 -1
- package/lib/module/Charts/BottomAxis/index.js.map +1 -1
- package/lib/module/Charts/Cursor.js +35 -15
- package/lib/module/Charts/Cursor.js.map +1 -1
- package/lib/module/Charts/Dot.js +47 -0
- package/lib/module/Charts/Dot.js.map +1 -0
- package/lib/module/Charts/Dots.js +70 -0
- package/lib/module/Charts/Dots.js.map +1 -0
- package/lib/module/Charts/Linechart/index.js +1 -1
- package/lib/module/Charts/Linechart/index.js.map +1 -1
- package/lib/module/Charts/YAxis.js +73 -0
- package/lib/module/Charts/YAxis.js.map +1 -0
- package/lib/module/Charts/ZoomableLinechart/ScalablePath.js +5 -4
- package/lib/module/Charts/ZoomableLinechart/ScalablePath.js.map +1 -1
- package/lib/module/Charts/ZoomableLinechart/index.js +1 -1
- package/lib/module/Charts/ZoomableLinechart/index.js.map +1 -1
- package/lib/module/Charts/gesture.js +90 -39
- package/lib/module/Charts/gesture.js.map +1 -1
- package/lib/module/Charts/graphUtils.js +71 -18
- package/lib/module/Charts/graphUtils.js.map +1 -1
- package/lib/module/Charts/index.js +5 -2
- package/lib/module/Charts/index.js.map +1 -1
- package/lib/module/Charts/maths.js +101 -14
- package/lib/module/Charts/maths.js.map +1 -1
- package/lib/typescript/commonjs/src/Charts/BottomAxis/AxisLine.d.ts +1 -1
- package/lib/typescript/commonjs/src/Charts/BottomAxis/AxisLine.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/Charts/BottomAxis/BottomAxis.d.ts +26 -3
- package/lib/typescript/commonjs/src/Charts/BottomAxis/BottomAxis.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/Charts/BottomAxis/Tick.d.ts +16 -3
- package/lib/typescript/commonjs/src/Charts/BottomAxis/Tick.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/Charts/BottomAxis/index.d.ts +1 -1
- package/lib/typescript/commonjs/src/Charts/BottomAxis/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/Charts/Cursor.d.ts +5 -2
- package/lib/typescript/commonjs/src/Charts/Cursor.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/Charts/Dot.d.ts +22 -0
- package/lib/typescript/commonjs/src/Charts/Dot.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/Charts/Dots.d.ts +28 -0
- package/lib/typescript/commonjs/src/Charts/Dots.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/Charts/Linechart/index.d.ts +1 -1
- package/lib/typescript/commonjs/src/Charts/Linechart/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/Charts/YAxis.d.ts +21 -0
- package/lib/typescript/commonjs/src/Charts/YAxis.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/Charts/ZoomableLinechart/ScalablePath.d.ts +2 -2
- package/lib/typescript/commonjs/src/Charts/ZoomableLinechart/ScalablePath.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/Charts/ZoomableLinechart/index.d.ts +1 -1
- package/lib/typescript/commonjs/src/Charts/ZoomableLinechart/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/Charts/gesture.d.ts +6 -0
- package/lib/typescript/commonjs/src/Charts/gesture.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/Charts/graphUtils.d.ts +1 -1
- package/lib/typescript/commonjs/src/Charts/graphUtils.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/Charts/index.d.ts +9 -3
- package/lib/typescript/commonjs/src/Charts/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/Charts/maths.d.ts +15 -1
- package/lib/typescript/commonjs/src/Charts/maths.d.ts.map +1 -1
- package/lib/typescript/module/src/Charts/BottomAxis/AxisLine.d.ts +1 -1
- package/lib/typescript/module/src/Charts/BottomAxis/AxisLine.d.ts.map +1 -1
- package/lib/typescript/module/src/Charts/BottomAxis/BottomAxis.d.ts +26 -3
- package/lib/typescript/module/src/Charts/BottomAxis/BottomAxis.d.ts.map +1 -1
- package/lib/typescript/module/src/Charts/BottomAxis/Tick.d.ts +16 -3
- package/lib/typescript/module/src/Charts/BottomAxis/Tick.d.ts.map +1 -1
- package/lib/typescript/module/src/Charts/BottomAxis/index.d.ts +1 -1
- package/lib/typescript/module/src/Charts/BottomAxis/index.d.ts.map +1 -1
- package/lib/typescript/module/src/Charts/Cursor.d.ts +5 -2
- package/lib/typescript/module/src/Charts/Cursor.d.ts.map +1 -1
- package/lib/typescript/module/src/Charts/Dot.d.ts +22 -0
- package/lib/typescript/module/src/Charts/Dot.d.ts.map +1 -0
- package/lib/typescript/module/src/Charts/Dots.d.ts +28 -0
- package/lib/typescript/module/src/Charts/Dots.d.ts.map +1 -0
- package/lib/typescript/module/src/Charts/Linechart/index.d.ts +1 -1
- package/lib/typescript/module/src/Charts/Linechart/index.d.ts.map +1 -1
- package/lib/typescript/module/src/Charts/YAxis.d.ts +21 -0
- package/lib/typescript/module/src/Charts/YAxis.d.ts.map +1 -0
- package/lib/typescript/module/src/Charts/ZoomableLinechart/ScalablePath.d.ts +2 -2
- package/lib/typescript/module/src/Charts/ZoomableLinechart/ScalablePath.d.ts.map +1 -1
- package/lib/typescript/module/src/Charts/ZoomableLinechart/index.d.ts +1 -1
- package/lib/typescript/module/src/Charts/ZoomableLinechart/index.d.ts.map +1 -1
- package/lib/typescript/module/src/Charts/gesture.d.ts +6 -0
- package/lib/typescript/module/src/Charts/gesture.d.ts.map +1 -1
- package/lib/typescript/module/src/Charts/graphUtils.d.ts +1 -1
- package/lib/typescript/module/src/Charts/graphUtils.d.ts.map +1 -1
- package/lib/typescript/module/src/Charts/index.d.ts +9 -3
- package/lib/typescript/module/src/Charts/index.d.ts.map +1 -1
- package/lib/typescript/module/src/Charts/maths.d.ts +15 -1
- package/lib/typescript/module/src/Charts/maths.d.ts.map +1 -1
- package/package.json +5 -5
- package/src/Charts/BottomAxis/AxisLine.tsx +1 -1
- package/src/Charts/BottomAxis/BottomAxis.tsx +100 -19
- package/src/Charts/BottomAxis/Tick.tsx +61 -15
- package/src/Charts/BottomAxis/index.tsx +5 -1
- package/src/Charts/Cursor.tsx +38 -10
- package/src/Charts/Dot.tsx +64 -0
- package/src/Charts/Dots.tsx +96 -0
- package/src/Charts/Linechart/index.tsx +1 -1
- package/src/Charts/YAxis.tsx +103 -0
- package/src/Charts/ZoomableLinechart/ScalablePath.tsx +8 -9
- package/src/Charts/ZoomableLinechart/index.tsx +1 -1
- package/src/Charts/gesture.ts +132 -71
- package/src/Charts/graphUtils.ts +78 -16
- package/src/Charts/index.tsx +9 -0
- package/src/Charts/maths.ts +107 -16
|
@@ -1,16 +1,39 @@
|
|
|
1
|
-
import { type SkFont } from '
|
|
1
|
+
import { type Color, type SkFont } from 'react-native-skia';
|
|
2
2
|
import { type FC } from 'react';
|
|
3
3
|
import { type StyleProp, type ViewStyle } from 'react-native';
|
|
4
4
|
import type { SharedValue } from 'react-native-reanimated';
|
|
5
|
+
/** A tick at an explicit position in graph space, as returned by a d3 scale. */
|
|
6
|
+
export type AxisTick = {
|
|
7
|
+
x: number;
|
|
8
|
+
label: string;
|
|
9
|
+
};
|
|
5
10
|
export type BottomAxisProps = {
|
|
6
|
-
labels: string[];
|
|
7
11
|
width: number;
|
|
8
12
|
scale: SharedValue<number>;
|
|
9
13
|
focalX: SharedValue<number>;
|
|
10
14
|
offsetX: SharedValue<number>;
|
|
15
|
+
font: SkFont;
|
|
16
|
+
/**
|
|
17
|
+
* Ticks at explicit positions, for a non-uniform axis (a time axis lands on
|
|
18
|
+
* month starts or Mondays, not on even fractions). Takes precedence over `labels`.
|
|
19
|
+
*/
|
|
20
|
+
ticks?: AxisTick[];
|
|
21
|
+
/** Labels spread evenly across `width`. */
|
|
22
|
+
labels?: string[];
|
|
11
23
|
offsetY?: number;
|
|
12
24
|
style?: StyleProp<ViewStyle>;
|
|
13
|
-
|
|
25
|
+
/** Renders its own Canvas by default; pass false to embed in an existing one. */
|
|
26
|
+
standalone?: boolean;
|
|
27
|
+
showAxisLine?: boolean;
|
|
28
|
+
color?: Color;
|
|
29
|
+
labelColor?: Color;
|
|
30
|
+
/** Negative (e.g. -chartHeight) draws full-height gridlines above the axis. */
|
|
31
|
+
tickLength?: number;
|
|
32
|
+
strokeWidth?: number;
|
|
33
|
+
dash?: [number, number];
|
|
34
|
+
labelAlign?: 'center' | 'left';
|
|
35
|
+
labelGap?: number;
|
|
36
|
+
showLabels?: boolean;
|
|
14
37
|
};
|
|
15
38
|
declare const BottomAxis: FC<BottomAxisProps>;
|
|
16
39
|
export { BottomAxis };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BottomAxis.d.ts","sourceRoot":"","sources":["../../../../../../src/Charts/BottomAxis/BottomAxis.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"BottomAxis.d.ts","sourceRoot":"","sources":["../../../../../../src/Charts/BottomAxis/BottomAxis.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,KAAK,EACV,KAAK,MAAM,EACZ,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAW,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAI3D,gFAAgF;AAChF,MAAM,MAAM,QAAQ,GAAG;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAEpD,MAAM,MAAM,eAAe,GAAG;IAC5B,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,IAAI,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,KAAK,CAAC,EAAE,QAAQ,EAAE,CAAC;IACnB,2CAA2C;IAC3C,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,iFAAiF;IACjF,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,UAAU,CAAC,EAAE,KAAK,CAAC;IACnB,+EAA+E;IAC/E,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACxB,UAAU,CAAC,EAAE,QAAQ,GAAG,MAAM,CAAC;IAC/B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,QAAA,MAAM,UAAU,EAAE,EAAE,CAAC,eAAe,CA4EnC,CAAC;AAEF,OAAO,EAAE,UAAU,EAAE,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { type SkFont } from '
|
|
2
|
-
import React from 'react';
|
|
1
|
+
import { type Color, type SkFont } from 'react-native-skia';
|
|
3
2
|
import { type SharedValue } from 'react-native-reanimated';
|
|
4
3
|
export type TickProps = {
|
|
5
4
|
initPosition: number;
|
|
@@ -9,6 +8,20 @@ export type TickProps = {
|
|
|
9
8
|
offsetX: SharedValue<number>;
|
|
10
9
|
offsetY?: number;
|
|
11
10
|
font: SkFont;
|
|
11
|
+
color?: Color;
|
|
12
|
+
labelColor?: Color;
|
|
13
|
+
/** Length of the tick line. Use a negative value (e.g. -chartHeight) to draw a vertical gridline above the axis. */
|
|
14
|
+
tickLength?: number;
|
|
15
|
+
strokeWidth?: number;
|
|
16
|
+
/** Dash/gap lengths for a dashed tick line. */
|
|
17
|
+
dash?: [number, number];
|
|
18
|
+
showLabel?: boolean;
|
|
19
|
+
/** `center` puts the label under the tick, `left` starts it right after the tick. */
|
|
20
|
+
labelAlign?: 'center' | 'left';
|
|
21
|
+
/** Gap between the tick and a left-aligned label. */
|
|
22
|
+
labelGap?: number;
|
|
12
23
|
};
|
|
13
|
-
|
|
24
|
+
declare const TickComponent: (props: TickProps) => import("react").JSX.Element;
|
|
25
|
+
export declare const Tick: import("react").MemoExoticComponent<typeof TickComponent>;
|
|
26
|
+
export {};
|
|
14
27
|
//# sourceMappingURL=Tick.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tick.d.ts","sourceRoot":"","sources":["../../../../../../src/Charts/BottomAxis/Tick.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"Tick.d.ts","sourceRoot":"","sources":["../../../../../../src/Charts/BottomAxis/Tick.tsx"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,KAAK,EACV,KAAK,MAAM,EACZ,MAAM,mBAAmB,CAAC;AAE3B,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;IACb,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,UAAU,CAAC,EAAE,KAAK,CAAC;IACnB,oHAAoH;IACpH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,+CAA+C;IAC/C,IAAI,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACxB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,qFAAqF;IACrF,UAAU,CAAC,EAAE,QAAQ,GAAG,MAAM,CAAC;IAC/B,qDAAqD;IACrD,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,QAAA,MAAM,aAAa,UAAoB,SAAS,gCAwD/C,CAAC;AAIF,eAAO,MAAM,IAAI,2DAAsB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { AxisLine, type AxisLineProps } from './AxisLine.js';
|
|
2
|
-
export { BottomAxis, type BottomAxisProps } from './BottomAxis.js';
|
|
2
|
+
export { BottomAxis, type AxisTick, type BottomAxisProps, } from './BottomAxis.js';
|
|
3
3
|
export { Tick, type TickProps } from './Tick.js';
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +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,
|
|
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,EACL,UAAU,EACV,KAAK,QAAQ,EACb,KAAK,eAAe,GACrB,MAAM,iBAAc,CAAC;AACtB,OAAO,EAAE,IAAI,EAAE,KAAK,SAAS,EAAE,MAAM,WAAQ,CAAC"}
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
import { type PathCommand } from '
|
|
2
|
-
import type
|
|
1
|
+
import { type PathCommand } from 'react-native-skia';
|
|
2
|
+
import { type FC } from 'react';
|
|
3
3
|
import { type SharedValue } from 'react-native-reanimated';
|
|
4
4
|
export type CursorProps = {
|
|
5
5
|
commands?: SharedValue<PathCommand[]>;
|
|
6
6
|
positionX: SharedValue<number>;
|
|
7
7
|
size?: number;
|
|
8
8
|
color?: string;
|
|
9
|
+
/** When set, draws a ring of this color around the cursor. */
|
|
10
|
+
strokeColor?: string;
|
|
11
|
+
strokeWidth?: number;
|
|
9
12
|
currentValue?: SharedValue<number> | SharedValue<number | undefined>;
|
|
10
13
|
translateY?: SharedValue<number | undefined>;
|
|
11
14
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Cursor.d.ts","sourceRoot":"","sources":["../../../../../src/Charts/Cursor.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAU,KAAK,WAAW,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"Cursor.d.ts","sourceRoot":"","sources":["../../../../../src/Charts/Cursor.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAU,KAAK,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAa,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAC3C,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,8DAA8D;IAC9D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,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,CAwD3B,CAAC;AAEF,OAAO,EAAE,MAAM,EAAE,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type Color } from 'react-native-skia';
|
|
2
|
+
import { type SharedValue } from 'react-native-reanimated';
|
|
3
|
+
export type DotProps = {
|
|
4
|
+
x: SharedValue<number> | number;
|
|
5
|
+
y: SharedValue<number> | number;
|
|
6
|
+
opacity?: SharedValue<number> | number;
|
|
7
|
+
r?: number;
|
|
8
|
+
color?: Color;
|
|
9
|
+
/**
|
|
10
|
+
* When set, the dot is drawn as a ring: `fillColor` inside, `color` as the
|
|
11
|
+
* stroke. Use the chart background color to get a "hollow" marker.
|
|
12
|
+
*/
|
|
13
|
+
fillColor?: Color;
|
|
14
|
+
strokeWidth?: number;
|
|
15
|
+
scale?: SharedValue<number>;
|
|
16
|
+
focalX?: SharedValue<number>;
|
|
17
|
+
offsetX?: SharedValue<number>;
|
|
18
|
+
};
|
|
19
|
+
declare function DotComponent(props: DotProps): import("react").JSX.Element;
|
|
20
|
+
export declare const Dot: import("react").MemoExoticComponent<typeof DotComponent>;
|
|
21
|
+
export {};
|
|
22
|
+
//# sourceMappingURL=Dot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Dot.d.ts","sourceRoot":"","sources":["../../../../../src/Charts/Dot.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAE9D,OAAO,EAAmB,KAAK,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAG5E,MAAM,MAAM,QAAQ,GAAG;IACrB,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC;IAChC,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC;IAChC,OAAO,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC;IACvC,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,KAAK,CAAC,EAAE,KAAK,CAAC;IACd;;;OAGG;IACH,SAAS,CAAC,EAAE,KAAK,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,KAAK,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC5B,MAAM,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC7B,OAAO,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CAC/B,CAAC;AAEF,iBAAS,YAAY,CAAC,KAAK,EAAE,QAAQ,+BAoCpC;AAID,eAAO,MAAM,GAAG,0DAAqB,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { type Color } from 'react-native-skia';
|
|
2
|
+
import { type FC } from 'react';
|
|
3
|
+
import { type SharedValue } from 'react-native-reanimated';
|
|
4
|
+
import type { AnimatedDot } from './types.js';
|
|
5
|
+
export type DotShape = 'circle' | 'diamond';
|
|
6
|
+
export type DotsProps = {
|
|
7
|
+
dots: AnimatedDot[];
|
|
8
|
+
r?: number;
|
|
9
|
+
shape?: DotShape;
|
|
10
|
+
color?: Color;
|
|
11
|
+
/** When set, dots are drawn as rings: `fillColor` inside, `color` as the stroke. */
|
|
12
|
+
fillColor?: Color;
|
|
13
|
+
strokeWidth?: number;
|
|
14
|
+
/** Viewport width used to cull off-screen dots. */
|
|
15
|
+
width?: number;
|
|
16
|
+
scale?: SharedValue<number>;
|
|
17
|
+
focalX?: SharedValue<number>;
|
|
18
|
+
offsetX?: SharedValue<number>;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Draw a whole series of dots as a single Skia path (two with `fillColor`).
|
|
22
|
+
* Unlike mapping over {@link Dot}, this runs one worklet per frame instead of
|
|
23
|
+
* one per dot, which keeps large series smooth during zoom/pan gestures.
|
|
24
|
+
* Per-dot opacity is binary here: dots below 0.5 are hidden.
|
|
25
|
+
*/
|
|
26
|
+
declare const Dots: FC<DotsProps>;
|
|
27
|
+
export { Dots };
|
|
28
|
+
//# sourceMappingURL=Dots.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Dots.d.ts","sourceRoot":"","sources":["../../../../../src/Charts/Dots.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAE,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EAAmB,KAAK,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE5E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAS,CAAC;AAE3C,MAAM,MAAM,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAC;AAE5C,MAAM,MAAM,SAAS,GAAG;IACtB,IAAI,EAAE,WAAW,EAAE,CAAC;IACpB,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,KAAK,CAAC,EAAE,QAAQ,CAAC;IACjB,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,oFAAoF;IACpF,SAAS,CAAC,EAAE,KAAK,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,mDAAmD;IACnD,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,KAAK,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC5B,MAAM,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC7B,OAAO,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CAC/B,CAAC;AAEF;;;;;GAKG;AACH,QAAA,MAAM,IAAI,EAAE,EAAE,CAAC,SAAS,CA+DvB,CAAC;AAEF,OAAO,EAAE,IAAI,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/Charts/Linechart/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAuB,KAAK,MAAM,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/Charts/Linechart/index.tsx"],"names":[],"mappings":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|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type Color, type SkFont } from 'react-native-skia';
|
|
2
|
+
export type YAxisProps = {
|
|
3
|
+
width: number;
|
|
4
|
+
height: number;
|
|
5
|
+
font: SkFont;
|
|
6
|
+
minY: number;
|
|
7
|
+
maxY: number;
|
|
8
|
+
/** Values to draw a gridline at. Defaults to `nbTicks` evenly spaced values. */
|
|
9
|
+
values?: number[];
|
|
10
|
+
nbTicks?: number;
|
|
11
|
+
color?: Color;
|
|
12
|
+
labelColor?: Color;
|
|
13
|
+
strokeWidth?: number;
|
|
14
|
+
showLabels?: boolean;
|
|
15
|
+
formatLabel?: (value: number) => string;
|
|
16
|
+
};
|
|
17
|
+
/** Evenly spaced integer ticks from 0 to a padded maximum, e.g. 0, 26, 52, 78, 104. */
|
|
18
|
+
export declare const getPaddedTicks: (maxValue: number, nbTicks?: number, padding?: number) => number[];
|
|
19
|
+
declare const MemoYAxis: import("react").NamedExoticComponent<YAxisProps>;
|
|
20
|
+
export { MemoYAxis as YAxis };
|
|
21
|
+
//# sourceMappingURL=YAxis.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"YAxis.d.ts","sourceRoot":"","sources":["../../../../../src/Charts/YAxis.tsx"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,KAAK,EACV,KAAK,MAAM,EACZ,MAAM,mBAAmB,CAAC;AAI3B,MAAM,MAAM,UAAU,GAAG;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,gFAAgF;IAChF,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,UAAU,CAAC,EAAE,KAAK,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;CACzC,CAAC;AAIF,uFAAuF;AACvF,eAAO,MAAM,cAAc,aACf,MAAM,yCAGf,MAAM,EAGR,CAAC;AA8DF,QAAA,MAAM,SAAS,kDAAc,CAAC;AAG9B,OAAO,EAAE,SAAS,IAAI,KAAK,EAAE,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Path, type SkPath } from '
|
|
1
|
+
import { Path, type SkPath } from 'react-native-skia';
|
|
2
2
|
import { type FC } from 'react';
|
|
3
3
|
import { type SharedValue } from 'react-native-reanimated';
|
|
4
4
|
export type ScalablePathProps = {
|
|
@@ -7,7 +7,7 @@ export type ScalablePathProps = {
|
|
|
7
7
|
focalX: SharedValue<number>;
|
|
8
8
|
offsetX: SharedValue<number>;
|
|
9
9
|
color?: string;
|
|
10
|
-
pathProps?: Omit<React.ComponentProps<typeof Path>, 'color'>;
|
|
10
|
+
pathProps?: Omit<React.ComponentProps<typeof Path>, 'color' | 'path'>;
|
|
11
11
|
};
|
|
12
12
|
declare const ScalablePath: FC<ScalablePathProps>;
|
|
13
13
|
export { ScalablePath };
|
|
@@ -1 +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,
|
|
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,mBAAmB,CAAC;AAC5D,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,GAAG,MAAM,CAAC,CAAC;CACvE,CAAC;AAEF,QAAA,MAAM,YAAY,EAAE,EAAE,CAAC,iBAAiB,CAwBvC,CAAC;AAEF,OAAO,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/Charts/ZoomableLinechart/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,MAAM,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/Charts/ZoomableLinechart/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC/D,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"}
|
|
@@ -6,6 +6,12 @@ import type { DataPoint } from './types.js';
|
|
|
6
6
|
* given the current focal, scale and offset
|
|
7
7
|
*/
|
|
8
8
|
export declare const getPositionWl: (position: number, focalX: number, scale: number, offsetX: number) => number;
|
|
9
|
+
/**
|
|
10
|
+
* Offset range keeping the content edges pinned to the viewport:
|
|
11
|
+
* leftBound (position 0) <= startOffset and rightBound (position width)
|
|
12
|
+
* >= width + startOffset. Collapses to [startOffset, startOffset] at scale 1.
|
|
13
|
+
*/
|
|
14
|
+
export declare const getOffsetBoundsWl: (width: number, startOffset: number, focalX: number, scale: number) => [min: number, max: number];
|
|
9
15
|
export type AxisGestureProps = {
|
|
10
16
|
width: number;
|
|
11
17
|
startOffset?: number;
|
|
@@ -1 +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,
|
|
1
|
+
{"version":3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,UAAoB,eAAe;;CAoC5D,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;;;;;CAmDrE,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type PathCommand, type SkPath } from '
|
|
1
|
+
import { type PathCommand, type SkPath } from 'react-native-skia';
|
|
2
2
|
import { type ScaleLinear } from 'd3-scale';
|
|
3
3
|
import * as shape from 'd3-shape';
|
|
4
4
|
import { type SharedValue } from 'react-native-reanimated';
|
|
@@ -1 +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,
|
|
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,mBAAmB,CAAC;AAE3B,OAAO,EAAe,KAAK,WAAW,EAAE,MAAM,UAAU,CAAC;AACzD,OAAO,KAAK,KAAK,MAAM,UAAU,CAAC;AAClC,OAAO,EAIL,KAAK,WAAW,EACjB,MAAM,yBAAyB,CAAC;AAQjC,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,YAAS,CAAC;AAEtD,MAAM,M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,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,SAiFrE,CAAC"}
|
|
@@ -1,15 +1,21 @@
|
|
|
1
1
|
export { AxisLine, BottomAxis, Tick } from './BottomAxis/index.js';
|
|
2
|
-
export type { AxisLineProps, BottomAxisProps, TickProps, } from './BottomAxis/index.js';
|
|
2
|
+
export type { AxisLineProps, AxisTick, BottomAxisProps, TickProps, } from './BottomAxis/index.js';
|
|
3
3
|
export { Cursor } from './Cursor.js';
|
|
4
4
|
export type { CursorProps } from './Cursor.js';
|
|
5
|
+
export { Dot } from './Dot.js';
|
|
6
|
+
export type { DotProps } from './Dot.js';
|
|
7
|
+
export { Dots } from './Dots.js';
|
|
8
|
+
export type { DotShape, DotsProps } from './Dots.js';
|
|
9
|
+
export { YAxis, getPaddedTicks } from './YAxis.js';
|
|
10
|
+
export type { YAxisProps } from './YAxis.js';
|
|
5
11
|
export { LineChart } from './Linechart/index.js';
|
|
6
12
|
export type { LineChartProps, LinePath } from './Linechart/index.js';
|
|
7
13
|
export { ScalablePath, ZoomableLineChart } from './ZoomableLinechart/index.js';
|
|
8
14
|
export type { ScalablePathProps, ZoomableLineChartProps, } from './ZoomableLinechart/index.js';
|
|
9
|
-
export { getClosestPoint, getPositionWl, useCursorGesture, useScalableGesture, useUpdateAxis, } from './gesture.js';
|
|
15
|
+
export { getClosestPoint, getOffsetBoundsWl, getPositionWl, useCursorGesture, useScalableGesture, useUpdateAxis, } from './gesture.js';
|
|
10
16
|
export type { AxisGestureProps, ScalableGesture, UpdateAxisProps, UseCursorGestureProps, } from './gesture.js';
|
|
11
17
|
export { buildGraph, defaultOpacityTransitionWl, defaultTranslateTransitionWl, scaleCommands, useDotsTransition, } from './graphUtils.js';
|
|
12
18
|
export type { BuildGraphConfig, Config, GraphData, UseDotAnimationProps, } from './graphUtils.js';
|
|
13
|
-
export { commandsToBezier, cubicBezierYForX, getYForX, magnitude, normalize, selectCurve, } from './maths.js';
|
|
19
|
+
export { commandsToBezier, cubicBezierYForX, getYForX, getYForXOnBeziers, magnitude, normalize, selectCurve, } from './maths.js';
|
|
14
20
|
export type { AnimatedDot, DataPoint, LineGraphType } from './types.js';
|
|
15
21
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +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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EACjB,sBAAsB,GACvB,MAAM,8BAAqB,CAAC;AAC7B,OAAO,EACL,eAAe,EACf,iBAAiB,EACjB,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,iBAAiB,EACjB,SAAS,EACT,SAAS,EACT,WAAW,GACZ,MAAM,YAAS,CAAC;AACjB,YAAY,EAAE,WAAW,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,YAAS,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { PathCommand, SkPoint, Vector } from '
|
|
1
|
+
import type { PathCommand, SkPoint, Vector } from '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,6 +12,20 @@ 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
|
+
/**
|
|
16
|
+
* Index of the cubic whose x range contains `x`, scanning from `start`; -1 if none.
|
|
17
|
+
* `cmds` must come from {@link commandsToBezier}.
|
|
18
|
+
*/
|
|
19
|
+
export declare const findBezierIndex: (cmds: PathCommand[], x: number, start?: number) => number;
|
|
20
|
+
/** y of the cubic at `cmds[index]` for `x`, without allocating; undefined when x has no t in [0, 1]. */
|
|
21
|
+
export declare const getYOnBezier: (cmds: PathCommand[], index: number, x: number) => number | undefined;
|
|
22
|
+
/**
|
|
23
|
+
* y of the path's start when `x` is left of it, of its end when right of it, else undefined.
|
|
24
|
+
* Endpoints are stored as float32, so a point's exact x can fall a hair outside the path.
|
|
25
|
+
*/
|
|
26
|
+
export declare const getYBeyondPathEnds: (cmds: PathCommand[], x: number) => number | undefined;
|
|
27
|
+
/** Same as {@link getYForX} for commands already passed through {@link commandsToBezier}. */
|
|
28
|
+
export declare const getYForXOnBeziers: (cmds: PathCommand[], x: number) => number | undefined;
|
|
15
29
|
export declare const magnitude: (p: SkPoint) => number;
|
|
16
30
|
export declare const normalize: (p: SkPoint) => SkPoint;
|
|
17
31
|
export {};
|
|
@@ -1 +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,
|
|
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,mBAAmB,CAAC;AAqH3B,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,SAiCV,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,SAKX,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,eAAe,SACpB,WAAW,EAAE,KAChB,MAAM,qBAER,MAUF,CAAC;AAIF,wGAAwG;AACxG,eAAO,MAAM,YAAY,SACjB,WAAW,EAAE,SACZ,MAAM,KACV,MAAM,KACR,MAAM,GAAG,SAiCX,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,kBAAkB,SACvB,WAAW,EAAE,KAChB,MAAM,KACR,MAAM,GAAG,SAQX,CAAC;AAEF,6FAA6F;AAC7F,eAAO,MAAM,iBAAiB,SACtB,WAAW,EAAE,KAChB,MAAM,KACR,MAAM,GAAG,SAIX,CAAC;AAIF,eAAO,MAAM,SAAS,MAAO,OAAO,KAAG,MACL,CAAC;AAEnC,eAAO,MAAM,SAAS,MAAO,OAAO,KAEG,OACtC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@obitrain/charts",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.0",
|
|
4
4
|
"description": "Charting library for React Native",
|
|
5
5
|
"main": "lib/commonjs/index.js",
|
|
6
6
|
"module": "lib/module/index.js",
|
|
@@ -85,7 +85,6 @@
|
|
|
85
85
|
"@react-native/jest-preset": "^0.86.0",
|
|
86
86
|
"@react-native/metro-config": "^0.86.0",
|
|
87
87
|
"@rnx-kit/align-deps": "^4.0.6",
|
|
88
|
-
"@shopify/react-native-skia": "2.6.2",
|
|
89
88
|
"@types/jest": "^30.0.0",
|
|
90
89
|
"@types/react": "^19.2.18",
|
|
91
90
|
"@typescript/native": "npm:typescript@^7.0.2",
|
|
@@ -105,18 +104,19 @@
|
|
|
105
104
|
"react-native-builder-bob": "^0.43.0",
|
|
106
105
|
"react-native-gesture-handler": "~2.32.0",
|
|
107
106
|
"react-native-reanimated": "~4.5.1",
|
|
107
|
+
"react-native-skia": "3.0.4",
|
|
108
108
|
"react-native-worklets": "^0.10.1",
|
|
109
109
|
"react-test-renderer": "19.2.3",
|
|
110
110
|
"typescript": "npm:@typescript/typescript6@^6.0.2"
|
|
111
111
|
},
|
|
112
112
|
"peerDependencies": {
|
|
113
|
-
"@shopify/react-native-skia": ">=2.0.0 <3.0.0",
|
|
114
113
|
"d3-scale": ">=4.0.2 <5.0.0",
|
|
115
114
|
"d3-shape": ">=3.2.0 <4.0.0",
|
|
116
115
|
"react": "^16.9.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
117
116
|
"react-native": "^0.79.0 || ^0.80.0 || ^0.81.6 || ^0.82.0 || ^0.83.0 || ^0.84.0 || ^0.85.0 || ^0.86.0 || ^0.87.0",
|
|
118
117
|
"react-native-gesture-handler": "^2.26.0 || ^2.28.0 || ^2.29.1 || ^2.30.0 || ^2.31.1 || ~2.32.0 || ^3.1.0",
|
|
119
118
|
"react-native-reanimated": "^4.0.0 || ~4.5.1",
|
|
119
|
+
"react-native-skia": ">=3.0.4",
|
|
120
120
|
"react-native-worklets": ">=0.5.0"
|
|
121
121
|
},
|
|
122
122
|
"workspaces": [
|
|
@@ -138,11 +138,11 @@
|
|
|
138
138
|
},
|
|
139
139
|
"setupFiles": [
|
|
140
140
|
"<rootDir>/jest.setup.js",
|
|
141
|
-
"
|
|
141
|
+
"react-native-skia/jestSetup.js",
|
|
142
142
|
"react-native-gesture-handler/jestSetup.js"
|
|
143
143
|
],
|
|
144
144
|
"transformIgnorePatterns": [
|
|
145
|
-
"node_modules/(?!((jest-)?react-native|@react-native(-community)
|
|
145
|
+
"node_modules/(?!((jest-)?react-native|@react-native(-community)?|react-native-skia|react-native-reanimated|react-native-worklets|react-native-gesture-handler|d3-.*|internmap)/)"
|
|
146
146
|
],
|
|
147
147
|
"modulePathIgnorePatterns": [
|
|
148
148
|
"<rootDir>/example/node_modules",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Line, vec, type Color } from '
|
|
1
|
+
import { Line, vec, type Color } from 'react-native-skia';
|
|
2
2
|
import { type FC } from 'react';
|
|
3
3
|
import { StyleSheet } from 'react-native';
|
|
4
4
|
import { useDerivedValue, type SharedValue } from 'react-native-reanimated';
|
|
@@ -1,41 +1,122 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import {
|
|
2
|
+
Canvas,
|
|
3
|
+
type Color,
|
|
4
|
+
type SkFont,
|
|
5
|
+
} from 'react-native-skia';
|
|
6
|
+
import { useMemo, type FC } from 'react';
|
|
4
7
|
import { type StyleProp, type ViewStyle } from 'react-native';
|
|
5
8
|
import type { SharedValue } from 'react-native-reanimated';
|
|
6
9
|
import { AxisLine } from './AxisLine';
|
|
7
10
|
import { Tick } from './Tick';
|
|
8
11
|
|
|
12
|
+
/** A tick at an explicit position in graph space, as returned by a d3 scale. */
|
|
13
|
+
export type AxisTick = { x: number; label: string };
|
|
14
|
+
|
|
9
15
|
export type BottomAxisProps = {
|
|
10
|
-
labels: string[];
|
|
11
16
|
width: number;
|
|
12
|
-
// tickInterval: number;
|
|
13
17
|
scale: SharedValue<number>;
|
|
14
18
|
focalX: SharedValue<number>;
|
|
15
19
|
offsetX: SharedValue<number>;
|
|
20
|
+
font: SkFont;
|
|
21
|
+
/**
|
|
22
|
+
* Ticks at explicit positions, for a non-uniform axis (a time axis lands on
|
|
23
|
+
* month starts or Mondays, not on even fractions). Takes precedence over `labels`.
|
|
24
|
+
*/
|
|
25
|
+
ticks?: AxisTick[];
|
|
26
|
+
/** Labels spread evenly across `width`. */
|
|
27
|
+
labels?: string[];
|
|
16
28
|
offsetY?: number;
|
|
17
29
|
style?: StyleProp<ViewStyle>;
|
|
18
|
-
|
|
30
|
+
/** Renders its own Canvas by default; pass false to embed in an existing one. */
|
|
31
|
+
standalone?: boolean;
|
|
32
|
+
showAxisLine?: boolean;
|
|
33
|
+
color?: Color;
|
|
34
|
+
labelColor?: Color;
|
|
35
|
+
/** Negative (e.g. -chartHeight) draws full-height gridlines above the axis. */
|
|
36
|
+
tickLength?: number;
|
|
37
|
+
strokeWidth?: number;
|
|
38
|
+
dash?: [number, number];
|
|
39
|
+
labelAlign?: 'center' | 'left';
|
|
40
|
+
labelGap?: number;
|
|
41
|
+
showLabels?: boolean;
|
|
19
42
|
};
|
|
20
43
|
|
|
21
44
|
const BottomAxis: FC<BottomAxisProps> = function (props) {
|
|
22
|
-
const {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
45
|
+
const {
|
|
46
|
+
labels,
|
|
47
|
+
ticks,
|
|
48
|
+
scale,
|
|
49
|
+
focalX,
|
|
50
|
+
offsetX,
|
|
51
|
+
style,
|
|
52
|
+
width,
|
|
53
|
+
font,
|
|
54
|
+
offsetY = 0,
|
|
55
|
+
standalone = true,
|
|
56
|
+
showAxisLine = true,
|
|
57
|
+
color,
|
|
58
|
+
labelColor,
|
|
59
|
+
tickLength,
|
|
60
|
+
strokeWidth,
|
|
61
|
+
dash,
|
|
62
|
+
labelAlign,
|
|
63
|
+
labelGap,
|
|
64
|
+
showLabels,
|
|
65
|
+
} = props;
|
|
66
|
+
|
|
67
|
+
const items = useMemo<AxisTick[]>(() => {
|
|
68
|
+
if (ticks !== undefined) return ticks;
|
|
69
|
+
if (labels === undefined) return [];
|
|
70
|
+
const interval = labels.length > 1 ? width / (labels.length - 1) : 0;
|
|
71
|
+
return labels.map((label, i) => ({ x: interval * i, label }));
|
|
72
|
+
}, [ticks, labels, width]);
|
|
73
|
+
|
|
74
|
+
// Callers naturally write `dash={[3, 4]}`; keying the memo on the values
|
|
75
|
+
// keeps one reference so the memoized Ticks are not rebuilt every render
|
|
76
|
+
const dashStart = dash?.[0];
|
|
77
|
+
const dashEnd = dash?.[1];
|
|
78
|
+
const dashIntervals = useMemo(
|
|
79
|
+
() =>
|
|
80
|
+
dashStart === undefined || dashEnd === undefined
|
|
81
|
+
? undefined
|
|
82
|
+
: ([dashStart, dashEnd] as [number, number]),
|
|
83
|
+
[dashStart, dashEnd]
|
|
84
|
+
);
|
|
85
|
+
|
|
86
|
+
const content = (
|
|
87
|
+
<>
|
|
88
|
+
{showAxisLine ? (
|
|
89
|
+
<AxisLine
|
|
90
|
+
{...{ width, offsetY, focalX, scale, offsetX, color, strokeWidth }}
|
|
91
|
+
/>
|
|
92
|
+
) : null}
|
|
93
|
+
{items.map((tick) => (
|
|
30
94
|
<Tick
|
|
31
|
-
key={
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
{
|
|
95
|
+
key={`${tick.x}:${tick.label}`}
|
|
96
|
+
initPosition={tick.x}
|
|
97
|
+
label={tick.label}
|
|
98
|
+
dash={dashIntervals}
|
|
99
|
+
{...{
|
|
100
|
+
offsetX,
|
|
101
|
+
offsetY,
|
|
102
|
+
focalX,
|
|
103
|
+
scale,
|
|
104
|
+
font,
|
|
105
|
+
color,
|
|
106
|
+
labelColor,
|
|
107
|
+
tickLength,
|
|
108
|
+
strokeWidth,
|
|
109
|
+
labelAlign,
|
|
110
|
+
labelGap,
|
|
111
|
+
}}
|
|
112
|
+
showLabel={showLabels}
|
|
35
113
|
/>
|
|
36
114
|
))}
|
|
37
|
-
|
|
115
|
+
</>
|
|
38
116
|
);
|
|
117
|
+
|
|
118
|
+
if (!standalone) return content;
|
|
119
|
+
return <Canvas style={style}>{content}</Canvas>;
|
|
39
120
|
};
|
|
40
121
|
|
|
41
122
|
export { BottomAxis };
|