web/res/metadataplayer/test/chartTimeline2.html
author Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
Sat, 07 Jan 2012 16:15:16 +0100
changeset 468 e7f9898e6f99
parent 133 9578d3ddce17
child 532 bab9705ac861
permissions -rwxr-xr-x
Added tag V01.20 for changeset e2324dd2f7c9
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: 99
diff changeset
     1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
     2
<html xmlns="http://www.w3.org/1999/xhtml">
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
     3
<head>
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
     4
<title>Example raphael</title>
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
     5
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
     6
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
     7
</head>
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
     8
<body>
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
     9
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    10
<div id="Ldt-output" name="Ldt-output" style="position:absolute;left:600px;" ></div>
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    11
<script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js'></script>
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    12
<script type="text/javascript" src="raphael-min.js"></script>
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    13
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    14
<div>
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    15
<!--
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    16
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    17
-->
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    18
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    19
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    20
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    21
<script type='text/javascript' src='http://www.iri.centrepompidou.fr/dev/ldt/static/ldt/js/LdtPlayer.min.js'></script>
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    22
  <div id="player_project_13b0aa52-336b-11e0-b233-00145ea49a02_embed" class="iri_player_embed"/>
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    23
  <script type="text/javascript">
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    24
	var config = {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    25
			metadata:{
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    26
				format:'cinelab',
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    27
				src:'metadata.json',
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    28
				load:'json'},
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    29
			gui:{
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    30
				width:650,
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    31
				height:480,
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    32
				mode:'video',
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    33
				container:'player_project_13b0aa52-336b-11e0-b233-00145ea49a02_embed',
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    34
				debug:false,
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    35
				css:'http://www.iri.centrepompidou.fr//dev/ldt/static/ldt/css/LdtPlayer.css'},
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    36
			player:{
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    37
				type:'jwplayer',
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    38
				src:'http://www.iri.centrepompidou.fr//dev/ldt/static/ldt/swf/player.swf'}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    39
		};
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    40
	__IriSP.init(config);     
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    41
</script>
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    42
<div id="charttimeline" style="position:relative;display:block;">ici</div>
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    43
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    44
<script type="text/javascript"> 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    45
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    46
// v1 ::
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    47
//		- config
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    48
// 		- organisation classe
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    49
// 		- rollover !! 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    50
// 		- legend  !!
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    51
// 		- seek !!
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    52
//		- time cursor
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    53
/*
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    54
	1 | 1D973D > vert 	> ++ > OK
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    55
	2 | C5A62D > orange	> ?? > Q
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    56
	3 | CE0A15 > rouge  > -- > KO
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    57
	4 | 036AAE > bleu   > == > REF
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    58
	5 | 585858 > gris   > NQ > ""
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    59
*/
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    60
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    61
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    62
	// configuration 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    63
	var config = {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    64
					target:"charttimeline",
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    65
					x:8,
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    66
					y:438,
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    67
					width:650,
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    68
					height:70,
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    69
					heightmax:70
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    70
					}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    71
	// Make and define the Raphael area
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    72
	//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: 99
diff changeset
    73
	var paper = Raphael(config.x,config.y,config.width, config.height);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    74
	paper.rect(0,20,config.width,config.heightmax-20).attr({fill:"#fff","stroke-width":0.1,opacity: 0.2});	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    75
	paper.rect(0,20,config.width,1).attr({fill:"#fff",stroke: "none"});	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    76
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    77
	// variable 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    78
	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: 99
diff changeset
    79
	var frameSize = 5; 					// frame size 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    80
	var margin 	  = 1;					// marge between frame
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    81
	var lineSize  = 650;				// timeline pixel width 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    82
	var nbrframes = lineSize/frameSize; // frame numbers
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    83
	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: 99
diff changeset
    84
	var duration  = 4299820 ;			// timescale width 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    85
	var frameLenght =lineSize/frameSize;// frame timescale	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    86
	var timeline;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    87
	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: 99
diff changeset
    88
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    89
	// array 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    90
	var tweets  = new Array();
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    91
	var element = new Array();
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    92
	var cluster = new Array();
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    93
	var frames  = new Array(frameLenght);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    94
	var slices  = new Array();
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    95
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    96
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    97
	// Classes =======================================================================
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    98
	var Frames = function(){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    99
		
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   100
		var Myclusters;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   101
		var x;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   102
		var y;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   103
		var width;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   104
		var height;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   105
	};
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   106
	Frames = function(json){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   107
		// make my clusters
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   108
		// ou Frame vide 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   109
	};
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   110
	Frames.prototype.draw = function(){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   111
	}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   112
	Frames.prototype.zoom = function(){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   113
	}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   114
	Frames.prototype.inside = function(){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   115
	}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   116
	var Clusters = function(){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   117
		var Object;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   118
		var yDist;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   119
		var x;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   120
		var y;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   121
		var width;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   122
		var height;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   123
	};
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   124
	Clusters = function(json){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   125
		// make my object
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   126
	};
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   127
	var Tweet = function(){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   128
	}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   129
	// Classes =======================================================================
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   130
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   131
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   132
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   134
	// trace function 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   135
	var traceNum = 0;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   136
	function trace(msg,value){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   137
		traceNum += 1;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   138
		$("<div>"+traceNum+" - "+msg+" : "+value+"</div>").appendTo("#Ldt-output");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   139
	}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   140
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   141
	// Refactoring (parametere) ************************************************************
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   142
	// color translastion
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   143
	function colorTranslation(value){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   144
		if(value == "Q"){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   145
			return 2;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   146
		}else if(value =="REF"){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   147
			return 4;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   148
		}else if(value =="OK"){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   149
			return 1;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   150
		}else if(value =="KO"){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   151
			return 3;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   152
		}else if(value ==""){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   153
			return 5;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   154
		}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   155
	}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   156
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   157
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   158
	// Refactoring (parametere) ************************************************************
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   159
	// load tweets send in parameters 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   160
	$.ajax({
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   161
	  dataType: "json",
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   162
	  url:"metadata.json",
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   163
	  success : function(json){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   164
		trace("load","");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   165
			$.each(json.annotations, function(i,item) {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   166
				
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   167
				var MyTime  = Math.floor(item.begin/duration*lineSize);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   168
				var Myframe = Math.floor(MyTime/lineSize*frameLenght);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   169
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   170
				if (item.content['polemics'] != undefined) {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   171
					if (item.content['polemics'][0] != null) {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   172
						
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   173
							for(var j=0; j<item.content['polemics'].length; j++){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   174
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   175
									tweets[numberOfTweet] = {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   176
												id:i,
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   177
												qualification:colorTranslation(item.content['polemics'][j]),
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   178
												yIndicator:MyTime,
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   179
												yframe:Myframe
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   180
												}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   181
									numberOfTweet+=1;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   182
							}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   183
					}else{
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   184
						//trace("k = ",i);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   185
						tweets[numberOfTweet] = {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   186
									id:i,
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   187
									qualification:colorTranslation(""),
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   188
									yIndicator:MyTime,
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   189
									yframe:Myframe
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   190
						}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   191
						numberOfTweet+=1;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   192
					}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   193
					
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   194
				} else {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   195
					//trace("tweet qualification = ","null");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   196
				}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   197
			});	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   198
		trace("======= ",numberOfTweet);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   199
	   DrawTweets ();
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   200
	   
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   201
	  }
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   202
	 });
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   203
 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   204
 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   205
 	// FishEye Effect 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   206
	var zoomCoef = 2;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   207
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   208
	function fisheye(id,sens){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   209
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   210
		if(sens!=0){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   211
			// ZOOM IN -----------------
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   212
			//replaceAll(id,sens);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   213
			ZoomIt(id,1,1);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   214
			//ZoomIt(id-1,2);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   215
			//ZoomIt(id+1,2);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   216
		} else {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   217
		trace("ici1","");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   218
			// ZOOM OUT -----------------
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   219
			ZoomIt(id,1,0);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   220
		trace("ici3","");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   221
		}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   222
		
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   223
	}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   224
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   225
	function replaceAll(id){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   226
		// move every body
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   227
		for (var i=0; i<slices.length; i++) {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   228
			if (slices[i] != undefined || i==id  || i==id+1  || i==id-1  ){	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   229
					for (var j=0; j<slices[i].length; j++) {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   230
						if (slices[i][j] != undefined){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   231
							//trace("anim== ",i+" "+slices[i].length);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   232
							slices[i][j].animate({//x:slices[i][j].attr("x")+(zoomCoef*3*frameSize),
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   233
												  height:slices[i][j].heightStart,
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   234
												  width:frameSize-margin,
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   235
												  y:slices[i][j].yStart
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   236
												  },180);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   237
						}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   238
					}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   239
				
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   240
			}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   241
		}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   242
	}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   243
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   244
	function ZoomIt(id,coef,sens){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   245
		if (slices[id][0].state==0 && sens!=0){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   246
				slices[id][0].state=1;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   247
				var addEheight = 0;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   248
				for (var j=0; j<slices[id].length; j++) {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   249
					//trace("",j);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   250
					object = slices[id][j];
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   251
					if (j!=slices[id].length){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   252
							Eheight 	= object.attr("height")*zoomCoef/coef;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   253
							addEheight += Eheight;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   254
							MyWidth 	= object.attr("width")*zoomCoef*4;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   255
							object.animate({
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   256
											height:Eheight,
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   257
											width:MyWidth,
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   258
											y:config.heightmax-addEheight
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   259
											//x:object.attr("x")-(MyWidth/4)
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   260
											},200);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   261
					}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   262
			}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   263
		} else if (slices[id][0].state==1 && sens!=1){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   264
			slices[id][0].state=0;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   265
				slices[id][0].state=1;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   266
				var addEheight = 0;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   267
				for (var j=0; j<slices[id].length; j++) {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   268
					//trace("",j);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   269
					object = slices[id][j];
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   270
					if (j!=slices[id].length){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   271
						object.animate({ 	  height:object.heightStart,
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   272
											  width:frameSize-margin,
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   273
											  y:object.yStart
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   274
											  },180);					
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   275
					
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   276
					}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   277
			}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   278
		}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   279
	}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   280
		
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   281
	// tweet Drawing (in raphael) 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   282
	function DrawTweets (){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   283
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   284
		//=====================================
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   285
		// 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: 99
diff changeset
   286
		numberOfTweet = tweets.length;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   287
		for(var i=0; i<nbrframes; i++) {	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   288
			for(var j=0; j<numberOfTweet; j++) {	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   289
				if (i==tweets[j].yframe){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   290
					
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   291
					var k = tweets[j].qualification;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   292
					// make array for frame cluster
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   293
					if(frames[i]==undefined){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   294
						frames[i] = new Array();
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   295
					}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   296
					// count clusters
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   297
					if(frames[i][k]==undefined){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   298
						frames[i][k]=1;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   299
					}else{
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   300
						frames[i][k]+=1;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   301
					}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   302
				}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   303
			}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   304
		}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   305
			
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   306
		//=====================================
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   307
		var max 	= 0; // max of tweet by Frame 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   308
		for(var i=0; i<nbrframes; i++) {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   309
			var moy	= 0;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   310
			for (var j=1; j<6; j++){		
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   311
				if (frames[i]!=undefined){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   312
					if (frames[i][j]!=undefined){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   313
						moy += frames[i][j]
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   314
					}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   315
				}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   316
			}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   317
			//trace("frame "+i,moy);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   318
			if (moy>max){max=moy;}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   319
		}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   320
		//trace("frame max =",max);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   321
		
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   322
		//=====================================
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   323
		// draw cluster of tweet by frame ...
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   324
		for(var i=0; i<nbrframes; i++) {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   325
			var addEheight = 0;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   326
			slices[i] =  new Array();
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   327
			if (frames[i]!=undefined){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   328
				for (var j=6; j>0; j--){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   329
					if (frames[i][j]!=undefined){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   330
						//trace(" x ",i+" "+j);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   331
						var Eheight  = frames[i][j]*5;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   332
						//				x			y									w					h
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   333
						e = paper.rect(i*frameSize, config.heightmax-Eheight-addEheight, frameSize-margin, Eheight).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: 99
diff changeset
   334
						e.id = i;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   335
						e.state = 0; // 0 petit // 1 grand
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   336
						e.heightStart = Eheight;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   337
						e.yStart = config.heightmax-Eheight-addEheight;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   338
						addEheight +=Eheight;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   339
						e.mouseover(function () {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   340
							fisheye(this.id,1);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   341
						}).mouseout(function () {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   342
							fisheye(this.id,0);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   343
						});;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   344
						slices[i].push(e);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   345
					}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   346
					// ajouter cette objet 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   347
				
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   348
				}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   349
			}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   350
		}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   351
	}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   352
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   353
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   354
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   355
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   356
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   357
</script>
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   358
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   359
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   360
</div>
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   361
</body>
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   362
</html>