-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
182 lines (152 loc) · 6.17 KB
/
index.html
File metadata and controls
182 lines (152 loc) · 6.17 KB
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
<html>
<head>
<link rel="shortcut icon" type="image/png" href="favicon/favicon.png" />
<link rel="stylesheet" type="text/css" href="css/fontawesome.min.css" />
<link href='https://fonts.googleapis.com/css?family=Roboto:300,400,500,700|Material+Icons' rel="stylesheet">
<link href="https://cdn.jsdelivr.net/npm/vuetify@2.6.3/dist/vuetify.min.css" rel="stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, minimal-ui">
<title>State Bridge Repair</title>
</head>
<body>
<div id="app">
<v-app>
<V-main>
<v-app-bar app color="indigo" dark>
<v-toolbar-title>State Repair Probabilities</v-toolbar-title>
</v-app-bar>
<v-container fluid>
<v-row>
<v-col>
<v-card id="top-left">
<v-card-title>Repair Probability Coloring</v-card-title>
<v-container>
<v-row>
<v-col>
<v-slider min="1" max="5" label="Max Probability in Std Dev.s" v-model="stdDevs"
@change="SetPieColor(false)" ticks="always" thumb-label="always">
</v-select>
</v-col>
</v-row>
<v-row>
<v-col>
<v-select :items="colorSchemes" label="Color Scheme" v-model="selectedColorScheme"
@change="selectColorScheme()"></v-select>
</v-col>
</v-row>
</v-container>
</v-card>
</v-col>
<v-col>
<v-card>
<v-card-title>Hexagon Positioning</v-card-title>
<v-container>
<v-row>
<v-col>
<v-select :items="mapSelectItems" label="Hexagon Positioning" v-model="selectedMapFormat"
@change="mapFormatChanged()"></v-select>
</v-col>
</v-row>
</v-container>
</v-card>
</v-col>
<v-col>
<v-card>
<v-card-title>Center Coloring</v-card-title>
<v-container>
<v-row>
<v-col cols=12>
<v-select :items="centerSelectItems" label="Center Coloring" v-model="selectedCenterFormat"
@change="centerFormatChanged()"></v-select>
</v-col>
<v-col cols=12 class="text-subtitle-1">
{{missingWarning()}}
</v-col>
</v-row>
</v-container>
</v-card>
</v-col>
</v-row>
</v-container>
</V-main>
</v-app>
</div>
<svg id='us-map' style="position:absolute;left:0px">
</svg>
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.15/lodash.js"
integrity="sha256-kzv+r6dLqmz7iYuR2OdwUgl4X5RVsoENBzigdF5cxtU=" crossorigin="anonymous"></script>
<script src="https://d3js.org/d3.v4.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3-legend/2.25.6/d3-legend.js"></script>
<script src="https://d3js.org/d3-color.v1.min.js"></script>
<script src="https://d3js.org/d3-interpolate.v1.min.js"></script>
<script src="https://d3js.org/d3-scale-chromatic.v1.min.js"></script>
<script src='https://code.jquery.com/jquery-3.2.1.min.js'></script>
<script src="https://cdn.jsdelivr.net/npm/vue@2.6.14"></script>
<script src="https://cdn.jsdelivr.net/npm/vuetify@2.x/dist/vuetify.js"></script>
<script src="js/indexGetData.js"></script>
<script src="js/indexMap.js"></script>
<script>
const app = new Vue({
el: '#app',
vuetify: new Vuetify(),
data: {
mapSelectItems: [],
centerSelectItems: [],
stdDevs: 1,
colorSchemes: [],
selectedMapFormat: "map",
selectedCenterFormat: "none",
selectedColorScheme: "d3.interpolateInferno",
missingInfoStates: ["AK", "HI"],
missingInfoTypes: ["Precipitation", "Freeze_Thaw_Cycles", "Snowfall"],
flippedCenterTypes: ["Year_Built_average", "Year_Built_median", "Deck_Condition_average", "Deck_Condition_median"],
},
mounted() {
this.mapSelectItems = [
{ value: "map", text: "Geographic" },
{ value: "name", text: "Sort by State Name" },
{ value: "avg", text: "Sort by Average Probability" },
{ value: "max", text: "Sort by Max Probability" },
];
this.centerSelectItems = [
{ value: "none", text: "None" },
];
this.colorSchemes = [
{ value: "d3.interpolateInferno", text: "Inferno" },
{ value: "d3.interpolateBrBG", text: "Brown/Blue/Green" },
{ value: "d3.interpolateRdBu", text: "Red/Blue" },
{ value: "d3.interpolateRdGy", text: "Red/Gray" },
{ value: "d3.interpolateRdYlBu", text: "Red/Yellow/Blue" },
{ value: "d3.interpolateSpectral", text: "Spectral" },
{ value: "d3.interpolateTurbo", text: "Turbo" },
{ value: "d3.interpolateViridis", text: "Viridis" },
{ value: "d3.interpolateCubehelixDefault", text: "Cube Helix" },
{ value: "d3.interpolateCool", text: "Cool" },
];
this.resize();
},
methods: {
resize:resize,
SetPieColor(flag) {
standardDevChanged(this.stdDevs);
},
mapFormatChanged() {
filter({ value: this.selectedMapFormat, text: this.mapSelectItems.find(x => x.value == this.selectedMapFormat).text });
},
centerFormatChanged() {
console.log(this.selectedCenterFormat);
filterCenter({ value: this.selectedCenterFormat });
},
selectColorScheme() {
TESTCOLOR(null);
},
missingWarning() {
if (this.missingInfoTypes.includes(this.selectedCenterFormat)) {
return `Note that ${this.selectedCenterFormat.replace(/_/g, " ")} data in unavailable for ${this.missingInfoStates.join(" & ")}.`;
}
return "";
}
},
});
</script>
</body>
</html>