This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { StyleSheet, Text, View, Dimensions, StatusBar } from 'react-native'; | |
import { LinearGradient } from 'expo-linear-gradient'; | |
import { FontAwesomeIcon } from '@fortawesome/react-native-fontawesome'; | |
import { faBars } from '@fortawesome/free-solid-svg-icons'; | |
export default function App() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// BarGraph/index.js | |
import React from 'react'; | |
import { StyleSheet, Text, View, Dimensions } from 'react-native'; | |
export default function BarGraph() { | |
return ( | |
<View style={styles.main}> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { StyleSheet, Text, View, Dimensions, StatusBar } from 'react-native'; | |
import { LinearGradient } from 'expo-linear-gradient'; | |
import { FontAwesomeIcon } from '@fortawesome/react-native-fontawesome'; | |
import { faBars } from '@fortawesome/free-solid-svg-icons'; | |
export default function App() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// App.js | |
... | |
import { faBars } from '@fortawesome/free-solid-svg-icons'; | |
import BarGraph from './BarGraph'; | |
... | |
<View style={styles.spaceBetween}> | |
<View style={styles.header}> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// BarGraph/xAxis.js | |
import React from 'react'; | |
import { ART } from 'react-native'; | |
import { scaleBand } from 'd3-scale'; | |
import moment from 'moment'; | |
const { | |
Surface, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// BarGraph/yAxis.js | |
import React from 'react'; | |
import { StyleSheet, ART } from 'react-native'; | |
import { scaleLinear } from 'd3-scale'; | |
const { | |
Surface, | |
Group, | |
Shape, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//BarGraph/Columns.js | |
import React from 'react'; | |
import { ART } from 'react-native'; | |
import { scaleBand, scaleLinear } from 'd3-scale'; | |
const { | |
Group, | |
Shape, | |
Path, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// BarGraph/index.js | |
import React from 'react'; | |
import { StyleSheet, Text, View, Dimensions } from 'react-native'; | |
import XAxis from './xAxis'; | |
import YAxis from '/yAxis'; | |
import Columns from './Columns'; | |
export default function BarGraph() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
generateValues = () => { | |
let days = []; | |
let nums = []; | |
Array(7).fill().forEach((i, index) => { | |
days.push(moment().subtract(index, 'days').format('ddd')); | |
nums.push(moment().subtract(index, 'days').format('D')); | |
}); | |
return { days: days.reverse(), nums: nums.reverse() } | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"days": [ | |
"Sat", | |
"Sun", | |
"Mon", | |
"Tue", | |
"Wed", | |
"Thu", | |
"Fri", | |
], |
OlderNewer