當前位置: 首頁>>代碼示例>>Python>>正文


Python panel.extension方法代碼示例

本文整理匯總了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() 
開發者ID:intake,項目名稱:xrviz,代碼行數:10,代碼來源:describe.py

示例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 
開發者ID:intake,項目名稱:intake,代碼行數:37,代碼來源:__init__.py


注:本文中的panel.extension方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。