root / trunk / web / dojo / dojox / geo / charting / _base.js
History | View | Annotate | Download (1.49 KB)
1 | 9 | andrej.cim | /*
|
---|---|---|---|
2 | Copyright (c) 2004-2010, The Dojo Foundation All Rights Reserved.
|
||
3 | Available via Academic Free License >= 2.1 OR the modified BSD license.
|
||
4 | see: http://dojotoolkit.org/license for details
|
||
5 | */
|
||
6 | |||
7 | |||
8 | if(!dojo._hasResource["dojox.geo.charting._base"]){ |
||
9 | dojo._hasResource["dojox.geo.charting._base"]=true; |
||
10 | dojo.provide("dojox.geo.charting._base");
|
||
11 | dojo.require("dojo.NodeList-traverse");
|
||
12 | dojo.require("dojox.gfx.matrix");
|
||
13 | dojo.require("dijit.Tooltip");
|
||
14 | (function(){
|
||
15 | var _1=dojox.geo.charting;
|
||
16 | _1.showTooltip=function(_2,_3,_4){ |
||
17 | var _5=_1._normalizeArround(_3);
|
||
18 | return dijit.showTooltip(_2,_5,_4);
|
||
19 | }; |
||
20 | _1.hideTooltip=function(_6){ |
||
21 | return dijit.hideTooltip(_6);
|
||
22 | }; |
||
23 | _1._normalizeArround=function(_7){ |
||
24 | var _8=_1._getRealBBox(_7);
|
||
25 | var _9=_7._getRealMatrix()||{xx:1,xy:0,yx:0,yy:1,dx:0,dy:0}; |
||
26 | var _a=dojox.gfx.matrix.multiplyPoint(_9,_8.x,_8.y);
|
||
27 | var _b=dojo.coords(_1._getGfxContainer(_7));
|
||
28 | _7.x=dojo.coords(_b,true).x+_a.x,_7.y=dojo.coords(_b,true).y+_a.y,_7.width=_8.width*_9.xx,_7.height=_8.height*_9.yy; |
||
29 | return _7;
|
||
30 | }; |
||
31 | _1._getGfxContainer=function(_c){ |
||
32 | return (new dojo.NodeList(_c.rawNode)).parents("div")[0]; |
||
33 | }; |
||
34 | _1._getRealBBox=function(_d){ |
||
35 | var _e=_d.getBoundingBox();
|
||
36 | if(!_e){
|
||
37 | var _f=_d.children;
|
||
38 | var _e=dojo.clone(_1._getRealBBox(_f[0])); |
||
39 | dojo.forEach(_f,function(_10){
|
||
40 | var _11=_1._getRealBBox(_10);
|
||
41 | _e.x=Math.min(_e.x,_11.x); |
||
42 | _e.y=Math.min(_e.y,_11.y); |
||
43 | _e.endX=Math.max(_e.x+_e.width,_11.x+_11.width); |
||
44 | _e.endY=Math.max(_e.y+_e.height,_11.y+_11.height); |
||
45 | }); |
||
46 | _e.width=_e.endX-_e.x; |
||
47 | _e.height=_e.endY-_e.y; |
||
48 | } |
||
49 | return _e;
|
||
50 | }; |
||
51 | })(); |
||
52 | } |