Chartjs
- Package
- purescript-chartjs
- Repository
- philippedev101/purescript-chartjs
Re-exports all core Chart.js modules (types, config, FFI, callbacks, colors).
Re-exports from Chartjs.Callbacks
#TooltipItem Source
data TooltipItemOpaque type for a Chart.js tooltip item in tooltip callbacks.
#TooltipCallbacks Source
type TooltipCallbacks = { footer :: Maybe (EffectFn1 (Array TooltipItem) String), label :: Maybe (EffectFn1 TooltipItem String), title :: Maybe (EffectFn1 (Array TooltipItem) String) }Tooltip formatting callbacks for label, title, and footer.
#LegendItem Source
data LegendItemOpaque type for a Chart.js legend item in legend callbacks.
#ComponentInput Source
type ComponentInput = { callbacks :: Callbacks, config :: ChartConfig }Input for the Halogen chart component: a config and optional callbacks.
#Callbacks Source
type Callbacks = { legendOnClick :: Maybe (EffectFn3 Event LegendItem Legend Unit), legendOnHover :: Maybe (EffectFn3 Event LegendItem Legend Unit), legendOnLeave :: Maybe (EffectFn3 Event LegendItem Legend Unit), onClick :: Maybe (EffectFn3 Event (Array ActiveElement) ChartInstance Unit), onHover :: Maybe (EffectFn3 Event (Array ActiveElement) ChartInstance Unit), onResize :: Maybe (EffectFn2 ChartInstance { height :: Number, width :: Number } Unit), tickCallbacks :: Maybe (Object TickCallback), tooltipCallbacks :: Maybe TooltipCallbacks }Chart.js event callbacks (click, hover, resize, legend, tooltip, ticks).
#ActiveElement Source
data ActiveElementOpaque type for a Chart.js active element in event callbacks.
#simpleInput Source
simpleInput :: ChartConfig -> ComponentInputCreate a ComponentInput from just a ChartConfig (no callbacks).
#hasOverlays Source
hasOverlays :: Callbacks -> ChartConfig -> BooleanCheck if there are any overlays that need to be merged (callbacks or non-CSS colors).
#hasCallbacks Source
hasCallbacks :: Callbacks -> BooleanCheck if any callbacks are set.
#defaultTooltipCallbacks Source
defaultTooltipCallbacks :: TooltipCallbacksAll optional fields set to Nothing.
#defaultCallbacks Source
defaultCallbacks :: CallbacksAll optional fields set to Nothing.
#callbacksToForeign Source
callbacksToForeign :: Callbacks -> ForeignConvert Callbacks to a plain JS object for the FFI merge function.
#buildOverlays Source
buildOverlays :: Callbacks -> ChartConfig -> ForeignBuild a combined overlays object with callbacks and dataset color overlays.
Re-exports from Chartjs.Colors
#indexableColorToForeign Source
indexableColorToForeign :: Indexable Color -> ForeignConvert an Indexable Color to Foreign.
#createRadialGradient Source
createRadialGradient :: HTMLCanvasElement -> { r0 :: Number, r1 :: Number, x0 :: Number, x1 :: Number, y0 :: Number, y1 :: Number } -> Array ColorStop -> Effect CanvasGradientCreate a radial gradient on a canvas.
#createPattern Source
createPattern :: HTMLCanvasElement -> Foreign -> String -> Effect CanvasPatternCreate a pattern on a canvas from an image element.
#createLinearGradient Source
createLinearGradient :: HTMLCanvasElement -> { x0 :: Number, x1 :: Number, y0 :: Number, y1 :: Number } -> Array ColorStop -> Effect CanvasGradientCreate a linear gradient on a canvas.
#colorToForeign Source
colorToForeign :: Color -> ForeignConvert a Color to a Foreign value for direct JS use.
Re-exports from Chartjs.Config
#toChartJsConfig Source
toChartJsConfig :: ChartConfig -> JsonConvert a ChartConfig to the JSON structure Chart.js expects.
Re-exports from Chartjs.FFI
#ChartInstance Source
data ChartInstanceOpaque handle to a Chart.js instance.
#updateChartWithCallbacks Source
updateChartWithCallbacks :: ChartInstance -> Json -> Foreign -> Effect UnitUpdate a chart with a new JSON config and a callbacks/overlays object.
#updateChart Source
updateChart :: ChartInstance -> Json -> Effect UnitUpdate an existing chart with a new JSON config.
#destroyChart Source
destroyChart :: ChartInstance -> Effect UnitDestroy a chart instance and release its resources.
#createChartWithCallbacks Source
createChartWithCallbacks :: HTMLElement -> Json -> Foreign -> Effect ChartInstanceCreate a chart with a JSON config and a callbacks/overlays object.
#createChart Source
createChart :: HTMLElement -> Json -> Effect ChartInstanceCreate a new Chart.js instance on a canvas element with a JSON config.
Re-exports from Chartjs.Types
#ParsingConfig Source
type ParsingConfig = { xAxisKey :: Maybe String, yAxisKey :: Maybe String }Custom parsing keys for mapping data object properties to axes.
#Dataset Source
type Dataset = { backgroundColor :: Maybe (Indexable Color), barPercentage :: Maybe Number, barThickness :: Maybe Number, base :: Maybe (Indexable Number), borderAlign :: Maybe (Indexable BorderAlign), borderCapStyle :: Maybe CapStyle, borderColor :: Maybe (Indexable Color), borderDash :: Maybe (Array Number), borderDashOffset :: Maybe Number, borderJoinStyle :: Maybe (Indexable JoinStyle), borderRadius :: Maybe (Indexable Number), borderSkipped :: Maybe (Indexable BorderSkipped), borderWidth :: Maybe (Indexable Number), categoryPercentage :: Maybe Number, circular :: Maybe (Indexable Boolean), circumference :: Maybe Number, clip :: Maybe Number, cubicInterpolationMode :: Maybe CubicInterpolationMode, data :: Array DataPoint, drawActiveElementsOnTop :: Maybe (Indexable Boolean), fill :: Maybe Fill, grouped :: Maybe Boolean, hidden :: Maybe Boolean, hitRadius :: Maybe (Indexable Number), hoverBackgroundColor :: Maybe (Indexable Color), hoverBorderCapStyle :: Maybe CapStyle, hoverBorderColor :: Maybe (Indexable Color), hoverBorderDash :: Maybe (Array Number), hoverBorderDashOffset :: Maybe Number, hoverBorderJoinStyle :: Maybe (Indexable JoinStyle), hoverBorderRadius :: Maybe (Indexable Number), hoverBorderWidth :: Maybe (Indexable Number), hoverOffset :: Maybe (Indexable Number), hoverRadius :: Maybe (Indexable Number), indexAxis :: Maybe Axis, inflateAmount :: Maybe (Indexable Number), label :: String, maxBarThickness :: Maybe Number, minBarLength :: Maybe Number, offset :: Maybe (Indexable Number), order :: Maybe Int, parsing :: Maybe ParsingConfig, pointBackgroundColor :: Maybe (Indexable Color), pointBorderColor :: Maybe (Indexable Color), pointBorderWidth :: Maybe (Indexable Number), pointHitRadius :: Maybe (Indexable Number), pointHoverBackgroundColor :: Maybe (Indexable Color), pointHoverBorderColor :: Maybe (Indexable Color), pointHoverBorderWidth :: Maybe (Indexable Number), pointHoverRadius :: Maybe (Indexable Number), pointRadius :: Maybe (Indexable Number), pointRotation :: Maybe (Indexable Number), pointStyle :: Maybe (Indexable PointStyle), radius :: Maybe (Indexable Number), rotation :: Maybe (Indexable Number), showLine :: Maybe Boolean, skipNull :: Maybe Boolean, spacing :: Maybe Number, spanGaps :: Maybe Boolean, stack :: Maybe String, stepped :: Maybe Stepped, tension :: Maybe Number, weight :: Maybe Number, xAxisID :: Maybe String, yAxisID :: Maybe String }Unified dataset configuration covering all Chart.js chart types.
#Color Source
data ColorA color value that Chart.js accepts: CSS string, gradient, or pattern.
Constructors
Instances
#ChartOptions Source
type ChartOptions = { animation :: Maybe AnimationSetting, aspectRatio :: Maybe Number, circumference :: Maybe Number, cutout :: Maybe String, devicePixelRatio :: Maybe Number, elements :: Maybe ElementsConfig, indexAxis :: Maybe Axis, interaction :: Maybe InteractionConfig, layout :: Maybe LayoutConfig, locale :: Maybe String, maintainAspectRatio :: Maybe Boolean, plugins :: Maybe PluginsConfig, resizeDelay :: Maybe Number, responsive :: Maybe Boolean, rotation :: Maybe Number, scales :: Maybe (Object ScaleConfig) }Top-level chart options.
#ChartConfig Source
type ChartConfig = { chartType :: ChartType, datasets :: Array Dataset, labels :: Array String, options :: ChartOptions }Complete chart configuration: type, data, and options.
#CanvasPattern Source
data CanvasPatternOpaque type for a CanvasPattern object (from canvas 2D context).
#CanvasGradient Source
data CanvasGradientOpaque type for a CanvasGradient object (from canvas 2D context).
#defaultParsingConfig Source
defaultParsingConfig :: ParsingConfigAll optional fields set to Nothing.
#defaultOptions Source
defaultOptions :: ChartOptionsAll optional fields set to Nothing.
#defaultDataset Source
defaultDataset :: DatasetDefault dataset with empty label and data. All optional fields set to Nothing.
#defaultConfig Source
defaultConfig :: ChartConfigDefault chart config with Bar type, empty labels, and empty datasets.
#chartTypeToString Source
chartTypeToString :: ChartType -> StringConvert to the Chart.js string representation.