diff --git a/ipyplot/_html_helpers.py b/ipyplot/_html_helpers.py index adc8803..569a2a3 100644 --- a/ipyplot/_html_helpers.py +++ b/ipyplot/_html_helpers.py @@ -8,6 +8,7 @@ import numpy as np import shortuuid from numpy import str_ +import urllib from ._img_helpers import _img_to_base64 @@ -228,14 +229,14 @@ def _display_html(html: str): display(HTML(_create_html_viewer(html))) return display(HTML(html)) - def _create_img( image: str or object, label: str or int, width: int, grid_style_uuid: str, custom_text: str = None, - force_b64: bool = False): + force_b64: bool = False, + inline_svg: bool = True): """Helper function to generate HTML code for displaying images along with corresponding texts. Parameters @@ -256,7 +257,10 @@ def _create_img( Do mind that using b64 conversion vs reading directly from filepath will be slower. You might need to set this to `True` in environments like Google colab. Defaults to False. - + inline_svg : bool, optional + You can force inlining svg images instead of reading them directly from filepaths with HTML. + Defaults to False. + Returns ------- str @@ -270,10 +274,13 @@ def _create_img( img_html += '