Skip to content

Commit 72024f0

Browse files
committed
Updated the Plots tab of Dashboard. It can now plot values in a list(s).
1 parent 3a5ac64 commit 72024f0

File tree

11 files changed

+869
-304
lines changed

11 files changed

+869
-304
lines changed

lib/Sisyphus/Gui/Dashboard/callbacks/callbacks_conditions.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import pandas as pd, ast
22
from dash import dcc, html, Input, Output, State, ctx
33
import dash
4-
import base64
4+
import base64, pickle
55
import json
66

77

@@ -12,6 +12,12 @@
1212
logger = config.getLogger(__name__)
1313

1414

15+
def resolve_df_from_store(store):
16+
if isinstance(store, dict) and "path" in store:
17+
with open(store["path"], "rb") as f:
18+
return pickle.load(f)
19+
return pd.DataFrame(store)
20+
1521
# Add/remove condition input rows
1622
def register_callbacks(app):
1723
@app.callback(
@@ -24,7 +30,11 @@ def register_callbacks(app):
2430
prevent_initial_call=True
2531
)
2632
def update_conditions(data, add_clicks, remove_clicks, children, logic_operator):
27-
df = pd.DataFrame(data)
33+
34+
#df = pd.DataFrame(data)
35+
df = resolve_df_from_store(data)
36+
37+
2838
triggered = ctx.triggered_id
2939
children = list(children) if children else []
3040

lib/Sisyphus/Gui/Dashboard/callbacks/callbacks_filter.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def register_callbacks(app):
3838
State("preferences-store", "data"),
3939
State("typeid-input", "value"),
4040
State("testtype-input", "value"),
41-
State("condition-container","children"), # <--- testing
41+
State("condition-container","children"),
4242
prevent_initial_call=True
4343
)
4444
def download_filtered(n_clicks, fields, thresholds, operators, logic_operator, filtered_data, filename, preferences, typeid, testtype,conds):
@@ -64,7 +64,13 @@ def download_filtered(n_clicks, fields, thresholds, operators, logic_operator, f
6464
filename += ".csv"
6565

6666
if n_clicks and filtered_data:
67-
df = pd.DataFrame(filtered_data)
67+
#df = pd.DataFrame(filtered_data)
68+
from Sisyphus.Gui.Dashboard.utils.data_resolver import (
69+
load_df_from_store,
70+
apply_row_indices,
71+
)
72+
df_full = load_df_from_store(filtered_data)
73+
df = apply_row_indices(df_full, filtered_data.get("row_indices"))
6874

6975
# --- Local save ---
7076
save_dir = preferences.get("working_dir", os.getcwd())

0 commit comments

Comments
 (0)