If the scan chart is open prior to the first scan being completed, an uncaught error occurs:
Uncaught Error: Source data is missing a component at (0,1)!
convertColumnsToData http://localhost:5000/static/js/c3.min.js:2
loadFromArgs http://localhost:5000/static/js/c3.min.js:2
load http://localhost:5000/static/js/c3.min.js:2
redraw_scan_chart http://localhost:5000/static/js/scan_chart.js:80
<anonymous> http://localhost:5000/:213
jQuery 8
<anonymous> http://localhost:5000/:199
emit http://localhost:5000/static/js/socket.io.min.js:6
value http://localhost:5000/static/js/socket.io.min.js:6
value http://localhost:5000/static/js/socket.io.min.js:6
value http://localhost:5000/static/js/socket.io.min.js:6
value http://localhost:5000/static/js/socket.io.min.js:6
emit http://localhost:5000/static/js/socket.io.min.js:6
value http://localhost:5000/static/js/socket.io.min.js:6
value http://localhost:5000/static/js/socket.io.min.js:6
emit http://localhost:5000/static/js/socket.io.min.js:6
value http://localhost:5000/static/js/socket.io.min.js:6
value http://localhost:5000/static/js/socket.io.min.js:6
emit http://localhost:5000/static/js/socket.io.min.js:6
value http://localhost:5000/static/js/socket.io.min.js:6
value http://localhost:5000/static/js/socket.io.min.js:6
emit http://localhost:5000/static/js/socket.io.min.js:6
value http://localhost:5000/static/js/socket.io.min.js:6
value http://localhost:5000/static/js/socket.io.min.js:6
value http://localhost:5000/static/js/socket.io.min.js:6
value http://localhost:5000/static/js/socket.io.min.js:6
emit http://localhost:5000/static/js/socket.io.min.js:6
value http://localhost:5000/static/js/socket.io.min.js:6
value http://localhost:5000/static/js/socket.io.min.js:6
onreadystatechange http://localhost:5000/static/js/socket.io.min.js:6
value http://localhost:5000/static/js/socket.io.min.js:6
n http://localhost:5000/static/js/socket.io.min.js:6
value http://localhost:5000/static/js/socket.io.min.js:6
value http://localhost:5000/static/js/socket.io.min.js:6
value http://localhost:5000/static/js/socket.io.min.js:6
value http://localhost:5000/static/js/socket.io.min.js:6
value http://localhost:5000/static/js/socket.io.min.js:6
emit http://localhost:5000/static/js/socket.io.min.js:6
value http://localhost:5000/static/js/socket.io.min.js:6
value http://localhost:5000/static/js/socket.io.min.js:6
onreadystatechange http://localhost:5000/static/js/socket.io.min.js:6
value http://localhost:5000/static/js/socket.io.min.js:6
n http://localhost:5000/static/js/socket.io.min.js:6
value http://localhost:5000/static/js/socket.io.min.js:6
value http://localhost:5000/static/js/socket.io.min.js:6
value http://localhost:5000/static/js/socket.io.min.js:6
value http://localhost:5000/static/js/socket.io.min.js:6
value http://localhost:5000/static/js/socket.io.min.js:6
emit http://localhost:5000/static/js/socket.io.min.js:6
value http://localhost:5000/static/js/socket.io.min.js:6
value http://localhost:5000/static/js/socket.io.min.js:6
onreadystatechange http://localhost:5000/static/js/socket.io.min.js:6
jQuery 2
<anonymous> http://localhost:5000/:106
jQuery 13
c3.min.js:2:122014
This occurs because the scan_chart_* variables are overwritten, even though get_scan_data has not provided any data:
If the scan chart is open prior to the first scan being completed, an uncaught error occurs:
This occurs because the
scan_chart_*
variables are overwritten, even thoughget_scan_data
has not provided any data:https://github.com/projecthorus/radiosonde_auto_rx/blob/d784d834c63b9ac1ac99751da3beb60d2ce5c7a0/auto_rx/autorx/templates/index.html#L199-L207
The
get_scan_data
response looks like so:Line 205 accesses non-existent array indices in
data.freq
, thereby setting the x coordinates of the threshold line toundefined
.To avoid this, we can skip processing if
data.freq
is empty, which leaves the placeholder data displayed instead.