forked from Mi1ind/Inferno-Oracle-1
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
220 lines (210 loc) · 7.16 KB
/
index.html
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
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css"
integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
<title>Inferno Oracle 1</title>
</head>
<!-- TFJS & TFVIS -->
<body>
<div class="container">
<div class="row">
<div class="col-md-12 text-center">
<h2 style="padding: 100px;">Forest Fire Prediction Using a Neural Network and an Arduino</h2>
</div>
</div>
<div class="row" style="margin-top: 50px; margin-bottom: 50px;">
<div class="col-md-5">
<h3 id="status_bar"></h3>
<h3 id="training_bar"></h3>
<hr>
<button class="btn btn-primary" style="display: none;" id="trainModel">Train Network</button>
<!-- <button class="btn btn-primary" id="predictModel">Predict Model</button> -->
</div>
<div id="chart" class=" col-md-7 text-center"></div>
</div>
</div>
<!-- Maps -->
<head>
<meta charset="utf-8" />
<title>Create a heatmap layer</title>
<meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no" />
<script src="https://api.mapbox.com/mapbox-gl-js/v2.0.1/mapbox-gl.js"></script>
<link href="https://api.mapbox.com/mapbox-gl-js/v2.0.1/mapbox-gl.css" rel="stylesheet" />
<style>
/* body { margin: 25; padding: 50; } */
#map {
width: 100%;
height: 600px;
/* margin-right: 20%;
margin-left:20%; */
margin-bottom: 2%;
}
.padded {
padding: 1%;
}
</style>
</head>
<h2 class="text-center padded">Below is a heat map of fire locations and intensity in North America</h2>
<div id="map"></div>
<script>
// TO MAKE THE MAP APPEAR YOU MUST
// ADD YOUR ACCESS TOKEN FROM
// https://account.mapbox.com
mapboxgl.accessToken = 'pk.eyJ1IjoibWkxaW5kIiwiYSI6ImNrNmgweTVkajJwOHozZG9ib3NiNDN2bHkifQ.nZQZ64UId3gMsFNavPiQ_A';
var map = new mapboxgl.Map({
container: 'map',
style: 'mapbox://styles/mapbox/dark-v10',
center: [-100,50],
zoom: 3
});
map.on('load', function () {
// Add a geojson point source.
// Heatmap layers also work with a vector tile source.
map.addSource('MODIS_CAN_Fires', {
'type': 'geojson',
'data': 'https://raw.githubusercontent.com/Mi1ind/Inferno-Oracle-1/master/MODIS_CAN_Fires.geojson'
});
map.addLayer(
{
'id': 'fire-heat',
'type': 'heatmap',
'source': 'MODIS_CAN_Fires',
'maxzoom': 9,
'paint': {
// Increase the heatmap weight based on frp
'heatmap-weight': [
'interpolate',
['linear'],
['get', 'frp'],
0,
0,
6,
1
],
// Increase the heatmap color weight weight by zoom level
// heatmap-intensity is a multiplier on top of heatmap-weight
'heatmap-intensity': [
'interpolate',
['linear'],
['zoom'],
0,
1,
9,
3
],
// Color ramp for heatmap. Domain is 0 (low) to 1 (high).
// Begin color ramp at 0-stop with a 0-transparancy color
// to create a blur-like effect.
'heatmap-color': [
'interpolate',
['linear'],
['heatmap-density'],
0,
'rgba(33,102,172,0)',
0.2,
'rgb(255,237,160)',
0.4,
'rgb(253,187,132)',
0.6,
'rgb(254,178,76)',
0.8,
'rgb(227,74,51)',
1,
'rgb(240,59,32)'
],
// Adjust the heatmap radius by zoom level
'heatmap-radius': [
'interpolate',
['linear'],
['zoom'],
0,
2,
9,
20
],
// Transition from heatmap to circle layer by zoom level
'heatmap-opacity': [
'interpolate',
['linear'],
['zoom'],
7,
1,
9,
0
]
}
},
'waterway-label'
);
map.addLayer(
{
'id': 'fires-point',
'type': 'circle',
'source': 'MODIS_CAN_Fires',
'minzoom': 7,
'paint': {
// Size circle radius by frp magnitude and zoom level
'circle-radius': [
'interpolate',
['linear'],
['zoom'],
7,
['interpolate', ['linear'], ['get', 'frp'], 1, 1, 6, 4],
16,
['interpolate', ['linear'], ['get', 'frp'], 1, 5, 6, 50]
],
// Color circle by frp magnitude
'circle-color': [
'interpolate',
['linear'],
['get', 'frp'],
1,
'rgba(33,102,172,0)',
2,
'rgb(103,169,207)',
3,
'rgb(209,229,240)',
4,
'rgb(253,219,199)',
5,
'rgb(239,138,98)',
6,
'rgb(178,24,43)'
],
'circle-stroke-color': 'white',
'circle-stroke-width': 1,
// Transition from heatmap to circle layer by zoom level
'circle-opacity': [
'interpolate',
['linear'],
['zoom'],
7,
0,
8,
1
]
}
},
'waterway-label'
);
});
</script>
<script type="module" src="index.js"></script>
<script src="https://code.jquery.com/jquery-3.5.1.js"
integrity="sha256-QWo7LDvxbWT2tbbQ97B53yJnYU3WhH/C8ycbRAkjPDc="
crossorigin="anonymous"></script>
<!-- <script src="https://d3js.org/d3.v6.min.js"></script> -->
<!-- <script src="https://code.jquery.com/jquery-3.4.1.slim.min.js"
integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n"
crossorigin="anonymous"></script> -->
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js"
integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo"
crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"
integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6"
crossorigin="anonymous"></script>
</body>
</html>