Add docstring to get_screenshot_as_png
* Add docstring to get_screenshot_as_png
* Remove warning about Glyphs rendered via webgl
Removed in both `export_png` and `get_screenshot_as_png`
@@ -75,9 +75,6 @@ def export_png(obj, filename=None, height=None, width=None, webdriver=None):
Responsive sizing_modes may generate layouts with unexpected size and
aspect ratios. It is recommended to use the default ``fixed`` sizing mode.
- .. warning::
- Glyphs that are rendered via webgl won't be included in the generated PNG.
-
'''
image = get_screenshot_as_png(obj, height=height, width=width, driver=webdriver)
@@ -149,8 +146,23 @@ def export_svgs(obj, filename=None, height=None, width=None, webdriver=None):
# Dev API
#-----------------------------------------------------------------------------
+
def get_screenshot_as_png(obj, driver=None, **kwargs):
- '''
+ ''' Get a screenshot of a LayoutDOM object.
+
+ Args:
+ obj (LayoutDOM or Document) : a Layout (Row/Column), Plot or Widget
+ object or Document to export.
+
+ driver (selenium.webdriver) : a selenium webdriver instance to use
+ to export the image.
+
+ Returns:
+ cropped_image (PIL.Image.Image) : a pillow image loaded from PNG.
+
+ .. warning::
+ Responsive sizing_modes may generate layouts with unexpected size and
+ aspect ratios. It is recommended to use the default ``fixed`` sizing mode.
'''
Image = import_required('PIL.Image',
