web/res/metadataplayer.polemic/src/js/polemic.js
author Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
Tue, 14 Feb 2012 14:35:09 +0100
changeset 516 819a9cd7679c
parent 389 d92c38c912ec
permissions -rwxr-xr-x
Added tag V01.38 for changeset 6dac95a86a52
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;
281
c1e9b566af90 thumbnail jane
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 276
diff changeset
    22
	var userPol    = new Array();
c1e9b566af90 thumbnail jane
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 276
diff changeset
    23
	var userNoPol  = new Array();
c1e9b566af90 thumbnail jane
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 276
diff changeset
    24
	var userst 	   = new Array();
259
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
    25
	var numberOfTweet = 0;
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
    26
	var Users;
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
    27
	var TweetPolemic;
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
    28
	var yMax	  		= config.height; 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
    29
	var PaperSlider;
259
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
    30
	var heightOfChart;
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
    31
	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
    32
	// 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
    33
	//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
    34
		
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
    35
	function ChartTimeLine (){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
    36
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
    37
		// variable 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
    38
		// yMax
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
    39
		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
    40
		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
    41
		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
    42
		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
    43
		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
    44
		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
    45
		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
    46
		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
    47
		var timeline;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
    48
		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
    49
		
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
    50
		// array 
259
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
    51
		//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
    52
		var element = new Array();
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
    53
		var cluster = new Array();
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
    54
		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
    55
		var slices  = new Array();
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
		
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
    58
		// Classes =======================================================================
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
    59
		var Frames = function(){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
    60
			
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
    61
			var Myclusters;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
    62
			var x;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
    63
			var y;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
    64
			var width;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
    65
			var height;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
    66
		};
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
    67
		Frames = function(json){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
    68
			// make my clusters
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
    69
			// ou Frame vide 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
    70
		};
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
    71
		Frames.prototype.draw = function(){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
    72
		};
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
    73
		Frames.prototype.zoom = function(){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
    74
		};
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
    75
		Frames.prototype.inside = function(){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
    76
		};
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
    77
		var Clusters = function(){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
    78
			var Object;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
    79
			var yDist;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
    80
			var x;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
    81
			var y;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
    82
			var width;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
    83
			var height;
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
		Clusters = function(json){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
    86
			// make my object
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
    87
		};
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
    88
		var Tweet = function(){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
    89
		};
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
    90
		// Classes =======================================================================
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
		// trace function 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
    93
		var traceNum = 0;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
    94
		function trace(msg,value){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
    95
			traceNum += 1;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
    96
			__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
    97
		}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
    98
		
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
    99
		// Refactoring (parametere) ************************************************************
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   100
		// color translastion
259
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   101
		var qTweet_0  =0;
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   102
		var qTweet_Q  =0;
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   103
		var qTweet_REF=0;
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   104
		var qTweet_OK =0;
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   105
		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
   106
		function colorTranslation(value){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   107
			if(value == "Q"){
259
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   108
				qTweet_Q+=1;
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   109
				return 2;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   110
			}else if(value =="REF"){
259
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   111
				qTweet_REF+=1;
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   112
				return 4;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   113
			}else if(value =="OK"){
259
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   114
				qTweet_OK+=1;
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   115
				return 1;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   116
			}else if(value =="KO"){
259
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   117
				qTweet_KO+=1;
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   118
				return 3;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   119
			}else if(value ==""){
259
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   120
				qTweet_0+=1;
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   121
				return 5;
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
		}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   124
		
259
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   125
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   126
		// Refactoring (parametere) ************************************************************
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   127
		// 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
   128
		__IriSP.jQuery.ajax({
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   129
		  dataType: "jsonp",
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   130
		  url:config.metadata,
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   131
		  success : function(json){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   132
			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
   133
		    // 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
   134
		    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
   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
		    // 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
   137
		    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
   138
		    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
   139
		    	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
   140
		    }
259
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   141
			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
   142
			
74c9ddc3640b a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 202
diff changeset
   143
			__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
   144
				
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 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
   146
				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
   147
259
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   148
				if (typeof(item.meta) !== "undefined" 
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   149
					&& typeof(item.meta["id-ref"]) !== "undefined"
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   150
					&& 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
   151
						
259
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   152
					var MyTJson = JSON.parse(item.meta['dc:source']['content']);
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   153
					
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   154
						if (item.content['polemics'] != undefined 
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   155
						&& item.content['polemics'][0] != null) {
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
						
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   158
					//console.log(item.meta['dc:source']['content']);
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   159
					
229
74c9ddc3640b a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 202
diff changeset
   160
							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
   161
									
74c9ddc3640b a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 202
diff changeset
   162
									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
   163
												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
   164
												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
   165
												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
   166
												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
   167
												title:item.content['title'],
259
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   168
												timeframe:item.begin,
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   169
												userId: MyTJson.id,
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   170
												userScreenName: MyTJson.screen_name,
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   171
												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
   172
												};
74c9ddc3640b a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 202
diff changeset
   173
									numberOfTweet+=1;
259
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   174
									
229
74c9ddc3640b a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 202
diff changeset
   175
							}
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   176
					}
229
74c9ddc3640b a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 202
diff changeset
   177
					else {
74c9ddc3640b a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 202
diff changeset
   178
						//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
   179
						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
   180
									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
   181
									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
   182
									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
   183
									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
   184
									title:item.content['title'],
259
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   185
									timeframe:item.begin,
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   186
									userId: MyTJson.id,
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   187
									userScreenName: MyTJson.screen_name,
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   188
									tsource:MyTJson
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   189
									
229
74c9ddc3640b a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 202
diff changeset
   190
						};
74c9ddc3640b a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 202
diff changeset
   191
						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
   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
				} 
74c9ddc3640b a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 202
diff changeset
   195
				else {
74c9ddc3640b a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 202
diff changeset
   196
					//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
   197
				}
74c9ddc3640b a lot of changes in the web file organization.
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 202
diff changeset
   198
			});	
259
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   199
			
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   200
		   DrawTweets ();
259
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   201
		   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
   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
		 });
259
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   205
		
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   206
		function pourcent(value,max){
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   207
			var myPourcentage = Math.round(value/max*1000)/10;
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   208
			return myPourcentage;
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   209
			
259
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   210
		}
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   211
		function round2Dec(value){
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   212
			var myValueRounded =  Math.round(value*100)/100;
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   213
			return myValueRounded
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   214
		}
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   215
		
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   216
259
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   217
		function searchKeyValueArray(mykey,myvalue,myarray){
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   218
			for(var i=0; i<myarray.length; i++) {
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   219
				if(myarray[i][mykey]==myvalue){
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   220
					return i;
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   221
					console.log("trouvé !");
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
			}
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   224
			return true;
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
		
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   227
		var tweetConversationel   = new Array();
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   228
		var tweetConversationelSP = 0;
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   229
		var tweetClient		  	  = new Array();
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   230
		var tweetRetweet		  = new Array();
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   231
		var maxRetweet
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   232
		function tweetRetweetCount(mytweet){
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   233
			tweet = mytweet.tsource
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   234
			var retweetIsHere = false;
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   235
			var myRT =	{
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   236
				   			id:'',
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   237
							tweet:tweet,
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   238
							total:1,
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   239
							SPtraine:''
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   240
						} 
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   241
			if(tweet.retweet_count>0){
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   242
				for(var i=0; i<tweetRetweet.length; i++){
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   243
					if(tweetRetweet[i].id==myRT.id){
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   244
						myRT = tweetRetweet[i];
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   245
						retweetIsHere=true;
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
				
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   249
				if (mytweet.qualification==5){
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   250
					myTclient.numberNsp+=1;
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   251
				}else{
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   252
					myTclient.numberSp+=1;
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
				
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   255
				if(retweetIsHere==false){
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   256
					tweetRetweet.push(myRT);
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   257
				}else{
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   258
					myRT.total+=1;	
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
		}
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   263
		function tweetRetweetReport(tweet){
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
		}
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   266
		function tweetClientCount(tweet){
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   267
			var myTclient =	{
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   268
							client:tweet.tsource.source,
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   269
							numberNsp:0,
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   270
							numberSp:0,
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   271
							total:1,
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   272
							}
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   273
			var clientIsHere = false;
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   274
			for(var i=0; i<tweetClient.length; i++) {
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   275
				if (tweetClient[i].client==tweet.tsource.source){
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   276
					clientIsHere = true;
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   277
					myTclient = tweetClient[i];
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
			}
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   280
			if (tweet.qualification==5){
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   281
				myTclient.numberNsp+=1;
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   282
			}else{
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   283
				myTclient.numberSp+=1;
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   284
			}
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   285
			if(clientIsHere==false){
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   286
				tweetClient.push(myTclient);
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   287
			}else{
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   288
				myTclient.total+=1
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
		}
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   291
		function tweetClientSort(a,b){
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   292
			return (a.total < b.total)?1:-1;
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   293
		}
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   294
		function tweetClientReport(){
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   295
			tweetClient.sort(tweetClientSort);
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   296
			console.log("_______________________________");
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   297
			for(var i=0; i<tweetClient.length; i++) {
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   298
				if(tweetClient[i].total>1){
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   299
					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
   300
				}
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   301
			}
266
bb7a2f8202b9 Jane McGonigal : jeux video
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 259
diff changeset
   302
			console.log(JSON.stringify(tweetClient));
259
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   303
		}
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   304
		function conversationalCount(tweet){
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   305
			if(tweet.tsource.entities.user_mentions.length>2){
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   306
				if (tweet.qualification!=5){
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   307
					tweetConversationelSP+=1;
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   308
				}
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   309
				var myTc = {
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   310
							polemique:tweet.qualification,
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   311
							user_mentions:tweet.tsource.entities.user_mentions,
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   312
							tsource:tweet
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
				tweetConversationel.push(myTc);
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   315
			}
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   316
		}
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   317
		function conversationalReport(){
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   318
			console.log("_______________________________");
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   319
			console.log("tweets conversationel    : "+tweetConversationel.length);
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   320
			console.log("tweets conversationel sp : "+pourcent(tweetConversationelSP,tweetConversationel.length));
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   321
			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
   322
		}
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   323
		function tweetsStats(){
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   324
			for(var i=0; i<tweets.length; i++) {
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   325
					conversationalCount(tweets[i])
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   326
					tweetClientCount(tweets[i]);
266
bb7a2f8202b9 Jane McGonigal : jeux video
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 259
diff changeset
   327
					//tweetRetweetCount(tweets[i]);
259
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   328
			}	
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   329
			conversationalReport();
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   330
			tweetClientReport();
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
		function numberUserUsePolemic(){
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
			for(var i=0; i<tweets.length; i++) {
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   335
				if (tweets[i].qualification!=5){
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   336
					var searchKeyValueArrayTest = searchKeyValueArray('userId',tweets[i].userId,userPol);
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   337
					if(searchKeyValueArrayTest==true){
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   338
						myUser = userPol.push({
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   339
											userId: tweets[i].userId,
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   340
											userScreenName: tweets[i].userScreenName,
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   341
											tweets:[]
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   342
											});
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   343
					}
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   344
				}else{
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   345
					var searchKeyValueArrayTest = searchKeyValueArray('userId',tweets[i].userId,userPol);
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   346
					if(searchKeyValueArrayTest==true){
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   347
						myUser = userNoPol.push({
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   348
											userId: tweets[i].userId,
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   349
											userScreenName: tweets[i].userScreenName,
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   350
											tweets:[]
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
				}
281
c1e9b566af90 thumbnail jane
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 276
diff changeset
   354
				
c1e9b566af90 thumbnail jane
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 276
diff changeset
   355
				var searchKeyValueArrayTest = searchKeyValueArray('userId',tweets[i].userId,userst);
c1e9b566af90 thumbnail jane
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 276
diff changeset
   356
				//console.log(searchKeyValueArrayTest);
c1e9b566af90 thumbnail jane
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 276
diff changeset
   357
				if(searchKeyValueArrayTest==true){
c1e9b566af90 thumbnail jane
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 276
diff changeset
   358
					//console.log("ici");
c1e9b566af90 thumbnail jane
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 276
diff changeset
   359
					myUser = userst.push({
c1e9b566af90 thumbnail jane
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 276
diff changeset
   360
										userId: tweets[i].userId,
c1e9b566af90 thumbnail jane
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 276
diff changeset
   361
										userScreenName: tweets[i].userScreenName,
c1e9b566af90 thumbnail jane
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 276
diff changeset
   362
										tweetsNP:[],
c1e9b566af90 thumbnail jane
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 276
diff changeset
   363
										tweetsSP:[],
c1e9b566af90 thumbnail jane
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 276
diff changeset
   364
										ecartNP:null,
c1e9b566af90 thumbnail jane
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 276
diff changeset
   365
										ecartSP:null
c1e9b566af90 thumbnail jane
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 276
diff changeset
   366
								 		});
c1e9b566af90 thumbnail jane
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 276
diff changeset
   367
					if(tweets[i].qualification!=5){
c1e9b566af90 thumbnail jane
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 276
diff changeset
   368
							userst[myUser-1].tweetsNP.push(tweets);
c1e9b566af90 thumbnail jane
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 276
diff changeset
   369
					}else {
c1e9b566af90 thumbnail jane
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 276
diff changeset
   370
							userst[myUser-1].tweetsSP.push(tweets);
c1e9b566af90 thumbnail jane
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 276
diff changeset
   371
					}
c1e9b566af90 thumbnail jane
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 276
diff changeset
   372
				}else{
c1e9b566af90 thumbnail jane
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 276
diff changeset
   373
					if(tweets[searchKeyValueArrayTest].qualification!=5){
c1e9b566af90 thumbnail jane
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 276
diff changeset
   374
						userst[searchKeyValueArrayTest].tweetsNP.push(tweets);
c1e9b566af90 thumbnail jane
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 276
diff changeset
   375
					}else {
c1e9b566af90 thumbnail jane
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 276
diff changeset
   376
						userst[searchKeyValueArrayTest].tweetsSP.push(tweets);
c1e9b566af90 thumbnail jane
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 276
diff changeset
   377
					}	
c1e9b566af90 thumbnail jane
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 276
diff changeset
   378
				}	
259
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   379
			}
281
c1e9b566af90 thumbnail jane
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 276
diff changeset
   380
			
c1e9b566af90 thumbnail jane
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 276
diff changeset
   381
			moyenneDeTweetsNPparUsers = (numberOfTweet-qTweet_0)/userNoPol.length
c1e9b566af90 thumbnail jane
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 276
diff changeset
   382
			moyenneDeTweetsSPparUsers = (numberOfTweet-qTweet_0)/userPol.length
c1e9b566af90 thumbnail jane
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 276
diff changeset
   383
			sommeDeMesCarreSP=0;
c1e9b566af90 thumbnail jane
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 276
diff changeset
   384
			sommeDeMesCarreNP=0;			
c1e9b566af90 thumbnail jane
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 276
diff changeset
   385
			for(var i=0; i<userst.length; i++) {
c1e9b566af90 thumbnail jane
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 276
diff changeset
   386
				myEcartSP = Math.pow(userst[i].tweetsSP.length-moyenneDeTweetsSPparUsers,2);
c1e9b566af90 thumbnail jane
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 276
diff changeset
   387
				userst[i].ecartSP=myEcartSP;
c1e9b566af90 thumbnail jane
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 276
diff changeset
   388
				sommeDeMesCarreSP+=myEcartSP;
c1e9b566af90 thumbnail jane
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 276
diff changeset
   389
				
c1e9b566af90 thumbnail jane
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 276
diff changeset
   390
				myEcartNP = Math.pow(userst[i].tweetsNP.length-moyenneDeTweetsNPparUsers,2);
c1e9b566af90 thumbnail jane
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 276
diff changeset
   391
				userst[i].ecartNP=myEcartNP;
c1e9b566af90 thumbnail jane
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 276
diff changeset
   392
				sommeDeMesCarreNP+=myEcartNP;
c1e9b566af90 thumbnail jane
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 276
diff changeset
   393
			}
c1e9b566af90 thumbnail jane
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 276
diff changeset
   394
			varianceSP	= sommeDeMesCarreSP/userst.length
c1e9b566af90 thumbnail jane
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 276
diff changeset
   395
			varianceNP	= sommeDeMesCarreNP/userst.length
c1e9b566af90 thumbnail jane
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 276
diff changeset
   396
			
c1e9b566af90 thumbnail jane
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 276
diff changeset
   397
			SommeVariances = varianceNP + varianceSP;
c1e9b566af90 thumbnail jane
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 276
diff changeset
   398
			
c1e9b566af90 thumbnail jane
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 276
diff changeset
   399
			EcartTypeSP = Math.sqrt(varianceSP);
c1e9b566af90 thumbnail jane
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 276
diff changeset
   400
			EcartTypeNP = Math.sqrt(varianceNP);
c1e9b566af90 thumbnail jane
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 276
diff changeset
   401
			
c1e9b566af90 thumbnail jane
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 276
diff changeset
   402
			SommeEcart = EcartTypeSP + EcartTypeNP;
c1e9b566af90 thumbnail jane
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 276
diff changeset
   403
			
c1e9b566af90 thumbnail jane
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 276
diff changeset
   404
c1e9b566af90 thumbnail jane
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 276
diff changeset
   405
			
c1e9b566af90 thumbnail jane
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 276
diff changeset
   406
			
c1e9b566af90 thumbnail jane
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 276
diff changeset
   407
			console.log("user  SP	       	: "+userPol.length);
c1e9b566af90 thumbnail jane
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 276
diff changeset
   408
			console.log("user  nSP  	   	: "+userNoPol.length);
c1e9b566af90 thumbnail jane
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 276
diff changeset
   409
			console.log("nbrTP / user SP   	: "+round2Dec(moyenneDeTweetsSPparUsers));
c1e9b566af90 thumbnail jane
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 276
diff changeset
   410
			console.log("nbrT  / user nSP  	: "+round2Dec(moyenneDeTweetsNPparUsers));
c1e9b566af90 thumbnail jane
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 276
diff changeset
   411
			console.log("varianceSP	  	: "+round2Dec(varianceSP));
c1e9b566af90 thumbnail jane
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 276
diff changeset
   412
			console.log("varianceNP	  	: "+round2Dec(varianceNP));
c1e9b566af90 thumbnail jane
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 276
diff changeset
   413
			console.log("EcartTypeSP	  	: "+round2Dec(EcartTypeSP));
c1e9b566af90 thumbnail jane
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 276
diff changeset
   414
			console.log("EcartTypeNP	  	: "+round2Dec(EcartTypeNP));
c1e9b566af90 thumbnail jane
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 276
diff changeset
   415
			
259
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   416
		}
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   417
		function Report(){
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   418
			console.log("_______________________________");
276
f7669b499d41 _setAllowAnchor
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 266
diff changeset
   419
			console.log("Total de tweets   	: "+numberOfTweet)
281
c1e9b566af90 thumbnail jane
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 276
diff changeset
   420
			console.log("Total de tweets P 	: "+(numberOfTweet-qTweet_0)+" 	"+ pourcent((numberOfTweet-qTweet_0),numberOfTweet)+" %")
276
f7669b499d41 _setAllowAnchor
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 266
diff changeset
   421
			console.log("accord       		: "+qTweet_OK+" 	"+pourcent(qTweet_OK,numberOfTweet)+" %");
f7669b499d41 _setAllowAnchor
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 266
diff changeset
   422
			console.log("desaccord    		: "+qTweet_KO+" 	"+pourcent(qTweet_KO,numberOfTweet)+" %");
f7669b499d41 _setAllowAnchor
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 266
diff changeset
   423
			console.log("question     		: "+qTweet_Q+" 	"+pourcent(qTweet_Q,numberOfTweet)+" %");
f7669b499d41 _setAllowAnchor
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 266
diff changeset
   424
			console.log("reference    		: "+qTweet_REF+" 	"+pourcent(qTweet_REF,numberOfTweet)+" %");
f7669b499d41 _setAllowAnchor
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 266
diff changeset
   425
			console.log("sans polemic 		: "+qTweet_0+" 	"+pourcent(qTweet_0,numberOfTweet)+" %");
259
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   426
			numberUserUsePolemic();
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   427
			tweetsStats();
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   428
		}
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   429
		// tweet Drawing (in raphael) 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   430
		function DrawTweets (){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   431
		// GROUPES TWEET ============================================
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   432
		// 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
   433
			numberOfTweet = tweets.length;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   434
			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
   435
				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
   436
				
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   437
					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
   438
						
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   439
						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
   440
						
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   441
						// 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
   442
						if(frames[i]==undefined){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   443
							frames[i] = {id:i,
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   444
										 qualifVol:new Array(),
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   445
										 mytweetsID:new Array()
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   446
										};
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   447
						}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   448
						// 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
   449
						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
   450
						
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   451
						// count opinion by frame
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   452
						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
   453
							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
   454
						}else{
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   455
							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
   456
						}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   457
						
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   458
					}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   459
				}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   460
			}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   461
		
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   462
		// GROUPES TWEET ============================================		
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   463
		// 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
   464
			var max = 0; 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   465
			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
   466
				var moy	= 0;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   467
				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
   468
					if (frames[i]!=undefined){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   469
						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
   470
							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
   471
						}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   472
					}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   473
				}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   474
				//trace("frame "+i,moy);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   475
				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
   476
			}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   477
		
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   478
			var tweetDrawed = new Array();
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   479
			var TweetHeight = 5;
259
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   480
			
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   481
			// DRAW  TWEETS ============================================
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   482
			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
   483
				var addEheight = 5;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   484
				if (frames[i]!=undefined){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   485
					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
   486
					// by type 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   487
					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
   488
						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
   489
							// show tweet by type 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   490
							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
   491
								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
   492
									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
   493
									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
   494
									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
   495
													y,								// y
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   496
													frameSize-margin,				// width
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   497
													TweetHeight						// height
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   498
													).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
   499
									addEheight +=TweetHeight;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   500
									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
   501
									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
   502
									e.mouseover(function () {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   503
										//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
   504
										//this.toFront();
383
f9347f6653b3 tracker mouse on chapter timeline and seek play pause
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 382
diff changeset
   505
										_gaq.push(['_trackPageview', location.pathname + location.search + location.hash+"/#!/MetaDatPlayer.PT.mouseover(time:"+this.time+",id:"+this.id+")"]);
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   506
									}).mouseout(function () {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   507
										//this.attr({stroke:"#00","stroke-width":0.1});	
383
f9347f6653b3 tracker mouse on chapter timeline and seek play pause
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 382
diff changeset
   508
										_gaq.push(['_trackPageview', location.pathname + location.search + location.hash+"/#!/MetaDatPlayer.PT.mouseout(time:"+this.time+",id:"+this.id+")"]);
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   509
									}).mousedown(function () {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   510
										__IriSP.MyApiPlayer.seek(this.time/1000);
383
f9347f6653b3 tracker mouse on chapter timeline and seek play pause
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 382
diff changeset
   511
										_gaq.push(['_trackPageview', location.pathname + location.search + location.hash+"/#!/MetaDatPlayer.PT.mousedown(time:"+this.time+",id:"+this.id+")"]);
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   512
									});
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   513
									__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
   514
									__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
   515
									__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
   516
									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
   517
									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
   518
									//frames[i].mytweetsID.pop();
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
				}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   524
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   525
			}		
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   526
			// DRAW UI :: resize border and bgd
389
d92c38c912ec bug size of the canvas in FF
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 383
diff changeset
   527
			heightOfChart 	= (config.height-yMax);
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   528
			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
   529
			PaperBorder 	= paper.rect(0,yMax,config.width,1).attr({fill:"#fff",stroke: "none",opacity: 1});	
316
26d83703fa63 Muséo 2011 2012
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 281
diff changeset
   530
			PaperSlider 	= paper.rect(0,20,1,heightOfChart).attr({fill:"#fc00ff",stroke: "none",opacity: 1});	
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   531
			
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   532
			// decalage 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   533
			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
   534
				
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   535
			PaperSlider.toFront();
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   536
			PaperBackground.toBack();
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   537
		}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   538
		
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   539
		if(typeof(PaperSlider) !== 'undefined' ) {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   540
			PaperSlider.toFront();
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   541
		}
259
bc17d1af15ab stats paper chi 1
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 229
diff changeset
   542
		Report();
133
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).mousemove(function(e){
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   547
		if (over){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   548
			__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
   549
			__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
   550
			__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
   551
			__IriSP.jQuery("#tip").show();
382
55370839e230 tracker mouse on PT timeline
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 316
diff changeset
   552
			_gaq.push(['_trackPageview', location.pathname + location.search + location.hash+"!!MetaDatPlayer.PT.mouseover("+this.time+","+this.id+")"]);
55370839e230 tracker mouse on PT timeline
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 316
diff changeset
   553
			
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   554
		}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
   555
			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
   556
				__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
   557
			     //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
   558
			}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   559
		}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   560
	});
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   561
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   562
	var over 	 = false;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   563
	var tipText  = "";
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   564
	var tipColor = "#efefef";
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   565
	var tweetSelection;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   566
	var PaperSlider;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   567
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   568
	// AddTip  ******************************************************************************
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   569
	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
   570
			__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
   571
			   tipText = txt;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   572
			   //tip.hide();//fadeIn(0);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   573
			   tipColor = color;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   574
			   over = true;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   575
			   //tweetSelection.attr(tempPosition);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   576
			   //tweetSelection.toFront();
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   577
			}).mouseout(function(){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   578
			   //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
   579
			   over = false;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   580
			});
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   581
			
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   582
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   583
	}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 123
diff changeset
   584
	
202
2bf0fd3432bf put more than one content for the polemical timeline
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
   585
		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
   586
			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
   587
				__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
   588
			}
120
3daa4039509a -folder reorgnaisation
Samuel Huron <samuel.huron@centrepompidou.fr>
parents: 50
diff changeset
   589
		});