| author | Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com> |
| Mon, 25 Jul 2011 18:50:20 +0200 | |
| changeset 229 | 74c9ddc3640b |
| parent 202 | 2bf0fd3432bf |
| child 259 | bc17d1af15ab |
| permissions | -rwxr-xr-x |
|
133
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
1 |
/* |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
2 |
* |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
3 |
* Copyright 2010 Institut de recherche et d'innovation |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
4 |
* contributor(s) : Samuel Huron |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
5 |
* |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
6 |
* contact@iri.centrepompidou.fr |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
7 |
* http://www.iri.centrepompidou.fr |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
8 |
* |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
9 |
* This software is a computer program whose purpose is to show and add annotations on a video . |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
10 |
* This software is governed by the CeCILL-C license under French law and |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
11 |
* abiding by the rules of distribution of free software. You can use, |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
12 |
* modify and/ or redistribute the software under the terms of the CeCILL-C |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
13 |
* license as circulated by CEA, CNRS and INRIA at the following URL |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
14 |
* "http://www.cecill.info". |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
15 |
* |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
16 |
* The fact that you are presently reading this means that you have had |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
17 |
* knowledge of the CeCILL-C license and that you accept its terms. |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
18 |
*/ |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
19 |
// CHART TIMELINE / VERSION PROTOTYPE :: |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
20 |
|
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
21 |
|
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
22 |
var yMax = config.height; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
23 |
var PaperSlider; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
24 |
var heightOfChart; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
25 |
// Make and define the Raphael area |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
26 |
//var paper = Raphael(document.getElementById(config.target),config.width, config.height); |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
27 |
|
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
28 |
function ChartTimeLine (){ |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
29 |
|
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
30 |
// variable |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
31 |
// yMax |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
32 |
var yCoef = 2; // coef for height of 1 tweet |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
33 |
var frameSize = 5; // frame size |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
34 |
var margin = 1; // marge between frame |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
35 |
var lineSize = config.width; // timeline pixel width |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
36 |
var nbrframes = lineSize/frameSize; // frame numbers |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
37 |
var numberOfTweet = 0; // number of tweet overide later |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
38 |
var duration = config.duration; // timescale width |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
39 |
var frameLenght = lineSize/frameSize; // frame timescale |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
40 |
var timeline; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
41 |
var colors = new Array("","#1D973D","#C5A62D","#CE0A15","#036AAE","#585858"); |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
42 |
|
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
43 |
// array |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
44 |
var tweets = new Array(); |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
45 |
var element = new Array(); |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
46 |
var cluster = new Array(); |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
47 |
var frames = new Array(frameLenght); |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
48 |
var slices = new Array(); |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
49 |
|
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
50 |
|
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
51 |
// Classes ======================================================================= |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
52 |
var Frames = function(){ |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
53 |
|
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
54 |
var Myclusters; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
55 |
var x; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
56 |
var y; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
57 |
var width; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
58 |
var height; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
59 |
}; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
60 |
Frames = function(json){ |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
61 |
// make my clusters |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
62 |
// ou Frame vide |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
63 |
}; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
64 |
Frames.prototype.draw = function(){ |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
65 |
}; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
66 |
Frames.prototype.zoom = function(){ |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
67 |
}; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
68 |
Frames.prototype.inside = function(){ |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
69 |
}; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
70 |
var Clusters = function(){ |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
71 |
var Object; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
72 |
var yDist; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
73 |
var x; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
74 |
var y; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
75 |
var width; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
76 |
var height; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
77 |
}; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
78 |
Clusters = function(json){ |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
79 |
// make my object |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
80 |
}; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
81 |
var Tweet = function(){ |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
82 |
}; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
83 |
// Classes ======================================================================= |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
84 |
|
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
85 |
// trace function |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
86 |
var traceNum = 0; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
87 |
function trace(msg,value){ |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
88 |
traceNum += 1; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
89 |
__IriSP.jQuery("<div>"+traceNum+" - "+msg+" : "+value+"</div>").appendTo("#output"); |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
90 |
} |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
91 |
|
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
92 |
// Refactoring (parametere) ************************************************************ |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
93 |
// color translastion |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
94 |
function colorTranslation(value){ |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
95 |
if(value == "Q"){ |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
96 |
return 2; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
97 |
}else if(value =="REF"){ |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
98 |
return 4; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
99 |
}else if(value =="OK"){ |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
100 |
return 1; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
101 |
}else if(value =="KO"){ |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
102 |
return 3; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
103 |
}else if(value ==""){ |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
104 |
return 5; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
105 |
} |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
106 |
} |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
107 |
|
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
108 |
|
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
109 |
// Refactoring (parametere) ************************************************************ |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
110 |
// load tweets send in parameters |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
111 |
__IriSP.jQuery.ajax({ |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
112 |
dataType: "jsonp", |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
113 |
url:config.metadata, |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
114 |
success : function(json){ |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
115 |
trace("load",""); |
|
229
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
202
diff
changeset
|
116 |
// get current view (the first ???) |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
202
diff
changeset
|
117 |
view = json.views[0]; |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
202
diff
changeset
|
118 |
|
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
202
diff
changeset
|
119 |
// the tweets are by definition of the second annotation type |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
202
diff
changeset
|
120 |
tweet_annot_type = null; |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
202
diff
changeset
|
121 |
if(typeof(view.annotation_types) !== "undefined" && view.annotation_types.length > 1) { |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
202
diff
changeset
|
122 |
tweet_annot_type = view.annotation_types[1]; |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
202
diff
changeset
|
123 |
} |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
202
diff
changeset
|
124 |
|
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
202
diff
changeset
|
125 |
|
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
202
diff
changeset
|
126 |
__IriSP.jQuery.each(json.annotations, function(i,item) { |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
202
diff
changeset
|
127 |
|
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
202
diff
changeset
|
128 |
var MyTime = Math.floor(item.begin/duration*lineSize); |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
202
diff
changeset
|
129 |
var Myframe = Math.floor(MyTime/lineSize*frameLenght); |
|
133
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
130 |
|
|
229
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
202
diff
changeset
|
131 |
if (typeof(item.meta) !== "undefined" && typeof(item.meta["id-ref"]) !== "undefined" && item.meta["id-ref"] === tweet_annot_type) { |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
202
diff
changeset
|
132 |
if (item.content['polemics'] != undefined && item.content['polemics'][0] != null) { |
|
133
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
133 |
|
|
229
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
202
diff
changeset
|
134 |
for(var j=0; j<item.content['polemics'].length; j++){ |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
202
diff
changeset
|
135 |
|
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
202
diff
changeset
|
136 |
tweets[numberOfTweet] = { |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
202
diff
changeset
|
137 |
id:i, |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
202
diff
changeset
|
138 |
qualification:colorTranslation(item.content['polemics'][j]), |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
202
diff
changeset
|
139 |
yIndicator:MyTime, |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
202
diff
changeset
|
140 |
yframe:Myframe, |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
202
diff
changeset
|
141 |
title:item.content['title'], |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
202
diff
changeset
|
142 |
timeframe:item.begin |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
202
diff
changeset
|
143 |
}; |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
202
diff
changeset
|
144 |
numberOfTweet+=1; |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
202
diff
changeset
|
145 |
} |
|
133
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
146 |
} |
|
229
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
202
diff
changeset
|
147 |
else { |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
202
diff
changeset
|
148 |
//trace("k = ",i); |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
202
diff
changeset
|
149 |
tweets[numberOfTweet] = { |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
202
diff
changeset
|
150 |
id:i, |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
202
diff
changeset
|
151 |
qualification:colorTranslation(""), |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
202
diff
changeset
|
152 |
yIndicator:MyTime, |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
202
diff
changeset
|
153 |
yframe:Myframe, |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
202
diff
changeset
|
154 |
title:item.content['title'], |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
202
diff
changeset
|
155 |
timeframe:item.begin |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
202
diff
changeset
|
156 |
}; |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
202
diff
changeset
|
157 |
numberOfTweet+=1; |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
202
diff
changeset
|
158 |
} |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
202
diff
changeset
|
159 |
|
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
202
diff
changeset
|
160 |
} |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
202
diff
changeset
|
161 |
else { |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
202
diff
changeset
|
162 |
//trace("tweet qualification = ","null"); |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
202
diff
changeset
|
163 |
} |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
202
diff
changeset
|
164 |
}); |
|
133
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
165 |
trace("======= ",numberOfTweet); |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
166 |
DrawTweets (); |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
167 |
|
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
168 |
} |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
169 |
}); |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
170 |
|
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
171 |
|
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
172 |
// tweet Drawing (in raphael) |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
173 |
function DrawTweets (){ |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
174 |
// GROUPES TWEET ============================================ |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
175 |
// Count nbr of cluster and tweet in a frame an save int in "frames" |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
176 |
numberOfTweet = tweets.length; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
177 |
for(var i=0; i<nbrframes; i++) { |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
178 |
for(var j=0; j<numberOfTweet; j++) { |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
179 |
|
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
180 |
if (i==tweets[j].yframe){ |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
181 |
|
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
182 |
var k = tweets[j].qualification; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
183 |
|
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
184 |
// make array for frame cluster |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
185 |
if(frames[i]==undefined){ |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
186 |
frames[i] = {id:i, |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
187 |
qualifVol:new Array(), |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
188 |
mytweetsID:new Array() |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
189 |
}; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
190 |
} |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
191 |
// add my tweet to frame |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
192 |
frames[i].mytweetsID.push(tweets[j]); |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
193 |
|
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
194 |
// count opinion by frame |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
195 |
if( frames[i].qualifVol[k] == undefined){ |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
196 |
frames[i].qualifVol[k] = 1; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
197 |
}else{ |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
198 |
frames[i].qualifVol[k] += 1; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
199 |
} |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
200 |
|
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
201 |
} |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
202 |
} |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
203 |
} |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
204 |
|
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
205 |
// GROUPES TWEET ============================================ |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
206 |
// max of tweet by Frame |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
207 |
var max = 0; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
208 |
for(var i=0; i<nbrframes; i++) { |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
209 |
var moy = 0; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
210 |
for (var j=0; j<6; j++){ |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
211 |
if (frames[i]!=undefined){ |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
212 |
if (frames[i].qualifVol[j]!=undefined){ |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
213 |
moy += frames[i].qualifVol[j]; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
214 |
} |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
215 |
} |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
216 |
} |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
217 |
//trace("frame "+i,moy); |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
218 |
if (moy>max){max=moy;} |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
219 |
} |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
220 |
|
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
221 |
var tweetDrawed = new Array(); |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
222 |
var TweetHeight = 5; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
223 |
// DRAW TWEETS ============================================ |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
224 |
for(var i=0; i<nbrframes;i++) { |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
225 |
var addEheight = 5; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
226 |
if (frames[i]!=undefined){ |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
227 |
trace (i+" k=",frames[i].mytweetsID.length); |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
228 |
// by type |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
229 |
for (var j=6; j>-1; j--){ |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
230 |
if (frames[i].qualifVol[j]!=undefined){ |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
231 |
// show tweet by type |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
232 |
for (var k=0; k<frames[i].mytweetsID.length; k++){ |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
233 |
if (frames[i].mytweetsID[k].qualification==j){ |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
234 |
var y=config.heightmax-addEheight; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
235 |
if(yMax>y){yMax=y;} |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
236 |
e = paper.rect( i*frameSize, // x |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
237 |
y, // y |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
238 |
frameSize-margin, // width |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
239 |
TweetHeight // height |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
240 |
).attr({stroke:"#00","stroke-width":0.1, fill: colors[j]}); |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
241 |
addEheight +=TweetHeight; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
242 |
e.time= frames[i].mytweetsID[k].timeframe; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
243 |
e.title= frames[i].mytweetsID[k].title; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
244 |
e.mouseover(function () { |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
245 |
//this.attr({stroke:"#fff","stroke-width":5}); |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
246 |
//this.toFront(); |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
247 |
}).mouseout(function () { |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
248 |
//this.attr({stroke:"#00","stroke-width":0.1}); |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
249 |
}).mousedown(function () { |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
250 |
__IriSP.MyApiPlayer.seek(this.time/1000); |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
251 |
}); |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
252 |
__IriSP.jQuery(e.node).attr('id', 't'+k+''); |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
253 |
__IriSP.jQuery(e.node).attr('title', frames[i].mytweetsID[k].title); |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
254 |
__IriSP.jQuery(e.node).attr('begin', frames[i].mytweetsID[k].timeframe); |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
255 |
var tempPosition = {x:i*frameSize,y:config.heightmax-addEheight}; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
256 |
addTip(e.node, frames[i].mytweetsID[k].title,colors[j],tempPosition); |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
257 |
//frames[i].mytweetsID.pop(); |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
258 |
} |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
259 |
} |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
260 |
} |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
261 |
} |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
262 |
} |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
263 |
|
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
264 |
} |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
265 |
// DRAW UI :: resize border and bgd |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
266 |
heightOfChart = (yMax-(config.height-yMax)); |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
267 |
PaperBackground = paper.rect(0,yMax,config.width,heightOfChart).attr({fill:"#fff","stroke-width":0.1,opacity: 0.1}); |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
268 |
PaperBorder = paper.rect(0,yMax,config.width,1).attr({fill:"#fff",stroke: "none",opacity: 1}); |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
269 |
PaperSlider = paper.rect(0,20,1,heightOfChart).attr({fill:"#fff",stroke: "none",opacity: 1}); |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
270 |
|
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
271 |
// decalage |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
272 |
tweetSelection = paper.rect(-100,-100,5,5).attr({fill:"#fff",stroke: "none",opacity: 1}); |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
273 |
|
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
274 |
PaperSlider.toFront(); |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
275 |
PaperBackground.toBack(); |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
276 |
} |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
277 |
|
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
278 |
if(typeof(PaperSlider) !== 'undefined' ) { |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
279 |
PaperSlider.toFront(); |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
280 |
} |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
281 |
} |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
282 |
|
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
283 |
|
|
202
2bf0fd3432bf
put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
133
diff
changeset
|
284 |
jQuery(document).mousemove(function(e){ |
|
133
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
285 |
if (over){ |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
286 |
__IriSP.jQuery("#tip").css("left", e.pageX-106).css("top", e.pageY-160); |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
287 |
__IriSP.jQuery("#tipcolor").css("background-color", tipColor); |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
288 |
__IriSP.jQuery("#tiptext").text(tipText); |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
289 |
__IriSP.jQuery("#tip").show(); |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
290 |
}else{ |
|
229
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
202
diff
changeset
|
291 |
if (typeof(__IriSP) !== 'undefined' && typeof(__IriSP.jQuery) === 'function') { |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
202
diff
changeset
|
292 |
__IriSP.jQuery("#tip").css("left", -10000).css("top", -100000); |
|
133
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
293 |
//tweetSelection.attr({x:-100,y:-100}); |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
294 |
} |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
295 |
} |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
296 |
}); |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
297 |
|
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
298 |
var over = false; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
299 |
var tipText = ""; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
300 |
var tipColor = "#efefef"; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
301 |
var tweetSelection; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
302 |
var PaperSlider; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
303 |
|
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
304 |
// AddTip ****************************************************************************** |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
305 |
function addTip(node, txt,color,tempPosition){ |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
306 |
__IriSP.jQuery(node).mouseover(function(){ |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
307 |
tipText = txt; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
308 |
//tip.hide();//fadeIn(0); |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
309 |
tipColor = color; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
310 |
over = true; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
311 |
//tweetSelection.attr(tempPosition); |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
312 |
//tweetSelection.toFront(); |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
313 |
}).mouseout(function(){ |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
314 |
//tip.show()//tip.fadeOut(0); |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
315 |
over = false; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
316 |
}); |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
317 |
|
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
318 |
|
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
319 |
} |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
123
diff
changeset
|
320 |
|
|
202
2bf0fd3432bf
put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
133
diff
changeset
|
321 |
jQuery(document).ready(function() { |
|
229
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
202
diff
changeset
|
322 |
if (typeof(__IriSP) !== 'undefined' && typeof(__IriSP.jQuery) === 'function') { |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
202
diff
changeset
|
323 |
__IriSP.jQuery("#tip").hide(); |
|
74c9ddc3640b
a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
202
diff
changeset
|
324 |
} |
|
120
3daa4039509a
-folder reorgnaisation
Samuel Huron <samuel.huron@centrepompidou.fr>
parents:
50
diff
changeset
|
325 |
}); |