diff --git a/web/static/js/main.js b/web/static/js/main.js index d71770e..4a7d2b6 100644 --- a/web/static/js/main.js +++ b/web/static/js/main.js @@ -232,9 +232,20 @@ } }); this.targets[target_slug].active = true; + + // 'src_plot': return at once if we are source + if ( target_slug.includes('_src') ){ + return this; + } + // 'src_plot': else also enable orbit if ((ref$ = this.orbits) != null) { ref$.enableTarget(target_slug); } + // 'src_plot': and enable corresponding '_src' slug if exists + var src_slug = target_slug+'_src' + if ( src_slug in this.targets){ + this.enableTarget(src_slug) + } return this; } @@ -246,9 +257,20 @@ } }); this.targets[target_slug].active = false; + + // 'src_plot': return at once if we are source + if ( target_slug.includes('_src') ){ + return this; + } + // 'src_plot': else also enable orbit if ((ref$ = this.orbits) != null) { ref$.disableTarget(target_slug); } + // 'src_plot': and disable corresponding '_src' slug if exists + var src_slug = target_slug+'_src' + if ( src_slug in this.targets){ + this.disableTarget(src_slug) + } return this; } @@ -873,7 +895,14 @@ this.plotWrapper.append('g').classed('x axis', true); this.plotWrapper.append('g').classed('y axis', true); this.yAxisText = this.plotWrapper.append("text").attr("transform", "rotate(-90)").attr("dy", "1em").style("text-anchor", "middle").text(this.title); - let y_title = this.target.name+" from "+$("input[name='input_slug']:checked").siblings(".mdl-radio__label").html(); + // src_plot: If it is a source we want to plot then set small Y-Title + let y_title='' + if ( this.target.slug.includes('_src') ){ + y_title = this.target.name + // src_plot: or just show normal Y-Title + } else { + y_title = this.target.name+" from "+$("input[name='input_slug']:checked").siblings(".mdl-radio__label").html(); + } this.yAxisTextTarget = this.plotWrapper.append("text").attr("transform", "rotate(-90)") .attr("dy", "1em").style("text-anchor", "middle") .style("font-style", "oblique").text(y_title); @@ -1568,6 +1597,10 @@ } initOrbiter(slug, config, data) { + // 'src_plot': If it is a source then Dont draw orbit` + if ( slug.includes('_src') ){ + return this; + } const thisOrbit = this; let orbit_ellipse; let orbiter; -- libgit2 0.21.2