RectangleMark
public class RectangleMark : ChartMark, IChartMarkRectangleMark for heatmaps, range charts, and grid-based visualizations. Matches Swift Charts RectangleMark(xStart:xEnd:yStart:yEnd:) API.
Constructors
Section titled “Constructors”
RectangleMark()
Section titled “RectangleMark()”public RectangleMark()
RectangleMark(float, float)
Section titled “RectangleMark(float, float)”public RectangleMark(float x, float y)Creates a RectangleMark centered at an XY point.
Matches Swift Charts: RectangleMark(x:y:width:height:).
Width/height are controlled through ChartGuru.RectangleMark.Width(ChartGuru.MarkDimension) and
ChartGuru.RectangleMark.Height(ChartGuru.MarkDimension).
Parameters
| Name | Type |
|---|---|
x |
System.Single |
y |
System.Single |
RectangleMark(PlottableValueRef, PlottableValueRef, int)
Section titled “RectangleMark(PlottableValueRef, PlottableValueRef, int)”public RectangleMark(PlottableValueRef x, PlottableValueRef y, int index = 0)Creates a centered RectangleMark from Swift-style plottable x/y bindings.
Parameters
| Name | Type |
|---|---|
x |
ChartGuru.PlottableValueRef |
y |
ChartGuru.PlottableValueRef |
index |
System.Int32 |
RectangleMark(float, float, float, float)
Section titled “RectangleMark(float, float, float, float)”public RectangleMark(float xStart, float xEnd, float yStart, float yEnd)Creates a RectangleMark with explicit bounds. Matches Swift Charts: RectangleMark(xStart:xEnd:yStart:yEnd:)
Parameters
| Name | Type |
|---|---|
xStart |
System.Single |
xEnd |
System.Single |
yStart |
System.Single |
yEnd |
System.Single |
RectangleMark(PlottableValueRef, PlottableValueRef, PlottableValueRef, PlottableValueRef)
Section titled “RectangleMark(PlottableValueRef, PlottableValueRef, PlottableValueRef, PlottableValueRef)”public RectangleMark(PlottableValueRef xStart, PlottableValueRef xEnd, PlottableValueRef yStart, PlottableValueRef yEnd)Creates a RectangleMark with categorical PlottableValue bounds. Matches Swift Charts: RectangleMark(xStart: .Value(…), xEnd: .Value(…), yStart: .Value(…), yEnd: .Value(…)) Positions are resolved automatically by ChartBuilder from unique category order.
Parameters
| Name | Type |
|---|---|
xStart |
ChartGuru.PlottableValueRef |
xEnd |
ChartGuru.PlottableValueRef |
yStart |
ChartGuru.PlottableValueRef |
yEnd |
ChartGuru.PlottableValueRef |
Methods
Section titled “Methods”
FromRect(float, float, float, float)
Section titled “FromRect(float, float, float, float)”public static RectangleMark FromRect(float x, float y, float width, float height)Creates a RectangleMark from position and Size (convenience constructor).
Parameters
| Name | Type |
|---|---|
x |
System.Single |
y |
System.Single |
width |
System.Single |
height |
System.Single |
Returns
ChartGuru.RectangleMark
FromCenter(float, float, float, float)
Section titled “FromCenter(float, float, float, float)”public static RectangleMark FromCenter(float centerX, float centerY, float width, float height)Creates a RectangleMark centered at position with given size.
Parameters
| Name | Type |
|---|---|
centerX |
System.Single |
centerY |
System.Single |
width |
System.Single |
height |
System.Single |
Returns
ChartGuru.RectangleMark
CornerRadius(float)
Section titled “CornerRadius(float)”public RectangleMark CornerRadius(float radius)Sets the corner radius for this rectangle. Swift Charts equivalent: .ClipShape(.rect(cornerRadius:))
Parameters
| Name | Type |
|---|---|
radius |
System.Single |
Returns
ChartGuru.RectangleMark
CellPadding(float)
Section titled “CellPadding(float)”public RectangleMark CellPadding(float padding)Sets the cell Padding (0–10 percent of cell size on each side) for this rectangle. Matches the designer’s Heat Map cell padding slider.
Parameters
| Name | Type |
|---|---|
padding |
System.Single |
Returns
ChartGuru.RectangleMark
Width(MarkDimension)
Section titled “Width(MarkDimension)”public RectangleMark Width(MarkDimension dimension)Sets the rendered rectangle width with Swift Charts MarkDimension semantics. Equivalent to RectangleMark(…, width: .fixed/.ratio/.inset/.automatic).
Parameters
| Name | Type |
|---|---|
dimension |
ChartGuru.MarkDimension |
Returns
ChartGuru.RectangleMark
Height(MarkDimension)
Section titled “Height(MarkDimension)”public RectangleMark Height(MarkDimension dimension)Sets the rendered rectangle height with Swift Charts MarkDimension semantics. Equivalent to RectangleMark(…, height: .fixed/.ratio/.inset/.automatic).
Parameters
| Name | Type |
|---|---|
dimension |
ChartGuru.MarkDimension |
Returns
ChartGuru.RectangleMark
GetMorphTargets(ChartType, Rect)
Section titled “GetMorphTargets(ChartType, Rect)”public override (Vector2 source, Vector2 target) GetMorphTargets(ChartType targetType, Rect plotArea)Projects this mark into plot-space geometry that the morph renderer can interpolate toward the requested chart type.
Parameters
| Name | Type |
|---|---|
targetType |
ChartGuru.ChartType |
plotArea |
UnityEngine.Rect |
Returns
System.ValueTuple{UnityEngine.Vector2,UnityEngine.Vector2}
Clone()
Section titled “Clone()”public override IChartMark Clone()Creates an independent copy of this Rectangle Mark; later configuration changes do not affect the original instance.
Returns
ChartGuru.IChartMark
Properties
Section titled “Properties”
MarkType
Section titled “MarkType”public override ChartType MarkType { get; }Returns
ChartGuru.ChartType
NeedsCategoricalResolution
Section titled “NeedsCategoricalResolution”public bool NeedsCategoricalResolution { get; }When true, this mark was created with categorical PlottableValue bounds and needs position resolution by ChartBuilder.
Returns
System.Boolean
IsCentered
Section titled “IsCentered”public bool IsCentered { get; }True when authored with Swift Charts’ centered RectangleMark(x:y:width:height:) form instead of range bounds.
Returns
System.Boolean
XStart
Section titled “XStart”public float XStart { get; set; }Left X coordinate of the rectangle.
Returns
System.Single
public float XEnd { get; set; }Right X coordinate of the rectangle.
Returns
System.Single
YStart
Section titled “YStart”public float YStart { get; set; }Bottom Y coordinate of the rectangle.
Returns
System.Single
public float YEnd { get; set; }Top Y coordinate of the rectangle.
Returns
System.Single
CornerRadiusValue
Section titled “CornerRadiusValue”public float CornerRadiusValue { get; set; }Corner radius for rounded rectangles.
Returns
System.Single
CellPaddingPercent
Section titled “CellPaddingPercent”public float CellPaddingPercent { get; set; }Cell padding as a percentage (0–10) of cell screen size on each side. Applied by the renderer at draw time; does not modify the data-space coordinates. Matches the Designer’s _heatMapCellPadding semantics.
Returns
System.Single
StrokeColor
Section titled “StrokeColor”public Color StrokeColor { get; set; }Stroke/border color.
Returns
UnityEngine.Color
StrokeWidth
Section titled “StrokeWidth”public float StrokeWidth { get; set; }Stroke/border width.
Returns
System.Single
WidthDimension
Section titled “WidthDimension”public MarkDimension WidthDimension { get; set; }Optional Swift Charts MarkDimension width override. This does not replace
ChartGuru.RectangleMark.DataWidth, which remains the data-space rectangle extent.
Returns
ChartGuru.MarkDimension
HeightDimension
Section titled “HeightDimension”public MarkDimension HeightDimension { get; set; }Optional Swift Charts MarkDimension height override. This does not replace
ChartGuru.RectangleMark.DataHeight, which remains the data-space rectangle extent.
Returns
ChartGuru.MarkDimension
DataWidth
Section titled “DataWidth”public float DataWidth { get; }Data-space width of the rectangle (XEnd - XStart).
Returns
System.Single
DataHeight
Section titled “DataHeight”public float DataHeight { get; }Data-space height of the rectangle (YEnd - YStart).
Returns
System.Single
CenterX
Section titled “CenterX”public float CenterX { get; }Center X coordinate.
Returns
System.Single
CenterY
Section titled “CenterY”public float CenterY { get; }Center Y coordinate.
Returns
System.Single