diff --git a/buildingspy/templates/datatable.html b/buildingspy/templates/datatable.html index 9115e797..1a2db131 100755 --- a/buildingspy/templates/datatable.html +++ b/buildingspy/templates/datatable.html @@ -260,6 +260,7 @@ $('#myTable3').on('click', '.myClass', function () { var tr = $(this).closest('tr'); var row_idx = table3.row(tr).index(); + var model = table3.cell(row_idx, 0).data(); var variables = table3.cell(row_idx, 1).data(); var file = table3.cell(row_idx, 3).data(); var dirs = table3.cell(row_idx, 4).data(); @@ -288,14 +289,13 @@ if (navail_vars.length > 0) { title = title.concat('
No available results for: ').concat(navail_vars.join(', ')); } var new_data = data.replace('$DICT_VAR_INFO', JSON.stringify(dict_var_info)); new_data = new_data.replace('$PAGE_TITLE', title); - new_data = new_data.replace('$TITLE', title); + new_data = new_data.replace('$TITLE', model); new_data = new_data.replace('$HEIGHT', height + '%'); new_data = new_data.replace('$ERR_PLOT_HEIGHT', err_plot_height); var strWindowFeatures = "menubar=yes, location=yes, resizable=yes, scrollbars=yes, status=yes"; var win = window.open('', '_blank', strWindowFeatures); win.document.write(new_data); win.document.close(); // necessary for the scripts on the page to be executed - // win.document.title = file; } else { alert(warnings.join('\n')); } }); }); diff --git a/buildingspy/templates/plot.html b/buildingspy/templates/plot.html index dce32f27..9a30f66e 100644 --- a/buildingspy/templates/plot.html +++ b/buildingspy/templates/plot.html @@ -3,7 +3,7 @@ $PAGE_TITLE - + @@ -69,6 +69,20 @@ var error_y_axis_title = 'error [unit of variable]'; var gen_y_axis_title = 'variable'; var gen_x_axis_title = 'time [s]'; + var tickformatstops = [ + { + 'dtickrange': [0, 0.1], + 'value': '.2e', + }, + { + 'dtickrange': [0.1, 1000], + 'value': '.1f', + }, + { + 'dtickrange': [1000, null], + 'value': '.2e', + }, + ]; // Dummy traces for legend only. traces.push( { @@ -126,6 +140,7 @@ layout['yaxis' + axis_error_idx] = { domain: [1 - err_plot_height, 1], ticks: 'inside', + tickformatstops: tickformatstops, showline: true, zeroline: true, title: error_y_axis_title, @@ -133,9 +148,9 @@ layout['xaxis' + axis_error_idx] = { showline: false, zeroline: false, + tickformatstops: tickformatstops, showticklabels: false, anchor: 'y' + axis_error_idx, - matches: 'x' + (nb_groups + 1) }; // ref & test domains var divHeight = parseFloat(document.getElementById('myDiv').style.height).toFixed(2); @@ -200,6 +215,7 @@ showline: true, zeroline: false, title: gen_y_axis_title, + tickformatstops: tickformatstops, }; layout['xaxis' + axis_data_idx] = { ticks: 'inside', @@ -208,13 +224,19 @@ mirror: 'ticks', zeroline: false, anchor: 'y' + axis_data_idx, - matches: 'x' + (axis_data_idx - 1) + matches: 'x', + tickformatstops: tickformatstops, }; }); }); layout['xaxis2']['showticklabels'] = true; if (nb_groups > 1) { layout['xaxis2']['side'] = 'top'; + } else { // Only onr group: no axis mirroring but add x axis to error plot. + layout['xaxis2']['mirror'] = false; + layout['yaxis2']['mirror'] = false; + layout['xaxis1']['showline'] = true; + layout['xaxis1']['showticklabels'] = true; } layout['xaxis' + (nb_groups + 1)]['showticklabels'] = true; layout['xaxis' + (nb_groups + 1)]['title'] = gen_x_axis_title;