From 817264d9db437b6239ef31c41cb365dcb887d3d2 Mon Sep 17 00:00:00 2001 From: Krzysztof Miemiec Date: Fri, 18 May 2018 23:37:34 +0200 Subject: [PATCH] * Removed `@types` dependencies from `package.json` * Don't require style prop for chart components * Include style for Axis * Treat svg props as partials --- types/react-native-svg-charts/index.d.ts | 16 ++++++++++------ types/react-native-svg-charts/package.json | 2 -- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/types/react-native-svg-charts/index.d.ts b/types/react-native-svg-charts/index.d.ts index e35f30d410..88bde6c6d0 100644 --- a/types/react-native-svg-charts/index.d.ts +++ b/types/react-native-svg-charts/index.d.ts @@ -33,10 +33,10 @@ export type OrderFunction = (series: Series) => number[]; export interface ChartProps { data: T[]; - style: StyleProp; + style?: StyleProp; animate?: boolean; animationDuration?: number; - svg?: PathProps; + svg?: Partial; width?: number; height?: number; curve?: CurveFactory; @@ -64,7 +64,7 @@ export class LineChart extends React.PureComponent> { // Pie Chart export interface PieChartData { - svg?: PathProps; + svg?: Partial; key: string | number; value?: number; arc?: { @@ -150,18 +150,21 @@ export interface BarChartProps extends ChartProps { export class BarChart extends React.PureComponent> { } -// XAxis +// Axis export interface AxisProps { + style?: StyleProp; data: T[]; spacingInner?: number; spacingOuter?: number; formatLabel?: (value: any, index: number) => number | string; scale?: ScaleFunction; numberOfTicks?: number; - svg?: TextProps; + svg?: Partial; } +// XAxis + export interface XAxisProps extends AxisProps { contentInset?: { left?: number; @@ -176,6 +179,7 @@ export class XAxis extends React.PureComponent> { // YAxis export interface YAxisProps extends AxisProps { + style?: StyleProp; contentInset?: { top?: number; bottom?: number; @@ -246,7 +250,7 @@ export type GridDirection = 'VERTICAL' | 'HORIZONTAL' | 'BOTH'; export interface GridProps { direction?: GridDirection; belowChart?: boolean; - svg?: LineProps; + svg?: Partial; ticks?: T[]; x?: (t: T) => number; y?: (t: T) => number; diff --git a/types/react-native-svg-charts/package.json b/types/react-native-svg-charts/package.json index 21ce5da517..2ca3d929ed 100644 --- a/types/react-native-svg-charts/package.json +++ b/types/react-native-svg-charts/package.json @@ -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" } }