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
updateModesupport to suppress animation on data updates- Query interface for all Chart.js instance methods
ChartReadyoutput when the instance is available
#component Source
component :: forall m. MonadAff m => Component Query ComponentInput Output mHalogen 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.
#Query Source
data Query aQueries for interacting with the chart instance.
Use H.request for queries that return a value, H.tell for fire-and-forget.
Constructors
ToBase64Image (Maybe String) (Maybe Number) (String -> a)StopChart aResetChart aRenderChart aClearChart aResizeChart (Maybe Number) (Maybe Number) aSetDatasetVisibility Int Boolean aIsDatasetVisible Int (Boolean -> a)HideDataset Int (Maybe Int) aShowDataset Int (Maybe Int) aToggleDataVisibility Int aGetDataVisibility Int (Boolean -> a)GetActiveElements (Array Foreign -> a)SetActiveElements (Array { datasetIndex :: Int, index :: Int }) aGetDatasetMeta Int (Foreign -> a)GetElementsAtEventForMode Event InteractionMode InteractionOptions Boolean (Array InteractionItem -> a)GetVisibleDatasetCount (Int -> a)GetSortedVisibleDatasetMetas (Array Foreign -> a)IsPluginEnabled String (Boolean -> a)IsPointInArea { x :: Number, y :: Number } (Boolean -> a)GetChartContext (Foreign -> a)NotifyPlugins String Foreign (Boolean -> a)GetInstance (Maybe ChartInstance -> a)
- Modules
- Chartjs.
Halogen