transform

package
v1.6.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 8, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package transform applies document-level post-evaluation transforms (scale, convert_to) to CalcMark evaluation results.

Index

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 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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL