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
b0d38ada
Commit
b0d38ada
authored
Sep 27, 2017
by
militarpancho
Browse files
Some changes in requests and environ variables
parent
df961e83
Changes
5
Hide whitespace changes
Inline
Side-by-side
.gitignore
View file @
b0d38ada
...
...
@@ -11,4 +11,4 @@ elasticsearch
*.db
.*
/fuseki/*
dashboard-reddit.html
dashboard-reddit.env.html
0 → 100644
View file @
b0d38ada
<link
rel=
"import"
href=
"/bower_components/polymer/polymer.html"
>
<link
rel=
"import"
href=
"/bower_components/material-search/material-search.html"
>
<link
rel=
"import"
href=
"/bower_components/paper-material/paper-material.html"
>
<link
rel=
"import"
href=
"/bower_components/google-chart-elasticsearch/google-chart.html"
>
<link
rel=
"import"
href=
"/bower_components/paper-tabs/paper-tabs.html"
>
<link
rel=
"import"
href=
"/bower_components/paper-tabs/paper-tab.html"
>
<link
rel=
"import"
href=
"/bower_components/number-chart/number-chart.html"
>
<link
rel=
"import"
href=
"/bower_components/comment-chart/comment-chart.html"
>
<link
rel=
"import"
href=
"/bower_components/paper-tabs/paper-tabs.html"
>
<link
rel=
"import"
href=
"/bower_components/yasgui-polymer/yasgui.html"
>
<link
rel=
"import"
href=
"/bower_components/iron-pages/iron-pages.html"
>
<link
rel=
"import"
href=
"/bower_components/paper-item/paper-item.html"
>
<link
rel=
"import"
href=
"/bower_components/paper-menu/paper-menu.html"
>
<link
rel=
"import"
href=
"/elements/news-chart/news-chart.html"
>
<dom-module
id=
"dashboard-reddit"
>
<link
rel=
"import"
type=
"css"
href=
"dashboard-tourpedia.css"
type=
"css"
>
<link
rel=
"import"
href=
"/styles/app-theme.html"
type=
"css"
>
<template>
<iron-ajax
auto
url=
"queries.json"
handle-as=
"json"
last-response=
"{{queries}}"
></iron-ajax>
<paper-tabs
selected=
"{{selected}}"
>
<paper-tab>
Dashboard
</paper-tab>
<paper-tab>
Sparql Editor
</paper-tab>
</paper-tabs>
<iron-pages
selected=
"{{selected}}"
>
<div>
<material-search
search-value=
"{{query}}"
></material-search>
<br>
<div
style=
"width: 100%; display: inline-block"
>
<div
style=
"width: 32%; margin-right: 2%; float: left"
>
<number-chart
icon=
"info"
stylebg=
"bg-red"
data=
"{{data}}"
>
</number-chart>
</div>
<div
style=
"width: 32%; margin-right: 2%; float: left"
>
<number-chart
data=
"{{data}}"
object=
"cnn"
aggKey=
"creator"
title=
"CNN"
icon=
"icons:receipt"
stylebg=
"bg-yellow"
>
</number-chart>
</div>
<div
style=
"width: 32%; float: left"
>
<number-chart
data=
"{{data}}"
object=
"The New York Times"
aggKey=
"creator"
title=
"The New York Times"
icon=
"icons:receipt"
aggkey=
"location"
stylebg=
"bg-green"
>
</number-chart>
</div>
</div>
<div
style=
"width: 100%; display: inline-block"
>
<div
class=
"chart_container"
style=
"right: 0; float: right"
>
<google-chart
data=
"{{data}}"
field=
"about"
id=
'pie-chart4'
extra-id=
'pie-chart4'
type=
'pie'
filters=
"{{filters}}"
icon=
'icons:list'
param=
'{{param}}'
options=
'{"title": "Article Sections"}'
cols=
'[{"label": "articlesection", "type": "string"},{"label": "Count", "type": "number"}]'
</
google-chart
>
</div>
<div
class=
"chart_container"
style=
"left: 0; float: left"
>
<google-chart
field=
"creator"
data=
"{{data}}"
id=
'pie-chart3'
extra-id=
'pie-chart3'
type=
'pie'
filters=
"{{filters}}"
icon=
'icons:reorder'
options=
'{"title": "Newspapers"}'
cols=
'[{"label": "type", "type": "string"},{"label": "Count", "type": "number"}]'
</
google-chart
>
</div>
</div>
<div
style=
"width: 100%"
>
<div
class=
"chart_container"
style=
"left: 0; float: left"
>
<google-chart
field=
"sentiment"
data=
"{{data}}"
id=
'pie-chart5'
extra-id=
'pie-chart5'
type=
'pie'
filters=
"{{filters}}"
icon=
'social:mood'
options=
'{"title": "Sentiments"}'
cols=
'[{"label": "Sentiment", "type": "string"},{"label": "Count", "type": "number"}]'
</
google-chart
>
</div>
<div
class=
"chart_container"
style=
"left: 0; float: right"
>
<google-chart
field=
"emotion"
data=
"{{data}}"
id=
'pie-chart5'
extra-id=
'pie-chart5'
type=
'pie'
filters=
"{{filters}}"
icon=
'social:sentiment-very-dissatisfied'
options=
'{"title": "Emotions"}'
cols=
'[{"label": "Sentiment", "type": "string"},{"label": "Count", "type": "number"}]'
</
google-chart
>
</div>
</div>
<div
class=
"chart_container"
style=
"left: 0; float: left; width: 100%"
>
<news-chart
datos =
"{{data}}"
title=
"List of news"
filters=
"{{filters}}"
icon=
'icons:receipt'
>
</news-chart>
</div>
</div>
</div>
<div>
<yasgui-ui
endpoint=
"http://${FUSEKI_ENPOINT_DASHBOARD}/gsicrawler/query"
queries=
"{{queries}}"
>
</yasgui-ui>
</div>
</iron-pages>
</template>
<script>
var
ready
=
false
;
Polymer
({
is
:
'
dashboard-reddit
'
,
properties
:
{
selected
:
{
type
:
Number
,
value
:
0
},
ids
:{
type
:
Array
},
data
:{
type
:
Object
},
client
:
{
type
:
Object
,
notify
:
true
,
observer
:
'
_clientChanged
'
},
fields
:
{
type
:
Array
,
value
:
function
()
{
return
[];
}
},
filters
:
{
type
:
Array
,
notify
:
true
,
value
:
function
()
{
return
[];
}
}
},
observers
:
[
'
_filtersChange(filters.*)
'
],
ready
:
function
(){
console
.
log
(
"
ready
"
);
},
_clientChanged
:
function
()
{
console
.
log
(
"
ClientChanged
"
);
ready
=
true
;
this
.
_query
();
},
_filtersChange
:
function
()
{
this
.
_query
();
},
_query
:
function
()
{
console
.
log
(
"
_filtersChangedash
"
)
var
that
=
this
;
console
.
log
(
"
Ready?:
"
,
ready
);
if
(
ready
){
this
.
client
.
search
({
// undocumented params are appended to the query string
index
:
"
gsicrawler
"
,
body
:
{
size
:
10
,
query
:
{
bool
:
{
must
:
this
.
filters
,
}
},
aggs
:
{
type
:
{
terms
:
{
field
:
"
@type.keyword
"
,
order
:
{
_count
:
"
desc
"
}
}
},
creator
:
{
terms
:
{
field
:
"
creator.keyword
"
,
order
:
{
_count
:
"
desc
"
}
}
},
about
:
{
terms
:
{
field
:
"
about.keyword
"
,
order
:
{
_count
:
"
desc
"
}
}
},
sentiment
:
{
terms
:
{
field
:
"
sentiments.marl:hasPolarity.keyword
"
,
order
:
{
_count
:
"
desc
"
}
}
},
emotion
:
{
terms
:
{
field
:
"
emotions.onyx:hasEmotion.onyx:hasEmotionCategory.keyword
"
,
order
:
{
_count
:
"
desc
"
}
}
}
}
}
}).
then
(
function
(
resp
)
{
var
myids
=
[]
resp
.
hits
.
hits
.
forEach
(
function
(
entry
){
myids
.
push
(
entry
.
_id
)})
that
.
ids
=
myids
;
//console.log(that.ids)
that
.
data
=
resp
;
console
.
log
(
that
.
data
);
});
}
}
});
</script>
</dom-module>
dashboard-reddit.html
View file @
b0d38ada
...
...
@@ -136,7 +136,7 @@
</div>
<div>
<yasgui-ui
endpoint=
"http://
krusti.gsi:13030
/gsicrawler/query"
endpoint=
"http://
${FUSEKI_ENDPOINT_DASHBOARD}
/gsicrawler/query"
queries=
"{{queries}}"
>
</yasgui-ui>
</div>
...
...
docker-compose.yml
View file @
b0d38ada
...
...
@@ -70,4 +70,4 @@ networks:
driver
:
bridge
volumes
:
esdata
:
\ No newline at end of file
esdata
:
init.sh
View file @
b0d38ada
...
...
@@ -16,4 +16,5 @@ cd demo
bower
link
$APP_NAME
--allow-root
envsubst < /usr/src/app/demo/index.env.html
>
/usr/src/app/demo/index.html
||
exit
1
;
envsubst < /usr/src/app/dashboard-reddit.env.html
>
/usr/src/app/dasboard-reddit.html
||
exit
1
;
http-server
.
Write
Preview
Markdown
is supported
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