Skip to content

Commit 821de2b

Browse files
committed
Revert "Create NDVI comparison graphs"
This reverts commit b320b69.
1 parent b320b69 commit 821de2b

File tree

3 files changed

+58
-251
lines changed

3 files changed

+58
-251
lines changed

frontend/src/App.vue

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
<template>
22
<h1 id="app">
3-
<NdviGraph />
3+
<TestComponent />
4+
<MedianTempGraph />
45
</h1>
56
</template>
67

78
<script>
8-
import NdviGraph from "./components/NdviGraph.vue"
9-
import MedianTempGraph from "./components/TestGraphOne.vue"
9+
import TestComponent from "./components/TestComponent.vue"
10+
// import MedianTempGraph from "./components/TestGraphOne.vue"
1011
1112
export default {
1213
name: 'App',
1314
components: {
14-
NdviGraph,
15-
MedianTempGraph
15+
TestComponent,
16+
// MedianTempGraph
1617
}
1718
};
1819
</script>

frontend/src/components/NdviGraph.vue

Lines changed: 0 additions & 246 deletions
This file was deleted.
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<template>
2+
<div>
3+
<h3>Temperature Data:</h3>
4+
<ul v-if="temperatureData">
5+
<li v-for="(data, index) in temperatureData.data" :key="index">
6+
Timestamp: {{ data.timestamp }} - Value: {{ data.value }} °C
7+
</li>
8+
</ul>
9+
</div>
10+
</template>
11+
12+
<script>
13+
import { ref, onMounted } from 'vue'
14+
import axios from 'axios'
15+
16+
export default {
17+
name: 'FetchTemperatureData',
18+
setup() {
19+
const temperatureData = ref(null)
20+
21+
const fetchTemperatureData = async () => {
22+
const apiUrl = 'http://localhost:8000/weather/index'
23+
24+
const params = {
25+
weatherVariable: "temperature_2m",
26+
startDate: 1672527600,
27+
endDate: 1675119600,
28+
location: "TEMPELHOFER_FELD",
29+
temporalResolution: "DAILY",
30+
aggregation: "MEAN",
31+
}
32+
33+
try {
34+
const response = await axios.get(apiUrl, { params })
35+
temperatureData.value = response.data
36+
} catch (error) {
37+
console.error("Error fetching temperature data:", error)
38+
}
39+
}
40+
41+
onMounted(() => {
42+
fetchTemperatureData()
43+
})
44+
45+
return {
46+
temperatureData
47+
}
48+
}
49+
}
50+
</script>
51+
52+
<style scoped></style>

0 commit comments

Comments
 (0)