web/res/metadataplayer/test/chartTimeline4.html
author Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
Sun, 04 Mar 2012 14:05:19 +0100
changeset 532 bab9705ac861
parent 133 9578d3ddce17
permissions -rwxr-xr-x
change platform url
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
 <style type='text/css'> 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
     7
	#tip{
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
     8
	 position : absolute;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
     9
	 border : 1px solid gray;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    10
	 background-color : #efefef;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    11
	 padding : 3px;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    12
	 z-index: 1000000;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    13
	 /* set this to create word wrap */
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    14
	 max-width: 200px;
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
</style>
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    17
</head>
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    18
<body>
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
<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
    21
<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
    22
<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
    23
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    24
<div>
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    25
<!--
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    26
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    27
-->
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    28
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    29
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    30
532
bab9705ac861 change platform url
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 133
diff changeset
    31
<script type='text/javascript' src='http://ldt.iri.centrepompidou.fr/static/ldt/js/LdtPlayer.min.js'></script>
133
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    32
  <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
    33
  <script type="text/javascript">
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    34
	var config = {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    35
			/*metadata:{
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    36
				format:'cinelab',
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    37
				src:'metadata.json',
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    38
				load:'json'},*/
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    39
			metadata:{
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    40
				format:'cinelab',
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    41
				src:'http://www.iri.centrepompidou.fr//dev/ldt/ldtplatform/ldt/cljson/id/13b0aa52-336b-11e0-b233-00145ea49a02',
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    42
				load:'jsonp'},
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    43
			gui:{
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    44
				width:650,
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    45
				height:480,
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    46
				mode:'video',
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    47
				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
    48
				debug:false,
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    49
				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
    50
			player:{
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    51
				type:'jwplayer',
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    52
				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
    53
		};
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    54
	__IriSP.init(config);     
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    55
</script>
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    56
<div id="charttimeline" style="position:relative;display:block;"></div>
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    57
<div id="tip"></div>
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    58
<script type="text/javascript"> 
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
// CHART TIMELINE / VERSION PROTOTYPE  ::
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    61
//		- config
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    62
// 		- organisation classe
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    63
// 		!!!- rollover !! 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    64
// 		!!!!- legend  !!
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    65
//		- time cursor
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    66
// 		- seek !!
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    67
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    68
/*
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    69
	1 | 1D973D > vert 	> ++ > OK
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    70
	2 | C5A62D > orange	> ?? > Q
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    71
	3 | CE0A15 > rouge  > -- > KO
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    72
	4 | 036AAE > bleu   > == > REF
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    73
	5 | 585858 > gris   > NQ > ""
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    74
*/
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    75
	
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
	// configuration 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    78
	var config = {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    79
					target:"charttimeline",
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    80
					x:8,
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    81
					y:418,
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    82
					width:650,
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    83
					height:70,
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    84
					heightmax:70
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    85
					}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    86
	// 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
    87
	//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
    88
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    89
	var over = false;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    90
	var tip = $("#tip").hide();
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    91
	var tipText = "";
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    92
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    93
	function ChartTimeLine (){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    94
		
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
    95
		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
    96
		paper.rect(0,20,config.width,config.heightmax-20).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: 99
diff changeset
    97
		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
    98
		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
    99
		paper.rect(0,20,1,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
   100
		
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   101
		// variable 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   102
		
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   103
		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
   104
		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
   105
		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
   106
		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
   107
		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
   108
		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
   109
		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
   110
		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
   111
		var timeline;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   112
		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
   113
		
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   114
		// array 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   115
		var tweets  = new Array();
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   116
		var element = new Array();
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   117
		var cluster = new Array();
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   118
		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
   119
		var slices  = new Array();
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   120
		
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   121
		
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   122
		// Classes =======================================================================
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   123
		var Frames = function(){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   124
			
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   125
			var Myclusters;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   126
			var x;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   127
			var y;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   128
			var width;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   129
			var height;
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
		Frames = function(json){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   132
			// make my clusters
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   133
			// ou Frame vide 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   134
		};
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   135
		Frames.prototype.draw = function(){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   136
		}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   137
		Frames.prototype.zoom = function(){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   138
		}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   139
		Frames.prototype.inside = function(){
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
		var Clusters = function(){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   142
			var Object;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   143
			var yDist;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   144
			var x;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   145
			var y;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   146
			var width;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   147
			var height;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   148
		};
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   149
		Clusters = function(json){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   150
			// make my object
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   151
		};
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   152
		var Tweet = function(){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   153
		}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   154
		// Classes =======================================================================
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
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   159
		// trace function 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   160
		var traceNum = 0;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   161
		function trace(msg,value){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   162
			traceNum += 1;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   163
			$("<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
   164
		}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   165
		
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   166
		// Refactoring (parametere) ************************************************************
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   167
		// color translastion
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   168
		function colorTranslation(value){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   169
			if(value == "Q"){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   170
				return 2;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   171
			}else if(value =="REF"){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   172
				return 4;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   173
			}else if(value =="OK"){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   174
				return 1;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   175
			}else if(value =="KO"){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   176
				return 3;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   177
			}else if(value ==""){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   178
				return 5;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   179
			}
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
		
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
		// Refactoring (parametere) ************************************************************
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   184
		// 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
   185
		$.ajax({
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   186
		  dataType: "json",
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   187
		  url:"metadata.json",
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   188
		  success : function(json){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   189
			trace("load","");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   190
				$.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
   191
					
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   192
					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
   193
					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
   194
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   195
					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
   196
						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
   197
							
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   198
								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
   199
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   200
										tweets[numberOfTweet] = {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   201
													id:i,
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   202
													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
   203
													yIndicator:MyTime,
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   204
													yframe:Myframe,
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   205
													title:item.content['title'],
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   206
													timeframe:item.begin
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
										numberOfTweet+=1;
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
						}else{
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   211
							//trace("k = ",i);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   212
							tweets[numberOfTweet] = {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   213
										id:i,
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   214
										qualification:colorTranslation(""),
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   215
										yIndicator:MyTime,
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   216
										yframe:Myframe,
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   217
										title:item.content['title'],
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   218
										timeframe:item.begin
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   219
							}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   220
							numberOfTweet+=1;
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
					} else {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   224
						//trace("tweet qualification = ","null");
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   225
					}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   226
				});	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   227
			trace("======= ",numberOfTweet);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   228
		   DrawTweets ();
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   229
		   
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   230
		  }
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   231
		 });
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   232
			
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   233
		// tweet Drawing (in raphael) 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   234
		function DrawTweets (){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   235
			// 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
   236
			numberOfTweet = tweets.length;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   237
			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
   238
				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
   239
					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
   240
						
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   241
						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
   242
						// 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
   243
						if(frames[i]==undefined){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   244
							frames[i] = new Array();
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   245
						}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   246
						// count clusters
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   247
						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
   248
							frames[i][k]=1;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   249
						}else{
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   250
							frames[i][k]+=1;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   251
						}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   252
					}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   253
				}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   254
			}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   255
			
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   256
			// 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
   257
			var max 	= 0; 
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   258
			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
   259
				var moy	= 0;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   260
				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
   261
					if (frames[i]!=undefined){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   262
						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
   263
							moy += frames[i][j]
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   264
						}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   265
					}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   266
				}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   267
				//trace("frame "+i,moy);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   268
				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
   269
			}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   270
			
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   271
			// 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
   272
			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
   273
				var addEheight = 0;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   274
				slices[i] =  new Array();
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   275
				if (frames[i]!=undefined){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   276
					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
   277
						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
   278
							//trace(" x ",i+" "+j);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   279
							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
   280
							//				x			y									w					h
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   281
							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
   282
							e.id = i;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   283
							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
   284
							e.heightStart = Eheight;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   285
							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
   286
							addEheight +=Eheight;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   287
							/*
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   288
							e.mouseover(function () {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   289
								fisheye(this.id,1);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   290
							}).mouseout(function () {
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   291
								fisheye(this.id,0);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   292
							});*/
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   293
							slices[i].push(e);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   294
							//
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   295
							$(e.node).attr('id', 't'+i);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   296
							$(e.node).attr('title', tweets[i].title);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   297
							addTip(e.node,  tweets[i].title);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   298
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   299
						}			
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   300
					}
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
		// AddTip  ******************************************************************************
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   306
		function addTip(node, txt){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   307
			$(node).mouseenter(function(){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   308
			   tipText = txt;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   309
			   tip.fadeIn(0);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   310
			   over = true;
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   311
			}).mouseleave(function(){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   312
			   tip.fadeOut(0);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   313
			   over = false;
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
	}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   318
	
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   319
	$(document).mousemove(function(e){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   320
		if (over){
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   321
			tip.css("left", e.clientX+20).css("top", e.clientY+20);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   322
			tip.text(tipText);
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   323
		}
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   324
	});
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   325
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   326
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   327
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   328
	ChartTimeLine();
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   329
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   330
</script>
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   331
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   332
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   333
</div>
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   334
</body>
9578d3ddce17 correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents: 99
diff changeset
   335
</html>