Icon

01.Game_​Data_​App - Exercise

There has been no title set for this workflow's metadata.

In this exercise you will finalize a Game Data App adding the Page 3-Form and Page 4-Dashboard. You will practice the creation of a component, view customization using CSS, the configuration of the Flow Chart View and the creation of a simple interactive dashboard.

(Optional) Page 4b

Session 3 - Building and Deploying a WebPortal Data App

Exercise 01.Game_Data_App

Learning objective: In this exercise you'll learn how to build and deploy a data app with components, CSS customization, interactivity, and other configurations.


Workflow description: This workflow finishes the implementation of a Game Data App by adding the Page 3-Form, and Page 4-Dashboard. The result is a customized and interactive application that is ready to be deployed as a data app on KNIME Business Hub.


You'll find the instructions to the exercises in the yellow annotations.

Step 7. Validate user input data

You want to check whether the user entered valid data or just left the default entries.

  1. With a Row Filter node, remove the entry if the email address is "example@email.com" (default)

  2. Define a conditional path by adding an Empty Table Switch node.

  3. Connect the first port of the Empty Table Switch node (non-empty table) to Page 4a - the user sees the dashboard

  4. Connect the second port of the Empty Table Switch node (empty table) to Page 4b - the user sees an error message



The first two pages are already configured. Page 1 shows a Welcome page while setting up the game session, and Page 2 let the user play the game (3 iterations)

Step 8. Deployment

Upload this workflow to KNIME Business Hub

  1. Right click the workflow in the Space Explorer and select Upload to Hub.

  2. Make sure to reset the workflow before upload

In the Hub browser UI

  1. Create a new space version of the space containing the workflow

  2. Create a deployment of this workflow as Data app

  3. Execute the Data app from the list of deployments



Page 1
Set up the match
Page 2
Play the game
Page 3
Show match results and collect user feedback
Step 1. Customize the Table View node visualization via CSS.

  1. Add the CSS Editor node

  2. Edit the CSS by adding the code provided below

  3. Connect the CSS Editor node to the Table View node via flow variable connection

  4. Configure the Table View flow variable to use the custom CSS

  5. How did the view change?



/* CSS rules */
.knime-title {
font-size: 30px;
font-weight: bold;
text-align: center;
color: #3d3a39;

}
.knime-table-info {
display: none
}
.knime-table-cell {
text-align: center;
}
.knime-table-header {
background-color: #ffd700;
color: #3d3a39;
}

Step 2. Configure the Data App Flowchart to guide the user through the flow

  1. Search the Data App Flowchart verified component on the KNIME Community Hub and add it to the workflow -> https://kni.me/c/-o_CLuu7-qrfguqE

  2. With a Table Creator node, define the steps of the data app (Welcome, Play, Form, Dashboard) and set page 3 as the active one.

  3. Configure the Data App Flowchart component to use the correct columns.



Step 3. Create the Page 3 - Form component

  1. Select all the nodes and components in the Page 3 orange annotation. Wrap them up into a component. Name it "Page 3".

  2. Connect the Page 3 component to the main flow (Variable Loop End node) via flow variable connection

  3. Open the Page 3 component and rearrange its composite view via the Layout editor.



Page 4a
Show an interactive dashboard with game statistics

Data App Flowchart

Step 4. Set up the widget

You want the user to select whether to display wrong or correct attempts, interactively. Hence,

  1. With a Column Filter node, filter the "Wrong Attempts" and "Correct Attempts" columns

  2. Pass this table to a Column Selection Widget node.

  3. Configure the Column Selection Widget node with the label "Attempts to display" to guide the user during the selection.



Here we read the match results data and prepare it for the visualization. We want to show a choropleth map and let the user select whether it displays the wrong or the correct attempts.

Step 5. Set up the view

  1. Search the Choropleth Map verified component on the KNIME Community Hub and add it to the workflow -> https://kni.me/c/L8IzuxeVxBOw4qDm

  2. Provide the formatted data and configure with a meaningful title.

  3. Set the "color_axis_var" to use the flow variable coming from the Column Selection Widget node



Refresh Button Widget node before the Column Selection Widget node

OR

Enable automatic re-execution on the Column Selection Widget node

PULL FOR THE ANSWER

Step 6. Create Page 4a - Dashboard Component

  1. Select all the nodesand components in Page 4a and wrap them up into a component. Name it "Page 4a".

  2. Rearrange the component composite view with the layout editor.

IMPORTANT: You want the user to update the Choropleth Map view after selecting a new configuration. What is missing to enable the view update?



Table Row To Variable
Page 4b - Error Message
Format Data for Choropleth Map
Table Row To Variable
Show match results
Table View (JavaScript)
Variable Loop End
Data Collection Form
Select image and names columns
Play
Counting Loop Start
read local match_results.csv
Match data
Welcome

Nodes

Extensions

Links