-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "Docs for ExtendedTask feature"
- Loading branch information
Showing
370 changed files
with
9,494 additions
and
29,486 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,12 +7,9 @@ | |
.DS_Store | ||
|
||
/.luarc.json | ||
__pycache__/ | ||
/__pycache__/ | ||
.Rproj.user | ||
.Rhistory | ||
|
||
/_inv/ | ||
/objects.json | ||
|
||
.venv/ | ||
__pycache__/ |
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 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,46 @@ | ||
# API Reference Intro | ||
|
||
This page details the Shiny's full API. | ||
New users are encouraged to start from the [Quick Start tutorial](../docs/quick-start.qmd), and then come back here when you're ready to learn more. | ||
We recommend newcomers start with [Shiny Express](../docs/express-introduction.qmd) instead of the more structured Shiny Core API. | ||
This website documents the public API of Shiny for Python. See the [Getting Started tutorial](/docs/get-started.qmd) for a more approachable introduction to the API. | ||
The left-hand sidebar gives quick access to the full public API, and the table of contents below shows the same entries plus a brief summary for each. | ||
Most of the reference pages include a live example app at the bottom, or at least mention another page with a relevant example. | ||
|
||
::: {.panel-tabset .panel-underline .border-0 .p-0 .justify-content-center} | ||
We've intentionally designed Shiny's API so that you can `from shiny import *` to get access to most of what you need for most apps without introducing an excessive amount of namespace pollution. | ||
Namely, it gives you: | ||
|
||
### Express | ||
* User interface (UI/HTML) helpers, available via the `ui` subpackage. | ||
|
||
```{shinylive-python} | ||
#| standalone: true | ||
#| components: [editor, viewer] | ||
#| layout: vertical | ||
#| viewerHeight: 150 | ||
* To avoid clashing with this `ui` namespace when you do `from shiny import *`, you'll want to name you UI object something else, like `app_ui`. | ||
|
||
from shiny.express import input, render, ui | ||
* Reactive programming utilities, available via the `reactive` subpackage. | ||
* Decorators for rendering `output`, available via the `render` subpackage. | ||
|
||
ui.input_slider("val", "Slider label", min=0, max=100, value=50) | ||
* 3rd party packages that want to implement their own rendering functions are encouraged to use a `@render_foo()` naming convention so users may import with `from mypkg import render_foo`. | ||
|
||
@render.text | ||
def slider_val(): | ||
return f"Slider value: {input.val()}" | ||
``` | ||
* A handful of other things you'll want for most apps (e.g., `App`, `Module`, etc). | ||
* If you're using type checking, you'll also want to use the `Inputs`, `Outputs`, and `Session` Classes | ||
to type the instances supplied to your server function, for example: | ||
|
||
### Core | ||
|
||
```{shinylive-python} | ||
#| standalone: true | ||
#| components: [editor, viewer] | ||
#| layout: vertical | ||
#| viewerHeight: 150 | ||
from shiny import App, render, ui | ||
#| viewerHeight: 400 | ||
## file: app.py | ||
from shiny import * | ||
app_ui = ui.page_fixed( | ||
ui.input_slider("val", "Slider label", min=0, max=100, value=50), | ||
ui.output_text_verbatim("slider_val") | ||
app_ui = ui.page_fluid( | ||
ui.input_slider("n", "Value of n", min=1, max=10, value=5), | ||
ui.output_text("n2") | ||
) | ||
def server(input, output, session): | ||
def server(input: Inputs, output: Outputs, session: Session) -> None: | ||
@output | ||
@render.text | ||
def slider_val(): | ||
return f"Slider value: {input.val()}" | ||
def n2(): | ||
return f"The value of n*2 is {input.n() * 2}" | ||
app = App(app_ui, server) | ||
``` | ||
|
||
::: | ||
|
||
{{< include _api_index.qmd >}} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
sidebar: components | ||
sidebar: components | ||
format: | ||
html: | ||
css: _partials/components.css | ||
toc: false | ||
code-line-numbers: true | ||
code-overflow: scroll | ||
include-after-body: _partials/componentsjs.html | ||
filters: | ||
- quarto | ||
- line-highlight | ||
- shinylive | ||
- shinylive | ||
|
This file was deleted.
Oops, something went wrong.
19 changes: 0 additions & 19 deletions
19
components/_partials/components-detail-relevant-functions.ejs
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.