-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #418 from COS301-SE-2024/mobile/feat/analytics
Mobile/feat/analytics
- Loading branch information
Showing
76 changed files
with
9,430 additions
and
2,755 deletions.
There are no files selected for viewing
Binary file modified
BIN
+0 Bytes
(100%)
frontend/occupi-mobile4/.gradle/buildOutputCleanup/buildOutputCleanup.lock
Binary file not shown.
4 changes: 2 additions & 2 deletions
4
frontend/occupi-mobile4/.gradle/buildOutputCleanup/cache.properties
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
#Thu Jul 04 00:58:00 SAST 2024 | ||
gradle.version=8.1.1 | ||
#Thu Sep 26 13:00:57 CAT 2024 | ||
gradle.version=8.9 |
Binary file not shown.
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import LoadingScreen from "../screens/Dashboard/LoadingScreen"; | ||
|
||
export default function Home() { | ||
return ( | ||
<LoadingScreen /> | ||
); | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import OccuBot from "../screens/Dashboard/OccuBot"; | ||
|
||
export default function Home() { | ||
return ( | ||
<OccuBot /> | ||
); | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import React from 'react'; | ||
import Recommendations from "../screens/Dashboard/Recommendations"; | ||
|
||
export default function Home() { | ||
const handleClose = () => { | ||
// Add your close logic here | ||
|
||
console.log('Recommendations closed'); | ||
}; | ||
|
||
return ( | ||
<Recommendations onClose={handleClose} /> | ||
); | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import Stats from "../screens/Dashboard/Stats"; | ||
|
||
export default function Home() { | ||
return ( | ||
<Stats /> | ||
); | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
import React, { useEffect, useState } from 'react'; | ||
import { widthPercentageToDP as wp } from 'react-native-responsive-screen'; | ||
import { | ||
View, Text | ||
} from '@gluestack-ui/themed'; | ||
import * as SecureStore from 'expo-secure-store'; | ||
import { LineChart } from "react-native-gifted-charts"; | ||
import { useColorScheme } from 'react-native'; | ||
import { useTheme } from './ThemeContext'; | ||
|
||
|
||
const AnalyticsGraph = ({data,title,x_axis}) => { | ||
const colorscheme = useColorScheme(); | ||
const { theme } = useTheme(); | ||
const currentTheme = theme === "system" ? colorscheme : theme; | ||
// console.log(data); | ||
const labels = currentTheme === 'dark' ? "lightgray" : "#242424"; | ||
const [accentColour, setAccentColour] = useState<string>('greenyellow'); | ||
useEffect(() => { | ||
const getAccentColour = async () => { | ||
let accentcolour = await SecureStore.getItemAsync('accentColour'); | ||
setAccentColour(accentcolour); | ||
}; | ||
getAccentColour(); | ||
}, []); | ||
|
||
return ( | ||
<View my="$2" w="$full" flexDirection='column' alignItems='center' justifyContent='space-around'> | ||
<Text underline color={currentTheme === 'dark' ? "$white" : "$black"}>{title}</Text> | ||
<LineChart | ||
isAnimated | ||
width={wp('85%')} | ||
thickness={3} | ||
color={accentColour} | ||
maxValue={10} | ||
noOfSections={10} | ||
hideRules | ||
animateOnDataChange | ||
animationDuration={1000} | ||
onDataChangeAnimationDuration={300} | ||
areaChart | ||
focusEnabled | ||
showDataPointOnFocus | ||
textColor1={currentTheme === 'dark' ? "white" : "black"} | ||
focusedDataPointColor={'white'} | ||
showStripOnFocus | ||
showTextOnFocus | ||
endSpacing={20} | ||
yAxisTextStyle={{color: labels}} | ||
xAxisLabelTextStyle={{color: labels, fontSize: 8.5}} | ||
data={data} | ||
// hideDataPoints | ||
curved | ||
startFillColor={accentColour} | ||
endFillColor={accentColour} | ||
startOpacity={0.5} | ||
endOpacity={0.1} | ||
spacing={data.length > 30 ? 30 : data.length*2} | ||
// rotateLabel | ||
backgroundColor="transparent" | ||
// showVerticalLines | ||
// verticalLinesColor="rgba(14,164,164,0.5)" | ||
// rulesColor="gray" | ||
// rulesType="dashed" | ||
xAxisColor="transparent" | ||
yAxisColor="transparent" | ||
initialSpacing={2} | ||
// yAxisColor={currentTheme === 'dark' ? "lightgray" : "darkgrey"} | ||
// xAxisColor={currentTheme === 'dark' ? "lightgray" : "darkgrey"} | ||
/> | ||
<Text color={currentTheme === 'dark' ? "$white" : "$black"}>{x_axis}</Text> | ||
</View> | ||
) | ||
} | ||
|
||
export default AnalyticsGraph; |
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
Oops, something went wrong.