Source code for panel.template.golden

"""
GoldenTemplate based on the golden-layout library.
"""
import pathlib

import param

from ...io.resources import JS_URLS
from ...layout import Card
from ..base import BasicTemplate
from ..theme import DarkTheme, DefaultTheme


[docs]class GoldenTemplate(BasicTemplate): """ GoldenTemplate is built on top of golden-layout library. """ sidebar_width = param.Integer(20, doc=""" The width of the sidebar in percent. Default is 20.""") _css = pathlib.Path(__file__).parent / 'golden.css' _template = pathlib.Path(__file__).parent / 'golden.html' _modifiers = { Card: { 'children': {'margin': (10, 10)}, 'button_css_classes': ['golden-card-button'] }, } _resources = { 'css': { 'goldenlayout': "https://cdn.jsdelivr.net/npm/golden-layout@1.5.9/src/css/goldenlayout-base.css", }, 'js': { 'jquery': JS_URLS['jQuery'], 'goldenlayout': 'https://cdn.jsdelivr.net/npm/golden-layout@1.5.9/dist/goldenlayout.min.js' } } def _apply_root(self, name, model, tags): if 'main' in tags: model.margin = (10, 15, 10, 10)
[docs]class GoldenDefaultTheme(DefaultTheme): css = param.Filename(default=pathlib.Path(__file__).parent / 'default.css') _template = GoldenTemplate
[docs]class GoldenDarkTheme(DarkTheme): css = param.Filename(default=pathlib.Path(__file__).parent / 'dark.css') _template = GoldenTemplate