mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 06:47:03 +00:00
* Removed @types dependencies from package.json
* Don't require style prop for chart components * Include style for Axis * Treat svg props as partials
This commit is contained in:
+10
-6
@@ -33,10 +33,10 @@ export type OrderFunction = (series: Series<any, any>) => number[];
|
||||
|
||||
export interface ChartProps<T> {
|
||||
data: T[];
|
||||
style: StyleProp<ViewStyle>;
|
||||
style?: StyleProp<ViewStyle>;
|
||||
animate?: boolean;
|
||||
animationDuration?: number;
|
||||
svg?: PathProps;
|
||||
svg?: Partial<PathProps>;
|
||||
width?: number;
|
||||
height?: number;
|
||||
curve?: CurveFactory;
|
||||
@@ -64,7 +64,7 @@ export class LineChart<T> extends React.PureComponent<ChartProps<T>> {
|
||||
// Pie Chart
|
||||
|
||||
export interface PieChartData {
|
||||
svg?: PathProps;
|
||||
svg?: Partial<PathProps>;
|
||||
key: string | number;
|
||||
value?: number;
|
||||
arc?: {
|
||||
@@ -150,18 +150,21 @@ export interface BarChartProps<T> extends ChartProps<T> {
|
||||
export class BarChart<T> extends React.PureComponent<BarChartProps<T>> {
|
||||
}
|
||||
|
||||
// XAxis
|
||||
// Axis
|
||||
|
||||
export interface AxisProps<T> {
|
||||
style?: StyleProp<ViewStyle>;
|
||||
data: T[];
|
||||
spacingInner?: number;
|
||||
spacingOuter?: number;
|
||||
formatLabel?: (value: any, index: number) => number | string;
|
||||
scale?: ScaleFunction;
|
||||
numberOfTicks?: number;
|
||||
svg?: TextProps;
|
||||
svg?: Partial<TextProps>;
|
||||
}
|
||||
|
||||
// XAxis
|
||||
|
||||
export interface XAxisProps<T> extends AxisProps<T> {
|
||||
contentInset?: {
|
||||
left?: number;
|
||||
@@ -176,6 +179,7 @@ export class XAxis<T> extends React.PureComponent<XAxisProps<T>> {
|
||||
// YAxis
|
||||
|
||||
export interface YAxisProps<T> extends AxisProps<T> {
|
||||
style?: StyleProp<ViewStyle>;
|
||||
contentInset?: {
|
||||
top?: number;
|
||||
bottom?: number;
|
||||
@@ -246,7 +250,7 @@ export type GridDirection = 'VERTICAL' | 'HORIZONTAL' | 'BOTH';
|
||||
export interface GridProps<T> {
|
||||
direction?: GridDirection;
|
||||
belowChart?: boolean;
|
||||
svg?: LineProps;
|
||||
svg?: Partial<LineProps>;
|
||||
ticks?: T[];
|
||||
x?: (t: T) => number;
|
||||
y?: (t: T) => number;
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
{
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@types/d3-scale": "^2.0.0",
|
||||
"@types/d3-shape": "^1.2.2",
|
||||
"react-native-svg": "^6.2.1"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user