2016-08-11 09:34:22 +00:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html>
|
|
|
|
|
|
|
|
<head>
|
|
|
|
<meta charset="utf-8">
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
|
|
|
|
|
|
<title>Analysis Information Leak framework Dashboard</title>
|
|
|
|
|
|
|
|
<!-- Core CSS -->
|
|
|
|
<link href="{{ url_for('static', filename='css/bootstrap.min.css') }}" rel="stylesheet">
|
|
|
|
<link href="{{ url_for('static', filename='font-awesome/css/font-awesome.css') }}" rel="stylesheet">
|
|
|
|
<link href="{{ url_for('static', filename='css/sb-admin-2.css') }}" rel="stylesheet">
|
|
|
|
<link href="{{ url_for('static', filename='css/dataTables.bootstrap.css') }}" rel="stylesheet" type="text/css" />
|
2016-08-11 19:08:43 +00:00
|
|
|
<link href="{{ url_for('static', filename='css/jquery-ui.min.css') }}" rel="stylesheet" type="text/css" />
|
2016-08-11 09:34:22 +00:00
|
|
|
<script language="javascript" src="{{ url_for('static', filename='js/jquery.js')}}"></script>
|
|
|
|
<script src="{{ url_for('static', filename='js/bootstrap.min.js') }}"></script>
|
|
|
|
<script src="{{ url_for('static', filename='js/jquery.dataTables.min.js') }}"></script>
|
|
|
|
<script src="{{ url_for('static', filename='js/dataTables.bootstrap.js') }}"></script>
|
2016-08-11 19:08:43 +00:00
|
|
|
<script src="{{ url_for('static', filename='js/jquery-ui.min.js') }}"></script>
|
|
|
|
<script src="{{ url_for('static', filename='js/jquery.flot.js') }}"></script>
|
2016-08-11 09:34:22 +00:00
|
|
|
|
2016-08-11 19:08:43 +00:00
|
|
|
<style>
|
|
|
|
.sparkLineStats ul {
|
|
|
|
padding-left:0;
|
|
|
|
list-style:none
|
|
|
|
}
|
|
|
|
</style>
|
2016-08-11 09:34:22 +00:00
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
|
2016-08-11 15:22:50 +00:00
|
|
|
<div id="wrapper">
|
2016-08-11 09:34:22 +00:00
|
|
|
<nav class="navbar navbar-default navbar-static-top" role="navigation" style="margin-bottom: 0">
|
|
|
|
{% include 'header.html' %}
|
|
|
|
<!-- /.navbar-top-links -->
|
|
|
|
<div class="navbar-default sidebar" role="navigation">
|
|
|
|
<div class="sidebar-collapse">
|
|
|
|
<ul class="nav" id="side-menu">
|
|
|
|
<li class="sidebar-search">
|
|
|
|
{% include 'searchbox.html' %}
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
<!-- /#side-menu -->
|
|
|
|
</div>
|
|
|
|
<!-- /.sidebar-collapse -->
|
|
|
|
<a href="{{ url_for('index') }}"><img src="{{ url_for('static', filename='image/AIL.png') }}" /></a>
|
|
|
|
</div>
|
|
|
|
<!-- /.navbar-static-side -->
|
|
|
|
</nav>
|
2016-08-11 15:22:50 +00:00
|
|
|
</div>
|
2016-08-11 09:34:22 +00:00
|
|
|
|
|
|
|
<div id="page-wrapper">
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-lg-12">
|
|
|
|
<h1 class="page-header" data-page="page-sentiment" >Sentiment analysis: Plot tool</h1>
|
|
|
|
</div>
|
|
|
|
<!-- /.col-lg-12 -->
|
|
|
|
</div>
|
|
|
|
<!-- /.row -->
|
|
|
|
<div class="row">
|
|
|
|
|
2016-08-11 19:08:43 +00:00
|
|
|
<!-- Panel OPTIONS -->
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-lg-12">
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-lg-12">
|
|
|
|
<div id="panel-today" class="panel panel-default">
|
|
|
|
<div class="panel-heading">
|
|
|
|
<strong>Select options</strong>
|
|
|
|
</div>
|
|
|
|
<div class="panel-body">
|
|
|
|
<div class="row">
|
|
|
|
<!-- left column -->
|
|
|
|
<div class="col-lg-9">
|
|
|
|
<!-- providers charts -->
|
|
|
|
<div class="col-lg-6">
|
|
|
|
<div class="sparkLineStats">
|
2016-08-15 13:16:31 +00:00
|
|
|
<ul id="providerList1">
|
2016-08-11 19:08:43 +00:00
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="col-lg-6">
|
|
|
|
<div class="sparkLineStats">
|
2016-08-15 13:16:31 +00:00
|
|
|
<ul id="providerList2">
|
2016-08-11 19:08:43 +00:00
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<!-- right column -->
|
|
|
|
<div class="col-lg-3">
|
|
|
|
<div aria-disabled="false" class="slider sliderRange sliderBlue ui-slider ui-slider-horizontal ui-widget ui-widget-content ui-corner-all" style="margin-bottom: 5px;"></div>
|
2016-08-15 12:53:46 +00:00
|
|
|
<strong>Date:</strong> <input type="text" id="amount" readonly style="border:0; color:#f6931f; font-weight:bold;">
|
2016-08-11 19:08:43 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<!-- /.row -->
|
|
|
|
<div class="row">
|
2016-08-15 13:54:53 +00:00
|
|
|
<button id="plot_btn" class="btn btn-info" style="margin-right: 8px; float: right;">Plot!</button>
|
2016-08-11 19:08:43 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<!-- /.panel-body -->
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<!-- /.panel -->
|
|
|
|
</div>
|
|
|
|
<!-- /.panel -->
|
|
|
|
</div>
|
|
|
|
</div>
|
2016-08-11 09:34:22 +00:00
|
|
|
|
2016-08-11 19:08:43 +00:00
|
|
|
<!-- Panel PLOT -->
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-lg-12">
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-lg-12">
|
|
|
|
<div id="panel-today" class="panel panel-default">
|
|
|
|
<div class="panel-heading">
|
|
|
|
<strong>Graph</strong>
|
|
|
|
</div>
|
|
|
|
<div class="panel-body">
|
|
|
|
<div id="graph" style="height: 300px;"></div>
|
|
|
|
</div>
|
|
|
|
<!-- /.panel-body -->
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<!-- /.panel -->
|
|
|
|
</div>
|
|
|
|
<!-- /.panel -->
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
2016-08-11 09:34:22 +00:00
|
|
|
<!-- /.row -->
|
2016-08-11 15:22:50 +00:00
|
|
|
</div>
|
2016-08-11 09:34:22 +00:00
|
|
|
<!-- /#page-wrapper -->
|
2016-08-11 15:22:50 +00:00
|
|
|
</div>
|
|
|
|
|
2016-08-11 09:34:22 +00:00
|
|
|
|
|
|
|
<!-- import graph function -->
|
|
|
|
<script>
|
|
|
|
$(document).ready(function(){
|
|
|
|
activePage = $('h1.page-header').attr('data-page');
|
|
|
|
$("#"+activePage).addClass("active");
|
2016-08-15 13:54:53 +00:00
|
|
|
var li_text = "<li><div class='checkbox'></div><label class='provider'><input value='"
|
|
|
|
var li_text_mid = "' type='checkbox'></input> "
|
2016-08-15 13:16:31 +00:00
|
|
|
var li_text_end = "</label></li>"
|
|
|
|
|
|
|
|
$.getJSON('/sentiment_analysis_plot_tool_getdata/?getProviders=True', function(data){
|
|
|
|
for(i=0; i<data.length; i++){
|
|
|
|
var providerList = i%2 == 0 ? '#providerList1' : '#providerList2';
|
2016-08-15 13:54:53 +00:00
|
|
|
$(providerList).append(li_text + data[i] + li_text_mid + data[i] + li_text_end);
|
2016-08-15 13:16:31 +00:00
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2016-08-11 09:34:22 +00:00
|
|
|
|
2016-08-15 12:53:46 +00:00
|
|
|
var today = Date.now();
|
|
|
|
var old_day = today - (31*24*60*60)*1000;
|
|
|
|
$( ".sliderRange" ).slider({
|
|
|
|
range: true,
|
|
|
|
min: old_day,
|
|
|
|
max: today,
|
|
|
|
values: [ today - (7*24*60*60)*1000, today ],
|
|
|
|
step: 24*60*60*1000,
|
|
|
|
slide: function( event, ui ) {
|
|
|
|
$( "#amount" ).val( new Date(ui.values[ 0 ]).toLocaleDateString() + " - " + new Date(ui.values[ 1 ]).toLocaleDateString() );
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
$( "#amount" ).val( new Date($( ".sliderRange" ).slider( "values", 0 )).toLocaleDateString() +
|
|
|
|
" - " + new Date($( ".sliderRange" ).slider( "values", 1 )).toLocaleDateString() );
|
|
|
|
|
2016-08-15 13:54:53 +00:00
|
|
|
|
|
|
|
$('#plot_btn').click(plotData);
|
|
|
|
|
|
|
|
|
|
|
|
function plotData(){
|
|
|
|
var query = $( "input:checked" ).map(function () {return this.value;}).get().join(",");
|
|
|
|
var Qdate = 2;
|
|
|
|
|
|
|
|
$.getJSON('/sentiment_analysis_plot_tool_getdata/?getProviders=False&query='+query+'&Qdate='+Qdate, function(data){
|
|
|
|
console.log(data);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-08-15 12:53:46 +00:00
|
|
|
function randNum(){
|
|
|
|
return ((Math.floor( Math.random()* (1+40-20) ) ) + 20)* 1200;
|
|
|
|
}
|
2016-08-11 19:08:43 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var likes = [[1, 5+randNum()], [2, 10+randNum()], [3, 15+randNum()], [4, 20+randNum()],[5, 25+randNum()],[6, 30+randNum()],[7, 35+randNum()],[8, 40+randNum()],[9, 45+randNum()],[10, 50+randNum()],[11, 55+randNum()],[12, 60+randNum()],[13, 65+randNum()],[14, 70+randNum()],[15, 75+randNum()],[16, 80+randNum()],[17, 85+randNum()],[18, 90+randNum()],[19, 85+randNum()],[20, 80+randNum()],[21, 75+randNum()],[22, 80+randNum()],[23, 75+randNum()],[24, 70+randNum()],[25, 65+randNum()],[26, 75+randNum()],[27,80+randNum()],[28, 85+randNum()],[29, 90+randNum()], [30, 95+randNum()]];
|
2016-08-15 13:54:53 +00:00
|
|
|
var likes2 = [[1, 5+randNum()], [2, 10+randNum()], [3, 15+randNum()], [4, 20+randNum()],[5, 25+randNum()],[6, 30+randNum()],[7, 35+randNum()],[8, 40+randNum()],[9, 45+randNum()],[10, 50+randNum()],[11, 55+randNum()],[12, 60+randNum()],[13, 65+randNum()],[14, 70+randNum()],[15, 75+randNum()],[16, 80+randNum()],[17, 85+randNum()],[18, 90+randNum()],[19, 85+randNum()],[20, 80+randNum()],[21, 75+randNum()],[22, 80+randNum()],[23, 75+randNum()],[24, 70+randNum()],[25, 65+randNum()],[26, 75+randNum()],[27,80+randNum()],[28, 85+randNum()],[29, 90+randNum()], [30, 95+randNum()]];
|
2016-08-11 19:08:43 +00:00
|
|
|
|
|
|
|
var plot = $.plot($("#graph"),
|
2016-08-15 13:54:53 +00:00
|
|
|
[ { data: likes, label: "Fans"}, { data: likes2, label: "Fans"} ], {
|
2016-08-11 19:08:43 +00:00
|
|
|
series: {
|
|
|
|
lines: { show: true,
|
|
|
|
lineWidth: 2,
|
|
|
|
fill: true, fillColor: { colors: [ { opacity: 0.5 }, { opacity: 0.2 } ] }
|
|
|
|
},
|
|
|
|
points: { show: true,
|
|
|
|
lineWidth: 2
|
|
|
|
},
|
|
|
|
shadowSize: 0
|
|
|
|
},
|
|
|
|
grid: { hoverable: true,
|
|
|
|
clickable: true,
|
|
|
|
tickColor: "#f9f9f9",
|
|
|
|
borderWidth: 0
|
|
|
|
},
|
|
|
|
colors: ["#3B5998"],
|
|
|
|
xaxis: {ticks:6, tickDecimals: 0},
|
|
|
|
yaxis: {ticks:3, tickDecimals: 0},
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-08-11 09:34:22 +00:00
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
|
|
</body>
|
|
|
|
</html>
|