def view() -> pn.Column:
    """# Bootstrap Dashboard Page.

    Creates a Bootstrap Dashboard Page with a Chart and a Table

    - inspired by the [GetBoostrap Dashboard Template]
    (https://getbootstrap.com/docs/4.4/examples/dashboard/)
    - implemented using the `awesome_panel' Python package and in particular the
    `awesome_panel.express.templates.BootstrapDashboardTemplate`

    Returns:
        pn.Column -- The Orders View
    """
    table = pn.Pane(
        _get_table_data(),
        sizing_mode="stretch_width",
    )
    return pn.Column(
        pn.pane.Markdown(TEXT),
        # pn.pane.PNG(str(IMAGE_PATH), max_width=600, sizing_mode="scale_both"),
        pnx.Title("Dashboard"),
        pn.layout.Divider(),
        _holoviews_chart(),
        pnx.Title("Section Title"),
        pn.layout.Divider(),
        table,
        sizing_mode="stretch_width",
        name="Dashboard",
    )
示例#2
0
def test_headings():
    """We test that we can show

- headers: title, header, subheader
- aligned: left, center
"""
    return TestApp(
        test_headings,
        pnx.Title("Title Left"),
        pnx.Header("Header Left"),
        pnx.SubHeader("SubHeader Left"),
        pnx.Title("Title Center", text_align="center",),
        pnx.Header("Header Center", text_align="center",),
        pnx.SubHeader("SubHeader Center", text_align="center",),
        sizing_mode="stretch_width",
    )
示例#3
0
def dashboard_view() -> pn.Column:
    """## Bootstrap Dashboard Template inspired by Page with orders chart and table

    Returns:
        pn.Column -- The Orders View
    """
    table = pn.Pane(services.get_table_data(), sizing_mode="stretch_width")
    return pn.Column(
        pnx.Title("Dashboard"),
        pnx.Divider(),
        holoviews_chart(),
        pnx.Title("Section Title"),
        pnx.Divider(),
        table,
        sizing_mode="stretch_width",
        name="Dashboard",
    )
示例#4
0
def test_with_url():
    """We test that we can show a Title with a link
"""
    return TestApp(
        test_with_url,
        pnx.Title("Title with url", url="https://awesome-panel.org",),
        pnx.Header("Header with url", url="https://awesome-panel.org",),
        pnx.SubHeader("SubHeader with url", url="https://awesome-panel.org",),
        sizing_mode="stretch_width",
    )
示例#5
0
def test_title_centered_white():
    """We test that we can show a centered Title, Header and SubHeader with a white text color"""
    return TestApp(
        test_title_centered_white,
        pnx.Title("Title Center", text_align="center", style={"color": "white"},),
        pnx.Header("Header Center", text_align="center", style={"color": "white"},),
        pnx.SubHeader("SubHeader Center", text_align="center", style={"color": "white"},),
        sizing_mode="stretch_width",
        background="lightgray",
    )
示例#6
0
def test_headings():
    """## test_headings

We test that we can show

- headers: title, header, subheader
- aligned: left, center
"""
    app = pn.Column(
        pn.pane.Markdown(test_headings.__doc__),
        pnx.Title("Title Left"),
        pnx.Header("Header Left"),
        pnx.SubHeader("SubHeader Left"),
        pnx.Title("Title Center", text_align="center"),
        pnx.Header("Header Center", text_align="center"),
        pnx.SubHeader("SubHeader Center", text_align="center"),
        sizing_mode="stretch_width",
        background="lightgray",
    )
    app.servable(test_headings.__name__)
示例#7
0
def test_with_url():
    """## test_with_url

We test that we can show a Title with a link
"""
    app = pn.Column(
        pn.pane.Markdown(test_with_url.__doc__),
        pnx.Title("Title with url", url="https://awesome-streamlit.org"),
        pnx.Header("Header with url", url="https://awesome-streamlit.org"),
        pnx.SubHeader("SubHeader with url",
                      url="https://awesome-streamlit.org"),
        sizing_mode="stretch_width",
        background="lightgray",
    )
    app.servable(test_with_url.__name__)
示例#8
0
def test_title_centered_white():
    """## test_title_centered_white

We test that we can show a centered Title, Header and SubHeader with a white text color
"""
    app = pn.Column(
        pn.pane.Markdown(test_title_centered_white.__doc__),
        pnx.Title("Title Center",
                  text_align="center",
                  style={"color": "white"}),
        pnx.Header("Header Center",
                   text_align="center",
                   style={"color": "white"}),
        pnx.SubHeader("SubHeader Center",
                      text_align="center",
                      style={"color": "white"}),
        sizing_mode="stretch_width",
        background="lightgray",
    )
    app.servable(test_title_centered_white.__name__)