Module

Hylograph.Components.Frame

Package
purescript-hylograph-components
Repository
afcondon/purescript-hylograph-components

Generic Halogen wrapper for any pure input -> Tree chart renderer.

Every preset in this library uses the same pattern — an empty <div> with a caller-supplied id, an Initialize effect that calls HATS rerender into that container, and a Receive hook that reruns the render when input changes. mkFrame captures all of that once; each chart module just says frame = mkFrame <its-render-fn>.

The generic parameter is the renderer's own Input type — there is no constraint on its shape. BarChart, ScatterPlot, LinePlot, PieChart all flow through the same component with their respective Input types threaded through.

#FrameInput Source

type FrameInput input = { chart :: input, containerId :: String }

#mkFrame Source

mkFrame :: forall query output input m. MonadAff m => (input -> Tree) -> Component query (FrameInput input) output m