Skip to content

Final #206

Merged
merged 1 commit into from Dec 16, 2024
Merged

Final #206

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -0,0 +1,345 @@
---
title: "Data Analytics Research Final Project Report"
author: "CJ Marino"
date: "12/15/2024"
output:
pdf_document:
toc: yes
toc_depth: '3'
html_notebook: default
html_document:
toc: yes
toc_depth: 3
toc_float: yes
number_sections: yes
theme: united
---


# 1.0 DAR Project and Group Members

* Project name: MARS
* Project team members:
- Ashton Compton
- Aadi Lahiri
- CJ Marino
- Nicolas Morawski
- Dante Mwatibo
- Charlotte Peterson
- Doña Roberts
- Margo VanEsselstyn
- David Walczyk


# 2.0 Project Introduction

The MarsMissionMinder application is a 2D Shiny app designed to present comprehensive data analytics and visualizations related to the Perseverance rover mission, as well as to accommodate insights from future Mars missions. The app serves as an interactive tool for researchers, educators, and enthusiasts, providing a user-friendly platform for exploring mission data in an engaging and meaningful way.

The primary objectives of this project were:

To develop a visually intuitive and functionally robust front-end interface for the app.
To enable dynamic and interactive exploration of datasets through tables, charts, and graphical representations.
To facilitate scalability, allowing the app to integrate future Mars mission datasets seamlessly.
Development Approach
This project involved front-end development of the app using the Shiny framework in R. While the initial foundation, referred to as "the campfire," provided a starting point, substantial modifications and innovations were introduced to enhance usability and performance. Development progressed through four distinct UI iterations, each addressing specific feedback and usability improvements. The process emphasized:

Designing an intuitive layout to accommodate multiple datasets and analytics tools.
Implementing dynamic and interactive elements, such as data filtering, visual overlays, and customizable views.
Ensuring compatibility and responsiveness across devices for broader accessibility.
The app leverages advanced R libraries such as ggplot2 for visualizations, DT for interactive tables, and heatmaply for rendering data-intensive heatmaps. Special attention was given to data rendering efficiency and user experience, ensuring that the interface remains responsive and informative even with large datasets.



This report details the development journey, showcasing the current state of the MarsMissionMinder app and its contributions to Mars mission data visualization as well as important information for furture developers.


# 3.0 Organization of Report


This report is organize as follows:


* Section 4.0: The Current UI - This section will go through the current mission minder UI

* Section 5.0: App Organization - Explanation of how the tab structure for the App works

* Section 6.0: Future Developer Guide - Info/Resources that may be helpful for future developers



# 4.0 The Current UI

The new UI for the MarsMissionMinder application represents a significant leap forward in functionality, usability, and visual appeal. It was designed to address the shortcomings of the original UI by incorporating dynamic, interactive elements and an intuitive layout that enhances the user experience. This section explores the data and code, contributions, methods, results, and limitations of this new design.

## 4.1 Data, Code, and Resources

### Data Directory:
The data used in this application is available [here: https://github.rpi.edu/DataINCITE/MarsMissionMinder-F24/tree/main/data](https://github.rpi.edu/DataINCITE/MarsMissionMinder-F24/tree/main/data)
This repository includes datasets such as:

Sample lithology data
SHERLOC mineral identifications
PIXL and clustering outputs
Sample metadata (dates, locations, etc.)
Other data sets made by members of the Mars team

### Campfire Codebase:
Initial development utilized a codebase named The Campfire as a starting point. Modifications and new features were integrated to create a more robust interface. The campfire's code can be found here [here: https://github.rpi.edu/RensselaerIDEA/MarsExplorer](https://github.rpi.edu/RensselaerIDEA/MarsExplorer)
The current Mars Mission Minder repository can be found [here: https://github.rpi.edu/DataINCITE/MarsMissionMinder-F24](https://github.rpi.edu/DataINCITE/MarsMissionMinder-F24)

### Technologies:
The app leverages Shiny, ggplot2, heatmaply, and DT libraries in R for creating interactive plots, tables, and heatmaps.

## 4.2 Contribution

The implementation of the UI was primarily done by me. However most of the tables, and the map were done by either Nicolas Morawski, Dr. Erickson, or David Walczyk. The majority of my work was in the UI components aswell as adding the reactivity via the sample/campaign selector. However the current logic was refined further by Dr. Erickson.

## 4.3 Methods Description



### Dynamic Data Visualizations:

Approach: Integrated interactive plotting libraries to enable real-time updates to visualizations based on sidebar selections.
Example: The heatmaps, bar plots, and line graphs dynamically adjust when users filter by campaigns or samples in the sidebar.

### Improved Navigation:

Approach: Introduced a streamlined tab navigation system, providing clear access to exploration tools, comparison plots, and sample reports.

Example: Tabs such as "Exploration" and "Sample Report" now organize content for easy discovery.

### Responsive Layout:

Approach: Redesigned the layout to optimize screen usage, ensuring that tables, maps, and plots are easily viewable and interactive on all devices.


## 4.4 Result and Discussion

### Fully Dynamic Visualizations
Method: Enabled real-time updates to heatmaps and bar plots based on sidebar sample and campaign selections.
Observation: Users can dynamically filter and visualize data, leading to a more engaging and exploratory experience.

Discussion: The addition of dynamic visualizations addressed one of the key limitations of the original UI by allowing users to interact with data in real time.


### Intuitive Design and Navigation
Method: Simplified the layout and reorganized content into logical tabs and sidebars.
Observation: The design is more user-friendly and visually appealing, with clear pathways to key features.

Discussion: The intuitive design ensures that users, regardless of technical expertise, can navigate the app effectively and derive insights from the data.


![Comparison Tab -> PIXL sub-tab](marinc8-photos/newui1.png)
![Exploration Tab -> PIXL vs. Sherloc sub-tab](marinc8-photos/newui2.png)
![Map Tab](marinc8-photos/newui3.png)

## 4.5 Conclusions, Limitations, and Future Work.

### Conclusions:
The new UI successfully addressed the key shortcomings of the original design by incorporating dynamic visualizations, an interactive map, and an intuitive layout. These improvements enhanced the app’s functionality and user experience, making it a more effective tool for exploring Mars mission data.

### Limitations and Future Work:
Performance with Large Datasets: Rendering dynamic plots for larger datasets can lead to delays in response time.
Accessibility Features: While the design is more intuitive, additional accessibility features (e.g., keyboard navigation or screen reader support) could further enhance usability. Implimenting color blindess setting (WIP) is also essential to ensure that users can access the app in the same way especially on plots like heat maps where color is very important.


# 5.0 Tab Structure of the app:

![Diagram for the current apps tab structure](marinc8-photos/TabStructure.png)

## 5.1 Contribution

I did the implementation of the updated UI structure for the Mars Mission Minder application. This design, while initially created based on my ideas, and ideas taken from the campfire, evolved significantly due to the constructive feedback provided by Dr. Bennet, Dr. Erickson, and the broader Mars Mission Minder team. Their critique, along with additional suggestions from Dr. Rogers, helped refine the design, ensuring its alignment with the project's goals and enhancing its usability. The chart above was made by Doña Roberts.

## 5.2 Methods Description

The updated UI was designed and implemented using a user-centered approach. Key steps in the development process included:

### Initial Wireframe Creation:
(done mostly by Nicolas Morawski)
The wireframe provided a foundational structure for the layout, ensuring clear organization of features and data visualizations.

### Feedback Integration:
Early prototypes were shared with Dr. Bennet, Dr. Erickson, and the team to gather iterative feedback. Dr. Rogers contributed specific insights into visual clarity and usability for scientific data especially regarding the navigation bar depicted on the laft side of the app.
The hierarchical structure, as described, was optimized for ease of navigation, emphasizing modularity and clear organization between Comparison, Exploration, Map, and other tabs.
Testing and Refinement:
While demoing the app to the rest of the team for feedback we tested it many times and revised it according to the changes we saw fit.


## 5.3 Result and Discussion

The updated UI represents a significant improvement in usability and functionality. Key outcomes include:

### Improved Navigation:
The hierarchical structure, including main tabs (e.g., Comparison, Exploration) and subtabs, allows users to easily access and analyze datasets.

### Enhanced Interactivity:
Dynamic elements, such as the interactive map and dataset comparisons, provide a more engaging user experience.

### Streamlined Design:
Feedback from collaborators emphasized clarity and organization, leading to better alignment with user needs.

### Focus on Specific Questions:
The integration of subtabs tailored to datasets (e.g., PIXL, SHERLOC/Lithology) and analyses (e.g., PIXL vs LIBS) supports detailed exploration of scientific questions.

## 5.4 Conclusions, Limitations, and Future Work.

### Conclusions:
The updated UI represents a significant step forward for the Mars Mission Minder project. It offers:

Enhanced navigation and data analysis capabilities through structured tabs.
Clear separation of isolated dataset exploration (Comparison) and integrated analyses (Exploration).
An interactive Map feature for intuitive data visualization.

### Limitations:
The Sample Report, User Guide, and About tabs are placeholders and require future development.
Current UI tools are functional but may require performance optimization as datasets grow in complexity.

### Future Work:
Develop the Sample Report tab for generating automated summaries.
Implement a complete User Guide to assist first-time users in navigating the app.
Populate the About section to provide context on data sources, team contributions, and project goals.
Expand interactive elements and improve performance for large datasets.
Incorporate more advanced tools for predictive analysis and campaign comparisons.


# 6.0 Future Developers Guide:


## 6.1 Overview of the App
The Mars Mission Minder is an RShiny application designed for analyzing and visualizing data from NASA’s Perseverance Rover Mission. It integrates multiple datasets to provide scientific insights through interactive tools, dynamic plots, and maps.

The app consists of several main tabs:

Comparison: Explore and analyze individual datasets like PIXL, SHERLOC, and LIBS.
Exploration: Compare datasets (e.g., PIXL vs LIBS) and perform integrated analyses.
Map: An interactive map displaying sample sites, rover waypoints, and LIBS targets.
Sample Report: Placeholder for generating detailed sample reports.
User Guide: Placeholder for a user manual.
About: Placeholder for information about the project and contributors.


## 6.2 Technologies and Libraries Used
The app is built using RShiny and relies on the following libraries:

### Shiny:

Framework for creating web applications in R.
Documentation: Shiny Basics
Visualization Libraries
ggplot2: For creating static and interactive plots.
ggplot2 Documentation
heatmaply: For creating interactive heatmaps.
heatmaply Documentation
ggtern: For ternary plots (used in PIXL analysis).
ggtern Documentation
plotly: For interactive graphs and heatmaps.
plotly Documentation
leaflet: For interactive maps (Map tab).
leaflet Documentation

### Data Manipulation:
tidyverse: Suite of tools for data wrangling and transformation.
tidyverse Documentation
dplyr: For filtering, selecting, and transforming datasets.
dplyr Documentation
Interactive UI Enhancements
DT: For rendering interactive tables.
DT Documentation
shinyjs: For adding custom JavaScript interactions.
shinyjs Documentation

### Additional Tools:
geosphere: For distance calculations using the Haversine formula.
jsonlite: To handle JSON data when necessary.
CSS Customization: Custom styles are defined in the app’s tags$head() section.


## 6.3 How to Use the App

### Comparison Tab:
Purpose: Analyze individual datasets.
Subtabs:
PIXL: Heatmaps, ternary plots, and sample location plots.
SHERLOC/Lithology: Placeholder for future ML and summary statistics.
LIBS: PCA plots and clustering analyses.
Usage:

Select samples via the table selector or the campaign checkbox in the sidebar.
Explore visualizations, such as heatmaps and ternary plots.

### Exploration Tab:
Purpose: Compare datasets and perform integrated analyses.
Subtabs:
PIXL vs LIBS: Compare connected points and visualize ternary plots.
PIXL vs SHERLOC: View stacked bar plots and heatmaps.
Mineral Analysis: Placeholder for mineral-focused insights.
Campaign Comparison: Placeholder for campaign-level comparisons.
Predicting Organic Matter: Placeholder for future ML-based predictions.
Usage:

Select a sample or campaign.
Use sliders (e.g., distance thresholds) to customize comparisons.

### Map Tab
Purpose: Explore sample locations and rover activities.
Features:
Displays sample points, LIBS targets, and rover waypoints.
Allows you to measure distances interactively using clicks.
Usage:

View Samples and click on them for meta data
Use markers and tools for measurements.


## 6.4 Running the App

Run the Installer.R
Once all packages are installed select the code window with crtl+A to highlight all the text then use ctrl+shift+enter to run the app.

## 6.5 Helpful Resources
Here are useful links to documentation and tutorials for the tools and libraries used:

### RShiny:

Shiny Introduction: [Shiny Basics](https://shiny.posit.co/r/getstarted/shiny-basics/lesson1/)

Shiny Layouts: [Shiny Layout Guide](https://shiny.posit.co/r/articles/build/layout-guide/)

### Visualization:

ggplot2: [ggplot2 Cheatsheet](https://rstudio.github.io/cheatsheets/html/data-visualization.html)

leaflet: [Leaflet for R](https://www.rdocumentation.org/packages/leaflet/versions/2.2.2)

heatmaply: [heatmaply Docs](https://www.rdocumentation.org/packages/heatmaply/versions/1.4.2)

### Data Wrangling

Tidyverse: [Tidyverse Guide](https://www.rdocumentation.org/packages/tidyverse/versions/2.0.0)

dplyr: [dplyr Cheatsheet](https://nyu-cdsc.github.io/learningr/assets/data-transformation.pdf)

### General R Help

RStudio Cheatsheets: [RStudio Cheatsheets](https://www.datacamp.com/cheat-sheet/getting-started-r)

## 6.6 Tips for New Developers
Understand Reactivity:

Reactives (reactive(), observeEvent()) are the core of Shiny. Learn how they work: Reactivity in Shiny
Debugging:

Use print() and Shiny’s console logs for debugging.
Use browser() for step-by-step debugging.
CSS Customization:

Update custom styles in the tags$head() section using standard CSS.
This can be seen in app within the UI mostly and works very similarly
Add New Features:

Follow the existing structure of subtabs and panels to ensure consistency.
Place reusable functions (like plotting functions) in a helper file for clarity.


Binary file not shown.