Skip to content

Commit

Permalink
1213 0050 update
Browse files Browse the repository at this point in the history
  • Loading branch information
andy89923 committed Jan 12, 2023
1 parent 2dc7094 commit 3ebcb44
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 4 deletions.
9 changes: 9 additions & 0 deletions movis/src/pages/f315/geo-map.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
} from "chart.js";
import { getCountDict } from "../../utils/relationUtils";
import { iso_3166_1_2_digit_to_number_map } from "../../utils/isoMapping";
import { start } from "repl";

ChartJS.register(
Title,
Expand Down Expand Up @@ -92,6 +93,14 @@ export default function Map(data: any) {
legend: {
display: false,
},
title: {
text: "Number are normalized by Log scale",
align: "start",
display: false,
font: {
size: 14,
},
},
},
scales: {
projection: {
Expand Down
33 changes: 29 additions & 4 deletions movis/src/pages/f315/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@ const CountLinePlot: React.FC<{
type: "linear" as const,
display: true,
position: "left" as const,
ticks: {
color: "rgba(255, 110, 140, 1)",
},
},
y1: {
type: "linear" as const,
Expand All @@ -118,6 +121,22 @@ const CountLinePlot: React.FC<{
},
},
},
plugins: {
title: {
display: false,
},
legend: {
display: true,
position: "bottom",
align: "center",
labels: {
boxWidth: 30,
font: {
size: 16,
},
},
},
},
responsive: true,
maintainAspectRatio: false,
};
Expand All @@ -142,7 +161,7 @@ const CountLinePlot: React.FC<{
labels: all_labels,
datasets: [
{
label: "count",
label: "# of Movies",
data: all_labels.map((dat) => {
return props.movies.filter((mov) => {
return Object.is(dateToStr(mov.release_date), dat);
Expand All @@ -157,7 +176,7 @@ const CountLinePlot: React.FC<{
{
label: "revenue",
data: all_labels.map((dat) => {
var sum = 0;
let sum = 0;
props.movies.map((mov) => {
if (Object.is(dateToStr(mov.release_date), dat)) sum += mov.revenue;
});
Expand All @@ -172,7 +191,7 @@ const CountLinePlot: React.FC<{
{
label: "budget",
data: all_labels.map((dat) => {
var sum = 0;
let sum = 0;
props.movies.map((mov) => {
if (Object.is(dateToStr(mov.release_date), dat)) sum += mov.budget;
});
Expand Down Expand Up @@ -324,10 +343,16 @@ const Home: NextPage = () => {
>
<div className="flex h-full flex-col items-center justify-center gap-4 rounded-xl bg-white/90 p-4 text-lg text-black hover:bg-white/100">
<Map data={movies} />
<div className="text-[0.5rem] text-gray-500">
Number are normalized by Log scale
</div>
</div>
</ZoomCard>

<ZoomCard title="Genres Count" className="col-span-2 row-span-2">
<ZoomCard
title="Genres Distribution"
className="col-span-2 row-span-2"
>
<div className="flex h-full flex-col gap-4 rounded-xl bg-white/90 p-4 text-lg text-black hover:bg-white/100">
<GenreBarPlot data={movies} />
</div>
Expand Down

0 comments on commit 3ebcb44

Please sign in to comment.