weso / wiBackend

http://www.weso.es
0 stars 0 forks source link

Generate nested list of Indicators, Years and Countries #33

Open castrofernandez opened 11 years ago

castrofernandez commented 11 years ago

For "/compare" view we need a 3 JSON nested arrays for indicators, years and countries.

Example of data:

<script> var dataCountries = [ { name: "AFRICA", children: [] }, { name: "EAST ASIA & PACIFIC", children: [ { name: "JAPAN", code: "JPN", children: [] } ] }, { name: "EUROPE & CENTRAL ASIA", children: [ { name: "FRANCE", code: "FRA", children: [] }, { name: "PORTUGAL", code: "POR", children: [] }, { name: "SPAIN", code: "ESP", children: [] }, { name: "UNITED KINGDOM", code: "GBR", children: [] } ] } ];

var dataIndicators = [ { name: "WEB INDEX", children: [ { name: "UNIVERSAL ACCESS", code: "UA", children: [ { name: "ITU G", code: "ITU G" ] }, { name: "FREEDOM & OPENNESS", code: "FO", children: [] }, { name: "RELEVANT CONTENT", code: "RC", children: [] }, { name: "EMPOWERMENT", code: "EM", children: [] } ] } ];

var dataYears = [ { name: "2007", code: "2007", children: [] }, { name: "2008", code: "2008", children: [] }, { name: "2009", code: "2009", children: [] }, { name: "2010", code: "2010", children: [] } ]; </script>

castrofernandez commented 11 years ago

var dataCountries = [ { name: "AFRICA", children: [] }, { name: "EAST ASIA & PACIFIC", children: [ { name: "JAPAN", code: "JPN", children: [] } ] }, { name: "EUROPE & CENTRAL ASIA", children: [ { name: "FRANCE", code: "FRA", children: [] }, { name: "PORTUGAL", code: "POR", children: [] }, { name: "SPAIN", code: "ESP", children: [] }, { name: "UNITED KINGDOM", code: "GBR", children: [] } ] } ];

var dataIndicators = [ { name: "WEB INDEX", children: [ { name: "UNIVERSAL ACCESS", code: "UA", children: [ { name: "ITU G", code: "ITU G" ] }, { name: "FREEDOM & OPENNESS", code: "FO", children: [] }, { name: "RELEVANT CONTENT", code: "RC", children: [] }, { name: "EMPOWERMENT", code: "EM", children: [] } ] } ];

var dataYears = [ { name: "2007", code: "2007", children: [] }, { name: "2008", code: "2008", children: [] }, { name: "2009", code: "2009", children: [] }, { name: "2010", code: "2010", children: [] } ];