-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature - Get data from BigMoodAPI and display it as a table
- Loading branch information
1 parent
a7f1177
commit 701e446
Showing
5 changed files
with
58 additions
and
30 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,51 @@ | ||
<template> | ||
<div id="regions_div"> | ||
<geo-chart :data="[['United States', 44], ['Germany', 23], ['Brazil', 22]]"></geo-chart> | ||
</div> | ||
<v-data-table :headers="headers" :items="trends" class="elevation-1"> | ||
<template v-slot:items="props"> | ||
<td class="text-xs-center">{{ props.item.country }}</td> | ||
<td class="text-xs-center">{{ props.item.city }}</td> | ||
<td class="text-xs-center">{{ props.item.trends[0].trend }}</td> | ||
<td class="text-xs-center">{{ props.item.trends[0].sentiment }}</td> | ||
<!-- <td class="text-xs-center">{{ props.item.woeid }}</td> --> | ||
</template> | ||
</v-data-table> | ||
</template> | ||
|
||
<script> | ||
import axios from "axios"; | ||
export default { | ||
name: "GeoMap", | ||
props: {}, | ||
data: { | ||
sentiment: [["United States", 44], ["Germany", 23], ["Brazil", 22]] | ||
data: function() { | ||
return { | ||
headers: [ | ||
{ text: "Country", value: "Country" }, | ||
{ text: "City", value: "City" }, | ||
{ text: "Hashtag", value: "Hashtag" }, | ||
{ text: "Sentiment", value: "Sentiment" }, | ||
// { text: "Woeid", value: "Woeid" } | ||
], | ||
trends: [], | ||
}; | ||
}, | ||
mounted () { | ||
axios | ||
.get('http://146.148.80.142:3000/bigmoodapi/trends') | ||
.then(response => { | ||
console.log(response.data.trends); | ||
this.trends = response.data.trends | ||
}) | ||
.catch(error => { | ||
this.error = error | ||
}) | ||
} | ||
}; | ||
</script> | ||
|
||
<!-- Add "scoped" attribute to limit CSS to this component only --> | ||
<style scoped> | ||
#regions_div { | ||
width: 900px; | ||
height: 500px; | ||
.regions_div { | ||
width: 1200px; | ||
height: 800px; | ||
text-align: center; | ||
} | ||
|
||
/* h3 { | ||
margin: 40px 0 0; | ||
} | ||
ul { | ||
list-style-type: none; | ||
padding: 0; | ||
} | ||
li { | ||
display: inline-block; | ||
margin: 0 10px; | ||
} | ||
a { | ||
color: #42b983; | ||
} */ | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters