dojox/charting/action2d/Highlight.js

  • Provides:

    • dojox.charting.action2d.Highlight
  • Requires:

    • dojox.charting.action2d.Base in common
    • dojox.color in common
  • dojox.charting.action2d.__HighlightCtorArgs

    • type
      Function
    • chains:
      • dojox.charting.action2d.__BaseCtorArgs: (prototype)
      • dojox.charting.action2d.__BaseCtorArgs: (call)
    • summary
      Additional arguments for highlighting actions.
  • dojox.charting.action2d.__HighlightCtorArgs.highlight

    • type
      String|dojo.Color|Function
    • summary
      Either a color or a function that creates a color when highlighting happens.
  • dojox.charting.action2d.Highlight

    • type
      Function
    • chains:
      • dojox.charting.action2d.Base: (prototype)
      • dojox.charting.action2d.Base: (call)
    • parameters:
      • chart: (typeof dojox.charting.Chart2D)
        The chart this action belongs to.
      • plot: (typeof String)
        The plot this action is attached to.  If not passed, "default" is assumed.
      • kwArgs: (typeof dojox.charting.action2d.__HighlightCtorArgs)
        Optional keyword arguments object for setting parameters.
    • source: [view]
         var a = kwArgs && kwArgs.highlight;
         this.colorFun = a ? (dojo.isFunction(a) ? a : cc(a)) : hl;


         this.connect();
    • summary
      Create the highlighting action and connect it to the plot.
  • dojox.charting.action2d.Highlight.defaultParams

    • type
      Object
    • summary
  • dojox.charting.action2d.Highlight.optionalParams

    • type
      Object
    • summary
  • dojox.charting.action2d.Highlight.process

    • type
      Function
    • parameters:
      • o: (typeof dojox.gfx.Shape)
        The object on which to process the highlighting action.
    • source: [view]
         if(!o.shape || !(o.type in this.overOutEvents)){ return; }


         var runName = o.run.name, index = o.index, anim, startFill, endFill;


         if(runName in this.anim){
          anim = this.anim[runName][index];
         }else{
          this.anim[runName] = {};
         }


         if(anim){
          anim.action.stop(true);
         }else{
          var color = o.shape.getFill();
          if(!color || !(color instanceof dojo.Color)){
           return;
          }
          this.anim[runName][index] = anim = {
           start: color,
           end: this.colorFun(color)
          };
         }


         var start = anim.start, end = anim.end;
         if(o.type == "onmouseout"){
          // swap colors
          var t = start;
          start = end;
          end = t;
         }


         anim.action = dojox.gfx.fx.animateFill({
          shape: o.shape,
          duration: this.duration,
          easing: this.easing,
          color: {start: start, end: end}
         });
         if(o.type == "onmouseout"){
          dojo.connect(anim.action, "onEnd", this, function(){
           if(this.anim[runName]){
            delete this.anim[runName][index];
           }
          });
         }
         anim.action.play();
    • summary
      Process the action on the given object.
  • dojox.charting.action2d.Highlight.defaultParams.duration

    • summary
  • dojox.charting.action2d.Highlight.defaultParams.easing

    • summary
  • dojox.charting.action2d.Highlight.optionalParams.highlight

    • summary
  • dojox.charting.action2d.Highlight.colorFun

    • summary
  • DEFAULT_LUMINOSITY1

    • summary
  • DEFAULT_LUMINOSITY2

    • summary
  • c

    • summary
  • cc

    • type
      Function
    • parameters:
      • color: (typeof )
    • source: [view]
         return function(){ return color; };
    • summary
  • hl

    • type
      Function
    • parameters:
      • color: (typeof )
    • source: [view]
         var a = new c.Color(color),
          x = a.toHsl();
         if(x.s == 0){
          x.l = x.l < 50 ? 100 : 0;
         }else{
          x.s = DEFAULT_SATURATION;
          if(x.l < DEFAULT_LUMINOSITY2){
           x.l = DEFAULT_LUMINOSITY1;
          }else if(x.l > DEFAULT_LUMINOSITY1){
           x.l = DEFAULT_LUMINOSITY2;
          }else{
           x.l = x.l - DEFAULT_LUMINOSITY2 > DEFAULT_LUMINOSITY1 - x.l ?
            DEFAULT_LUMINOSITY2 : DEFAULT_LUMINOSITY1;
          }
         }
         return c.fromHsl(x);
    • summary
  • dojox.charting.action2d

    • type
      Object
    • summary
  • dojox.charting

    • type
      Object
    • summary
  • dojox

    • type
      Object
    • summary