src/js/widgets/stackGraphWidget.js
branchpopcorn-port
changeset 820 7968346b9689
parent 766 aa26ddaf2556
child 821 49013af6d50b
equal deleted inserted replaced
819:9b8e68803f6f 820:7968346b9689
    43     this.defaultcolorconf = (this._config.defaultcolor
    43     this.defaultcolorconf = (this._config.defaultcolor
    44         ? this._config.defaultcolor
    44         ? this._config.defaultcolor
    45         : _defaultDefColor);
    45         : _defaultDefColor);
    46     this.paper = new Raphael(this.selector[0], this.width, this.height);
    46     this.paper = new Raphael(this.selector[0], this.width, this.height);
    47     this.groups = [];
    47     this.groups = [];
    48     this.duration = this._serializer.currentMedia().meta["dc:duration"];
    48     this.duration = this._serializer.getDuration();
    49     
    49     
    50     var _annotationType = this._serializer.getTweets(),
    50     var _annotationType = this._serializer.getTweets(),
    51         _sliceDuration = ~~ ( this.duration / this.sliceCount),
    51         _sliceDuration = ~~ ( this.duration / this.sliceCount),
    52         _annotations = this._serializer._data.annotations,
    52         _annotations = this._serializer._data.annotations,
    53         _groupedAnnotations = IriSP._.range(this.sliceCount).map(function(_i) {
    53         _groupedAnnotations = IriSP._.range(this.sliceCount).map(function(_i) {
   160         .mousemove(function(event) {
   160         .mousemove(function(event) {
   161             _this.updateTooltip(event);
   161             _this.updateTooltip(event);
   162             
   162             
   163             // Also tell the world where the mouse is hovering.
   163             // Also tell the world where the mouse is hovering.
   164             var relX = event.pageX - _this.selector.offset().left;
   164             var relX = event.pageX - _this.selector.offset().left;
   165             var duration = _this._serializer.currentMedia().meta["dc:duration"];
   165             var duration = _this._serializer.getDuration();
   166             var Time = ((relX / _this.width) * duration).toFixed(2);
   166             var Time = ((relX / _this.width) * duration).toFixed(2);
   167             _this._Popcorn.trigger("IriSP.StackGraphWidget.mouseOver", Time);
   167             _this._Popcorn.trigger("IriSP.StackGraphWidget.mouseOver", Time);
   168 
   168 
   169         })
   169         })
   170         .mouseout(function() {
   170         .mouseout(function() {