Esempio n. 1
0
# pylint: disable=redefined-outer-name,protected-access
# pylint: disable=missing-function-docstring,missing-module-docstring,missing-class-docstring
import holoviews as hv
import numpy as np
import panel as pn
from holoviews import opts

from panel.template.fast.grid import FastGridTemplate, FastGridDarkTheme

hv.extension("bokeh")
opts.defaults(opts.Ellipse(line_width=3, color="#DF3874"))


def test_template_theme_parameter():
    template = FastGridTemplate(title="Fast", theme="dark")
    # Not '#3f3f3f' which is for the Vanilla theme

    doc = template.server_doc()
    assert doc.theme._json['attrs']['Figure'][
        'background_fill_color'] == "#181818"

    assert isinstance(template._get_theme(), FastGridDarkTheme)



COLLAPSED_ICON = """
<svg style="stroke: #E62F63" width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg" slot="collapsed-icon">
            <path d="M15.2222 1H2.77778C1.79594 1 1 1.79594 1 2.77778V15.2222C1 16.2041 1.79594 17 2.77778 17H15.2222C16.2041 17 17 16.2041 17 15.2222V2.77778C17 1.79594 16.2041 1 15.2222 1Z" stroke-linecap="round" stroke-linejoin="round"></path>
            <path d="M9 5.44446V12.5556" stroke-linecap="round" stroke-linejoin="round"></path>
            <path d="M5.44446 9H12.5556" stroke-linecap="round" stroke-linejoin="round"></path>
        </svg>
import panel as pn

from bokeh.document import Document
from holoviews import opts

from panel.pane import HoloViews, Markdown
from panel.template.fast.list import FastListDarkTheme, FastListTemplate
from panel.tests.template.fast.test_fast_grid_template import (
    INFO, _create_hvplot, _fast_button_card, _sidebar_items)

ACCENT_COLOR = "#D2386C"

opts.defaults(opts.Ellipse(line_width=3, color=ACCENT_COLOR))


def test_template_theme_parameter():
    template = FastListTemplate(title="Fast", theme="dark")
    # Not '#3f3f3f' which is for the Vanilla theme

    doc = template.server_doc(Document())
    assert doc.theme._json['attrs']['Figure'][
        'background_fill_color'] == "#181818"

    assert isinstance(template._get_theme(), FastListDarkTheme)


def test_accepts_colors_by_name():
    template = FastListTemplate(
        accent_base_color="red",
        header_background="green",
        header_color="white",
Esempio n. 3
0
from awesome_panel_extensions.frameworks.fast import (
    FastButton,
    FastCheckbox,
    FastLiteralInput,
    FastSwitch,
    FastTextInput,
)
from awesome_panel_extensions.site.template.template_generator import _TEMPLATE_CSS_ID
from holoviews import opts
from panel.template import FastGridTemplate

from application.config import site
from application.pages.fast.echarts_app import EchartsApp

hv.extension("bokeh")
ellipse_opts = opts.Ellipse(line_width=3, color="#DF3874")

APPLICATION = site.create_application(
    url="fast-grid-template",
    name="Fast Grid Template",
    author="Marc Skov Madsen",
    introduction="Demonstrates the FastGridTemplate and Fast Components",
    description=__doc__,
    thumbnail_url="fast-grid-template.png",
    documentation_url="",
    code_url="fast/fast_grid_template_app.py",
    gif_url="",
    mp4_url="fast_grid_template_app.mp4",
    tags=["Fast", "Template"],
)