Module

Chartjs.Halogen

Package
purescript-chartjs-halogen
Repository
philippedev101/purescript-chartjs-halogen

Halogen component that manages a Chart.js canvas lifecycle.

Wraps purescript-chartjs FFI bindings in a Halogen component with:

  • Automatic create/update/destroy on mount/receive/unmount
  • updateMode support to suppress animation on data updates
  • Query interface for all Chart.js instance methods
  • ChartReady output when the instance is available

#component Source

component :: forall m. MonadAff m => Component Query ComponentInput Output m

Halogen component that renders and manages a Chart.js chart.

Input: ComponentInput from Chartjs.Callbacks (config + callbacks + updateMode). Use simpleInput for the common case (no callbacks, animation suppressed on updates).

Queries: All Chart.js instance methods are available via the Query type. Use H.request for methods that return values, H.tell for side-effect-only methods.

Output: ChartReady inst when the chart is created (for consumers who need the raw instance), ChartError msg on create/update/query failures.

#Output Source

data Output

Output messages emitted by the chart component.

Constructors