TenunOption class

Parses and manages a single unified JSON "option" object, similar to Apache ECharts. Handles normalization, theme injection, and seamless type switching.

Available extensions

Constructors

TenunOption.fromJson(Map<String, dynamic> json, {bool autoNormalizePayload = false, PayloadNormalizationOptions? normalizationOptions})
Creates an option from raw JSON.
factory

Properties

autoNormalizePayload bool
final
global Map<String, dynamic>
final
hashCode int
The hash code for this object.
no setterinherited
normalizationOptions PayloadNormalizationOptions
final
primaryType ChartType
final
rawJson Map<String, dynamic>
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
series List<Map<String, dynamic>>
final
xAxis Map<String, dynamic>
final
yAxis Map<String, dynamic>
final

Methods

build() BaseChartConfig
Resolves the final BaseChartConfig ready for rendering.
isCompatibleWith(ChartType newType) bool

Available on TenunOption, provided by the TenunOptionTypeSwitching extension

Checks if switching to newType is lossless (data shapes match).
isLosslessSwitch(ChartType newType) bool

Available on TenunOption, provided by the TenunOptionTypeSwitching extension

Deep lossless check.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
switchType(ChartType newType) TenunOption

Available on TenunOption, provided by the TenunOptionTypeSwitching extension

Switch chart type while automatically adapting the data structure.
toJson() Map<String, dynamic>
Returns a copy of the underlying JSON for external inspection.
toRenderJson() Map<String, dynamic>
Returns the normalized JSON payload used by build.
toSharedRenderJson() Map<String, dynamic>
Returns a compact normalized payload containing only shared chart fields.
toString() String
A string representation of this object.
inherited
tryBuild({bool deep = true, bool requireRegisteredType = true, bool buildWhenInvalid = false}) TenunOptionBuildResult
Non-throwing variant of build for developer tools and JSON-driven UIs.
trySwitchAuto({List<ChartType>? preferredOrder, bool includeCurrentType = false, bool registeredOnly = true}) ChartAutoSwitchResult

Available on TenunOption, provided by the TenunOptionTypeSwitching extension

Attempts to switch to the best compatible chart type without throwing.
trySwitchAutoValidated({List<ChartType>? preferredOrder, bool includeCurrentType = false, bool registeredOnly = true, bool deep = true, bool requireRegisteredType = true}) ValidatedChartAutoSwitchResult

Available on TenunOption, provided by the TenunOptionTypeSwitching extension

Attempts to auto-switch chart type and validates the adapted payload.
trySwitchType(ChartType newType, {bool force = false, bool registeredOnly = true}) ChartTypeSwitchResult

Available on TenunOption, provided by the TenunOptionTypeSwitching extension

Attempts to switch chart type without throwing on incompatible targets.
trySwitchTypeValidated(ChartType newType, {bool force = false, bool registeredOnly = true, bool deep = true, bool requireRegisteredType = true}) ValidatedChartTypeSwitchResult

Available on TenunOption, provided by the TenunOptionTypeSwitching extension

Attempts to switch chart type and validates the adapted payload.
validate({bool deep = true, bool requireRegisteredType = true}) ValidationResult
Validates the normalized payload used by build.

Operators

operator ==(Object other) bool
The equality operator.
inherited