// A couple of constants that must match what's in CSS. We need to know them before the content actually renders, so we // can't just ask the elements themselves for their dimensions. BAND_COLUMN_HEIGHT_EM = 62; BAND_COLUMN_CANVAS_WIDTH_EM = 4; BAND_COLUMN_FONT_SIZE = 16; BAND_COLUMN_HEIGHT_PX = BAND_COLUMN_HEIGHT_EM * BAND_COLUMN_FONT_SIZE; BAND_COLUMN_CANVAS_WIDTH_PX = BAND_COLUMN_CANVAS_WIDTH_EM * BAND_COLUMN_FONT_SIZE; // Load spots and populate the bands display. function loadSpots() { $.getJSON('/api/v1/spots' + buildQueryString(), function(jsonData) { // Store last updated time lastUpdateTime = moment.utc(); updateRefreshDisplay(); // Store data spots = jsonData; // Update bands display updateBands(); }); } // Build a query string for the API, based on the filters that the user has selected. function buildQueryString() { var str = "?"; ["dx_continent", "de_continent", "mode_type", "source", "band"].forEach(fn => { if (!allFilterOptionsSelected(fn)) { str = str + getQueryStringFor(fn) + "&"; } }); str = str + "max_age=" + $("#max-spot-age option:selected").val(); // Additional filters for the bands view: No dupes, no QRT str = str + "&dedupe=true&allow_qrt=false"; return str; } // Update the bands display function updateBands() { // Stop here if nothing to display var bandsContainer = $("#bands-container"); if (spots.length === 0) { bandsContainer.html("