Introduction

Data apps provide a user interface to perform scalable and shareable data operations, such as visualization, data import, export, and preview.

You can think of a data app as a web application that allows others to interact with data without needing to understand the underlying technical details.

With this guide you will build your first KNIME Data App from scratch and deploy it to the KNIME Hub.

Things you need before you start

If you haven’t done so yet, download and install KNIME Analytics Platform to build the workflow.

Additionally, create your KNIME Hub Pro or Team account if you don’t have one yet. This will allow you to publish your data app to the KNIME Hub and share it with others.

This guide assumes that you have a basic understanding of how to use KNIME Analytics Platform. If you are new to KNIME, we recommend going through the KNIME Getting Started Guide first.
KNIME Analytics Platform is free to use forever. For Pro and Team plan pricing and execution credits, please refer to the KNIME Hub pricing page. Finally, you can refer to the KNIME Pro Guide to understand how job execution and billing works in more details.

Build and deploy your first data app

KNIME Data Apps are built using special nodes in KNIME Analytics Platform that allow you to update the look and feel of each page, build in interaction, and combine multiple pages in the app.

This section provides a step-by-step guide for building and deploying a simple workflow as a data app.

As a starting point, we use the workflow shown in Figure 1 and adapt it to build our first data app. The example workflow demonstrates how to access, and visualize sales data.

01 workflow visualization sales data
Figure 1. Workflow for Visualization of Sales Data

The workflow for visualizing sales data consists of the following nodes:

  • Data Access:

    • CSV Reader node to read the sales data from a CSV file.

  • Data Prepprocessing:

    • Column Filter node to select relevant columns from the dataset.

    • Row Filter node to remove rows where the country value is unknown.

  • Data Visualization:

    • Line Plot node to visualize sales over time.

    • Color Manager node (optional) to assign colors to different countries.

    • Pie Chart node to visualize sales by country.

You can download the initial workflow from KNIME Hub.

Once you have downloaded the workflow, open it in KNIME Analytics Platform.

Step 1/5 — Create a component

A component is the basic building block of your data app, so the first step in order to create a data app is to encapsulate the view nodes in a component.

To create a component:

  1. Select the view nodes

  2. Right-click on one of the selected nodes

  3. Select Create component from the context menu

    02 create component
    Figure 2. Create a component
  4. Follow the instructions in the dialog to create the component. You can name the component, e.g. Sales Data Analysis

  5. Execute the component by right-clicking on it and selecting Execute from the context menu

  6. The component view is then shown in the node monitor panel

    03 component view
    Figure 3. Component view

Step 2/5 — Upload Workflow to KNIME Hub

To upload the workflow to your KNIME Hub account:

  1. Go to the Home tab in KNIME Analytics Platform, hover over the KNIME Community Hub icon in the left sidebar, and click Connect. This will open a page in your browser where you can log in to your KNIME Hub account.

  2. After logging in, return back to the Analytics Platform, select your Pro account, and create a new space by clicking the yellow plus button. A space is where you can organize your workflows and data apps for a specific project.

    04 create space
    Figure 4. Create a space
  3. Switch to your workflow tab, save your workflow, and click the Upload button.

  4. In the upload dialog, select your Pro account, and the space you have just created.

  5. Important: Make sure the option Reset Workflow(s) before upload is checked as it is by default.

  6. This will open a tab showing the uploaded workflow on KNIME Hub.

Step 3/5 — Execute the data app

  1. Click Deploy on Hub in the top right corner of the workflow editor. This will open a page in your browser and will show the workflow page on KNIME Hub.

  2. Here, click Run to execute the workflow.

    05 workflow adhoc execution
    Figure 5. Workflow execution on KNIME Hub
  3. You should see now the same view as in KNIME Analytics Platform when you opened the component view.

If you do not see the view, make sure that the option Reset Workflow(s) before upload is checked when uploading the workflow.

Step 4/5 — Version and create a deployment of your data app

To version your data app:

  1. From the workflow page in the browser, click the Versions button, then click Create version in the side panel.

  2. Give the version a name and a description, and click Create.

  3. This will create a new version of your workflow.

To create a deployment of your data app:

  1. Once you created a version, click the Deploy button, select Create data app, and give your data app deployment a name and a description.

  2. Click Create to create the deployment.

Now you can run your data app deployment:

  1. Scroll down to the Deployments section, click the three dots icon, and select Run to run your data app deployment.

    06 execute deployment
    Figure 6. Execute data app deployment

Step 5/5 — Share your data app

If you want now you can share your data app with others.

  1. From the deployment section, click the three dots icon, and select Share to open the sharing dialog.

  2. Here you can type the username of the user you want to share your data app deployment with. The users added here will be able to run the data app on KNIME Hub.

    07 share data app
    Figure 7. Share your data app
    In order to run a data app on KNIME Hub shared with them, the user doesn’t need to have a Pro account. However, the execution of the data app will consume execution credits from your Pro account.

All the data apps a user has access to can be found on the Data Apps Portal.

You have now successfully created and deployed your first KNIME Data App.

Now, you can go a step further and adapt the given workflow to your needs and add more interactivity to it by adding Widget nodes and configuring the component layout.

Advanced Data App Features

You can extend the data app you created in the previous section by adding widgets, interactivity, adjust the layout of the page, or add additional components to your workflow.

The following points about the data app are worth noting:

  • Each page of your data app will depict the execution of one component which encapsulates widgets, views, and intermediate nodes

  • You can define the layout of each component

  • Parts of a page that should be updated after a user input are implemented via a Refresh Button Widget node or the Re-execution tab of a Widget node (optional).

Add widgets and interactivity to the data app

You can add widgets to your data app to allow the user to interact with the data.

  1. Open the workflow you created in the previous section in KNIME Analytics Platform from the KNIME Hub space you uploaded it to.

  2. Execute the CSV Reader node to load the data.

  3. Right click the component you created in Step 1 of the previous section and select Component > Open component from the context menu.

  4. For example, I want to analyze sales data over time for a specific country. To do so add a Row Filter node, place it in between the component input port and the Line Plot node, and configure it to show results for a specific country, e.g. "Brazil".

    img row filter node
    Figure 8. Add Row Filter node to filter by country
  5. Click Apply and Execute. Now you will notice that the Line Plot, once executed, only shows data for Brazil.

Now, you might want to give the end-user of the data app the opportunity to explore the data further, like to actively select for which country to show the data.

To do so:

  1. Add a Value Selection Widget node before the Row Filter node.

  2. Connect this node to the Component Input port and configure it to select the column "Country".

    img value selection widget node
    Figure 9. Add Value Selection Widget node to select country
  3. Connect the flow variable port of the widget node to the Row Filter node. Then select the Row Filter node, and configure it. You need to set the flow variables to the ones provided by the Widget node.

    img configure flow variables
    Figure 10. Configure flow variables of Row Filter node
    To know more about how to use flow variables in KNIME, refer to the KNIME Flow Control Guide.
  4. Finally, you can add a Refresh Button Widget node and connect its flow variable port to the Value Selection Widget node. This will add a button in the visualization. The user can then select a country from the dropdown and click the Refresh Button to update the Line Plot.

    img refresh button widget node
    Figure 11. Add Refresh Button Widget node to refresh the plot

Change the Layout of the Data App

If you open the component view of the above example, you will see that the layout of the composite view is not ideal.

To change the layout:

  1. Right-click the component and select Component > Open component from the context menu.

  2. Click the Open layout editor button in the toolbar.

  3. This will open the Visual Layout Editor, that provides a simple drag and drop approach to get a layout of your choice.

  4. You can adjust the layout by defining which Widget and View nodes should be displayed next to or below each other.

    img visual layout editor
    Figure 12. Visual Layout Editor

Update the Data App on KNIME Hub

Now you want to update the data app on KNIME Hub with the changes you made to the workflow.

  1. After you have made changes to your workflow, save the workflow and select Overwrite.

  2. This will create a new draft version of your workflow. From this you need to create a new version.

  3. To do so in KNIME Analytics Platform you can click the dropdown icon next to the workflow name in the tab bar and select Version history.

  4. This will open the version history dialog. Here, click Create version, give the version a name and a description, and click Create.

  5. Now, go to KNIME Hub, open your workflow, go to the deployment section, click the three dots icon, and select Edit to open the edit dialog.

  6. Here, select the new version you just created and click Save changes.

    img edit deployment
    Figure 13. Image showing the edit deployment dialog

Now when you or others who have access to the data app execute the data app, the updated version will be used.

Other examples of data apps

By combining different widgets and views, you can create powerful data apps that allow users to interact with data in various ways.

You can find more examples of data apps on our website: KNIME Data App examples.

Glossary

Component

A component in Data Apps will provide a composite view as a single page in the browser. In general, a component is an isolated block of logical operations in a KNIME Workflow that can be encapsulated inside a component. A component can have its own configuration dialog and can also be assigned a view. Components enable you to bundle functionality for a particular part of the workflow and allow sharing and reusing. For more information refer to KNIME Components Guide. Widget nodes, View nodes, and Refresh Button Widgets are encapsulated together to form a component in KNIME Data Apps.

Composite View

Composite views contain the interactive views of Widget nodes, Interactive Widget nodes, and View nodes, that are encapsulated within a component. All composite views on the root level also define a web application, accessible through the KNIME Hub. In order to inspect the composite view in KNIME Analytics Platform, once the execution is done, right-click the component and select Open view. The layout of the composite view is also customizable. You can edit the appearance of the component’s composite view with the Visual Layout Editor. For more details refer to the Layout of composite views section.

Widget nodes

You can use Widget nodes inside a component to build a composite view that will be visualized as a web page on the KNIME KNIME Hub. The use of Widget nodes is aimed to set specific configurations, e.g to filter a data table by selecting a value from a specific column. On the web page, you will then be able to enter values for specific parameters before proceeding with the workflow execution. These values are injected into the workflow and used to parameterize its execution.

Interactive Widget nodes and View nodes

You can use Interactive Widget nodes and View nodes inside a component to build a composite view that will be visualized as a web page on the KNIME Hub. View nodes are used to build specific visualizations, like tables, charts, and plots, which are displayed as web pages. Interactive Widget nodes can be also used alongside the View nodes in order to interact with the visualizations directly on the web page.

Refresh Button Widget

You can use the Refresh Button Widget node inside a component to build a composite view that will be visualized as an interactively re-executable web page on the KNIME Hub. Button Widget node creates a button visual element to the data application that allows re-execution of specific nodes thus refreshing the desired visualizations. Consequently, enhancing the flexibility of the visual programming.

Re-execution of Widgets

In addition to the functionality of the Refresh Button Widget node, it is also possible to configure some of the Widget nodes (Selection Widget node and Boolean Widget node) so that the change in their value in the composite view upon user interaction will directly trigger re-execution of the component downstream nodes. You can read more about it in the Re-execution of Widgets section.