Skip to content

Commit 4636034

Browse files
committed
Fixed importing bug for plots
1 parent 000cba7 commit 4636034

1 file changed

Lines changed: 12 additions & 5 deletions

File tree

js/widgets/main_plot.js

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -559,15 +559,17 @@ $(function() {
559559
}
560560
},
561561

562-
toggle_combined: function(combine) {
562+
toggle_combined: function(combine, plot=true) {
563563
this.combined = combine;
564564

565565
this._elements.midaxis_top.style("display", combine ? "none" : null);
566566
this._elements.midaxis_bottom.style("display", combine ? "none" : null);
567567

568-
this.scale_axes(undefined, undefined, undefined, true, true);
568+
if (plot) {
569+
this.scale_axes(undefined, undefined, undefined, true, true);
569570

570-
$("#settings-table").settings_table("plot_all_composites")
571+
$("#settings-table").settings_table("plot_all_composites")
572+
}
571573
},
572574

573575
toggle_color_trace: function(color_trace) {
@@ -654,12 +656,12 @@ $(function() {
654656
export: function() {
655657
return {title: this.title, xlabel: this.xlabel, ylabel: this.ylabel, opacity: this.opacity,
656658
smoothing: this.smoothing, bp_shift: this.bp_shift, xmin: this.xmin, xmax: this.xmax,
657-
ymax: this.ymax, combined: this.combined, locked: this.locked}
659+
ymax: this.ymax, combined: this.combined, locked: this.locked, color_trace: this.color_trace}
658660
},
659661

660662
import: function(data) {
661663
if ("combined" in data) {
662-
this.combined = data.combined;
664+
this.toggle_combined(data.combined, false);
663665
d3.select("#combined-checkbox").property("checked", data.combined);
664666
d3.select("#separate-color-checkbox").property("disabled", data.combined)
665667
};
@@ -692,6 +694,11 @@ $(function() {
692694
this.locked = data.locked;
693695
d3.select("#lock-axes-checkbox").property("checked", data.locked);
694696
$("#axes-input").axes_input("toggle_locked", data.locked)
697+
};
698+
699+
if ("color_trace" in data) {
700+
this.color_trace = data.color_trace;
701+
d3.select("#color-trace-checkbox").property("checked", data.color_trace)
695702
}
696703
},
697704

0 commit comments

Comments
 (0)