From c542196fa2f997544a5ad19a29525e74c4adab86 Mon Sep 17 00:00:00 2001 From: Luke Pickering Date: Thu, 5 Dec 2019 13:04:14 -0600 Subject: [PATCH] Adds a second, less cluttered plot --- NDComb.html | 3 +++ ndapp.js | 26 ++++++++++++++++++++------ 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/NDComb.html b/NDComb.html index 2ea7470..24a7b7b 100644 --- a/NDComb.html +++ b/NDComb.html @@ -225,6 +225,9 @@

MathJax initializing...

+
+
+
diff --git a/ndapp.js b/ndapp.js index c49b93c..82533de 100644 --- a/ndapp.js +++ b/ndapp.js @@ -6,6 +6,7 @@ class ndapp { this.Widgets = {}; this.Widgets.NDCombPlot_El = document.getElementById("NDCombPlot"); + this.Widgets.NDCombPlot_Nom_El = document.getElementById("NDCombPlot_Nom"); this.Widgets.ConstraintControls = document.getElementById("ConstraintControls"); @@ -30,6 +31,11 @@ class ndapp { AddCurve(plot, params, curve_state = 0) { + let add_extra = curve_state > 2; + if (add_extra) { + curve_state -= 2; + } + let combflux = { meta: { id: 0, @@ -118,9 +124,11 @@ class ndapp { plot.AddCurve(INGRIDFN); plot.ShowNext(combflux); - plot.AddCurve(ND280F); - plot.AddCurve(WAGASCIF); - plot.AddCurve(INGRIDF); + if (add_extra) { + plot.AddCurve(ND280F); + plot.AddCurve(WAGASCIF); + plot.AddCurve(INGRIDF); + } } else { plot.AddCurve(combflux); } @@ -133,6 +141,9 @@ class ndapp { this.Widgets.NDCombPlot = new OscProbPlot(); this.Widgets.NDCombPlot.DrawAxes(this.Widgets.NDCombPlot_El, 0, 3, -3, 5, "\\(\\textrm{Combined flux}\\)"); + this.Widgets.NDCombPlot_Nom = new OscProbPlot(); + this.Widgets.NDCombPlot_Nom.DrawAxes(this.Widgets.NDCombPlot_Nom_El, 0, 3, -3, 5, "\\(\\textrm{Combined flux}\\)"); + this.Update(); this.Controls.ND280_El.addEventListener("change", () => { @@ -163,7 +174,8 @@ class ndapp { this.Controls.WAGASCI_El.value = this.coeffs["WAGASCI"]; this.Controls.INGRID_El.value = this.coeffs["INGRID"]; - this.AddCurve(this.Widgets.NDCombPlot, this.coeffs, 1); + this.AddCurve(this.Widgets.NDCombPlot, this.coeffs, 3); + this.AddCurve(this.Widgets.NDCombPlot_Nom, this.coeffs, 1); } @@ -178,7 +190,8 @@ class ndapp { coeffcopy.point_class = this.color_class_wheel[this.wheel_idx]; - this.AddCurve(this.Widgets.NDCombPlot, coeffcopy, 1); + this.AddCurve(this.Widgets.NDCombPlot, coeffcopy, 3); + this.AddCurve(this.Widgets.NDCombPlot_Nom, coeffcopy, 1); this.Controls.ND280_El.value = this.coeffs["ND280"]; this.Controls.WAGASCI_El.value = this.coeffs["WAGASCI"]; @@ -192,7 +205,8 @@ class ndapp { coeffcopy[chg_par.x_name] = chg_par.x_value coeffcopy[chg_par.y_name] = chg_par.y_value - this.AddCurve(this.Widgets.NDCombPlot, coeffcopy, 2); + this.AddCurve(this.Widgets.NDCombPlot, coeffcopy, 4); + this.AddCurve(this.Widgets.NDCombPlot_Nom, coeffcopy, 2); }, () => { // Off drag this.Widgets.NDCombPlot.RemoveHover();