Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
sefarad
dashboard-gsicrawler
Commits
8bc6b6c3
Commit
8bc6b6c3
authored
Oct 02, 2017
by
Alberto Pascual
Browse files
dashboard updates
parent
f986360b
Changes
10
Hide whitespace changes
Inline
Side-by-side
dashboard-reddit.env.html
View file @
8bc6b6c3
...
...
@@ -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=
"dat
a
Published"
field=
"
schema:
dat
e
Published"
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 @@
}
}
},
dat
a
Published
:
{
'
schema:
dat
e
Published
'
:
{
date_histogram
:
{
field
:
"
dat
a
Published
"
,
field
:
"
schema:
dat
e
Published
"
,
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 @@
}
}
},
dat
a
Published
:
{
'
schema:
dat
e
Published
'
:
{
date_histogram
:
{
field
:
"
dat
a
Published
"
,
field
:
"
schema:
dat
e
Published
"
,
format
:
"
MM-yyyy
"
,
interval
:
"
month
"
}
...
...
dashboard-reddit.html
View file @
8bc6b6c3
...
...
@@ -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=
"dat
a
Published"
field=
"
schema:
dat
e
Published"
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 @@
}
}
},
dat
a
Published
:
{
'
schema:
dat
e
Published
'
:
{
date_histogram
:
{
field
:
"
dat
a
Published
"
,
field
:
"
schema:
dat
e
Published
"
,
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 @@
}
}
},
dat
a
Published
:
{
'
schema:
dat
e
Published
'
:
{
date_histogram
:
{
field
:
"
dat
a
Published
"
,
field
:
"
schema:
dat
e
Published
"
,
format
:
"
MM-yyyy
"
,
interval
:
"
month
"
}
...
...
demo/elements/entities-chart/entities-chart.html
View file @
8bc6b6c3
...
...
@@ -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
}})
}
});
...
...
demo/elements/google-chart-elasticsearch/google-chart.html
View file @
8bc6b6c3
...
...
@@ -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
==
'
dat
a
Published
'
){
if
(
field
==
'
dat
e
Published
'
){
term1
[
field
]
=
param
.
toLowerCase
().
split
(
"
-
"
);
}
console
.
log
(
term1
)
var
object
=
{
terms
:
term1
}
if
(
field
==
'
dat
a
Published
'
){
if
(
field
==
'
schema:
dat
e
Published
'
){
var
date
=
param
.
toLowerCase
().
toString
().
split
(
"
-
"
);
var
term
=
date
[
1
]
+
'
-
'
+
date
[
0
]
+
'
-01
'
object
=
{
range
:
{
dat
a
Published
:
{
gte
:
term
,
boost
:
5
}}}
object
=
{
range
:
{
'
schema:
dat
e
Published
'
:
{
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
==
"
dat
a
Published
"
)
{
if
(
this
.
field
==
"
schema:
dat
e
Published
"
)
{
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
'
;
...
...
demo/elements/news-chart/news-chart.html
View file @
8bc6b6c3
...
...
@@ -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)
...
...
demo/elements/news-chart/tweet-chart.css
View file @
8bc6b6c3
...
...
@@ -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
View replaced file @
f986360b
View file @
8bc6b6c3
24.1 KB
|
W:
|
H:
83 KB
|
W:
|
H:
2-up
Swipe
Onion skin
demo/images/times.png
View replaced file @
f986360b
View file @
8bc6b6c3
25.6 KB
|
W:
|
H:
57.4 KB
|
W:
|
H:
2-up
Swipe
Onion skin
demo/index.html
View file @
8bc6b6c3
...
...
@@ -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>
...
...
docker-compose.yml
View file @
8bc6b6c3
...
...
@@ -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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment