246 <div id="tip"></div> |
246 <div id="tip"></div> |
247 <script type="text/javascript"> |
247 <script type="text/javascript"> |
248 $(document).mousemove(function(e){ |
248 $(document).mousemove(function(e){ |
249 if (over){ |
249 if (over){ |
250 tip.css("left", e.pageX-106).css("top", e.pageY-160); |
250 tip.css("left", e.pageX-106).css("top", e.pageY-160); |
251 tip.css("color", tipColor) |
251 tip.css("color", tipColor); |
252 tip.text(tipText); |
252 tip.text(tipText); |
253 } |
253 } |
254 }); |
254 }); |
255 var over = false; |
255 var over = false; |
256 var tip = $("#tip").hide(); |
256 var tip = $("#tip").hide(); |
434 x:8, |
434 x:8, |
435 y:418, |
435 y:418, |
436 width:650, |
436 width:650, |
437 height:70, |
437 height:70, |
438 heightmax:70 |
438 heightmax:70 |
439 } |
439 }; |
440 // Make and define the Raphael area |
440 // Make and define the Raphael area |
441 //var paper = Raphael(document.getElementById(config.target),config.width, config.height); |
441 //var paper = Raphael(document.getElementById(config.target),config.width, config.height); |
442 |
442 |
443 |
443 |
444 function ChartTimeLine (){ |
444 function ChartTimeLine (){ |
445 |
445 |
446 //var paper = Raphael(config.x, config.y,config.width, config.height); |
446 //var paper = Raphael(config.x, config.y,config.width, config.height); |
447 var paper = Raphael(document.getElementById("chartTimeline"),config.width, config.height); |
447 var paper = Raphael(config.target,config.width, config.height); |
|
448 var current = null; |
448 paper.rect(0,20,config.width,config.heightmax-20).attr({fill:"#fff","stroke-width":0.1,opacity: 0.1}); |
449 paper.rect(0,20,config.width,config.heightmax-20).attr({fill:"#fff","stroke-width":0.1,opacity: 0.1}); |
449 paper.rect(0,20,config.width,1).attr({fill:"#fff",stroke: "none"}); |
450 paper.rect(0,20,config.width,1).attr({fill:"#fff",stroke: "none"}); |
450 paper.rect(0,20,config.width,1).attr({fill:"#fff",stroke: "none"}); |
451 paper.rect(0,20,config.width,1).attr({fill:"#fff",stroke: "none"}); |
451 paper.rect(0,20,1,1).attr({fill:"#fff",stroke: "none"}); |
452 paper.rect(0,20,1,1).attr({fill:"#fff",stroke: "none"}); |
452 |
453 |
483 Frames = function(json){ |
484 Frames = function(json){ |
484 // make my clusters |
485 // make my clusters |
485 // ou Frame vide |
486 // ou Frame vide |
486 }; |
487 }; |
487 Frames.prototype.draw = function(){ |
488 Frames.prototype.draw = function(){ |
488 } |
489 }; |
489 Frames.prototype.zoom = function(){ |
490 Frames.prototype.zoom = function(){ |
490 } |
491 }; |
491 Frames.prototype.inside = function(){ |
492 Frames.prototype.inside = function(){ |
492 } |
493 }; |
493 var Clusters = function(){ |
494 var Clusters = function(){ |
494 var Object; |
495 var Object; |
495 var yDist; |
496 var yDist; |
496 var x; |
497 var x; |
497 var y; |
498 var y; |
623 for(var i=0; i<nbrframes; i++) { |
624 for(var i=0; i<nbrframes; i++) { |
624 var moy = 0; |
625 var moy = 0; |
625 for (var j=0; j<6; j++){ |
626 for (var j=0; j<6; j++){ |
626 if (frames[i]!=undefined){ |
627 if (frames[i]!=undefined){ |
627 if (frames[i].qualifVol[j]!=undefined){ |
628 if (frames[i].qualifVol[j]!=undefined){ |
628 moy += frames[i].qualifVol[j] |
629 moy += frames[i].qualifVol[j]; |
629 } |
630 } |
630 } |
631 } |
631 } |
632 } |
632 //trace("frame "+i,moy); |
633 //trace("frame "+i,moy); |
633 if (moy>max){max=moy;} |
634 if (moy>max){max=moy;} |
634 } |
635 } |
635 |
636 |
636 var tweetDrawed = new Array(); |
637 var tweetDrawed = new Array(); |
637 var TweetHeight = 5; |
638 var TweetHeight = 5; |
638 // DRAW TWEETS ============================================ |
639 // DRAW TWEETS ============================================ |
639 for(var i=0; i<nbrframes;i++) { |
640 for(var i=0; i<nbrframes;i++) { |
640 var addEheight = 5; |
641 var addEheight = 5; |
641 if (frames[i]!=undefined){ |
642 if (frames[i]!=undefined){ |
642 trace (i+" k=",frames[i].mytweetsID.length); |
643 trace (i+" k=",frames[i].mytweetsID.length); |
653 ).attr({stroke:"#00","stroke-width":0.1, fill: colors[j]}); |
654 ).attr({stroke:"#00","stroke-width":0.1, fill: colors[j]}); |
654 addEheight +=TweetHeight; |
655 addEheight +=TweetHeight; |
655 e.time= frames[i].mytweetsID[k].timeframe; |
656 e.time= frames[i].mytweetsID[k].timeframe; |
656 e.title= frames[i].mytweetsID[k].title; |
657 e.title= frames[i].mytweetsID[k].title; |
657 e.mouseover(function () { |
658 e.mouseover(function () { |
658 this.attr({stroke:"#fff","stroke-width":5}); |
659 if(this != current) { |
659 this.toFront(); |
660 to = this.attr("timeout"); |
|
661 if(to != null) { |
|
662 clearTimeout(to); |
|
663 } |
|
664 if(current != null) { |
|
665 current.attr({stroke:"#00","stroke-width":0.1}); |
|
666 } |
|
667 this.attr({stroke:"#fff","stroke-width":5}); |
|
668 this.toFront(); |
|
669 var elem = this; |
|
670 this.attr("timeout", |
|
671 setTimeout(function() { |
|
672 elem.attr({stroke:"#00","stroke-width":0.1}); |
|
673 current = null; |
|
674 }, 10000)); |
|
675 current = this; |
|
676 } |
660 }).mouseout(function () { |
677 }).mouseout(function () { |
661 this.attr({stroke:"#00","stroke-width":0.1}); |
678 this.attr({stroke:"#00","stroke-width":0.1}); |
|
679 current = null; |
|
680 clearTimeout(this.attr("timeout")); |
662 }).mousedown(function () { |
681 }).mousedown(function () { |
663 __IriSP.MyApiPlayer.seek(this.time/1000) |
682 __IriSP.MyApiPlayer.seek(this.time/1000); |
664 }); |
683 }); |
665 $(e.node).attr('id', 't'+k+''); |
684 $(e.node).attr('id', 't'+k+''); |
666 $(e.node).attr('title', frames[i].mytweetsID[k].title); |
685 $(e.node).attr('title', frames[i].mytweetsID[k].title); |
667 $(e.node).attr('begin', frames[i].mytweetsID[k].timeframe); |
686 $(e.node).attr('begin', frames[i].mytweetsID[k].timeframe); |
668 addTip(e.node, frames[i].mytweetsID[k].title,colors[j]); |
687 addTip(e.node, frames[i].mytweetsID[k].title,colors[j]); |