アットウィキロゴ

jsapi

<html>
<head>
<meta charset="utf-8"/>
<script type="text/javascript" src="http://www.google.com/jsapi"></script> 
<script src="sample.js"></script>
<script src="jquery.js"></script>
<script src="ex.js"></script>
</head>
<body onload="sample()">
<p id="memo"></p>    
</body>
</html>
    </body>
</html>
 
 
class ex{
 
namex:string[]=new Array();
number_dir:number[]=new Array();
dir:any[]=new Array();
 
 
faststep():void{
 
this.namex[1]="北海道";
this.namex[2]="青森";
this.namex[3]="岩手";
this.namex[4]="宮城";
this.namex[5]="秋田";
this.namex[6]="山形";
this.namex[7]="福島";
this.namex[8]="茨城";
this.namex[9]="栃木";
this.namex[10]="群馬";
this.namex[11]="埼玉";
this.namex[12]="千葉";
this.namex[13]="東京";
this.namex[14]="神奈川";
this.namex[15]="新潟";
this.namex[16]="富山";
this.namex[17]="石川";
this.namex[18]="福井";
this.namex[19]="山梨";
this.namex[20]="長野";
this.namex[21]="岐阜";
this.namex[22]="静岡";
this.namex[23]="愛知";
this.namex[24]="三重";
this.namex[25]="滋賀";
this.namex[26]="京都";
this.namex[27]="大阪";
this.namex[28]="兵庫";
this.namex[29]="奈良";
this.namex[30]="和歌山";
this.namex[31]="鳥取";
this.namex[32]="島根";
this.namex[33]="岡山";
this.namex[34]="広島";
this.namex[35]="山口";
this.namex[36]="徳島";
this.namex[37]="香川";
this.namex[38]="愛媛";
this.namex[39]="高知";
this.namex[40]="福岡";
this.namex[41]="佐賀";
this.namex[42]="長崎";
this.namex[43]="熊本";
this.namex[44]="大分";
this.namex[45]="宮崎";
this.namex[46]="鹿児島";
this.namex[47]="沖縄";
 
 
 
this.number_dir[1]=1;
this.number_dir[2]=3;
this.number_dir[3]=3;
this.number_dir[4]=3;
this.number_dir[5]=3;
this.number_dir[6]=4;
this.number_dir[7]=6;
this.number_dir[8]=4;
this.number_dir[9]=3;
this.number_dir[10]=5;
this.number_dir[11]=4;
this.number_dir[12]=4;
this.number_dir[13]=5;
this.number_dir[14]=4;
this.number_dir[15]=4;
this.number_dir[16]=4;
this.number_dir[17]=2;
this.number_dir[18]=4;
this.number_dir[19]=4;
this.number_dir[20]=6;
this.number_dir[21]=5;
this.number_dir[22]=5;
this.number_dir[23]=4;
this.number_dir[24]=5;
this.number_dir[25]=4;
this.number_dir[26]=5;
this.number_dir[27]=4;
this.number_dir[28]=6;
this.number_dir[29]=4;
this.number_dir[30]=3;
this.number_dir[31]=3;
this.number_dir[32]=3;
this.number_dir[33]=4;
this.number_dir[34]=4;
this.number_dir[35]=5;
this.number_dir[36]=3;
this.number_dir[37]=3;
this.number_dir[38]=4;
this.number_dir[39]=2;
this.number_dir[40]=4;
this.number_dir[41]=2;
this.number_dir[42]=2;
this.number_dir[43]=5;
this.number_dir[44]=5;
this.number_dir[45]=3;
this.number_dir[46]=3;
this.number_dir[47]=1;
this.dir[1][1]=2;
this.dir[2][1]=1;
this.dir[2][2]=3;
this.dir[2][3]=5;
this.dir[3][1]=2;
this.dir[3][2]=4;
this.dir[3][3]=5;
this.dir[4][1]=3;
this.dir[4][2]=6;
this.dir[4][3]=7;
this.dir[5][1]=2;
this.dir[5][2]=3;
this.dir[5][3]=6;
this.dir[6][1]=4;
this.dir[6][2]=5;
this.dir[6][3]=7;
this.dir[6][4]=15;
this.dir[7][1]=4;
this.dir[7][2]=6;
this.dir[7][3]=8;
this.dir[7][4]=9;
this.dir[7][5]=10;
this.dir[7][6]=15;
this.dir[8][1]=7;
this.dir[8][2]=9;
this.dir[8][3]=11;
this.dir[8][4]=12;
this.dir[9][1]=7;
this.dir[9][2]=8;
this.dir[9][3]=10;
this.dir[10][1]=7;
this.dir[10][2]=9;
this.dir[10][3]=11;
this.dir[10][4]=15;
this.dir[10][5]=20;
this.dir[11][1]=8;
this.dir[11][2]=10;
this.dir[11][3]=12;
this.dir[11][4]=13;
this.dir[12][1]=8;
this.dir[12][2]=11;
this.dir[12][3]=13;
this.dir[12][4]=14;
this.dir[13][1]=11;
this.dir[13][2]=12;
this.dir[13][3]=14;
this.dir[13][4]=19;
this.dir[13][5]=22;
this.dir[14][1]=12;
this.dir[14][2]=13;
this.dir[14][3]=19;
this.dir[14][4]=22;
this.dir[15][1]=6;
this.dir[15][2]=7;
this.dir[15][3]=10;
this.dir[15][4]=20;
this.dir[16][1]=15;
this.dir[16][2]=17;
this.dir[16][3]=20;
this.dir[16][4]=21;
this.dir[17][1]=16;
this.dir[17][2]=18;
this.dir[18][1]=17;
this.dir[18][2]=21;
this.dir[18][3]=25;
this.dir[18][4]=26;
this.dir[19][1]=13;
this.dir[19][2]=14;
this.dir[19][3]=20;
this.dir[19][4]=22;
this.dir[20][1]=10;
this.dir[20][2]=15;
this.dir[20][3]=16;
this.dir[20][4]=19;
this.dir[20][5]=21;
this.dir[20][6]=23;
this.dir[21][1]=16;
this.dir[21][2]=20;
this.dir[21][3]=23;
this.dir[21][4]=24;
this.dir[21][5]=25;
this.dir[22][1]=13;
this.dir[22][2]=14;
this.dir[22][3]=19;
this.dir[22][4]=20;
this.dir[22][5]=23;
this.dir[23][1]=20;
this.dir[23][2]=21;
this.dir[23][3]=22;
this.dir[23][4]=24;
this.dir[24][1]=21;
this.dir[24][2]=23;
this.dir[24][3]=25;
this.dir[24][4]=29;
this.dir[24][5]=30;
this.dir[25][1]=18;
this.dir[25][2]=21;
this.dir[25][3]=24;
this.dir[25][4]=26;
this.dir[26][1]=18;
this.dir[26][2]=25;
this.dir[26][3]=27;
this.dir[26][4]=28;
this.dir[26][5]=29;
this.dir[27][1]=26;
this.dir[27][2]=28;
this.dir[27][3]=29;
this.dir[27][4]=30;
this.dir[28][1]=26;
this.dir[28][2]=27;
this.dir[28][3]=31;
this.dir[28][4]=33;
this.dir[28][5]=36;
this.dir[28][6]=37;
this.dir[29][1]=24;
this.dir[29][2]=26;
this.dir[29][3]=27;
this.dir[29][4]=30;
this.dir[30][1]=24;
this.dir[30][2]=27;
this.dir[30][3]=29;
this.dir[31][1]=28;
this.dir[31][2]=32;
this.dir[31][3]=33;
this.dir[32][1]=31;
this.dir[32][2]=34;
this.dir[32][3]=35;
this.dir[33][1]=28;
this.dir[33][2]=31;
this.dir[33][3]=34;
this.dir[33][4]=37;
this.dir[34][1]=32;
this.dir[34][2]=33;
this.dir[34][3]=35;
this.dir[34][4]=38;
this.dir[35][1]=32;
this.dir[35][2]=34;
this.dir[35][3]=38;
this.dir[35][4]=40;
this.dir[35][5]=44;
this.dir[36][1]=28;
this.dir[36][2]=37;
this.dir[36][3]=39;
this.dir[37][1]=33;
this.dir[37][2]=36;
this.dir[37][3]=38;
this.dir[38][1]=34;
this.dir[38][2]=35;
this.dir[38][3]=37;
this.dir[38][4]=39;
this.dir[39][1]=36;
this.dir[39][2]=38;
this.dir[40][1]=35;
this.dir[40][2]=41;
this.dir[40][3]=43;
this.dir[40][4]=44;
this.dir[41][1]=40;
this.dir[41][2]=42;
this.dir[42][1]=41;
this.dir[42][2]=43;
this.dir[43][1]=40;
this.dir[43][2]=42;
this.dir[43][3]=44;
this.dir[43][4]=45;
this.dir[43][5]=46;
this.dir[44][1]=35;
this.dir[44][2]=38;
this.dir[44][3]=40;
this.dir[44][4]=43;
this.dir[44][5]=45;
this.dir[45][1]=43;
this.dir[45][2]=44;
this.dir[45][3]=46;
this.dir[46][1]=43;
this.dir[46][2]=45;
this.dir[46][3]=47;
this.dir[47][1]=46;
 
 
 
}
 
 
}
 
 
 
google.load("visualization", "1", {packages:["geochart"]});
 
var namex=new Array();
var number_dir=new Array();
var dir=new Array();
var x=new Array();
var a=new Array();
 
function sample(){
 
    for (s = 1; s < 48;s++ ){
     dir[s]=new Array();   
    }
 
var sub = new ex();
sub.dir = dir;
sub.faststep();
dir = sub.dir;
namex = sub.namex;
number_dir = sub.number_dir;
 
 
ball=1;
 
 
 
for(s=0;s<48;s++){
    x[s]=new Array();    
    }
 
  x[0][0]="Region";
  x[0][1]="POINT";
 
  for(s=1;s<48;s++){
 x[s][0]=namex[s];
  }
 
        var options = {
        region: 'JP',
        resolution: 'provinces',
        colorAxis: {colors: ['green','yellow', 'red']}
      };
 
 var timer;
var delay = 1000;
 
 for(s=1;s<101;s++){
 a[s]=1;    
 }
 
var loop = function () {
 
 for(s=1;s<101;s++){
ball=a[s]; 
n1=number_dir[ball]*Math.random();
n2=Math.floor(n1)+1;
a[s]=dir[ball][n2];
 }
 
 
 
  for(s=1;s<48;s++){
 x[s][1]=0;
  }
 
for(s=1;s<101;s++){
ball=a[s];
x[ball][1]=100;
}
 
 var data = google.visualization.arrayToDataTable(x); 
var chart = new google.visualization.GeoChart(document.getElementById('memo'));
chart.draw(data, options);
 
 
 
    clearTimeout(timer);
    timer = setTimeout(loop, delay);
}
 
loop();
 
 
}
 
最終更新:2015年11月01日 05:23