• forked:都道府県別 幸福度ランキング
Import an externally hosted application
Check style

  • JavaScript
  • CSS
  • HTML
  • Images
  • Input Data
  • ReadMe
  • forked:都道府県別 幸福度ランキング
  • jquery-1.7.1.min.js  
  • https://www.google.com/jsapi  
  • http://www.html5.jp/library/sample/graph_radar/html5jp/graph/radar.js  
  •  
  • history

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
 
if(typeof Application==="undefined"||!Application){var Application= {};}
   
   Application.gc = function() {
    this._init.apply(this, arguments);
}
 
Application.gc.prototype = {
    
    _data : null,
    _options : null,
    _prefecture : null,
    
    _init : function() {
        this._prefecture = this._getGooglePrefecture();
        this._data = this._getGoogleDataTable();
        this._options = this._getGoogleOption();
    },
    
    _configArray : function() {
        var array = [
            {
                "caption" : "Location",
                "property" : "label"
            },
            {
                "caption" : "幸福度",
                "property" : "http://www.unisys.co.jp/research/happiness_ranking/property/total_ranking"
            }
        ];
        return array;
    },
    
    _getGoogleOption : function() {
        var options = {
            region: 'JP',
            width:'800px',
            height:'600px',
            colors: [0x267114,0x50AA00,0xA5EF63,0xE0FFD4]
        };
        return options;
    },
    
    _getGoogleDataTable : function() {
        var configArray = getConfigArray();
        var prefectureArray = this._prefecture;
        var main = [];
        var array = [];
        $.each(configArray, function(index, obj) {
            array.push(obj.caption);
        });
        array.push("都道府県名");
        main.push(array);
 
        var mainArray = this._getObjectArray();
        $.each(mainArray, function(i, objArray) {
            array = [];
            $.each(objArray, function(j, objData) {
                $.each(configArray, function(k, obj) {
                    if (objData.property === obj.property) {
                        var val = null;
                        if (obj.property === "label") {
                            $.each(prefectureArray, function(l, prefecture) {
                                if (objData.value === prefecture.name ) {
                                    val = prefecture.codename;
                                    array[2] = objData.value;
                                }
                            });
                        } else {
                            val = objData.value;
                        }
                        
                        if (! isNaN(val)) {
                            if (Math.floor(val).toString() == val.toString()) {
                                // yay! we have an int
                                val = parseInt(val);
                                //a(val);
                                //a(array[2]);
                                setRanking(array[2],val);
                            } else {
                                // it's a float or something else.
                                val = parseFloat(val);
                            } 
                        }
                        array[k] = val;
                    }
                });
            });
            main.push(array);
        });
        return main;
    },
    
    _getObjectArray : function() {
        var main = [];
        $.each(LinkData.getWorks(), function(workKey, workValue) {
            $.each(LinkData.getFiles(workValue), function(fileKey, fileValue) {
                $.each(LinkData.getSubjects(workValue, fileValue), function(subjKey, subjValue) {
                    var array = [];
                    $.each(LinkData.getProperties(workValue, fileValue), function(propKey, propValue) {
                        var obj = {};
jquery-1.7.1.min.js
https://www.google.com/jsapi
http://www.html5.jp/library/sample/graph_radar/html5jp/graph/radar.js
Playing...

jquery-1.7.1.min.js
https://www.google.com/jsapi
http://www.html5.jp/library/sample/graph_radar/html5jp/graph/radar.js