diff --git a/plot/discovery/discovery.view.tree b/plot/discovery/discovery.view.tree index d32700d..f502e42 100644 --- a/plot/discovery/discovery.view.tree +++ b/plot/discovery/discovery.view.tree @@ -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 diff --git a/plot/discovery/discovery.view.ts b/plot/discovery/discovery.view.ts index 603d136..5cfccaa 100644 --- a/plot/discovery/discovery.view.ts +++ b/plot/discovery/discovery.view.ts @@ -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] ), @@ -258,6 +256,11 @@ namespace $.$$ { return traces } + @ $mol_mem + cmp_labels() { + return this.json_cmp() ? [ this.json().answerto, this.json_cmp().answerto ] : [] + } + } }