Spaces:
Running
Running
mriusero
commited on
Commit
·
0156020
1
Parent(s):
f731ddb
core: layout
Browse files- src/ui/dashboard.py +16 -22
- src/ui/graphs/general_graphs.py +1 -1
src/ui/dashboard.py
CHANGED
@@ -108,6 +108,12 @@ def init_components(n=TOOLS_COUNT):
|
|
108 |
tool_plots = []
|
109 |
general_plots = []
|
110 |
|
|
|
|
|
|
|
|
|
|
|
|
|
111 |
# General metrics display and its plots
|
112 |
main_display = GeneralMetricsDisplay()
|
113 |
displays.append(main_display)
|
@@ -118,12 +124,6 @@ def init_components(n=TOOLS_COUNT):
|
|
118 |
efficiency_data={}
|
119 |
)
|
120 |
)
|
121 |
-
# Tool metrics displays and their plots
|
122 |
-
for i in range(1, n + 1):
|
123 |
-
display = ToolMetricsDisplay()
|
124 |
-
displays.append(display)
|
125 |
-
tool_plots.extend(display.tool_block(df=pd.DataFrame(), id=i))
|
126 |
-
|
127 |
return displays, tool_plots, general_plots
|
128 |
|
129 |
|
@@ -143,25 +143,19 @@ async def on_tick(state, displays):
|
|
143 |
issues_df = data[-2] # issues DataFrame
|
144 |
efficiency_data = data[-1] # efficiency dict
|
145 |
|
146 |
-
#
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
issues_df=issues_df,
|
153 |
-
efficiency_data=efficiency_data
|
154 |
-
)
|
155 |
)
|
156 |
|
157 |
-
#
|
158 |
tool_plots = []
|
159 |
-
for df, display in zip(tool_dfs, displays[1
|
160 |
-
tool_plots.extend(
|
161 |
-
|
162 |
-
df=df
|
163 |
-
)
|
164 |
-
)
|
165 |
return tool_plots + general_plots + [state]
|
166 |
|
167 |
def dashboard_ui(state):
|
|
|
108 |
tool_plots = []
|
109 |
general_plots = []
|
110 |
|
111 |
+
# Tool metrics displays and their plots
|
112 |
+
for i in range(1, n + 1):
|
113 |
+
display = ToolMetricsDisplay()
|
114 |
+
displays.append(display)
|
115 |
+
tool_plots.extend(display.tool_block(df=pd.DataFrame(), id=i))
|
116 |
+
|
117 |
# General metrics display and its plots
|
118 |
main_display = GeneralMetricsDisplay()
|
119 |
displays.append(main_display)
|
|
|
124 |
efficiency_data={}
|
125 |
)
|
126 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
127 |
return displays, tool_plots, general_plots
|
128 |
|
129 |
|
|
|
143 |
issues_df = data[-2] # issues DataFrame
|
144 |
efficiency_data = data[-1] # efficiency dict
|
145 |
|
146 |
+
# General plots
|
147 |
+
general_display = displays[-1]
|
148 |
+
general_plots = general_display.refresh(
|
149 |
+
all_tools_df=all_tools_df,
|
150 |
+
issues_df=issues_df,
|
151 |
+
efficiency_data=efficiency_data
|
|
|
|
|
|
|
152 |
)
|
153 |
|
154 |
+
# Tool-specific plots
|
155 |
tool_plots = []
|
156 |
+
for df, display in zip(tool_dfs, displays[:-1]):
|
157 |
+
tool_plots.extend(display.refresh(df=df))
|
158 |
+
|
|
|
|
|
|
|
159 |
return tool_plots + general_plots + [state]
|
160 |
|
161 |
def dashboard_ui(state):
|
src/ui/graphs/general_graphs.py
CHANGED
@@ -142,7 +142,7 @@ class GeneralMetricsDisplay:
|
|
142 |
fig.update_layout(
|
143 |
template='plotly_dark',
|
144 |
annotations=[dict(
|
145 |
-
text="No
|
146 |
showarrow=False,
|
147 |
font=dict(size=16, color="white")
|
148 |
)]
|
|
|
142 |
fig.update_layout(
|
143 |
template='plotly_dark',
|
144 |
annotations=[dict(
|
145 |
+
text="No Error",
|
146 |
showarrow=False,
|
147 |
font=dict(size=16, color="white")
|
148 |
)]
|