Skip to content

Commit 168077b

Browse files
committed
At least close ']' for lists of lists. Sorry, lists of lists of lists.
Also, you have to ensure that the sublist is longer than "[...]". Where "..." == end. Otherwise, you might end up with: ", ...]". Where we're closing something that we no longer open!
1 parent 74f4f63 commit 168077b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Diff for: plotly/graph_objs/graph_objs_tools.py

+2
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ def curtail_val_repr(val, max_chars, add_delim=False):
3636
if isinstance(val, six.string_types):
3737
# TODO: can we assume this ends in "'"
3838
r = r[:max_chars - len(end + "'")] + end + "'"
39+
elif isinstance(val, list) and max_chars >= len("[{end}]".format(end)):
40+
r = r[:max_chars - len(end + ']')] + end + ']'
3941
else:
4042
r = r[:max_chars - len(end)] + end
4143
if add_delim:

0 commit comments

Comments
 (0)