Trace

  • Displays interactive figure containing the trace Jupyter notebook.

    This method is useful for quickly previewing a trace without explicitly constructing the Figure object. Optionally, it also accepts configuration and layout options to fine-tune the appearance.

    Here’s a example that displays a scatter trace:

    try Scatter(x: [1, 2, 3], y: [4, 6, 5]).display()
    

    Important

    Prior to calling this method, the following Jupyter notebook magic has to be executed:

    %include "EnableIPythonDisplay.swift"
    

    Bug

    Google Colab seems to be a bit broken. I wasn’t able to figure out a Swift-only communication with the Jupyter kernel. There’s more details in the Workaround.ipynb example notebook. A Swift only solution that works locally in Jupyter breaks in the Colab environment. For the time being, to make the display method work, the communication with the kernel has to be routed via the Python bridge.