Create node layout using a bottom-up approach (literally) and overwrites ggparty-precomputed positions in plot_data.

position_nodes(plot_data, terminal_data, custom_layout, lev_fac, panel_space)

Arguments

plot_data

Dataframe output of `ggparty:::get_plot_data()`.

terminal_data

Dataframe of terminal node information including id and raw terminal node size.

custom_layout

Dataframe with 3 columns: id, x and y for manually input custom layout.

lev_fac

Relative weight of child node positions according to their levels, commonly ranges from 1 to 1.5. 1 for parent node perfectly in the middle of child nodes.

panel_space

Spacing between facets relative to viewport, recommended to range from 0.001 to 0.01.

Value

Dataframe with 3 columns: id, x and y of smart layout combined with custom_layout.