Permalink
Browse files

Initial commit

  • Loading branch information...
olegberman committed Dec 20, 2017
0 parents commit fe8cc934f9bbd8dcafe8be6da84c8f65a9f9ff9d
@@ -0,0 +1,8 @@
{
"presets": ["babel-preset-expo"],
"env": {
"development": {
"plugins": ["transform-react-jsx-source"]
}
}
}
@@ -0,0 +1,70 @@
[ignore]
; We fork some components by platform
.*/*[.]android.js

; Ignore templates for 'react-native init'
.*/local-cli/templates/.*

; Ignore the website subdir
<PROJECT_ROOT>/node_modules/react-native/website/.*

; Ignore the Dangerfile
<PROJECT_ROOT>/node_modules/react-native/danger/dangerfile.js

; Ignore "BUCK" generated dirs
<PROJECT_ROOT>/node_modules/react-native/\.buckd/

; Ignore unexpected extra "@providesModule"
.*/node_modules/.*/node_modules/fbjs/.*
.*/node_modules/fbemitter/.*

; Ignore duplicate module providers
; For RN Apps installed via npm, "Libraries" folder is inside
; "node_modules/react-native" but in the source repo it is in the root
.*/Libraries/react-native/React.js

; Ignore polyfills
.*/Libraries/polyfills/.*

; Ignore misbehaving dev-dependencies
.*/node_modules/reqwest/.*
.*/node_modules/xdl/.*

; Ignore expo dependencies

; Ignore Expo SDK + some of it's dependencies temporarily:
; https://github.com/expo/expo/issues/162
.*/node_modules/expo/src/.*
.*/node_modules/react-native-gesture-handler/.*

[include]

[libs]
node_modules/react-native/Libraries/react-native/react-native-interface.js
node_modules/react-native/flow/
node_modules/expo/flow/

[options]
emoji=true

module.system=haste

munge_underscores=true

module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> 'RelativeImageStub'

suppress_type=$FlowIssue
suppress_type=$FlowFixMe
suppress_type=$FlowFixMeProps
suppress_type=$FlowFixMeState
suppress_type=$FixMe

suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(5[0-3]\\|[1-4][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native_oss[a-z,_]*\\)?)\\)
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(5[0-3]\\|[1-4][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native_oss[a-z,_]*\\)?)\\)?:? #[0-9]+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError

unsafe.enable_getters_and_setters=true

[version]
^0.53.0
@@ -0,0 +1,3 @@
node_modules/
.expo/
npm-debug.*
@@ -0,0 +1 @@
{}
169 App.js
@@ -0,0 +1,169 @@
import React from 'react'
import { ScrollView, StatusBar, Dimensions, Text } from 'react-native'
import ScrollableTabView from 'react-native-scrollable-tab-view'
import LineChart from './src/line-chart'
import PieChart from './src/pie-chart'
import ProgressChart from './src/progress-chart'
import BarChart from './src/bar-chart'
import ContributionGraph from './src/contribution-graph'
import { data, contributionData, pieChartData, progressChartData } from './data'
import 'babel-polyfill'

// in Expo - swipe left to see the following styling, or create your own
const chartConfigs = [
{
backgroundColor: '#000000',
backgroundGradientFrom: '#1E2923',
backgroundGradientTo: '#08130D',
color: (opacity = 1) => `rgba(26, 255, 146, ${opacity})`,
style: {
borderRadius: 16
}
},
{
backgroundColor: '#022173',
backgroundGradientFrom: '#022173',
backgroundGradientTo: '#1b3fa0',
color: (opacity = 1) => `rgba(255, 255, 255, ${opacity})`,
style: {
borderRadius: 16
}
},
{
backgroundColor: '#ffffff',
backgroundGradientFrom: '#ffffff',
backgroundGradientTo: '#ffffff',
color: (opacity = 1) => `rgba(0, 0, 0, ${opacity})`
},
{
backgroundColor: '#26872a',
backgroundGradientFrom: '#43a047',
backgroundGradientTo: '#66bb6a',
color: (opacity = 1) => `rgba(255, 255, 255, ${opacity})`,
style: {
borderRadius: 16
}
},
{
backgroundColor: '#000000',
backgroundGradientFrom: '#000000',
backgroundGradientTo: '#000000',
color: (opacity = 1) => `rgba(${255}, ${255}, ${255}, ${opacity})`
}, {
backgroundColor: '#0091EA',
backgroundGradientFrom: '#0091EA',
backgroundGradientTo: '#0091EA',
color: (opacity = 1) => `rgba(${255}, ${255}, ${255}, ${opacity})`
},
{
backgroundColor: '#e26a00',
backgroundGradientFrom: '#fb8c00',
backgroundGradientTo: '#ffa726',
color: (opacity = 1) => `rgba(255, 255, 255, ${opacity})`,
style: {
borderRadius: 16
}
},
{
backgroundColor: '#b90602',
backgroundGradientFrom: '#e53935',
backgroundGradientTo: '#ef5350',
color: (opacity = 1) => `rgba(255, 255, 255, ${opacity})`,
style: {
borderRadius: 16
}
},
{
backgroundColor: '#ff3e03',
backgroundGradientFrom: '#ff3e03',
backgroundGradientTo: '#ff3e03',
color: (opacity = 1) => `rgba(${0}, ${0}, ${0}, ${opacity})`
}
]

export default class App extends React.Component {
renderTabBar() {
return <StatusBar hidden/>
}
render() {
const width = Dimensions.get('window').width
const height = 220
return (
<ScrollableTabView renderTabBar={this.renderTabBar}>
{chartConfigs.map(chartConfig => {
const labelStyle = {
color: chartConfig.color(),
marginVertical: 10,
textAlign: 'center',
fontSize: 16
}
const graphStyle = {
marginVertical: 8,
...chartConfig.style
}
return (
<ScrollView
key={Math.random()}
style={{
backgroundColor: chartConfig.backgroundColor
}}
>
<Text style={labelStyle}>Bezier Line Chart</Text>
<LineChart
data={data}
width={width}
height={height}
chartConfig={chartConfig}
bezier
style={graphStyle}
/>
<Text style={labelStyle}>Progress Chart</Text>
<ProgressChart
data={progressChartData}
width={width}
height={height}
chartConfig={chartConfig}
style={graphStyle}
/>
<Text style={labelStyle}>Bar Graph</Text>
<BarChart
width={width}
height={height}
data={data}
chartConfig={chartConfig}
style={graphStyle}
/>
<Text style={labelStyle}>Pie Chart</Text>
<PieChart
data={pieChartData}
height={height}
width={width}
chartConfig={chartConfig}
accessor="population"
style={graphStyle}
/>
<Text style={labelStyle}>Line Chart</Text>
<LineChart
data={data}
width={width}
height={height}
chartConfig={chartConfig}
style={graphStyle}
/>
<Text style={labelStyle}>Contribution Graph</Text>
<ContributionGraph
values={contributionData}
width={width}
height={height}
endDate={new Date('2016-05-01')}
numDays={105}
chartConfig={chartConfig}
style={graphStyle}
/>
</ScrollView>
)
})}
</ScrollableTabView>
)
}
}

Large diffs are not rendered by default.

Oops, something went wrong.
Oops, something went wrong.

0 comments on commit fe8cc93

Please sign in to comment.