diff --git a/client/jsFiles/SEAWebClientGraphics.js b/client/jsFiles/SEAWebClientGraphics.js index 2fe1f6e..b7a83a5 100644 --- a/client/jsFiles/SEAWebClientGraphics.js +++ b/client/jsFiles/SEAWebClientGraphics.js @@ -499,13 +499,13 @@ let graphs = (function (){ * Adds the received dataset in the graph being created * Sets the visualization window, conditionnaly autoscale, applies the changes, and show the legend * @param {number} gindex - The position of the graph in the container - * @param {{tag:string, unit:string, curves:[{name:string, label:string, color:string, original_color:string}]}} block - The information of the block to create + * @param {{tag:string, unit:string, curves:[{name:string, label:string, 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]} + let dict = {} // {string: [name:string, label:string, color:string]} for (let curve of block.curves) { if (curve.show !== false) { vars_array[gindex].push(curve.name); @@ -1003,7 +1003,7 @@ let graphs = (function (){ } /** * Inits the graph content - * @param {[{tag:string, unit:string, curves:[{name:string, label:string, color:string, original_color:string}]}]} blocks - the received blocks + * @param {[{tag:string, unit:string, curves:[{name:string, label:string, color:string}]}]} blocks - the received blocks */ function initGraphs(blocks){ buildGraphicsUI(); @@ -1012,7 +1012,7 @@ let graphs = (function (){ /** * Holds the received variables from the /getvars call, gets the server time, then creates the graphs - * @param {[{tag:string, unit:string, curves:[{name:string, label:string, color:string, original_color:string}]}]} blocks_arg - the received blocks + * @param {[{tag:string, unit:string, curves:[{name:string, label:string, color:string}]}]} blocks_arg - the received blocks */ function receivedVars(blocks_arg){ maxTime = timeRange[1]*1000; @@ -1962,7 +1962,7 @@ function Graph(gindex, container, x_label, y_label, tag, scaleType = "linear"){ /** * Called when new data is received from the server (SSE). * Appends new data to the corresponding curves' datasets - * @param {{type:"graph-update", reduced:boolean, time:number, graph:{string:[[(number),(number)]]}}} graph - The graph response from the server + * @param {{type:"graph-update", time:number, graph:{string:[[(number),(number)]]}}} graph - The graph response from the server */ function updateCharts2(graph){ if(!graphs.doUpdates()) { diff --git a/colors.py b/colors.py index 1147f26..c800b13 100644 --- a/colors.py +++ b/colors.py @@ -4,12 +4,12 @@ def assign_colors_to_curves(blocks): Parameters : - blocks ["tag":(str),"unit":(str), "curves":[{"name":(str), "label":(str), "color":(str)}]] : a list of dictionnaries, each one representing - a block of curves with their name, their label and their color (if found in the database), grouped by their tag (which can be the unit augmented with an index) and their unit + blocks (["tag":(str),"unit":(str), "curves":[{"name":(str), "label":(str), "color":(str)}]]) : a list of dictionnaries, each one representing + a block of curves with their name, their label and their color to display (can be empty if not defined before), grouped by their category if given or unit (in tag). Returns : - ["tag":(str),"unit":(str), "curves":[{"name":(str), "label":(str), "color":(str), "original_color":(str)}]] : the same object as the "blocks" parameter, with the color value - updated depending on its availability in the ColorMap, and a new "original_color" value which contains the previous "color" value + ["tag":(str),"unit":(str), "curves":[{"name":(str), "label":(str), "color":(str)}]] : the same object as the "blocks" parameter, with the color value + updated depending on its availability in the ColorMap """ # get last value only @@ -23,14 +23,11 @@ def assign_colors_to_curves(blocks): if c < 0: valid = ColorMap.check_hex(col) if valid: - curve["original_color"] = col curve["color"] = valid else: auto_curves.append(curve) - curve["original_color"] = col + "?" else: color_set.add(c) - curve["original_color"] = col curve["color"] = ColorMap.to_hex(c) c = 1 # omit white for curve in auto_curves: diff --git a/doc/protocol.txt b/doc/protocol.txt index cd740c5..7276d7d 100644 --- a/doc/protocol.txt +++ b/doc/protocol.txt @@ -35,7 +35,6 @@ The only constantly open connection: = { "type": "graph-update", - "reduced": true/false, "time": , "graph": { "": [[