This function takes a dendrogram class object and other attributes to calcuate the size of gaps between leaves. The gap is stored in a leaf to its left. The function is called recursively.
calculate_gap(
d,
sum,
gap_total,
mode = c("quantitative", "threshold"),
mapping = c("exponential", "linear"),
scale = 0.2,
max_height = 0,
threshold = 2,
gap_size = 0,
verbose = FALSE,
...
)
the annotated dendrogram class object
dendrogram class object
the sum of distance
the total width allocated for gaps
gap mode, either "threshold" or "quantitative"
in case of quantitative mode, either "linear" or "exponential" mapping
the sclae log base for the exponential mapping
the highest distance value, which is the value of the first dendrogram branch
the threshold value for threshold mode
the size of gap for threshold mode
logical for whether in verbose mode or not
ignored