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
/*
challengemap.js
The MIT License (MIT)
Copyright (c) 2013 Digital und MeeR Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
(function(global) {
var works = LinkData.getWorks(), fileData = {}
_(works).each(function(work){
var files = LinkData.getFiles(work), workName = LinkData.getWorkName(work)
_(files).each(function(file){
var city = { challenge_data: [] }, latStore = [], longStore = [], latSum = 0, longSum = 0
,subjects = LinkData.getSubjects(work, file)
,colorScale = chroma.scale("Set3").mode("hsv")
_(subjects).each(function(sub){
var obj = {}, props = LinkData.getProperties(work, file)
_(props).each(function(prop){
propLabel = prop.split("#")[1]
obj[propLabel] = LinkData.getObjects(work, file, sub, prop)[0]
})
obj.color = colorScale(Math.random())
latStore.push(parseFloat(obj.lat))
latSum += parseFloat(obj.lat)
longStore.push(parseFloat(obj.long))
longSum += parseFloat(obj.long)
city.challenge_data.push(obj)
city.name = city.challenge_data[0].city
city.year = city.challenge_data[0].year
city.lat = latSum / city.challenge_data.length
city.long = longSum / city.challenge_data.length
city.bounds = {
s: _.min(latStore),
w: _.min(longStore),
n: _.max(latStore),
e: _.max(longStore)
}
city.id = work + "|" + file
fileData[city.id] = city
$(".file-selector").each(function(idx, el){
$(el).append('<option value="' + city.id + '">' + workName + " | " + file + '</option>')
$("#submit-match").on("click", function(){
var submitData = []
var val = $(el).val(), data = null, id = $(el).attr("id")
if(val) {
data = fileData[val]
data.selector = id
submitData.push(data)
$("#" + id + "-total-count").html("-")
$("#" + id + "-total-percentage").html("--")
$("#" + id + "-total-population").html("-")
$("#" + id + "-winner").hide()
__app.match.reset(submitData)
$("#data-section").slideDown()
$("#selector-section").slideUp()
$(".file-selector").on("change", function(){
var selfValue = $(this).val(), otherSelectors = $(".file-selector").not(this)
if($(this).attr("id") == "c1") {
otherSelectors.each(function(idx, el){
if(selfValue)
$(el).prop("disabled", false)
else
$(el).prop("disabled", true).val("").trigger("change")
otherSelectors.find("option").each(function(idx, el){
var optionValue = $(el).attr("value")
if(optionValue) {
if(optionValue == selfValue)
$(el).prop("disabled", true)
html { height: 100%; }
body { height: 100%; margin: 0; padding: 0; font: 14px/1.231 Lato, sans-serif; }
h1,h2,h3,h4,h5,h6 { font-family: Lato, sans-serif; }
#map_canvas { height: 100%; }
#map_canvas img, .google-maps img { max-width: none; }
.counter { font-size: 24px; color: white; margin-right: 0.1em; }
.counter.total-percentage { font-size: 42px; color: #ffdddd; }
.winner { display: block; font-weight: bold; color: #e67e22; text-align: center }
#info-box { position: absolute; right: 0px; top: 0px; background: white; width: 350px; }
#info-box h2 { margin-bottom: 12px; }
#info-box .toggle-button { width: 49.99%; padding-left: 0; padding-right: 0; background-color: transparent; color: #999999; border: 0 none; border-bottom: 4px solid #cccccc; margin: 0; background-image: none; -webkit-box-shadow: none; -moz-box-shadow: none; box-shadow: none; -webkit-border-radius: 0; -moz-border-radius: 0; -ms-border-radius: 0; -o-border-radius: 0; border-radius: 0; }
#info-box .toggle-button:hover, #info-box .toggle-button.hover { background-color: transparent; border-bottom-color: #f0c3c7; }
#info-box .toggle-button:active, #info-box .toggle-button.active { background-color: transparent; color: #333333; border-bottom-color: #e70012; }
#info-box #switch-city .toggle-button { border-bottom: 0 none; background-color: #2d59ad; color: #91ade2; }
#info-box #switch-city .toggle-button:hover, #info-box #switch-city .toggle-button.hover { background-color: #234484; color: #91ade2; }
#info-box #switch-city .toggle-button:active, #info-box #switch-city .toggle-button.active { background-color: #012873; color: white; }
#info-box #switch-city { position: relative; }
#info-box .versus { background: white; display: block; text-align: center; color: #2d59ad; line-height: 32px; width: 32px; height: 32px; border-radius: 16px; position: absolute; left: 144px; top: 8px; z-index: 9000; }
#info-box .palette { color: white; margin: 0; padding: 10px 15px; text-align: center }
#info-box .palette-alizarin { background-color: #e70012; }
#info-box .palette-silver { background-color: #bdc3c7; }
#info-box .counter-title { margin: 0; padding: 5px; color: white; text-align: center; border-bottom: 1px solid white; }
#info-box .counter-title.title-percentage { background-color: #e70012; }
#info-box .counter-title.title-count { background-color: #bdc3c7; }
table { width: 100%; }
td .count, td .population { display: block; }
td .population { color: #cccccc; padding-top: 2px; margin-top: 2px; border-top: 1px dotted #cccccc; }
p.count, p.population { margin: 0; }
p.population { padding-top: 4px; margin-top: 4px; border-top: 1px dotted white; }
#timestamp { display: block; }
<div class="row-fluid" style="margin:0;max-width:100%;width:100%;height:100%">
<div id="map_canvas" style="margin-right:350px;height:100%"></div>
<div id="info-box">
<div style="padding: 10px 15px">
<div id="data-alert"></div>
<h2>VS! CHALLENGE DAY<span id="target-year"></span>
<small id="timestamp"></small></h2>
<div id="selector-section">
<h5>表示するデータを選択</h5>
<div class="row-fluid">
<select class="file-selector span12" id="c1">
<option value="">データ1</option>
</select>
<p style="text-align:center">VS</p>
<select class="file-selector span12" id="c2">
<option value="">データ2</option>
</div>
<button id="submit-match" class="btn btn-primary btn-block">決定</button>
<div id="data-section" style="display:none">
<button id="show-selector" class="btn btn-block">データ選択に戻る</button>
<hr>
<div class="span6">
<span class="winner" id="c1-winner" style="display:none">★ WINNER</span>
<span class="winner" id="c2-winner" style="display:none">★ WINNER</span>
<div style="margin-bottom:10px;display:none" id="switch-city">
<div class="btn-group row-fluid" data-toggle="buttons-radio">
<span class="versus">VS</span>
<h5 class="counter-title title-percentage">参加率</h5>
<div class="palette palette-alizarin">
<span id="c1-total-percentage" class="counter total-percentage">--</span><span class="total-percentage-unit counter-unit">%</span>
<h5 class="counter-title title-count">参加者数/総人口</h5>
<div class="palette palette-silver">
<p class="count"><span id="c1-total-count" class="counter">-</span><span class="total-count-unit counter-unit">人</span></p>
<p class="population"><span id="c1-total-population" class="counter">-</span><span class="total-count-unit counter-unit">人</span></p>
<span id="c2-total-percentage" class="counter total-percentage">--</span><span class="total-percentage-unit counter-unit">%</span>
<p class="count"><span id="c2-total-count" class="counter">-</span><span class="total-count-unit counter-unit">人</span></p>
<p class="population"><span id="c2-total-population" class="counter">-</span><span class="total-count-unit counter-unit">人</span></p>
<h5>地図の表示</h5>
<div style="margin-bottom:10px">
<a class="btn btn-large btn-primary span6 toggle-button" id="display-percentage">参加率</a>
<a class="btn btn-large btn-primary span6 toggle-button" id="display-count">参加人数</a>
<div>
<a class="btn btn-large btn-primary span6 toggle-button" id="display-region">地域ごと</a>
<a class="btn btn-large btn-primary span6 toggle-button" id="display-total">総合</a>
<!--img src="title.png" style="position:absolute; left: 20px; bottom: 20px"-->
Click the Browse button or drag and drop to choose files to upload
The Maximum upload size is 1MB.(bmp,gif,jpeg,jpg,png)
*Required field
Add name for another language
You can upload jpg, gif, png file formats
Add description for another language
Fork original application has been updated. >>see
Original application has been updated. >>see
Playing...
Please enter a valid URL