Scale
public abstract class ScaleBase class for all scale types. Maps data values to visual positions.
Fields
Section titled “Fields”
_domain
Section titled “_domain”protected float2 _domainReturns
Unity.Mathematics.float2
_range
Section titled “_range”protected float2 _rangeReturns
Unity.Mathematics.float2
_inverted
Section titled “_inverted”protected bool _invertedReturns
System.Boolean
_clamped
Section titled “_clamped”protected bool _clampedReturns
System.Boolean
Constructors
Section titled “Constructors”
Scale(float, float, float, float)
Section titled “Scale(float, float, float, float)”public Scale(float domainMin, float domainMax, float rangeMin, float rangeMax)Initializes the input data domain and output visual range. Scales clamp mapped values by default.
Parameters
| Name | Type |
|---|---|
domainMin |
System.Single |
domainMax |
System.Single |
rangeMin |
System.Single |
rangeMax |
System.Single |
Methods
Section titled “Methods”
Map(float)
Section titled “Map(float)”public abstract float Map(float value)Maps a value from the scale’s input domain into its configured output range.
Parameters
| Name | Type |
|---|---|
value |
System.Single |
Returns
System.Single
Invert(float)
Section titled “Invert(float)”public abstract float Invert(float position)Reverses the axis mapping so larger values are laid out toward the opposite edge.
Parameters
| Name | Type |
|---|---|
position |
System.Single |
Returns
System.Single
GenerateTicks(int)
Section titled “GenerateTicks(int)”public abstract float[] GenerateTicks(int count)Generates readable tick values spanning the active domain, targeting the requested count without exceeding scale constraints.
Parameters
| Name | Type |
|---|---|
count |
System.Int32 |
Returns
System.Single[]
SetDomain(float, float)
Section titled “SetDomain(float, float)”public Scale SetDomain(float min, float max)Replaces the input data interval used by subsequent mapping and tick generation.
Parameters
| Name | Type |
|---|---|
min |
System.Single |
max |
System.Single |
Returns
ChartGuru.Scale
SetRange(float, float)
Section titled “SetRange(float, float)”public Scale SetRange(float min, float max)Replaces the output coordinate interval, typically expressed in plot-area pixels.
Parameters
| Name | Type |
|---|---|
min |
System.Single |
max |
System.Single |
Returns
ChartGuru.Scale
SetInverted(bool)
Section titled “SetInverted(bool)”public Scale SetInverted(bool inverted)Controls whether increasing domain values map toward the opposite end of the output range.
Parameters
| Name | Type |
|---|---|
inverted |
System.Boolean |
Returns
ChartGuru.Scale
SetClamped(bool)
Section titled “SetClamped(bool)”public Scale SetClamped(bool clamped)Controls whether out-of-domain inputs stop at the output bounds or extrapolate beyond them.
Parameters
| Name | Type |
|---|---|
clamped |
System.Boolean |
Returns
ChartGuru.Scale
Properties
Section titled “Properties”
Domain
Section titled “Domain”public float2 Domain { get; }Returns
Unity.Mathematics.float2
public float2 Range { get; }Returns
Unity.Mathematics.float2
Inverted
Section titled “Inverted”public bool Inverted { get; }Returns
System.Boolean
Clamped
Section titled “Clamped”public bool Clamped { get; }Returns
System.Boolean