JavaScript Editor

Executes JavaScript code to generate a view. The code in the script editor is executed when displayed in the view (right-click -> Interactive View) or in the KNIME server web portal.

Within the java script code block you have access to the input table and can use a set of predefined libraries to generate the view.

Note, this node is currently under development. Future versions of the node will have more functionality, including the ability to define and use templates and to generate a static view/image output.


Flow Variables

The list contains the flow variables that are currently available at the node input. Double clicking any of the entries will insert the respective identifier at the current cursor position in the JavaScript editor.


Choose from the list of available JavaScript library dependencies. Any entries selected here are available at runtime of the view. Note that this list will be expanded in the future.


Enter optional CSS instructions for styling the view.


Change the standard font used for rendering for the whole document:

html, body {font-family: sans-serif;}

Enter the JavaScript code to be executed. All HTML elements have to be created in the JavaScript and appended to the <body> element.

If data is available at the input port, a JavaScript object knimeDataTable is automatically created and populated.
The methods available on this object are:

  • knimeDataTable.getNumRows(); Retrieve the amount of rows contained in the table.
  • knimeDataTable.getNumColumns(); Retrieve the amount of columns contained in the table.
  • knimeDataTable.getColumnNames(); Retrieve the column names in a string array.
  • knimeDataTable.getColumnTypes(); Retrieve the converted JavaScript column types in a string array. These can be Boolean, Number, String, SVG, PNG or Undefined.
  • knimeDataTable.getPossibleValues(); Retrieve an array with possible values from the data table spec.
  • knimeDataTable.getRowColors(); Retrieve a string array with CSS-style color information for each row.
  • knimeDataTable.getRows(); Retrieve an array comprising all rows of the data table.
  • knimeDataTable.getColumn(columnID); Retrieve an array of all values contained in the column with the given ID. Note that this operation can be computationally expensive as data is stored per row and has to be converted.


Loop over all values contained in the table object and process only number types:

var rows = knimeDataTable.getRows();
for (var rowID = 0; rowID < knimeDataTable.getNumRows(); rowID++) {
    var row = rows[rowID];
    for (var colID = 0; colID < knimeDataTable.getNumColumns(); colID++) {
        if (knimeDataTable.getColumnTypes()[colID] === 'number') {
            var value =[colID];
            // process value

Input Ports

No description for this port available.

Output Ports

No description for this port available.

Popular Predecessors

Popular Successors

  • No recommendations found


Interactive View: Javascript editor


  • No workflows found



You want to see the source code for this node? Click the following button and we’ll use our super-powers to find it for you.