Skip to content

Commit

Permalink
notify
Browse files Browse the repository at this point in the history
  • Loading branch information
stan-donarise committed Jul 11, 2023
1 parent ad80329 commit 1b35c86
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 4 deletions.
2 changes: 2 additions & 0 deletions plot/plot.view.tree
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ $mpds_visavis_plot $mol_view
json_cmp null
plot_raw null
show_setup false
notify? null
Fullscreen $mol_check
Icon <= Expand_icon $mol_icon_arrow_expand_all
checked? <=> fullscreen? false
Expand Down Expand Up @@ -61,6 +62,7 @@ $mpds_visavis_plot $mol_view
pie_click? <=> pie_click? null
scatter <= Scatter $mpds_visavis_plot_scatter
plot_raw <= plot_raw
notify? <=> notify?
customscatter <= Customscatter $mpds_visavis_plot_customscatter
plot_raw <= plot_raw
heatmap <= Heatmap $mpds_visavis_plot_heatmap
Expand Down
15 changes: 14 additions & 1 deletion plot/plot.view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ namespace $.$$ {
export class $mpds_visavis_plot extends $.$mpds_visavis_plot {

@ $mol_action
fetch_plot_json( request: RequestInfo ){
fetch_plot_json( request: RequestInfo | null ){
if ( request == null ) return null

const json = $mol_fetch.json( request ) as any
Expand All @@ -25,6 +25,14 @@ namespace $.$$ {
return this.fetch_plot_json( this.json_cmp_request() )
}

@ $mol_mem
json_cmp_request( next?: string | null ) {
if ( next === null && $mol_wire_probe( ()=> this.json_cmp_request() ) === null ) {
this.notify( 'Comparison was reset' )
}
return next ?? null
}

@ $mol_mem
plot_raw() {
return this.json() ?
Expand Down Expand Up @@ -66,6 +74,11 @@ namespace $.$$ {
@ $mol_action
on_fixel_checked( checked: boolean ) { }

@ $mol_action
notify( msg: string ) {
alert( msg )
}

}

$mol_view_component( $mpds_visavis_plot )
Expand Down
1 change: 1 addition & 0 deletions plot/scatter/scatter.view.tree
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
$mpds_visavis_plot_scatter $mpds_visavis_plotly
plot_raw $mpds_visavis_plot_raw
notify? null
5 changes: 2 additions & 3 deletions plot/scatter/scatter.view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,10 @@ namespace $.$$ {
if (Math.abs(t_data[0] - t_data_sum/t_data.length) < 0.1 && Math.abs(p_data[0] - p_data_sum/p_data.length) > 0.1){
return 'pressure'
} else if (Math.abs(t_data[0] - t_data_sum/t_data.length) > 0.1 && Math.abs(p_data[0] - p_data_sum/p_data.length) > 0.1){
return $mol_fail( new $mol_data_error('Sorry, plotting both temperature and pressure is not yet supported') )
this.notify( 'Sorry, plotting both temperature and pressure is not yet supported' )
// return 'pressure and temperature'
} else {
return 'temperature'
}
return 'temperature'
}

@ $mol_mem
Expand Down

0 comments on commit 1b35c86

Please sign in to comment.