Skip to main content

Usage

The following shows how the step can be used in a recipe.

Examples

  • Signature
General syntax for using the step in a recipe. Shows the inputs and outputs the step is expected to receive and will produce respectively. For futher details see sections below.
create_plot_insight(, {
    "param": value,
    ...
})

Inputs & Outputs

The following are the inputs expected by the step and the outputs it produces. These are generally columns (ds.first_name), datasets (ds or ds[["first_name", "last_name"]]) or models (referenced by name e.g. "churn-clf").

Configuration

The following parameters can be used to configure the behaviour of the step by including them in a json object as the last “input” to the step, i.e. step(..., {"param": "value", ...}) -> (output).

Parameters

  • Area Chart
  • Bar Chart
  • Box Plot Chart
  • Bubble Chart
  • Bubble Colored Chart
  • Grouped Bar Chart
  • Heat Map Chart
  • Line Chart
  • Multiple Line Chart
  • Scatterplot Chart
  • Scatterplot Colored Chart
  • Seasonal Decomposition Chart
  • Segmented Area Chart
  • Segmented Bar Chart
  • Segmented Line Chart
  • Stacked Area Chart
  • Stacked Bar Chart
  • Stacked 100% Area Chart
  • Stacked 100% Bar Chart
  • Table Chart
selectedChart
string
default:"Area Chart"
required
Area Chart. Area Chart.
elements
array[object]
Type and appearance of an insight’s elements. A list in which each item is an object configuring the appearance of a particular insight element.
kind
string
Specify the type of element.Values must be one of the following:TITLE DESCRIPTION CHART GRAPH STATS LEGEND LEGEND_COLOR_SCALE TABLE_CHART
text
string
The text shown for this insight element.
layout
object
The element’s position and size. The position refers to the top-left corner of the rectangle representing the insight element, while the size is given by its width and height. For reference, the entire insight is 12 units wide and 9 units high, and the origin (0, 0) of the x/y coordinates is in its top-left corner.
x
integer
Horizontal position of the element’s top-left corner. In increments of 1; 0 being the left-most and 8 the right-most position.Values must be in the following range:
-1x11
y
integer
Vertical position of the element’s top-left corner. In increments of 1; 0 being the top-most and 11 the bottom-most position.Values must be in the following range:
0y11
w
integer
The width of the element (in increments of 1).Values must be in the following range:
1w12
h
integer
The height of the element (in increments of 1).Values must be in the following range:
1h9
column
string
Name of the column containing the data to be used in this insight element. Required if the element is of type CHART or STATS.
insightThemeMode
string
Theme mode applied to the whole insight.Values must be one of the following:
  • dark
  • light
isAutoMode
boolean
Defines if the cross-filters mode is set to auto.
ignoreNulls
boolean
Defines if the cross-filters and significant variables should ignore null values.
layout
string
Insight default layout.Values must be one of the following:
  • plot
  • all
layoutElements
array[string]
Insight default layout elements.
Item
string
Each item in array.Values must be one of the following:
  • title
  • description
  • filters
relative
boolean
required
Defines if the cross-filters mode is set to relative.
replayDisabled
[string, boolean]
default:"false"
Indicates if the insight can replay its original state or not.Values must be one of the following:
  • drillDown
  • directSelectionInGraph
  • nonPersistedColumn
  • True
  • False
selection
string
A filter query. See Advanced query filters for more information.
title
string
required
Title of the insight.
annotations
array[object]
Comments that can be added to the chart. Any text can be added as annotation at certain abscissa point.
align
string
Alignment of the annotation.Values must be one of the following:
  • start
  • center
  • end
label
string
Text of the comment.
shape
object
Annotations shape. Annotations shape configuration.
type
string
Annotation shape type.Values must be one of the following:
  • arrow
endpoint
string
Annotation endpoint type for arrow shape.Values must be one of the following:
  • line
  • solid
  • none
lineStyle
string
Annotation shape line style.Values must be one of the following:
  • solid
  • dashed
stroke
string
Annotation shape line color.
strokeDash
array[number]
Annotation shape line dash.
Item
number
Each item in array.
strokeWidth
number
Annotation shape line width.
x
number
Annotation shape endpoint position x for arrow shape.
y
number
Annotation shape endpoint position y for arrow shape.
style
object
Annotations style. Annotation label style configuration.
fill
string
Annotation label color.
fontSize
number
Annotation label font size in pixels.
fontStyle
string
Annotation label font style.Values must be one of the following:
  • bold
  • italic
  • normal
x
[object, object, object]
X axis value. X axis value where the annotation is placed.
  • Value annotation placed over a value in the axis
  • Stat value annotation placed over a stat value in the axis
  • Value annotation placed relative to canvas dimensions
kind
string
required
Annotation kind.Values must be one of the following:
  • VALUE
value
[number, string]
required
Annotation value in X axis.
y
[object, object, object, object]
Y axis value. Y axis value where the annotation is placed.
  • Value annotation placed over a value in the axis
  • Stat value annotation placed over a stat value in the axis
  • Stat annotation placed over a calculated stat in the axis
  • Value annotation placed relative to canvas dimensions
kind
string
required
Annotation kind.Values must be one of the following:
  • VALUE
value
[number, string]
required
Annotation value in Y axis.
chartDescription
string
Chart description.
Chart footer text.
chartSize
[string, object]
Chart size. Chart width & height if customized, undefined if in “Fit to screen” mode.
  • string
  • object
{_}
string
string.Values must be one of the following:
  • automatic
chartSubtitle
string
Chart subtitle.
chartTitle
string
Chart title.
discretizationX
[object, object, object]
Discretization configuration for a slot (x, y or color). There is different kind of discretization configurations depending on column type:
  • For quantitative ones a single count defining the number of bins is enough
  • For categorical ones we need the count of categories & its top (DESC) or bottom (ASC) direction
  • For dates we need a date period & a count of periods.
  • object
  • object
  • object
count
number
required
Number of bins in the axis.
discretizationIsExactX
boolean
Defines if the discretization in the X axis uses a exact or pretty number of bins.
discretizationUseQuantilesX
boolean
Defines if the discretization in the X axis uses quantiles.
foregroundColor
string
Chart markers foregroundColor.
hideXTitle
boolean
Hides chart X axis title.
hideYTitle
boolean
Hides chart Y axis title.
interpolation
string
Interpolation method used for line or area chart.Values must be one of the following:linear monotone cardinal natural step step-before step-after
stat
object
Stat configuration. For example, for a max stat it would be: { "stat": "max" } For stats that require a param like “countWhere” or “percentOfRowsWhere” it would be: { "stat": "countWhere", "params": { "value": "categoryName" } }
stat
string
Stat kind.Values must be one of the following:sum mean variance standardDeviation skewness kurtosis min p25 p50 p75 max nNulls precision count cumSum nodeCount rForeground rForegroundColor rForegroundX uniqueValues valueCount countWhere percentOfRowsWhere
params
object
Stat parameters.
value
string
Value for the stat parameter.
theme
string
default:"graphext"
required
Theme applied to the chart.Values must be one of the following:graphext dark excel fivethirtyeight ggplot2 googlecharts latimes powerbi quartz urbaninstitute vox
themeColorPalette
string
Theme color palette applied to the chart.Values must be one of the following:Horus Osiris Re Blues Greens Oranges Purples Reds Viridis Magma Plasma Red-Blue Blue-Orange Red-Grey Red-Yellow-Blue Red-Yellow-Green graphext dark excel fivethirtyeight ggplot2 googlecharts latimes powerbi quartz urbaninstitute vox
themeMode
string
default:"dark"
Theme mode applied to the chart.Values must be one of the following:
  • dark
  • light
tooltip
boolean
Defines if tooltip is enabled.
x
object
required
Slot value represented in the x axis. SlotValues could be of kind column, aggregated column, listIndex, nodeCount or metric.
kind
string
The kind of then slot value.Values must be one of the following:
  • AGGREGATED_COLUMN
  • COLUMN
  • LIST_INDEX
  • NODE_COUNT
  • METRIC
name
string
The name of the slot value. Accepts variables of type category, boolean, number or date, as well as listIndex.
aggregation
string
Aggregation method to apply to the column. Only for values with AGGREGATED_COLUMN kind.Values must be one of the following:SUM AVG VARIANCE STDEV MIN P25 P50 P75 MAX MODE UNIQUE_VALUES LIST LIST_UNIQUE CONCATENATE COUNT ELEMENT_COUNT ELEMENT_MIN ELEMENT_MAX ELEMENT_SUM ELEMENT_AVG ELEMENT_VARIANCE ELEMENT_STDEV
xAxisConfig
object
X Axis config options. Configuration options specific to X axis, including base axis properties and label display controls.
hideGrid
boolean
Whether to hide grid lines in the axe or not.
includeZero
boolean
Whether to include zero in the axe or not.
isLogarithmic
boolean
Whether to use a logarithmic scale.
labelsFormat
string
Axis labels numeric format.
labelsMaxWidth
number
Maximum width in pixels for axis labels before truncating with ellipsis.
labelsMode
string
Axis labels orientation mode. Controls how axis labels are oriented. auto (rotates only when needed), rotate (always rotated), or none (never rotated).Values must be one of the following:
  • auto
  • rotate
  • none
labelsRotation
number
Labels rotation in degrees.
ticks
object
Axis ticks configuration. An object for axis tick configuration.
count
[number, string, object]
Ticks count. Equivalent to Vega axes tickCount prop.
  • number
  • string
  • object
{_}
number
number.
values
array[['string', 'number']]
Ticks values. Equivalent to Vega axes values prop.
Item
[string, number]
Each item in array.
xTitle
string
Chart X axis title.
y
object
required
Slot value represented in the y axis. SlotValues could be of kind column, aggregated column, listIndex, nodeCount or metric.
kind
string
The kind of then slot value.Values must be one of the following:
  • AGGREGATED_COLUMN
  • COLUMN
  • LIST_INDEX
  • NODE_COUNT
  • METRIC
name
string
The name of the slot value. Accepts variables of type category, boolean or number, as well as nodeCount or a metric.
aggregation
string
Aggregation method to apply to the column. Only for values with AGGREGATED_COLUMN kind.Values must be one of the following:SUM AVG VARIANCE STDEV MIN P25 P50 P75 MAX MODE UNIQUE_VALUES LIST LIST_UNIQUE CONCATENATE COUNT ELEMENT_COUNT ELEMENT_MIN ELEMENT_MAX ELEMENT_SUM ELEMENT_AVG ELEMENT_VARIANCE ELEMENT_STDEV
yAxisConfig
object
Y Axis config options. Configuration options specific to Y axis, including base axis properties.
hideGrid
boolean
Whether to hide grid lines in the axe or not.
includeZero
boolean
Whether to include zero in the axe or not.
isLogarithmic
boolean
Whether to use a logarithmic scale.
labelsFormat
string
Axis labels numeric format.
labelsMaxWidth
number
Maximum width in pixels for axis labels before truncating with ellipsis.
ticks
object
Axis ticks configuration. An object for axis tick configuration.
count
[number, string, object]
Ticks count. Equivalent to Vega axes tickCount prop.
  • number
  • string
  • object
{_}
number
number.
values
array[['string', 'number']]
Ticks values. Equivalent to Vega axes values prop.
Item
[string, number]
Each item in array.
yTitle
string
Chart Y axis title.
zoomX
[array, array]
Selection applied to chart in the x axis. The chart will be zoom in over this selection.
  • array
  • array
{_}
array[number]
array.
Item
number
Each item in array.
zoomY
[array, array]
Selection applied to chart in the y axis. The chart will be zoom in over this selection.
  • array
  • array
{_}
array[number]
array.
Item
number
Each item in array.
I