本文整理汇总了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