Commit 889255fe authored by Daniel Suarez Souto's avatar Daniel Suarez Souto
Browse files

added categories-chart

parent abefc9e0
Pipeline #1193 passed with stages
in 28 seconds
......@@ -416,9 +416,6 @@ H2020 RIA Action Grant No. 740934 under the call SEC-06-FCT-2016 — Developing
}/*,
match: this.search*/
},
sort: {
"schema:datePublished":"desc"
},
aggs: {
type: {
terms: {
......@@ -455,6 +452,16 @@ H2020 RIA Action Grant No. 740934 under the call SEC-06-FCT-2016 — Developing
}
}
},
'people.name':{
terms: {
field: "entities.schema:name.keyword",
size : 16,
order: {
_count: "desc"
}
include
}
}
'categories.name': {
terms: {
field: "taxonomies.rdfs:label.keyword",
......
......@@ -416,9 +416,6 @@ H2020 RIA Action Grant No. 740934 under the call SEC-06-FCT-2016 — Developing
}/*,
match: this.search*/
},
sort: {
"schema:datePublished":"desc"
},
aggs: {
type: {
terms: {
......@@ -439,7 +436,7 @@ H2020 RIA Action Grant No. 740934 under the call SEC-06-FCT-2016 — Developing
'entities.name': {
terms: {
field: "entities.schema:name.keyword",
size : 25,
size : 16,
order: {
_count: "desc"
}
......@@ -455,6 +452,16 @@ H2020 RIA Action Grant No. 740934 under the call SEC-06-FCT-2016 — Developing
}
}
},
'people.name':{
terms: {
field: "entities.schema:name.keyword",
size : 16,
order: {
_count: "desc"
}
include
}
}
'categories.name': {
terms: {
field: "taxonomies.rdfs:label.keyword",
......
......@@ -68,7 +68,7 @@
Person
</div>
<div class="leyend_person" style="display: flex; flex-direction: row;">
<div style="width: 7px;height: 7px;background-color: #9b009b; float: left; margin-top: 7px;margin-right: 3px; margin-left: 6px" class="style-scope news-chart"></div>
<div style="width: 7px;height: 7px;background-color: #505050; float: left; margin-top: 7px;margin-right: 3px; margin-left: 6px" class="style-scope news-chart"></div>
Category
</div>
......@@ -76,12 +76,12 @@
<template is="dom-repeat" items="{{news.entities}}" as="entity">
<span class="badge badge-secondary" on-tap="highlightEntity" data-id$= "{{getID(news)}}" data-text$="{{getNew(news)}}" style$="{{getBg(entity)}} cursor:pointer;">{{entity.schema:name}}</span>
<span class="badge badge-secondary" on-tap="highlightEntity" data-id$= "{{getID(news)}}" data-text$="{{getNew(news)}}" style$="background-color: {{getBg(entity)}};">{{entity.schema:name}}</span>
</template>
<template is="dom-repeat" items="{{news.taxonomies}}" as="category">
<span class="badge badge-secondary" on-tap="highlightCategory" data-id$= "{{getID(news)}}" data-text$="{{getNew(news)}}" style="background-color: #9b009b;margin-bottom:5px; cursor:pointer;">{{getCategory(category)}}</span>
<span class="badge badge-secondary" on-tap="highlightCategory" data-id$= "{{getID(news)}}" data-text$="{{getNew(news)}}" style="background-color: #505050;">{{getCategory(category)}}</span>
</template>
</div>
......@@ -122,6 +122,7 @@
<script>
var filtered = false;
var bgs = true;
Polymer({
......@@ -195,10 +196,6 @@
value: function() { return []; }
}
},
ready: function() {
},
_dataChanged: function() {
//console.log("Tweet Chart")
var that = this
......@@ -250,15 +247,14 @@
},
getBg: function(entity){
//console.log(entity)
if(!("@type" in entity)){
return "background-color: brown;margin-bottom:5px;"
} else if(entity["@type"][0] == "schema:Place") {
return "background-color: #f90;margin-bottom:5px;"
} else if(entity["@type"][0] == "schema:Organization") {
return "background-color: #dd4b39;margin-bottom:5px;"
if(entity["@type"][0] === "schema:Place") {
color = "#ff9900"
} else if(entity["@type"][0] === "schema:Organization") {
color = "#dd4b39"
} else {
return "background-color: #00c0ef;margin-bottom:5px;"
color = "#00c0ef"
}
return color;
},
checkSentiment: function(sentiment) {
//console.log(sentiment[0]['marl:hasPolarity'])
......
......@@ -140,4 +140,15 @@ button h4 a:focus {
.style-scope.news-chart:hover {
text-decoration: none;
}
\ No newline at end of file
}
.badge.badge-secondary {
border: 1px solid ;
border-bottom-left-radius: 0;
padding-right: 12px;
cursor:pointer;
margin-bottom:5px;
margin-right: 3px;
margin-left: 3px;
font-size: 13px;
color: white;
}
......@@ -79,19 +79,19 @@
Person
</div>
<div class="leyend_person" style="display: flex; flex-direction: row;">
<div style="width: 7px;height: 7px;background-color: #9b009b; float: left; margin-top: 7px;margin-right: 3px; margin-left: 6px" class="style-scope news-chart"></div>
<div style="width: 7px;height: 7px;background-color: #505050; float: left; margin-top: 7px;margin-right: 3px; margin-left: 6px" class="style-scope news-chart"></div>
Category
</div>
</div>
<template is="dom-repeat" items="{{news.entities}}" as="entity">
<span class="badge badge-secondary" on-tap="highlightEntity" data-id$= "{{getID(news)}}" data-text$="{{getArticle(news)}}" style$="{{getBg(entity)}} cursor:pointer;">{{entity.schema:name}}</span>
<span class="badge badge-secondary" on-tap="highlightEntity" data-id$= "{{getID(news)}}" data-text$="{{getArticle(news)}}" style$="background-color: {{getBg(entity)}};">{{entity.schema:name}}</span>
</template>
<template is="dom-repeat" items="{{news.taxonomies}}" as="category">
<span class="badge badge-secondary" on-tap="highlightCategory" data-id$= "{{getID(news)}}" data-text$="{{getArticle(news)}}" style="background-color: #9b009b;margin-bottom:5px; cursor:pointer;">{{getCategory(category)}}</span>
<span class="badge badge-secondary" on-tap="highlightCategory" data-id$= "{{getID(news)}}" data-text$="{{getArticle(news)}}" style="background-color: #505050;">{{getCategory(category)}}</span>
</template>
</div>
......@@ -278,16 +278,15 @@
return fecha[2].split("T")[0]+"-"+fecha[1]+"-"+fecha[0]
},
getBg: function(entity){
if(!("@type" in entity)){
return "background-color: brown;margin-bottom:5px;"
} else if(entity["@type"][0] == "schema:Place") {
return "background-color: #f90;margin-bottom:5px;"
} else if(entity["@type"][0] == "schema:Organization") {
return "background-color: #dd4b39;margin-bottom:5px;"
//console.log(entity)
if(entity["@type"][0] === "schema:Place") {
color = "#ff9900"
} else if(entity["@type"][0] === "schema:Organization") {
color = "#dd4b39"
} else {
return "background-color: #00c0ef;margin-bottom:5px;"
color = "#00c0ef"
}
return color;
},
checkSentiment: function(sentiment) {
//console.log(sentiment[0]['marl:hasPolarity'])
......
......@@ -137,4 +137,15 @@ a.text.style-scope.propaganda-chart:first-letter {
width: 100%;
line-height: 35px;
text-align: center;
}
.badge.badge-secondary {
border: 1px solid ;
border-bottom-left-radius: 0;
padding-right: 12px;
cursor:pointer;
margin-bottom:5px;
margin-right: 3px;
margin-left: 3px;
font-size: 13px;
color: white;
}
\ No newline at end of file
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