Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't apply relayout operations to the view that originated the event (GH1086) #1094

Merged
merged 2 commits into from
Aug 6, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions js/src/Figure.js
Original file line number Diff line number Diff line change
Expand Up @@ -1248,10 +1248,11 @@ var FigureView = widgets.DOMWidgetView.extend({
/** @type {Py2JsRelayoutMsg} */
var msgData = this.model.get("_py2js_relayout");
if (msgData !== null) {

var relayoutData = msgData.relayout_data;
if (msgData.source_view_id !== this.viewID) {
var relayoutData = msgData.relayout_data;
relayoutData["_doNotReportToPy"] = true;
Plotly.relayout(this.el, msgData.relayout_data);
}

// ### Send layout delta ###
var layout_edit_id = msgData.layout_edit_id;
Expand Down
6 changes: 6 additions & 0 deletions plotly/basewidget.py
Original file line number Diff line number Diff line change
Expand Up @@ -814,6 +814,12 @@ def _remove_overlapping_props(input_data, delta_data, prop_path=()):
input_val, delta_val, recur_prop_path))
removed.extend(recur_removed)

# Check whether the last property in input_val
# has been removed. If so, remove it entirely
if not input_val:
input_data.pop(p)
removed.append(recur_prop_path)

elif p in input_data and p != 'uid':
# ### Remove property ###
input_data.pop(p)
Expand Down