@@ -282,36 +282,166 @@ def _functions_panel(server):
282282 with html .Div (
283283 classes = "d-flex align-center ga-3 mb-5 pl-5 w-full" ,
284284 ):
285- ### --> see fourc_webserver specification on which function visualizations are currently supported
286- html .Span ("COMPONENT: " , classes = "text-h6" )
287- html .Span (
288- v_text = (
289- "funct_section[selected_funct][selected_funct_item]['COMPONENT']" ,
290- ),
291- )
292- ## show function string
285+ with html .Div (
286+ v_if = (
287+ "'COMPONENT' in funct_section[selected_funct][selected_funct_item]" ,
288+ )
289+ ):
290+ ### --> see fourc_webserver specification on which function visualizations are currently supported
291+ html .Span ("COMPONENT: " , classes = "text-h6" )
292+ html .Span (
293+ v_text = (
294+ "funct_section[selected_funct][selected_funct_item]['COMPONENT']" ,
295+ ),
296+ )
297+ ## show function information
293298 with html .Div (
294299 classes = "d-flex align-center ga-3 mb-5 pl-5 w-full" ,
295300 ):
296- ### --> see fourc_webserver specification on which function visualizations are currently supported
297- html .Span ("FUNCTION: " , classes = "text-h6" )
298- # view mode: text
299- html .Span (
300- v_if = ("edit_mode == all_edit_modes['view_mode']" ,),
301- v_text = (
302- "funct_section[selected_funct][selected_funct_item]['SYMBOLIC_FUNCTION_OF_SPACE_TIME']" ,
303- ),
304- )
305- # edit mode: text field
306- vuetify .VTextField (
307- v_model = (
308- "funct_section[selected_funct][selected_funct_item]['SYMBOLIC_FUNCTION_OF_SPACE_TIME']" ,
309- ),
310- update_modelValue = "flushState('funct_section')" ,
311- v_if = ("edit_mode == all_edit_modes['edit_mode']" ,),
312- dense = True ,
313- hide_details = True ,
314- )
301+ # for function components: show the functional strings
302+ with html .Div (
303+ v_if = (
304+ "'COMPONENT' in funct_section[selected_funct][selected_funct_item]" ,
305+ )
306+ ):
307+ ### --> see fourc_webserver specification on which function visualizations are currently supported
308+ html .Span ("FUNCTION: " , classes = "text-h6" )
309+ # view mode: text
310+ html .Span (
311+ v_if = ("edit_mode == all_edit_modes['view_mode']" ,),
312+ v_text = (
313+ "funct_section[selected_funct][selected_funct_item]['SYMBOLIC_FUNCTION_OF_SPACE_TIME']" ,
314+ ),
315+ )
316+ # edit mode: text field
317+ vuetify .VTextField (
318+ v_model = (
319+ "funct_section[selected_funct][selected_funct_item]['SYMBOLIC_FUNCTION_OF_SPACE_TIME']" ,
320+ ),
321+ update_modelValue = "flushState('funct_section')" ,
322+ v_if = ("edit_mode == all_edit_modes['edit_mode']" ,),
323+ dense = True ,
324+ hide_details = True ,
325+ style = "min-width: 200px; max-width: 400px;" , # control width
326+ )
327+ # for variables: show type, times, and values
328+ with html .Div (
329+ v_if = (
330+ "'VARIABLE' in funct_section[selected_funct][selected_funct_item]" ,
331+ )
332+ ):
333+ ## -> type
334+ with html .Div ():
335+ html .Span ("TYPE: " , classes = "text-h6" )
336+ # view mode: text
337+ html .Span (
338+ v_if = ("edit_mode == all_edit_modes['view_mode']" ,),
339+ v_text = (
340+ "funct_section[selected_funct][selected_funct_item]['TYPE']" ,
341+ ),
342+ )
343+ # edit mode: text field
344+ vuetify .VTextField (
345+ v_model = (
346+ "funct_section[selected_funct][selected_funct_item]['TYPE']" ,
347+ ),
348+ update_modelValue = "flushState('funct_section')" ,
349+ v_if = ("edit_mode == all_edit_modes['edit_mode']" ,),
350+ dense = True ,
351+ hide_details = True ,
352+ )
353+
354+ ## -> times
355+ with html .Div ():
356+ html .Span ("TIMES: " , classes = "text-h6" )
357+ # view mode: text
358+ html .Span (
359+ v_if = ("edit_mode == all_edit_modes['view_mode']" ,),
360+ v_text = (
361+ "funct_section[selected_funct][selected_funct_item]['TIMES']" ,
362+ ),
363+ )
364+ # edit mode: list of text fields
365+ with html .Div (
366+ v_if = ("edit_mode == all_edit_modes['edit_mode']" ,),
367+ ):
368+ with html .Div (
369+ v_for = "(time_instant, time_instant_index) in funct_section[selected_funct][selected_funct_item]['TIMES']" ,
370+ style = "margin-bottom: 8px;" , # spacing between fields
371+ ):
372+ vuetify .VNumberInput (
373+ precision = ("funct_plot['input_precision']" ,),
374+ v_model = (
375+ "funct_section[selected_funct][selected_funct_item]['TIMES'][time_instant_index]" ,
376+ ),
377+ update_modelValue = "flushState('funct_section')" ,
378+ dense = True ,
379+ hide_details = True ,
380+ style = "min-width: 200px; max-width: 400px;" , # control width
381+ )
382+
383+ ## -> values / descriptions
384+ with html .Div (
385+ v_if = (
386+ "'VALUES' in funct_section[selected_funct][selected_funct_item]" ,
387+ )
388+ ):
389+ html .Span ("VALUES: " , classes = "text-h6" )
390+ # view mode: text
391+ html .Span (
392+ v_if = ("edit_mode == all_edit_modes['view_mode']" ,),
393+ v_text = (
394+ "funct_section[selected_funct][selected_funct_item]['VALUES']" ,
395+ ),
396+ )
397+ # edit mode: list of text fields
398+ with html .Div (
399+ v_if = ("edit_mode == all_edit_modes['edit_mode']" ,),
400+ ):
401+ with html .Div (
402+ v_for = "(val, val_index) in funct_section[selected_funct][selected_funct_item]['VALUES']" ,
403+ style = "margin-bottom: 8px;" , # spacing between fields
404+ ):
405+ vuetify .VNumberInput (
406+ precision = ("funct_plot['input_precision']" ,),
407+ v_model = (
408+ "funct_section[selected_funct][selected_funct_item]['VALUES'][val_index]" ,
409+ ),
410+ update_modelValue = "flushState('funct_section')" ,
411+ dense = True ,
412+ hide_details = True ,
413+ style = "min-width: 200px; max-width: 400px;" , # control width
414+ )
415+
416+ with html .Div (
417+ v_if = (
418+ "'DESCRIPTION' in funct_section[selected_funct][selected_funct_item]" ,
419+ )
420+ ):
421+ html .Span ("DESCRIPTION: " , classes = "text-h6" )
422+ # view mode: text
423+ html .Span (
424+ v_if = ("edit_mode == all_edit_modes['view_mode']" ,),
425+ v_text = (
426+ "funct_section[selected_funct][selected_funct_item]['DESCRIPTION']" ,
427+ ),
428+ )
429+ # edit mode: list of text fields
430+ with html .Div (
431+ v_if = ("edit_mode == all_edit_modes['edit_mode']" ,),
432+ ):
433+ with html .Div (
434+ v_for = "(val, val_index) in funct_section[selected_funct][selected_funct_item]['DESCRIPTION']" ,
435+ style = "margin-bottom: 8px;" , # spacing between fields
436+ ):
437+ vuetify .VTextField (
438+ v_model = "funct_section[selected_funct][selected_funct_item]['DESCRIPTION'][val_index]" ,
439+ update_modelValue = "flushState('funct_section')" ,
440+ dense = True ,
441+ hide_details = True ,
442+ style = "min-width: 200px; max-width: 400px;" , # control width
443+ )
444+
315445 # next components: only in view mode
316446 with html .Div (
317447 v_if = ("edit_mode == all_edit_modes['view_mode']" ,),
@@ -410,7 +540,14 @@ def _functions_panel(server):
410540 display_mode_bar = "true" ,
411541 )
412542 server .controller .figure_update = figure .update
413- server .controller .figure_update (function_plot_figure (server .state ))
543+ if server .state .funct_section [server .state .selected_funct ][
544+ server .state .selected_funct_item
545+ ][
546+ "VISUALIZATION"
547+ ]: # add this explicitly again here, to avoid prohibited server actions
548+ server .controller .figure_update (
549+ function_plot_figure (server .state )
550+ )
414551
415552 # here we define the GUI output of the non-visualizable function components
416553 with html .Div (
0 commit comments