web/res/metadataplayer.polemic/src/js/polemic.js
author Samuel Huron <samuel.huron@centrepompidou.fr>
Sun, 28 Aug 2011 11:48:30 +0200
changeset 259 bc17d1af15ab
parent 229 74c9ddc3640b
child 266 bb7a2f8202b9
permissions -rwxr-xr-x
stats paper chi 1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
259
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
    21
	var RAWTweets;
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
    22
	var userPol   = new Array();
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
    23
	var userNoPol = new Array();
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
    24
	var numberOfTweet = 0;
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
    25
	var Users;
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
    26
	var TweetPolemic;
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
    27
	var yMax	  		= config.height; 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
    28
	var PaperSlider;
259
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
    29
	var heightOfChart;
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
    30
	var tweets  = new Array();
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
    31
	// 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
    32
	//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
    33
		
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
    34
	function ChartTimeLine (){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
    35
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
    36
		// variable 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
    37
		// yMax
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
    38
		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
    39
		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
    40
		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
    41
		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
    42
		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
    43
		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
    44
		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
    45
		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
    46
		var timeline;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
    47
		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
    48
		
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
    49
		// array 
259
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
    50
		//var tweets  = new Array();
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
    51
		var element = new Array();
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
    52
		var cluster = new Array();
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
    53
		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
    54
		var slices  = new Array();
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
    55
		
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
    56
		
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
    57
		// Classes =======================================================================
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
    58
		var Frames = function(){
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
			var Myclusters;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
    61
			var x;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
    62
			var y;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
    63
			var width;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
    64
			var height;
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 = function(json){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
    67
			// make my clusters
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
    68
			// ou Frame vide 
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
		Frames.prototype.draw = function(){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
    71
		};
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
    72
		Frames.prototype.zoom = function(){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
    73
		};
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
    74
		Frames.prototype.inside = function(){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
    75
		};
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
    76
		var Clusters = function(){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
    77
			var Object;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
    78
			var yDist;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
    79
			var x;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
    80
			var y;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
    81
			var width;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
    82
			var height;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
    83
		};
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
    84
		Clusters = function(json){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
    85
			// make my object
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
    86
		};
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
    87
		var Tweet = function(){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
    88
		};
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
    89
		// Classes =======================================================================
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
		// trace function 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
    92
		var traceNum = 0;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
    93
		function trace(msg,value){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
    94
			traceNum += 1;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
    95
			__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
    96
		}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
    97
		
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
    98
		// Refactoring (parametere) ************************************************************
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
    99
		// color translastion
259
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   100
		var qTweet_0  =0;
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   101
		var qTweet_Q  =0;
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   102
		var qTweet_REF=0;
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   103
		var qTweet_OK =0;
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   104
		var qTweet_KO =0;
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   105
		function colorTranslation(value){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   106
			if(value == "Q"){
259
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   107
				qTweet_Q+=1;
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   108
				return 2;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   109
			}else if(value =="REF"){
259
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   110
				qTweet_REF+=1;
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   111
				return 4;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   112
			}else if(value =="OK"){
259
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   113
				qTweet_OK+=1;
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   114
				return 1;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   115
			}else if(value =="KO"){
259
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   116
				qTweet_KO+=1;
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   117
				return 3;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   118
			}else if(value ==""){
259
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   119
				qTweet_0+=1;
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   120
				return 5;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   121
			}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   122
		}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   123
		
259
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   124
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   125
		// Refactoring (parametere) ************************************************************
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   126
		// 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
   127
		__IriSP.jQuery.ajax({
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   128
		  dataType: "jsonp",
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   129
		  url:config.metadata,
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   130
		  success : function(json){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   131
			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
   132
		    // 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
   133
		    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
   134
		    
74c9ddc3640b a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 202
diff changeset
   135
		    // 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
   136
		    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
   137
		    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
   138
		    	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
   139
		    }
259
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   140
			RAWTweets = json.annotations;
229
74c9ddc3640b a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 202
diff changeset
   141
			
74c9ddc3640b a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 202
diff changeset
   142
			__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
   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
				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
   145
				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
   146
259
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   147
				if (typeof(item.meta) !== "undefined" 
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   148
					&& typeof(item.meta["id-ref"]) !== "undefined"
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   149
					&& item.meta["id-ref"] === tweet_annot_type) {
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   150
						
259
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   151
					var MyTJson = JSON.parse(item.meta['dc:source']['content']);
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   152
					
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   153
						if (item.content['polemics'] != undefined 
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   154
						&& item.content['polemics'][0] != null) {
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   155
						
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   156
						
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   157
					//console.log(item.meta['dc:source']['content']);
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   158
					
229
74c9ddc3640b a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 202
diff changeset
   159
							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
   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
									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
   162
												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
   163
												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
   164
												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
   165
												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
   166
												title:item.content['title'],
259
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   167
												timeframe:item.begin,
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   168
												userId: MyTJson.id,
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   169
												userScreenName: MyTJson.screen_name,
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   170
												tsource:MyTJson
229
74c9ddc3640b a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 202
diff changeset
   171
												};
74c9ddc3640b a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 202
diff changeset
   172
									numberOfTweet+=1;
259
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   173
									
229
74c9ddc3640b a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 202
diff changeset
   174
							}
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   175
					}
229
74c9ddc3640b a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 202
diff changeset
   176
					else {
74c9ddc3640b a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 202
diff changeset
   177
						//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
   178
						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
   179
									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
   180
									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
   181
									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
   182
									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
   183
									title:item.content['title'],
259
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   184
									timeframe:item.begin,
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   185
									userId: MyTJson.id,
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   186
									userScreenName: MyTJson.screen_name,
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   187
									tsource:MyTJson
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   188
									
229
74c9ddc3640b a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 202
diff changeset
   189
						};
74c9ddc3640b a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 202
diff changeset
   190
						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
   191
					}
74c9ddc3640b a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 202
diff changeset
   192
					
74c9ddc3640b a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 202
diff changeset
   193
				} 
74c9ddc3640b a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 202
diff changeset
   194
				else {
74c9ddc3640b a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 202
diff changeset
   195
					//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
   196
				}
74c9ddc3640b a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 202
diff changeset
   197
			});	
259
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   198
			
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   199
		   DrawTweets ();
259
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   200
		   if(numberOfTweet>0){Report();}
133
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
		 });
259
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   204
		
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   205
		function pourcent(value,max){
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   206
			var myPourcentage = Math.round(value/max*1000)/10;
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   207
			return myPourcentage;
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   208
			
259
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   209
		}
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   210
		function round2Dec(value){
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   211
			var myValueRounded =  Math.round(value*100)/100;
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   212
			return myValueRounded
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   213
		}
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   214
		
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   215
259
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   216
		function searchKeyValueArray(mykey,myvalue,myarray){
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   217
			for(var i=0; i<myarray.length; i++) {
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   218
				if(myarray[i][mykey]==myvalue){
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   219
					return i;
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   220
					console.log("trouvé !");
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   221
				}
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   222
			}
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   223
			return true;
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   224
		}
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   225
		
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   226
		var tweetConversationel   = new Array();
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   227
		var tweetConversationelSP = 0;
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   228
		var tweetClient		  	  = new Array();
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   229
		var tweetRetweet		  = new Array();
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   230
		var maxRetweet
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   231
		function tweetRetweetCount(mytweet){
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   232
			tweet = mytweet.tsource
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   233
			var retweetIsHere = false;
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   234
			var myRT =	{
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   235
				   			id:'',
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   236
							tweet:tweet,
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   237
							total:1,
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   238
							SPtraine:''
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   239
						} 
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   240
			if(tweet.retweet_count>0){
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   241
				for(var i=0; i<tweetRetweet.length; i++){
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   242
					if(tweetRetweet[i].id==myRT.id){
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   243
						myRT = tweetRetweet[i];
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   244
						retweetIsHere=true;
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   245
					}
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   246
				}
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   247
				
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   248
				if (mytweet.qualification==5){
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   249
					myTclient.numberNsp+=1;
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   250
				}else{
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   251
					myTclient.numberSp+=1;
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   252
				}
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   253
				
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   254
				if(retweetIsHere==false){
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   255
					tweetRetweet.push(myRT);
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   256
				}else{
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   257
					myRT.total+=1;	
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   258
				}
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   259
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   260
			}
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   261
		}
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   262
		function tweetRetweetReport(tweet){
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   263
			
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   264
		}
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   265
		function tweetClientCount(tweet){
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   266
			var myTclient =	{
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   267
							client:tweet.tsource.source,
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   268
							numberNsp:0,
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   269
							numberSp:0,
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   270
							total:1,
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   271
							}
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   272
			var clientIsHere = false;
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   273
			for(var i=0; i<tweetClient.length; i++) {
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   274
				if (tweetClient[i].client==tweet.tsource.source){
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   275
					clientIsHere = true;
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   276
					myTclient = tweetClient[i];
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   277
				}
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   278
			}
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   279
			if (tweet.qualification==5){
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   280
				myTclient.numberNsp+=1;
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   281
			}else{
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   282
				myTclient.numberSp+=1;
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   283
			}
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   284
			if(clientIsHere==false){
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   285
				tweetClient.push(myTclient);
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   286
			}else{
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   287
				myTclient.total+=1
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   288
			}
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   289
		}
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   290
		function tweetClientSort(a,b){
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   291
			return (a.total < b.total)?1:-1;
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   292
		}
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   293
		function tweetClientReport(){
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   294
			tweetClient.sort(tweetClientSort);
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   295
			console.log("_______________________________");
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   296
			for(var i=0; i<tweetClient.length; i++) {
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   297
				if(tweetClient[i].total>1){
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   298
					console.log("t: "+tweetClient[i].total+" / sp :"+tweetClient[i].numberSp+" : "+tweetClient[i].client);
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   299
				}
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   300
			}
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   301
		}
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   302
		function conversationalCount(tweet){
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   303
			if(tweet.tsource.entities.user_mentions.length>2){
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   304
				if (tweet.qualification!=5){
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   305
					tweetConversationelSP+=1;
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   306
				}
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   307
				var myTc = {
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   308
							polemique:tweet.qualification,
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   309
							user_mentions:tweet.tsource.entities.user_mentions,
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   310
							tsource:tweet
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   311
							}
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   312
				tweetConversationel.push(myTc);
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   313
			}
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   314
		}
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   315
		function conversationalReport(){
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   316
			console.log("_______________________________");
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   317
			console.log("tweets conversationel    : "+tweetConversationel.length);
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   318
			console.log("tweets conversationel sp : "+pourcent(tweetConversationelSP,tweetConversationel.length));
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   319
			console.log("tweets conversationel nsp: "+pourcent(tweetConversationel.length-tweetConversationelSP,tweetConversationel.length));
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   320
		}
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   321
		function tweetsStats(){
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   322
			for(var i=0; i<tweets.length; i++) {
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   323
					conversationalCount(tweets[i])
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   324
					tweetClientCount(tweets[i]);
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   325
					tweetRetweetCount(tweets[i]);
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   326
			}	
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   327
			conversationalReport();
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   328
			tweetClientReport();
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   329
		}		
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   330
		function numberUserUsePolemic(){
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   331
			
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   332
			for(var i=0; i<tweets.length; i++) {
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   333
			/*	
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   334
				var searchKeyValueArrayTest = searchKeyValueArray('userId',tweets[i].userId,userPol);
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   335
					myUser = {
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   336
							  userId: tweets[i].userId,
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   337
							  userScreenName: tweets[i].userScreenName,
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   338
							  
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   339
							  };
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   340
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   341
				if(searchKeyValueArrayTest==true){
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   342
					myUser = userPol.push({
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   343
										userId: tweets[i].userId,
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   344
										userScreenName: tweets[i].userScreenName,
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   345
										tweets:[]
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   346
										});
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   347
						if (tweets[i].qualification!=5){
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   348
							
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   349
						}else{
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   350
							
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   351
						}
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   352
					
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   353
				}
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   354
				
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   355
			*/	
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   356
				if (tweets[i].qualification!=5){
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   357
					var searchKeyValueArrayTest = searchKeyValueArray('userId',tweets[i].userId,userPol);
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   358
					if(searchKeyValueArrayTest==true){
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   359
						myUser = userPol.push({
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   360
											userId: tweets[i].userId,
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   361
											userScreenName: tweets[i].userScreenName,
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   362
											tweets:[]
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   363
											});
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   364
						//var myUTweets = myUser.tweets = new Array();
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   365
						//myUTweets.push(tweets[i]);
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   366
					}
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   367
				}else{
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   368
					var searchKeyValueArrayTest = searchKeyValueArray('userId',tweets[i].userId,userPol);
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   369
					if(searchKeyValueArrayTest==true){
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   370
						myUser = userNoPol.push({
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   371
											userId: tweets[i].userId,
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   372
											userScreenName: tweets[i].userScreenName,
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   373
											tweets:[]
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   374
											});
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   375
					}
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   376
				}
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   377
			}
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   378
			console.log("user  SP	       : "+userPol.length);
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   379
			console.log("user  nSP  	   : "+userNoPol.length);
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   380
			console.log("nbrTP / user SP   : "+round2Dec((numberOfTweet-qTweet_0)/userPol.length));
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   381
			console.log("nbrT  / user nSP  : "+round2Dec((numberOfTweet-qTweet_0)/userNoPol.length));
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   382
		}
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   383
		function Report(){
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   384
			console.log("_______________________________");
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   385
			console.log("Total de tweets   : "+numberOfTweet)
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   386
			console.log("Total de tweets P : "+(numberOfTweet-qTweet_0))
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   387
			console.log("question     : "+pourcent(qTweet_Q,numberOfTweet)+" %");
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   388
			console.log("reference    : "+pourcent(qTweet_REF,numberOfTweet)+" %");
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   389
			console.log("accord       : "+pourcent(qTweet_OK,numberOfTweet)+" %");
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   390
			console.log("desaccord    : "+pourcent(qTweet_KO,numberOfTweet)+" %");
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   391
			console.log("sans polemic : "+pourcent(qTweet_0,numberOfTweet)+" %");
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   392
			numberUserUsePolemic();
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   393
			tweetsStats();
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   394
		}
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   395
		// tweet Drawing (in raphael) 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   396
		function DrawTweets (){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   397
		// GROUPES TWEET ============================================
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   398
		// 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
   399
			numberOfTweet = tweets.length;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   400
			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
   401
				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
   402
				
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   403
					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
   404
						
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   405
						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
   406
						
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   407
						// 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
   408
						if(frames[i]==undefined){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   409
							frames[i] = {id:i,
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   410
										 qualifVol:new Array(),
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   411
										 mytweetsID:new Array()
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   412
										};
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   413
						}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   414
						// 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
   415
						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
   416
						
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   417
						// count opinion by frame
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   418
						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
   419
							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
   420
						}else{
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   421
							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
   422
						}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   423
						
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   424
					}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   425
				}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   426
			}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   427
		
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   428
		// GROUPES TWEET ============================================		
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   429
		// 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
   430
			var max = 0; 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   431
			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
   432
				var moy	= 0;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   433
				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
   434
					if (frames[i]!=undefined){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   435
						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
   436
							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
   437
						}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   438
					}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   439
				}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   440
				//trace("frame "+i,moy);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   441
				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
   442
			}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   443
		
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   444
			var tweetDrawed = new Array();
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   445
			var TweetHeight = 5;
259
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   446
			
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   447
			// DRAW  TWEETS ============================================
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   448
			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
   449
				var addEheight = 5;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   450
				if (frames[i]!=undefined){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   451
					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
   452
					// by type 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   453
					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
   454
						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
   455
							// show tweet by type 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   456
							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
   457
								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
   458
									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
   459
									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
   460
									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
   461
													y,								// y
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   462
													frameSize-margin,				// width
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   463
													TweetHeight						// height
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   464
													).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
   465
									addEheight +=TweetHeight;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   466
									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
   467
									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
   468
									e.mouseover(function () {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   469
										//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
   470
										//this.toFront();
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   471
									}).mouseout(function () {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   472
										//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
   473
									}).mousedown(function () {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   474
										__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
   475
									});
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   476
									__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
   477
									__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
   478
									__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
   479
									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
   480
									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
   481
									//frames[i].mytweetsID.pop();
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   482
								}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   483
							}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   484
						}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   485
					}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   486
				}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   487
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   488
			}		
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   489
			// 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
   490
			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
   491
			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
   492
			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
   493
			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
   494
			
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   495
			// decalage 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   496
			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
   497
				
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   498
			PaperSlider.toFront();
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   499
			PaperBackground.toBack();
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   500
		}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   501
		
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   502
		if(typeof(PaperSlider) !== 'undefined' ) {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   503
			PaperSlider.toFront();
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   504
		}
259
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   505
		Report();
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   506
	}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   507
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   508
	
202
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
   509
	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
   510
		if (over){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   511
			__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
   512
			__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
   513
			__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
   514
			__IriSP.jQuery("#tip").show();
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   515
		}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
   516
			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
   517
				__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
   518
			     //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
   519
			}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   520
		}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   521
	});
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   522
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   523
	var over 	 = false;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   524
	var tipText  = "";
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   525
	var tipColor = "#efefef";
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   526
	var tweetSelection;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   527
	var PaperSlider;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   528
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   529
	// AddTip  ******************************************************************************
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   530
	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
   531
			__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
   532
			   tipText = txt;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   533
			   //tip.hide();//fadeIn(0);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   534
			   tipColor = color;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   535
			   over = true;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   536
			   //tweetSelection.attr(tempPosition);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   537
			   //tweetSelection.toFront();
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   538
			}).mouseout(function(){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   539
			   //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
   540
			   over = false;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   541
			});
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   542
			
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   543
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   544
	}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   545
	
202
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
   546
		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
   547
			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
   548
				__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
   549
			}
120
3daa4039509a -folder reorgnaisation
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 50
diff changeset
   550
		});