diff --git a/frontend/next.config.mjs b/frontend/next.config.mjs
index 5d83319..fcfa1e7 100644
--- a/frontend/next.config.mjs
+++ b/frontend/next.config.mjs
@@ -13,7 +13,7 @@ const nextConfig = {
{
protocol: "http",
hostname: "web.hypso.ies.ntnu.no",
- port: '1337'
+ port: "1337",
},
{
protocol: "http",
diff --git a/frontend/package-lock.json b/frontend/package-lock.json
index 161349f..bc3f7a4 100644
--- a/frontend/package-lock.json
+++ b/frontend/package-lock.json
@@ -26,6 +26,7 @@
"@turf/turf": "^6.5.0",
"@visx/geo": "^3.5.0",
"@visx/scale": "^3.5.0",
+ "@visx/shape": "^3.5.0",
"add": "^2.0.6",
"chart.js": "^4.4.1",
"chartjs-adapter-luxon": "^1.3.1",
@@ -6375,6 +6376,11 @@
"@types/d3-color": "*"
}
},
+ "node_modules/@types/d3-path": {
+ "version": "1.0.11",
+ "resolved": "https://registry.npmjs.org/@types/d3-path/-/d3-path-1.0.11.tgz",
+ "integrity": "sha512-4pQMp8ldf7UaB/gR8Fvvy69psNHkTpD/pVw3vmEi8iZAB9EPMBruB1JvHO4BIq9QkUUd2lV1F5YXpMNj7JPBpw=="
+ },
"node_modules/@types/d3-scale": {
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/@types/d3-scale/-/d3-scale-4.0.2.tgz",
@@ -6383,6 +6389,14 @@
"@types/d3-time": "*"
}
},
+ "node_modules/@types/d3-shape": {
+ "version": "1.3.12",
+ "resolved": "https://registry.npmjs.org/@types/d3-shape/-/d3-shape-1.3.12.tgz",
+ "integrity": "sha512-8oMzcd4+poSLGgV0R1Q1rOlx/xdmozS4Xab7np0eamFFUYq71AU9pOCJEFnkXW2aI/oXdVYJzw6pssbSut7Z9Q==",
+ "dependencies": {
+ "@types/d3-path": "^1"
+ }
+ },
"node_modules/@types/d3-time": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/@types/d3-time/-/d3-time-3.0.0.tgz",
@@ -6452,6 +6466,11 @@
"integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==",
"dev": true
},
+ "node_modules/@types/lodash": {
+ "version": "4.17.0",
+ "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.17.0.tgz",
+ "integrity": "sha512-t7dhREVv6dbNj0q17X12j7yDG4bD/DHYX7o5/DbDxobP0HnGPgpRz2Ej77aL7TZT3DSw13fqUTj8J4mMnqa7WA=="
+ },
"node_modules/@types/luxon": {
"version": "3.4.2",
"resolved": "https://registry.npmjs.org/@types/luxon/-/luxon-3.4.2.tgz",
@@ -7934,6 +7953,15 @@
"dev": true,
"peer": true
},
+ "node_modules/@visx/curve": {
+ "version": "3.3.0",
+ "resolved": "https://registry.npmjs.org/@visx/curve/-/curve-3.3.0.tgz",
+ "integrity": "sha512-G1l1rzGWwIs8ka3mBhO/gj8uYK6XdU/3bwRSoiZ+MockMahQFPog0bUkuVgPwwzPSJfsA/E5u53Y/DNesnHQxg==",
+ "dependencies": {
+ "@types/d3-shape": "^1.3.1",
+ "d3-shape": "^1.0.6"
+ }
+ },
"node_modules/@visx/geo": {
"version": "3.5.0",
"resolved": "https://registry.npmjs.org/@visx/geo/-/geo-3.5.0.tgz",
@@ -7971,6 +7999,28 @@
"@visx/vendor": "3.5.0"
}
},
+ "node_modules/@visx/shape": {
+ "version": "3.5.0",
+ "resolved": "https://registry.npmjs.org/@visx/shape/-/shape-3.5.0.tgz",
+ "integrity": "sha512-DP3t9jBQ7dSE3e6ptA1xO4QAIGxO55GrY/6P+S6YREuQGjZgq20TLYLAsiaoPEzFSS4tp0m12ZTPivWhU2VBTw==",
+ "dependencies": {
+ "@types/d3-path": "^1.0.8",
+ "@types/d3-shape": "^1.3.1",
+ "@types/lodash": "^4.14.172",
+ "@types/react": "*",
+ "@visx/curve": "3.3.0",
+ "@visx/group": "3.3.0",
+ "@visx/scale": "3.5.0",
+ "classnames": "^2.3.1",
+ "d3-path": "^1.0.5",
+ "d3-shape": "^1.2.0",
+ "lodash": "^4.17.21",
+ "prop-types": "^15.5.10"
+ },
+ "peerDependencies": {
+ "react": "^16.3.0-0 || ^17.0.0-0 || ^18.0.0-0"
+ }
+ },
"node_modules/@visx/vendor": {
"version": "3.5.0",
"resolved": "https://registry.npmjs.org/@visx/vendor/-/vendor-3.5.0.tgz",
@@ -10302,8 +10352,7 @@
"node_modules/d3-path": {
"version": "1.0.9",
"resolved": "https://registry.npmjs.org/d3-path/-/d3-path-1.0.9.tgz",
- "integrity": "sha512-VLaYcn81dtHVTjEHd8B+pbe9yHWpXKZUC87PzoFmsFrJqgFwDe/qxfp5MlfsfM1V5E/iVt0MmEbWQ7FVIXh/bg==",
- "peer": true
+ "integrity": "sha512-VLaYcn81dtHVTjEHd8B+pbe9yHWpXKZUC87PzoFmsFrJqgFwDe/qxfp5MlfsfM1V5E/iVt0MmEbWQ7FVIXh/bg=="
},
"node_modules/d3-quadtree": {
"version": "1.0.7",
@@ -10342,7 +10391,6 @@
"version": "1.3.7",
"resolved": "https://registry.npmjs.org/d3-shape/-/d3-shape-1.3.7.tgz",
"integrity": "sha512-EUkvKjqPFUAZyOlhY5gzCxCeI0Aep04LwIRpsZ/mLFelJiUfnK56jo5JMDSE7yyP2kLSb6LtF+S5chMk7uqPqw==",
- "peer": true,
"dependencies": {
"d3-path": "1"
}
@@ -14813,8 +14861,7 @@
"node_modules/lodash": {
"version": "4.17.21",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
- "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==",
- "dev": true
+ "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg=="
},
"node_modules/lodash-es": {
"version": "4.17.21",
diff --git a/frontend/package.json b/frontend/package.json
index 5fe8005..6e992ff 100644
--- a/frontend/package.json
+++ b/frontend/package.json
@@ -34,6 +34,7 @@
"@turf/turf": "^6.5.0",
"@visx/geo": "^3.5.0",
"@visx/scale": "^3.5.0",
+ "@visx/shape": "^3.5.0",
"add": "^2.0.6",
"chart.js": "^4.4.1",
"chartjs-adapter-luxon": "^1.3.1",
diff --git a/frontend/src/app/layout.tsx b/frontend/src/app/layout.tsx
index d05ed9c..de0d212 100644
--- a/frontend/src/app/layout.tsx
+++ b/frontend/src/app/layout.tsx
@@ -10,8 +10,8 @@ import { ApolloWrapper } from "@/components/wrappers/ApolloWrapper";
const inter = Inter({ subsets: ["latin"] });
export const metadata: Metadata = {
- title: "Create Next App",
- description: "Generated by create next app",
+ title: "NTNU SmallSat Lab",
+ description: "NTNU Small Satellite Lab",
};
import ErrorBoundaryNavigation from "@/components/ErrorBoundaryNavigation";
diff --git a/frontend/src/app/satellites/[satelliteSlug]/page.tsx b/frontend/src/app/satellites/[satelliteSlug]/page.tsx
index a2871a9..f90bfce 100644
--- a/frontend/src/app/satellites/[satelliteSlug]/page.tsx
+++ b/frontend/src/app/satellites/[satelliteSlug]/page.tsx
@@ -3,9 +3,10 @@ import BlockRendererClient from "@/components/BlockRendererClient";
import fetchSatelliteInfo from "@/lib/data/fetchSatelliteInfo";
import { BlocksContent } from "@strapi/blocks-react-renderer";
import RelatedProjectsAndSatellites from "@/components/RelatedProjectsAndSatellites";
-import SatelliteDataHome from "@/components/satelliteData/SatelliteDataHome";
+import Map2d from "@/components/2dmap/Map2d";
import { useSatelliteStore } from "@/lib/store";
-import SolarDataComponent from "@/components/SolarActivity/SolarData";
+import SatelliteDataHome from "@/components/satelliteData/SatelliteDataHome";
+
function setSelectedSatelliteSlug(satelliteSlug: string) {
const setSelectedSatellite =
useSatelliteStore.getState().setSelectedSatellite;
@@ -39,31 +40,60 @@ export default async function SatelliteInfoPage({
if (!satelliteInfo) return
Loading...
;
return (
- <>
-
+
+
+
+ {/* Container for satname, stats and sat image */}
+
+ {/* Stats Container */}
+
+
+
+ {satelliteInfo.name}
+
+
+
+
+
+
+
+ {/* Image container */}
+
+
+
+ {/* Container for map */}
+
+
+
+
+ {/* Container for body content */}
+
+
+
+
+
+ {/* Related projects */}
+
+ {satelliteInfo.relatedProjects?.length != 0 ? (
+
Related Projects
+ ) : null}
-
-
- {satelliteInfo.name}
-
-
-
- {satelliteInfo.relatedProjects?.length ? (
-
- Related Projects
-
- ) : null}
-
- {satelliteInfo.relatedProjects?.map(
- (project: ProjectOrSatellite) => (
-
- ),
- )}
+
+ {satelliteInfo.relatedProjects?.map(
+ (project: ProjectOrSatellite) => (
+
+ ),
+ )}
+
- >
+
);
}
diff --git a/frontend/src/components/2dmap/2dMapProjection.tsx b/frontend/src/components/2dmap/2dMapProjection.tsx
index f3ed08a..34cec70 100644
--- a/frontend/src/components/2dmap/2dMapProjection.tsx
+++ b/frontend/src/components/2dmap/2dMapProjection.tsx
@@ -1,7 +1,6 @@
-"use client";
-/* eslint-disable react/jsx-handler-names */
import React from "react";
import * as topojson from "topojson-client";
+// @ts-ignore
import { CustomProjection } from "@visx/geo";
import { geoNaturalEarth1 } from "@visx/vendor/d3-geo";
import topology from "./world-topo.json";
@@ -11,6 +10,7 @@ export type GeoCustomProps = {
height: number;
satLatitude?: number;
satLongitude?: number;
+ futurePositions?: [number, number][];
};
interface FeatureShape {
@@ -20,35 +20,44 @@ interface FeatureShape {
properties: { name: string };
}
-export const background = "";
-
// @ts-expect-error
const world = topojson.feature(topology, topology.objects.units) as {
type: "FeatureCollection";
features: FeatureShape[];
};
-export default function GeoCustom({
+export default function Map2dNaturalProjection({
width,
height,
satLatitude,
satLongitude,
+ futurePositions,
}: GeoCustomProps) {
const centerX = width / 2;
const centerY = height / 2;
const scale = (width / 630) * 100;
- // This function projects lat/long to the SVG coordinate system
const projection = geoNaturalEarth1()
.scale(scale)
.translate([centerX, centerY]);
- // Check if both satLatitude and satLongitude are defined
let satPoint: [number, number] | undefined;
if (typeof satLatitude === "number" && typeof satLongitude === "number") {
satPoint = projection([satLongitude, satLatitude]) || undefined;
}
- return width < 10 ? null : (
+
+ // Function to interpolate the green color based on the index
+ const interPolateColor = (index: number, total: number) => {
+ const startColor = { r: 40, g: 96, b: 241 };
+ const endColor = { r: 241, g: 0, b: 20 };
+ const ratio = index / total;
+ const r = Math.round((1 - ratio) * startColor.r + ratio * endColor.r);
+ const g = Math.round((1 - ratio) * startColor.g + ratio * endColor.g);
+ const b = Math.round((1 - ratio) * startColor.b + ratio * endColor.b);
+ return `rgb(${r}, ${g}, ${b})`;
+ };
+
+ return (
<>