Skip to content

Commit

Permalink
Merge pull request #1 from code4fukui/use-aggregated-data
Browse files Browse the repository at this point in the history
集計済みデータを利用したグラフを表示するようにページを一新した
  • Loading branch information
haruyuki-16278 authored Dec 23, 2024
2 parents b5eee75 + ae86e36 commit 94faace
Show file tree
Hide file tree
Showing 34 changed files with 979 additions and 998 deletions.
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "public/people-flow-data"]
path = public/people-flow-data
[submodule "data/people-flow-data"]
path = data/people-flow-data
url = [email protected]:code4fukui/fukui-kanko-people-flow-data.git
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,11 @@ pnpm dev
```

ブラウザで [http://localhost:3000](http://localhost:3000) を開くことで起動された開発サーバーのビルド結果を閲覧できます。

### gitサブモジュールの更新

手元で最新データに更新したいときはサブモジュールで利用しているデータをupdateする必要があります。

```bash
git submodule update --remote
```
73 changes: 0 additions & 73 deletions app/[year]/[month]/[date]/page.tsx

This file was deleted.

108 changes: 0 additions & 108 deletions app/compare/[place]/[graph]/[left]/[right]/page.tsx

This file was deleted.

102 changes: 102 additions & 0 deletions app/monthly/[year]/[month]/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
import MonthlyDetectedPersonGraph from "@/components/graphs/monthly-detected-person.component";
import MonthlyEstimatedAgeGraph from "@/components/graphs/monthly-estimated-age.component";
import MonthlyEstimatedCarCategorySummaryGraph from "@/components/graphs/monthly-estimated-car-category-summary.component";
import MonthlyEstimatedCarCategoryGraph from "@/components/graphs/monthly-estimated-car-category.component";
import MonthlyEstimatedGenderGraph from "@/components/graphs/monthly-estimated-gender.component";
import MonthlyEstimatedPrefectureSummaryGraph from "@/components/graphs/monthly-estimated-prefecture-summary.component";
import MonthlyEstimatedPrefectureGraph from "@/components/graphs/monthly-estimated-prefecture.component";
import MonthlyPageNavigation from "@/components/monthly-page-navigation.component";

export async function generateStaticParams() {
const routes = [];
for (
let i = new Date("2024-10-01");
i.getTime() < new Date().getTime();
i.setMonth(i.getMonth() + 1)
) {
routes.push({
year: i.getFullYear().toString(),
month: (i.getMonth() + 1).toString().padStart(2, "0"),
});
}

return routes;
}

export default async function Page({
params,
}: {
params: Promise<{ year: string; month: string }>;
}) {
const date = new Date(((params) => `${params.year}-${params.month}-01`)(await params));
return (
<>
<MonthlyPageNavigation year={date.getFullYear()} month={date.getMonth() + 1} />
<article className="mb-4 flex flex-col items-center p-4">
<h2 className="mb-2 text-xl font-bold">福井駅東口(観光案内所前)</h2>
<div className="grid h-full w-full grid-cols-1 gap-4 xl:grid-cols-2">
<MonthlyDetectedPersonGraph
placement="fukui-station-east-entrance"
year={date.getFullYear()}
month={date.getMonth() + 1}
></MonthlyDetectedPersonGraph>
<MonthlyEstimatedGenderGraph
placement="fukui-station-east-entrance"
year={date.getFullYear()}
month={date.getMonth() + 1}
></MonthlyEstimatedGenderGraph>
<MonthlyEstimatedAgeGraph
placement="fukui-station-east-entrance"
year={date.getFullYear()}
month={date.getMonth() + 1}
></MonthlyEstimatedAgeGraph>
</div>
</article>
<article className="mb-4 flex flex-col items-center p-4">
<h2 className="mb-2 text-xl font-bold">東尋坊</h2>
<div className="grid h-full w-full grid-cols-1 gap-4 xl:grid-cols-2">
<MonthlyDetectedPersonGraph
placement="tojinbo-shotaro"
year={date.getFullYear()}
month={date.getMonth() + 1}
></MonthlyDetectedPersonGraph>
<MonthlyEstimatedGenderGraph
placement="tojinbo-shotaro"
year={date.getFullYear()}
month={date.getMonth() + 1}
></MonthlyEstimatedGenderGraph>
<MonthlyEstimatedAgeGraph
placement="tojinbo-shotaro"
year={date.getFullYear()}
month={date.getMonth() + 1}
></MonthlyEstimatedAgeGraph>
</div>
</article>
<article className="mb-4 flex flex-col items-center p-4">
<h2 className="mb-2 text-xl font-bold">レインボーライン第一駐車場</h2>
<div className="grid h-full w-full grid-cols-1 gap-4 xl:grid-cols-2">
<MonthlyEstimatedPrefectureGraph
placement="rainbow-line-parking-lot-1-gate"
year={date.getFullYear()}
month={date.getMonth() + 1}
></MonthlyEstimatedPrefectureGraph>
<MonthlyEstimatedPrefectureSummaryGraph
placement="rainbow-line-parking-lot-1-gate"
year={date.getFullYear()}
month={date.getMonth() + 1}
></MonthlyEstimatedPrefectureSummaryGraph>
<MonthlyEstimatedCarCategoryGraph
placement="rainbow-line-parking-lot-1-gate"
year={date.getFullYear()}
month={date.getMonth() + 1}
></MonthlyEstimatedCarCategoryGraph>
<MonthlyEstimatedCarCategorySummaryGraph
placement="rainbow-line-parking-lot-1-gate"
year={date.getFullYear()}
month={date.getMonth() + 1}
></MonthlyEstimatedCarCategorySummaryGraph>
</div>
</article>
</>
);
}
Loading

0 comments on commit 94faace

Please sign in to comment.