diff --git a/topsoilApp/src/main/java/org/cirdles/topsoil/app/control/plot/panel/DataOptionsController.java b/topsoilApp/src/main/java/org/cirdles/topsoil/app/control/plot/panel/DataOptionsController.java index 7bcc1d6a..26315486 100644 --- a/topsoilApp/src/main/java/org/cirdles/topsoil/app/control/plot/panel/DataOptionsController.java +++ b/topsoilApp/src/main/java/org/cirdles/topsoil/app/control/plot/panel/DataOptionsController.java @@ -147,21 +147,6 @@ protected void initialize() { fireEventOnChanged(unctBarsRadioButton.selectedProperty(), unctBarsRadioButton, PlotOption.UNCTBARS); fireEventOnChanged(showUnincludedCheckBox.selectedProperty(), showUnincludedCheckBox, PlotOption.SHOW_UNINCLUDED); - /* - uncertaintyComboBox.valueProperty().addListener(new ChangeListener() { - @Override - public void changed(ObservableValue observable, Uncertainty oldValue, Uncertainty newValue) { - - if (resetViewOnChangeUnc.isSelected()) { - PlotGenerator.plot.call(PlotFunction.Scatter.RECENTER); - PlotGenerator.plot.call(PlotFunction.Scatter.RECENTER); - System.out.println(resetViewOnChangeUnc.isSelected() + "balasdfokjasdf"); - } - } - }); - */ - - fireEventOnChanged(pointsFillValue, pointsFillColorPicker, PlotOption.POINTS_FILL); fireEventOnChanged(pointsOpacityValue, pointsFillColorPicker, PlotOption.POINTS_OPACITY); fireEventOnChanged(ellipsesFillValue, ellipsesFillColorPicker, PlotOption.ELLIPSES_FILL); diff --git a/topsoilApp/src/main/java/org/cirdles/topsoil/app/control/plot/panel/PlotOptionsPanel.java b/topsoilApp/src/main/java/org/cirdles/topsoil/app/control/plot/panel/PlotOptionsPanel.java index e0d5dbcc..f93286dc 100644 --- a/topsoilApp/src/main/java/org/cirdles/topsoil/app/control/plot/panel/PlotOptionsPanel.java +++ b/topsoilApp/src/main/java/org/cirdles/topsoil/app/control/plot/panel/PlotOptionsPanel.java @@ -232,7 +232,9 @@ static void fireEventOnChangedAndResetView(Property property, CheckBox ch if (checkBox.isSelected()) { System.out.println("Checkbox is selected and fireEvent() was called"); Event.fireEvent(target, new OptionChangeEvent<>(plotOption, oldValue, newValue)); - PlotGenerator.plot.call(PlotFunction.Scatter.RECENTER); + Event.fireEvent(target, new OptionChangeEvent<>(PlotOption.RESET_VIEW_ON_CHANGE_UNC, false, true)); + //PlotGenerator.plot.update(); + //PlotGenerator.plot.call(PlotFunction.Scatter.RECENTER); } })); } diff --git a/topsoilCore/src/main/java/org/cirdles/topsoil/plot/PlotOption.java b/topsoilCore/src/main/java/org/cirdles/topsoil/plot/PlotOption.java index c71e4a39..f0ac38db 100644 --- a/topsoilCore/src/main/java/org/cirdles/topsoil/plot/PlotOption.java +++ b/topsoilCore/src/main/java/org/cirdles/topsoil/plot/PlotOption.java @@ -49,7 +49,7 @@ public static PlotOption forKey(String key) { public static final PlotOption R238_235S = numberValue("R238_235S", 137.88); public static final PlotOption SHOW_UNINCLUDED = booleanValue("show_unincluded", true); - public static final PlotOption RESET_VIEW_ON_CHANGE_UNC = booleanValue("reset_view_on_change_unc", true); + public static final PlotOption RESET_VIEW_ON_CHANGE_UNC = booleanValue("reset_view_on_change_unc", false); public static final PlotOption POINTS = booleanValue("points", true); public static final PlotOption POINTS_FILL = stringValue("points_fill", "steelblue"); diff --git a/topsoilCore/src/main/resources/org/cirdles/topsoil/plot/topsoil.js b/topsoilCore/src/main/resources/org/cirdles/topsoil/plot/topsoil.js index 686cb2de..4cd5f16c 100644 --- a/topsoilCore/src/main/resources/org/cirdles/topsoil/plot/topsoil.js +++ b/topsoilCore/src/main/resources/org/cirdles/topsoil/plot/topsoil.js @@ -14150,7 +14150,7 @@ const ELLIPSE_CLASS = "ellipse"; exports.Ellipses = { draw(plot) { const { ellipses_fill: fill, ellipses_opacity: opacity, uncertainty } = plot.options; - console.log("uncertaintyE: " + uncertainty + " typeOf: " + typeof uncertainty); + console.log("options.reset_: " + plot.options.reset_view_on_change_unc); const layerToDrawOn = plots_1.findLayer(plot, plots_1.Feature.ELLIPSES); const ellipses = layerToDrawOn.selectAll("." + ELLIPSE_CLASS).data(calcEllipses(plot.data, uncertainty)); ellipses.exit().remove(); @@ -14441,6 +14441,7 @@ class McLeanRegression { lowerEnvelope.attr("d", lineGenerator(this.envelopeLowerBound)); upperEnvelope.attr("d", lineGenerator(this.envelopeUpperBound)); } + info.text("this: " + plot.options.reset_view_on_change_unc); let leftText = plot.leftTextSVGElement; leftText.text("Slope: " + regression.getRoundedSlope(5) + ", y-intercept: " + regression.getRoundedIntercept(5)); } @@ -15431,6 +15432,7 @@ var Option; Option["LAMBDA_238"] = "lambda_238"; Option["R238_235S"] = "R238_235S"; Option["SHOW_UNINCLUDED"] = "show_unincluded"; + Option["RESET_VIEW_ON_CHANGE_UNC"] = "reset_view_on_change_unc"; Option["POINTS"] = "points"; Option["POINTS_FILL"] = "points_fill"; Option["POINTS_OPACITY"] = "points_opacity"; @@ -15757,6 +15759,10 @@ class ScatterPlot extends plot_abstract_1.default { this.features["tera-wasserburg"] = new concordia_1.TeraWasserburgConcordia(); this.features["evolution"] = new evolution_1.EvolutionMatrix(); this.features[const_1.Feature.MCLEAN_REGRESSION] = new mclean_regression_1.McLeanRegression(); + if (this.options.reset_view_on_change_unc) { + this.update(); + this.options.reset_view_on_change_unc = false; + } this.update(); } resize() {