Constructors
Fields
AxisLabelFillColour
#public Color AxisLabelFillColour
Default fill colour used by DrawAxisLabels(Context, Color, Color) callers that don't specify one (e.g. the pop-out editor). The mapper's attributes override this by calling the method with skin-derived shade colours.
AxisLabelTextColour
#public Color AxisLabelTextColour
Default text colour used by DrawAxisLabels(Context, Color, Color) callers that don't specify one.
Properties
AllowCreate
#Gets or sets whether the user can add new functions or replace the ones already hosted. If this property is false, existing functions can be edited or deleted.
Constraints
#Gets or sets the axis-lock and ratio constraints for this editor. Changes take effect on the next SetFrameBoundary(RectangleF) call and also fire ConstraintsChanged so external observers can react.
ShowGrips
#Gets or sets whether functions with grips on actually show and respond to their grips. Hiding keeps the per-function grip state intact for a view which cannot display it.
UnitsPerPixel
#Gets the units in graph space per units in frame space. Since the horizontal and vertical scaling should always be equal, this value is the average of the units in both x and y directions.
XLabelBox
#public RectangleF XLabelBox { get; }
Rectangle for the X axis label, centred on the bottom edge of the current frame boundary and sitting just inside it.
YLabelBox
#public RectangleF YLabelBox { get; }
Rectangle for the Y axis label, centred on the left edge of the current frame boundary and sitting just inside it.
Indexers
Methods
AdoptProjection
#Adopt another view's projection. Two views of the same functions rarely have the same pixel bounds, so copying the limits across verbatim leaves them showing different X:Y ratios - the same numbers stretched over a different aspect. The visible ratio and the X range are copied instead and the Y range is derived from this view's own boundary, so both views draw the same grid squares even though they show different amounts of graph vertically.
Parameters:
| other (FrameF) | Frame to adopt, boundary included. |
ApplyConstraints
#Assign new constraints as a single user gesture. Unlike the Constraints setter this brackets the change so an owner can record a coalescing undo checkpoint via AxisChanged. Use this for user-initiated constraint edits (input panel, menu); use the plain setter for programmatic / internal changes that shouldn't be undoable in their own right.
Parameters:
| constraints (GraphConstraints) |
CancelRatioSnap
#public void CancelRatioSnap()
Advance the ratio-snap animation (if one is running) and adjust the frame so the visible ratio matches the interpolated value. Called at the start of drawing from both the on-canvas mapper and the pop-out editor.
Cancel any in-flight ratio-snap animation. Called when the frame is restored from undo so a lingering animation can't overwrite it.
Cancel any in-flight ratio-snap animation. Called when the frame is restored from undo so a lingering animation can't overwrite it.
CreateSnapSpace
#Create the combined snapping space for grips and the grid, based on snapping properties.
CursorAt
#public Cursor CursorAt(PointF contentLocation)
Cursor appropriate for a given content-space point when interacting with axis labels, scalar link grips and referent fields. Returns null (default cursor) when the point is over none of those. Shared between the on-canvas mapper's
ICursorAwareAttributes implementation and the pop-out editor's mouse-move handler so both give the same hover feedback.Parameters:
| contentLocation (PointF) |
DeleteSelection
#public void DeleteSelection()
Draw
#DrawAxisLabels
#Draw the two axis-label pills. Shared between the pop-out editor (via Draw(Context, Action, Action)) and the on-canvas mapper (which calls this method directly with its own skin-derived colours). The X pill is centred on the bottom edge of the frame boundary with a rounded top; the Y pill mirrors that on the left edge with a rounded right.
Parameters:
| context (Context) | |
| fillColour (Color) | |
| textColour (Color) |
InsertNewFunction
#Insert a new function based on the [IoId] of a function type.
Parameters:
| id (Guid) | IoId of a Function type. |
ProjectLimits
#The single function that maps GraphConstraints onto a set of frame limits. Callers supply their preferred midpoint and range on each axis; this function overrides both when constraints demand it. Rules, in order:
- A locked axis uses its locked interval; the caller's midpoint and range for that axis are ignored.
- When
enforceRatiois true and both axes aren't locked, the visible ratio is forced to equal GraphConstraints.Ratio by rescaling one axis's range around its midpoint. The chosen axis is Y unless Y is locked (in which case X is chosen instead). - When both axes are locked, both intervals are used verbatim and the visible ratio drifts with the boundary.
ReplaceAll
#Replace the entire function collection in a single operation, raising just one FunctionsChanged. Restores a snapshot (e.g. a pop-out undo) without the transient-empty flicker of Clear() followed by Add(FunctionUi[]).
Parameters:
| functions (params FunctionUi[]) |
Reproject
#public void Reproject()
Reproject the current frame through ProjectLimits(RectangleF, GraphConstraints, double, double, double, double, bool). Used after pan/zoom/gesture to enforce locks; ratio is deliberately not enforced so nav gestures can rescale the unlocked axis freely. Public so external nav callers (e.g. INestedNavigation on the on-canvas attributes) can invoke it after directly assigning Frame.
SetFrameBoundary
#public void SetFrameBoundary(RectangleF boundary)
Change the boundary of the frame. On a resize (that is, when the previous boundary was non-empty and the caller isn't setting fresh limits) the domain is rescaled to preserve units-per-pixel on both axes independently, so a user-established X:Y ratio survives the resize. Whatever ratio is in place only changes via SetFrameLimits(double, double, double, double).
Parameters:
| boundary (RectangleF) |
SetFrameLimits
#Same as SetFrameLimits(double, double, double, double) but with explicit control over the "fresh" flag. Pass
markFresh=false when the new limits already reflect the current boundary (e.g. after adopting a computed aspect ratio) - the next boundary change will then rescale the limits normally instead of adopting the new boundary verbatim.SetFrameLimits
#Assign new limits to this frame. The limits are used verbatim; the next SetFrameBoundary(RectangleF) call will adopt the new boundary without rescaling these limits.
ShowAxisTooltipAt
#If the given content-space point is over an X or Y axis label, pop a tooltip describing the label and return true. Callers use this to give both the on-canvas mapper and the pop-out editor identical hover tooltips over the label pills.
Parameters:
| contentLocation (PointF) |
Events
AxisChanged
#Raised once per user-driven axis gesture, after the gesture completes, carrying the pre-gesture frame and constraints. Owners subscribe to record a single undo step; successive gestures are meant to coalesce.
BeginEdit
#Raised at the start of a user interaction that edits the function collection, before the first mutation. This includes grip-drags, but also addition of new functions or removal of existing functions.