Skip to content

Commit

Permalink
Add inline nav text and clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
JHawk0224 committed Jan 21, 2024
1 parent 791c3f0 commit 22e14aa
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 53 deletions.
4 changes: 2 additions & 2 deletions PennMobile/Dining/SwiftUI/DiningSettingsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ struct DiningSettingsView: View {

// Toggle("Include guest swipes", isOn: $totalData)
}
.navigationBarTitle("Dining Analytics Settings")
.navigationBarTitle("Dining Analytics Settings", displayMode: .inline)
.toolbar {
ToolbarItem(placement: .navigationBarTrailing) {
Button(action: {
Expand All @@ -56,7 +56,7 @@ struct DiningSettingsView: View {

// Toggle("Include guest swipes", isOn: $totalData)
}
.navigationBarTitle("Dining Analytics Settings")
.navigationBarTitle("Dining Analytics Settings", displayMode: .inline)
.toolbar {
ToolbarItem(placement: .navigationBarTrailing) {
Button(action: {
Expand Down
51 changes: 0 additions & 51 deletions PennMobileShared/Dining/DiningAnalyticsViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -190,58 +190,7 @@ public class DiningAnalyticsViewModel: ObservableObject {
self.swipesPredictedZeroDate = swipePredictions.predictedZeroDate
self.predictedSwipesSemesterEndBalance = swipePredictions.predictedEndBalance

// let dollarPredictions = self.getPredictions(firstBalance: startDollarBalance, lastBalance: lastDollarBalance, maxBalance: maxDollarBalance)
// let last7dollarPredictions = self.getPredictions(firstBalance: last7startDollarBalance, lastBalance: lastDollarBalance, maxBalance: maxDollarBalance)
//
// let (averageSlopeD, predictedZeroDateD, endBalanceD) = getWeightedAveragePredictions(allBalance: self.dollarHistory)
// let (averageSlopeS, predictedZeroDateS, endBalanceS) = getWeightedAveragePredictions(allBalance: self.swipeHistory)

//OPTIONS DOLLAR
// if (selectedOptionIndex == 0) {
// self.dollarSlope = self.getSlope(firstBalance: startDollarBalance, lastBalance: lastDollarBalance)
// self.dollarPredictedZeroDate = self.predictZeroDate(firstBalance: startDollarBalance, slope: self.dollarSlope)
// self.predictedDollarSemesterEndBalance = dollarPredictions.predictedEndBalance
// self.dollarSlope = dollarPredictions.slope
//
// } else if (selectedOptionIndex == 1) {
// let totalSlope = self.getSlope(firstBalance: startDollarBalance, lastBalance: lastDollarBalance)
// let last7Slope = self.getSlope(firstBalance: last7startDollarBalance, lastBalance: lastDollarBalance)
// self.dollarSlope = (totalSlope + last7Slope) / 2
// self.dollarPredictedZeroDate = self.predictZeroDate(firstBalance: startDollarBalance, slope: self.dollarSlope)
// self.predictedDollarSemesterEndBalance = (dollarPredictions.predictedEndBalance + last7dollarPredictions.predictedEndBalance) / 2
// self.dollarSlope = (dollarPredictions.slope + last7dollarPredictions.slope) / 2
// } else if (selectedOptionIndex == 2) {
// self.dollarSlope = averageSlopeD
// self.dollarPredictedZeroDate = predictedZeroDateD
// self.predictedDollarSemesterEndBalance = endBalanceD
//
// }

self.dollarAxisLabel = self.getAxisLabelsYX(from: self.dollarHistory)

// Get swipe predictions using data from all dates and swipe predictions using data from the last 7 days.
// Then average the two.
// let swipePredictions = self.getPredictions(firstBalance: startSwipeBalance, lastBalance: lastSwipeBalance, maxBalance: maxSwipeBalance)
// let last7swipePredictions = self.getPredictions(firstBalance: last7startSwipeBalance, lastBalance: lastSwipeBalance, maxBalance: last7maxSwipeBalance)

//OPTIONS SWIPE
// if (selectedOptionIndex == 0) {
// self.swipeSlope = swipePredictions.slope
// self.swipesPredictedZeroDate = self.predictZeroDate(firstBalance: startSwipeBalance, slope: self.swipeSlope)
// self.predictedSwipesSemesterEndBalance = swipePredictions.predictedEndBalance
//
// } else if (selectedOptionIndex == 1) {
// self.swipeSlope = (swipePredictions.slope + last7swipePredictions.slope) / 2
// self.swipesPredictedZeroDate = self.predictZeroDate(firstBalance: startSwipeBalance, slope: self.swipeSlope)
// self.predictedSwipesSemesterEndBalance = (swipePredictions.predictedEndBalance + last7swipePredictions.predictedEndBalance) / 2
//
// } else if (selectedOptionIndex == 2) {
// self.swipeSlope = averageSlopeS
// self.swipesPredictedZeroDate = predictedZeroDateS
// self.predictedSwipesSemesterEndBalance = endBalanceS
//
// }

self.swipeAxisLabel = self.getAxisLabelsYX(from: self.swipeHistory)
}

Expand Down

0 comments on commit 22e14aa

Please sign in to comment.