|
1 | 1 | from __future__ import absolute_import |
2 | 2 |
|
3 | 3 | import collections |
| 4 | +from collections import OrderedDict |
4 | 5 | import re |
5 | 6 | import six |
6 | 7 | from six import string_types |
@@ -233,14 +234,14 @@ class is a subclass of both BaseFigure and widgets.DOMWidget. |
233 | 234 | # are suitable as `data` elements of Plotly.animate, but not |
234 | 235 | # the Plotly.update (See `_build_update_params_from_batch`) |
235 | 236 | # |
236 | | - # type: typ.Dict[int, typ.Dict[str, typ.Any]] |
237 | | - self._batch_trace_edits = {} |
| 237 | + # type: OrderedDict[int, OrderedDict[str, typ.Any]] |
| 238 | + self._batch_trace_edits = OrderedDict() |
238 | 239 |
|
239 | 240 | # ### Batch layout edits ### |
240 | 241 | # Dict from layout properties to new layout values. This dict is |
241 | 242 | # directly suitable for use in Plotly.animate and Plotly.update |
242 | | - # type: typ.Dict[str, typ.Any] |
243 | | - self._batch_layout_edits = {} |
| 243 | + # type: collections.OrderedDict[str, typ.Any] |
| 244 | + self._batch_layout_edits = OrderedDict() |
244 | 245 |
|
245 | 246 | # Animation property validators |
246 | 247 | # ----------------------------- |
@@ -772,7 +773,7 @@ def _restyle_child(self, child, key_path_str, val): |
772 | 773 | # Add key_path_str/val to saved batch edits |
773 | 774 | else: |
774 | 775 | if trace_index not in self._batch_trace_edits: |
775 | | - self._batch_trace_edits[trace_index] = {} |
| 776 | + self._batch_trace_edits[trace_index] = OrderedDict() |
776 | 777 | self._batch_trace_edits[trace_index][key_path_str] = val |
777 | 778 |
|
778 | 779 | def _normalize_trace_indexes(self, trace_indexes): |
|
0 commit comments