Skip to content

Commit 06bf50e

Browse files
committed
Removed PropTypes
1 parent 3246208 commit 06bf50e

File tree

8 files changed

+1
-233
lines changed

8 files changed

+1
-233
lines changed

index.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,6 @@
1313
export { default as Axes }from './lib/Axes';
1414
export { default as BarChart }from './lib/BarChart';
1515
export { default as LineChart }from './lib/LineChart';
16-
// prop types
17-
export { default as AxisStylePropTypes }from './lib/AxisStylePropTypes';
18-
export { default as DatasetPropType }from './lib/DatasetPropType';
19-
export { default as ScalePropType }from './lib/ScalePropType';
2016
// helper functions
2117
export { default as generateScale }from './lib/generateScale';
2218
export { default as makeRange }from './lib/makeRange';

lib/Axes.js

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,7 @@ import {
1717
StyleSheet,
1818
Text,
1919
View,
20-
ViewPropTypes
2120
} from 'react-native';
22-
import PropTypes from 'prop-types';
23-
24-
import StyleSheetPropType from 'react-native/Libraries/DeprecatedPropTypes/DeprecatedStyleSheetPropType';
25-
import AxisStylePropTypes from './AxisStylePropTypes';
26-
import ScalePropType from './ScalePropType';
2721

2822
// Helper function to determine decimal places
2923
// http://stackoverflow.com/a/20334744
@@ -48,33 +42,6 @@ const DEFAULT_AXIS_LABEL_WIDTH = 40;
4842
* Axes component plots axes, labels and gridlines for a chart
4943
*/
5044
class Axes extends Component {
51-
static propTypes = {
52-
// Category axis options
53-
showCategoryAxisLine: PropTypes.bool,
54-
showCategoryLabels: PropTypes.bool,
55-
showCategoryTicks: PropTypes.bool,
56-
showCategoryGridlines: PropTypes.bool,
57-
categoryAxisStyle: StyleSheetPropType(AxisStylePropTypes),
58-
categoryAxisMode: PropTypes.oneOf(['point', 'range']),
59-
categoryLabelStyle: Text.propTypes.style,
60-
categoryLabels: PropTypes.arrayOf(PropTypes.string),
61-
62-
// Value axis options
63-
showValueAxisLine: PropTypes.bool,
64-
showValueLabels: PropTypes.bool,
65-
showValueTicks: PropTypes.bool,
66-
showValueGridlines: PropTypes.bool,
67-
valueAxisStyle: StyleSheetPropType(AxisStylePropTypes),
68-
valueAxisMode: PropTypes.oneOf(['normal', 'inverted']),
69-
valueScale: ScalePropType.isRequired,
70-
valueLabelStyle: Text.propTypes.style,
71-
valueLabels: PropTypes.arrayOf(PropTypes.string),
72-
valueLabelsFormatter: PropTypes.func,
73-
74-
// Style
75-
orientation: PropTypes.oneOf(['vertical', 'horizontal']),
76-
style: ViewPropTypes.style
77-
};
7845

7946
static defaultProps = {
8047
showCategoryAxisLine: true,

lib/AxisStylePropTypes.js

Lines changed: 0 additions & 30 deletions
This file was deleted.

lib/BarChart.js

Lines changed: 1 addition & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,9 @@ import React, { Component } from 'react';
1414
import {
1515
StyleSheet,
1616
View,
17-
ViewPropTypes,
1817
} from 'react-native';
1918
import PropTypes from 'prop-types';
2019

21-
import DataPropType from './DataPropType';
22-
import DatasetPropType from './DatasetPropType';
23-
import ScalePropType from './ScalePropType';
24-
2520
import resolveDatasets from './resolveDatasets';
2621
import ensureScaleCoverRange from './ensureScaleCoverRange';
2722

@@ -108,16 +103,6 @@ const barStyles = StyleSheet.create({
108103
* BarCluster component
109104
*/
110105
class BarCluster extends Component {
111-
static propTypes = {
112-
orientation: PropTypes.oneOf(['vertical', 'horizontal']).isRequired,
113-
minValue: PropTypes.number.isRequired,
114-
maxValue: PropTypes.number.isRequired,
115-
borderStyle: PropTypes.oneOf(['solid', 'dotted', 'dashed']),
116-
borderWidth: PropTypes.number,
117-
data: PropTypes.arrayOf(DataPropType).isRequired,
118-
margin: PropTypes.number,
119-
barSpacing: PropTypes.number
120-
};
121106

122107
_renderBar = (datum, index, data) => {
123108
let barMargin = (this.props.barSpacing / 2) || 0;
@@ -220,15 +205,6 @@ const barClusterStyles = StyleSheet.create({
220205
* BarStack component
221206
*/
222207
class BarStack extends Component {
223-
static propTypes = {
224-
orientation: PropTypes.oneOf(['vertical', 'horizontal']).isRequired,
225-
minValue: PropTypes.number.isRequired,
226-
maxValue: PropTypes.number.isRequired,
227-
borderStyle: PropTypes.oneOf(['solid', 'dotted', 'dashed']),
228-
borderWidth: PropTypes.number,
229-
data: PropTypes.arrayOf(DataPropType).isRequired,
230-
margin: PropTypes.number
231-
};
232208

233209
_renderBar = (datum, index, data) => {
234210
// always use diff to avoid divid by zero and negative values
@@ -302,27 +278,8 @@ const barStackStyles = StyleSheet.create({
302278
* BarChart component
303279
*/
304280
class BarChart extends Component {
305-
static propTypes = {
306-
// Bar options
307-
// space between bars / bar clusters
308-
spacing: PropTypes.number,
309-
// space between bars in bar cluster
310-
clusterSpacing: PropTypes.number,
311-
// Border width of the bar, uses secondaryColor from dataset
312-
barBorderWidth: PropTypes.number,
313-
314-
datasets: PropTypes.arrayOf(DatasetPropType).isRequired,
315-
316-
// Scale of the chart
317-
valueScale: ScalePropType.isRequired,
318-
319-
// Style
320-
orientation: PropTypes.oneOf(['vertical', 'horizontal']),
321-
displayMode: PropTypes.oneOf(['clustered', 'stacked']),
322-
style: ViewPropTypes.style
323-
};
324281

325-
static defaultProps: {
282+
static defaultProps = {
326283
spacing: 10,
327284
clusterSpacing: 0,
328285
barBorderWidth: 2,

lib/DataPropType.js

Lines changed: 0 additions & 31 deletions
This file was deleted.

lib/DatasetPropType.js

Lines changed: 0 additions & 31 deletions
This file was deleted.

lib/LineChart.js

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -14,29 +14,14 @@ import React, { Component } from 'react';
1414
import {
1515
StyleSheet,
1616
View,
17-
ViewPropTypes,
1817
} from 'react-native';
19-
import PropTypes from 'prop-types';
20-
import DatasetPropType from './DatasetPropType';
21-
import ScalePropType from './ScalePropType';
2218

2319
import ensureScaleCoverRange from './ensureScaleCoverRange';
2420

2521
/**
2622
* Line component
2723
*/
2824
class Line extends Component {
29-
static propTypes = {
30-
lineColor: PropTypes.string,
31-
lineWidth: PropTypes.number.isRequired,
32-
fromRatio: PropTypes.number.isRequired,
33-
toRatio: PropTypes.number,
34-
pointMode: PropTypes.oneOf(['from', 'to', 'both', 'none']).isRequired,
35-
pointRadius: PropTypes.number,
36-
pointBorderWidth: PropTypes.number,
37-
pointBorderColor: PropTypes.string,
38-
pointColor: PropTypes.string
39-
};
4025

4126
static defaultProps = {
4227
lineWidth: 2,
@@ -158,11 +143,6 @@ const lineStyles = StyleSheet.create({
158143
* Area component
159144
*/
160145
class Area extends Component {
161-
static propTypes = {
162-
fillColor: PropTypes.string,
163-
fromRatio: PropTypes.number.isRequired,
164-
toRatio: PropTypes.number.isRequired
165-
};
166146

167147
static defaultProps = {
168148
fillColor: 'rgba(0,0,0,.05)'
@@ -235,21 +215,6 @@ const areaStyles = StyleSheet.create({
235215
* LineChart component
236216
*/
237217
class LineChart extends Component {
238-
static propTypes = {
239-
// data
240-
datasets: PropTypes.arrayOf(DatasetPropType).isRequired,
241-
valueScale: ScalePropType.isRequired,
242-
// options
243-
categoryAxisMode: PropTypes.oneOf(['point', 'range']),
244-
valueAxisMode: PropTypes.oneOf(['normal', 'inverted']),
245-
showArea: PropTypes.bool,
246-
showPoints: PropTypes.bool,
247-
// styling
248-
lineWidth: PropTypes.number,
249-
pointRadius: PropTypes.number,
250-
pointBorderWidth: PropTypes.number,
251-
style: ViewPropTypes.style
252-
};
253218

254219
static defaultProps = {
255220
valueAxisMode: 'normal',

lib/ScalePropType.js

Lines changed: 0 additions & 25 deletions
This file was deleted.

0 commit comments

Comments
 (0)