本文整理匯總了Python中panel.extension方法的典型用法代碼示例。如果您正苦於以下問題:Python panel.extension方法的具體用法?Python panel.extension怎麽用?Python panel.extension使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類panel
的用法示例。
在下文中一共展示了panel.extension方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: __init__
# 需要導入模塊: import panel [as 別名]
# 或者: from panel import extension [as 別名]
def __init__(self, data):
super().__init__()
xr.set_options(display_style='html')
pn.extension(raw_css=[CSS])
self.data = data
self.panel = pn.pane.HTML(min_width=500, max_height=250, css_classes=['xrviz-scroll'])
self.panel.object = "Description Section"
self.setup()
示例2: do_import
# 需要導入模塊: import panel [as 別名]
# 或者: from panel import extension [as 別名]
def do_import():
error = too_old = False
try:
import panel as pn
too_old = LooseVersion(pn.__version__) < LooseVersion("0.9.5")
except ImportError as e:
error = e
if too_old or error:
class GUI(object):
def __repr__(self):
raise RuntimeError("Please install panel to use the GUI `conda "
"install -c conda-forge panel>=0.8.0`. Import "
"failed with error: %s" % error)
return GUI
try:
from .gui import GUI
css = """
.scrolling {
overflow: scroll;
}
"""
pn.config.raw_css.append(css) # add scrolling class from css (panel GH#383, GH#384)
pn.extension()
except Exception as e:
class GUI(object):
def __repr__(self):
raise RuntimeError("Initialisation of GUI failed, even though "
"panel is installed. Please update it "
"to a more recent version (`conda install -c"
" conda-forge panel>=0.9.5`).")
return GUI