Skip to content

Commit

Permalink
Remove @output decorator
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 11, 2024
1 parent 6cc2ef8 commit ac204e3
Show file tree
Hide file tree
Showing 337 changed files with 21,162 additions and 9,121 deletions.
1 change: 1 addition & 0 deletions docs/app/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\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 @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"}]
Loading

0 comments on commit ac204e3

Please sign in to comment.