Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Metric viewer update #77

Merged
merged 2 commits into from
Jul 30, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions cascade/meta/metric_viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def plot_table(self, show=False):
fig.show()
return fig

def serve(self, page_size=50, **kwargs) -> None:
def serve(self, page_size=50, include=None, exclude=None, **kwargs) -> None:
# Conditional import
try:
import dash
Expand All @@ -112,8 +112,15 @@ def serve(self, page_size=50, **kwargs) -> None:
else:
from dash import Input, Output, html, dcc, dash_table

if include is None:
include = []
if exclude is None:
exclude = []

df = self.table
df_flatten = pd.DataFrame(map(flatten, self.table.to_dict('records')))
df = df.drop(exclude, axis=1)
df = df[['line', 'num'] + include]
df_flatten = pd.DataFrame(map(flatten, df.to_dict('records')))

app = dash.Dash()
dep_fig = go.Figure()
Expand All @@ -128,11 +135,11 @@ def serve(self, page_size=50, **kwargs) -> None:
}
),
dcc.Dropdown(
list(df.columns),
list(df_flatten.columns),
id='dropdown-x',
multi=False),
dcc.Dropdown(
list(df.columns),
list(df_flatten.columns),
id='dropdown-y',
multi=False),
dcc.Graph(
Expand Down