Skip to content

Commit

Permalink
Matrix: two-axis sorting controls
Browse files Browse the repository at this point in the history
  • Loading branch information
stan-donarise committed May 30, 2024
1 parent 518c420 commit f80daff
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 16 deletions.
3 changes: 3 additions & 0 deletions plot/matrix/matrix.view.css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ namespace $.$$ {
flex: {
shrink: 1,
},
Option: {
padding: ['.25rem', '.75rem'],
},
},

Plot: {
Expand Down
57 changes: 42 additions & 15 deletions plot/matrix/matrix.view.tree
Original file line number Diff line number Diff line change
Expand Up @@ -67,18 +67,45 @@ $mpds_visavis_plot_matrix $mol_view
<= Intersection_on $mol_check_box
title \Show intersection
checked? <=> intersection_only? false
<= Order $mol_labeler
title \Sort by
Content <= Order_switch $mol_switch
value? <=> sort_control? \nump
options <= order_dict *
nump \Periodic number
num \Atomic number
size \Atomic size
rea \Atomic reactivity
rpp \Pseudopotential radii
rion \Ionic radii
rcov \Covalent radii
rmet \Metallic radii
tmelt \Melting temperature
eneg \Electronegativity
^ sorting /
<= Order $mol_labeler
title \Sort by
Content <= Order_switch $mol_switch
value? <=> sort_control? \nump
options <= order_dict *
nump \Periodic number
num \Atomic number
size \Atomic size
rea \Atomic reactivity
rpp \Pseudopotential radii
rion \Ionic radii
rcov \Covalent radii
rmet \Metallic radii
tmelt \Melting temperature
eneg \Electronegativity
<= X_sort_label $mol_labeler
title \Sort first axis by
Content <= X_sort $mol_select
value? <=> x_sort?
dictionary <= order_dict
<= Y_sort_label $mol_labeler
title \Sort second axis by
Content <= Y_sort $mol_select
value? <=> y_sort?
dictionary <= order_dict
<= X_op_label $mol_labeler
title \X joint sort operator
Content <= X_op $mol_select
value? <=> x_op_str?
dictionary <= op_dict *
null \none
diff \diff
product \product
ratio \ratio
max \max
min \min
<= Y_op_label $mol_labeler
title \Y joint sort operator
Content <= Y_op $mol_select
value? <=> y_op_str?
dictionary <= op_dict
20 changes: 19 additions & 1 deletion plot/matrix/matrix.view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ namespace $.$$ {
return [
... this.json().payload.fixel ? [ this.Fixel() ] : [],
this.multi_jsons() ? this.Intersection_on() : this.Nonformers(),
... this.show_setup() ? [ this.Order() ] : [],
... this.show_setup() ? this.sorting() : [],
]
}

Expand Down Expand Up @@ -428,6 +428,24 @@ namespace $.$$ {
}
return "nump"
}

@ $mol_mem
x_op_str( next?: string ) {
if( next == 'null' ) {
this.x_op( null )
return next
}
return this.x_op( next )
}

@ $mol_mem
y_op_str( next?: string ) {
if( next == 'null' ) {
this.y_op( null )
return next
}
return this.y_op( next )
}

@ $mol_mem
auto_reorder(){
Expand Down

0 comments on commit f80daff

Please sign in to comment.