跳到正文

第 14 课 · Visualization

Interactive Dashboards and Data Apps in KNIME

Combine KNIME view and widget nodes inside a component to build interactive dashboards, arrange them with the layout editor, and understand data apps.

A single chart answers one question. A dashboard lets someone ask several: pick a region, see the numbers change, and drill into the rows. In KNIME you build this by putting views and input controls inside a component. This lesson shows the idea and the design habits that make dashboards useful.

The building blocks

  • View nodes draw charts and tables, as in charts and views.
  • Widget nodes are on-screen controls such as selection lists, sliders, text inputs, file upload, and download buttons.
  • A component packages several nodes into one. When it contains views or widgets, it can show them together as a composite view.
flowchart LR
  A["Data table"] --> B["Value selection widget"]
  B --> C["Row Filter"]
  C --> D["Bar Chart"]
  C --> E["Table View"]

Inside one component, a widget chooses a value and the views show the filtered rows.

Build one step by step

  1. Prepare the data outside the component: cleaned and, if possible, aggregated.
  2. Add a widget such as a Value Selection Widget and the filter and view nodes that should react.
  3. Connect the widget's flow variable output to the filter setting it should control.
  4. Select the nodes and create a component (the Ctrl+J shortcut also works).
  5. Execute the component, then open its view from the right-click menu.

In the composite view you can change a widget value and apply it to see the result for the current execution.

Do not confuse widget nodes with configuration nodes. Widgets appear in the composite view. Configuration nodes build the component's settings dialog. See components and metanodes for the full picture.

Arrange the layout

Components have a layout editor that places items on a drag-and-drop grid, with up to 12 columns in a row. A common layout looks like this:

Row Content (width out of 12)
1 Title text (12)
2 Region selector (4), date selector (4), spare (4)
3 Bar chart (6), line plot (6)
4 Detail table (12)

An advanced editor also lets you write the layout as structured text, but most people never need it.

Python Stand-in: check that each layout row fits in 12 columns

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Interaction between views

Many KNIME views can share selections, so selecting points in one view highlights the same rows in others. This depends on the views using the same underlying rows and on their settings. Test the exact interaction you plan, and do not assume it works between every pair of views.

Widgets that filter data change what downstream views show. Some widgets can also trigger re-execution when their value changes. Heavy steps inside the component make every change slow, so keep the expensive preparation outside.

Python Stand-in: a selection that changes the summary

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The stand-in shows a clear message for an empty selection. Your real dashboard should too: an empty chart with no explanation looks broken.

Data apps

When a component with a composite view runs on KNIME Hub, other people can use it in a web browser as a data app, without installing KNIME. Deploying needs a Hub plan that supports it, and a saved version of the workflow. Features differ between plans, so check the current Hub documentation. The sharing and deployment lesson explains more.

Design habits

  • One purpose per page. Name the question it answers in the title.
  • Most important first, at the top left.
  • Sensible defaults so the page shows something immediately.
  • State the data date, so users know how fresh it is.
  • Show filters that are active.

A data app shows data to whoever can open it. Anything in a table view, a download button, or hidden columns passed into a view may be reachable. Remove columns the audience should not see before they enter the dashboard, and review access permissions.

Plan before you build

Sketch the page on paper first. Write the audience, the questions they ask, and the action they take after reading. A manager who checks revenue once a week needs a few large numbers and a trend, while an analyst needs filters and a detailed table. One page rarely serves both well. If you find yourself adding a tenth control, split the page.

Planning question Example answer
Who is it for? Regional sales leads
What do they decide? Which region needs help this month
How often is it used? Weekly
What must be visible at once? Total, trend, ranking

Test the controls

Try each control at its extremes. Select nothing, select everything, pick a value with no data, and choose the earliest and latest dates. Confirm that the numbers shown in different views agree with each other. If a total and a table disagree, users stop trusting both. Also try the page in a smaller window, since a layout that looks neat on a wide monitor may become cramped on a laptop.

Write a short description near the top that says what is included, what is excluded, and when the data was last prepared. This one paragraph prevents a large share of questions.

Practice task

Build a component with a region selector, a bar chart of revenue by month, and a table of orders for the selected region. Give a colleague the page without explaining it, ask them to find the best month for one region, and watch where they hesitate. Their confusion is your list of improvements.

Check your understanding

Quick check · 3 questions

of 3 answered You scored / 3 · perfect!

  1. 1. Which node type provides on-screen controls in a composite view?

    Widgets appear in the composite view; configuration nodes build the dialog.
  2. 2. How wide can a layout row be in the layout editor?

    The grid has up to 12 columns per row.
  3. 3. How can you keep a dashboard responsive?

    Only light steps should repeat when the user interacts.

Summary

  • Views and widgets inside a component form a composite view.
  • Arrange items on a 12-column grid with the layout editor.
  • Handle empty selections and keep heavy work outside the component.
  • Data apps on KNIME Hub let others use the page in a browser.
  • Remove sensitive columns and control access.

Next: Machine Learning Basics and Data Splitting

你的学习进度保存在此浏览器中,无需账号。