File tree Expand file tree Collapse file tree 2 files changed +14
-3
lines changed
Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change 33
44
55class Annotations (UserList ):
6+ def __str__ (self ):
7+ sorted_annotations = sorted (self , key = lambda ann : ann ["row" ])
8+ return "\n " .join (
9+ f"Line { ann ['row' ]} : { ann ['text' ]} " for ann in sorted_annotations
10+ )
11+
612 def add_annotations (self , annotations ):
713 """Merge another Annotations instance into this instance by appending its
814 annotations.
Original file line number Diff line number Diff line change 2727yaml_parser = YamlParser ()
2828
2929yaml_alert = pn .pane .Alert (
30- "### The YAML did not parse correctly! (see editor) " ,
30+ "### The YAML did not parse correctly!" ,
3131 alert_type = "danger" ,
3232 visible = False ,
3333)
3434error_alert = pn .pane .Alert (
35- "### There was an error in the YAML configuration (see editor) ." ,
35+ "### There was an error in the YAML configuration." ,
3636 alert_type = "warning" ,
3737 visible = False ,
3838)
4141def update_plot (value ):
4242 yaml_alert .visible = error_alert .visible = False
4343 yaml_parser .parse_waveforms (value )
44+ annotations = yaml_parser .waveform .annotations
4445
45- code_editor .annotations = list (yaml_parser . waveform . annotations )
46+ code_editor .annotations = list (annotations )
4647 code_editor .param .trigger ("annotations" )
4748
4849 # Show alert when there is a yaml parsing error
4950 if yaml_parser .has_yaml_error :
51+ yaml_alert .bject = (f"### The YAML did not parse correctly!\n { bleep } " ,)
5052 yaml_alert .visible = True
5153 elif code_editor .annotations :
54+ error_alert .object = (
55+ f"### There was an error in the YAML configuration.\n { annotations } "
56+ )
5257 error_alert .visible = True
5358 return yaml_parser .plot_tendencies ()
5459
You can’t perform that action at this time.
0 commit comments