User Guide

Working with mini-apps

AnalytiXagility mini-apps provide you with the tools necessary to develop and run interactive visualisations that answer some of the most common questions you have about your data. Mini-apps are built on Shiny, a web application framework for R by RStudio that turns analyses into highly visual and interactive applications, making it easy for every member of a multidisciplinary team to understand project data.

 

Working with mini-apps in your workspace

mini-apps icon, grabbed on 20.01.17, using XAP version 1.19.1 2740-8759a, from https://edcvaatest04.aridhiatest.net/#The Mini-apps tab sits between the Audit and Data tabs. Selecting the Mini-apps tab reveals the list of published mini-apps.
mini-apps, grabbed on 20.01.17, using XAP version 1.19.1 2740-8759a, from https://edcvaatest04.aridhiatest.net/#/workspaces/1152/mini_apps

Figure 1: Mini-apps list

There are two distinct views:mini-apps views, grabbed on 20.01.17, using XAP version 1.19.1 2740-8759a, from https://edcvaatest04.aridhiatest.net/#/workspaces/1152/mini_apps

  • Published – The default view in the mini-apps list is to only show those which have been published. From here a user can select or run a mini-app. The number of mini-apps that can be published will vary depending on how your workspace has been configured.
  • All Mini-apps – Alongside those mini-apps that have been published you will see all those mini-apps that are currently ‘work in progress’, i.e. unpublished. As well as being able to select or run a mini-app, the user will be able to manage, preview and edit any mini-app.
  •  

    Creating and previewing a mini-app

    add icon, grabbed on 17.01.17, using XAP version 1.19.1 2740-8759a, from https://edcvaatest04.aridhiatest.net/#/workspaces/1150
    Select the ‘New mini-app’ option from the ‘Add’ dropdown menu and give it a name; this will create your AnalytiXagility mini-app. Once you have selected a name and confirmed, you will be dropped straight into editing the mini-app.

    Note that the grid of mini-app tiles will be ordered alphabetically by name; if you want the tiles to appear in a certain order, please bear this in mind.

     

    Structure of a mini-app

    A mini-app consists of two scripts which function together to determine how it will look, and how it should function.

    • The user interface script controls the layout and appearance of your app: this is defined in the R script.
    • The server script contains the functions that compute output: this is defined in the R script.

    To learn more about Shiny powered apps, you can read RStudio’s documentation at http://shiny.rstudio.com/

     

    Creating mini-app from a template

    new mini-app, grabbed on 20.01.17, using XAP version 1.19.1 2740-8759a, from https://edcvaatest04.aridhiatest.net/#/workspaces/1152To help you get started we have provided a template of the required ui.r and server.r and supplementary code.r files to run a mini-app and generate a plot. When you select ‘New Mini-app’ a pop-up window will appear. Enter the name of your mini-app and choose a template from the dropdown menu.
    create mini-app, grabbed on 20.01.17, using XAP version 1.19.1 2740-8759a, from https://edcvaatest04.aridhiatest.net/#/workspaces/1152/mini_apps

    Click on ‘Create mini-app’. This will open ui.r, server.r and code.r.

    Note that code.r file is only used to add additional functions to the app, is not mandatory and can be left blank.

     

    Publishing a mini-app

    mini-app sidebar, grabbed on 20.01.17, using XAP version 1.19.1 2740-8759a, from https://edcvaatest04.aridhiatest.net/#/workspaces/1152/mini_appsOnce you are happy with the design of your mini-app you can promote it via the ‘Publish’ button in the right hand sidebar, which will make it visible for users in the mini-app gallery. This means that your new mini-app will be pushed into the default view of mini-apps, making it visible to all members of your workspace, and allowing them to run them by clicking the ‘Run’ button.

     

    Running a mini-app

    previous and next, grabbed on 20.01.17, using XAP version 1.19.1 2740-8759a, from https://analytixagility.aridhia.net/#workspaces/58/mini_app/627Clicking the ‘Run’ button on a published mini-app from within the Mini-apps tab will open that mini-app in its own dedicated ‘Application’ tab. From here you can also navigate around all published mini-apps using either the ‘Previous’ and ‘Next’ buttons, or by directly selecting another mini-app using the list in the right-hand sidebar.
    genome viewer mini-app, grabbed on 20.01.17, using XAP version 1.19.1 2740-8759a, from https://analytixagility.aridhia.net/#workspaces/58/mini_app/627

    Figure 3: Running a mini-app
     

    Unpublishing and deleting a mini-app

    If a mini-app has come to the end of its natural lifecycle, or further work is required before it is published for consumption by the rest of your team, you can remove it from the list of published apps by using the ‘Unpublish’ button in the right-hand sidebar. To remove it permanently, select ‘Delete’.

     

    Customising a mini-app

    mini-apps sidebar, grabbed on 20.01.17, using XAP version 1.19.1 2740-8759a, from https://analytixagility.aridhia.net/#/workspaces/58/mini_appsYou can customise your mini-app by adding additional assets to it when in ‘All mini-apps’ mode. Simply select the required mini-app in the Mini-apps tab and click ‘Upload File’ in the right-hand sidebar. This will add the file to the app and appear in its list of associated files. Clicking on one of these files will open the file for editing.

    Different versions of mini-apps can be created within AnalytiXagility by adding a file to the same location as your mini-app, this will be saved this as the latest version.

     

    Developing a mini-app offline and uploading to the workspace

    You can also develop mini-apps offline on your own machine before uploading it your workspace via SFTP. To make this possible your mini-app should follow a certain structure and be archived as a .zip file.

    To make an offline mini-app, create a .zip file with the following structure:

    • mini-apps # Mini-apps folder
      • my_app # Sub folder for this mini-app
        • server.r # RShiny server script
        • tile.png # (optional) .png image to be displayed as app icon (must be named)
        • ui.r # RShiny ui script
    • iris.csv # (optional) CSV file containing data to load into the workspace database
    • scripts # (optional) Folder containing files to load into the workspace “scripts” folder
    • documents # (optional) Folder containing files to load into the workspace “scripts” folder
    • datafiles # (optional) Folder containing files to load into the workspace “scripts” folder

    The created .zip archive must be placed into ‘Data’ folder using SFTP. Upon upload, you will be notified as to whether the archive was uploaded successfully. Now you should be able to locate it in the Mini-apps tab in your workspace.

     

    To contact support, send an email to the Aridhia service desk: servicedesk@aridhia.com.