tenun_core library

Classes

AdaptiveCullingConfig
Adaptive threshold & viewport culling for massive datasets (>50k pts).
AreaChartConfig
AreaChartWidget
AsyncChartProcessingController
Guards async chart-processing calls so stale results cannot overwrite newer UI state.
AsyncChartProcessingReport
AsyncChartProcessor
Moves heavy chart processing (LTTB, stats, binning) off the UI thread.
AsyncChartProcessorConfig
AxisLabel
AxisLine
AxisPointer
AxisTick
BackgroundLayer
BarChartConfig
Configuration for bar charts with complete JSON support
BarChartPainter
BarChartWidget
Bar chart widget that renders based on configuration using CustomPainter
BarGroup
BarSegment
BarSeries
BaseChartConfig
BaseRenderLayer
Base class that tracks a single dirty flag.
ChartAccessibilityOptions
ChartAnimationOptions
ChartApiContract
ChartApiContractProvider
ChartApiContracts
Shared contracts for the major Tenun chart API surfaces.
ChartApiDefaults
ChartApiEmptyState
ChartApiFieldNames
ChartApiFields
Canonical chart API field names shared by JSON configs, builders, and direct chart widgets.
ChartApiFieldSpec
ChartApiSurface
ChartAutoSwitchResult
Non-throwing result for automatic chart-type switching.
ChartCapabilities
Capability metadata for a chart type.
ChartCartesianBounds
ChartConfig
ChartConfigValidator
ChartController
Programmatic control over a live chart widget.
ChartDataProcessingCacheConfig
Global memoization policy for ChartDataProcessor.
ChartDataProcessingCachePolicySnapshot
Immutable cache-policy values captured for a single processing run.
ChartDataProcessingCacheStats
Runtime diagnostics for the chart data processing cache.
ChartDataProcessingCacheWriteReport
ChartDataProcessingReport
Per-run processing diagnostics for performance dashboards and tests.
ChartDataProcessor
ChartDataSignature
Stable, content-based signature for chart payload/config data.
ChartDataValueReader
Defensive helpers for chart data payloads that can arrive as decoded JSON, typed Dart maps, or hand-written object literals.
ChartDiagnosticFallbackFields
Shared diagnostic fallback field names and parsing helpers.
ChartDiagnosticFallbackFieldSpec
ChartErrorBoundary
Wraps chart rendering to catch fatal exceptions and show a safe fallback.
ChartFactory
Factory class for creating charts from configurations or JSON
ChartFamilyManifest
ChartFamilyManifestEntry
ChartFamilyManifests
ChartFamilyShowcaseCoverageReport
ChartFamilyShowcaseCoverages
ChartFormatters
Locale-aware formatters for tooltips & axis labels.
ChartIndexRange
ChartInteractionOptions
ChartJsonOptionCompletion
ChartJsonOptionCompletions
ChartJsonOptionFieldReference
ChartJsonOptionPatchEntry
ChartJsonOptionPatchIssue
ChartJsonOptionPatchOperation
ChartJsonOptionPaths
ChartJsonOptionPayloadPatchReport
ChartJsonOptionSchema
ChartJsonOptionSchemas
Public schema registry for cross-cutting JSON option groups.
ChartJsonOptionValueHint
ChartJsonOptionValueValidation
ChartLegend
ChartLineStyle
ChartObjectCacheStats
Shared hit/miss/eviction snapshot for lightweight render-object caches.
ChartPalette
An ordered list of series colors.
ChartPayloadContract
Registry-owned payload contract for a chart type.
ChartPayloadDoctor
ChartPayloadDoctorFinding
ChartPayloadDoctorReport
ChartPayloadNormalizationFields
Shared payload normalization field names and parsing helpers.
ChartPayloadNormalizationFieldSpec
ChartPerformanceSummary
Compact roll-up of one processing pass for dashboards and logs.
ChartPointValue
A normalized 2D point read from flexible chart JSON data.
ChartRegistration
Describes one registered chart type.
ChartRegistry
Global registry of chart types.
ChartRegistryHealthReport
Aggregated registry diagnostics for developer tooling and showcase views.
ChartRegistrySnapshot
Immutable snapshot of the current ChartRegistry state.
ChartRenderCacheStats
Combined diagnostics for the global render-object caches.
ChartRenderLayerReport
Per-layer timing/cache report emitted by ChartRenderPipeline.
ChartRenderPipeline
Orchestrates an ordered stack of RenderLayer objects.
ChartRenderPipelineReport
Aggregate paint timing/cache report for one pipeline frame.
ChartRuntimeDiagnostics
Lightweight runtime report emitted by TenunChart.
ChartRuntimePerformancePolicy
Tunable thresholds for runtime performance recommendations.
ChartRuntimePerformancePolicyFields
Shared runtime performance policy field names and parsing helpers.
ChartRuntimePerformancePolicyFieldSpec
ChartRuntimePerformancePolicyResolution
ChartRuntimePerformanceSummary
Actionable runtime roll-up for JSON/config-driven chart rendering.
ChartSelection
Represents a selected data point.
ChartSpacing
ChartStats
Pre-computed stats across all series in a chart.
ChartSwitchCompatibility
Non-throwing compatibility result for a potential runtime chart switch.
ChartSwitchGroup
Runtime switch compatibility group for a data shape.
ChartSwitchOption
Ranked runtime switch candidate for a JSON chart payload.
ChartTextStyle
ChartTheme
ChartToolbox
ChartTooltip
ChartTypeSwitchResult
Non-throwing result for a requested chart-type switch.
ChartTypography
ChartVisibilityOptions
ChartWidgetApiContracts
ChartZoomBridge
Bridges ChartController zoom operations with a ChartZoomController.
ChartZoomController
A ValueNotifier that owns ChartZoomState and exposes gesture-friendly mutation helpers.
ChartZoomState
Immutable zoom + pan state for one axis (X).
ChartZoomViewport
A viewport that integrates zoom state with canvas geometry.
ColorCache
Parses and caches Color objects from string representations.
CrosshairLayer
DataPoint
A 2-D data point used across all samplers.
DataSampler
DataShapeAdapter
Backward-compatible facade over the registry-backed data-shape tools.
DoubleListSampler
Samples List<double> directly, without allocating DataPoint objects.
Emphasis
Feature
GridData
GridLayer
ItemStyle
Label
LargeDataSamplingConfig
Global large-data sampling policy used by BaseChartConfig.
LineChartConfig
LineChartPainter
LineChartWidget
LineSeries
LineStyle
LTTBSampler
MinMaxSampler
MultiBarChartPainter
MultiBarChartWidget
NthPointSampler
PaintCache
PathCache
Caches pre-computed ui.Path objects to avoid rebuilding them on every paint() call when the underlying data has not changed.
PayloadDiff
PayloadDiffSummary
PayloadNormalizationOptions
PayloadNormalizationResult
PictureCache
Advanced Picture Cache with automatic LRU eviction and memory tracking. Prevents OOM crashes on large charts by disposing unused ui.Pictures.
PictureCacheResult
Result of a PictureCache lookup/build operation.
PictureCacheStats
Memory and cache-efficiency snapshot for PictureCache.
PieChartConfig
PieChartWidget
PieSeries
ProcessedSeries
Sampled version of a series ready for rendering.
RegistrationAuditIssue
Issue found while auditing a RegistrationBundle.
RegistrationBundle
A named group of ChartRegistration objects.
RegistrationBundleAudit
Audit result for a chart registration bundle.
RenderLayer
One composable layer in a ChartRenderPipeline.
ScatterBarChartWidget
ScatterChartConfig
ScatterChartPainter
ScatterChartWidget
SelectionHighlightLayer
Series
SeriesStats
Pre-computed statistics for a single numeric series.
ShadowStyle
SimpleAreaChart
A compact area chart that uses the same data model as SimpleLineChart.
SimpleBarChart
A lightweight, polished bar chart for small comparison datasets.
SimpleBarChartData
SimpleChartReferenceBand
SimpleChartReferenceLine
SimpleDonutChart
A polished composition chart for showing proportions with a compact center summary and optional legend.
SimpleDonutChartData
SimpleGroupedBarChart
A compact grouped bar chart for comparing multiple series per category.
SimpleGroupedBarSeries
SimpleLineChart
A compact line chart for product UI, dashboards, lessons, and reports.
SimpleScatterChart
A lightweight scatter and bubble chart for relationships, opportunity maps, and two-axis comparisons.
SimpleScatterPoint
SimpleScatterReferenceBand
SimpleScatterReferenceLine
SimpleSparklineChart
A tiny trend chart for KPI cards, tables, and dense dashboards.
SimpleStackedBarChart
A compact stacked bar chart for composition, allocation, and contribution.
SimpleStepChart
A stepped trend chart for values that hold until a change point.
SimpleTrendPoint
SimpleTrendSeries
SimpleTrendTooltipItem
SplitArea
SplitLine
StackedBarChartPainter
StackedBarChartWidget
TenunChart
Main chart widget that can be configured with either a config object or JSON
TenunChartFromJson
Convenience widget for creating charts directly from JSON
TenunChartJson
A drop-in replacement for TenunChart that accepts raw JSON and enables seamless chart-type switching without data loss.
TenunDiagnosticFallbackOptions
TenunInvalidPayloadFallback
TenunOption
Parses and manages a single unified JSON "option" object, similar to Apache ECharts. Handles normalization, theme injection, and seamless type switching.
TenunOptionBuildResult
Non-throwing result for direct TenunOption config building.
TenunRenderErrorFallback
TenunSwitchBlockedFallback
TenunValidationReportFallback
TextPainterCache
Caches TextPainter layout results with bounded LRU eviction.
TitlesData
ToolboxFeature
TooltipLayer
ValidatedChartAutoSwitchResult
Auto-switch result plus post-switch payload validation.
ValidatedChartTypeSwitchResult
Switch result plus post-switch payload validation.
ValidationIssue
ValidationReport
ValidationReportIssue
ValidationResult
XAxisPointer
XYAxis
ZoomableTenunChart
ZoomConstraints
ZoomRange
Defines the visible x-range and zoom level.

Enums

Align
AxisType
BarChartAlignment
Alignment options for bar charts
ChartApiFamily
ChartApiFieldCategory
ChartApiFieldValueKind
ChartDataCacheAdmissionReason
Explains why a cache path was admitted or skipped for a processing run.
ChartDataCacheRecommendationSeverity
Rankable severity for cache recommendation dashboards.
ChartDataCacheRecommendedAction
Structured remediation action for cache admission diagnostics.
ChartDataCacheWriteReason
ChartDataMode
Data handling mode for chart series rendering.
ChartDataProcessingPath
ChartDiagnosticFallbackFieldKind
ChartFamilyManifestSurface
ChartJsonOptionPatchChangeKind
ChartJsonOptionPatchIssueSeverity
ChartJsonOptionPatchOperationKind
ChartPayloadDoctorStatus
ChartPayloadNormalizationFieldKind
ChartPayloadSeriesStrategy
Strategy used to derive series from shorthand JSON payload fields.
ChartResolvedSamplingStrategy
Strategy actually used by the sampler after auto, thresholds, and visible-window sizes are resolved.
ChartRuntimePerformancePolicyFieldKind
ChartRuntimePerformancePolicySource
ChartRuntimePerformanceRecommendation
ChartRuntimePerformanceSeverity
ChartSeriesDataShape
Data-shape groups used to pick compatible chart families.
ChartType
Enum of all supported chart types.
FontStyle
FontWeight
PayloadDiffKind
RegistrationAuditSeverity
SamplingStrategy
SimpleBarChartOrientation
SimpleBarChartStyle
SimpleChartReferenceLineStyle
SimpleScatterReferenceAxis
SimpleSparklineType
SimpleStackedBarMode
SimpleStepChartMode
SimpleTrendChartStyle
SimpleTrendLineStyle
TooltipRenderMode
TooltipTrigger
ValidationSeverity

Mixins

ViewportCullingMixin
Mixin for painters to skip off-screen points.
ZoomViewportMixin
Mixin for CustomPainter subclasses that use ChartZoomViewport.

Functions

auditRegistrationBundle(RegistrationBundle bundle, {bool includeUnknownShapeWarnings = false}) RegistrationBundleAudit
Audits bundle for duplicate types, duplicate keys, canonical drift, and missing shape data.
availableChartCapabilities({bool registeredOnly = true}) List<ChartCapabilities>
Capability metadata for all compiled-in chart registrations.
canonicalChartType(ChartType type) ChartType
Maps retained legacy enum values onto the implemented chart type that owns their parser/registration.
canonicalizeChartData(Object? value) String
Canonicalizes JSON-like chart data with sorted map keys.
chartApiContractForType(ChartType rawType) ChartApiContract
Resolves the shared API contract family for a registered chart type.
chartCapabilitiesForRegistration(ChartRegistration reg) ChartCapabilities
Returns capability metadata for a concrete ChartRegistration.
chartCapabilitiesForType(ChartType rawType) ChartCapabilities
Returns capability metadata for type.
chartPayloadContractForType(ChartType rawType) ChartPayloadContract
Returns the payload contract for type.
chartRegistryHealthReport({RegistrationBundle? bundle, bool registeredOnly = false, bool includeUnknownShapeWarnings = false}) ChartRegistryHealthReport
Builds a consolidated health report for bundle.
chartSwitchCompatibilityForJson(Map<String, dynamic> source, {required ChartType targetType, bool registeredOnly = true}) ChartSwitchCompatibility
Checks whether targetType can safely consume source without throwing.
chartSwitchOptionsForJson(Map<String, dynamic> source, {List<ChartType>? preferredOrder, bool includeCurrentType = false, bool registeredOnly = true}) List<ChartSwitchOption>
Returns ranked switch candidates with capabilities and preview payloads.
chartTypeSupportsSeriesShape(ChartType type, ChartSeriesDataShape shape) bool
Returns true when type can consume a series with shape.
chartTypeToString(ChartType type) String
Convert ChartType back to a canonical string.
chartUsesExternalDataModel(ChartType type) bool
Returns true when type is parsed by a chart-specific data model instead of generic series validation.
clearChartRenderCaches({bool resetMetrics = true}) → void
compatibleChartTypesForConfig(BaseChartConfig config, {bool registeredOnly = true}) List<ChartType>
Suggest chart types that can consume config based on series-data shape.
compatibleChartTypesForJson(Map<String, dynamic> json, {bool registeredOnly = true}) List<ChartType>
Suggest chart types that can consume json based on series-data shape.
compatibleChartTypesForShape(ChartSeriesDataShape shape, {bool registeredOnly = true}) List<ChartType>
Suggest chart types that can consume a series with shape.
convertColor(String? name) Color
getBundleForSeriesShape(ChartSeriesDataShape shape) RegistrationBundle?
Returns a bundle with charts compatible to the provided data shape.
getChartConfig(ChartType chartType, Map<String, dynamic> json) → dynamic
getChartType(String type) ChartType
Convert a string to ChartType.
getContrastColor(Color color) Color
getDefaultSeriesColor(int index) Color
getMaxSeriesValue(List<Series> series) double
getRandomColor() Color
getStringRandomColor() String
inferSeriesDataShape(Map<String, dynamic> json) ChartSeriesDataShape
Detect the dominant data shape from JSON chart config.
legend(ChartConfig config) Widget
normalizeChartTypeKey(Object? raw) String
Normalizes chart type strings in the same way the registry resolves JSON keys, so nested series and top-level config payloads accept the same separator variants.
rankedCompatibleChartTypesForJson(Map<String, dynamic> source, {List<ChartType>? preferredOrder, bool includeCurrentType = false, bool registeredOnly = true}) List<ChartType>
Returns compatible target chart types ranked by preferredOrder.
registeredChartCapabilities() List<ChartCapabilities>
Capability metadata for chart types known to the current registry.
resetChartRenderCacheStats() → void
resolveColor(String? raw, Color fallback) Color
Resolve a nullable color string with a fallback.
rgbaStringToColor(String rgbaString) Color
rgbStringToColor(String rgbString) Color
Convert rgb string to Color Format: rgb(r, g, b)
safeStringToColor(String? colorString, [Color fallback = Colors.grey]) Color
stableChartDataHash(Object? value) String
Returns a deterministic hash for value.
stableChartDataHashCanonical(String canonical) String
Returns a deterministic hash for an already-canonicalized string.
stringToColor(String colorString) Color
switchChartTypeForSeriesShape(Map<String, dynamic> source, {required ChartType targetType, bool force = false}) Map<String, dynamic>
Switch chart type while preserving/normalizing data where possible.
switchChartTypeForSeriesShapeAuto(Map<String, dynamic> source, {List<ChartType>? preferredOrder, bool includeCurrentType = false, bool registeredOnly = true}) Map<String, dynamic>
Automatically switches source to the highest-ranked compatible chart type for its inferred data shape.
targetSeriesDataShape(ChartType rawType) ChartSeriesDataShape
Returns the expected series-data shape for type.
tryStringToColor(String? colorString) Color?
trySwitchChartTypeForSeriesShape(Map<String, dynamic> source, {required ChartType targetType, bool force = false, bool registeredOnly = true}) ChartTypeSwitchResult
Attempts to switch source to targetType without throwing.
trySwitchChartTypeForSeriesShapeAuto(Map<String, dynamic> source, {List<ChartType>? preferredOrder, bool includeCurrentType = false, bool registeredOnly = true}) ChartAutoSwitchResult
Attempts to automatically switch source to the highest-ranked compatible chart type without throwing.

Typedefs

AsyncChartProcessingResult = ({AsyncChartProcessingReport report, ChartProcessingResult result})
ChartErrorHandler = void Function(Object error, StackTrace stack)
ChartErrorWidgetBuilder = Widget Function(BuildContext context, Object error)
ChartProcessingResult = ({List<ProcessedSeries> processed, ChartStats stats})
ChartProcessingResultWithReport = ({ChartDataProcessingReport report, ChartProcessingResult result})
ChartRenderErrorBuilder = Widget Function(BuildContext context, Object error, StackTrace stackTrace)
ChartRenderErrorHandler = void Function(Object error, StackTrace stackTrace)
ChartRenderPipelineDiagnosticsCallback = void Function(ChartRenderPipelineReport report)
CrosshairCallback = void Function(int? seriesIndex, int? dataIndex, dynamic value)
DataPointTapCallback = void Function(int seriesIndex, int dataIndex, dynamic value)
RangeSelectCallback = void Function(int startIndex, int endIndex)
SimpleBarTapCallback = void Function(SimpleBarChartData data, int index)
SimpleBarTooltipBuilder = Widget Function(BuildContext context, SimpleBarChartData data, int index, String formattedValue)
SimpleBarValueFormatter = String Function(double value)
SimpleDonutTapCallback = void Function(SimpleDonutChartData data, int index, double share)
SimpleDonutTooltipBuilder = Widget Function(BuildContext context, SimpleDonutChartData data, int index, String formattedValue, String formattedShare)
SimpleDonutValueFormatter = String Function(double value)
SimpleGroupedBarTapCallback = void Function(String category, SimpleGroupedBarSeries series, double value, int categoryIndex, int seriesIndex)
SimpleGroupedBarTooltipBuilder = Widget Function(BuildContext context, String category, SimpleGroupedBarSeries series, double value, int categoryIndex, int seriesIndex, String formattedValue)
SimpleScatterPointTapCallback = void Function(SimpleScatterPoint point, int index)
SimpleScatterTooltipBuilder = Widget Function(BuildContext context, SimpleScatterPoint point, int index, String formattedX, String formattedY, String? formattedSize)
SimpleScatterValueFormatter = String Function(double value)
SimpleSparklineTapCallback = void Function(SimpleTrendPoint point, int index)
SimpleSparklineTooltipBuilder = Widget Function(BuildContext context, SimpleTrendPoint point, int index, String formattedValue)
SimpleStackedBarTapCallback = void Function(String category, SimpleGroupedBarSeries series, double value, double share, int categoryIndex, int seriesIndex)
SimpleStackedBarTooltipBuilder = Widget Function(BuildContext context, String category, SimpleGroupedBarSeries series, double value, double share, int categoryIndex, int seriesIndex, String formattedValue, String formattedShare)
SimpleTrendPointTapCallback = void Function(String label, List<SimpleTrendTooltipItem> items, int index)
SimpleTrendTooltipBuilder = Widget Function(BuildContext context, String label, List<SimpleTrendTooltipItem> items)
SimpleTrendValueFormatter = String Function(double value)
TenunChartJsonBuildResultHandler = void Function(TenunOptionBuildResult result)
TenunChartJsonErrorBuilder = Widget Function(BuildContext context, TenunOptionBuildResult result)
TenunChartJsonSwitchErrorBuilder = Widget Function(BuildContext context, ValidatedChartTypeSwitchResult result)
TenunChartJsonSwitchResultHandler = void Function(ValidatedChartTypeSwitchResult result)
ZoomChangeCallback = void Function(double startFrac, double endFrac)

Exceptions / Errors

UnregisteredChartTypeException