Skip to main content

Visualize output data

import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; import BrowserWindow from '@site/src/components/browser-window';

Add viewers for dataframe

You can specify viewers to review output dataframes in a human-friendly way. Each dataframe parameter may have a list of viewers.

To see all available viewers, open the demo dataframe and expand the toolbox on the left.

Fantastic viewers and where to find them

fantastic viewers

The following code adds Scatter plot and Line chart viewers on the input dataframe.

builtin-viewers

#name: Adding viewer on output dataframe
#language: python
#sample: demog.csv
#input: dataframe inputDF
#output: dataframe outputDF { viewer: Line chart | Scatter plot }

outputDF = inputDF.copy()
tip

The default script view supports viewers for output dataframes only. You can specify viewers for input dataframes using advanced UI editor

Customize viewers for dataframe

Each viewer has a list of customizable properties. They control how the viewer is rendered and how it behaves. For instance, you can specify the dataframe column used as the X-axis on the scatter plot.

The list of available properties differs for each type of viewer. Right-click the viewer and select Properties in the context menu. In the viewer tag, you can specify any property listed in the opened property panel.

only camelCase is accepted

You should enter the viewer property in camelCase format. For example, here "Show regression line" property of the scatterplot becomes showRegressionLine.

For example, the following code:

  • specifies marker type and size for linechart
  • enables regression line rendering for scatterplot

viewers-customization

#name: Viewers customization
#language: python
#sample: cars.csv
#input: dataframe inputDF
#output: dataframe outputDF { viewer: Scatter plot(y: "model", markerType: star, markerSize: 15) | Scatter plot(showRegressionLine: true) }

outputDF = inputDF.copy()
More customization

The default script view shows all viewers at once. You can divide viewers into separate tabs using advanced UI editor.