dojox/charting/action2d/Magnify.js

  • Provides:

    • dojox.charting.action2d.Magnify
  • Requires:

    • dojox.charting.action2d.Base in common
    • dojox.gfx.matrix in common
    • dojo.fx in common in project dojo
  • dojox.charting.action2d.__MagnifyCtorArgs

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

    • type
      Number
    • summary
      The amount to magnify the given object to.  Default is 2.
  • dojox.charting.action2d.Magnify

    • 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 to apply the action to. If not passed, "default" is assumed.
      • kwArgs: (typeof )
    • source: [view]
      dojo.provide("dojox.charting.action2d.Magnify");


      dojo.require("dojox.charting.action2d.Base");
      dojo.require("dojox.gfx.matrix");
      dojo.require("dojo.fx");




      dojo.declare("dojox.charting.action2d.__MagnifyCtorArgs", dojox.charting.action2d.__BaseCtorArgs, {
       // summary:
       //  Additional arguments for highlighting actions.


       // scale: Number?
       //  The amount to magnify the given object to. Default is 2.
       scale: 2
      });


      (function(){
       var DEFAULT_SCALE = 2,
        m = dojox.gfx.matrix,
        gf = dojox.gfx.fx;


       dojo.declare("dojox.charting.action2d.Magnify", dojox.charting.action2d.Base, {
        // summary:
        //  Create an action that magnifies the object the action is applied to.


        // the data description block for the widget parser
        defaultParams: {
         duration: 400, // duration of the action in ms
         easing: dojo.fx.easing.backOut, // easing for the action
         scale: DEFAULT_SCALE // scale of magnification
        },
        optionalParams: {}, // no optional parameters


        constructor: function(chart, plot, kwArgs){
         // summary:
         //  Create the magnifying action.
         // chart: dojox.charting.Chart2D
         //  The chart this action belongs to.
         // plot: String?
         //  The plot to apply the action to. If not passed, "default" is assumed.
         // kwArgs: dojox.charting.action2d.__MagnifyCtorArgs?
         //  Optional keyword arguments for this action.


         // process optional named parameters
         this.scale = kwArgs && typeof kwArgs.scale == "number" ? kwArgs.scale : DEFAULT_SCALE;


         this.connect();
    • summary
      Create the magnifying action.
  • dojox.charting.action2d.Magnify.defaultParams

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

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

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


         var runName = o.run.name, index = o.index, vector = [], anim, init, scale;


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


         if(anim){
          anim.action.stop(true);
         }else{
          this.anim[runName][index] = anim = {};
         }


         if(o.type == "onmouseover"){
          init = m.identity;
          scale = this.scale;
         }else{
          init = m.scaleAt(this.scale, o.cx, o.cy);
          scale = 1 / this.scale;
         }


         var kwArgs = {
          shape: o.shape,
          duration: this.duration,
          easing: this.easing,
          transform: [
           {name: "scaleAt", start: [1, o.cx, o.cy], end: [scale, o.cx, o.cy]},
           init
          ]
         };
         if(o.shape){
          vector.push(gf.animateTransform(kwArgs));
         }
         if(o.oultine){
          kwArgs.shape = o.outline;
          vector.push(gf.animateTransform(kwArgs));
         }
         if(o.shadow){
          kwArgs.shape = o.shadow;
          vector.push(gf.animateTransform(kwArgs));
         }


         if(!vector.length){
          delete this.anim[runName][index];
          return;
         }


         anim.action = dojo.fx.combine(vector);
         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.Magnify.defaultParams.duration

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

    • summary
  • dojox.charting.action2d.Magnify.defaultParams.scale

    • summary
  • dojox.charting.action2d.Magnify.scale

    • summary
  • m

    • summary
  • gf

    • summary
  • dojox.charting.action2d

    • type
      Object
    • summary
  • dojox.charting

    • type
      Object
    • summary
  • dojox

    • type
      Object
    • summary