sankeyTitleHeight function

double sankeyTitleHeight({
  1. String? chartTitle,
  2. double? titleFontSize,
})

Height the chart reserves above the plot for its title.

Ports SankeyChart.tsx:554-560: a title costs its font size plus CHART_TITLE_PADDING, floored at 36; no title still reserves 36.

Implementation

double sankeyTitleHeight({String? chartTitle, double? titleFontSize}) =>
    chartTitle != null
    // 13 is upstream's fallback title size (`SankeyChart.tsx:556`).
    ? math.max(
        (titleFontSize ?? 13) + kChartTitlePadding,
        kSankeyMinTitleHeight,
      )
    : kSankeyMinTitleHeight;