From e0a455ba69748dc54037915befc72dbb87786ae6 Mon Sep 17 00:00:00 2001 From: "stan.donarise" Date: Mon, 2 Sep 2024 00:27:59 +1100 Subject: [PATCH] fix cube heatmap min max --- plot/cube/cube.view.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plot/cube/cube.view.ts b/plot/cube/cube.view.ts index a64bcf7..47cd30d 100644 --- a/plot/cube/cube.view.ts +++ b/plot/cube/cube.view.ts @@ -170,10 +170,12 @@ namespace $.$$ { @ $mol_mem points_traversed() { + const jsons = this.multi_jsons() ?? [ this.json() ] + const values_by_label: Record< string/*json index*/, Map< string/*point label*/, number/*v*/ > - > = Object.fromEntries( this.multi_jsons().map( (j: any, i:number )=> [i, new Map] ) ) + > = Object.fromEntries( jsons.map( (j: any, i:number )=> [i, new Map] ) ) let value_min = Infinity let value_max = -Infinity @@ -185,7 +187,7 @@ namespace $.$$ { let points_y: number[] = [] let points_z: number[] = [] - this.multi_jsons().map( (json: any, index: number) => { + jsons.map( (json: any, index: number) => { const points = $mpds_visavis_plot_cube_json( json ).payload.points points.labels.forEach( (label, i)=> {