Created
March 25, 2024 18:53
-
-
Save filipstachura/b0abd52b07b7f58e212b8e3519cf5318 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This file generated by Quarto; do not edit by hand. | |
from __future__ import annotations | |
from pathlib import Path | |
from shiny import App, Inputs, Outputs, Session, ui | |
def server(input: Inputs, output: Outputs, session: Session) -> None: | |
import seaborn as sns | |
penguins = sns.load_dataset("penguins") | |
# ======================================================================== | |
from shiny import render, ui | |
ui.input_select("x", "Variable:", | |
choices=["bill_length_mm", "bill_depth_mm"]) | |
ui.input_select("dist", "Distribution:", choices=["hist", "kde"]) | |
ui.input_checkbox("rug", "Show rug marks", value = False) | |
# ======================================================================== | |
@render.plot | |
def displot(): | |
sns.displot( | |
data=penguins, hue="species", multiple="stack", | |
x=input.x(), rug=input.rug(), kind=input.dist()) | |
# ======================================================================== | |
return None | |
_static_assets = ["test_files","test_files/libs/quarto-html/tippy.css","test_files/libs/quarto-html/quarto-syntax-highlighting.css","test_files/libs/bootstrap/bootstrap-icons.css","test_files/libs/bootstrap/bootstrap.min.css","test_files/libs/quarto-dashboard/datatables.min.css","test_files/libs/clipboard/clipboard.min.js","test_files/libs/quarto-html/quarto.js","test_files/libs/quarto-html/popper.min.js","test_files/libs/quarto-html/tippy.umd.min.js","test_files/libs/quarto-html/anchor.min.js","test_files/libs/bootstrap/bootstrap.min.js","test_files/libs/quarto-dashboard/quarto-dashboard.js","test_files/libs/quarto-dashboard/stickythead.js","test_files/libs/quarto-dashboard/datatables.min.js","test_files/libs/quarto-dashboard/pdfmake.min.js","test_files/libs/quarto-dashboard/vfs_fonts.js","test_files/libs/quarto-dashboard/web-components.js","test_files/libs/quarto-dashboard/components.js"] | |
_static_assets = {"/" + sa: Path(__file__).parent / sa for sa in _static_assets} | |
app = App( | |
Path(__file__).parent / "test.html", | |
server, | |
static_assets=_static_assets, | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment