App
The App
class controls how the notebook is displayed in the Mercury.
import mercury as mr
# set Application parameters
app = mr.App(title="",
description="",
show_code=False,
show_prompt=False,
continuous_update=True,
static_notebook=False,
show_sidebar=True,
full_screen=True,
allow_download=True,
allow_share=True,
stop_on_error=False
)
Parameters
- title (string) - title of the application, it will be used in the home view and in sidebar.
- description (string) - description of the application, it will be used in the home view.
- show_code (boolean) - set to
True
to show code of the notebook, default is set toFalse
which means that code is hidden. - show_prompt (boolean) - set to
True
if you want to show notebook prompt in the application, theshow_code
needs to beTrue
as well. Default is set toFalse
. - continuous_update (boolean) - default is set to
True
which means that notebook is recomputed immediately after widget value change. Please set toFalse
if you want to have updates after clickingRun
button. - static_notebook (boolean) - when set to
True
notebook will not be recomputed on any widget change (notebook is static). Default isFalse
which means that app presented in Mercury is interactive. - show_sidebar (boolean) - you can hide sidebar when Mercury App is open. User can open sidebar by clicking in the top right blue button with arror. By default sidebar is displayed.
- full_screen (boolean) - by default (
True
) notebook is displayed with full width. Please setFalse
to limit notebook width to1140px
. - allow_download (boolean) - by default there is
Download
button available to export results as PDF or HTML file. You can hideDownload
button by settingallow_download=False
. - allow_share (boolean) - by default there is
Share
button availabe to export results as a URL. You can hideShare
button by settingallow_share=False
. - stop_on_error (boolean) - by default (
False
) notebook will execute all cells even with errors. When set toTrue
notebook will stop execution when error occured in the cell.