Skip to content

Commit

Permalink
fix discovery cmp_labels
Browse files Browse the repository at this point in the history
  • Loading branch information
stan-donarise committed Nov 11, 2023
1 parent 7d0bcdc commit d9e601b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
7 changes: 5 additions & 2 deletions plot/discovery/discovery.view.tree
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,17 @@ $mpds_visavis_plot_discovery $mol_view
elementals_on? /
show_setup true
discovery_click? null
colorset /
\#3e3f95
\#c00
sub /
<= Plot $mpds_visavis_plotly
data <= data *
layout <= layout *
subscribe_events <= subscribe_events null
<= Cmp_legend $mpds_visavis_plot_legend_cmp
first_cmp_label? <= first_cmp_label? \
second_cmp_label? <= second_cmp_label? \
labels <= cmp_labels /
colorset <= colorset
<= Setup $mol_view
sub /
<= Elementals $mol_labeler
Expand Down
11 changes: 7 additions & 4 deletions plot/discovery/discovery.view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -232,17 +232,15 @@ namespace $.$$ {
const elementals_on = this.elementals_on()

const first = Discover_item({points: json.payload.points, name: json.answerto})
this.first_cmp_label( first.name )


const second = json_cmp ? Discover_item({points: json_cmp.payload.points, name: json_cmp.answerto}) : undefined
this.second_cmp_label( second?.name )

const result = discover(elementals_on, first, second)

const traces = [];

for (let i = 0; i < result.length; i++){
const dscolor = (i == 0) ? '#3e3f95' : '#900'
const dscolor = this.colorset()[ i ]
const oflag = (i == 0) ? 1 : 0.9
traces.push({
x: result[i].discovery.map((item: any) => item[0] ),
Expand All @@ -258,6 +256,11 @@ namespace $.$$ {
return traces
}

@ $mol_mem
cmp_labels() {
return this.json_cmp() ? [ this.json().answerto, this.json_cmp().answerto ] : []
}

}

}

0 comments on commit d9e601b

Please sign in to comment.