Module

Chartjs.Types

Package
purescript-chartjs
Repository
philippedev101/purescript-chartjs

PureScript types, enums, and default constructors for Chart.js configuration.

#ChartType Source

data ChartType

Supported Chart.js chart types. The 8 named constructors cover all built-in types; CustomType is an escape hatch for chart types registered at runtime via Chart.register(MyController), where MyController is a controller class (not a plugin) that defines a new id such as "financial", "candlestick", or a custom doughnut variant. The wrapped string in CustomType must match the controller's id field so Chart.js can look it up at draw time. Pairs naturally with roadmap item #25's registration FFI bindings, but useful standalone for any consumer who has registered a controller via raw JS.

Constructors

Instances

#chartTypeToString Source

chartTypeToString :: ChartType -> String

Convert to the Chart.js string representation. CustomType passes the wrapped string through unchanged — Chart.js looks up the corresponding registered controller at runtime.

#Position Source

data Position

Element position within the chart.

Constructors

Instances

#positionToString Source

positionToString :: Position -> String

Convert to the Chart.js string representation.

#TextAlign Source

data TextAlign

Text alignment options.

Constructors

Instances

#textAlignToString Source

textAlignToString :: TextAlign -> String

Convert to the Chart.js string representation.

#Axis Source

data Axis

Chart axis identifier.

Constructors

Instances

#axisToString Source

axisToString :: Axis -> String

Convert to the Chart.js string representation.

#PointStyle Source

data PointStyle

Point marker styles. PSFalse disables the marker. PSImage wraps an HTMLImageElement or HTMLCanvasElement for image-based point styles — the referenced element's natural width / height determine the drawn size at render time (the pointRadius field does not apply).

Image point styles cannot be JSON-serialized and go through the overlay mechanism in Chartjs.Colors / Chartjs.Callbacks — you must create the chart via createChartWithCallbacks (or anything that builds overlays) for a PSImage dataset pointStyle to render. Ensure the wrapped image has finished loading before the chart is created; Chart.js reads width/height at draw time and draws nothing if they are zero.

Note: PSImage is currently supported only on Dataset.pointStyle. Setting it on options-level fields (legend, element defaults) silently produces a null in the JSON config with no overlay replacement.

Constructors

Instances

#pointStyleToString Source

pointStyleToString :: PointStyle -> String

Convert to the Chart.js string representation. Returns "" for PSImage, which has no string form — use pointStyleToJson and the overlay path for serialization.

#BorderSkipped Source

data BorderSkipped

Which border to skip on bar elements. BSFalse draws all borders.

Constructors

Instances

#borderSkippedToString Source

borderSkippedToString :: BorderSkipped -> String

Convert to the Chart.js string representation.

#BorderAlign Source

data BorderAlign

Arc border alignment mode.

Constructors

Instances

#borderAlignToString Source

borderAlignToString :: BorderAlign -> String

Convert to the Chart.js string representation.

#CapStyle Source

data CapStyle

Canvas line cap style.

Constructors

Instances

#capStyleToString Source

capStyleToString :: CapStyle -> String

Convert to the Chart.js string representation.

#JoinStyle Source

data JoinStyle

Canvas line join style.

Constructors

Instances

#joinStyleToString Source

joinStyleToString :: JoinStyle -> String

Convert to the Chart.js string representation.

#CubicInterpolationMode Source

#cubicInterpolationModeToString Source

cubicInterpolationModeToString :: CubicInterpolationMode -> String

Convert to the Chart.js string representation.

#InteractionMode Source

data InteractionMode

Interaction mode for hover and tooltip detection.

Constructors

Instances

#interactionModeToString Source

interactionModeToString :: InteractionMode -> String

Convert to the Chart.js string representation.

#scaleTypeToString Source

scaleTypeToString :: ScaleType -> String

Convert to the Chart.js string representation.

#TimeUnit Source

#timeUnitToString Source

timeUnitToString :: TimeUnit -> String

Convert to the Chart.js string representation.

#easingToString Source

easingToString :: Easing -> String

Convert to the Chart.js string representation.

#DecimationAlgorithm Source

data DecimationAlgorithm

Data decimation algorithms for large datasets.

Constructors

Instances

#decimationAlgorithmToString Source

decimationAlgorithmToString :: DecimationAlgorithm -> String

Convert to the Chart.js string representation.

#DrawTime Source

data DrawTime

When to draw the filler plugin relative to other chart elements.

Constructors

Instances

#drawTimeToString Source

drawTimeToString :: DrawTime -> String

Convert to the Chart.js string representation.

#Indexable Source

data Indexable a

A value that Chart.js accepts as either a single value or per-data-point array.

Constructors

Instances

#Padding Source

data Padding

Padding: uniform number or per-side.

Constructors

Instances

#AnimationSetting Source

data AnimationSetting

Animation can be a config object or false to disable.

Constructors

Instances

#ScaleDisplay Source

data ScaleDisplay

Scale display: true, false, or "auto".

Constructors

Instances

#ScaleMinMax Source

data ScaleMinMax

Scale min / max / suggestedMin / suggestedMax value. Numeric for linear/logarithmic/radial scales, string for category scales (matches a label) and time scales (an ISO date or any string the configured time adapter parses). Chart.js's CategoryScaleOptions and TimeScaleOptions both type these as string | number; the base CoreScaleOptions types them as unknown (fully untyped).

Constructors

Instances

#ScriptableContext Source

type ScriptableContext = { active :: Boolean, chart :: Foreign, dataIndex :: Int, dataset :: Foreign, datasetIndex :: Int, mode :: String, parsed :: Foreign, raw :: Foreign, type :: String }

Context passed by Chart.js to scriptable option functions at resolution time. Mirrors Chart.js's ScriptableContext<TType> interface. chart, dataset, parsed, and raw are left as Foreign because their shape varies by chart type and parsing config — consumers inspect them via Foreign operations.

#ScriptableTooltipContext Source

type ScriptableTooltipContext = { chart :: Foreign, tooltip :: Foreign, tooltipItems :: Array Foreign }

Context passed by Chart.js to scriptable tooltip option functions. Mirrors Chart.js's ScriptableTooltipContext<TType>. Different from dataset-level ScriptableContext — has tooltip and tooltipItems instead of dataIndex, dataset, etc. Both tooltip and tooltipItems are left as Foreign because their shape is complex (the full TooltipModel / TooltipItem types).

#ScriptableScaleContext Source

type ScriptableScaleContext = { chart :: Foreign, index :: Int, scale :: Foreign, tick :: Foreign }

Context passed by Chart.js to scriptable scale/tick/grid option functions. Mirrors Chart.js's ScriptableScaleContext. Different from dataset-level ScriptableContext — has scale and tick fields instead of dataset, parsed, etc. chart and scale are left as Foreign because their shape is complex; tick is also Foreign (wraps { value :: Number, label? :: String | String[], major? :: Boolean }) — consumers inspect via Foreign operations. Note: the Scriptable / ScriptableIndexable ADTs are parameterised on ScriptableContext in the type, but at runtime Chart.js passes this context shape for scale options.

#ScriptableScalePointLabelContext Source

type ScriptableScalePointLabelContext = { chart :: Foreign, index :: Int, label :: Foreign, scale :: Foreign }

Context passed by Chart.js to scriptable point-label option functions on radial scales. Mirrors Chart.js's ScriptableScalePointLabelContext. Has label (the point label string) instead of tick.

#Scriptable Source

data Scriptable a

A value that Chart.js accepts as either a static value or a function computed from the resolution context. Chart.js calls Scriptable functions once per affected element at draw time to pick the concrete value. Use SVal for static values and SFn (or the scriptableFn smart constructor) for dynamic ones.

SFn-wrapped functions travel through the overlay path: they cannot be JSON-serialized, so the chart must be created via createChartWithCallbacks or createChartAuto for the dynamic form to take effect. SVal-only configurations serialize as plain JSON and work with the base createChart path.

Constructors

Instances

#ScriptableIndexable Source

data ScriptableIndexable a

Chart.js's ScriptableAndArray<T, TContext> — a value that can be a single value, a per-item array, or a scriptable function. Note that Chart.js does not allow function entries inside the array form, so this is a flat ADT rather than Indexable (Scriptable a).

Like Scriptable, the SIFn form cannot be JSON-serialized and travels through the overlay path — the chart must be created via createChartAuto (or createChartWithCallbacks) for an SIFn value to take effect. SIVal / SIArray serialize as plain JSON and work with the base createChart path.

Constructors

Instances

#scriptableValue Source

scriptableValue :: forall a. a -> Maybe (Scriptable a)

Wrap a static value as a Scriptable field value (Just (SVal a)). Mirrors the single / perItem convention — returns Maybe so the result can be dropped directly into a Maybe (Scriptable a) record field without a manual Just. For pattern matching use the raw SVal constructor instead.

#scriptableFn Source

scriptableFn :: forall a. (ScriptableContext -> a) -> Maybe (Scriptable a)

Wrap a ScriptableContext -> a function as a Scriptable field value (Just (SFn f)). Returns Maybe for record-literal ergonomics.

#siValue Source

siValue :: forall a. a -> Maybe (ScriptableIndexable a)

ScriptableIndexable field value wrapping a single static value (Just (SIVal a)). Returns Maybe for record-literal ergonomics.

#siArray Source

siArray :: forall a. Array a -> Maybe (ScriptableIndexable a)

ScriptableIndexable field value wrapping a per-item array (Just (SIArray xs)). Returns Maybe for record-literal ergonomics.

#siFn Source

siFn :: forall a. (ScriptableContext -> a) -> Maybe (ScriptableIndexable a)

ScriptableIndexable field value wrapping a ScriptableContext -> a function (Just (SIFn f)). Returns Maybe for record-literal ergonomics.

#SpanGaps Source

data SpanGaps

spanGaps accepts boolean or number (max gap size in axis units).

Constructors

Instances

#Clip Source

data Clip

clip accepts number, per-side object, or false.

Constructors

Instances

#Stacked Source

data Stacked

stacked accepts boolean or "single" (stacks positive+negative together).

Constructors

Instances

#Cutout Source

data Cutout

cutout accepts number (pixels) or string (percentage like "50%").

Constructors

Instances

#BarThickness Source

data BarThickness

barThickness accepts number or "flex".

Constructors

Instances

#IsoWeekday Source

data IsoWeekday

isoWeekday accepts boolean or number (0-6 weekday index).

Constructors

Instances

#BarBorderWidth Source

data BarBorderWidth

Bar chart borderWidth as uniform number or per-side object.

Constructors

Instances

#BarBorderRadius Source

data BarBorderRadius

Bar chart borderRadius as uniform number or per-corner object.

Constructors

Instances

#ArcBorderRadius Source

data ArcBorderRadius

Arc borderRadius as uniform number or per-corner object.

Constructors

Instances

#InflateAmount Source

data InflateAmount

Bar inflate amount: a pixel count or 'auto' (0.33px when bars are tightly packed, 0 otherwise). Chart.js default is 'auto'.

Constructors

Instances

#PointLabelDisplay Source

data PointLabelDisplay

Point label display mode: boolean or 'auto' (show labels only when associated data is visible). Chart.js default is true.

Constructors

Instances

#Label Source

data Label

Multi-line label: single string or array of strings.

Constructors

Instances

#TitleText Source

data TitleText

Title/subtitle text: single string or array of strings for multi-line.

Constructors

Instances

#Color Source

data Color

A color value that Chart.js accepts: CSS string, gradient, or pattern.

Constructors

Instances

#CanvasGradient Source

data CanvasGradient

Opaque type for a CanvasGradient object (from canvas 2D context).

#CanvasPattern Source

data CanvasPattern

Opaque type for a CanvasPattern object (from canvas 2D context).

#css Source

css :: String -> Color

Convenience constructor for CSS color strings.

#psImage Source

psImage :: HTMLImageElement -> PointStyle

Convenience constructor for PSImage from a typed HTMLImageElement. Equivalent to PSImage (unsafeToForeign img). For HTMLCanvasElement or other CanvasImageSource values, use PSImage directly with unsafeToForeign.

The referenced image must be fully loaded before the chart is created — Chart.js reads width/height at draw time and draws nothing if they are zero. Route the config through createChartWithCallbacks so the overlay merge can substitute the live reference into the config.

#Font Source

type Font = { family :: Maybe String, lineHeight :: Maybe LineHeight, size :: Maybe Number, style :: Maybe String, weight :: Maybe FontWeight }

Font configuration for Chart.js text elements.

#FontWeight Source

data FontWeight

CSS font-weight value. Mirrors Chart.js's FontSpec.weight which accepts specific keyword strings or a numeric weight (100–900).

Constructors

Instances

#LineHeight Source

data LineHeight

CSS line-height value. Mirrors Chart.js's FontSpec.lineHeight which accepts a unitless number or any CSS string (e.g. "1.5em", "150%").

Constructors

Instances

#DatasetCommonRow Source

type DatasetCommonRow :: Row Type -> Row Typetype DatasetCommonRow r = (angle :: Maybe Number, animation :: Maybe AnimationSetting, animations :: Maybe AnimationsConfig, backgroundColor :: Maybe (ScriptableIndexable Color), barPercentage :: Maybe Number, barThickness :: Maybe BarThickness, base :: Maybe (ScriptableIndexable Number), borderAlign :: Maybe (ScriptableIndexable BorderAlign), borderCapStyle :: Maybe (Scriptable CapStyle), borderColor :: Maybe (ScriptableIndexable Color), borderDash :: Maybe (Scriptable (Array Number)), borderDashOffset :: Maybe (Scriptable Number), borderJoinStyle :: Maybe (ScriptableIndexable JoinStyle), borderRadius :: Maybe (ScriptableIndexable BarBorderRadius), borderSkipped :: Maybe (ScriptableIndexable BorderSkipped), borderWidth :: Maybe (ScriptableIndexable BarBorderWidth), categoryPercentage :: Maybe Number, chartType :: Maybe ChartType, circular :: Maybe (ScriptableIndexable Boolean), circumference :: Maybe Number, clip :: Maybe Clip, cubicInterpolationMode :: Maybe (Scriptable CubicInterpolationMode), datalabels :: Maybe Foreign, drawActiveElementsOnTop :: Maybe (ScriptableIndexable Boolean), fill :: Maybe (Scriptable Fill), grouped :: Maybe Boolean, hidden :: Maybe Boolean, hitRadius :: Maybe (ScriptableIndexable Number), hoverBackgroundColor :: Maybe (ScriptableIndexable Color), hoverBorderCapStyle :: Maybe (Scriptable CapStyle), hoverBorderColor :: Maybe (ScriptableIndexable Color), hoverBorderDash :: Maybe (Scriptable (Array Number)), hoverBorderDashOffset :: Maybe (Scriptable Number), hoverBorderJoinStyle :: Maybe (ScriptableIndexable JoinStyle), hoverBorderRadius :: Maybe (ScriptableIndexable BarBorderRadius), hoverBorderWidth :: Maybe (ScriptableIndexable Number), hoverOffset :: Maybe (ScriptableIndexable Number), hoverRadius :: Maybe (ScriptableIndexable Number), indexAxis :: Maybe Axis, inflateAmount :: Maybe (ScriptableIndexable InflateAmount), maxBarThickness :: Maybe Number, minBarLength :: Maybe Number, offset :: Maybe (ScriptableIndexable Number), order :: Maybe Int, parsing :: Maybe ParsingConfig, pointBackgroundColor :: Maybe (ScriptableIndexable Color), pointBorderColor :: Maybe (ScriptableIndexable Color), pointBorderWidth :: Maybe (ScriptableIndexable Number), pointHitRadius :: Maybe (ScriptableIndexable Number), pointHoverBackgroundColor :: Maybe (ScriptableIndexable Color), pointHoverBorderColor :: Maybe (ScriptableIndexable Color), pointHoverBorderWidth :: Maybe (ScriptableIndexable Number), pointHoverRadius :: Maybe (ScriptableIndexable Number), pointRadius :: Maybe (ScriptableIndexable Number), pointRotation :: Maybe (ScriptableIndexable Number), pointStyle :: Maybe (ScriptableIndexable PointStyle), radius :: Maybe (ScriptableIndexable Number), rotation :: Maybe (ScriptableIndexable Number), segment :: Maybe Foreign, showLine :: Maybe Boolean, skipNull :: Maybe Boolean, spacing :: Maybe Number, spanGaps :: Maybe SpanGaps, stack :: Maybe String, stepped :: Maybe Stepped, tension :: Maybe Number, transitions :: Maybe TransitionsConfig, weight :: Maybe Number, xAxisID :: Maybe String, yAxisID :: Maybe String | r)

Row of dataset configuration fields shared between instances (Dataset) and per-type defaults (DatasetDefaults). Parameterised by r so the row can be extended with identity fields (label/data) to form Dataset, or closed (with ()) to form DatasetDefaults.

#Dataset Source

type Dataset = { data :: Array DataPoint, label :: String | DatasetCommonRow () }

Unified dataset configuration covering all Chart.js chart types.

#DatasetDefaults Source

type DatasetDefaults = Record (DatasetCommonRow ())

Dataset defaults — same shape as Dataset minus the identity fields (label, data). Used as the value type of per-chart-type entries in DatasetsDefaults (options.datasets.line, options.datasets.bar, ...).

#DatasetsDefaults Source

type DatasetsDefaults = { bar :: Maybe DatasetDefaults, bubble :: Maybe DatasetDefaults, doughnut :: Maybe DatasetDefaults, line :: Maybe DatasetDefaults, pie :: Maybe DatasetDefaults, polarArea :: Maybe DatasetDefaults, radar :: Maybe DatasetDefaults, scatter :: Maybe DatasetDefaults }

Per-chart-type dataset defaults (options.datasets in Chart.js). Each entry supplies default field values for datasets of that chart type.

#Radius Source

type Radius = Cutout

Outer radius for pie/doughnut charts. Same shape as Cutout: pixels or percentage string (e.g. "100%").

#ScaleTitleConfig Source

type ScaleTitleConfig = { align :: Maybe TextAlign, color :: Maybe Color, display :: Maybe Boolean, font :: Maybe (Scriptable Font), padding :: Maybe Padding, text :: Maybe TitleText }

Scale axis title configuration.

#TicksConfig Source

type TicksConfig = { align :: Maybe TextAlign, autoSkip :: Maybe Boolean, autoSkipPadding :: Maybe Number, backdropColor :: Maybe (Scriptable Color), backdropPadding :: Maybe Padding, color :: Maybe (ScriptableIndexable Color), count :: Maybe Int, crossAlign :: Maybe String, display :: Maybe Boolean, font :: Maybe (Scriptable Font), format :: Maybe Foreign, includeBounds :: Maybe Boolean, labelOffset :: Maybe Number, major :: Maybe { enabled :: Maybe Boolean }, maxRotation :: Maybe Number, maxTicksLimit :: Maybe Int, minRotation :: Maybe Number, mirror :: Maybe Boolean, padding :: Maybe Number, precision :: Maybe Number, sampleSize :: Maybe Int, showLabelBackdrop :: Maybe (Scriptable Boolean), source :: Maybe String, stepSize :: Maybe Number, textStrokeColor :: Maybe (Scriptable Color), textStrokeWidth :: Maybe (Scriptable Number), z :: Maybe Number }

Scale tick mark configuration.

#GridConfig Source

type GridConfig = { circular :: Maybe Boolean, color :: Maybe (ScriptableIndexable Color), display :: Maybe Boolean, drawOnChartArea :: Maybe Boolean, drawTicks :: Maybe Boolean, lineWidth :: Maybe (ScriptableIndexable Number), offset :: Maybe Boolean, tickBorderDash :: Maybe (Scriptable (Array Number)), tickBorderDashOffset :: Maybe (Scriptable Number), tickColor :: Maybe (ScriptableIndexable Color), tickLength :: Maybe Number, tickWidth :: Maybe Number, z :: Maybe Number }

Scale grid line configuration. #36: color, lineWidth, tickColor are now ScriptableIndexable; tickBorderDash, tickBorderDashOffset are now Scriptable.

#ScaleBorderConfig Source

type ScaleBorderConfig = { color :: Maybe Color, dash :: Maybe (Scriptable (Array Number)), dashOffset :: Maybe (Scriptable Number), display :: Maybe Boolean, width :: Maybe Number, z :: Maybe Number }

Scale border line configuration. #36: dash, dashOffset are now Scriptable.

#TimeConfig Source

type TimeConfig = { displayFormats :: Maybe (Object String), isoWeekday :: Maybe IsoWeekday, minUnit :: Maybe TimeUnit, offsetAfterAutoskip :: Maybe Boolean, parser :: Maybe String, round :: Maybe TimeUnit, tooltipFormat :: Maybe String, unit :: Maybe TimeUnit }

Time scale configuration.

#AngleLinesConfig Source

type AngleLinesConfig = { borderDash :: Maybe (Scriptable (Array Number)), borderDashOffset :: Maybe (Scriptable Number), color :: Maybe (Scriptable Color), display :: Maybe Boolean, lineWidth :: Maybe (Scriptable Number) }

Radial scale angle line configuration. #40: color, lineWidth, borderDash, borderDashOffset now Scriptable.

#PointLabelsConfig Source

type PointLabelsConfig = { backdropColor :: Maybe (Scriptable Color), backdropPadding :: Maybe Number, borderRadius :: Maybe (Scriptable Number), centerPointLabels :: Maybe Boolean, color :: Maybe (Scriptable Color), display :: Maybe PointLabelDisplay, font :: Maybe (Scriptable Font), padding :: Maybe Number }

Radial scale point label configuration. #41: color, backdropColor, borderRadius now Scriptable; font Scriptable (#44). #45: display accepts PointLabelDisplay (boolean or 'auto').

#ScaleConfig Source

type ScaleConfig = { adapters :: Maybe { date :: Maybe Foreign }, alignToPixels :: Maybe Boolean, angleLines :: Maybe AngleLinesConfig, animate :: Maybe Boolean, axis :: Maybe String, backgroundColor :: Maybe Color, beginAtZero :: Maybe Boolean, border :: Maybe ScaleBorderConfig, bounds :: Maybe String, clip :: Maybe Boolean, display :: Maybe ScaleDisplay, grace :: Maybe String, grid :: Maybe GridConfig, max :: Maybe ScaleMinMax, min :: Maybe ScaleMinMax, offset :: Maybe Boolean, pointLabels :: Maybe PointLabelsConfig, position :: Maybe Position, reverse :: Maybe Boolean, stack :: Maybe String, stackWeight :: Maybe Number, stacked :: Maybe Stacked, startAngle :: Maybe Number, suggestedMax :: Maybe ScaleMinMax, suggestedMin :: Maybe ScaleMinMax, ticks :: Maybe TicksConfig, time :: Maybe TimeConfig, title :: Maybe ScaleTitleConfig, type :: Maybe ScaleType, weight :: Maybe Number }

Full scale axis configuration.

#TitleConfig Source

type TitleConfig = { align :: Maybe TextAlign, color :: Maybe Color, display :: Maybe Boolean, font :: Maybe (Scriptable Font), fullSize :: Maybe Boolean, padding :: Maybe Padding, position :: Maybe Position, text :: Maybe TitleText }

Chart title (or subtitle) plugin configuration.

#LegendLabelsConfig Source

type LegendLabelsConfig = { borderRadius :: Maybe Number, boxHeight :: Maybe Number, boxWidth :: Maybe Number, color :: Maybe Color, font :: Maybe (Scriptable Font), padding :: Maybe Number, pointStyle :: Maybe PointStyle, pointStyleWidth :: Maybe Number, textAlign :: Maybe TextAlign, useBorderRadius :: Maybe Boolean, usePointStyle :: Maybe Boolean }

Legend label appearance configuration.

#LegendTitleConfig Source

type LegendTitleConfig = { color :: Maybe Color, display :: Maybe Boolean, font :: Maybe (Scriptable Font), padding :: Maybe Padding, text :: Maybe String }

Legend title configuration.

#LegendConfig Source

type LegendConfig = { align :: Maybe TextAlign, display :: Maybe Boolean, fullSize :: Maybe Boolean, labels :: Maybe LegendLabelsConfig, maxHeight :: Maybe Number, maxWidth :: Maybe Number, position :: Maybe Position, reverse :: Maybe Boolean, rtl :: Maybe Boolean, textDirection :: Maybe String, title :: Maybe LegendTitleConfig }

Chart legend plugin configuration.

#TooltipConfig Source

type TooltipConfig = { backgroundColor :: Maybe (Scriptable Color), bodyAlign :: Maybe (Scriptable TextAlign), bodyColor :: Maybe (Scriptable Color), bodyFont :: Maybe (Scriptable Font), bodySpacing :: Maybe (Scriptable Number), borderColor :: Maybe (Scriptable Color), borderWidth :: Maybe (Scriptable Number), boxHeight :: Maybe (Scriptable Number), boxPadding :: Maybe Number, boxWidth :: Maybe (Scriptable Number), caretPadding :: Maybe (Scriptable Number), caretSize :: Maybe (Scriptable Number), cornerRadius :: Maybe (Scriptable Number), displayColors :: Maybe (Scriptable Boolean), enabled :: Maybe (Scriptable Boolean), footerAlign :: Maybe (Scriptable TextAlign), footerColor :: Maybe (Scriptable Color), footerFont :: Maybe (Scriptable Font), footerMarginTop :: Maybe (Scriptable Number), footerSpacing :: Maybe (Scriptable Number), intersect :: Maybe Boolean, mode :: Maybe InteractionMode, multiKeyBackground :: Maybe (Scriptable Color), padding :: Maybe (Scriptable Padding), position :: Maybe (Scriptable String), rtl :: Maybe (Scriptable Boolean), textDirection :: Maybe (Scriptable String), titleAlign :: Maybe (Scriptable TextAlign), titleColor :: Maybe (Scriptable Color), titleFont :: Maybe (Scriptable Font), titleMarginBottom :: Maybe (Scriptable Number), titleSpacing :: Maybe (Scriptable Number), usePointStyle :: Maybe (Scriptable Boolean), xAlign :: Maybe (Scriptable String), yAlign :: Maybe (Scriptable String) }

Tooltip plugin configuration (#35: all fields except mode, intersect, and boxPadding are Scriptable<T, ScriptableTooltipContext> in Chart.js TS). Color fields widened from String to Color so consumers can use gradients or patterns as tooltip colors.

#DecimationConfig Source

type DecimationConfig = { algorithm :: Maybe DecimationAlgorithm, enabled :: Maybe Boolean, samples :: Maybe Number, threshold :: Maybe Number }

Data decimation plugin configuration.

#FillerConfig Source

type FillerConfig = { drawTime :: Maybe DrawTime, propagate :: Maybe Boolean }

Filler plugin configuration for area fills.

#ColorsPluginOptions Source

type ColorsPluginOptions = { enabled :: Maybe Boolean, forceOverride :: Maybe Boolean }

Built-in colors plugin options. When enabled (default true), the plugin auto-assigns colors to datasets from a built-in palette. Set forceOverride to true to override any user-set colors.

#PluginsConfig Source

type PluginsConfig = { colors :: Maybe ColorsPluginOptions, datalabels :: Maybe Foreign, decimation :: Maybe DecimationConfig, filler :: Maybe FillerConfig, legend :: Maybe LegendConfig, subtitle :: Maybe TitleConfig, title :: Maybe TitleConfig, tooltip :: Maybe TooltipConfig }

Top-level plugin configuration.

#AnimationConfig Source

type AnimationConfig = { animateRotate :: Maybe Boolean, animateScale :: Maybe Boolean, delay :: Maybe Number, duration :: Maybe Number, easing :: Maybe Easing, from :: Maybe AnimationValue, loop :: Maybe Boolean, properties :: Maybe (Array String), to :: Maybe AnimationValue, type :: Maybe AnimationType }

Animation timing and easing configuration (tier 1).

#AnimationType Source

data AnimationType

Animation interpolation type.

Constructors

Instances

#animationTypeToString Source

animationTypeToString :: AnimationType -> String

Convert to the Chart.js string representation.

#AnimationValue Source

data AnimationValue

A value used as animation start/end point.

Constructors

Instances

#AnimationPropertySetting Source

#AnimationPropertyConfig Source

type AnimationPropertyConfig = { delay :: Maybe Number, duration :: Maybe Number, easing :: Maybe Easing, from :: Maybe AnimationValue, loop :: Maybe Boolean, properties :: Maybe (Array String), to :: Maybe AnimationValue, type :: Maybe AnimationType }

Per-property animation config (used in tier 2 options.animations).

#AnimationsConfig Source

type AnimationsConfig = Object AnimationPropertySetting

Per-property animation configuration (tier 2). Keys are property names or group names (e.g., "colors", "numbers", "x", "tension").

#TransitionConfig Source

type TransitionConfig = { animation :: Maybe AnimationSetting, animations :: Maybe AnimationsConfig }

Animation overrides for a specific update mode (tier 3). The animation field is Maybe AnimationSetting (not AnimationConfig) so consumers can pass Just AnimationDisabled to fully disable a per-mode animation — the canonical Chart.js idiom for "instant hover transitions" or "no-animation resize."

#TransitionsConfig Source

type TransitionsConfig = Object TransitionConfig

Per-mode transition overrides (tier 3). Keys are mode names: "active", "hide", "show", "reset", "resize", or custom.

#defaultAnimationPropertyConfig Source

defaultAnimationPropertyConfig :: AnimationPropertyConfig

All optional fields set to Nothing.

#defaultTransitionConfig Source

defaultTransitionConfig :: TransitionConfig

All optional fields set to Nothing.

#InteractionConfig Source

type InteractionConfig = { axis :: Maybe String, includeInvisible :: Maybe Boolean, intersect :: Maybe Boolean, mode :: Maybe InteractionMode }

Hover and tooltip interaction configuration.

#InteractionOptions Source

type InteractionOptions = { axis :: Maybe String, includeInvisible :: Maybe Boolean, intersect :: Maybe Boolean }

Options passed to getElementsAtEventForMode. Matches Chart.js's InteractionOptions interface — same fields as InteractionConfig minus mode (which is passed as a separate argument to the method).

#InteractionItem Source

type InteractionItem = { datasetIndex :: Int, element :: Foreign, index :: Int }

Single element returned from getElementsAtEventForMode. Matches Chart.js's InteractionItem. element is the underlying Chart.js element (point, bar, arc, etc.) — opaque, consumers inspect via Foreign operations if needed.

#LayoutConfig Source

type LayoutConfig = { autoPadding :: Maybe Boolean, padding :: Maybe (Scriptable Padding) }

Chart layout configuration. padding is Scriptable<Padding> in Chart.js TS — a scriptable function can compute padding based on the chart context at render time.

#PointElementConfig Source

type PointElementConfig = { backgroundColor :: Maybe (ScriptableIndexable Color), borderColor :: Maybe (ScriptableIndexable Color), borderWidth :: Maybe (ScriptableIndexable Number), drawActiveElementsOnTop :: Maybe (ScriptableIndexable Boolean), hitRadius :: Maybe (ScriptableIndexable Number), hoverBackgroundColor :: Maybe (ScriptableIndexable Color), hoverBorderColor :: Maybe (ScriptableIndexable Color), hoverBorderWidth :: Maybe (ScriptableIndexable Number), hoverRadius :: Maybe (ScriptableIndexable Number), pointStyle :: Maybe (ScriptableIndexable PointStyle), radius :: Maybe (ScriptableIndexable Number), rotation :: Maybe (ScriptableIndexable Number) }

Default styling for point elements. All fields ScriptableIndexable per Chart.js ScriptableAndArrayOptions. #43: added hoverBackgroundColor, hoverBorderColor, drawActiveElementsOnTop.

#LineElementConfig Source

type LineElementConfig = { backgroundColor :: Maybe (ScriptableIndexable Color), borderCapStyle :: Maybe (ScriptableIndexable CapStyle), borderColor :: Maybe (ScriptableIndexable Color), borderDash :: Maybe (ScriptableIndexable (Array Number)), borderDashOffset :: Maybe (ScriptableIndexable Number), borderJoinStyle :: Maybe (ScriptableIndexable JoinStyle), borderWidth :: Maybe (ScriptableIndexable Number), capBezierPoints :: Maybe (ScriptableIndexable Boolean), cubicInterpolationMode :: Maybe (ScriptableIndexable CubicInterpolationMode), fill :: Maybe (ScriptableIndexable Fill), hoverBackgroundColor :: Maybe (ScriptableIndexable Color), hoverBorderCapStyle :: Maybe (ScriptableIndexable CapStyle), hoverBorderColor :: Maybe (ScriptableIndexable Color), hoverBorderDash :: Maybe (ScriptableIndexable (Array Number)), hoverBorderDashOffset :: Maybe (ScriptableIndexable Number), hoverBorderJoinStyle :: Maybe (ScriptableIndexable JoinStyle), hoverBorderWidth :: Maybe (ScriptableIndexable Number), segment :: Maybe Foreign, spanGaps :: Maybe (ScriptableIndexable SpanGaps), stepped :: Maybe (ScriptableIndexable Stepped), tension :: Maybe (ScriptableIndexable Number) }

Default styling for line elements. All fields ScriptableIndexable. #43: added hover fields, spanGaps, segment.

#BarElementConfig Source

type BarElementConfig = { backgroundColor :: Maybe (ScriptableIndexable Color), base :: Maybe (ScriptableIndexable Number), borderColor :: Maybe (ScriptableIndexable Color), borderRadius :: Maybe (ScriptableIndexable BarBorderRadius), borderSkipped :: Maybe (ScriptableIndexable BorderSkipped), borderWidth :: Maybe (ScriptableIndexable BarBorderWidth), hoverBackgroundColor :: Maybe (ScriptableIndexable Color), hoverBorderColor :: Maybe (ScriptableIndexable Color), hoverBorderRadius :: Maybe (ScriptableIndexable BarBorderRadius), hoverBorderWidth :: Maybe (ScriptableIndexable Number), inflateAmount :: Maybe (ScriptableIndexable InflateAmount), pointStyle :: Maybe (ScriptableIndexable PointStyle) }

Default styling for bar elements. All fields ScriptableIndexable. #43: added base, hover fields.

#ArcElementConfig Source

type ArcElementConfig = { angle :: Maybe (ScriptableIndexable Number), backgroundColor :: Maybe (ScriptableIndexable Color), borderAlign :: Maybe (ScriptableIndexable BorderAlign), borderColor :: Maybe (ScriptableIndexable Color), borderDash :: Maybe (ScriptableIndexable (Array Number)), borderDashOffset :: Maybe (ScriptableIndexable Number), borderJoinStyle :: Maybe (ScriptableIndexable JoinStyle), borderRadius :: Maybe (ScriptableIndexable ArcBorderRadius), borderWidth :: Maybe (ScriptableIndexable Number), circular :: Maybe (ScriptableIndexable Boolean), hoverBackgroundColor :: Maybe (ScriptableIndexable Color), hoverBorderColor :: Maybe (ScriptableIndexable Color), hoverBorderDash :: Maybe (ScriptableIndexable (Array Number)), hoverBorderDashOffset :: Maybe (ScriptableIndexable Number), hoverBorderWidth :: Maybe (ScriptableIndexable Number), hoverOffset :: Maybe (ScriptableIndexable Number), offset :: Maybe (ScriptableIndexable Number), selfJoin :: Maybe (ScriptableIndexable Boolean), spacing :: Maybe (ScriptableIndexable Number), spacingMode :: Maybe (ScriptableIndexable String) }

Default styling for arc elements (pie, doughnut, polar area). All fields ScriptableIndexable. #43: added hover fields, spacingMode.

#ElementsConfig Source

type ElementsConfig = { arc :: Maybe ArcElementConfig, bar :: Maybe BarElementConfig, line :: Maybe LineElementConfig, point :: Maybe PointElementConfig }

Default element styling overrides.

#ChartOptions Source

type ChartOptions = { animation :: Maybe AnimationSetting, animations :: Maybe AnimationsConfig, aspectRatio :: Maybe Number, backgroundColor :: Maybe (ScriptableIndexable Color), borderColor :: Maybe (ScriptableIndexable Color), circumference :: Maybe Number, clip :: Maybe Clip, color :: Maybe (Scriptable Color), cutout :: Maybe Cutout, datasets :: Maybe DatasetsDefaults, devicePixelRatio :: Maybe Number, elements :: Maybe ElementsConfig, events :: Maybe (Array String), font :: Maybe Font, hover :: Maybe InteractionConfig, hoverBackgroundColor :: Maybe (ScriptableIndexable Color), hoverBorderColor :: Maybe (ScriptableIndexable Color), indexAxis :: Maybe Axis, interaction :: Maybe InteractionConfig, layout :: Maybe LayoutConfig, locale :: Maybe String, maintainAspectRatio :: Maybe Boolean, normalized :: Maybe Boolean, offset :: Maybe (Indexable Number), parsing :: Maybe ParsingConfig, plugins :: Maybe PluginsConfig, radius :: Maybe Radius, resizeDelay :: Maybe Number, responsive :: Maybe Boolean, rotation :: Maybe Number, scales :: Maybe (Object ScaleConfig), showLine :: Maybe Boolean, spacing :: Maybe Number, spanGaps :: Maybe SpanGaps, startAngle :: Maybe Number, transitions :: Maybe TransitionsConfig }

Top-level chart options.

#ChartConfig Source

type ChartConfig = { chartType :: ChartType, datasets :: Array Dataset, labels :: Array Label, options :: ChartOptions, plugins :: Maybe (Array Foreign), xLabels :: Maybe (Array String), yLabels :: Maybe (Array String) }

Complete chart configuration: type, data, and options.

#defaultDataset Source

defaultDataset :: Dataset

Default dataset with empty label and data. All optional fields set to Nothing.

#defaultDatasetDefaults Source

defaultDatasetDefaults :: DatasetDefaults

Default DatasetDefaults with all optional fields set to Nothing. Use as a starting point for per-chart-type defaults in DatasetsDefaults.

#defaultDatasetsDefaults Source

defaultDatasetsDefaults :: DatasetsDefaults

Default DatasetsDefaults with every per-type entry set to Nothing.

#defaultFont Source

defaultFont :: Font

All optional fields set to Nothing.

#defaultScaleTitleConfig Source

defaultScaleTitleConfig :: ScaleTitleConfig

All optional fields set to Nothing.

#defaultTicksConfig Source

defaultTicksConfig :: TicksConfig

All optional fields set to Nothing.

#defaultGridConfig Source

defaultGridConfig :: GridConfig

All optional fields set to Nothing.

#defaultScaleBorderConfig Source

defaultScaleBorderConfig :: ScaleBorderConfig

All optional fields set to Nothing.

#defaultTimeConfig Source

defaultTimeConfig :: TimeConfig

All optional fields set to Nothing.

#defaultAngleLinesConfig Source

defaultAngleLinesConfig :: AngleLinesConfig

All optional fields set to Nothing.

#defaultPointLabelsConfig Source

defaultPointLabelsConfig :: PointLabelsConfig

All optional fields set to Nothing.

#defaultScaleConfig Source

defaultScaleConfig :: ScaleConfig

All optional fields set to Nothing.

#defaultTitleConfig Source

defaultTitleConfig :: TitleConfig

All optional fields set to Nothing.

#defaultLegendLabelsConfig Source

defaultLegendLabelsConfig :: LegendLabelsConfig

All optional fields set to Nothing.

#defaultLegendTitleConfig Source

defaultLegendTitleConfig :: LegendTitleConfig

All optional fields set to Nothing.

#defaultLegendConfig Source

defaultLegendConfig :: LegendConfig

All optional fields set to Nothing.

#defaultTooltipConfig Source

defaultTooltipConfig :: TooltipConfig

All optional fields set to Nothing.

#defaultDecimationConfig Source

defaultDecimationConfig :: DecimationConfig

All optional fields set to Nothing.

#defaultFillerConfig Source

defaultFillerConfig :: FillerConfig

All optional fields set to Nothing.

#defaultColorsPluginOptions Source

defaultColorsPluginOptions :: ColorsPluginOptions

All optional fields set to Nothing.

#defaultPluginsConfig Source

defaultPluginsConfig :: PluginsConfig

All optional fields set to Nothing.

#defaultAnimationConfig Source

defaultAnimationConfig :: AnimationConfig

All optional fields set to Nothing.

#defaultInteractionConfig Source

defaultInteractionConfig :: InteractionConfig

All optional fields set to Nothing.

#defaultInteractionOptions Source

defaultInteractionOptions :: InteractionOptions

All optional fields set to Nothing. Default options for getElementsAtEventForMode — Chart.js will use its built-in defaults for any field left Nothing.

#defaultLayoutConfig Source

defaultLayoutConfig :: LayoutConfig

All optional fields set to Nothing.

#defaultPointElementConfig Source

defaultPointElementConfig :: PointElementConfig

All optional fields set to Nothing.

#defaultLineElementConfig Source

defaultLineElementConfig :: LineElementConfig

All optional fields set to Nothing.

#defaultBarElementConfig Source

defaultBarElementConfig :: BarElementConfig

All optional fields set to Nothing.

#defaultArcElementConfig Source

defaultArcElementConfig :: ArcElementConfig

All optional fields set to Nothing.

#defaultElementsConfig Source

defaultElementsConfig :: ElementsConfig

All optional fields set to Nothing.

#defaultOptions Source

defaultOptions :: ChartOptions

All optional fields set to Nothing.

#defaultConfig Source

defaultConfig :: ChartConfig

Default chart config with Bar type, empty labels, and empty datasets.

#ParsingConfig Source

type ParsingConfig = { key :: Maybe String, xAxisKey :: Maybe String, yAxisKey :: Maybe String }

Custom parsing keys for mapping data object properties to axes. Use xAxisKey/yAxisKey for cartesian charts, key for radial charts (pie/doughnut/radar).

#defaultParsingConfig Source

defaultParsingConfig :: ParsingConfig

All optional fields set to Nothing.

#single Source

single :: forall a. a -> Maybe (Indexable a)

Wrap a single value as an indexable option.

#perItem Source

perItem :: forall a. Array a -> Maybe (Indexable a)

Wrap per-item values as an indexable option.

#fromNumbers Source

fromNumbers :: Array Number -> Array DataPoint

Convert plain numbers to DataPoint values.

#fromXY Source

fromXY :: Array (Tuple Number Number) -> Array DataPoint

Convert (x, y) tuples to XY data points.

#fromXYString Source

fromXYString :: Array (Tuple String Number) -> Array DataPoint

Convert (label, value) tuples to XYString data points (for time/category x-axis).

#fromBubble Source

fromBubble :: Array { r :: Number, x :: Number, y :: Number } -> Array DataPoint

Convert {x, y, r} records to bubble data points.

#fromFloatingBar Source

fromFloatingBar :: Array (Tuple Number Number) -> Array DataPoint

Convert (min, max) tuples to floating bar data points (range bars).

#uniformPadding Source

uniformPadding :: Number -> Maybe Padding

Create uniform padding.