X-Git-Url: https://gerrit.fd.io/r/gitweb?p=csit.git;a=blobdiff_plain;f=resources%2Ftools%2Fdash%2Fapp%2Fpal%2Ftrending%2Fgraphs.py;h=4cd8285f72fe07c3204a2b3060f70a83126f71fe;hp=0b4968082fb48a140c863766bd9705ce39279f06;hb=aa9f6d2b4d417b439e2953a9c82c31b0d561f632;hpb=ae1fe880286d7b0414664bce2b2c7c91c3f543f3 diff --git a/resources/tools/dash/app/pal/trending/graphs.py b/resources/tools/dash/app/pal/trending/graphs.py index 0b4968082f..4cd8285f72 100644 --- a/resources/tools/dash/app/pal/trending/graphs.py +++ b/resources/tools/dash/app/pal/trending/graphs.py @@ -23,13 +23,7 @@ import hdrh.codec from datetime import datetime from ..utils.constants import Constants as C -from ..utils.utils import classify_anomalies - - -def _get_color(idx: int) -> str: - """ - """ - return C.PLOT_COLORS[idx % len(C.PLOT_COLORS)] +from ..utils.utils import classify_anomalies, get_color def _get_hdrh_latencies(row: pd.Series, name: str) -> dict: @@ -272,7 +266,7 @@ def graph_trending(data: pd.DataFrame, sel:dict, layout: dict, else: norm_factor = 1.0 traces = _generate_trending_traces( - itm["testtype"], name, df, start, end, _get_color(idx), norm_factor + itm["testtype"], name, df, start, end, get_color(idx), norm_factor ) if traces: if not fig_tput: @@ -281,7 +275,7 @@ def graph_trending(data: pd.DataFrame, sel:dict, layout: dict, if itm["testtype"] == "pdr": traces = _generate_trending_traces( - "pdr-lat", name, df, start, end, _get_color(idx), norm_factor + "pdr-lat", name, df, start, end, get_color(idx), norm_factor ) if traces: if not fig_lat: @@ -348,7 +342,7 @@ def graph_hdrh_latency(data: dict, layout: dict) -> go.Figure: legendgroup=C.GRAPH_LAT_HDRH_DESC[lat_name], showlegend=bool(idx % 2), line=dict( - color=_get_color(int(idx/2)), + color=get_color(int(idx/2)), dash="solid", width=1 if idx % 2 else 2 ),