Documentation
¶
Overview ¶
Package transform applies document-level post-evaluation transforms (scale, convert_to) to CalcMark evaluation results.
Index ¶
- func Apply(result types.Type, scale *document.ScaleConfig, ...) types.Type
- func ApplyToResults(results []types.Type, scale *document.ScaleConfig, ...) []types.Type
- func WouldConvert(result types.Type, convertTo *document.ConvertToConfig) bool
- func WouldScale(result types.Type, scale *document.ScaleConfig) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Apply ¶
func Apply(result types.Type, scale *document.ScaleConfig, convertTo *document.ConvertToConfig) types.Type
Apply applies scale and convert_to transforms to an evaluation result. Returns a new value (or the original if no transform applies). Order: scale first, then convert_to.
func ApplyToResults ¶
func ApplyToResults(results []types.Type, scale *document.ScaleConfig, convertTo *document.ConvertToConfig) []types.Type
ApplyToResults applies transforms to a slice of results, returning new values. This is a convenience for formatters that process result lists.
func WouldConvert ¶
func WouldConvert(result types.Type, convertTo *document.ConvertToConfig) bool
WouldConvert reports whether Apply would convert this result's unit given the convert_to config. Must be called on PRE-transform results (before Apply), because Apply changes the unit, making post-transform detection unreliable.
Used by the evaluator to cache per-statement conversion flags.
func WouldScale ¶
func WouldScale(result types.Type, scale *document.ScaleConfig) bool
WouldScale reports whether Apply would scale this result given the scale config. Used by the TUI to show a visual indicator on scaled values. Scaling is always explicit: unit_categories must list the categories to scale.
Types ¶
This section is empty.