Creator Guide

Learn to create an App Panel with sample files step-by-step. It takes ~10min to complete

The goal of this tutorial is to help you create a simple App Panel that you can use and adapt to your own code. Follow the five steps below to create an App Panel with sample files from a capsule in R.

  1. Prepare a new capsule with sample files.

  2. Set up the Parameters panel.

  3. Lock the Parameters panel.

  4. Run with parameters.

  5. Set up the Result Files panel.

Prepare a New Capsule with Sample Files

App Panel works with code files that take input parameters in a capsule.

  1. Create a new capsule using the R starter environment.

  2. Click on Start with Sample Files to generate code and data that are ready for the App Panel.

You will see code and data files in /code and /data folders.

Click on main.R and run from /code. Drag the run file tab to the right so both files appear side-by-side in the viewer (see animated GIF below).

Set up the Parameters Panel

Set up the Parameters panel to map the input arguments in the code (e.g. main.R) to user inputs in the App Panel.

Types of Parameters

App Panel supports three types of input parameters. The icons at the top of the Parameters panel represent each type:

main.R plots a sine function. You will set up the following three arguments in this example from main.R.

  1. plot_title: the title of the figure in the result file.

  2. number_of_cycles: # of cycles for the sine function.

  3. input_data: a txt file that indicates the sampling rate.

The argumentsargs[x]in line 9-11 need to match with the three input parameters in the panel in sequential order from top to bottom. The following three tabs show you how to set the input parameters up respectively.

The following three tabs show you how to set up three parameters in the Parameters panel. Click on each tab for more details.

The first parameter value you set up goes toargs[1]in the code. It is stored in plot_titleas the first argument. This parameter lets the viewer type the plot title by entering any text. A Text Parameter is the most appropriate parameter type here.

Lock the Parameters Panel

Run with Parameters

Set up the Result Files Panel

Set the Functionality Status

To lock the released capsule to App Panel only, set the Functionality Status to Run-only functionality available in the capsule metadata.

Share the Capsule

You just completed creating an App Panel. To share it with others, you can either share the capsule or release the capsule. To use and view an App Panel, go to the Viewer Guide.

Last updated