diff --git a/plot/cube/cube.view.ts b/plot/cube/cube.view.ts index 95a389b..6c5323f 100644 --- a/plot/cube/cube.view.ts +++ b/plot/cube/cube.view.ts @@ -140,7 +140,7 @@ namespace $.$$ { @ $mol_mem scatters() { - const values: Map< [string/*label*/, number/*json index*/], number/*v*/ > = new Map() + const values: Map< [ label: string, json_index: number ], number/*v*/ > = new Map() const entries: Map< string/*point label*/, number[]/*json indexes*/> = new Map() @@ -154,8 +154,8 @@ namespace $.$$ { const points = $mpds_visavis_plot_cube_json( json ).payload.points points.labels.forEach( (label, i)=> { - const prev = entries.get( label ) ?? [] - entries.set( label, [ ...prev, index ] ) + entries.get( label )?.push( index ) ?? entries.set( label, [ index ] ) + values.set( [ label, index ], points.v[i] ) if( !labels.has( label ) ) { diff --git a/plot/matrix/matrix.view.ts b/plot/matrix/matrix.view.ts index c6624bd..9586f37 100644 --- a/plot/matrix/matrix.view.ts +++ b/plot/matrix/matrix.view.ts @@ -114,8 +114,7 @@ namespace $.$$ { const map = new Map< string, typeof $mpds_visavis_plot_matrix_json_link['Value'][] >() this.links().forEach( l => { - const prev = map.get( l.cmt ) ?? [] - map.set( l.cmt, [ ...prev, l ] ) + map.get( l.cmt )?.push( l ) ?? map.set( l.cmt, [ l ] ) } ) return map