module Hyper.Extra (
    -- * Synopsis
    -- | Visual representation for various data types.

    -- * Diagrams
    dia,
    ) where

import Hyper

import qualified Data.Text        as T
import qualified Data.Text.Lazy   as TL

import Diagrams.Prelude
import Diagrams.Backend.SVG
import Graphics.Svg               as SVG

{-----------------------------------------------------------------------------
    Integration of the `diagrams-svg` and `svg-builder` packages
------------------------------------------------------------------------------}
dia :: QDiagram SVG V2 Double Any -> Graphic
dia = html . TL.toStrict . SVG.renderText
    . renderDia SVG (SVGOptions (mkWidth 250) Nothing (T.pack "") [] True)