Skip to content

Commit

Permalink
Added some comments for data types
Browse files Browse the repository at this point in the history
Signed-off-by: Emil Balitzki <[email protected]>
  • Loading branch information
Corgam committed Jul 12, 2024
1 parent cfcd2bd commit 6c489d6
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 12 deletions.
1 change: 1 addition & 0 deletions frontend/src/components/MapView/MapDatasetVisualizer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ const MapDatasetVisualizer: React.FC<MapDatasetVisualizerProps> = ({
* @returns the color to use
*/
const getColor = (usageType: string) => {
console.log(usageType);
if (dataset.metaData && dataset.metaData.polygonColoring) {
const coloring = dataset.metaData.polygonColoring;
for (const colorRule of coloring.colors) {
Expand Down
19 changes: 14 additions & 5 deletions frontend/src/types/LocationDataTypes.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,26 @@
/**
* A response object from the location endpoint.
*/
export interface LocationDataResponse {
individualData: DatasetItem[];
selectionData: DatasetItem[];
}

export interface SubdataItem {
key: string;
value: string;
}

/**
* A single dataset row visible in the data view.
*/
export interface DatasetItem {
displayName: string;
value: string | null;
datasetID: string | null;
coordinate: number[] | null;
subdata: SubdataItem[];
}

/**
* Sub rows for the data view and the dataset row.
*/
export interface SubdataItem {
key: string;
value: string;
}
8 changes: 6 additions & 2 deletions frontend/src/types/MapSelectionTypes.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { LatLng } from "leaflet";
import { MultiPolygon } from "geojson";

// Define PolygonSelection class
/**
* A map selection of a polygon. Either by manualy drawing it or by search bar.
*/
export class PolygonSelection {
polygon: MultiPolygon;
displayName: string;
Expand All @@ -18,7 +20,9 @@ export class PolygonSelection {
}
}

// An interface for a single marker selection
/**
* A map selection of a single location/marker.
*/
export class MarkerSelection {
marker: LatLng;
displayName: string;
Expand Down
4 changes: 3 additions & 1 deletion frontend/src/types/MapTypes.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
// Enum for types of maps
/**
* Enum for types of background maps for the map view.
*/
export enum MapTypes {
Normal = "normal",
Satellite = "satellite",
Expand Down
13 changes: 9 additions & 4 deletions frontend/src/types/MarkersTypes.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
// Enum for types of markers
/**
* Enum for the types of markers for individual datasets.
*/
export enum MarkersTypes {
Markers = "markers", // Map will display single coordinates with markers on top.
Areas = "areas", // Map will display polygon areas.
None = "none", // Map will not display anything.
// Map will display single coordinates with markers on top.
Markers = "markers",
// Map will display polygon areas.
Areas = "areas",
// Map will not display anything.
None = "none",
}

0 comments on commit 6c489d6

Please sign in to comment.