def visualize(self, format='png'): """Visualize an expression in the browser as a PNG image. Parameters ---------- format : str, optional Defaults to ``'png'``. Some additional formats are ``'jpeg'`` and ``'svg'``. These are specified by the ``graphviz`` Python library. Notes ----- This method opens a web browser tab showing the image of the expression graph created by the code in :module:`ibis.expr.visualize`. Raises ------ ImportError If ``graphviz`` is not installed. """ import ibis.expr.visualize as viz path = viz.draw(viz.to_graph(self), format=format) webbrowser.open('file://{}'.format(os.path.abspath(path)))
def visualize(self, format: str = 'svg') -> None: """Visualize an expression in the browser as an SVG image. Parameters ---------- format Image output format. These are specified by the ``graphviz`` Python library. Notes ----- This method opens a web browser tab showing the image of the expression graph created by the code in [ibis.expr.visualize][]. Raises ------ ImportError If ``graphviz`` is not installed. """ import ibis.expr.visualize as viz path = viz.draw(viz.to_graph(self), format=format) webbrowser.open(f'file://{os.path.abspath(path)}')
def visualize(self, format='svg'): """Visualize an expression in the browser as an SVG image. Parameters ---------- format : str, optional Defaults to ``'svg'``. Some additional formats are ``'jpeg'`` and ``'png'``. These are specified by the ``graphviz`` Python library. Notes ----- This method opens a web browser tab showing the image of the expression graph created by the code in :module:`ibis.expr.visualize`. Raises ------ ImportError If ``graphviz`` is not installed. """ import ibis.expr.visualize as viz path = viz.draw(viz.to_graph(self), format=format) webbrowser.open('file://{}'.format(os.path.abspath(path)))