granite-0.7.4.0: Easy terminal plotting.
Copyright(c) 2025
LicenseMIT
Maintainermschavinda@gmail.com
Safe HaskellNone
LanguageGHC2021

Granite.Flame

Description

Differential flame/icicle graphs. A FlameNode tree carries, per frame, the summed positive delta (fnPos, an increase) and the magnitude of the summed negative delta (fnNeg, a decrease, kept non-negative). flameDiff lays the tree out top→down by depth and emits a standalone <svg> document.

A frame's width is its churn (fnPos + fnNeg) relative to the root churn. Within a frame a red part (the increase) and a blue part (the decrease) are drawn side by side, so a relocation — equal +x/-x — reads as half-red/ half-blue rather than as a net regression.

Synopsis

Documentation

data FlameNode Source #

Constructors

FlameNode 

Fields

  • fnLabel :: Text

    Frame name.

  • fnPos :: Double

    Summed positive self-delta in this subtree (an increase), in bytes (tooltips format it as MB).

  • fnNeg :: Double

    Summed negative magnitude in this subtree (a decrease, >= 0), in bytes (tooltips format it as MB).

  • fnChildren :: [FlameNode]
     

Instances

Instances details
Show FlameNode Source # 
Instance details

Defined in Granite.Flame

Eq FlameNode Source # 
Instance details

Defined in Granite.Flame

data FlameOpts Source #

Constructors

FlameOpts 

Fields

Instances

Instances details
Show FlameOpts Source # 
Instance details

Defined in Granite.Flame

Eq FlameOpts Source # 
Instance details

Defined in Granite.Flame

flameDiff :: FlameNode -> FlameOpts -> Text Source #

Render a differential flame graph as a full standalone <svg> document. Rows go top→down by depth; a frame's width is proportional to its churn over the root churn; children are laid left→right sorted by descending churn; frames narrower than foMinPx are dropped and recursion stops past foMaxDepth.