Skip to content

Commit

Permalink
Adds a second, less cluttered plot
Browse files Browse the repository at this point in the history
  • Loading branch information
luketpickering committed Dec 5, 2019
1 parent 3a26cfb commit c542196
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 6 deletions.
3 changes: 3 additions & 0 deletions NDComb.html
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,9 @@ <h3>MathJax initializing...</h3>
<div class="row">
<div id="NDCombPlot"></div>
</div>
<div class="row">
<div id="NDCombPlot_Nom"></div>
</div>

<div class="row">
<div class="form-group">
Expand Down
26 changes: 20 additions & 6 deletions ndapp.js
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand All @@ -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,
Expand Down Expand Up @@ -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);
}
Expand All @@ -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", () => {
Expand Down Expand Up @@ -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);

}

Expand All @@ -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"];
Expand All @@ -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();
Expand Down

0 comments on commit c542196

Please sign in to comment.