Skip to content

Commit

Permalink
Updated dashboard
Browse files Browse the repository at this point in the history
  • Loading branch information
Priyankas007 committed Feb 22, 2025
1 parent d093542 commit bbe9e7c
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
</CommandLineArgument>
<CommandLineArgument
argument = "--skipOnboarding"
isEnabled = "NO">
isEnabled = "YES">
</CommandLineArgument>
<CommandLineArgument
argument = "--testSchedule"
Expand Down
12 changes: 6 additions & 6 deletions NeutroFeverGuard/HealthKitVisualizations/HKVisualization.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ struct HKVisualization: View {
@State var oxygenSaturationScatterData: [HKData] = []
@State var bodyTemperatureScatterData: [HKData] = []

var public body: some View {
var body: some View {
// swiftlint:disable closure_body_length
NavigationStack {
List {
Expand All @@ -40,7 +40,7 @@ struct HKVisualization: View {
yName: "Heart Rate (bpm)",
title: "Heart Rate Over Time",
threshold: 100,
scatterData: heartRateData
scatterData: heartRateScatterData
)
} else {
Text("No heart rate data available.")
Expand All @@ -53,9 +53,9 @@ struct HKVisualization: View {
data: bodyTemperatureData,
xName: "Time",
yName: "Body Temperature (°F)",
title: "Basal Body Temperature Over Time",
title: "Body Temperature Over Time",
threshold: 99.0,
scatterData: bodyTemperatureData
scatterData: bodyTemperatureScatterData
)
} else {
Text("No body temperature data available.")
Expand All @@ -70,7 +70,7 @@ struct HKVisualization: View {
yName: "Oxygen Saturation (%)",
title: "Oxygen Saturation Over Time",
threshold: 94.0,
scatterData: oxygenSaturationData
scatterData: oxygenSaturationScatterData
)
} else {
Text("No oxygen saturation data available.")
Expand Down Expand Up @@ -233,7 +233,7 @@ struct HKVisualization: View {
if quantityTypeIDF == HKQuantityTypeIdentifier.oxygenSaturation {
self.oxygenSaturationScatterData = collectedData
} else if quantityTypeIDF == HKQuantityTypeIdentifier.heartRate {
self.heartRateData = collectedData
self.heartRateScatterData = collectedData
} else if quantityTypeIDF == HKQuantityTypeIdentifier.bodyTemperature {
self.bodyTemperatureScatterData = collectedData
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,16 @@ struct HKVisualizationItem: View {
// Helper text to show data when clicked.
if let elm = selectedElement, elm.sumValue == 0 {
let details = (
String(localized: "HKVIZ_SUMMARY", locale: locale) +
String(localized: "HKVIZ_SUMMARY: ", locale: locale) +
String(elm.date.formatted(.dateTime.year().month().day())) +
":\n" +
String(localized: "HKVIZ_AVERAGE_STRING", locale: locale) +
String(localized: "HKVIZ_AVERAGE_STRING: ", locale: locale) +
String(round(elm.avgValue * 10) / 10) +
", " +
String(localized: "HKVIZ_MAX_STRING", locale: locale) +
String(localized: "HKVIZ_MAX_STRING: ", locale: locale) +
String(Int(round(elm.maxValue))) +
", " +
String(localized: "HKVIZ_MIN_STRING", locale: locale) +
String(localized: "HKVIZ_MIN_STRING: ", locale: locale) +
String(Int(round(elm.minValue)))
)
Text(details)
Expand Down Expand Up @@ -147,7 +147,7 @@ struct HKVisualizationItem: View {
xName: LocalizedStringResource,
yName: LocalizedStringResource,
title: LocalizedStringResource,
threshold: Double = -1.0,
threshold: Double = 25,
helperText: LocalizedStringResource? = nil,
scatterData: [HKData] = []
) {
Expand Down
2 changes: 0 additions & 2 deletions NeutroFeverGuard/NeutroFeverGuard.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@ struct NeutroFeverGuard: App {
WindowGroup {
ZStack {
if completedOnboardingFlow {
// HKVisualization()
HomeView()
// HKVisualizationItem(data: [], xName: "Preview x axis", yName: "Preview y axis", title: "Preview Title")
} else {
EmptyView()
}
Expand Down
14 changes: 7 additions & 7 deletions NeutroFeverGuard/Resources/Localizable.xcstrings
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,10 @@
}
}
},
"Basal Body Temperature Over Time" : {
"Body Temperature (°F)" : {

},
"Body Temperature (°F)" : {
"Body Temperature Over Time" : {

},
"Cancel" : {
Expand Down Expand Up @@ -195,16 +195,16 @@
"Heart Rate Over Time" : {

},
"HKVIZ_AVERAGE_STRING" : {
"HKVIZ_AVERAGE_STRING: " : {

},
"HKVIZ_MAX_STRING" : {
"HKVIZ_MAX_STRING: " : {

},
"HKVIZ_MIN_STRING" : {
"HKVIZ_MIN_STRING: " : {

},
"HKVIZ_SUMMARY" : {
"HKVIZ_SUMMARY: " : {

},
"HL7 FHIR" : {
Expand Down Expand Up @@ -342,7 +342,7 @@
}
}
},
"No basal body temperature data available." : {
"No body temperature data available." : {

},
"No heart rate data available." : {
Expand Down

0 comments on commit bbe9e7c

Please sign in to comment.