intrepidshape/elm-web3-ui/2.1.2

NOTE: the latest version is 4.0.0

Web3.Ui.VeBalanceChart

SVG line chart of vote-escrow balance decaying linearly from nowSec to unlockTime. Educational primitive — shows the user how their vote weight will fade as the lock matures.

Linear-decay model (Curve / Aerodrome standard):

veBalance(t) = amount * max(0, unlockTime - t) / maxLockSec

At t = nowSec the line starts at the current ve-balance; at t = unlockTime it hits zero and stays there. The chart samples sampleCount points across that span and connects them with a polyline. Math runs on Float because the chart is purely visual — do not consume rendered points for on-chain calculation.

Web3.Ui.VeBalanceChart.view
    { amount = lock.amount
    , unlockTime = lock.unlockTime
    , maxLockSec = fourYears
    , nowSec = model.nowSec
    , width = 320
    , height = 80
    }

CSS classes: web3-vebalancechart, web3-vebalancechart__path, web3-vebalancechart__current, web3-vebalancechart__axis. Stroke and fill colors come from the consumer stylesheet.

{ amount : BigInt
, unlockTime : Int
, maxLockSec : Int
, nowSec : Int
, width : Int
, height : Int
}
-> Html msg

Render the decay chart.