diff --git a/src/app/app.component.html b/src/app/app.component.html
index 6a25003..891cfd7 100644
--- a/src/app/app.component.html
+++ b/src/app/app.component.html
@@ -1 +1,10 @@
-
+
+
+
+
+
+
+
+
+
+
diff --git a/src/app/app.component.scss b/src/app/app.component.scss
index e69de29..138aee3 100644
--- a/src/app/app.component.scss
+++ b/src/app/app.component.scss
@@ -0,0 +1,10 @@
+:host {
+ display: flex;
+ flex-direction: column;
+}
+
+div {
+ flex: 1;
+ flex-direction: row;
+ display: flex;
+}
diff --git a/src/app/app.component.ts b/src/app/app.component.ts
index 929ad10..4803758 100644
--- a/src/app/app.component.ts
+++ b/src/app/app.component.ts
@@ -1,15 +1,49 @@
-import { Component } from '@angular/core';
+import { Component, OnInit, inject } from '@angular/core';
import { RouterOutlet } from '@angular/router';
import { ChartComponent } from '../components/chart/chart.component';
import { SelectComponent } from '../components/select/select.component';
+import { DataService } from '../services/data.service';
+import { TableComponent } from '../components/table/table.component';
+import { Header } from '../components/table/header';
+import { FilterService } from '../services/filters.service';
@Component({
selector: 'app-root',
standalone: true,
- imports: [RouterOutlet, ChartComponent, SelectComponent],
+ imports: [RouterOutlet, ChartComponent, SelectComponent, TableComponent],
templateUrl: './app.component.html',
styleUrl: './app.component.scss',
})
-export class AppComponent {
+export class AppComponent implements OnInit {
title = 'Georgia Milestones';
+
+ data = inject(DataService);
+ filter = inject(FilterService);
+
+ header = [new Header({ label: 'School', source: 'school' })];
+ rows: Record[] = [];
+
+ ngOnInit(): void {
+ // this.filter.filters$.subscribe((filters: KeyValue[]) => {
+ // this.data.Data.pipe(take(1)).subscribe((data: Milestone[]) => {
+ // const result = data.filter((d: Milestone) => {
+ // const match = (filters ?? []).findIndex((f: KeyValue) => {
+ // switch (f.key) {
+ // case 'year':
+ // return d.Year.toString() === f.value;
+ // case 'grade':
+ // return d.Grade.toString() === f.value;
+ // case 'county':
+ // return d.County === f.value;
+ // case 'school':
+ // return d.School === f.value;
+ // }
+ // return false;
+ // });
+ // return match > -1;
+ // });
+ // this.rows = result.map((r: Milestone) => ({ school: r.School }));
+ // });
+ // });
+ }
}
diff --git a/src/components/chart/chart-type.ts b/src/components/chart/chart-type.ts
index 5cea4c4..f9ae496 100644
--- a/src/components/chart/chart-type.ts
+++ b/src/components/chart/chart-type.ts
@@ -12,6 +12,7 @@ export enum ChartType {
export interface IDataset {
type?: ChartType;
borderColor?: string;
+ label?: string;
data: string[];
backgroundColor?: string | string[];
pointBackgroundColor?: string;
@@ -20,6 +21,6 @@ export interface IDataset {
export interface IData {
labels?: string[];
- labelsSource: string[];
+ labelsSource?: string[];
datasets: IDataset[];
}
diff --git a/src/components/chart/chart.component.ts b/src/components/chart/chart.component.ts
index c8cbb59..819f94b 100644
--- a/src/components/chart/chart.component.ts
+++ b/src/components/chart/chart.component.ts
@@ -5,7 +5,7 @@ import {
OnDestroy,
ViewChild,
} from '@angular/core';
-import { Chart, ChartOptions } from 'chart.js';
+import { Chart, ChartOptions } from 'chart.js/auto';
import { PluginNodata } from './plugin-nodata';
import { PluginMoreColors } from './plugin-more-colors';
import { ChartType, IData } from './chart-type';
@@ -22,9 +22,20 @@ export class ChartComponent implements AfterViewInit, OnDestroy {
private chart: any = undefined;
private data: IData = {
- labels: [],
- labelsSource: [],
- datasets: [],
+ labels: Array.from(
+ { length: 10 },
+ () => `${Math.floor(Math.random() * 100)}`
+ ),
+ // labelsSource: [],
+ datasets: [
+ {
+ label: 'test',
+ data: Array.from(
+ { length: 10 },
+ () => `${Math.floor(Math.random() * 100)}`
+ ),
+ },
+ ],
};
constructor() {}
diff --git a/src/components/select/select.component.html b/src/components/select/select.component.html
index 814a111..72e5e0f 100644
--- a/src/components/select/select.component.html
+++ b/src/components/select/select.component.html
@@ -1,4 +1,7 @@
-
-