From 6ebcacdf12b23433f0addc2c173341a8b7fea6ee Mon Sep 17 00:00:00 2001 From: l_samenv Date: Mon, 19 Aug 2024 16:27:19 +0200 Subject: [PATCH] changed selection label to unit in graphics --- client/jsFiles/SEAWebClientGraphics.js | 7 ++++++- influxdb.py | 2 +- variables_config.ini | 1 + 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/client/jsFiles/SEAWebClientGraphics.js b/client/jsFiles/SEAWebClientGraphics.js index 60c669c..69be3b7 100644 --- a/client/jsFiles/SEAWebClientGraphics.js +++ b/client/jsFiles/SEAWebClientGraphics.js @@ -328,6 +328,7 @@ let graphs = (function (){ */ function createSelection(gindex){ let graph_elm = graph_elm_array[gindex]; + console.log("clear for createSelection", gindex) clear(gindex); let selection = document.createElement('div'); @@ -405,6 +406,7 @@ let graphs = (function (){ * @param {{tag:string, unit:string, curves:[{name:string, label:string, color:string, original_color:string}]}} block - The information of the block to create */ function createGraph(gindex, block){ + console.log("clear for create graph", gindex) clear(gindex); tag_dict[block.tag] = gindex; let dict = {} // {string: [name:string, label:string, color:string, original_color:string]} @@ -1201,6 +1203,9 @@ let graphs = (function (){ jumpToDate: jumpToDate, initGraphs: initGraphs, onZoomCompleteCallback:onZoomCompleteCallback, + + prev_blk:prev_blk, + tag_dict:tag_dict } })(); @@ -1216,7 +1221,7 @@ function Graph(gindex, container, x_label, y_label, tag, scaleType = "linear"){ let dselect = document.createElement('div'); //the clickable unit to select the curves we want to display dselect.classList.add('dselect'); - dselect.innerHTML = "[" + tag + "]"; + dselect.innerHTML = "[" + y_label + "]"; dselect.addEventListener('click', function(e){ graphs.createSelection(gindex); }) diff --git a/influxdb.py b/influxdb.py index 809d50c..0d3258c 100644 --- a/influxdb.py +++ b/influxdb.py @@ -452,7 +452,7 @@ class InfluxDataGetter: variable ({"name":(str), "label":(str), "unit":(str)[,"has_potential_target":(bool)]}) : a dictionnary containing the Influx name of the corresponding variable out of the setup_info dict, the label to display in the Web GUI, its unit and possibly a boolean value indicating if the variable has a target available. """ - key = variable["cat"]+variable["unit"] + key = variable["cat"]+"_"+variable["unit"] if variable["cat"] != "" else variable["unit"] if key not in groups.keys(): groups[key] = {"tag":key, "unit":variable["unit"], "curves":[]} #tag is set to cat+unit while client is not modified groups[key]["curves"].append({ diff --git a/variables_config.ini b/variables_config.ini index be3d0f1..637a49c 100644 --- a/variables_config.ini +++ b/variables_config.ini @@ -1,3 +1,4 @@ [chart] +T_stat=other T_stat.raw= T_nvd.raw= \ No newline at end of file