multicolorfits.gui_embed#

multicolorfits.gui_embed(host='127.0.0.1', port=8321, session=None, state=None, files=None, colors=None, labels=None, **kwargs)[source]#

Embed the browser GUI in Jupyter, Colab, VS Code notebooks, or Binder.

Starts uvicorn in a background thread and displays an inline iframe (or Colab’s port proxy). Use display='url' to print the URL only, or return_url=True to get the URL string without displaying.

Parameters:
  • host – Same as gui().

  • port – Same as gui().

  • session – Same as gui().

  • state – Same as gui().

  • files – Same as gui().

  • colors – Same as gui().

  • labels – Same as gui().

  • display ({'auto', 'iframe', 'colab', 'url', 'none'}) – Embedding mode; auto picks Colab vs Jupyter vs URL print.

  • height – iframe size (height also used for Colab).

  • width – iframe size (height also used for Colab).

  • proxy_url (str or None) – Override iframe src for custom JupyterHub proxy layouts.

  • return_url – URL-only helpers for scripting and debugging.

  • print_url – URL-only helpers for scripting and debugging.

Examples

import multicolorfits as mcf
s = mcf.McfSession()
s.load_files(['a.fits', 'b.fits'], colors=['#f00', '#0ff'])
mcf.gui_embed(session=s, height=950)

Requires the web extra: pip install multicolorfits[web]