dojox/geo/charting/_Feature.js

  • Provides:

    • dojox.geo.charting._Feature
  • Requires:

    • dojox.gfx.fx in common
  • dojox.geo.charting._Feature

    • type
      Function
    • parameters:
      • parent: (typeof )
      • name: (typeof )
      • shapeData: (typeof )
    • source: [view]
        this.id = name;
        this.shape = parent.mapObj.createGroup();
        this.parent = parent;
        this.mapObj = parent.mapObj;
        this._bbox = shapeData.bbox;
        this._center = shapeData.center;
        //TODO: fill color would be defined by charting data and legend
        //this._defaultFill = ["#FFCE52", "#CE6342", "#63A584"][Math.floor(Math.random() * 3)];
        this._defaultFill = parent.defaultColor;
        this._highlightFill = parent.highlightColor;
        this._defaultStroke = {
         width: this._normalizeStrokeWeight(.5),
         color: "white"
        };
        this._scale = Math.min(this.parent.containerSize.w / this._bbox.w, this.parent.containerSize.h / this._bbox.h);

        
        var shapes = (dojo.isArray(shapeData.shape[0])) ? shapeData.shape : [shapeData.shape];
        dojo.forEach(shapes, function(points){
         this.shape.createPolyline(points).setStroke(this._defaultStroke).setFill(this._defaultFill);
        }, this);
    • summary
  • dojox.geo.charting._Feature._isZoomIn

    • summary
  • dojox.geo.charting._Feature._isFocused

    • summary
  • dojox.geo.charting._Feature.markerText

    • summary
  • dojox.geo.charting._Feature.setValue

    • summary
  • dojox.geo.charting._Feature._setFillWith

    • type
      Function
    • parameters:
      • color: (typeof )
    • source: [view]
        var borders = (dojo.isArray(this.shape.children)) ? this.shape.children : [this.shape.children];
        dojo.forEach(borders, function(item){
         item.setFill(color);
        });
    • summary
  • dojox.geo.charting._Feature._setStrokeWith

    • type
      Function
    • parameters:
      • stroke: (typeof )
    • source: [view]
        var borders = (dojo.isArray(this.shape.children)) ? this.shape.children : [this.shape.children];
        dojo.forEach(borders, function(item){
         item.setStroke({
          color: stroke.color,
          width: stroke.width,
          join: "round"
         });
        });
    • summary
  • dojox.geo.charting._Feature._normalizeStrokeWeight

    • type
      Function
    • parameters:
      • weight: (typeof )
    • source: [view]
        var matrix = this.shape._getRealMatrix();
        return (dojox.gfx.renderer != "vml")?weight/(this.shape._getRealMatrix()||{xx:1}).xx:weight;
    • summary
  • dojox.geo.charting._Feature._onmouseoverHandler

    • type
      Function
    • parameters:
      • evt: (typeof )
    • source: [view]
        this.parent.onFeatureOver(this);
        this._setFillWith(this._highlightFill);
        this.mapObj.marker.show(this.id);
    • summary
  • dojox.geo.charting._Feature._onmouseoutHandler

    • type
      Function
    • source: [view]
        this._setFillWith(this._defaultFill);
        this.mapObj.marker.hide();
        dojo.style("mapZoomCursor", "display", "none");
    • summary
  • dojox.geo.charting._Feature._onmousemoveHandler

    • type
      Function
    • parameters:
      • evt: (typeof )
    • source: [view]
        if(this._isFocused){
         var evt = dojo.fixEvent(evt || window.event);
         dojo.style("mapZoomCursor", "left", evt.pageX + 12 + "px");
         dojo.style("mapZoomCursor", "top", evt.pageY + "px");
         dojo.byId("mapZoomCursor").className = (this._isZoomIn)?"mapZoomOut":"mapZoomIn";
         dojo.style("mapZoomCursor", "display", "block");
        }
    • summary
  • dojox.geo.charting._Feature._onclickHandler

    • type
      Function
    • source: [view]
        if(!this._isFocused){
         for (var name in this.mapObj.features){
          if (this.mapObj.features[name] != this){
           this.mapObj.features[name]._setStrokeWith(this._defaultStroke);
           this.mapObj.features[name]._setFillWith(this.mapObj.features[name]._defaultFill);
           this.mapObj.features[name]._isFocused = false;
           this.mapObj.features[name]._isZoomIn = false;
          }
         }
         this._focus();
        }
        else if (this._isZoomIn){
         this._zoomOut();
        }
        else {
         this._zoomIn();
        }
    • summary
  • dojox.geo.charting._Feature._focus

    • type
      Function
    • source: [view]
        this.shape._moveToFront();
        this._setStrokeWith({color:"black",width:this._normalizeStrokeWeight(2)});
        this.parent.onFeatureClick(this);
        this._isFocused = true;
    • summary
  • dojox.geo.charting._Feature._zoomIn

    • type
      Function
    • source: [view]
        var anim = dojox.gfx.fx.animateTransform({
         duration: 1000,
         shape: this.mapObj,
         transform: [{
          name: "translate",
          start: [-this.mapObj.currentBBox.x, -this.mapObj.currentBBox.y],
          end: [-this._bbox.x, -this._bbox.y]
         },{
          name: "scaleAt",
          start: [this.mapObj.currentScale, this.mapObj.currentBBox.x, this.mapObj.currentBBox.y],
          end: [this._scale, this._bbox.x, this._bbox.y]
         }]
        });
        dojo.connect(anim,"onEnd",this,function(){
         this._setStrokeWith({color:"black",width:this._normalizeStrokeWeight(2)});
         this.parent.onZoomEnd(this);
        });
        anim.play();
        this.mapObj.currentScale = this._scale;
        this.mapObj.currentBBox = {
         x: this._bbox.x,
         y: this._bbox.y
        };
        this._isZoomIn = true;
        dojo.byId("mapZoomCursor").className = "";
    • summary
  • dojox.geo.charting._Feature._zoomOut

    • type
      Function
    • source: [view]
        var anim = dojox.gfx.fx.animateTransform({
         duration: 1000,
         shape: this.mapObj,
         transform: [{
          name: "translate",
          start: [-this._bbox.x, -this._bbox.y],
          end: [-this.mapObj.boundBox[0], -this.mapObj.boundBox[1]]
         }, {
          name: "scaleAt",
          start: [this._scale, this._bbox.x, this._bbox.y],
          end: [this.mapObj.scale, this.mapObj.boundBox[0], this.mapObj.boundBox[1]]
         }]
        });
        dojo.connect(anim,"onEnd",this,function(){
         this._setStrokeWith({color:"black",width:this._normalizeStrokeWeight(2)});
        });
        anim.play();
        this.mapObj.currentScale = this.mapObj.scale;
        this.mapObj.currentBBox = {
         x: this.mapObj.boundBox[0],
         y: this.mapObj.boundBox[1]
        };
        this._isZoomIn = false;
        dojo.byId("mapZoomCursor").className = "";
    • summary
  • dojox.geo.charting._Feature.init

    • type
      Function
    • source: [view]
        this.shape.rawNode.id = this.id;
        this.tooltip = null;
        this.shape.connect("onmouseover", this, this._onmouseoverHandler);
        this.shape.connect("onmouseout", this, this._onmouseoutHandler);
        this.shape.connect("onmousemove", this, this._onmousemoveHandler);
        this.shape.connect("onclick", this, this._onclickHandler);
    • summary
  • dojox.geo.charting._Feature.mapObj.currentScale

    • summary
  • dojox.geo.charting._Feature.mapObj.currentBBox

    • summary
  • dojox.geo.charting._Feature.shape.rawNode.id

    • summary
  • dojox.geo.charting._Feature.tooltip

    • summary
  • dojox.geo.charting._Feature.id

    • summary
  • dojox.geo.charting._Feature.shape

    • summary
  • dojox.geo.charting._Feature.parent

    • summary
  • dojox.geo.charting._Feature.mapObj

    • summary
  • dojox.geo.charting._Feature._bbox

    • summary
  • dojox.geo.charting._Feature._center

    • summary
  • dojox.geo.charting._Feature._defaultFill

    • summary
  • dojox.geo.charting._Feature._highlightFill

    • summary
  • dojox.geo.charting._Feature._defaultStroke

    • summary
  • dojox.geo.charting._Feature._scale

    • summary
  • dojox.geo.charting

    • type
      Object
    • summary
  • dojox.geo

    • type
      Object
    • summary
  • dojox

    • type
      Object
    • summary