Skip to content

Commit

Permalink
Static pages
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Solymos <psolymos@gmail.com>
  • Loading branch information
psolymos committed Jul 6, 2024
1 parent e885efd commit be09c00
Show file tree
Hide file tree
Showing 259 changed files with 500,763 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/py-shinylive/app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[{"name": "app.py", "content": "import seaborn as sns\nimport matplotlib.pyplot as plt\nfrom shiny import App, render, ui\n\nfaithful = sns.load_dataset(\"geyser\")\nx = faithful.waiting\n\n\napp_ui = ui.page_fixed(\n ui.panel_title(\"Old Faithful\"),\n ui.output_plot(id = \"histogram\"),\n ui.input_slider(\n id=\"n\", \n label=\"Number of bins:\", \n min=1, \n max=50, \n value=25,\n ticks=True\n ),\n)\n\ndef server(input, output, session):\n @output\n @render.plot(alt=\"Histogram of waiting times\")\n def histogram():\n plt.hist(\n x, \n bins = input.n(), \n density=False, \n color=\"#BB74DB\",\n edgecolor=\"white\")\n plt.title(\"Histogram of waiting times\")\n plt.xlabel(\"Waiting time to next eruption [mins]\")\n plt.ylabel(\"Frequency\")\n\napp = App(ui = app_ui, server = server)\n", "type": "text"}, {"name": "requirements.txt", "content": "shiny>=0.10.2\nmatplotlib\nseaborn\n", "type": "text"}]
34 changes: 34 additions & 0 deletions docs/py-shinylive/edit/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Shiny examples browser</title>
<script
src="../shinylive/load-shinylive-sw.js"
type="module"
></script>
<script src="../shinylive/jquery.min.js"></script>
<script src="../shinylive/jquery.terminal/js/jquery.terminal.min.js"></script>
<link
href="../shinylive/jquery.terminal/css/jquery.terminal.min.css"
rel="stylesheet"
/>
<script type="module">
import { runApp } from "../shinylive/shinylive.js";
const response = await fetch("../app.json");
if (!response.ok) {
throw new Error("HTTP error loading app.json: " + response.status);
}
const appFiles = await response.json();

const appRoot = document.getElementById("root");
runApp(appRoot, "editor-terminal-viewer", {startFiles: appFiles}, "python");
</script>
<link rel="stylesheet" href="../shinylive/style-resets.css" />
<link rel="stylesheet" href="../shinylive/shinylive.css" />
</head>
<body>
<div style="height: 100vh; width: 100vw" id="root"></div>
</body>
</html>
28 changes: 28 additions & 0 deletions docs/py-shinylive/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Shiny App</title>
<script
src="./shinylive/load-shinylive-sw.js"
type="module"
></script>
<script type="module">
import { runApp } from "./shinylive/shinylive.js";
const response = await fetch("./app.json");
if (!response.ok) {
throw new Error("HTTP error loading app.json: " + response.status);
}
const appFiles = await response.json();

const appRoot = document.getElementById("root");
runApp(appRoot, "viewer", {startFiles: appFiles}, "python");
</script>
<link rel="stylesheet" href="./shinylive/style-resets.css" />
<link rel="stylesheet" href="./shinylive/shinylive.css" />
</head>
<body>
<div style="height: 100vh; width: 100vw" id="root"></div>
</body>
</html>
Loading

0 comments on commit be09c00

Please sign in to comment.