* 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:
Krzysztof Miemiec
2018-05-24 17:26:17 +02:00
parent ecec6c0af0
commit 817264d9db
2 changed files with 10 additions and 8 deletions
+10 -6
View File
@@ -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"
}
}