From f80daff5292742b24cbce4bada939e8e988a11ba Mon Sep 17 00:00:00 2001 From: "stan.donarise" Date: Thu, 30 May 2024 23:34:22 +1100 Subject: [PATCH] Matrix: two-axis sorting controls --- plot/matrix/matrix.view.css.ts | 3 ++ plot/matrix/matrix.view.tree | 57 +++++++++++++++++++++++++--------- plot/matrix/matrix.view.ts | 20 +++++++++++- 3 files changed, 64 insertions(+), 16 deletions(-) diff --git a/plot/matrix/matrix.view.css.ts b/plot/matrix/matrix.view.css.ts index 973b2ec..e324b20 100644 --- a/plot/matrix/matrix.view.css.ts +++ b/plot/matrix/matrix.view.css.ts @@ -37,6 +37,9 @@ namespace $.$$ { flex: { shrink: 1, }, + Option: { + padding: ['.25rem', '.75rem'], + }, }, Plot: { diff --git a/plot/matrix/matrix.view.tree b/plot/matrix/matrix.view.tree index 32becc3..3ac0359 100644 --- a/plot/matrix/matrix.view.tree +++ b/plot/matrix/matrix.view.tree @@ -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 diff --git a/plot/matrix/matrix.view.ts b/plot/matrix/matrix.view.ts index 9586f37..e0270c2 100644 --- a/plot/matrix/matrix.view.ts +++ b/plot/matrix/matrix.view.ts @@ -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() : [], ] } @@ -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(){