intrepidshape/elm-web3-ui/4.0.0

Web3.Ui.ProgressRing

Circular progress ring (SVG) for "X% toward Y" displays -- graduation progress, vesting unlock, vault deposit cap. The circular variant of Web3.Ui.SupplyBar.

Web3.Ui.ProgressRing.view []
    { current = curve.curvePls
    , target = graduationThreshold
    , size = 64
    , label = Just "graduation"
    }

current / target is divided in BigInt space and the arc geometry is carried as hundredths of a pixel, so nothing is routed through Float.

CSS classes: web3-progressring, web3-progressring__track, web3-progressring__fill, web3-progressring__label. Stroke width and color come from CSS -- set stroke and stroke-width on the __track and __fill elements; geometry is inline for SVG.

view : List (Attribute msg) -> Config -> Html msg

Render the ring.

type alias Config =
{ current : BigInt
, target : BigInt
, size : Int
, label : Maybe String
}

Progress toward a target, the ring's pixel size, and an optional label rendered inside it (also used as the accessible name).