-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: add initial tutorial for shiny
fix: remove incorrectly pushed file
- Loading branch information
Showing
14 changed files
with
132 additions
and
0 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions
18
docs/src/tutorials/getting-started-shiny/01-getting-ready.md
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# 1. Getting Ready | ||
|
||
[Shiny][shiny] is an open source R package that provides an elegant and powerful web | ||
framework for building web applications using R. Before continuing, you will need the | ||
following: | ||
|
||
[shiny]: https://shiny.posit.co/ | ||
|
||
* A project | ||
* Project storage | ||
* A RStudio Notebook | ||
|
||
For tutorials on the above, see: | ||
|
||
* [My First Notebook](../my-first-notebook/) | ||
* [My first RStudio project](../getting-started-rstudio/) | ||
|
||
This code will produce a simple dashboard with some controls that change a scatter plot. |
49 changes: 49 additions & 0 deletions
49
docs/src/tutorials/getting-started-shiny/02-create-shiny-site.md
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 |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# 2. Create a Shiny site | ||
|
||
In this section you will create a Shiny site. | ||
|
||
Starting point: you should be logged in to DataLabs, in a project you have admin | ||
permissions for. This project should contain a blank RStudio notebook. | ||
|
||
In order to begin, open your RStudio notebook and create a new project ensuring | ||
to select "Shiny". This will trigger some actions like initialising renv and may | ||
take a few minutes. | ||
|
||
![create shiny project type](../../img/create-shiny-project-type.png "create shiny project type") | ||
|
||
***NOTE: When working on more advanced Shiny sites that use custom packages, you | ||
should always enable `renv` when you create the RStudio project. This will track | ||
all dependencies used in the project, and they can be loaded by the Shiny site once | ||
it has been created by initialising `renv` in the Shiny code itself. While this isn't | ||
required for this minimal example, generally it's advisable to work this way.*** | ||
|
||
![create shiny project](../../img/create-shiny-project-in-rstudio.png "create shiny project") | ||
|
||
Once complete, this should have generated a new folder with an existing `app.R` | ||
file in which serves as a good example on how to work with Shiny. | ||
|
||
![shiny project created](../../img/create-shiny-app-example.png "shiny project created") | ||
|
||
Next from DataLabs, on the left-hand side, select **Sites**. | ||
|
||
![site page](../../img/project-site-page-empty.png "site page") | ||
|
||
Select **Create Site** and fill out the form. In this form, the `Source Path` | ||
should point to where your app.R code exists within your Project Storage, | ||
for example `/data/notebooks/rstudio-notebook/tutorial`. (Assuming the project | ||
created in RStudio was called tutorial) | ||
|
||
By default, the Shiny site will look for app.R or main.R/server.R. If nothing | ||
is present it will simply show a blank index page. The site will still be able to | ||
access other files in the directory if necessary, such as data files and | ||
scripts. | ||
|
||
![shiny site settings](../../img/create-shiny-site.png "shiny site settings") | ||
|
||
When happy with the settings, click **Create**. | ||
|
||
Once created, you will be able to see your Site appear in the list, and | ||
its status will change from `Requested` to `Ready` once it is available to | ||
launch. | ||
|
||
![shiny site created](../../img/create-shiny-site-created.png "shiny site created") |
17 changes: 17 additions & 0 deletions
17
docs/src/tutorials/getting-started-shiny/03-launch-shiny-site.md
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# 3. Launch Shiny | ||
|
||
In this section you will launch a Panel site. | ||
|
||
Starting point: you should be logged in to DataLabs, in a project you have at least | ||
viewer permissions for. This project should contain a Shiny site connected to a | ||
RStudio notebook. | ||
|
||
On the left-hand side, select **Sites**. | ||
|
||
![shiny site created](../../img/create-shiny-site-created.png "shiny site created") | ||
|
||
Click on **Open** on your Shiny site. | ||
|
||
![shiny site created](../../img/create-shiny-app-created.png "shiny site created") | ||
|
||
You should be able to see the default Shiny example histogram successfully loaded. |
17 changes: 17 additions & 0 deletions
17
docs/src/tutorials/getting-started-shiny/04-delete-shiny-site.md
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# 4. Delete Shiny site | ||
|
||
In this section you will delete a Shiny site. | ||
|
||
As sites are driven by the contents of a notebook and doesn't contain the code | ||
itself, they can be deleted when they are no longer needed. | ||
|
||
Starting point: you should be logged in to DataLabs, in a project you have admin | ||
permissions for, and a Shiny site should already exist. | ||
|
||
![shiny site created](../../img/create-shiny-site-created.png "shiny site created") | ||
|
||
On the Shiny site, select the triple-dot *More* menu and select **Delete**. | ||
|
||
![shiny site delete](../../img/create-shiny-delete.png "shiny site delete") | ||
|
||
Select **Confirm deletion** to delete the Shiny site. |
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# 5. Conclusion | ||
|
||
__Congratulations!__ | ||
|
||
In this tutorial, you have: | ||
|
||
* Created a Shiny site linked to a notebook. | ||
* Launched the site and used its interactive elements. | ||
* Deleted the Shiny site. | ||
|
||
__Where next?__ | ||
|
||
To learn more about Shiny, visit <https://shiny.posit.co/> |
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# My first Shiny Site | ||
|
||
In this tutorial you will create a *[Shiny][shiny]* site within Datalabs, allowing you to | ||
visualise and interact with a notebook. | ||
|
||
[shiny]: https://shiny.posit.co/ | ||
|
||
1. [Getting ready](01-getting-ready.md) | ||
2. [Create a Shiny site](02-create-shiny-site.md) | ||
3. [Launch Shiny](03-launch-shiny-site.md) | ||
4. [Delete Shiny site](04-delete-shiny-site.md) | ||
5. [Conclusion](05-conclusion.md) |