Module

Sigil.Hats

Package
purescript-sigil-hats
Repository
afcondon/purescript-sigil-hats

Bridge from Sigil LayoutNode trees to HATS Tree values.

Uses toSvgPrimitive from Sigil.Svg.Attrs so that the HATS path produces identical SVG attributes to the DOM FFI emit path.

#toTree Source

toTree :: LayoutNode -> Tree

Convert a LayoutNode to a HATS Tree, using the shared attribute mapping.

#renderClassDeclSvg Source

renderClassDeclSvg :: { methods :: Array { ast :: Maybe RenderType, name :: String }, name :: String, superclasses :: Array SuperclassInfo, typeParams :: Array String } -> Tree

Render a type class definition as a HATS Tree.

#renderSignatureSvg Source

renderSignatureSvg :: { ast :: RenderType, className :: Maybe String, name :: String, sig :: String, typeParams :: Array String } -> Tree

Render a value/type-synonym signature as a HATS Tree.

#renderAdtSvg Source

renderAdtSvg :: { constructors :: Array { args :: Array RenderType, name :: String }, keyword :: Maybe String, name :: String, typeParams :: Array String } -> Tree

Render an ADT (data type with constructor branches) as a HATS Tree.

#renderSigletSvg Source

renderSigletSvg :: { ast :: RenderType, maxHeight :: Number, maxWidth :: Number } -> Maybe Tree

Render a siglet (elided miniature type signature) as a HATS Tree. Returns Nothing if the type can't fit in the given dimensions.

Modules
Sigil.Hats