Giter Site home page Giter Site logo

covid19-analyzer's People

Contributors

raenonx avatar yayen-lin avatar

Watchers

 avatar

Forkers

sharisung markwu7

covid19-analyzer's Issues

GUI / Startup screen

This is the first screen when the application starts.

Click start button or similar to start loading the resources (Population data / state name data / Case data).

  • If there is any error during the loading, abort the load and prompt the user to provide the data path.
  • Data path should be a directory containing
    • data/data.csv - case data
    • data/uspops.csv - US population data
    • data/usstates.csv - US state name conversion data
    • filterdoc.html - Documentation of the filter query syntax

Filter Syntax

Enum

FilterParameter - 1d62534

Notes

  • Parameter to be used in FilterCondition

Enums

  • STATE - state name / abbreviation
  • COUNTY - county name
  • CONFIRMED - confirmed cases
  • FATAL - fatal cases
  • CONFIRMED_PER100K - confirmed cases per 100K residents
  • FATAL_PER100K - fatal cases per 100K residents
  • DEATH_RATE - death rate (%)
  • LATITUDE - latitude of the county
  • LONGITUDE - longitude of the county
  • ZIP_CODE - zip code
  • DATE - date

Methods

  • FilterParameter parse(String word)
    • Parse word to be one of the parameter above. If not parsable, return null.

FilterComparator - 1d62534

Notes

  • Comaprator to be used in FilterCondition

Enums

  • GT - >
  • GTE - >=
  • LT - <
  • LTE - <=
  • EQ - =

Methods

  • FilterComparator parse(String word)
    • Parse word to be one of the comparator above. If not parsable, return null.

Class

FilterConditionEntity - bc56bac

Notes

  • Represents a single filter condition

Fields

  • FilterParameter param
  • FilterComparator cmp - the comparator to be used against the given value
  • String val - will be casted when going to be used

FilterCondition

Notes

  • Class which represents the conditions given
  • The relationship between the 1st dimension elements of conditions is OR
  • The relationship between the 2nd dimension elements of conditions is AND
  • Example:
    • Equivalent 1
      • [[(FATAL > 50), (CONFIRMED < 100)], [(STATE = "WI")]]
      • (%fatal% > 50 AND %confirmed% < 100) OR %state% = "WI"

Fields

  • List<FilterConditionBody> conditions

FilterSyntaxParser

Notes

  • To parse a filter syntax to be FilterCondition. Singleton.

BST

Abstract Class

BST

Notes

  • Uses TreeMap as its underlying DS.
    Methods
  • int sum(): sum of all node values
  • int sum(Predicate<? super T> predicate): sum of all node values using the given predicate

Interface

ISummable

Notes

  • Get a value from the class to be used to calculate the sum.

Methods

  • int getValue()

Class

BSTDirectSum

Notes

  • Value of the node can be directly used to calculate the sum.

BSTIndirectSum

Notes

  • Value of the node cannot be directly used to calculate the sum.

Notes on the cases data

Case data(csv) header convention

Date County State Confirmed Fatal
Index 0 1 2 3 4

Notes on Recovered cases

Omitted because it is calculated nationally.

Notes on Recovered cases

Omitted because it is calculated by (confirmed - fatal).

Population Data

Interface

Region

Methods

  • int getPopulation()

Class - Data

UnitedStates implements Region

Fields

  • List<State> states
  • static UnitedStates current - current parsed UnitedStates

Methods

  • State getState(String state)
    • Uses the given string to get the corresponding State.
    • state can be the state's name or abbreviation.
  • County getCounty(String countyState)
    • Uses the given string to get the corresponding County.
    • countyState needs to be in the format of <COUNTY>, <STATE> for disambiguation. For example: Dane, WI.

State implements Region, Comparable<String>

Notes

  • Methods of Comparable will use name which will then be used in BSTs.

Fields

  • String name
  • String abbr
  • List<County> counties

County implements Region

Notes

  • Methods of Comparable will use name which will then be used in BSTs.

Fields

  • String name
  • double latitude
  • double longitude

Class - Utils

PopulationDataReader

Methods

  • UnitedStates parse(String filePath) - parse the US population data file to be an UnitedState instance.

GUI (Basic)

Notes

  • Single dashboard style

Requirements

  • Show load/save of data
  • Show some sample data (hard-coded is OK)
  • Intuitive and clear to distinguish different functionality
  • DOES NOT need to load the data to get to the main screen

Resources

Section

Section 1 (#9) - @yayen-lin

  • Summary

Section 2 (#10) - @markwu7

  • Summary of filtered result

Section 3 (#11) - @sharisung @tsung6

  • Graph

Section 4 (#12) - @RaenonX

  • Table

Colors

  • #212529 - Main
  • #6C757D - Secondary
  • #DC3545 - Fatal
  • #007BFF - Filter Button Background

Image Preview

Preview Image

GUI / Table

Sub-thread of #1

A class to produce a table which can then be attached to the main layout.

COVID-19 cases DSs

Class

DataEntry

Notes

  • Single entry of a data

Fields

  • State state
  • County county
  • int confirmedCases
  • int fatalCases
  • Date date

Methods

  • double confirmedPer100K(bool isState)
    • If isState is false, then it takes the population of the county.
  • double fatalPer100K(bool isState)
    • If isState is false, then it takes the population of the county.
  • double deathRatePercentage(bool isState)
    • If isState is false, then it takes the population of the county.

DataHolder

Notes

  • Holds the entries and perform some calculations or collations on it.

Methods

  • BST<State, BST<County, List<DataEntry>>> data
    • Used when trying to query the data using county or state
  • TreeMap<Integer, List<DataEntry>> confirmedCase/fatalCase
    • Used when trying to get the data using confirmed/fatal case counts
  • HashTable<String, List<DataEntry>> zipCode
    • Used when trying to get the data using ZIP code
  • List<DataEntry> data
    • Data storage of the entries
  • DataCollection filter(FilterCondition condition)
    • Filter the data using the given condition(s)
  • String summaryText()
    • Output the summary text of the data being held
  • int totalConfirmed() / totalFatal()
  • double avgGrowthConfirmed(bool isPer100K) / avgGrowthFatal(bool isPer100K)
    • Average growth of the confirmed / fatal cases per day among the data
  • void outputSummary(String path)
    • Output the summary to the given path
  • void outputData(String path)
    • Output the data to the given path

Population for states without county

Early raw data only have states but not county. Use the existing population data to get the population for these early raw data.

Check the overall data entries can get a sense of what null county will have.

Some population data are not imported

  • Diamond Princess
  • Grand Princess
  • Guam
  • Northern Mariana Islands
  • Puerto Rico
  • Virgin Islands

Possible Solution

Change uspops.csv to be empty county name / state name only.

GUI / Summary

Sub-thread of #1

Data to be included

  • Confirmed Cases
  • Active Cases
  • Fatal Cases

Type of the data to be included

  • Overall (All time record)
  • Difference compare to 7 days before

Export summary

Export some things from the filtered data.

Summary stats

  • Condition
  • Confirmed / Fatal case count
  • Confirmed / Fatal case count per 100K residents

Data entry

  • Each filtered data entries

BTree

Interface / Class

  • Will need an inner class BTreeNode for this tree

Notes on the population data

Header Convention

State County Population Latitude Longitude ZIPs

Notes on ZIP code

zips usually contains multiple codes which are separated by a space.

GUI / Graph

Sub-thread of #1

A class to produce a line chart to be attached on the main layout.

GUI / Summary of the filtered results

Sub-thread of #1

Data to be included

  • Confirmed Cases
  • Active Cases
  • Fatal Cases

Type of the data to be included

  • Count
  • Per 100K residents
  • Average growth rate
    • Calculation TBD

Minimize the population data

Only keeps the necessary data.

Use Python to do this task.

Add a new issue (#18) to record the header convention after this was completed.

Points on committing

  • DO NOT commit too many things at once.
  • Commit when a small piece of a task has been done.
  • Open a new branch when working on a new thing, then merge it back once it's done.
    • Use git rebase to apply newly implemented thing when the task has not completed yet.
  • Mention the issue index as the second example if it's related

Commit Message Format

CODE - COMMIT_MESSAGE

Commit Message Example

Add - Updated README.md
Add - #8 FilterCondition

Code

Code Full Form
ADD Add
IMP Improvements
FIX Fixes

Commit Message

Brief and descriptive, recommended < 120 characters.

Update status on various actions

  • Filter failed to apply
    • Failed to apply data filter.
  • Filter successfully applied
    • Data filtered on <NOW_DATETIME>.
  • Exported results
    • Result file exported to <EXPORT_PATH>.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.