Skip to main content

Usage

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

Examples

  • Example 1
  • Signature
For a weighted layout provide both input columns, e.g.
layout_network(ds.link_targets, ds.link_weights, {scalingRatio: 0.8, linLogMode: false}) -> (ds.x, ds.y)

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").
targets
column[list[number]]
required
A column containing link targets. Source is implied in the index.
*weights
column[list[number]]
x
column
required
A column containing the x coordinate of each node’s position in the network.
y
column
required
A column containing the y coordinate of each node’s position in the network.

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

gravity
number
default:"0.05"
Attracts nodes to the center. Prevents islands from drifting away.
  • 0.05
scalingRatio
number
default:"0.8"
The amount of repulsion. Greater values lead to a larger and more sparse graph.
  • 0.8
barnesHutTheta
number
default:"1.0"
Algorithmic “resolution”. Greater values lead to faster execution at the expense of less precise calculations.Values must be in the following range:
0.0barnesHutTheta2.0
avoidHubs
boolean
default:"false"
Prefer authorities over hubs. Prefer “authorities” (nodes with a high indegree) over hubs (nodes with a high outdegree). Authorities will have more central and hubs more peripheral positions. (default=false).
  • False
linLogMode
boolean
default:"false"
Usually produces tighter clusters. Enabling it may also require adjusting the scalingRatio.
  • False
avoidOverlap
boolean
default:"false"
Try to avoid overlap between nodes.
  • False
iterations
integer
default:"500"
The more the better, though it will take longer.
  • 300
nodeSize
number
default:"1.0"
How much space to (try and) give each node in the final layout.Values must be in the following range:
1.0nodeSize < inf
ignoreWeightsBelow
number
default:"0.0"
Links with weights below this value will be ignored.Values must be in the following range:
0.0ignoreWeightsBelow < inf
normalizeWeights
boolean
default:"false"
Normalize weights to the range [0, 1].
I