Added sorting, started on paging
This commit is contained in:
@@ -68,16 +68,29 @@ export class DataService {
|
||||
const data: Record<string, any>[] = [];
|
||||
|
||||
(results?.data ?? []).forEach((record: Record<string, any>) => {
|
||||
let code = fn(Csv.County_Code, record);
|
||||
const code = fn(Csv.County_Code, record);
|
||||
// skip non-data rows on the csv
|
||||
if (isNaN(code)) return;
|
||||
const county = fs(Csv.County_Code, record);
|
||||
|
||||
const county_label = fs(Csv.County_Label, record);
|
||||
const school_label = fs(Csv.School_Label, record);
|
||||
if (county_label === '' || school_label === '') return;
|
||||
|
||||
if (!this._counties.has(county)) {
|
||||
this._counties.set(county, county_label);
|
||||
}
|
||||
const school = fs(Csv.School_Code, record);
|
||||
if (!this._schools.has(school)) {
|
||||
this._schools.set(school, school_label);
|
||||
}
|
||||
|
||||
const ms = {} as Record<string, any>;
|
||||
ms[Milestone.Year] = year;
|
||||
ms[Milestone.Grade] = grade;
|
||||
ms[Milestone.Cohort] = cohort;
|
||||
ms[Milestone.County] = fs(Csv.County_Code, record);
|
||||
ms[Milestone.School] = fs(Csv.School_Code, record);
|
||||
ms[Milestone.County] = this._counties.get(county); //fs(Csv.County_Code, record);
|
||||
ms[Milestone.School] = this._schools.get(school); //fs(Csv.School_Code, record);
|
||||
if (year !== 2020) {
|
||||
ms[Milestone.ELACount] = fn(Csv.ELA_Count, record);
|
||||
ms[Milestone.ELAMean] = fn(Csv.ELA_Mean, record);
|
||||
@@ -106,12 +119,14 @@ export class DataService {
|
||||
}
|
||||
data.push(ms);
|
||||
|
||||
const county = fs(Csv.County_Code, record);
|
||||
this._counties.set(county, fs(Csv.County_Label, record));
|
||||
this._schools.set(
|
||||
`${county}-${fs(Csv.School_Code, record)}`,
|
||||
fs(Csv.School_Label, record)
|
||||
);
|
||||
// this._counties.set(
|
||||
// fs(Csv.County_Code, record),
|
||||
// fs(Csv.County_Label, record)
|
||||
// );
|
||||
// this._schools.set(
|
||||
// fs(Csv.School_Code, record),
|
||||
// fs(Csv.School_Label, record)
|
||||
// );
|
||||
});
|
||||
|
||||
if (year !== 2020) {
|
||||
|
||||
Reference in New Issue
Block a user