Commit 9d00f536 authored by delanoe's avatar delanoe

Merge branch 'samuel' into merge

parents 13816c28 568a9432
This diff is collapsed.
......@@ -24,9 +24,15 @@ var latest,oldest;
var TheBuffer = false
function Push2Buffer( NewVal ) {
console.log( " = = = = = = = = " )
console.log( "Push2Buffer()" )
console.log( "\t"+NewVal )
if ( TheBuffer == false) {
if( ! NewVal ) {
var limits = [ new Date( oldest[0],oldest[1],oldest[2] ) , new Date( latest[0],latest[1],latest[2] ) ];
// var limits = [ new Date( oldest[0],oldest[1],oldest[2] ) , new Date( latest[0],latest[1],latest[2] ) ];
var limits = [new Date(oldest[0],oldest[1]-1,oldest[2]), new Date(latest[0],latest[1]-1,latest[2] ) ];
limits[0] = new Date(limits[0].setDate(limits[0].getDate()-1) );
limits[1] = new Date(limits[1].setDate(limits[1].getDate()+1) );
NewVal = limits;
}
console.log( " - - - - - - " )
......@@ -42,7 +48,9 @@ function Push2Buffer( NewVal ) {
var past = TheBuffer[0]+"_"+TheBuffer[1]
if( ! NewVal ) {
var limits = [ new Date( oldest[0],oldest[1],oldest[2] ) , new Date( latest[0],latest[1],latest[2] ) ];
var limits = [new Date(oldest[0],oldest[1]-1,oldest[2]), new Date(latest[0],latest[1]-1,latest[2] ) ];
limits[0] = new Date(limits[0].setDate(limits[0].getDate()-1) );
limits[1] = new Date(limits[1].setDate(limits[1].getDate()+1) );
NewVal = limits;
}
var now = NewVal[0]+"_"+NewVal[1]
......@@ -295,8 +303,9 @@ function Main_test( Data , SearchFilter ) {
oldest = t0;
latest = t1;
TheBuffer = [new Date(t0[0],(t0[1]-1),t0[2]), new Date(t1[0],(t1[1]-1),t1[2]+1)];
TheBuffer = [new Date(t0[0],t0[1]-1,t0[2]), new Date(t1[0],t1[1]-1,t1[2] ) ];
TheBuffer[0] = new Date(TheBuffer[0].setDate(TheBuffer[0].getDate()-1) );
TheBuffer[1] = new Date(TheBuffer[1].setDate(TheBuffer[1].getDate()+1) );
var arrayd3 = []
for(var e in Data) {
......@@ -397,7 +406,7 @@ function Main_test( Data , SearchFilter ) {
.group(volumeByMonthGroup)
.centerBar(true)
.gap(0)
.x(d3.time.scale().domain([new Date(t0[0],t0[1],t0[2]), new Date(t1[0],t1[1],t1[2])]))
.x(d3.time.scale().domain([TheBuffer[0], TheBuffer[1] ]))
.round(d3.time.month.round)
.xUnits(d3.time.months)
.renderlet(function (chart) {
......
......@@ -24,28 +24,24 @@ var latest,oldest;
var TheBuffer = false
var PossibleActions = []
var PossibleActions = [
{
"id":"to_delete",
"name": "Delete",
"color":"red"
},
// {
// "id":"to_keep",
// "name": "Keep",
// "color":"green"
// },
// {
// "id":"to_group",
// "name": "Group",
// "color":"blue"
// }
]
var action1 = {
"id":"to_delete",
"name": "Delete",
"color":"red"
}
// var action2 = {
// "id":"to_keep",
// "name": "Keep",
// "color":"green"
// }
// var action3 = {
// "id":"to_group",
// "name": "Group",
// "color":"blue"
// }
PossibleActions.push(action1)
// PossibleActions.push(action2)
// PossibleActions.push(action3)
var FlagsBuffer = {}
for(var i in PossibleActions) {
......
......@@ -95,22 +95,53 @@
<div class="col-md-6">
<div class="jumbotron">
{% if processing > 0 %}
<h3> <img width="20px" src="{% static "js/libs/img2/loading-bar.gif" %}"></img> Graph (later)</h3>
{% if processing > 0 %}
<h3> <img width="20px" src="{% static "js/libs/img2/loading-bar.gif" %}"></img> Networks (later)</h3>
<ol>
<li>Terms</li>
<li>Journals and Terms</li>
<li>Authors and Terms</li>
</ol>
{% else %}
<h3><a href="/project/{{project.id}}/corpus/{{ corpus.id }}/explorer">Graph</a></h3>
{% endif %}
<h3> Networks </h3>
<ol>
<li>Visualize</li>
<li>Explore</li>
<li>Read</li>
<li data-url="/project/{{project.id}}/corpus/{{ corpus.id }}/explorer?field1=ngrams&amp;field2=ngrams" onclick='gotoexplorer(this)'><a>Terms</a></li>
<li data-url="/project/{{project.id}}/corpus/{{ corpus.id }}/explorer?field1=journal&amp;field2=ngrams" onclick='gotoexplorer(this)'><a>Journals and Terms</a></li>
<li>Authors and Terms</li>
</ol>
{% endif %}
<h4><a href="/project/{{project.id}}/corpus/{{corpus.id}}/">Back to corpus</a></h3>
</div>
</div>
</div>
</div>
<script type="text/javascript">
function gotoexplorer(elem) {
var url_ = $(elem).data("url")
if (TheBuffer==false)
return window.open(url_,'_blank');
var current_timerange = TheBuffer
var time_limits = [new Date(oldest[0],oldest[1]-1,oldest[2]), new Date(latest[0],latest[1]-1,latest[2] ) ];
time_limits[0] = new Date(time_limits[0].setDate(time_limits[0].getDate()-1) );
time_limits[1] = new Date(time_limits[1].setDate(time_limits[1].getDate()+1) );
if( ( +current_timerange[0]===+time_limits[0] ) && ( +current_timerange[1]===+time_limits[1] ) ) {
url_ = url_ // rien
} else {
var start__ = new Date(current_timerange[0].setDate(current_timerange[0].getDate()+1) );
var end__ = new Date(current_timerange[1].setDate(current_timerange[1].getDate()-1) );
var start_ = start__.getFullYear()+"-"+(start__.getMonth()+1)+"-"+(start__.getDay()+1)
var end_ = end__.getFullYear()+"-"+(end__.getMonth()+1)+"-"+(end__.getDay()+1)
url_ += "&start=" + start_ + "&end="+end_;
// url_ += "&start=" + start__.getFullYear() + "&end="+end__.getFullYear();
}
return window.open(url_,'_blank');
}
</script>
{% endblock %}
......
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