Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement analytics GUI (Part 2 - Piechart Display) #99

Conversation

marcus-ny
Copy link

@marcus-ny marcus-ny commented Apr 2, 2024

Resolves #84

Feature added

A GUI display for analytics has been implemented. It showcases 3 values in piecharts - Reliability, Impact and Urgency

Screenshot 2024-04-03 at 3 16 15 AM

Changelog

  • New class DashboardData has been added to encapsulate current contact's analytics and the max values of all existing loans. These max values are used for reference in calculating Impact and Urgency indices

Notes

  • Help wanted to test out possible issues with the RIU indices as this feature may be bug prone depending on existence/absence of certain values
  • For any non-functional issues related to GUI cosmetics (boxes stretching incorrectly, color schemes, etc.), please help to add comments into issue Fix GUI display inconsistencies #98
Currently handled cases
  • no active loans > reliability pie chart should NOT show. Instead, a message at the bottom will be displayed saying "No active loans to analyze"
  • no active loans that are due in the future > earliest return date will be null for that person's analytics(?). The piechart for Urgency should not show. Instead, a message at the bottom will be displayed saying "No active loans to analyze"
  • no loans in history > impact chart should not show

@marcus-ny marcus-ny added help wanted Extra attention is needed priority.High Must do labels Apr 2, 2024
@marcus-ny marcus-ny added this to the v1.3 milestone Apr 2, 2024
@marcus-ny marcus-ny self-assigned this Apr 2, 2024
Copy link

codecov bot commented Apr 2, 2024

Codecov Report

Attention: Patch coverage is 2.46914% with 79 lines in your changes are missing coverage. Please review.

Project coverage is 47.34%. Comparing base (214941c) to head (8c6bee6).

Files Patch % Lines
src/main/java/seedu/address/ui/AnalyticsPanel.java 0.00% 41 Missing ⚠️
...a/seedu/address/model/analytics/DashboardData.java 0.00% 17 Missing ⚠️
...ava/seedu/address/model/person/UniqueLoanList.java 0.00% 13 Missing ⚠️
...rc/main/java/seedu/address/model/ModelManager.java 33.33% 4 Missing ⚠️
...seedu/address/logic/commands/AnalyticsCommand.java 0.00% 3 Missing ⚠️
...rc/main/java/seedu/address/logic/LogicManager.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master      #99      +/-   ##
============================================
- Coverage     48.81%   47.34%   -1.48%     
  Complexity      431      431              
============================================
  Files            98       99       +1     
  Lines          2157     2224      +67     
  Branches        216      224       +8     
============================================
  Hits           1053     1053              
- Misses         1060     1127      +67     
  Partials         44       44              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

if (analytics.getEarliestReturnDate() == null || earliestReturnDate == null) {
return null;
}
LocalDate target = analytics.getEarliestReturnDate().toInstant().atZone(ZoneId.systemDefault()).toLocalDate();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably abstract this conversion of dates in a later iteration.

impactChart.setData(impactData);
impactIndex.setText(String.format("%.2f", data.getImpactIndex() * 100) + "%");
}
if (data.getUrgencyIndex() == null) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's probably a better to handle these null conditions. Something to consider for future iterations.

Copy link

@xiaorui-ui xiaorui-ui left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@Joseph31416 Joseph31416 merged commit 2cdf8d3 into AY2324S2-CS2103T-W13-1:master Apr 4, 2024
3 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed priority.High Must do
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement basic GUI for Loan Analytics
3 participants