Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 97dc235

Browse files
committed
document to_plotly_json encoder
1 parent 3f1fe9e commit 97dc235

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

plotly/utils.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,12 +172,18 @@ def sageJSONEncoder(self, obj):
172172
raise NotEncodable
173173

174174
def builtinJSONEncoder(self, obj):
175+
'''
176+
Provide an API for folks to write their own
177+
JSON encoders for their objects that they wanna
178+
send to Plotly: this is an object's `to_plotly_json` method
179+
180+
Used for grid_objs.Column objects.
181+
'''
175182
try:
176183
return obj.to_plotly_json()
177184
except AttributeError:
178185
raise NotEncodable
179186

180-
181187
def default(self, obj):
182188
encoders = (self.builtinJSONEncoder,
183189
self.datetimeJSONEncoder,

0 commit comments

Comments
 (0)