Skip to content

Send the moveTraces message after the figure's data has been updated. #1671

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

Merged
merged 2 commits into from
Jul 21, 2019
Merged
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
8 changes: 6 additions & 2 deletions packages/python/plotly/plotly/basedatatypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -642,8 +642,9 @@ def data(self, new_data):
# ### Check whether a move is needed ###
if not all([i1 == i2 for i1, i2 in zip(new_inds, current_inds)]):

# #### Update widget, if any ####
self._send_moveTraces_msg(current_inds, new_inds)
# #### Save off index lists for moveTraces message ####
msg_current_inds = current_inds
msg_new_inds = new_inds

# #### Reorder trace elements ####
# We do so in-place so we don't trigger traitlet property
Expand All @@ -664,6 +665,9 @@ def data(self, new_data):
for ni, trace_data in zip(new_inds, moving_traces_data):
self._data.insert(ni, trace_data)

# #### Update widget, if any ####
self._send_moveTraces_msg(msg_current_inds, msg_new_inds)

# ### Update data defaults ###
# There is to front-end syncronization to worry about so this
# operations doesn't need to be in-place
Expand Down