Commit 00608bad authored by Alberto Pascual's avatar Alberto Pascual
Browse files

dashboard updates

parent aa3dc261
......@@ -49,7 +49,7 @@
<number-chart
data="{{data}}"
object="cnn"
aggKey="author"
aggKey="schema:author"
title="CNN"
icon="/images/cnn.png"
stylebg="bg-yellow">
......@@ -59,7 +59,7 @@
<number-chart
data="{{data}}"
object="The New York Times"
aggKey="author"
aggKey="schema:author"
title="The New York Times"
icon="/images/times.png"
aggkey="location"
......@@ -71,7 +71,7 @@
<div style="width: 100%; display: inline-block">
<div class="chart_container" style="right: 0; float: right">
<entities-chart
field="about"
field="entities.dbps:anyURI"
data="{{data}}"
title="Entities founded"
icon="icons:list"
......@@ -82,7 +82,7 @@
</div>
<div class="chart_container" style="left: 0; float: left">
<google-chart
field="author"
field="schema:author"
data="{{data}}"
id='pie-chart3'
extra-id='pie-chart3'
......@@ -125,7 +125,7 @@
<div class="chart_container" style="left: 0; float: left; width: 100%">
<google-chart
field="dataPublished"
field="schema:datePublished"
data="{{data}}"
id='line-chart'
extra-id='line-chart'
......@@ -149,7 +149,7 @@
</div>
<div>
<yasgui-ui
endpoint="http://${FUSEKI_ENPOINT_DASHBOARD}/gsicrawler/query"
endpoint="http:///krusti.gsi/gsicrawler/query"
queries="{{queries}}">
</yasgui-ui>
</div>
......@@ -237,7 +237,7 @@
query: {
multi_match:{
query: this.query,
fields: ['author', 'headline', 'sentiments', 'about']
fields: ['schema:author', 'schema:headline', 'sentiments', 'schema:about']
}
},
aggs: {
......@@ -249,17 +249,17 @@
}
}
},
author: {
'schema:author': {
terms: {
field: "author.keyword",
field: "schema:author.keyword",
order: {
_count: "desc"
}
}
},
about: {
'entities.dbps:anyURI': {
terms: {
field: "about.keyword",
field: "entities.dbps:anyURI.keyword",
order: {
_count: "desc"
}
......@@ -281,9 +281,9 @@
}
}
},
dataPublished: {
'schema:datePublished': {
date_histogram : {
field : "dataPublished",
field : "schema:datePublished",
format: "MM-yyyy",
interval : "month"
}
......@@ -325,17 +325,17 @@
}
}
},
author: {
'schema:author': {
terms: {
field: "author.keyword",
field: "schema:author.keyword",
order: {
_count: "desc"
}
}
},
about: {
'entities.dbps:anyURI': {
terms: {
field: "about.keyword",
field: "entities.dbps:anyURI.keyword",
order: {
_count: "desc"
}
......@@ -357,9 +357,9 @@
}
}
},
dataPublished: {
'schema:datePublished': {
date_histogram : {
field : "dataPublished",
field : "schema:datePublished",
format: "MM-yyyy",
interval : "month"
}
......
......@@ -49,7 +49,7 @@
<number-chart
data="{{data}}"
object="cnn"
aggKey="author"
aggKey="schema:author"
title="CNN"
icon="/images/cnn.png"
stylebg="bg-yellow">
......@@ -59,7 +59,7 @@
<number-chart
data="{{data}}"
object="The New York Times"
aggKey="author"
aggKey="schema:author"
title="The New York Times"
icon="/images/times.png"
aggkey="location"
......@@ -71,7 +71,7 @@
<div style="width: 100%; display: inline-block">
<div class="chart_container" style="right: 0; float: right">
<entities-chart
field="about"
field="entities.dbps:anyURI"
data="{{data}}"
title="Entities founded"
icon="icons:list"
......@@ -82,7 +82,7 @@
</div>
<div class="chart_container" style="left: 0; float: left">
<google-chart
field="author"
field="schema:author"
data="{{data}}"
id='pie-chart3'
extra-id='pie-chart3'
......@@ -125,7 +125,7 @@
<div class="chart_container" style="left: 0; float: left; width: 100%">
<google-chart
field="dataPublished"
field="schema:datePublished"
data="{{data}}"
id='line-chart'
extra-id='line-chart'
......@@ -149,7 +149,7 @@
</div>
<div>
<yasgui-ui
endpoint="http:///gsicrawler/query"
endpoint="http:///krusti.gsi/gsicrawler/query"
queries="{{queries}}">
</yasgui-ui>
</div>
......@@ -222,7 +222,6 @@
else this._ESsearch()
},
_filtersChange: function() {
var myfilters = []
this._query();
},
_ESsearch: function() {
......@@ -238,7 +237,7 @@
query: {
multi_match:{
query: this.query,
fields: ['author', 'headline', 'sentiments', 'about']
fields: ['schema:author', 'schema:headline', 'sentiments', 'schema:about']
}
},
aggs: {
......@@ -250,17 +249,18 @@
}
}
},
author: {
'schema:author': {
terms: {
field: "author.keyword",
field: "schema:author.keyword",
order: {
_count: "desc"
}
}
},
about: {
'entities.dbps:anyURI': {
terms: {
field: "about.keyword",
field: "entities.dbps:anyURI.keyword",
size: 20,
order: {
_count: "desc"
}
......@@ -282,9 +282,9 @@
}
}
},
dataPublished: {
'schema:datePublished': {
date_histogram : {
field : "dataPublished",
field : "schema:datePublished",
format: "MM-yyyy",
interval : "month"
}
......@@ -326,17 +326,18 @@
}
}
},
author: {
'schema:author': {
terms: {
field: "author.keyword",
field: "schema:author.keyword",
order: {
_count: "desc"
}
}
},
about: {
'entities.dbps:anyURI': {
terms: {
field: "about.keyword",
field: "entities.dbps:anyURI.keyword",
size: 20,
order: {
_count: "desc"
}
......@@ -358,9 +359,9 @@
}
}
},
dataPublished: {
'schema:datePublished': {
date_histogram : {
field : "dataPublished",
field : "schema:datePublished",
format: "MM-yyyy",
interval : "month"
}
......
......@@ -209,6 +209,7 @@
_dataChanged: function() {
var that = this
var aggs = 0
console.log(this.field)
try{
var hits = this.data.aggregations[this.field].buckets;
}
......@@ -217,7 +218,7 @@
}
var data = [];
hits.forEach(function(entry) {
data.push([entry.key.toUpperCase(), entry.doc_count]);
data.push([entry.key.toUpperCase().split("/")[4], entry.doc_count]);
});
that.entities = data;
filtered = true;
......@@ -229,7 +230,7 @@
filter: function(e) {
var myfilters = e.model.__data__.entity[0].toLowerCase().split(" ")
this.push('filters', { terms: { about: myfilters}})
this.push('filters', { terms: { 'entities.dbps:anyURI': myfilters}})
}
});
......
......@@ -290,15 +290,15 @@ Data can be provided in one of three ways:
if (field == "sentiment") field = 'sentiments.marl:hasPolarity'
if (field == "emotion") field = 'emotions.onyx:hasEmotion.onyx:hasEmotionCategory'
term1[field] = param.toLowerCase().split(" ");
if (field == 'dataPublished'){
if (field == 'datePublished'){
term1[field] = param.toLowerCase().split("-");
}
console.log(term1)
var object = {terms: term1}
if (field == 'dataPublished'){
if (field == 'schema:datePublished'){
var date = param.toLowerCase().toString().split("-");
var term = date[1]+'-'+date[0]+'-01'
object = {range: {dataPublished: {gte: term, boost: 5}}}
object = {range: {'schema:datePublished': {gte: term, boost: 5}}}
}
var isInside = -1
for(var i = 0; i < this.filters.length; i++){
......@@ -484,8 +484,8 @@ Data can be provided in one of three ways:
_dataChanged: function() {
//console.log("_dataChanged")
console.log(this.field)
console.log(this.data)
//console.log(this.field)
//console.log(this.data)
var that = this
var aggs = 0
try{
......@@ -495,7 +495,7 @@ Data can be provided in one of three ways:
var hits = []
}
var data = [];
if (this.field == "dataPublished") {
if (this.field == "schema:datePublished") {
hits.forEach(function(entry) {
data.push([entry.key_as_string, entry.doc_count]);
});
......@@ -505,7 +505,7 @@ Data can be provided in one of three ways:
data.push([entry.key, entry.doc_count]);
});
}
console.log(data)
//console.log(data)
if(data.length == 0 ){
this.$.chartdiv.style.visibility = 'hidden';
this.$.nodata.style.visibility = 'visible';
......
......@@ -17,11 +17,28 @@
<span>{{title}}</span>
</div>
<template is="dom-repeat" items="{{data}}" as="news">
<div class="tweet same-height" style="border: 2px dashed rgba(96, 125, 139, .5); text-align: center;">
<span style="font-weight: bold; font-size:30px; text-align:center; margin: 0 auto; display:block;">{{news.headline}}</span></br>
<div class$="tweet {{checkSentiment(news.sentiments)}} same-height" style="border: 2px dashed rgba(96, 125, 139, .5); text-align: center;">
<div class="row"><div class="col-md-7 headline">
<div class="col-md-4">
<img src="{{news.schema:thumbnailUrl}}" style="width: 100%; display:inline-block; left: 0%; position: relative; ">
</div>
<div class="col-md-8">
<span style="font-weight: bold; font-size:30px; display:inline-block; vertical-align: middle;">{{news.schema:headline}}</span>
</div>
</div>
<div class="col-md-1 see-more">
<img src={{checkSource(news.schema:author)}} style="width: 100%; display:block; position: relative;" align="left">
</div>
<div class="col-md-2 emotion-box">
<img src={{checkEmotion(news.emotions)}} style="width: 30%; margin: 0 auto; display: block; position:relative;" data-toggle="tooltip" data-placement="top" title="{{getemotion(news.emotions)}}">
<p class$="emotion {{getemotion(news.emotions)}}">Emotion: {{getemotion(news.emotions)}}</p></br>
</div>
<div class="see-more col-md-2">
<button class="btn btn-primary" ident$="subitem[[index]]" on-click="toggle" aria-expanded$="[[opened]]" aria-controls="collapse">{{buttontext}}<iron-icon icon="expand-more"></iron-icon></button>
<img src={{checkSource(news.author)}} style="width: 10%; display:block; left: 3%; position: relative;">
<img src={{checkEmotion(news.emotions)}} style="width: 3%; margin: 0 auto; display:block; float:right; position:relative; top:-65px;left: -43px;" data-toggle="tooltip" data-placement="top" title="{{getemotion(news.emotions)}}">
</div>
</div>
<iron-collapse ident$="subitem[[index]]">
<div class="content" style="text-align:justify; width: 94%; margin: 0 auto;">
<br>
......@@ -138,17 +155,17 @@
},
checkSentiment: function(sentiment) {
//console.log(sentiment)
if (sentiment == "marl:Positive")
return "tweet positive"
else if (sentiment == "marl:Negative")
return "tweet negative"
console.log(sentiment[0]['marl:hasPolarity'])
if (sentiment[0]['marl:hasPolarity'] == "marl:Positive")
return "tweet positive-news"
else if (sentiment[0]['marl:hasPolarity'] == "marl:Negative")
return "tweet negative-news"
else
return "tweet neutral"
return "tweet neutral-news"
},
getemotion: function(emotion) {
//console.log(sentiment)
return emotion[0]['onyx:hasEmotion']['onyx:hasEmotionCategory'].split('#')[1]
//console.log(emotion)
return emotion[0]['onyx:hasEmotion']['onyx:hasEmotionCategory'].split(':')[1]
},
checkSpanSentiment: function(sentiment) {
//console.log(sentiment)
......
......@@ -15,6 +15,46 @@
line-height: 35px;
}
.emotion{
text-align: center;
}
.headline{
text-align: left;
}
.emotion-box{
padding-top: 2%;
}
.see-more{
padding-top: 3%;
}
.neutral-emotion{
color: #F7EA2A;
}
.negative-fear{
color: #054990;
}
.sadness{
color: #395EAD;
}
.joy{
color: #75B84C;
}
.disgust{
color: #E0901B;
}
.anger{
color: #C81F1D;
}
.top-bar span {
vertical-align: middle;
}
......@@ -46,6 +86,18 @@ paper-icon-button.green:hover {
background: rgba(96, 125, 139, .5);;
}
.positive-news {
background: rgba(76, 175, 80, .2);
}
.negative-news {
background: rgba(255, 82, 82, .2);
}
.neutral-news {
background: rgba(96, 125, 139, .2);;
}
.text {
font-size: 17px;
font-weight: bold;
......
demo/images/cnn.png

24.1 KB | W: | H:

demo/images/cnn.png

83 KB | W: | H:

demo/images/cnn.png
demo/images/cnn.png
demo/images/cnn.png
demo/images/cnn.png
  • 2-up
  • Swipe
  • Onion skin
demo/images/times.png

25.6 KB | W: | H:

demo/images/times.png

57.4 KB | W: | H:

demo/images/times.png
demo/images/times.png
demo/images/times.png
demo/images/times.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -18,7 +18,7 @@
<template is="dom-bind">
<elastic-client
config='{"host": "localhost:19200"}'
config='{"host": "krusti.gsi:19200"}'
client="{{client}}"
cluster-status="{{myStatus}}">
</elastic-client>
......
......@@ -62,6 +62,10 @@ services:
- ES_PORT=${ES_PORT}
- FUSEKI_ENDPOINT_EXTERNAL=${FUSEKI_ENDPOINT_EXTERNAL}
- API_KEY_MEANING_CLOUD=${API_KEY_MEANING_CLOUD}
- TWITTER_CONSUMER_KEY=${TWITTER_CONSUMER_KEY}
- TWITTER_CONSUMER_SECRET=${TWITTER_CONSUMER_SECRET}
- TWITTER_ACCESS_TOKEN=${TWITTER_ACCESS_TOKEN}
- TWITTER_ACCESS_TOKEN_SECRET=${TWITTER_ACCESS_TOKEN_SECRET}
depends_on:
- elasticsearch
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment