├── .gitignore ├── LICENSE ├── README.md ├── app.yaml ├── css └── vtree.css ├── favicon.ico ├── index.html ├── index.yaml ├── js └── vtree.min.js ├── main.py └── vpyast.png /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | 5 | # C extensions 6 | *.so 7 | 8 | # Distribution / packaging 9 | .Python 10 | env/ 11 | bin/ 12 | build/ 13 | develop-eggs/ 14 | dist/ 15 | eggs/ 16 | lib/ 17 | lib64/ 18 | parts/ 19 | sdist/ 20 | var/ 21 | *.egg-info/ 22 | .installed.cfg 23 | *.egg 24 | 25 | # Installer logs 26 | pip-log.txt 27 | pip-delete-this-directory.txt 28 | 29 | # Unit test / coverage reports 30 | htmlcov/ 31 | .tox/ 32 | .coverage 33 | .cache 34 | nosetests.xml 35 | coverage.xml 36 | 37 | # Translations 38 | *.mo 39 | 40 | # Mr Developer 41 | .mr.developer.cfg 42 | .project 43 | .pydevproject 44 | 45 | # Rope 46 | .ropeproject 47 | 48 | # Django stuff: 49 | *.log 50 | *.pot 51 | 52 | # Sphinx documentation 53 | docs/_build/ 54 | 55 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "{}" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright {yyyy} {name of copyright owner} 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | vpyast 2 | ====== 3 | 4 | > このソフトを、モンティ・パイソンへ捧げます。 5 | 6 | Python AST Visualizer 7 | 8 | 9 | [site](http://vpyast.appspot.com/) 10 | 11 | 12 | ![Screenshot](https://github.com/ivan111/vpyast/raw/master/vpyast.png) 13 | -------------------------------------------------------------------------------- /app.yaml: -------------------------------------------------------------------------------- 1 | application: vpyast 2 | version: 1 3 | runtime: python27 4 | api_version: 1 5 | threadsafe: yes 6 | 7 | handlers: 8 | - url: /favicon\.ico 9 | static_files: favicon.ico 10 | upload: favicon\.ico 11 | 12 | - url: / 13 | static_files: index.html 14 | upload: index\.html 15 | 16 | - url: /css 17 | static_dir: css 18 | 19 | - url: /js 20 | static_dir: js 21 | 22 | - url: .* 23 | script: main.app 24 | 25 | libraries: 26 | - name: webapp2 27 | version: "2.5.2" 28 | -------------------------------------------------------------------------------- /css/vtree.css: -------------------------------------------------------------------------------- 1 | fieldset { 2 | margin: 8px; 3 | padding: 4px; 4 | height: 68px; 5 | float: left; 6 | display: inline; 7 | white-space: nowrap; 8 | } 9 | 10 | 11 | fieldset input { 12 | margin: 4px; 13 | padding: 4px; 14 | } 15 | 16 | 17 | svg { 18 | overflow: hidden; 19 | background: #ffffff; 20 | -webkit-box-shadow: 4px 4px 8px rgba(0,0,0,0.5); 21 | -moz-box-shadow : 4px 4px 8px rgba(0,0,0,0.5); 22 | box-shadow : 4px 4px 8px rgba(0,0,0,0.5); 23 | } 24 | 25 | 26 | svg .vtree-node text { 27 | cursor: pointer; 28 | } 29 | 30 | 31 | svg circle.vtree-dummy { 32 | cursor: pointer; 33 | stroke: steelblue; 34 | stroke-width: 2px; 35 | fill: white; 36 | } 37 | 38 | 39 | svg .vtree-node text { 40 | font: 14px sans-serif; 41 | } 42 | 43 | 44 | svg .vtree-link { 45 | fill: none; 46 | stroke: #ccc; 47 | stroke-width: 2px; 48 | } 49 | 50 | 51 | svg .vtree-table { 52 | stroke-width: 2px; 53 | stroke: steelblue; 54 | } 55 | 56 | 57 | svg path.vtree-table { 58 | fill: white; 59 | cursor: pointer; 60 | } 61 | 62 | 63 | .vtree-tooltip { 64 | position: absolute; 65 | text-align: center; 66 | padding: 2px; 67 | font: 12px sans-serif; 68 | background: lightsteelblue; 69 | border: 0px; 70 | border-radius: 8px; 71 | pointer-events: none; 72 | } 73 | -------------------------------------------------------------------------------- /favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ivan111/vpyast/8e878b6b3e2b5a25a641af00df611cb70a4ba73e/favicon.ico -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Python AST Visualizer 7 | 8 | 9 | 10 | 11 | 90 | 91 | 92 | 93 | 94 | 95 | Home 96 | 97 |

Python AST Visualizer

98 | 99 |

Ver 0.0.7.2.1 github

100 | 101 |
102 | 106 |
107 | 108 |

109 | 110 |
111 | 112 |
113 | Functions 114 | 115 |
116 | 117 |
118 | Visibility 119 | Array Node   120 | Link Name   121 | Column 1   122 | Column 2   123 |
124 | 125 |
126 | Max Length 127 | 130 | 133 |
134 | 135 |
136 | 137 |
138 |
139 | 140 |
141 | 142 | 143 |

Created Date: 2014-08-02

144 | 145 | 146 | 147 | 148 | -------------------------------------------------------------------------------- /index.yaml: -------------------------------------------------------------------------------- 1 | indexes: 2 | 3 | # AUTOGENERATED 4 | 5 | # This index.yaml is automatically updated whenever the dev_appserver 6 | # detects that a new type of query is run. If you want to manage the 7 | # index.yaml file manually, remove the above marker line (the line 8 | # saying "# AUTOGENERATED"). If you want to manage some indexes 9 | # manually, move them above the marker line. The index.yaml file is 10 | # automatically uploaded to the admin console when you next deploy 11 | # your application using appcfg.py. 12 | 13 | -------------------------------------------------------------------------------- /js/vtree.min.js: -------------------------------------------------------------------------------- 1 | !function(){function C(a,b){return ab?1:a>=b?0:NaN}function Y(a){return null!=a&&!isNaN(a)}function S(a){return{left:function(b,c,d,e){3>arguments.length&&(d=0);4>arguments.length&&(e=b.length);for(;d>>1;0>a(b[f],c)?d=f+1:e=f}return d},right:function(b,c,d,e){3>arguments.length&&(d=0);4>arguments.length&&(e=b.length);for(;d>>1;0arguments.length)return g&&g.on;g&&(g.on=null,c=c.slice(0,h=c.indexOf(g)).concat(c.slice(h+1)),d.remove(b));f&&c.push(d.set(b,{on:f}));return a};return b}function Q(){k.event.preventDefault()}function Ga(){for(var a=k.event,b;b=a.sourceEvent;)a=b; 4 | return a}function O(a){for(var b=new ga,c=0,d=arguments.length;++c=b&&(b=e+1);!(e= 9 | d[b])&&++bLc&&(ka.scrollX||ka.scrollY)){var c=k.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important"),e=c[0][0].getScreenCTM();Lc=!(e.f||e.e);c.remove()}Lc?(d.x=b.pageX,d.y=b.pageY):(d.x=b.clientX,d.y=b.clientY); 12 | d=d.matrixTransform(a.getScreenCTM().inverse());return[d.x,d.y]}c=a.getBoundingClientRect();return[b.clientX-c.left-a.clientLeft,b.clientY-c.top-a.clientTop]}function tg(){return k.event.changedTouches[0].identifier}function ug(){return k.event.target}function vg(){return ka}function Mc(a,b,c){return(b[0]-a[0])*(c[1]-a[1])-(b[1]-a[1])*(c[0]-a[0])}function Vd(a){return 1a?K:Math.acos(a)}function hb(a){return 1a?-ha:Math.asin(a)}function Wd(a){return((a=Math.exp(a))+1/a)/2}function Xd(a){return(a= 13 | Math.sin(a/2))*a}function Ya(){}function Ba(a,b,c){return this instanceof Ba?void(this.h=+a,this.s=+b,this.l=+c):2>arguments.length?a instanceof Ba?new Ba(a.h,a.s,a.l):Yd(""+a,Zd,Ba):new Ba(a,b,c)}function Nc(a,b,c){function d(a){360a&&(a+=360);return 60>a?e+(f-e)*a/60:180>a?f:240>a?e+(f-e)*(240-a)/60:e}var e,f;a=isNaN(a)?0:0>(a%=360)?a+360:a;b=isNaN(b)?0:0>b?0:1c?0:1=c?c*(1+b):c+b-c*b;e=2*c-f;return new la(Math.round(255*d(a+120)),Math.round(255*d(a)),Math.round(255* 14 | d(a-120)))}function va(a,b,c){return this instanceof va?void(this.h=+a,this.c=+b,this.l=+c):2>arguments.length?a instanceof va?new va(a.h,a.c,a.l):a instanceof wa?$d(a.l,a.a,a.b):$d((a=ae((a=k.rgb(a)).r,a.g,a.b)).l,a.a,a.b):new va(a,b,c)}function Oc(a,b,c){isNaN(a)&&(a=0);isNaN(b)&&(b=0);return new wa(c,Math.cos(a*=H)*b,Math.sin(a)*b)}function wa(a,b,c){return this instanceof wa?void(this.l=+a,this.a=+b,this.b=+c):2>arguments.length?a instanceof wa?new wa(a.l,a.a,a.b):a instanceof va?Oc(a.l,a.c,a.h): 15 | ae((a=la(a)).r,a.g,a.b):new wa(a,b,c)}function be(a,b,c){a=(a+16)/116;c=a-c/200;b=Pc(a+b/500)*ce;a=Pc(a)*de;c=Pc(c)*ee;return new la(Qc(3.2404542*b-1.5371385*a-.4985314*c),Qc(-.969266*b+1.8760108*a+.041556*c),Qc(.0556434*b-.2040259*a+1.0572252*c))}function $d(a,b,c){return 0=a?12.92*a:1.055*Math.pow(a,1/2.4)-.055))}function la(a,b,c){return this instanceof la?void(this.r=~~a,this.g=~~b,this.b=~~c):2>arguments.length?a instanceof la?new la(a.r,a.g,a.b):Yd(""+a,la,Nc):new la(a,b,c)}function Nb(a){return new la(a>>16,a>>8&255,a&255)+""}function ib(a){return 16>a?"0"+Math.max(0,a).toString(16):Math.min(255,a).toString(16)}function Yd(a,b,c){var d=0,e=0,f=0,g,h;if(g=/([a-z]+)\((.*)\)/i.exec(a))switch(h=g[2].split(","),g[1]){case "hsl":return c(parseFloat(h[0]),parseFloat(h[1])/ 17 | 100,parseFloat(h[2])/100);case "rgb":return b(Sc(h[0]),Sc(h[1]),Sc(h[2]))}if(c=Ob.get(a))return b(c.r,c.g,c.b);null==a||"#"!==a.charAt(0)||isNaN(c=parseInt(a.substring(1),16))||(4===a.length?(d=(c&3840)>>4,d|=d>>4,e=c&240,e|=e>>4,f=c&15,f|=f<<4):7===a.length&&(d=(c&16711680)>>16,e=(c&65280)>>8,f=c&255));return b(d,e,f)}function Zd(a,b,c){var d=Math.min(a/=255,b/=255,c/=255),e=Math.max(a,b,c),f=e-d,g=(e+d)/2;f?(d=.5>g?f/(e+d):f/(2-e-d),a=60*(a==e?(b-c)/f+(bg?0:a);return new Ba(a,d,g)}function ae(a,b,c){a=Tc(a);b=Tc(b);c=Tc(c);var d=Rc((.4124564*a+.3575761*b+.1804375*c)/ce),e=Rc((.2126729*a+.7151522*b+.072175*c)/de);a=Rc((.0193339*a+.119192*b+.9503041*c)/ee);return wa(116*e-16,500*(d-e),200*(e-a))}function Tc(a){return.04045>=(a/=255)?a/12.92:Math.pow((a+.055)/1.055,2.4)}function Sc(a){var b=parseFloat(a);return"%"===a.charAt(a.length-1)?Math.round(2.55*b):b}function V(a){return"function"===typeof a?a:function(){return a}}function ea(a){return a} 19 | function Uc(a){return function(b,c,d){2===arguments.length&&"function"===typeof c&&(d=c,c=null);return Pb(b,c,a,d)}}function Pb(a,b,c,d){function e(){var a=m.status,b;if(!a&&m.responseText||200<=a&&300>a||304===a){try{b=c.call(f,m)}catch(d){g.error.call(f,d);return}g.load.call(f,b)}else g.error.call(f,m)}var f={},g=k.dispatch("beforesend","progress","load","error"),h={},m=new XMLHttpRequest,n=null;!ka.XDomainRequest||"withCredentials"in m||!/^(http(s)?:)?\/\//.test(a)||(m=new XDomainRequest);"onload"in 20 | m?m.onload=m.onerror=e:m.onreadystatechange=function(){3arguments.length)return h[a];null==b?delete h[a]:h[a]=b+"";return f};f.mimeType=function(a){if(!arguments.length)return b;b=null==a?null:a+"";return f};f.responseType=function(a){if(!arguments.length)return n;n=a;return f};f.response=function(a){c=a;return f};["get","post"].forEach(function(a){f[a]= 21 | function(){return f.send.apply(f,[a].concat(Qa(arguments)))}});f.send=function(c,d,e){2===arguments.length&&"function"===typeof d&&(e=d,d=null);m.open(c,a,!0);null==b||"accept"in h||(h.accept=b+",*/*");if(m.setRequestHeader)for(var k in h)m.setRequestHeader(k,h[k]);null!=b&&m.overrideMimeType&&m.overrideMimeType(b);null!=n&&(m.responseType=n);if(null!=e)f.on("error",e).on("load",function(a){e(null,a)});g.beforesend.call(f,m);m.send(null==d?null:d);return f};f.abort=function(){m.abort();return f}; 22 | k.rebind(f,g,"on");return null==d?f:f.get(wg(d))}function wg(a){return 1===a.length?function(b,c){a(null==b?c:null)}:a}function Vc(){var a=fe(),a=ge()-a;24=Ja.t&&(Ja.f=Ja.c(a-Ja.t)),Ja=Ja.n;return a}function ge(){for(var a,b=Sb,c=Infinity;b;)b.f?b=a?a.n=b.n:Sb=b.n:(b.t",n=a[3]||"",r=a[4]||"",t=a[5],q=+a[6],J=a[7],A=a[8],v=a[9],x=1,E="",L="",D=!1;A&&(A=+A.substring(1));if(t||"0"===c&&"="===d)t=c="0",d="=",J&&(q-=Math.floor((q-1)/4));switch(v){case "n":J=!0;v="g";break;case "%":x=100;L="%";v="f";break;case "p":x=100; 24 | L="%";v="r";break;case "b":case "o":case "x":case "X":"#"===r&&(E="0"+v.toLowerCase());case "c":case "d":D=!0;A=0;break;case "s":x=-1,v="r"}"$"===r&&(E=e[0],L=e[1]);"r"!=v||A||(v="g");if(null!=A)if("g"==v)A=Math.max(1,Math.min(21,A));else if("e"==v||"f"==v)A=Math.max(0,Math.min(20,A));var v=yg.get(v)||zg,F=t&&J;return function(a){var e=L;if(D&&a%1)return"";var g=0>a||0===a&&0>1/a?(a=-a,"-"):n;0>x?(e=k.formatPrefix(a,A),a=e.scale(a),e=e.symbol+L):a*=x;a=v(a,A);var r=a.lastIndexOf("."),X=0>r?a:a.substring(0, 25 | r);a=0>r?"":b+a.substring(r+1);!t&&J&&(X=f(X));var r=E.length+X.length+a.length+(F?0:g.length),jb=r"===d?jb+g+a:"^"===d?jb.substring(0,r>>=1)+g+a+jb.substring(r):g+(F?a:jb+a))+e}}}function zg(a){return a+""}function Ka(){this._=new Date(1=g)return-1;e=b.charCodeAt(f++);if(37===e){if(e=b.charAt(f++),e=l[e in ke?b.charAt(f++):e],!e||0>(d=e(a,c,d)))return-1}else if(e!=c.charCodeAt(d++))return-1}return d}var d=a.dateTime,e=a.date,f=a.time,g=a.periods,h=a.days, 29 | m=a.shortDays,n=a.months,r=a.shortMonths;b.utc=function(a){function c(a){try{ja=Ka;var b=new ja;b._=a;return d(b)}finally{ja=Date}}var d=b(a);c.parse=function(a){try{ja=Ka;var b=d.parse(a);return b&&b._}finally{ja=Date}};c.toString=d.toString;return c};b.multi=b.utc.multi=Bg;var t=k.map(),q=Vb(h),J=Wb(h),A=Vb(m),v=Wb(m),x=Vb(n),E=Wb(n),L=Vb(r),D=Wb(r);g.forEach(function(a,b){t.set(a.toLowerCase(),b)});var F={a:function(a){return m[a.getDay()]},A:function(a){return h[a.getDay()]},b:function(a){return r[a.getMonth()]}, 30 | B:function(a){return n[a.getMonth()]},c:b(d),d:function(a,b){return ma(a.getDate(),b,2)},e:function(a,b){return ma(a.getDate(),b,2)},H:function(a,b){return ma(a.getHours(),b,2)},I:function(a,b){return ma(a.getHours()%12||12,b,2)},j:function(a,b){return ma(1+z.dayOfYear(a),b,3)},L:function(a,b){return ma(a.getMilliseconds(),b,3)},m:function(a,b){return ma(a.getMonth()+1,b,2)},M:function(a,b){return ma(a.getMinutes(),b,2)},p:function(a){return g[+(12<=a.getHours())]},S:function(a,b){return ma(a.getSeconds(), 31 | b,2)},U:function(a,b){return ma(z.sundayOfYear(a),b,2)},w:function(a){return a.getDay()},W:function(a,b){return ma(z.mondayOfYear(a),b,2)},x:b(e),X:b(f),y:function(a,b){return ma(a.getFullYear()%100,b,2)},Y:function(a,b){return ma(a.getFullYear()%1E4,b,4)},Z:Cg,"%":function(){return"%"}},l={a:function(a,b,c){A.lastIndex=0;return(b=A.exec(b.substring(c)))?(a.w=v.get(b[0].toLowerCase()),c+b[0].length):-1},A:function(a,b,c){q.lastIndex=0;return(b=q.exec(b.substring(c)))?(a.w=J.get(b[0].toLowerCase()), 32 | c+b[0].length):-1},b:function(a,b,c){L.lastIndex=0;return(b=L.exec(b.substring(c)))?(a.m=D.get(b[0].toLowerCase()),c+b[0].length):-1},B:function(a,b,c){x.lastIndex=0;return(b=x.exec(b.substring(c)))?(a.m=E.get(b[0].toLowerCase()),c+b[0].length):-1},c:function(a,b,d){return c(a,F.c.toString(),b,d)},d:le,e:le,H:me,I:me,j:Dg,L:Eg,m:Fg,M:Gg,p:function(a,b,c){b=t.get(b.substring(c,c+=2).toLowerCase());return null==b?-1:(a.p=b,c)},S:Hg,U:Ig,w:Jg,W:Kg,x:function(a,b,d){return c(a,F.x.toString(),b,d)},X:function(a, 33 | b,d){return c(a,F.X.toString(),b,d)},y:Lg,Y:Mg,Z:Ng,"%":Og};return b}function ma(a,b,c){var d=0>a?"-":"";a=(d?-a:a)+"";var e=a.length;return d+(eI(a[0]-b[0])&&1E-6>I(a[1]-b[1])}function $c(a,b){a*=H;var c=Math.cos(b*=H);wb(c*Math.cos(a),c*Math.sin(a),Math.sin(b))}function wb(a,b,c){++xb;La+=(a-La)/xb;Ma+=(b-Ma)/xb;Ca+=(c-Ca)/xb}function re(){function a(a,f){a*=H;var g=Math.cos(f*=H),h=g*Math.cos(a),g=g*Math.sin(a),m=Math.sin(f),n=Math.atan2(Math.sqrt((n=c*m-d*g)*n+(n=d*h-b*m)*n+(n=b*g-c*h)*n),b*h+c*g+d*m);lb+=n;sa+=n* 40 | (b+(b=h));ta+=n*(c+(c=g));oa+=n*(d+(d=m));wb(b,c,d)}var b,c,d;xa.point=function(e,f){e*=H;var g=Math.cos(f*=H);b=g*Math.cos(e);c=g*Math.sin(e);d=Math.sin(f);xa.point=a;wb(b,c,d)}}function se(){xa.point=$c}function Qg(){function a(a,b){a*=H;var c=Math.cos(b*=H),n=c*Math.cos(a),c=c*Math.sin(a),r=Math.sin(b),t=e*r-f*c,q=f*n-d*r,k=d*c-e*n,A=Math.sqrt(t*t+q*q+k*k),v=d*n+e*c+f*r,x=A&&-Vd(v)/A,A=Math.atan2(A,v);Ra+=x*t;Sa+=x*q;Da+=x*k;lb+=A;sa+=A*(d+(d=n));ta+=A*(e+(e=c));oa+=A*(f+(f=r));wb(d,e,f)}var b, 41 | c,d,e,f;xa.point=function(g,h){b=g;c=h;xa.point=a;g*=H;var m=Math.cos(h*=H);d=m*Math.cos(g);e=m*Math.sin(g);f=Math.sin(h);wb(d,e,f)};xa.lineEnd=function(){a(b,c);xa.lineEnd=se;xa.point=$c}}function mb(){return!0}function te(a,b,c,d,e){var f=[],g=[];a.forEach(function(a){if(!(0>=(b=a.length-1))){var b,c=a[0],d=a[b];if(bc(c,d)){e.lineStart();for(d=0;dK,s=s*B;$a.add(Math.atan2(s*H*Math.sin(I),je*u+s*Math.cos(I)));r+=U?Z+H*qa:Z;U^p>=d^z>=d&&(l=kb(ab(l),ab(b)),$b(l),p=kb(h,l),$b(p),p=(U^0<=Z?-1:1)*hb(p[2]),e>p||e===p&&(l[0]||l[1]))&&(q+=U^0<=Z?1:-1);if(!y++)break; 46 | p=z;s=B;je=u;l=b}}a=(-1E-6>r||1E-6>r&&0>$a)^q&1;x.length?(D||(f.polygonStart(),D=!0),te(x,Sg,a,c,f)):a&&(D||(f.polygonStart(),D=!0),f.lineStart(),c(null,null,1,f),f.lineEnd());D&&(f.polygonEnd(),D=!1);x=F=null},sphere:function(){f.polygonStart();f.lineStart();c(null,null,1,f);f.lineEnd();f.polygonEnd()}},x,E=we(),L=b(E),D=!1,F,l;return v}}function Rg(a){return 1(a=a.x)[0]?a[1]-ha-1E-6:ha-a[1])-(0>(b=b.x)[0]?b[1]-ha-1E-6:ha-b[1])}function Tg(a){function b(a,b){return Math.cos(a)*Math.cos(b)>e}function c(a,b,c){var d=ab(a),f=ab(b),h=[1,0,0],f=kb(d,f),g=Yb(f,f),d=f[0],k=g-d*d;if(!k)return!c&&a;g=e*g/k;k=-e*d/k;d=kb(h,f);h=Zb(h,g);f=Zb(f,k);Zc(h,f);f=Yb(h,d);g=Yb(d,d);k=f*f-g*(Yb(h,h)-1);if(!(0>k)){var x=Math.sqrt(k),k=Zb(d,(-f-x)/g);Zc(k,h);k= 48 | ac(k);if(!c)return k;c=a[0];var E=b[0];a=a[1];b=b[1];var L;EI(D-K);!F&&bD?F?0I(k[0]-c)?a:b):a<=k[1]&&k[1]<=b:D>K^(c<=k[0]&&k[0]<=E))return b=Zb(d,(-f+x)/g),Zc(b,h),[k,ac(b)]}}function d(b,c){var d=f?a:K-a,e=0;b<-d?e|=1:b>d&&(e|=2);c<-d?e|=4:c>d&&(e|=8);return e}var e=Math.cos(a),f=0A?K:-K),v):0;!e&&(q=t=L)&&a.lineStart();L!==t&&(E=c(e,x),bc(e,E)||bc(x,E))&&(x[0]+=1E-6,x[1]+=1E-6,L=b(x[0],x[1]));if(L!==t)k=0,L?(a.lineStart(),E=c(x,e),a.point(E[0],E[1])):(E=c(e,x),a.point(E[0],E[1]),a.lineEnd()),e=E;else if(g&&e&&f^L){var F;D&h||!(F=c(x,e,!0))||(k=0,f?(a.lineStart(),a.point(F[0][0],F[0][1]),a.point(F[1][0],F[1][1]),a.lineEnd()):(a.point(F[1][0],F[1][1]),a.lineEnd(),a.lineStart(),a.point(F[0][0],F[0][1])))}!L||e&&bc(e,x)||a.point(x[0],x[1]);e=x; 50 | t=L;h=D},lineEnd:function(){t&&a.lineEnd();e=null},clean:function(){return k|(q&&t)<<1}}},h,f?[0,-a]:[-K,a-K])}function xe(a,b,c,d){return function(e){var f=e.a,g=e.b,h=f.x,f=f.y,m=0,n=1,r=g.x-h,g=g.y-f,t;t=a-h;if(r||!(0r){if(tn)return;t>m&&(m=t)}t=c-h;if(r||!(0>t)){t/=r;if(0>r){if(t>n)return;t>m&&(m=t)}else if(0g){if(tn)return;t>m&&(m=t)}t=d-f;if(g|| 51 | !(0>t)){t/=g;if(0>g){if(t>n)return;t>m&&(m=t)}else if(0n&&(e.b={x:h+n*r,y:f+n*g});return e}}}}}}function ye(a,b,c,d){function e(d,e){return 1E-6>I(d[0]-a)?0I(d[0]-c)?0I(d[1]-b)?0g(f,h)^0g&&0Mc(E,J,b)&&--c,E=J;b=0!==c;c= 54 | X&&b;e=A.length;if(c||e)h.polygonStart(),c&&(h.lineStart(),m(null,null,1,h),h.lineEnd()),e&&te(A,f,b,m,h),h.polygonEnd();A=v=x=null}},L,D,F,l,M,p,s,X;return E}}function ze(a,b){function c(c,e){return c=a(c,e),b(c[0],c[1])}a.invert&&b.invert&&(c.invert=function(c,e){return c=b.invert(c,e),c&&a.invert(c[0],c[1])});return c}function bd(a){var b=0,c=K/3,d=cd(a);a=d(b,c);a.parallels=function(a){return arguments.length?d(b=a[0]*K/180,c=a[1]*K/180):[b/K*180,c/K*180]};return a}function Ae(a,b){function c(a, 55 | b){var c=Math.sqrt(f-2*e*Math.sin(b))/e;return[c*Math.sin(a*=e),g-c*Math.cos(a)]}var d=Math.sin(a),e=(d+Math.sin(b))/2,f=1+d*(2*e-d),g=Math.sqrt(f)/e;c.invert=function(a,b){var c=g-b;return[Math.atan2(a,c)/e,hb((f-(a*a+c*c)*e*e)/(2*e))]};return c}function Ug(){function a(a,b){dc+=e*a-d*b;d=a;e=b}var b,c,d,e;Ta.point=function(f,g){Ta.point=a;b=d=f;c=e=g};Ta.lineEnd=function(){a(b,c)}}function Vg(){function a(a,b){g.push("M",a,",",b,f)}function b(a,b){g.push("M",a,",",b);h.point=c}function c(a,b){g.push("L", 56 | a,",",b)}function d(){h.point=a}function e(){g.push("Z")}var f=Be(4.5),g=[],h={point:a,lineStart:function(){h.point=b},lineEnd:d,polygonStart:function(){h.lineEnd=e},polygonEnd:function(){h.lineEnd=d;h.point=a},pointRadius:function(a){f=Be(a);return h},result:function(){if(g.length){var a=g.join("");g=[];return a}}};return h}function Be(a){return"m0,"+a+"a"+a+","+a+" 0 1,1 0,"+-2*a+"a"+a+","+a+" 0 1,1 0,"+2*a+"z"}function bb(a,b){La+=a;Ma+=b;++Ca}function Ce(){function a(a,e){var f=a-b,g=e-c,f=Math.sqrt(f* 57 | f+g*g);sa+=f*(b+a)/2;ta+=f*(c+e)/2;oa+=f;bb(b=a,c=e)}var b,c;ya.point=function(d,e){ya.point=a;bb(b=d,c=e)}}function De(){ya.point=bb}function Wg(){function a(a,b){var c=a-d,m=b-e,c=Math.sqrt(c*c+m*m);sa+=c*(d+a)/2;ta+=c*(e+b)/2;oa+=c;c=e*a-d*b;Ra+=c*(d+a);Sa+=c*(e+b);Da+=3*c;bb(d=a,e=b)}var b,c,d,e;ya.point=function(f,g){ya.point=a;bb(b=d=f,c=e=g)};ya.lineEnd=function(){a(b,c)}}function Xg(a){function b(b,c){a.moveTo(b,c);a.arc(b,c,g,0,qa)}function c(b,c){a.moveTo(b,c);h.point=d}function d(b,c){a.lineTo(b, 58 | c)}function e(){h.point=b}function f(){a.closePath()}var g=4.5,h={point:b,lineStart:function(){h.point=c},lineEnd:e,polygonStart:function(){h.lineEnd=f},polygonEnd:function(){h.lineEnd=e;h.point=b},pointRadius:function(a){g=a;return h},result:u};return h}function Ee(a){function b(a){return(h?d:c)(a)}function c(b){return Fe(b,function(c,d){c=a(c,d);b.point(c[0],c[1])})}function d(b){function c(d,e){d=a(d,e);b.point(d[0],d[1])}function d(){p=NaN;u.point=f;b.lineStart()}function f(c,d){var g=ab([c,d]), 59 | n=a(c,d);e(p,s,M,X,y,z,p=n[0],s=n[1],M=c,X=g[0],y=g[1],z=g[2],h,b);b.point(p,s)}function g(){u.point=c;b.lineEnd()}function k(){d();u.point=A;u.lineEnd=v}function A(a,b){f(x=a,b);E=p;L=s;D=X;F=y;l=z;u.point=f}function v(){e(p,s,M,X,y,z,E,L,x,D,F,l,h,b);u.lineEnd=g;g()}var x,E,L,D,F,l,M,p,s,X,y,z,u={point:c,lineStart:d,lineEnd:g,polygonStart:function(){b.polygonStart();u.lineStart=k},polygonEnd:function(){b.polygonEnd();u.lineStart=d}};return u}function e(b,c,d,h,q,k,A,v,x,E,L,D,F,l){var M=A-b,p=v- 60 | c,s=M*M+p*p;if(s>4*f&&F--){var X=h+E,y=q+L,z=k+D,u=Math.sqrt(X*X+y*y+z*z),B=Math.asin(z/=u),Z=1E-6>I(I(z)-1)||1E-6>I(d-x)?(d+x)/2:Math.atan2(y,X),H=a(Z,B),B=H[0],H=H[1],K=B-b,U=H-c,N=p*K-M*U;if(N*N/s>f||.3K?a-qa:a<-K?a+qa:a,b]}function dd(a,b,c){return a?b||c?ze(Ke(a),Le(b,c)):Ke(a):b||c?Le(b,c):Je}function Me(a){return function(b,c){return b+=a,[b>K?b-qa:b<-K?b+qa:b,c]}}function Ke(a){var b=Me(a);b.invert=Me(-a);return b}function Le(a,b){function c(a,b){var c=Math.cos(b),r=Math.cos(a)*c,c=Math.sin(a)*c,t=Math.sin(b),q=t*d+r*e;return[Math.atan2(c*f-q*g,r*d-t*e),hb(q*f+c*g)]}var d=Math.cos(a), 65 | e=Math.sin(a),f=Math.cos(b),g=Math.sin(b);c.invert=function(a,b){var c=Math.cos(b),r=Math.cos(a)*c,c=Math.sin(a)*c,t=Math.sin(b),q=t*f-c*g;return[Math.atan2(c*f+t*g,r*d+q*e),hb(q*d-r*e)]};return c}function ad(a,b){var c=Math.cos(a),d=Math.sin(a);return function(e,f,g,h){var m=g*b;if(null!=e){if(e=Ne(c,e),f=Ne(c,f),0f)e+=g*qa}else e=a+g*qa,f=a-.5*m;for(var n;0f:e-c[2]?-d:d)+2*Math.PI-1E-6)%(2*Math.PI)}function Oe(a,b,c){var d=k.range(a,b-1E-6,c).concat(b);return function(a){return d.map(function(b){return[a,b]})}}function Pe(a,b,c){var d=k.range(a,b-1E-6,c).concat(b);return function(a){return d.map(function(b){return[b,a]})}}function ed(a){return a.source}function fd(a){return a.target}function Zg(a,b,c,d){var e=Math.cos(b),f=Math.sin(b),g=Math.cos(d),h=Math.sin(d),m=e*Math.cos(a),n=e*Math.sin(a),r=g*Math.cos(c),t=g*Math.sin(c),q=2*Math.asin(Math.sqrt(Xd(d- 67 | b)+e*g*Xd(c-a))),k=1/Math.sin(q);c=q?function(a){var b=Math.sin(a*=q)*k,c=Math.sin(q-a)*k;a=c*m+b*r;var d=c*n+b*t,b=c*f+b*h;return[Math.atan2(d,a)*W,Math.atan2(b,Math.sqrt(a*a+d*d))*W]}:function(){return[a*W,b*W]};c.distance=q;return c}function zb(a,b){function c(b,c){var f=Math.cos(b),g=Math.cos(c),f=a(f*g);return[f*g*Math.sin(b),f*Math.sin(c)]}c.invert=function(a,c){var f=Math.sqrt(a*a+c*c),g=b(f),h=Math.sin(g),g=Math.cos(g);return[Math.atan2(a*h,f*g),Math.asin(f&&c*h/f)]};return c}function Qe(a, 68 | b){function c(a,b){0ha-1E-6&&(b=ha-1E-6);var c=f/Math.pow(Math.tan(K/4+b/2),e);return[c*Math.sin(e*a),f-c*Math.cos(e*a)]}var d=Math.cos(a),e=a===b?Math.sin(a):Math.log(d/Math.cos(b))/Math.log(Math.tan(K/4+b/2)/Math.tan(K/4+a/2)),f=d*Math.pow(Math.tan(K/4+a/2),e)/e;if(!e)return ec;c.invert=function(a,b){var c=f-b,d=(0e?-1:0)*Math.sqrt(a*a+c*c);return[Math.atan2(a,c)/e,2*Math.atan(Math.pow(f/d,1/e))-ha]};return c}function Re(a,b){function c(a,b){var c=f-b;return[c* 69 | Math.sin(e*a),f-c*Math.cos(e*a)]}var d=Math.cos(a),e=a===b?Math.sin(a):(d-Math.cos(b))/(b-a),f=d/e+a;if(1E-6>I(e))return yb;c.invert=function(a,b){var c=f-b;return[Math.atan2(a,c)/e,f-(0e?-1:0)*Math.sqrt(a*a+c*c)]};return c}function ec(a,b){return[a,Math.log(Math.tan(K/4+b/2))]}function Se(a){var b=Ua(a),c=b.scale,d=b.translate,e=b.clipExtent,f;b.scale=function(){var a=c.apply(b,arguments);return a===b?f?b.clipExtent(null):b:a};b.translate=function(){var a=d.apply(b,arguments);return a===b? 70 | f?b.clipExtent(null):b:a};b.clipExtent=function(a){var h=e.apply(b,arguments);if(h===b){if(f=null==a){var m=K*c(),n=d();e([[n[0]-m,n[1]-m],[n[0]+m,n[1]+m]])}}else f&&(h=null);return h};return b.clipExtent(null)}function gd(a,b){return[Math.log(Math.tan(K/4+b/2)),-a]}function nb(a){return a[0]}function Ab(a){return a[1]}function Te(a){for(var b=a.length,c=[0,1],d=2,e=2;e=Mc(a[c[d-2]],a[c[d-1]],a[e]);)--d;c[d++]=e}return c.slice(0,d)}function $g(a,b){return a[0]-b[0]||a[1]-b[1]} 71 | function hd(a,b,c){return(c[0]-b[0])*(a[1]-b[1])<(c[1]-b[1])*(a[0]-b[0])}function Ue(a,b,c,d){var e=a[0],f=c[0],g=b[0]-e,h=d[0]-f;a=a[1];c=c[1];b=b[1]-a;d=d[1]-c;f=(h*(a-c)-d*(e-f))/(d*g-h*b);return[e+f*g,a+f*b]}function Ve(a){var b=a[0];a=a[a.length-1];return!(b[0]-a[0]||b[1]-a[1])}function ah(){fc(this);this.edge=this.site=this.circle=null}function We(a){var b=Xe.pop()||new ah;b.site=a;return b}function id(a){ob(a);pb.remove(a);Xe.push(a);fc(a)}function Ye(a,b){var c=a.site,d=c.x,e=c.y,f=e-b;if(!f)return d; 72 | var g=a.P;if(!g)return-Infinity;var c=g.site,g=c.x,c=c.y,h=c-b;if(!h)return g;var m=g-d,n=1/f-1/h,r=m/h;return n?(-r+Math.sqrt(r*r-2*n*(m*m/(-2*h)-c+h/2+e-f/2)))/n+d:(d+g)/2}function Ze(a){this.site=a;this.edges=[]}function $e(a,b){return b.angle-a.angle}function bh(){fc(this);this.x=this.y=this.arc=this.site=this.cy=null}function qb(a){var b=a.P,c=a.N;if(b&&c){var d=b.site,b=a.site,e=c.site;if(d!==e){var c=b.x,f=b.y,g=d.x-c,h=d.y-f,d=e.x-c,e=e.y-f,m=2*(g*e-h*d);if(!(-1E-12<=m)){var n=g*g+h*h,r=d* 73 | d+e*e,h=(e*n-h*r)/m,g=(g*r-d*n)/m,e=g+f,f=af.pop()||new bh;f.arc=a;f.site=b;f.x=h+c;f.y=e+Math.sqrt(h*h+g*g);f.cy=e;a.circle=f;a=null;for(b=Bb._;b;)if(f.y=e)return;if(n>r){if(!d)d={x:t,y:f};else if(d.y>=g)return;c={x:t,y:g}}else{if(!d)d={x:t,y:g};else if(d.yq||1r){if(!d)d={x:(f-t)/q,y:f};else if(d.y>=g)return;c={x:(g-t)/q,y:g}}else{if(!d)d={x:(g-t)/q,y:g};else if(d.y=e)return;c={x:e,y:q*e+t}}else{if(!d)d={x:e,y:q*e+t};else if(d.xI(h-m.circle.x)&&1E-6>I(r-m.circle.cy);)t=m.P,g.unshift(m),id(m),m=t;g.unshift(m);ob(m);for(t=n;t.circle&&1E-6>I(h-t.circle.x)&&1E-6>I(r-t.circle.cy);)n=t.N,g.push(t),id(t),t=n;g.push(t);ob(t);h=g.length;r=void 0;for(r=1;rI(f.a.x-f.b.x)&&1E-6>I(f.a.y-f.b.y))f.a=f.b=null,c.splice(e,1);c=b[0][0];d=b[1][0];e=b[0][1];f=b[1][1];r=cb;for(n=r.length;n--;)if((t=r[n])&&t.prepare())for(k=t.edges,A=k.length,q=0;qI(h-c)&&1E-6I(g-c)?x:f}:1E-6>I(m-f)&&1E-6I(x-f)?g:d,y:f}:1E-6>I(h-d)&&1E-6I(g-d)?x:e}:1E-6>I(m-e)&&1E-6I(x-e)?g:c,y:e}:null),t.site,null)),++A}c={cells:cb,edges:rb};pb=Bb=rb=cb=null;return c}function eh(a,b){return b.y-a.y||b.x-a.x}function fh(a){return a.x}function gh(a){return a.y}function df(){return{leaf:!0,nodes:[],point:null,x:null,y:null}}function Fb(a,b,c,d,e,f){if(!a(b,c,d,e,f)){var g=.5*(c+e),h=.5*(d+f);b=b.nodes;b[0]&&Fb(a,b[0],c,d,g,h);b[1]&&Fb(a, 81 | b[1],g,d,e,h);b[2]&&Fb(a,b[2],c,h,g,f);b[3]&&Fb(a,b[3],g,h,e,f)}}function md(a,b){a=k.rgb(a);b=k.rgb(b);var c=a.r,d=a.g,e=a.b,f=b.r-c,g=b.g-d,h=b.b-e;return function(a){return"#"+ib(Math.round(c+f*a))+ib(Math.round(d+g*a))+ib(Math.round(e+h*a))}}function ef(a,b){var c={},d={},e;for(e in a)e in b?c[e]=db(a[e],b[e]):d[e]=a[e];for(e in b)e in a||(d[e]=b[e]);return function(a){for(e in c)d[e]=c[e](a);return d}}function Na(a,b){b-=a=+a;return function(c){return a+b*c}}function ff(a,b){var c=nd.lastIndex= 82 | od.lastIndex=0,d,e,f,g=-1,h=[],m=[];a+="";for(b+="";(d=nd.exec(a))&&(e=od.exec(b));)(f=e.index)>c&&(f=b.substring(c,f),h[g]?h[g]+=f:h[++g]=f),(d=d[0])===(e=e[0])?h[g]?h[g]+=e:h[++g]=e:(h[++g]=null,m.push({i:g,x:Na(d,e)})),c=od.lastIndex;ch.length?m[0]?(b=m[0].x,function(a){return b(a)+""}):function(){return b}:(b=m.length,function(a){for(var c=0,d;c=b?0:1<=b?1:a(b)}}function gf(a){return function(b){return 1-a(1-b)}}function hf(a){return function(b){return.5*(.5>b?a(2*b):2-a(2-2*b))}}function ih(a){return a*a}function jh(a){return a* 84 | a*a}function kh(a){if(0>=a)return 0;if(1<=a)return 1;var b=a*a,c=b*a;return 4*(.5>a?c:3*(a-b)+c-.75)}function lh(a){return 1-Math.cos(a*ha)}function mh(a){return Math.pow(2,10*(a-1))}function nh(a){return 1-Math.sqrt(1-a*a)}function oh(a){return a<1/2.75?7.5625*a*a:a<2/2.75?7.5625*(a-=1.5/2.75)*a+.75:a<2.5/2.75?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375}function jf(a,b){b-=a;return function(c){return Math.round(a+b*c)}}function kf(a){var b=[a.a,a.b],c=[a.c,a.d],d=lf(b),e=b[0]* 85 | c[0]+b[1]*c[1],f=-e;c[0]+=f*b[0];c[1]+=f*b[1];f=lf(c)||0;b[0]*c[1]d&&(c=b,d=e);return c}function Eh(a){return a.reduce(Fh, 91 | 0)}function Fh(a,b){return a+b[1]}function Gh(a,b){return pf(a,Math.ceil(Math.log(b.length)/Math.LN2+1))}function pf(a,b){for(var c=-1,d=+a[0],e=(a[1]-d)/b,f=[];++c<=b;)f[c]=e*c+d;return f}function Hh(a){return[k.min(a),k.max(a)]}function Ih(a,b){return a.value-b.value}function rd(a,b){var c=a._pack_next;a._pack_next=b;b._pack_prev=a;b._pack_next=c;c._pack_prev=b}function qf(a,b){a._pack_next=b;b._pack_prev=a}function rf(a,b){var c=b.x-a.x,d=b.y-a.y,e=a.r+b.r;return.999*e*e>c*c+d*d}function sf(a){function b(a){d= 92 | Math.min(a.x-a.r,d);e=Math.max(a.x+a.r,e);f=Math.min(a.y-a.r,f);g=Math.max(a.y+a.r,g)}if((c=a.children)&&(J=c.length)){var c,d=Infinity,e=-Infinity,f=Infinity,g=-Infinity,h,m,n,r,k,q,J;c.forEach(Jh);h=c[0];h.x=-h.r;h.y=0;b(h);if(1e&&(c+=e/2,e=0);0>f&&(d+=f/2,f=0);return{x:c,y:d,dx:e,dy:f}}function sb(a){var b=a[0];a=a[a.length-1];return b=d?e*=10:.35>=d?e*=5:.75>=d&&(e*=2);c[0]=Math.ceil(c[0]/e)*e;c[1]=Math.floor(c[1]/e)*e+.5*e;c[2]=e;return c}function vd(a, 99 | b,c){a=Va(a,b);if(c){b=ie.exec(c);b.shift();if("s"===b[8]){var d=k.formatPrefix(Math.max(I(a[0]),I(a[1])));b[7]||(b[7]="."+lc(d.scale(a[2])));b[8]="f";c=k.format(b.join(""));return function(a){return c(d.scale(a))+d.symbol}}b[7]||(b[7]="."+Qh(b[8],a));c=b.join("")}else c=",."+lc(a[2])+"f";return k.format(c)}function lc(a){return-Math.floor(Math.log(a)/Math.LN10+.01)}function Qh(a,b){var c=lc(b[2]);return a in Rh?Math.abs(c-lc(Math.max(I(b[0]),I(b[1]))))+ +("e"!==a):c-2*("%"===a)}function Bf(a,b,c, 100 | d){function e(a){return(c?Math.log(0>a?0:a):-Math.log(0a;k--);g=g.slice(r,k)}return g};g.tickFormat=function(a,b){if(!arguments.length)return Cf;2>arguments.length?b=Cf:"function"!==typeof b&&(b=k.format(b));var d=Math.max(.1,a/g.ticks().length),r=c?(t=1E-12,Math.ceil):(t=-1E-12,Math.floor),t;return function(a){return a/ 102 | f(r(e(a)+t))<=d?b(a):""}};g.copy=function(){return Bf(a.copy(),b,c,d)};return wd(g,a)}function Df(a,b,c){function d(b){return a(e(b))}var e=mc(b),f=mc(1/b);d.invert=function(b){return f(a.invert(b))};d.domain=function(b){if(!arguments.length)return c;a.domain((c=b.map(Number)).map(e));return d};d.ticks=function(a){return k.range.apply(k,Va(c,a))};d.tickFormat=function(a,b){return vd(c,a,b)};d.nice=function(a){return d.domain(kc(c,zf(Va(c,a)[2])))};d.exponent=function(g){if(!arguments.length)return b; 103 | e=mc(b=g);f=mc(1/b);a.domain(c.map(e));return d};d.copy=function(){return Df(a.copy(),b,c)};return wd(d,a)}function mc(a){return function(b){return 0>b?-Math.pow(-b,a):Math.pow(b,a)}}function Ef(a,b){function c(c){return f[((e.get(c)||("range"===b.t?e.set(c,a.push(c)):NaN))-1)%f.length]}function d(b,c){return k.range(a.length).map(function(a){return b+c*a})}var e,f,g;c.domain=function(d){if(!arguments.length)return a;a=[];e=new ba;for(var f=-1,g=d.length,r;++farguments.length&&(m=0);var n=e[0],r=e[1],k=(r-n)/(Math.max(1,a.length-1)+m);f=d(2>a.length?(n+r)/2:n+k*m/2,k);g=0;b={t:"rangePoints",a:arguments};return c};c.rangeBands=function(e,m,n){2>arguments.length&&(m=0);3>arguments.length&&(n=m);var r=e[1]arguments.length&&(m=0);3>arguments.length&&(n=m);var r=e[1]c?[NaN,NaN]:[0b?NaN:b/f+a;return[b,b+1/f]};d.copy=function(){return Gf(a,b,c)};return e()}function Hf(a,b){function c(c){if(c<=c)return b[k.bisect(a,c)]}c.domain=function(b){if(!arguments.length)return a;a=b;return c};c.range=function(a){if(!arguments.length)return b; 108 | b=a;return c};c.invertExtent=function(c){c=b.indexOf(c);return[a[c-1],a[c]]};c.copy=function(){return Hf(a,b)};return c}function If(a){function b(a){return+a}b.invert=b;b.domain=b.range=function(c){if(!arguments.length)return a;a=c.map(b);return b};b.ticks=function(b){return k.range.apply(k,Va(a,b))};b.tickFormat=function(b,d){return vd(a,b,d)};b.copy=function(){return If(a)};return b}function Th(a){return a.innerRadius}function Uh(a){return a.outerRadius}function Jf(a){return a.startAngle}function Kf(a){return a.endAngle} 109 | function Lf(a){function b(b){function g(){r.push("M",f(a(k),h))}for(var r=[],k=[],q=-1,J=b.length,A,v=V(c),x=V(d);++qb.length||a.length!=b.length&&a.length!=b.length+2)return ra(a);var c= 111 | a.length!=b.length,d="",e=a[0],f=a[1],g=b[0],h=g,m=1;c&&(d+="Q"+(f[0]-2*g[0]/3)+","+(f[1]-2*g[1]/3)+","+f[0]+","+f[1],e=a[1],m=2);if(1a.length)return ra(a);var b=1,c=a.length,d=a[0],e=d[0],f=d[1],g=[e,e,e,(d=a[1])[0]],h=[f,f,f,d[1]],e=[e,",",f,"L",ua(Wa,g),",",ua(Wa,h)];for(a.push(a[c-1]);++b<=c;)d=a[b],g.shift(),g.push(d[0]),h.shift(),h.push(d[1]),Bd(e,g,h);a.pop();e.push("L",d);return e.join("")}function ua(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3]}function Bd(a,b,c){a.push("C",ua(Nf,b),",",ua(Nf,c),",",ua(Of,b),",",ua(Of,c),",",ua(Wa,b), 113 | ",",ua(Wa,c))}function Cd(a,b){return(b[1]-a[1])/(b[0]-a[0])}function Pf(a){for(var b,c=-1,d=a.length,e,f;++cc)return r();e.active=c;f.event&&f.event.start.call(a,t,b);f.tween.forEach(function(c,d){(d=d.call(a,t,b))&&x.push(d)});k.timer(function(){v.c=n(d||1)?mb:n;return 1},0,g)}function n(d){if(e.active!==c)return r();d/=A;for(var g=q(d),h=x.length;0b?1:b)};d.tickFormat=function(){return c};d.copy=function(){return Fd(a.copy(),b,c)};return wd(d,a)}function fb(a){return new Date(a)}function ai(a){return JSON.parse(a.responseText)}function bi(a){var b=za.createRange();b.selectNode(za.body);return b.createContextualFragment(a.responseText)}var k={version:"3.4.11"};Date.now|| 121 | (Date.now=function(){return+new Date});var Vf=[].slice,Qa=function(a){return Vf.call(a)},za=document,Ia=za.documentElement,ka=window;try{Qa(Ia.childNodes)[0].nodeType}catch(Bi){Qa=function(a){for(var b=a.length,c=Array(b);b--;)c[b]=a[b];return c}}try{za.createElement("div").style.setProperty("opacity",0,"")}catch(Ci){var qc=ka.Element.prototype,ci=qc.setAttribute,di=qc.setAttributeNS,Wf=ka.CSSStyleDeclaration.prototype,ei=Wf.setProperty;qc.setAttribute=function(a,b){ci.call(this,a,b+"")};qc.setAttributeNS= 122 | function(a,b,c){di.call(this,a,b,c+"")};Wf.setProperty=function(a,b,c){ei.call(this,a,b+"",c)}}k.ascending=C;k.descending=function(a,b){return ba?1:b>=a?0:NaN};k.min=function(a,b){var c=-1,d=a.length,e,f;if(1===arguments.length){for(;++cf&&(e=f)}else{for(;++cf&&(e=f)}return e};k.max=function(a,b){var c=-1,d=a.length,e,f;if(1===arguments.length){for(;++c< 123 | d&&!(null!=(e=a[c])&&e<=e);)e=void 0;for(;++ce&&(e=f)}else{for(;++ce&&(e=f)}return e};k.extent=function(a,b){var c=-1,d=a.length,e,f,g;if(1===arguments.length){for(;++cf&&(e=f),gf&&(e=f),gc?0:c);barguments.length&&(c=1,2>arguments.length&&(b=a,a=0));if(Infinity===(b-a)/c)throw Error("infinite range");var d=[],e;e=I(c);for(var f=1;e*f%1;)f*=10;e=f;var f=-1,g;a*=e;b*=e;c*=e;if(0>c)for(;(g=a+c*++f)>b;)d.push(g/e);else for(;(g=a+c*++f)=d.length)return g?g.call(c,e):f?e.sort(f):e;for(var k=-1,t=e.length,q=d[n++],l,A,v=new ba,x;++k=d.length)return a;var f=[],g=e[c++];a.forEach(function(a,d){f.push({key:a,values:b(d,c)})});return g?f.sort(function(a,b){return g(a.key,b.key)}):f}var c={},d=[],e=[],f,g;c.map=function(b,c){return a(c,b,0)};c.entries= 130 | function(c){return b(a(k.map,c,0),0)};c.key=function(a){d.push(a);return c};c.sortKeys=function(a){e[d.length-1]=a;return c};c.sortValues=function(a){f=a;return c};c.rollup=function(a){g=a;return c};return c};k.set=function(a){var b=new T;if(a)for(var c=0,d=a.length;carguments.length?this[a].on(d):this[a].on(d,b);if(2===arguments.length){if(null==b)for(a in this)if(this.hasOwnProperty(a))this[a].on(d, 132 | null);return this}};k.event=null;k.requote=function(a){return a.replace(fi,"\\$&")};var fi=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,Kb={}.__proto__?function(a,b){a.__proto__=b}:function(a,b){for(var c in b)a[c]=b[c]},Hc=function(a,b){return b.querySelector(a)},Ic=function(a,b){return b.querySelectorAll(a)},gi=Ia.matches||Ia[aa(Ia,"matchesSelector")],Rd=function(a,b){return gi.call(a,b)};"function"===typeof Sizzle&&(Hc=function(a,b){return Sizzle(a,b)[0]||null},Ic=Sizzle,Rd=Sizzle.matchesSelector);k.selection= 133 | function(){return Yf};var P=k.selection.prototype=[];P.select=function(a){var b=[],c,d,e,f;a=l(a);for(var g=-1,h=this.length;++garguments.length){if("string"===typeof a){var c=this.node();a=k.ns.qualify(a);return a.local?c.getAttributeNS(a.space, 135 | a.local):c.getAttribute(a)}for(b in a)this.each(s(b,a[b]));return this}return this.each(s(a,b))};P.classed=function(a,b){if(2>arguments.length){if("string"===typeof a){var c=this.node(),d=(a=(a+"").trim().split(/^|\s+/)).length,e=-1;if(b=c.classList)for(;++ed){if("string"!== 136 | typeof a){2>d&&(b="");for(c in a)this.each(U(c,a[c],b));return this}if(2>d)return ka.getComputedStyle(this.node(),null).getPropertyValue(a);c=""}return this.each(U(a,b,c))};P.property=function(a,b){if(2>arguments.length){if("string"===typeof a)return this.node()[a];for(b in a)this.each(Od(b,a[b]));return this}return this.each(Od(a,b))};P.text=function(a){return arguments.length?this.each("function"===typeof a?function(){var b=a.apply(this,arguments);this.textContent=null==b?"":b}:null==a?function(){this.textContent= 137 | ""}:function(){this.textContent=a}):this.node().textContent};P.html=function(a){return arguments.length?this.each("function"===typeof a?function(){var b=a.apply(this,arguments);this.innerHTML=null==b?"":b}:null==a?function(){this.innerHTML=""}:function(){this.innerHTML=a}):this.node().innerHTML};P.append=function(a){a=Pd(a);return this.select(function(){return this.appendChild(a.apply(this,arguments))})};P.insert=function(a,b){a=Pd(a);b=l(b);return this.select(function(){return this.insertBefore(a.apply(this, 138 | arguments),b.apply(this,arguments)||null)})};P.remove=function(){return this.each(function(){var a=this.parentNode;a&&a.removeChild(this)})};P.data=function(a,b){function c(a,c){var d,e=a.length,f=c.length,g=Math.min(e,f),k=Array(f),E=Array(f),l=Array(e),D,F;if(b){var g=new ba,p=new ba,M=[],s;for(d=-1;++darguments.length&&(b=qg(this));return P.insert.call(this,a,b)};P.transition=function(){for(var a=gb||++Zf,b=[],c,d,e=rc||{time:Date.now(),ease:kh,delay:0,duration:250},f=-1,g=this.length;++fd){if("string"!==typeof a){2>d&&(b=!1);for(c in a)this.each(Td(c,a[c],b));return this}if(2>d)return(d=this.node()["__on"+a])&&d._;c=!1}return this.each(Td(a,b,c))};var Jc=k.map({mouseenter:"mouseover",mouseleave:"mouseout"});Jc.forEach(function(a){"on"+a in za&&Jc.remove(a)});var vb="onselectstart"in za?null:aa(Ia.style,"userSelect"),sg=0;k.mouse=function(a){return Kc(a, 145 | Ga())};var Lc=/WebKit/.test(ka.navigator.userAgent)?-1:0;k.touches=function(a,b){2>arguments.length&&(b=Ga().touches);return b?Qa(b).map(function(b){var d=Kc(a,b);d.identifier=b.identifier;return d}):[]};k.behavior.drag=function(){function a(){this.on("mousedown.drag",e).on("touchstart.drag",f)}function b(a,b,e,f,r){return function(){var t=k.event.target,q=this.parentNode,l=c.of(this,arguments),A=0,v=a(),x=".drag"+(null==v?"":"-"+v),E,L=k.select(e()).on(f+x,function(){var a=b(q,v),c,d;a&&(c=a[0]- 146 | F[0],d=a[1]-F[1],A=A|c|d,F=a,l({type:"drag",x:a[0]+E[0],y:a[1]+E[1],dx:c,dy:d}))}).on(r+x,function(){b(q,v)&&(L.on(f+x,null).on(r+x,null),D(A&&k.event.target===t),l({type:"dragend"}))}),D=Mb(),F=b(q,v);d?(E=d.apply(this,arguments),E=[E.x-F[0],E.y-F[1]]):E=[0,0];l({type:"dragstart"})}}var c=O(a,"drag","dragstart","dragend"),d=null,e=b(u,k.mouse,vg,"mousemove","mouseup"),f=b(tg,k.touch,ug,"touchmove","touchend");a.origin=function(b){if(!arguments.length)return d;d=b;return a};return k.rebind(a,c,"on")}; 147 | var K=Math.PI,qa=2*K,ha=K/2,H=K/180,W=180/K,sc=Math.SQRT2;k.interpolateZoom=function(a,b){function c(a){var b=a*A;if(l){a=Wd(q);var c,g=sc*b+q;c=((g=Math.exp(2*g))-1)/(g+1);c*=a;var n=q,g=((n=Math.exp(n))-1/n)/2;c=f/(2*k)*(c-g);return[d+c*h,e+c*m,f*a/Wd(sc*b+q)]}return[d+a*h,e+a*m,f*Math.exp(sc*b)]}var d=a[0],e=a[1],f=a[2],g=b[2],h=b[0]-d,m=b[1]-e,n=h*h+m*m,k=Math.sqrt(n),t=(g*g-f*f+4*n)/(4*f*k),n=(g*g-f*f-4*n)/(4*g*k),q=Math.log(Math.sqrt(t*t+1)-t),l=Math.log(Math.sqrt(n*n+1)-n)-q,A=(l||Math.log(g/ 148 | f))/sc;c.duration=1E3*A;return c};k.behavior.zoom=function(){function a(a){a.on("mousedown.zoom",m).on(hi+".zoom",r).on("dblclick.zoom",t).on("touchstart.zoom",n)}function b(a){return[(a[0]-q.x)/q.k,(a[1]-q.y)/q.k]}function c(a){q.k=Math.max(E[0],Math.min(E[1],a))}function d(a,b){b=[b[0]*q.k+q.x,b[1]*q.k+q.y];q.x+=a[0]-b[0];q.y+=a[1]-b[1]}function e(){M&&M.domain(s.range().map(function(a){return(a-q.x)/q.k}).map(s.invert));z&&z.domain(y.range().map(function(a){return(a-q.y)/q.k}).map(y.invert))}function f(a){a({type:"zoomstart"})} 149 | function g(a){e();a({type:"zoom",scale:q.k,translate:[q.x,q.y]})}function h(a){a({type:"zoomend"})}function m(){var a=this,c=k.event.target,e=F.of(a,arguments),m=0,n=k.select(ka).on("mousemove.zoom",function(){m=1;d(k.mouse(a),r);g(e)}).on("mouseup.zoom",function(){n.on("mousemove.zoom",null).on("mouseup.zoom",null);q(m&&k.event.target===c);h(e)}),r=b(k.mouse(a)),q=Mb();Lb.call(a);f(e)}function n(){function a(){var c=k.touches(x);l=q.k;c.forEach(function(a){a.identifier in v&&(v[a.identifier]=b(a))}); 150 | return c}function e(){var b=k.event.target;k.select(b).on(L,r).on(J,t);M.push(b);for(var b=k.event.changedTouches,f=0,h=b.length;ff-D&&(b=h[0],h=v[b.identifier],c(2*q.k),d(b,h),Q(),g(A)),D=f):1b&&(b=30);c&&30>c&&(c=30);d&&30>d&&(d=30);return new la(Math.min(255,b/a), 158 | Math.min(255,c/a),Math.min(255,d/a))};vc.darker=function(a){a=Math.pow(.7,arguments.length?a:1);return new la(a*this.r,a*this.g,a*this.b)};vc.hsl=function(){return Zd(this.r,this.g,this.b)};vc.toString=function(){return"#"+ib(this.r)+ib(this.g)+ib(this.b)};var Ob=k.map({aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352, 159 | chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151, 160 | dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210, 161 | lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173, 162 | midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864, 163 | seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074});Ob.forEach(function(a,b){Ob.set(a,new la(b>>16,b>>8&255,b&255))});k.functor=V;k.xhr=Uc(ea);k.dsv=function(a,b){function c(a,c,f){3>arguments.length&& 164 | (f=c,c=null);var g=Pb(a,b,null==c?d:e(c),f);g.row=function(a){return arguments.length?g.response(null==(c=a)?d:e(a)):c};return g}function d(a){return c.parse(a.responseText)}function e(a){return function(b){return c.parse(b.responseText,a)}}function f(b){return b.map(g).join(a)}function g(a){return h.test(a)?'"'+a.replace(/\"/g,'""')+'"':a}var h=new RegExp('["'+a+"\n]"),m=a.charCodeAt(0);c.parse=function(a,b){var d;return c.parseRows(a,function(a,c){if(d)return d(a,c-1);var e=new Function("d","return {"+ 165 | a.map(function(a,b){return JSON.stringify(a)+": d["+b+"]"}).join(",")+"}");d=b?function(a,c){return b(e(a),c)}:e})};c.parseRows=function(a,b){function c(){if(h>=g)return e;if(D)return D=!1,d;var b=h;if(34===a.charCodeAt(b)){for(var f=b;f++arguments.length&&(c=b,b=Ga().changedTouches);if(b)for(var d=0,e=b.length,f;dd&&(b=0);3>d&&(c=Date.now());d={c:a,t:c+b,f:!1,n:null};Tb?Tb.n=d:Sb=d;Tb=d; 168 | Rb||(Qb=clearTimeout(Qb),Rb=1,he(Vc))};k.timer.flush=function(){fe();ge()};k.round=function(a,b){return b?Math.round(a*(b=Math.pow(10,b)))/b:Math.round(a)};var ii="y z a f p n \u00b5 m k M G T P E Z Y".split(" ").map(function(a,b){var c=Math.pow(10,3*I(8-b));return{scale:8a&&(a*=-1),b&&(a=k.round(a,Wc(a,b))),c=1+Math.floor(1E-12+Math.log(a)/Math.LN10),c=Math.max(-24,Math.min(24,3*Math.floor((c- 169 | 1)/3))));return ii[8+c/3]};var ie=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,yg=k.map({b:function(a){return a.toString(2)},c:function(a){return String.fromCharCode(a)},o:function(a){return a.toString(8)},x:function(a){return a.toString(16)},X:function(a){return a.toString(16).toUpperCase()},g:function(a,b){return a.toPrecision(b)},e:function(a,b){return a.toExponential(b)},f:function(a,b){return a.toFixed(b)},r:function(a,b){return(a=k.round(a,Wc(a,b))).toFixed(Math.max(0, 170 | Math.min(20,Wc(a*(1+1E-15),b))))}}),z=k.time={},ja=Date;Ka.prototype={getDate:function(){return this._.getUTCDate()},getDay:function(){return this._.getUTCDay()},getFullYear:function(){return this._.getUTCFullYear()},getHours:function(){return this._.getUTCHours()},getMilliseconds:function(){return this._.getUTCMilliseconds()},getMinutes:function(){return this._.getUTCMinutes()},getMonth:function(){return this._.getUTCMonth()},getSeconds:function(){return this._.getUTCSeconds()},getTime:function(){return this._.getTime()}, 171 | getTimezoneOffset:function(){return 0},valueOf:function(){return this._.valueOf()},setDate:function(){Oa.setUTCDate.apply(this._,arguments)},setDay:function(){Oa.setUTCDay.apply(this._,arguments)},setFullYear:function(){Oa.setUTCFullYear.apply(this._,arguments)},setHours:function(){Oa.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){Oa.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){Oa.setUTCMinutes.apply(this._,arguments)},setMonth:function(){Oa.setUTCMonth.apply(this._, 172 | arguments)},setSeconds:function(){Oa.setUTCSeconds.apply(this._,arguments)},setTime:function(){Oa.setTime.apply(this._,arguments)}};var Oa=Date.prototype;z.year=Za(function(a){a=z.day(a);a.setMonth(0,1);return a},function(a,b){a.setFullYear(a.getFullYear()+b)},function(a){return a.getFullYear()});z.years=z.year.range;z.years.utc=z.year.utc.range;z.day=Za(function(a){var b=new ja(2E3,0);b.setFullYear(a.getFullYear(),a.getMonth(),a.getDate());return b},function(a,b){a.setDate(a.getDate()+b)},function(a){return a.getDate()- 173 | 1});z.days=z.day.range;z.days.utc=z.day.utc.range;z.dayOfYear=function(a){var b=z.year(a);return Math.floor((a-b-6E4*(a.getTimezoneOffset()-b.getTimezoneOffset()))/864E5)};"sunday monday tuesday wednesday thursday friday saturday".split(" ").forEach(function(a,b){b=7-b;var c=z[a]=Za(function(a){(a=z.day(a)).setDate(a.getDate()-(a.getDay()+b)%7);return a},function(a,b){a.setDate(a.getDate()+7*Math.floor(b))},function(a){var c=z.year(a).getDay();return Math.floor((z.dayOfYear(a)+(c+b)%7)/7)-(c!==b)}); 174 | z[a+"s"]=c.range;z[a+"s"].utc=c.utc.range;z[a+"OfYear"]=function(a){var c=z.year(a).getDay();return Math.floor((z.dayOfYear(a)+(c+b)%7)/7)}});z.week=z.sunday;z.weeks=z.sunday.range;z.weeks.utc=z.sunday.utc.range;z.weekOfYear=z.sundayOfYear;var ke={"-":"",_:" ",0:"0"},$=/^\s*\d+/,ne=/^%/;k.locale=function(a){return{numberFormat:xg(a),timeFormat:Ag(a)}};var ag=k.locale({decimal:".",thousands:",",grouping:[3],currency:["$",""],dateTime:"%a %b %e %X %Y",date:"%m/%d/%Y",time:"%H:%M:%S",periods:["AM","PM"], 175 | days:"Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),shortDays:"Sun Mon Tue Wed Thu Fri Sat".split(" "),months:"January February March April May June July August September October November December".split(" "),shortMonths:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" ")});k.format=ag.numberFormat;k.geo={};Xc.prototype={s:0,t:0,add:function(a){oe(a,this.t,wc);oe(wc.s,this.s,this);this.s?this.t+=wc.t:this.s=wc.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}}; 176 | var wc=new Xc;k.geo.stream=function(a,b){if(a&&bg.hasOwnProperty(a.type))bg[a.type](a,b);else Xb(a,b)};var bg={Feature:function(a,b){Xb(a.geometry,b)},FeatureCollection:function(a,b){for(var c=a.features,d=-1,e=c.length;++da?4*K+a:a;pa.lineStart=pa.lineEnd=pa.point=u}};k.geo.bounds=function(){function a(a,b){D.push(F=[r=a,q=a]);bl&&(l=b)}function b(b,c){var d=ab([b*H,c*H]);if(E){var e=kb(E,d),e=kb([e[1],-e[0],0],e);$b(e);var e=ac(e),f=b-A,g=0l&&(l=e)):(m=(m+360)%360-180,f^(g*Al&&(l=c));f?bh(r,q)&&(q=b):h(b,q)>h(r,q)&&(r=b):q>=r?(bq&&(q=b)):b>A?h(r,b)>h(r,q)&&(q=b): 179 | h(b,q)>h(r,q)&&(r=b)}else a(b,c);E=d;A=b}function c(){s.point=b}function d(){F[0]=r;F[1]=q;s.point=a;E=null}function e(a,c){if(E){var d=a-A;p+=180(b-=a)?b+360:b}function m(a,b){return a[0]-b[0]}function n(a,b){return b[0]<=b[1]?b[0]<=a&&a<=b[1]:a$a?(r=-(q=180),t=-(l=90)):1E-6p&&(t=-90);F[0]=r;F[1]=q}};return function(a){l=q=-(r=t=Infinity);D=[];k.geo.stream(a,s);if(a=D.length){D.sort(m);for(var b=1,c=D[0],d,e=[c];bh(c[0],c[1])&&(c[1]=d[1]),h(d[0],c[1])>h(c[0],c[1])&&(c[0]=d[0])):e.push(c=d);var f=-Infinity,g;a=e.length- 181 | 1;b=0;for(c=e[a];b<=a;c=d,++b)d=e[b],(g=h(c[1],d[0]))>f&&(f=g,r=d[0],q=c[1])}D=F=null;return Infinity===r||Infinity===t?[[NaN,NaN],[NaN,NaN]]:[[r,t],[q,l]]}}();k.geo.centroid=function(a){xb=lb=La=Ma=Ca=sa=ta=oa=Ra=Sa=Da=0;k.geo.stream(a,xa);a=Ra;var b=Sa,c=Da,d=a*a+b*b+c*c;return 1E-12>d&&(a=sa,b=ta,c=oa,1E-6>lb&&(a=La,b=Ma,c=Ca),d=a*a+b*b+c*c,1E-12>d)?[NaN,NaN]:[Math.atan2(b,a)*W,hb(c/Math.sqrt(d))*W]};var xb,lb,La,Ma,Ca,sa,ta,oa,Ra,Sa,Da,xa={sphere:u,point:$c,lineStart:re,lineEnd:se,polygonStart:function(){xa.lineStart= 182 | Qg},polygonEnd:function(){xa.lineStart=re}},Ie=ve(mb,function(a){var b=NaN,c=NaN,d=NaN,e;return{lineStart:function(){a.lineStart();e=1},point:function(f,g){var h=0I(m-K))a.point(b,c=0<(c+g)/2?ha:-ha),a.point(d,c),a.lineEnd(),a.lineStart(),a.point(h,c),a.point(f,c),e=0;else if(d!==h&&m>=K){1E-6>I(b-d)&&(b-=1E-6*d);1E-6>I(f-h)&&(f-=1E-6*h);var m=b,n=c,k=f,t,q,l=Math.sin(m-k);c=1E-6e&&-.425<=g&&-.214>g?c:.166<=e&&.234>e&&-.214<=g&&-.115>g?d:b).invert(a)};a.stream=function(a){var e=b.stream(a),f=c.stream(a),g=d.stream(a);return{point:function(a,b){e.point(a,b); 186 | f.point(a,b);g.point(a,b)},sphere:function(){e.sphere();f.sphere();g.sphere()},lineStart:function(){e.lineStart();f.lineStart();g.lineStart()},lineEnd:function(){e.lineEnd();f.lineEnd();g.lineEnd()},polygonStart:function(){e.polygonStart();f.polygonStart();g.polygonStart()},polygonEnd:function(){e.polygonEnd();f.polygonEnd();g.polygonEnd()}}};a.precision=function(e){if(!arguments.length)return b.precision();b.precision(e);c.precision(e);d.precision(e);return a};a.scale=function(e){if(!arguments.length)return b.scale(); 187 | b.scale(e);c.scale(.35*e);d.scale(e);return a.translate(b.translate())};a.translate=function(e){if(!arguments.length)return b.translate();var k=b.scale(),t=+e[0],q=+e[1];g=b.translate(e).clipExtent([[t-.455*k,q-.238*k],[t+.455*k,q+.238*k]]).stream(f).point;h=c.translate([t-.307*k,q+.201*k]).clipExtent([[t-.425*k+1E-6,q+.12*k+1E-6],[t-.214*k-1E-6,q+.234*k-1E-6]]).stream(f).point;m=d.translate([t-.205*k,q+.212*k]).clipExtent([[t-.214*k+1E-6,q+.166*k+1E-6],[t-.115*k-1E-6,q+.234*k-1E-6]]).stream(f).point; 188 | return a};return a.scale(1070)};var xc,dc,Ta={point:u,lineStart:u,lineEnd:u,polygonStart:function(){dc=0;Ta.lineStart=Ug},polygonEnd:function(){Ta.lineStart=Ta.lineEnd=Ta.point=u;xc+=I(dc/2)}},yc,zc,Ac,Bc,ji={point:function(a,b){aAc&&(Ac=a);bBc&&(Bc=b)},lineStart:u,lineEnd:u,polygonStart:u,polygonEnd:u},ya={point:bb,lineStart:Ce,lineEnd:De,polygonStart:function(){ya.lineStart=Wg},polygonEnd:function(){ya.point=bb;ya.lineStart=Ce;ya.lineEnd=De}};k.geo.path=function(){function a(a){a&& 189 | ("function"===typeof c&&g.pointRadius(+c.apply(this,arguments)),h&&h.valid||(h=f(g)),k.geo.stream(a,h));return g.result()}function b(){h=null;return a}var c=4.5,d,e,f,g,h;a.area=function(a){xc=0;k.geo.stream(a,f(Ta));return xc};a.centroid=function(a){La=Ma=Ca=sa=ta=oa=Ra=Sa=Da=0;k.geo.stream(a,f(ya));return Da?[Ra/Da,Sa/Da]:oa?[sa/oa,ta/oa]:Ca?[La/Ca,Ma/Ca]:[NaN,NaN]};a.bounds=function(a){Ac=Bc=-(yc=zc=Infinity);k.geo.stream(a,f(ji));return[[yc,zc],[Ac,Bc]]};a.projection=function(a){if(!arguments.length)return d; 190 | f=(d=a)?a.stream||Yg(a):ea;return b()};a.context=function(a){if(!arguments.length)return e;g=null==(e=a)?new Vg:new Xg(a);"function"!==typeof c&&g.pointRadius(c);return b()};a.pointRadius=function(b){if(!arguments.length)return c;c="function"===typeof b?b:(g.pointRadius(+b),+b);return a};return a.projection(k.geo.albersUsa()).context(null)};k.geo.transform=function(a){return{stream:function(b){b=new He(b);for(var c in a)b[c]=a[c];return b}}};He.prototype={point:function(a,b){this.stream.point(a,b)}, 191 | sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};k.geo.projection=Ua;k.geo.projectionMutator=cd;(k.geo.equirectangular=function(){return Ua(yb)}).raw=yb.invert=yb;k.geo.rotation=function(a){function b(b){b=a(b[0]*H,b[1]*H);return b[0]*=W,b[1]*=W,b}a=dd(a[0]%360*H,a[1]*H,2e&&(b=f,f=e,e=b);n>m&&(b=n,n=m,m=b);return a.precision(p)};a.minorExtent=function(b){if(!arguments.length)return[[d,h],[c,g]];d=+b[0][0];c=+b[1][0];h=+b[0][1];g=+b[1][1];d>c&&(b=d,d=c,c=b);h>g&&(b=h,h=g,g=b);return a.precision(p)};a.step=function(b){return arguments.length?a.majorStep(b).minorStep(b):a.minorStep()};a.majorStep=function(b){if(!arguments.length)return[q,l];q=+b[0];l=+b[1];return a};a.minorStep=function(b){if(!arguments.length)return[r, 196 | t];r=+b[0];t=+b[1];return a};a.precision=function(b){if(!arguments.length)return p;p=+b;A=Oe(h,g,90);v=Pe(d,c,p);x=Oe(n,m,90);E=Pe(f,e,p);return a};return a.majorExtent([[-180,-89.999999],[180,89.999999]]).minorExtent([[-180,-80.000001],[180,80.000001]])};k.geo.greatArc=function(){function a(){return{type:"LineString",coordinates:[c||b.apply(this,arguments),e||d.apply(this,arguments)]}}var b=ed,c,d=fd,e;a.distance=function(){return k.geo.distance(c||b.apply(this,arguments),e||d.apply(this,arguments))}; 197 | a.source=function(d){if(!arguments.length)return b;b=d;c="function"===typeof d?null:d;return a};a.target=function(b){if(!arguments.length)return d;d=b;e="function"===typeof b?null:b;return a};a.precision=function(){return arguments.length?a:0};return a};k.geo.interpolate=function(a,b){return Zg(a[0]*H,a[1]*H,b[0]*H,b[1]*H)};k.geo.length=function(a){Cc=0;k.geo.stream(a,ub);return Cc};var Cc,ub={sphere:u,point:u,lineStart:function(){function a(a,f){var g=Math.sin(f*=H),h=Math.cos(f),m=I((a*=H)-b),k= 198 | Math.cos(m);Cc+=Math.atan2(Math.sqrt((m=h*Math.sin(m))*m+(m=d*g-c*h*k)*m),c*g+d*h*k);b=a;c=g;d=h}var b,c,d;ub.point=function(e,f){b=e*H;c=Math.sin(f*=H);d=Math.cos(f);ub.point=a};ub.lineEnd=function(){ub.point=ub.lineEnd=u}},lineEnd:u,polygonStart:u,polygonEnd:u},cg=zb(function(a){return Math.sqrt(2/(1+a))},function(a){return 2*Math.asin(a/2)});(k.geo.azimuthalEqualArea=function(){return Ua(cg)}).raw=cg;var dg=zb(function(a){return(a=Math.acos(a))&&a/Math.sin(a)},ea);(k.geo.azimuthalEquidistant=function(){return Ua(dg)}).raw= 199 | dg;(k.geo.conicConformal=function(){return bd(Qe)}).raw=Qe;(k.geo.conicEquidistant=function(){return bd(Re)}).raw=Re;var eg=zb(function(a){return 1/a},Math.atan);(k.geo.gnomonic=function(){return Ua(eg)}).raw=eg;ec.invert=function(a,b){return[a,2*Math.atan(Math.exp(b))-ha]};(k.geo.mercator=function(){return Se(ec)}).raw=ec;var fg=zb(function(){return 1},Math.asin);(k.geo.orthographic=function(){return Ua(fg)}).raw=fg;var gg=zb(function(a){return 1/(1+a)},function(a){return 2*Math.atan(a)});(k.geo.stereographic= 200 | function(){return Ua(gg)}).raw=gg;gd.invert=function(a,b){return[-b,2*Math.atan(Math.exp(a))-ha]};(k.geo.transverseMercator=function(){var a=Se(gd),b=a.center,c=a.rotate;a.center=function(a){return a?b([-a[1],a[0]]):(a=b(),[a[1],-a[0]])};a.rotate=function(a){return a?c([a[0],a[1],2a.length)return[];var b=V(c),g=V(d),h,m=a.length,k=[],r=[];for(h=0;h=d&&l.x<=f&&l.y>=e&&l.y<=g?[[d,g],[f,g],[f,e],[d,e]]:[]).point=a[h]});return b}function c(a){return a.map(function(a,b){return{x:1E-6*Math.round(f(a,b)/ 207 | 1E-6),y:1E-6*Math.round(g(a,b)/1E-6),i:b}})}var d=nb,e=Ab,f=d,g=e,h=Ec;if(a)return b(a);b.links=function(a){return ld(c(a)).edges.filter(function(a){return a.l&&a.r}).map(function(b){return{source:a[b.l.i],target:a[b.r.i]}})};b.triangles=function(a){var b=[];ld(c(a)).cells.forEach(function(c,d){for(var e=c.site,f=c.edges.sort($e),g=-1,h=f.length,k,l=f[h-1].edge,l=l.l===e?l.r:l.l;++g(e.x-l.x)*(k.y-e.y)-(e.x-k.x)*(l.y-e.y)&&b.push([a[d],a[k.i],a[l.i]])}); 208 | return b};b.x=function(a){return arguments.length?(f=V(d=a),b):d};b.y=function(a){return arguments.length?(g=V(e=a),b):e};b.clipExtent=function(a){if(!arguments.length)return h===Ec?null:h;h=null==a?Ec:a;return b};b.size=function(a){return arguments.length?b.clipExtent(a&&[[0,0],a]):h===Ec?null:h&&h[1]};return b};var Ec=[[-1E6,-1E6],[1E6,1E6]];k.geom.delaunay=function(a){return k.geom.voronoi().triangles(a)};k.geom.quadtree=function(a,b,c,d,e){function f(a){function f(a,b,c,d,e,g,h,k){if(!isNaN(c)&& 209 | !isNaN(d))if(a.leaf){var m=a.x,n=a.y;if(null!=m){if(!(.01>I(m-c)+I(n-d))){var r=a.point;a.x=a.y=a.point=null;t(a,r,m,n,e,g,h,k)}t(a,b,c,d,e,g,h,k)}else a.x=c,a.y=d,a.point=b}else t(a,b,c,d,e,g,h,k)}function t(a,b,c,d,e,g,h,k){var m=.5*(e+h),n=.5*(g+k),q=c>=m,t=d>=n,l=(t<<1)+q;a.leaf=!1;a=a.nodes[l]||(a.nodes[l]=df());q?e=m:h=m;t?g=n:k=n;f(a,b,c,d,e,g,h,k)}var q,l=V(g),A=V(h),v,x,p,s,D,F,y,M;if(null!=b)D=b,F=c,y=d,M=e;else if(y=M=-(D=F=Infinity),v=[],x=[],s=a.length,k)for(p=0;py&&(y=q.x),q.y>M&&(M=q.y),v.push(q.x),x.push(q.y);else for(p=0;py&&(y=z);q>M&&(M=q);v.push(z);x.push(q)}z=y-D;q=M-F;z>q?M=F+z:y=D+q;var u=df();u.add=function(a){f(u,a,+l(a,++p),+A(a,p),D,F,y,M)};u.visit=function(a){Fb(a,u,D,F,y,M)};p=-1;if(null==b){for(;++parguments.length&&(b=.45);arguments.length?c=b/qa*Math.asin(1/a):(a=1,c=b/4);return function(d){return 1+a*Math.pow(2,-10*d)*Math.sin((d-c)*qa/b)}},back:function(a){a||(a=1.70158);return function(b){return b*b*((a+1)*b-a)}},bounce:function(){return oh}}),li=k.map({"in":ea,out:gf,"in-out":hf,"out-in":function(a){return hf(gf(a))}});k.ease=function(a){var b=a.indexOf("-"),c=0<=b?a.substring(0,b):a,b=0<=b?a.substring(b+1):"in",c=ki.get(c)||hg,b=li.get(b)||ea;return hh(b(c.apply(null,Vf.call(arguments, 214 | 1))))};k.interpolateHcl=function(a,b){a=k.hcl(a);b=k.hcl(b);var c=a.h,d=a.c,e=a.l,f=b.h-c,g=b.c-d,h=b.l-e;isNaN(g)&&(g=0,d=isNaN(d)?b.c:d);isNaN(f)?(f=0,c=isNaN(c)?b.h:c):180f&&(f+=360);return function(a){return Oc(c+f*a,d+g*a,e+h*a)+""}};k.interpolateHsl=function(a,b){a=k.hsl(a);b=k.hsl(b);var c=a.h,d=a.s,e=a.l,f=b.h-c,g=b.s-d,h=b.l-e;isNaN(g)&&(g=0,d=isNaN(d)?b.s:d);isNaN(f)?(f=0,c=isNaN(c)?b.h:c):180f&&(f+=360);return function(a){return Nc(c+f*a,d+g*a,e+h*a)+""}}; 215 | k.interpolateLab=function(a,b){a=k.lab(a);b=k.lab(b);var c=a.l,d=a.a,e=a.b,f=b.l-c,g=b.a-d,h=b.b-e;return function(a){return be(c+f*a,d+g*a,e+h*a)+""}};k.interpolateRound=jf;k.transform=function(a){var b=za.createElementNS(k.ns.prefix.svg,"g");return(k.transform=function(a){if(null!=a){b.setAttribute("transform",a);var d=b.transform.baseVal.consolidate()}return new kf(d?d.matrix:mi)})(a)};kf.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+ 216 | ")scale("+this.scale+")"};var mi={a:1,b:0,c:0,d:1,e:0,f:0};k.interpolateTransform=mf;k.layout={};k.layout.bundle=function(){return function(a){for(var b=[],c=-1,d=a.length;++c(g*=.99))return d.end({type:"end",alpha:g=0}),!0;var b=p.length,c=v.length, 220 | f,m,n,t,l,y,J;for(f=0;fe&&(e=h);d.push(h)}for(g=0;g< 232 | c;++g)k[g]=(e-d[g])/2;return k},wiggle:function(a){var b=a.length,c=a[0],d=c.length,e,f,g,h,k,n,r,l,q,p=[];p[0]=l=q=0;for(f=1;f=n[0]&&l<=n[1]&&(l=h[k.bisect(r,l,1,p)-1],l.y+=A,l.push(a[g]));return h}var b=!0,c=Number,d=Hh,e=Gh;a.value=function(b){if(!arguments.length)return c;c=b;return a};a.range=function(b){if(!arguments.length)return d; 234 | d=V(b);return a};a.bins=function(b){if(!arguments.length)return e;e="number"===typeof b?function(a){return pf(a,b)}:V(b);return a};a.frequency=function(c){if(!arguments.length)return b;b=!!c;return a};return a};k.layout.pack=function(){function a(a,g){var h=b.call(this,a,g),k=h[0],n=d[0],r=d[1],l=null==e?Math.sqrt:"function"===typeof e?e:function(){return e};k.x=k.y=0;Ea(k,function(a){a.r=+l(a.value)});Ea(k,sf);if(c){var q=c*(e?1:Math.max(2*k.r/n,2*k.r/r))/2;Ea(k,function(a){a.r+=q});Ea(k,sf);Ea(k, 235 | function(a){a.r-=q})}uf(k,n/2,r/2,e?1:1/Math.max(2*k.r/n,2*k.r/r));return h}var b=k.layout.hierarchy().sort(Ih),c=0,d=[1,1],e;a.size=function(b){if(!arguments.length)return d;d=b;return a};a.radius=function(b){if(!arguments.length)return e;e=null==b||"function"===typeof b?b:+b;return a};a.padding=function(b){if(!arguments.length)return c;c=+b;return a};return Gb(a,b)};k.layout.tree=function(){function a(a,k){var l=f.call(this,a,k),q=l[0],p=b(q);Ea(p,c);p.parent.m=-p.z;Hb(p,d);if(m)Hb(q,e);else{var A= 236 | q,v=q,x=q;Hb(q,function(a){a.xv.x&&(v=a);a.depth>x.depth&&(x=a)});var s=g(A,v)/2-A.x,y=h[0]/(v.x+g(v,A)/2+s),D=h[1]/(x.depth||1);Hb(q,function(a){a.x=(a.x+s)*y;a.y=a.depth*D})}return l}function b(a){a={A:null,children:[a]};for(var b=[a],c;null!=(c=b.pop());)for(var d=c.children,e,f=0,g=d.length;fb?0:b),e.area=isNaN(f)||0>=f?0:f}function b(c){var e=c.children;if(e&&e.length){var f=n(c),g=[],h=e.slice(),k=Infinity,m,l="slice"===q?f.dx:"dice"===q?f.dy:"slice-dice"===q?c.depth&1?f.dy:f.dx:Math.min(f.dx,f.dy);a(h,f.dx* 241 | f.dy/c.value);for(g.area=0;0<(c=h.length);){g.push(c=h[c-1]);g.area+=c.area;if(!(c="squarify"!==q)){m=l;c=g.area;for(var r=void 0,t=0,s=Infinity,y=-1,z=g.length;++yt&&(t=r);c*=c;m*=m;c=(m=c?Math.max(m*t*p/c,c/(m*s*p)):Infinity)<=k}c?(h.pop(),k=m):(g.area-=g.pop().area,d(g,l,f,!1),l=Math.min(f.dx,f.dy),g.length=g.area=0,k=Infinity)}g.length&&(d(g,l,f,!0),g.length=g.area=0);e.forEach(b)}}function c(b){var e=b.children;if(e&&e.length){var f=n(b),g=e.slice(),h=[];a(g,f.dx* 242 | f.dy/b.value);for(h.area=0;b=g.pop();)h.push(b),h.area+=b.area,null!=b.z&&(d(h,b.z?f.dx:f.dy,f,!g.length),h.length=h.area=0);e.forEach(c)}}function d(a,b,c,d){var e=-1,f=a.length,h=c.x,k=c.y,m=b?g(a.area/b):0,n;if(b==c.dx){if(d||m>c.dy)m=c.dy;for(;++ec.dx)m=c.dx;for(;++ec&&(b=1);1>c&&(a=0);return function(){var c,e;do c=2* 245 | Math.random()-1,e=2*Math.random()-1,e=c*c+e*e;while(!e||1=wi?a?"M0,"+g+"A"+g+","+g+" 0 1,1 0,"+-g+"A"+g+","+g+" 0 1,1 0,"+g+"M0,"+a+"A"+a+","+a+" 0 1,0 0,"+-a+"A"+a+","+a+" 0 1,0 0,"+a+"Z":"M0,"+g+"A"+g+","+g+" 0 1,1 0,"+-g+"A"+g+","+g+" 0 1,1 0,"+g+"Z":a?"M"+g*p+","+g*h+"A"+g+","+g+" 0 "+l+",1 "+g*q+","+g*k+"L"+a*q+","+a*k+"A"+a+","+a+" 0 "+ 250 | l+",0 "+a*p+","+a*h+"Z":"M"+g*p+","+g*h+"A"+g+","+g+" 0 "+l+",1 "+g*q+","+g*k+"L0,0Z"}var b=Th,c=Uh,d=Jf,e=Kf;a.innerRadius=function(c){if(!arguments.length)return b;b=V(c);return a};a.outerRadius=function(b){if(!arguments.length)return c;c=V(b);return a};a.startAngle=function(b){if(!arguments.length)return d;d=V(b);return a};a.endAngle=function(b){if(!arguments.length)return e;e=V(b);return a};a.centroid=function(){var a=(b.apply(this,arguments)+c.apply(this,arguments))/2,g=(d.apply(this,arguments)+ 251 | e.apply(this,arguments))/2+eb;return[Math.cos(g)*a,Math.sin(g)*a]};return a};var eb=-ha,wi=qa-1E-6;k.svg.line=function(){return Lf(ea)};var xd=k.map({linear:ra,"linear-closed":function(a){return ra(a)+"Z"},step:function(a){for(var b=0,c=a.length,d=a[0],e=[d[0],",",d[1]];++ba.length)return ra(a);for(var b=[],c=-1,d=a.length,e,f=[0],g=[0];3>++c;)e= 252 | a[c],f.push(e[0]),g.push(e[1]);b.push(ua(Wa,f)+","+ua(Wa,g));for(--c;++c++c;)f=a[c%d],g.push(f[0]),h.push(f[1]);b=[ua(Wa,g),",",ua(Wa,h)];for(--c;++ca.length?ra(a):a[0]+nc(a,Ad(a,b))},"cardinal-open":function(a,b){return 4>a.length?ra(a):a[1]+nc(a.slice(1,a.length-1),Ad(a,b))},"cardinal-closed":function(a,b){return 3>a.length?ra(a):a[0]+nc((a.push(a[0]),a),Ad([a[a.length-2]].concat(a,[a[1]]),b))},monotone:function(a){if(3>a.length)a=ra(a);else{var b=a[0],c=[],d,e,f,g;d=0;e=a.length-1;var h=[];f=a[1];for(g=h[0]=Cd(a[0],f);++dI(d)?h[k]=h[k+1]=0:(e=h[k]/d,f=h[k+1]/d,g=e*e+f*f,9K)+",1 "+b}var d=ed,e=fd,f=Vh,g=Jf,h=Kf;a.radius=function(b){if(!arguments.length)return f;f=V(b);return a};a.source=function(b){if(!arguments.length)return d;d=V(b);return a};a.target=function(b){if(!arguments.length)return e;e=V(b);return a};a.startAngle= 257 | function(b){if(!arguments.length)return g;g=V(b);return a};a.endAngle=function(b){if(!arguments.length)return h;h=V(b);return a};return a};k.svg.diagonal=function(){function a(a,f){var g=b.call(this,a,f),h=c.call(this,a,f),k=(g.y+h.y)/2,g=[g,{x:g.x,y:k},{x:h.x,y:k},h],g=g.map(d);return"M"+g[0]+"C"+g[1]+" "+g[2]+" "+g[3]}var b=ed,c=fd,d=Rf;a.source=function(c){if(!arguments.length)return b;b=V(c);return a};a.target=function(b){if(!arguments.length)return c;c=V(b);return a};a.projection=function(b){if(!arguments.length)return d; 258 | d=b;return a};return a};k.svg.diagonal.radial=function(){var a=k.svg.diagonal(),b=Rf,c=a.projection;a.projection=function(a){return arguments.length?c(Wh(b=a)):b};return a};k.svg.symbol=function(){function a(a,e){return(jg.get(b.call(this,a,e))||Sf)(c.call(this,a,e))}var b=Yh,c=Xh;a.type=function(c){if(!arguments.length)return b;b=V(c);return a};a.size=function(b){if(!arguments.length)return c;c=V(b);return a};return a};var jg=k.map({circle:Sf,cross:function(a){a=Math.sqrt(a/5)/2;return"M"+-3*a+","+ 259 | -a+"H"+-a+"V"+-3*a+"H"+a+"V"+-a+"H"+3*a+"V"+a+"H"+a+"V"+3*a+"H"+-a+"V"+a+"H"+-3*a+"Z"},diamond:function(a){a=Math.sqrt(a/(2*kg));var b=a*kg;return"M0,"+-a+"L"+b+",0 0,"+a+" "+-b+",0Z"},square:function(a){a=Math.sqrt(a)/2;return"M"+-a+","+-a+"L"+a+","+-a+" "+a+","+a+" "+-a+","+a+"Z"},"triangle-down":function(a){a=Math.sqrt(a/Fc);var b=a*Fc/2;return"M0,"+b+"L"+a+","+-b+" "+-a+","+-b+"Z"},"triangle-up":function(a){a=Math.sqrt(a/Fc);var b=a*Fc/2;return"M0,"+-b+"L"+a+","+b+" "+-a+","+b+"Z"}});k.svg.symbolTypes= 260 | jg.keys();var Fc=Math.sqrt(3),kg=Math.tan(30*H),ca=[],Zf=0,gb,rc;ca.call=P.call;ca.empty=P.empty;ca.node=P.node;ca.size=P.size;k.transition=function(a){return arguments.length?gb?a.transition():a:Yf.transition()};k.transition.prototype=ca;ca.select=function(a){var b=this.id,c=[],d,e,f;a=l(a);for(var g=-1,h=this.length;++garguments.length?this.node().__transition__[c].tween.get(a):Pa(this,null==b?function(b){b.__transition__[c].tween.remove(a)}:function(d){d.__transition__[c].tween.set(a,b)})};ca.attr=function(a,b){function c(){this.removeAttribute(h)}function d(){this.removeAttributeNS(h.space,h.local)}function e(a){return null==a?c:(a+="",function(){var b=this.getAttribute(h),c;return b!==a&&(c=g(b,a),function(a){this.setAttribute(h, 263 | c(a))})})}function f(a){return null==a?d:(a+="",function(){var b=this.getAttributeNS(h.space,h.local),c;return b!==a&&(c=g(b,a),function(a){this.setAttributeNS(h.space,h.local,c(a))})})}if(2>arguments.length){for(b in a)this.attr(b,a[b]);return this}var g="transform"==a?mf:db,h=k.ns.qualify(a);return Dd(this,"attr."+a,b,h.local?f:e)};ca.attrTween=function(a,b){function c(a,c){var d=b.call(this,a,c,this.getAttribute(e));return d&&function(a){this.setAttribute(e,d(a))}}function d(a,c){var d=b.call(this, 264 | a,c,this.getAttributeNS(e.space,e.local));return d&&function(a){this.setAttributeNS(e.space,e.local,d(a))}}var e=k.ns.qualify(a);return this.tween("attr."+a,e.local?d:c)};ca.style=function(a,b,c){function d(){this.style.removeProperty(a)}var e=arguments.length;if(3>e){if("string"!==typeof a){2>e&&(b="");for(c in a)this.style(c,a[c],b);return this}c=""}return Dd(this,"style."+a,b,function(b){return null==b?d:(b+="",function(){var d=ka.getComputedStyle(this,null).getPropertyValue(a),e;return d!==b&& 265 | (e=db(d,b),function(b){this.style.setProperty(a,e(b),c)})})})};ca.styleTween=function(a,b,c){3>arguments.length&&(c="");return this.tween("style."+a,function(d,e){var f=b.call(this,d,e,ka.getComputedStyle(this,null).getPropertyValue(a));return f&&function(b){this.style.setProperty(a,f(b),c)}})};ca.text=function(a){return Dd(this,"text",a,Zh)};ca.remove=function(){return this.each("end.transition",function(){var a;2>this.__transition__.count&&(a=this.parentNode)&&a.removeChild(this)})};ca.ease=function(a){var b= 266 | this.id;if(1>arguments.length)return this.node().__transition__[b].ease;"function"!==typeof a&&(a=k.ease.apply(k,arguments));return Pa(this,function(c){c.__transition__[b].ease=a})};ca.delay=function(a){var b=this.id;return 1>arguments.length?this.node().__transition__[b].delay:Pa(this,"function"===typeof a?function(c,d,e){c.__transition__[b].delay=+a.call(c,c.__data__,d,e)}:(a=+a,function(c){c.__transition__[b].delay=a}))};ca.duration=function(a){var b=this.id;return 1>arguments.length?this.node().__transition__[b].duration: 267 | Pa(this,"function"===typeof a?function(c,d,e){c.__transition__[b].duration=Math.max(1,a.call(c,c.__data__,d,e))}:(a=Math.max(1,a),function(c){c.__transition__[b].duration=a}))};ca.each=function(a,b){var c=this.id;if(2>arguments.length){var d=rc,e=gb;gb=c;Pa(this,function(b,d,e){rc=b.__transition__[c];a.call(b,b.__data__,d,e)});rc=d;gb=e}else Pa(this,function(d){d=d.__transition__[c];(d.event||(d.event=k.dispatch("start","end"))).on(a,b)});return this};ca.transition=function(){for(var a=this.id,b= 268 | ++Zf,c=[],d,e,f,g,h=0,k=this.length;hrect,.s>rect").attr("width",m[1]-m[0])}function d(a){a.select(".extent").attr("y", 276 | n[0]);a.selectAll(".extent,.e>rect,.w>rect").attr("height",n[1]-n[0])}function e(){function e(){var a=k.mouse(z),f=!1;na&&(a[0]+=na[0],a[1]+=na[1]);I||(k.event.altKey?(U||(U=[(m[0]+m[1])/2,(n[0]+n[1])/2]),N[0]=m[+(a[0]G&&(G=u)});return[T,G]}function S(C){var T,G;d3_layout_hierarchyVisitAfter(C,function(C){var u;if(C.children&&0!==C.children.length){u=C.children;var T=[],B,Q;Q=0;var G;G=[];var O,R; 291 | for(B=0;BN&&(N=na);for(O=B;O=N))for(l=N/(G-B),O=B;Ol[p].right&&(l[p].right=Z,l[p].rightNode=N);T[0]={left:-G, 293 | leftNode:u[0],right:G,rightNode:u[u.length-1]};u=T}else u=[];C._vtAreas=u});T=Y(C);G=T[1]-T[0];d3_layout_hierarchyVisitBefore(C,function(C){C.x=C.parent?C.parent.x+C._vtRelX:-T[0]});return G}function da(C){var G=[],S;d3_layout_hierarchyVisitBefore(C,function(C){void 0===G[C.depth]&&(G[C.depth]=0);C.h>G[C.depth]&&(G[C.depth]=C.h)});d3_layout_hierarchyVisitAfter(C,function(C){var u,R;for(u=R=0;ul._conf.maxNameLen&&(s=s.substring(0,l._conf.maxNameLen),l._conf.showEllipsis&&(s+="..."));return s}function R(l,p,s){l=l||"";l.length>p&& 298 | (l=l.substring(0,p),s&&(l+="..."));return l}function T(l,p,s){var y,u,B,C;if(!p||0===p.length)return 0;B=l._conf.fontSize/2;C=0===s?l._conf.maxNameLen:l._conf.maxValueLen;for(y=0;yB&&(B=u);l.d3.ruler.text("");return B+2*l._conf.td_padding}function Gc(l){return function(p){var s,y,u;y=s=0;var B,C=0,U;u=l._conf.fontSize;B=l._conf.td_padding;p._vtLinkName&&l._conf.showLinkName&&(C=ia(l,p),l.d3.ruler.text(C), 299 | C=l.d3.ruler[0][0].offsetWidth,l.d3.ruler.text(""));(U=p._vtNameTbl)&&0!==U.length?(l._conf.showColumn[0]&&(s=T(l,U,0)),l._conf.showColumn[1]&&(y=T(l,U,1)),s+=y,y=(u+2*B)*U.length):(s=u+2*B,y=u+2*B);l._mode===l.MODE_PYTHON_AST&&p._PyType&&(l.d3.ruler.style("font-weight","bold"),l.d3.ruler.text(p._PyType),w=l.d3.ruler[0][0].offsetWidth,w+=2*B,l.d3.ruler.text(""),l.d3.ruler.style("font-weight","normal"),w>s&&(s=w),U&&0!==U.length&&(y+=u+2*B));p._vtWidth=s;C>s&&(s=C);return[s,y]}}function aa(l){return function(p){l.d3.tooltip.transition().duration(200).style("opacity", 300 | .9);l.d3.tooltip.text(p._vtOriginal).style("left",d3.event.pageX-l.containerLeft+"px").style("top",d3.event.pageY-l.containerTop-l._conf.fontSize+"px")}}function u(l){return function(){l.d3.tooltip.transition().duration(500).style("opacity",0);l.d3.tooltip.text("")}}function ga(l){return function(p){if(void 0!==p._vtChildren||void 0!==p._vtHiddenChildren)p._vtChildren?(p._vtHiddenChildren=p._vtChildren,p._vtChildren=null):(p._vtChildren=p._vtHiddenChildren,p._vtHiddenChildren=null),l.update(p)}}function B(l, 301 | p){this.d3={};this.d3.container=d3.select(l).text("").style("position","relative");this.curMaxId=0;this._conf={};this._conf.fontSize=14;this._conf.nodeMargin=8;this._conf.td_padding=4;this._conf.duration=768;this._conf.showArrayNode=!0;this._conf.showColumn=[];this._conf.showColumn[0]=!0;this._conf.showColumn[1]=!0;this._conf.showLinkName=!0;this._conf.maxNameLen=32;this._conf.maxValueLen=32;this._conf.showEllipsis=!0;this.width=920;this.height=760;this.d3.zoomListener=d3.behavior.zoom().scaleExtent([1, 302 | 2]).on("zoom",G(this));this.d3.msg=this.d3.container.append("div").attr("class","vtree-message");this.d3.svg=this.d3.container.append("svg").attr("width",this.width).attr("height",this.height).call(this.d3.zoomListener);this.d3.g=this.d3.svg.append("g").attr("transform","translate(20,20)");this.d3.ruler=this.d3.container.append("span").text("").style("visibility","hidden").style("white-space","nowrap").style("font",this._conf.fontSize+"px sans-serif");this.d3.tooltip=this.d3.container.append("div").attr("class", 303 | "vtree-tooltip").style("opacity",0);this.d3.tree=d3.layout.vtree().children(ba(this)).separation(fa(this)).hSeparation(Fa(this)).nodeSize(Gc(this));this.d3.diagonal=d3.svg.diagonal().projection(function(l){return[l.x,l.y]});this.containerLeft=l.getBoundingClientRect().left;this.containerTop=l.getBoundingClientRect().top;this.mode(this.MODE_NORMAL);this.data(p)}function Q(l,p,s){return"number"!==typeof l?null:p&&ls?s:l}function Ga(l,p,s,y,u){s=Q(s,y,u);return null!==s?(l[p]=s,!0):!1}var O= 304 | /^\s*null\s*$/,Aa=/^\s*https?:\/\/[^\s<>]+\s*$/;B.prototype.createLinkName=function(l,p){var s=this,y;y=this._conf.showLinkName;l.filter(function(l){return l._vtLinkName}).append("text").attr("class","vtree-link-name");p.selectAll(".vtree-link-name").text(function(l){return y?ia(s,l):""}).attr("y",-this._conf.fontSize/3).attr("text-anchor","middle").style("font-size",this._conf.fontSize)};B.prototype.createDummyArray=function(l,p){var s;s=2*this._conf.fontSize/3;l.filter(function(l){return l._vtIsDummy}).append("circle").attr("class", 305 | "vtree-dummy").attr("cy",s).attr("r",s);p.selectAll("circle").style("fill",function(l){return l._vtHiddenChildren?"lightsteelblue":"white"})};B.prototype.createTables=function(l,p,s){var y=this,B,C,G;p.filter(function(l){return!l._vtIsDummy}).append("path").attr("class","vtree-table");s.selectAll(".vtree-table").attr("d",function(l){var p=[],s,u,B,C,G,N;B=(C=l._vtNameTbl)&&0!==C.length?T(y,C,0):0;u=l._vtWidth/2;s=!1===y._conf.showColumn[0]?-u:-u+B;p.push(["M",-u,0].join(" "));p.push(["L",u,0].join(" ")); 306 | p.push(["L",u,l.h].join(" "));p.push(["L",-u,l.h].join(" "));p.push("Z");if(C&&0!==C.length)for(G=C.length,y._mode===y.MODE_PYTHON_AST&&l._PyType?(G++,B=N=l.h/G):(N=0,B=l.h/C.length),C=(l.h-N)/C.length,y._conf.showColumn[0]&&y._conf.showColumn[1]&&(p.push(["M",s,N].join(" ")),p.push(["L",s,l.h].join(" "))),l=0;laa}).on("mouseover",B).on("mouseout",C));y._conf.showColumn[1]&&(u[1]._vtOriginal=u[1].val||"",Y=R(u[1].val,ba,fa),Aa.test(u[1].val)?(da=da.append("a").attr("xlink:href",u[1].val),ga=!0):ga=!1,ia=da.selectAll("text.vtree-val-col").data([u[1]]).enter().append("text").attr("class", 310 | "vtree-val-col").text(Y).attr("x",Q+G).attr("y",ia).style("font-size",y._conf.fontSize),ia.filter(function(l){return l._vtOriginal.length>ba}).on("mouseover",B).on("mouseout",C),ga&&da.attr("fill","#00F"))}))});this.createDummyArray(p,s)};B.prototype.createNodes=function(l,p){var s,u,B,C;s=this;u=this.d3.g.selectAll("g.vtree-node").data(p,function(l){l.id||(l.id=++s.curMaxId);return l.id});B=u.enter().append("g").attr("class","vtree-node").attr("transform",function(){return["translate(",l.x0,",", 311 | l.y0,")"].join("")}).style("opacity",0).on("click",ga(this));C=u.transition().duration(this._conf.duration).attr("transform",function(l){return["translate(",l.x,",",l.y,")"].join("")}).style("opacity",1);u.exit().transition().duration(this._conf.duration).attr("transform",function(){return["translate(",l.x,",",l.y,")"].join("")}).style("opacity",0).remove();this.createLinkName(B,C);this.createTables(u,B,C)};B.prototype.createLinks=function(l,p){var s,u;u=this.d3.diagonal;s=this.d3.g.selectAll("path.vtree-link").data(p, 312 | function(l){return l.target.id});s.enter().insert("path","g").attr("class","vtree-link").attr("d",function(){var p={x:l.x0,y:l.y0};return u({source:p,target:p})}).style("opacity",0);s.transition().duration(this._conf.duration).attr("d",u).style("opacity",1);s.exit().transition().duration(this._conf.duration).attr("d",function(){var p={x:l.x,y:l.y};return u({source:p,target:p})}).style("opacity",0).remove()};B.prototype.update=function(l){var p,s,u;p={};l||(l=this.root);s=this.d3.tree(this.root,void 0, 313 | p);u=this.d3.tree.links(s);this.createNodes(l,s);this.createLinks(l,u);p.widthl||l>=this.MAX_MODE)return this;this._mode=l;return this};B.prototype.size=function(l,p){var s,u;s=Q(l,32,8096);u=Q(p,32,8096);if(null===s||null===u)return this;this.width=l;this.height=p;this.d3.svg.attr("width",l).attr("height",p);return this};B.prototype.conf=function(l,p){var s;s=this._conf;switch(l){case "showEllipsis":s.showEllipsis=!!p;break;case "showArrayNode":s.showArrayNode=!!p;break;case "showLinkName":s.showLinkName=!!p;break;case "showColumn0":s.showColumn[0]= 316 | !!p;!1===s.showColumn[0]&&(s.showColumn[1]=!0);break;case "showColumn1":s.showColumn[1]=!!p;!1===s.showColumn[1]&&(s.showColumn[0]=!0);break;case "fontSize":Ga(s,l,p,9,32);this.d3.ruler.style("font-size",s.fontSize+"px");break;case "nodeMargin":Ga(s,l,p,1,100);break;case "animeDuration":Ga(s,"duration",p,10,1E4);break;case "maxNameLen":Ga(s,l,p,1,1024);break;case "maxValueLen":Ga(s,l,p,1,1024)}return this};return function(l,p){return new B(l,p)}}(); 317 | -------------------------------------------------------------------------------- /main.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # 3 | # Copyright 2007 Google Inc. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | from _ast import AST 18 | import ast 19 | import json 20 | 21 | import webapp2 22 | 23 | 24 | class MainHandler( webapp2.RequestHandler ): 25 | 26 | def post( self ): 27 | node = ast.parse( self.request.get( 'pysrc' ) ) 28 | 29 | self.response.headers['Content-Type'] = 'application/json' 30 | self.response.write( ast2json( node ) ) 31 | 32 | 33 | 34 | def ast2json( node ): 35 | 36 | if not isinstance( node, AST ): 37 | raise TypeError( 'expected AST, got %r' % node.__class__.__name__ ) 38 | 39 | 40 | def _format( node ): 41 | if isinstance( node, AST ): 42 | fields = [ ( '_PyType', _format( node.__class__.__name__ ) ) ] 43 | fields += [ ( a, _format( b ) ) for a, b in iter_fields( node ) ] 44 | 45 | return '{ %s }' % ', '.join( ( '"%s": %s' % field for field in fields ) ) 46 | 47 | if isinstance( node, list ): 48 | return '[ %s ]' % ', '.join( [ _format( x ) for x in node ] ) 49 | 50 | return json.dumps( node ) 51 | 52 | 53 | return _format( node ) 54 | 55 | 56 | 57 | def iter_fields( node ): 58 | 59 | for field in node._fields: 60 | try: 61 | yield field, getattr( node, field ) 62 | except AttributeError: 63 | pass 64 | 65 | 66 | 67 | app = webapp2.WSGIApplication( [ 68 | ( '/ast2json', MainHandler ) 69 | ], debug=True ) 70 | -------------------------------------------------------------------------------- /vpyast.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ivan111/vpyast/8e878b6b3e2b5a25a641af00df611cb70a4ba73e/vpyast.png --------------------------------------------------------------------------------