Skip to content

Commit b01abe8

Browse files
RemiLeheEZoni
andauthored
Move opacity card further up (#265)
Co-authored-by: Edoardo Zoni <ezoni@lbl.gov>
1 parent 848d307 commit b01abe8

File tree

2 files changed

+43
-38
lines changed

2 files changed

+43
-38
lines changed

dashboard/app.py

Lines changed: 6 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
from state_manager import server, state, ctrl, initialize_state
1616
from error_manager import error_panel, add_error
1717
from utils import (
18+
data_depth_panel,
1819
load_experiments,
1920
load_database,
2021
load_data,
@@ -271,6 +272,10 @@ def home_route():
271272
with vuetify.VRow():
272273
with vuetify.VCol():
273274
par_manager.panel()
275+
# plots control panel
276+
with vuetify.VRow():
277+
with vuetify.VCol():
278+
data_depth_panel()
274279
# optimization control panel
275280
with vuetify.VRow():
276281
with vuetify.VCol():
@@ -279,44 +284,7 @@ def home_route():
279284
with vuetify.VRow():
280285
with vuetify.VCol():
281286
mod_manager.panel()
282-
# plots control panel
283-
with vuetify.VRow():
284-
with vuetify.VCol():
285-
with vuetify.VExpansionPanels(
286-
v_model=("expand_panel_control_plots", 0)
287-
):
288-
with vuetify.VExpansionPanel(
289-
title="Control: Plots",
290-
style="font-size: 20px; font-weight: 500;",
291-
):
292-
with vuetify.VExpansionPanelText():
293-
# create a row for the slider label
294-
with vuetify.VRow():
295-
vuetify.VListSubheader(
296-
"Projected Data Depth",
297-
style="margin-top: 16px;",
298-
)
299-
# create a row for the slider and text field
300-
with vuetify.VRow(no_gutters=True):
301-
with vuetify.VSlider(
302-
v_model_number=("opacity",),
303-
change="flushState('opacity')",
304-
hide_details=True,
305-
max=1.0,
306-
min=0.0,
307-
step=0.025,
308-
style="align-items: center;",
309-
):
310-
with vuetify.Template(v_slot_append=True):
311-
vuetify.VTextField(
312-
v_model_number=("opacity",),
313-
density="compact",
314-
hide_details=True,
315-
readonly=True,
316-
single_line=True,
317-
style="margin-top: 0px; padding-top: 0px; width: 80px;",
318-
type="number",
319-
)
287+
320288
# plots card
321289
with vuetify.VCol(cols=8):
322290
with vuetify.VCard():

dashboard/utils.py

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import pymongo
88
import torch
99
import yaml
10+
from trame.widgets import vuetify3 as vuetify
1011
from state_manager import state
1112
from error_manager import add_error
1213

@@ -351,3 +352,39 @@ def plot(exp_data, sim_data, model_manager, cal_manager):
351352

352353
fig.update_layout(clickmode="event")
353354
return fig
355+
356+
357+
def data_depth_panel():
358+
with vuetify.VExpansionPanels(v_model=("expand_panel_control_plots", 0)):
359+
with vuetify.VExpansionPanel(
360+
title="Control: Plots",
361+
style="font-size: 20px; font-weight: 500;",
362+
):
363+
with vuetify.VExpansionPanelText():
364+
# create a row for the slider label
365+
with vuetify.VRow():
366+
vuetify.VListSubheader(
367+
"Projected Data Depth",
368+
style="margin-top: 16px;",
369+
)
370+
# create a row for the slider and text field
371+
with vuetify.VRow(no_gutters=True):
372+
with vuetify.VSlider(
373+
v_model_number=("opacity",),
374+
change="flushState('opacity')",
375+
hide_details=True,
376+
max=1.0,
377+
min=0.0,
378+
step=0.025,
379+
style="align-items: center;",
380+
):
381+
with vuetify.Template(v_slot_append=True):
382+
vuetify.VTextField(
383+
v_model_number=("opacity",),
384+
density="compact",
385+
hide_details=True,
386+
readonly=True,
387+
single_line=True,
388+
style="margin-top: 0px; padding-top: 0px; width: 80px;",
389+
type="number",
390+
)

0 commit comments

Comments
 (0)