diff --git a/assets/custom-functions.js b/assets/custom-functions.js index bf7a20cfca17e811972590f66afabd8b6167fbc5..a409a0f638f8f8a80db45acddd4e7f03cb22a81f 100644 --- a/assets/custom-functions.js +++ b/assets/custom-functions.js @@ -162,7 +162,7 @@ $(document).ready(function () { var input = this.value; //CREATE FUNCTION TO ALLOW DELETION OF SPACES - date.onkeydown = function() { + date.onkeydown = function(event) { var key = event.keyCode || event.charCode; inputText = String(input); if(key == 8 && (input.length==2 || input.length==6)){ @@ -273,28 +273,7 @@ $(document).ready(function () { //================== Stats table carets END =============================================== -//==================Functions to flip adjust colorbar values for only concentration var === -//GET THE VARIABLE VALUE -function getVars() { - const search = window.location.search - const urlParams = new URLSearchParams(search); - const currentVar = urlParams.get('var'); - return currentVar; -} - -function tiltValues() { - if (getVars() == 'concentration') { - const containers = document.querySelectorAll('.leaflet-control-colorbar'); - containers.forEach(container => { - const secondDiv = container.querySelectorAll('div')[1]; - const spans = secondDiv.querySelectorAll('span'); - spans.forEach(span => { - span.style.transform = 'rotate(30deg)'; - span.style.paddingTop = '2px'; - }); - }); - }; -}; +//==================Functions to resize colorbar ====================== function setWidthForColorbars(nothing) { const colorbars = document.querySelectorAll('.leaflet-control-colorbar'); @@ -312,10 +291,9 @@ $(document).ready(function () { }) $(document).ready(function () { - setTimeout(tiltValues, 1500); setTimeout(setWidthForColorbars, 1500); }); -//==================END Funcfions to flip adjust colorbar values for only concentration var ========== +//==================END Funcfions to resize colorbar ================== // //================= Function to clear datepicker without resetting ================================= $(document).ready(function () { diff --git a/assets/style.css b/assets/style.css index 76a37e564827b6bafca72d41ac303d139012d531..165e4acf3c7592d7dbf32a16986e66924bc02919 100644 --- a/assets/style.css +++ b/assets/style.css @@ -1019,3 +1019,8 @@ td.column-0 { left: 7px; font-size: xxx-large; } + +.sconc_info div:nth-child(2) span { + transform: rotate(30deg) !important; + padding-top: 2px; +} diff --git a/data_handler.py b/data_handler.py index 01a070fead90483408693e16b58c0633d0e5cf7c..eb28487bcfb3447d78c4d28dabaf9aa07f4e5853 100644 --- a/data_handler.py +++ b/data_handler.py @@ -109,7 +109,7 @@ STATS = OrderedDict({ 'totn': 'TOTAL CASES' }) -GRAPH_HEIGHT = 92.8 +GRAPH_HEIGHT = 90 # Frequency = 3 Hourly FREQ = 3 @@ -982,6 +982,8 @@ class FigureHandler(object): CUR_INFO_STYLE = INFO_STYLE.copy() if colorbar is not None: CUR_INFO_STYLE['width'] = str(colorbar.width) + "px" + #add sconc_info class to tilt colorbar values so they won't overlap + if varname == "SCONC_DUST": colorbar.className = 'sconc_info' if aspect[0] > 2: CUR_INFO_STYLE['fontSize'] = "{}px".format(int(INFO_STYLE['fontSize'][:-2])-aspect[0]+ 0.3) info = html.Div(