Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 0efbb28

Browse filesBrowse files
committed
Simplify Figure.get_data()
1 parent 79766af commit 0efbb28
Copy full SHA for 0efbb28

File tree

1 file changed

+2
-11
lines changed
Filter options

1 file changed

+2
-11
lines changed

‎plotly/graph_objs/graph_objs.py

Copy file name to clipboardExpand all lines: plotly/graph_objs/graph_objs.py
+2-11Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1003,17 +1003,8 @@ def get_data(self, flatten=False):
10031003
:returns: (dict|list) Depending on (flat|unflat)
10041004
10051005
"""
1006-
data = super(Figure, self).get_data(flatten=flatten)
1007-
if flatten:
1008-
keys = data.keys()
1009-
for key in keys:
1010-
new_key = '.'.join(key.split('.')[1:])
1011-
old_data = data.pop(key)
1012-
if key.split('.')[0] == 'data':
1013-
data[new_key] = old_data
1014-
return data
1015-
else:
1016-
return data['data']
1006+
self.to_graph_objs()
1007+
return self['data'].get_data(flatten=flatten)
10171008
Figure.get_data = get_data
10181009

10191010
def to_dataframe(self):

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.