Commit 14ce4cff authored by delanoe's avatar delanoe

Merge branch 'romain-refactoring-navbar' into refactoring

parents eb15d263 71f3526f
......@@ -27,6 +27,7 @@ def ngramtable(request, project_id, corpus_id):
request = request,
context = {
'debug': settings.DEBUG,
'user': request.user,
'date': datetime.now(),
'project': project,
'corpus' : corpus,
......
.dc-chart {
div.dc-chart {
float: left;
}
.dc-chart rect.bar {
stroke: none;
fill: steelblue;
cursor: pointer;
}
.dc-chart rect.bar:hover {
......@@ -26,29 +26,24 @@
fill: #ccc;
}
.dc-chart .sub .bar {
stroke: none;
fill: #ccc;
}
.dc-chart .pie-slice {
fill: white;
font-size: 12px;
cursor: pointer;
}
.dc-chart .pie-slice :hover{
.dc-chart .pie-slice :hover {
fill-opacity: .8;
}
.dc-chart .selected path{
.dc-chart .selected path {
stroke-width: 3;
stroke: #ccc;
fill-opacity: 1;
}
.dc-chart .deselected path{
strok: none;
.dc-chart .deselected path {
stroke: none;
fill-opacity: .5;
fill: #ccc;
}
......@@ -63,6 +58,13 @@
font: 10px sans-serif;
}
.dc-chart .grid-line {
fill: none;
stroke: #ccc;
opacity: .5;
shape-rendering: crispEdges;
}
.dc-chart .grid-line line {
fill: none;
stroke: #ccc;
......@@ -86,56 +88,30 @@
.dc-chart path.line {
fill: none;
stroke: steelblue;
stroke-width: 1.5px;
}
.dc-chart circle.dot{
fill: steelblue;
}
.dc-chart g.stack1 path.line {
stroke: green;
}
.dc-chart g.stack1 circle.dot{
fill: green;
}
.dc-chart g.stack2 path.line {
stroke: red;
}
.dc-chart g.stack2 circle.dot{
fill: red;
.dc-chart circle.dot {
stroke: none;
}
.dc-chart g.dc-tooltip path{
.dc-chart g.dc-tooltip path {
fill: none;
stroke: grey;
stroke-opacity: .8;
}
.dc-chart path.area {
fill: steelblue;
fill-opacity: .3;
stroke: none;
}
.dc-chart g.stack1 path.area {
fill: green;
}
.dc-chart g.stack2 path.area {
fill: red;
}
.dc-chart .node {
font-size: 0.7em;
cursor: pointer;
}
.dc-chart .node :hover{
.dc-chart .node :hover {
fill-opacity: .8;
}
......@@ -146,7 +122,7 @@
}
.dc-chart .deselected circle {
strok: none;
stroke: none;
fill-opacity: .5;
fill: #ccc;
}
......@@ -172,13 +148,14 @@
font-weight: bold;
}
.dc-data-table {}
.dc-data-table {
}
.dc-chart g.state{
.dc-chart g.state {
cursor: pointer;
}
.dc-chart g.state :hover{
.dc-chart g.state :hover {
fill-opacity: .8;
}
......@@ -205,7 +182,7 @@
fill: none;
}
.dc-chart g.debug rect{
.dc-chart g.debug rect {
fill: blue;
fill-opacity: .2;
}
......@@ -222,4 +199,48 @@
.dc-chart g.row text {
fill: white;
font-size: 12px;
cursor: pointer;
}
.dc-legend {
font-size: 11px;
}
.dc-legend-item {
cursor: pointer;
}
.dc-chart g.axis text {
/* Makes it so the user can't accidentally click and select text that is meant as a label only */
-webkit-user-select: none; /* Chrome/Safari */
-moz-user-select: none; /* Firefox */
-ms-user-select: none; /* IE10 */
-o-user-select: none;
user-select: none;
pointer-events: none;
}
.dc-chart path.highlight {
stroke-width: 3;
fill-opacity: 1;
stroke-opacity: 1;
}
.dc-chart .highlight {
fill-opacity: 1;
stroke-opacity: 1;
}
.dc-chart .fadeout {
fill-opacity: 0.2;
stroke-opacity: 0.2;
}
.dc-chart path.dc-symbol {
fill-opacity: 0.5;
stroke-opacity: 0.5;
}
.dc-hard .number-display {
float: none;
}
/* styles for menu.html template (navbar etc) */
#dafixedtop .navbar-text {
margin: 0 ;
padding-top: 15px;
padding-bottom: 15px;
}
#corporatop.nav-tabs > li > a {
line-height: .85;
}
......@@ -9,7 +9,8 @@
* Date: Tue Jan 02 2014
*/
th {
background: #bd2525;
/*background: #bd2525;*/
background: #065E9C;
}
th a {
color: #fff;
......@@ -58,7 +59,7 @@ th a:hover {
}
.dynatable-active-page {
background: #bd2525;
background: #065E9C;
border-radius: 5px;
color: #fff;
}
......
This diff is collapsed.
This diff is collapsed.
......@@ -86,8 +86,6 @@ function Final_UpdateTable( action ) {
if ( ! UpdateTable ) return false; //stop whatever you wanted to do.
var TimeRange = AjaxRecords;
var dataini = TheBuffer[0];
......@@ -128,10 +126,7 @@ function Final_UpdateTable( action ) {
}
// STEP 01:
// Get all the duplicates using the Django-Garg API
var current_docs = {}
var BIS_dict = {}
// remember url elements
var id_from_url = function(name) {
var regex = new RegExp(name + '/(\\d+)');
......@@ -143,8 +138,6 @@ var corpus_id = id_from_url('corpora');
// STEP 02:
// D3.js: Interactive timerange.
var moveChart = dc.compositeChart("#monthly-move-chart");
......@@ -285,7 +278,6 @@ function Main_test(Data) {
div_table += "\t"+"\t"+'<th data-dynatable-column="del" data-dynatable-no-sort="true">'+"\n"
div_table += "\t"+"\t"+'<span class="glyphicon glyphicon-trash" aria-hidden="true"></span>'+"\n"
div_table += "\t"+"\t"+'</th>'+"\n"
div_table += "\t"+"\t"+'</th>'+"\n"
div_table += "\t"+'</thead>'+"\n"
div_table += "\t"+'<tbody>'+"\n"
div_table += "\t"+'</tbody>'+"\n"
......@@ -316,10 +308,10 @@ function Main_test(Data) {
$.each(Data, function(i, node) {
if (node.date) {
arrayd3.push({
date: get_node_date(node),
dd: node.date,
// date: get_node_date(node),
// dd: node.date,
month: d3.time.month(node.date),
volume: justdates[date],
dailyvolume: justdates[date],
});
}
});
......@@ -338,33 +330,36 @@ function Main_test(Data) {
return d.month;
});
console.warn(moveMonths)
//moveChart:(3)
var monthlyMoveGroup = moveMonths.group().reduceSum(function (d) {
return d.volume;
return d.dailyvolume;
//return Math.abs(+d.close - +d.open);
});
//volumeChart:(2)
var volumeByMonthGroup = moveMonths.group().reduceSum(function (d) {
return d.volume / 500000;
return d.dailyvolume / 500000;
});
//moveChart:(2)
//moveChart:(2) (cf. https://dc-js.github.io/dc.js/docs/stock.html#section-14)
var indexAvgByMonthGroup = moveMonths.group().reduce(
function (p, v) {
++p.days;
p.total += (+v.open + +v.close) / 2;
p.avg = Math.round(p.total / p.days);
// console.log("dc:dimension:reduce:filter_add")
++p.nb;
p.total += v.dailyvolume
return p;
},
function (p, v) {
--p.days;
p.total -= (+v.open + +v.close) / 2;
p.avg = p.days == 0 ? 0 : Math.round(p.total / p.days);
// console.log("dc:dimension:reduce:filter_remove")
--p.nb;
p.total -= v.dailyvolume
return p;
},
function () {
return {days: 0, total: 0, avg: 0};
// console.log("dc:dimension:reduce:init")
return {total: 0, nb: 0};
}
);
......@@ -376,7 +371,7 @@ function Main_test(Data) {
.dimension(moveMonths)
.group(indexAvgByMonthGroup)
.valueAccessor(function (d) {
return d.value.avg;
return d.value.total;
})
.x(d3.time.scale().domain([t0, t1]))
.round(d3.time.month.round)
......@@ -387,17 +382,21 @@ function Main_test(Data) {
.compose([
dc.lineChart(moveChart)
.group(indexAvgByMonthGroup)
// here d are already data grouped by month
.valueAccessor(function (d) {
return d.value.avg;
// console.log(d)
return d.value.total;
})
.renderArea(true)
// orange
.stack(monthlyMoveGroup, function (d) {
// console.log(d)
return d.value;
})
.title(function (d) {
var value = d.value.avg ? d.value.avg : d.value;
var value = d.data.value.total ? d.data.value.total : d.data.value;
if (isNaN(value)) value = 0;
return dateFormat(d.key) + "\n" + numberFormat(value);
return dateFormat(d.data.key) + "\n" + numberFormat(value);
})
])
.xAxis();
......
......@@ -407,7 +407,7 @@ function Main_test( data , initial) {
// .renderDataPoints({radius: 2, fillOpacity: 0.8, strokeOpacity: 0.8})
.brushOn(false)
.title(function (d) {
var value = d.value.avg ? d.value.avg : d.value;
var value = d.data.value.avg ? d.data.value.avg : d.data.value;
if (isNaN(value)) value = 0;
return value+" journals with "+Number(d.key)+" publications";
})
......
......@@ -1645,7 +1645,7 @@ function MainTableAndCharts( data , initial , search_filter) {
// .renderDataPoints({radius: 2, fillOpacity: 0.8, strokeOpacity: 0.8})
.brushOn(false)
.title(function (d) {
var value = d.value.avg ? d.value.avg : d.value;
var value = d.data.value.avg ? d.data.value.avg : d.data.value;
if (isNaN(value)) value = 0;
return value+" ngrams with "+FirstScore+"="+Number(d.key);
})
......
......@@ -32,11 +32,11 @@
<div class="clearfix"></div>
</center>
</div>
<div class="row">
<div id="monthly-volume-chart"></div>
</div>
<div id="content_loader">
<br>
<center>
......@@ -77,15 +77,13 @@
</div> <!-- /row with the dynatable panels -->
</div> <!-- /jumbotron -->
<!--
</div> Alignment
<!--
</div> Alignment
</div> (these divs are closed by the menu)
/container -->
<script type="text/javascript" src="{% static "js/jquery/jquery.min.js" %}"></script>
<script src="{% static "js/bootstrap/bootstrap.min.js" %}"></script>
<script type="text/javascript" src="{% static "js/jquery/jquery.dynatable.js" %}"></script>
<!-- custom-lib for dynatable.js and dc.js -->
......
{% extends "pages/menu.html" %}
{% block css %}
{% load staticfiles %}
<link rel="stylesheet" type="text/css" href="{% static "css/bootstrap.css" %}">
{% block css %}
<link rel="stylesheet" type="text/css" href="{% static "css/d3/dc.css"%}"/>
<link rel="stylesheet" type="text/css" href="{% static "css/jquery/jquery.dynatable.css"%}"/>
<link rel="stylesheet" type="text/css" href="{% static "css/gargantext/tables.css"%}"/>
......@@ -11,7 +9,6 @@
<script type="text/javascript" src="{% static "js/d3/d3.js"%}"></script>
<script type="text/javascript" src="{% static "js/d3/crossfilter.js"%}"></script>
<script type="text/javascript" src="{% static "js/d3/dc.js"%}"></script>
{% endblock %}
......@@ -28,11 +25,11 @@
<div class="clearfix"></div>
</center>
</div>
<div class="row">
<div id="monthly-volume-chart"></div>
</div>
<div id="content_loader">
<br>
<center>
......@@ -104,7 +101,7 @@
<button id="ImportList" onclick="GetUserPortfolio();" class="btn btn-warning">
Import a Corpus-List
</button>
</div> container
</div> container
--!>
......@@ -115,11 +112,9 @@
-->
<script type="text/javascript" src="{% static "js/jquery/jquery.min.js" %}"></script>
<script type="text/javascript" src="{% static "js/bootstrap/bootstrap.min.js" %}"></script>
<script type="text/javascript" src="{% static "js/jquery/jquery.dynatable.js" %}"></script>
<!-- custom-lib for dynatable.js and dc.js -->
<script type="text/javascript" src="{% static "js/gargantext/NGrams_dyna_chart_and_table.js" %}"></script>
{% endblock %}
{% extends "pages/menu.html" %}
{% block css %}
{% load staticfiles %}
<link rel="stylesheet" type="text/css" href="{% static "css/bootstrap.css" %}">
{% block css %}
<link rel="stylesheet" type="text/css" href="{% static "css/d3/dc.css"%}"/>
<link rel="stylesheet" type="text/css" href="{% static "css/jquery/jquery.dynatable.css"%}"/>
......@@ -98,8 +96,6 @@
</div>
</div>
<script type="text/javascript" src="{% static "js/jquery/jquery.min.js" %}"></script>
<script src="{% static "js/bootstrap/bootstrap.min.js" %}"></script>
<!-- here goes import script js/bootstrap/bootstrap-multiselect.js, mais ca marche pas-->
<script type="text/javascript" src="{% static "js/jquery/jquery.dynatable.js" %}"></script>
......
{% extends "pages/menu.html" %}
{% load staticfiles %}
{% block css %}
{% load staticfiles %}
<link rel="stylesheet" href="{% static "css/bootstrap.css" %}" />
<script src="{% static "js/jquery/jquery.min.js" %}" type="text/javascript"></script>
......
{% extends "pages/menu.html" %}
{% load staticfiles %}
{% block css %}
{% load staticfiles %}
<link rel="stylesheet" href="{% static "css/bootstrap.css" %}">
<script src="{% static "js/jquery/jquery.min.js" %}" type="text/javascript"></script>
......
This diff is collapsed.
Markdown is supported
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