packages feed

layoutz-1.0.0.0: examples/SizingMini.hs

{-# LANGUAGE OverloadedStrings #-}
module Main where

import Layoutz

main :: IO ()
main = runApp $ sandbox () (\_ m -> m) $ \_ ->
  row
    [ box "nav" ["home", "logs", "plots"] & fixedWidth 12
    , box "wave" [sized wave & fill] & fill
    ] & fill
  where
    wave w h = plotLine (w - 6) (h - 4) [Series points "sin" ColorCyan]
      where points = [(x, sin x) | x <- [0, 0.05 .. fromIntegral w / 3]]