From bc49bc62bdd2e958c1904e76f4f3eddb9c0d5e33 Mon Sep 17 00:00:00 2001 From: Mehdi Aghaei Date: Wed, 24 Jul 2024 23:51:27 +0200 Subject: [PATCH] IMP: Add new chart component, cleanup home page and navigations. --- .../Components/Layout/MainLayout.razor | 9 ++-- .../Components/Layout/Navbar.razor | 18 +++++++ .../Components/Pages/BarChart.razor | 35 ++++++++++++++ .../Components/Pages/ChartList.razor | 13 +++++ .../Components/Pages/CountryChart.razor | 29 ------------ .../Components/Pages/HeatMap.razor | 20 ++++++++ .../Components/Pages/Home.razor | 47 +++++++++++++++++-- .../Components/Pages/LineChart.razor | 36 ++++++++++++++ .../Components/Pages/PieChart.razor | 22 +++++++++ .../Components/Pages/ScatterPlot.razor | 21 +++++++++ Pandemic.Tracker.sln | 6 +-- 11 files changed, 215 insertions(+), 41 deletions(-) create mode 100644 Pandemic.Tracker.Web/Components/Layout/Navbar.razor create mode 100644 Pandemic.Tracker.Web/Components/Pages/BarChart.razor create mode 100644 Pandemic.Tracker.Web/Components/Pages/ChartList.razor delete mode 100644 Pandemic.Tracker.Web/Components/Pages/CountryChart.razor create mode 100644 Pandemic.Tracker.Web/Components/Pages/HeatMap.razor create mode 100644 Pandemic.Tracker.Web/Components/Pages/LineChart.razor create mode 100644 Pandemic.Tracker.Web/Components/Pages/PieChart.razor create mode 100644 Pandemic.Tracker.Web/Components/Pages/ScatterPlot.razor diff --git a/Pandemic.Tracker.Web/Components/Layout/MainLayout.razor b/Pandemic.Tracker.Web/Components/Layout/MainLayout.razor index 77bee93..6148b81 100644 --- a/Pandemic.Tracker.Web/Components/Layout/MainLayout.razor +++ b/Pandemic.Tracker.Web/Components/Layout/MainLayout.razor @@ -1,12 +1,9 @@ @inherits LayoutComponentBase -
+ -
-
- @Body -
-
+
+ @Body
diff --git a/Pandemic.Tracker.Web/Components/Layout/Navbar.razor b/Pandemic.Tracker.Web/Components/Layout/Navbar.razor new file mode 100644 index 0000000..aea1b65 --- /dev/null +++ b/Pandemic.Tracker.Web/Components/Layout/Navbar.razor @@ -0,0 +1,18 @@ + \ No newline at end of file diff --git a/Pandemic.Tracker.Web/Components/Pages/BarChart.razor b/Pandemic.Tracker.Web/Components/Pages/BarChart.razor new file mode 100644 index 0000000..0ac44d5 --- /dev/null +++ b/Pandemic.Tracker.Web/Components/Pages/BarChart.razor @@ -0,0 +1,35 @@ +@page "/bar-chart" +@rendermode InteractiveServer +@inject CountryService CountryService + + + + + + + + + +@code { + public List Countries { get; set; } = []; + + protected override void OnInitialized() + { + Countries = CountryService.GetCountriesStatic().Take(20).ToList(); + } +} \ No newline at end of file diff --git a/Pandemic.Tracker.Web/Components/Pages/ChartList.razor b/Pandemic.Tracker.Web/Components/Pages/ChartList.razor new file mode 100644 index 0000000..526dcb1 --- /dev/null +++ b/Pandemic.Tracker.Web/Components/Pages/ChartList.razor @@ -0,0 +1,13 @@ +@page "/chart-list" +@rendermode InteractiveServer + + \ No newline at end of file diff --git a/Pandemic.Tracker.Web/Components/Pages/CountryChart.razor b/Pandemic.Tracker.Web/Components/Pages/CountryChart.razor deleted file mode 100644 index 3bd82d9..0000000 --- a/Pandemic.Tracker.Web/Components/Pages/CountryChart.razor +++ /dev/null @@ -1,29 +0,0 @@ -@page "/country-chart" -@rendermode InteractiveServer -@inject CountryService CountryService - - - - - - - - -@code { - public ListCountries { get; set; } = []; - - protected override void OnInitialized() - { - Countries = CountryService.GetCountriesStatic().Take(10).ToList(); - } -} \ No newline at end of file diff --git a/Pandemic.Tracker.Web/Components/Pages/HeatMap.razor b/Pandemic.Tracker.Web/Components/Pages/HeatMap.razor new file mode 100644 index 0000000..ba41b67 --- /dev/null +++ b/Pandemic.Tracker.Web/Components/Pages/HeatMap.razor @@ -0,0 +1,20 @@ +@page "/heat-map" +@rendermode InteractiveServer +@inject CountryService CountryService + + + + + +@code { + public List Countries { get; set; } = []; + + protected override void OnInitialized() + { + Countries = CountryService.GetCountriesStatic().Take(20).ToList(); + } +} \ No newline at end of file diff --git a/Pandemic.Tracker.Web/Components/Pages/Home.razor b/Pandemic.Tracker.Web/Components/Pages/Home.razor index 87bfb54..e84c10a 100644 --- a/Pandemic.Tracker.Web/Components/Pages/Home.razor +++ b/Pandemic.Tracker.Web/Components/Pages/Home.razor @@ -1,7 +1,48 @@ @page "/" -Home +
+
+

Pandemic Tracker

+
+

This app currently only covers COVID-19. Stay informed with updated data and visualizations.

+ Navigate to Charts +
-

Hello everyone!

+
+
+
+
+
Real-Time Data Visualization
+

Easily grasp intricate information through visual depictions with our robust data visualization tools.

+
+
+
+
+
+
+
API Architecture
+

Ensure consistent functionality with a strong architectural foundation, even with changes in data provisioning APIs.

+
+
+
+
-Welcome to Pandemic Tracker. +
+
+
+
+
Data Exportation
+

Export data in CSV format for further analysis or record-keeping, enhancing usability and flexibility.

+
+
+
+
+
+
+
Public Health Informatics
+

Leverage technology to improve the accessibility and utility of health-related data during critical periods.

+
+
+
+
+
\ No newline at end of file diff --git a/Pandemic.Tracker.Web/Components/Pages/LineChart.razor b/Pandemic.Tracker.Web/Components/Pages/LineChart.razor new file mode 100644 index 0000000..e2b8b42 --- /dev/null +++ b/Pandemic.Tracker.Web/Components/Pages/LineChart.razor @@ -0,0 +1,36 @@ +@page "/line-chart" +@rendermode InteractiveServer +@inject CountryService CountryService + + + + + + + + + + +@code { + public List Countries { get; set; } = []; + + protected override void OnInitialized() + { + Countries = CountryService.GetCountriesStatic().Take(20).ToList(); + } +} \ No newline at end of file diff --git a/Pandemic.Tracker.Web/Components/Pages/PieChart.razor b/Pandemic.Tracker.Web/Components/Pages/PieChart.razor new file mode 100644 index 0000000..f835f2e --- /dev/null +++ b/Pandemic.Tracker.Web/Components/Pages/PieChart.razor @@ -0,0 +1,22 @@ +@page "/pie-chart" +@rendermode InteractiveServer +@inject CountryService CountryService + + + + + + +@code { + public List Countries { get; set; } = []; + + protected override void OnInitialized() + { + Countries = CountryService.GetCountriesStatic().Take(10).ToList(); + } +} \ No newline at end of file diff --git a/Pandemic.Tracker.Web/Components/Pages/ScatterPlot.razor b/Pandemic.Tracker.Web/Components/Pages/ScatterPlot.razor new file mode 100644 index 0000000..9ffef62 --- /dev/null +++ b/Pandemic.Tracker.Web/Components/Pages/ScatterPlot.razor @@ -0,0 +1,21 @@ +@page "/scatter-plot" +@rendermode InteractiveServer +@inject CountryService CountryService + + + + + +@code { + public List Countries { get; set; } = []; + + protected override void OnInitialized() + { + Countries = CountryService.GetCountriesStatic().Take(20).ToList(); + } +} \ No newline at end of file diff --git a/Pandemic.Tracker.sln b/Pandemic.Tracker.sln index f1e9dff..3708285 100644 --- a/Pandemic.Tracker.sln +++ b/Pandemic.Tracker.sln @@ -1,11 +1,10 @@ - Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.9.34607.119 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Pandemic.Tracker.Web", "Pandemic.Tracker.Web\Pandemic.Tracker.Web.csproj", "{A49F7E08-3CEB-45C8-8855-CBDC46EA567E}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Pandemic.Tracker.Web", "Pandemic.Tracker.Web\Pandemic.Tracker.Web.csproj", "{A49F7E08-3CEB-45C8-8855-CBDC46EA567E}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Pandemic.Tracker.Web.Unit.Tests", "Pandemic.Tracker.Web.Unit.Tests\Pandemic.Tracker.Web.Unit.Tests.csproj", "{B5F4D6C2-02A6-495A-9574-6CE2AC35595B}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Pandemic.Tracker.Web.Unit.Tests", "Pandemic.Tracker.Web.Unit.Tests\Pandemic.Tracker.Web.Unit.Tests.csproj", "{B5F4D6C2-02A6-495A-9574-6CE2AC35595B}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -29,3 +28,4 @@ Global SolutionGuid = {04F50B84-66C3-4DFA-8D96-B86DAF0892D4} EndGlobalSection EndGlobal +bal