# FunctionEditorBase class

Namespace: [Grasshopper2.UI.Graphing](https://developer.rhino3d.com/api/gh2/namespace/grasshopper2.ui.graphing.md) · Assembly: [Grasshopper2](https://developer.rhino3d.com/api/gh2/assembly/grasshopper2.md)

```cs
public sealed class FunctionEditorBase : IResponsive
```

Base control for editing functions.

## Constructors

- [FunctionEditorBase](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functioneditorbase/ctor.md): (2 overloads) Create a new editor.

## Fields

- [AxisLabelFillColour](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functioneditorbase/axislabelfillcolour.md): Default fill colour used by [FunctionEditorBase.DrawAxisLabels(Context, Color, Color)](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functioneditorbase/drawaxislabels.md) 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.
- [AxisLabelSize](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functioneditorbase/axislabelsize.md): (static) Pixel size of the square X / Y axis label boxes.
- [AxisLabelTextColour](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functioneditorbase/axislabeltextcolour.md): Default text colour used by [FunctionEditorBase.DrawAxisLabels(Context, Color, Color)](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functioneditorbase/drawaxislabels.md) callers that don't specify one.

## Properties

- [All](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functioneditorbase/all.md): Get all functions.
- [AllowCreate](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functioneditorbase/allowcreate.md): 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.
- [AllowDelete](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functioneditorbase/allowdelete.md): Gets or sets whether the user can delete functions.
- [Constraints](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functioneditorbase/constraints.md): Gets or sets the axis-lock and ratio constraints for this editor. Changes take effect on the next [FunctionEditorBase.SetFrameBoundary(RectangleF)](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functioneditorbase/setframeboundary.md) call and also fire [FunctionEditorBase.ConstraintsChanged](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functioneditorbase/constraintschanged.md) so external observers can react.
- [Count](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functioneditorbase/count.md): Gets the number of functions in this editor.
- [Frame](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functioneditorbase/frame.md): Gets or sets the frame projection for this editor.
- [Responder](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functioneditorbase/responder.md)
- [ShowGrips](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functioneditorbase/showgrips.md): 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.
- [SnapToGrid](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functioneditorbase/snaptogrid.md): Gets whether grip dragging is snapped to the visible grid.
- [SnapToGrips](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functioneditorbase/snaptogrips.md): Gets whether grip dragging is snapped to the unselected grips.
- [UnitsPerPixel](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functioneditorbase/unitsperpixel.md): 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](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functioneditorbase/xlabelbox.md): Rectangle for the X axis label, centred on the bottom edge of the current frame boundary and sitting just inside it.
- [YLabelBox](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functioneditorbase/ylabelbox.md): Rectangle for the Y axis label, centred on the left edge of the current frame boundary and sitting just inside it.

## Indexers

- [this[]](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functioneditorbase/item.md): (2 overloads) Gets the UI with the given identifier.

## Methods

- [Add](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functioneditorbase/add.md): Add multiple functions to this editor.
- [AdoptProjection](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functioneditorbase/adoptprojection.md): 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.
- [ApplyConstraints](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functioneditorbase/applyconstraints.md): Assign new constraints as a single user gesture. Unlike the [FunctionEditorBase.Constraints](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functioneditorbase/constraints.md) setter this brackets the change so an owner can record a coalescing undo checkpoint via [FunctionEditorBase.AxisChanged](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functioneditorbase/axischanged.md). 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.
- [CancelRatioSnap](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functioneditorbase/cancelratiosnap.md): 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.
- [Clear](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functioneditorbase/clear.md): Remove all functions from this editor.
- [CreateSnapSpace](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functioneditorbase/createsnapspace.md): Create the combined snapping space for grips and the grid, based on snapping properties.
- [CursorAt](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functioneditorbase/cursorat.md): 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.
- [DeleteSelection](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functioneditorbase/deleteselection.md)
- [Draw](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functioneditorbase/draw.md): (2 overloads)
- [DrawAxisLabels](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functioneditorbase/drawaxislabels.md): Draw the two axis-label pills. Shared between the pop-out editor (via [FunctionEditorBase.Draw(Context, Action, Action)](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functioneditorbase/draw.md)) 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.
- [InsertNewFunction](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functioneditorbase/insertnewfunction.md): (2 overloads) Insert a new function based on the [IoId] of a function type.
- [PopulateAxisMenu](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functioneditorbase/populateaxismenu.md): Populate the axis-options context menu with the standard items: Set domain / codomain (as dialogs), Lock domain / codomain toggles, Set X:Y ratio and Reset ratio. Called by the on-canvas mapper when the user right- clicks an axis label, and by [FunctionEditorBase.PopulateMenu(PointF, ContextMenu)](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functioneditorbase/populatemenu.md) when the pop-out editor's context-menu machinery lands on a label.
- [PopulateMenu](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functioneditorbase/populatemenu.md)
- [ProjectLimits](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functioneditorbase/projectlimits.md): (static) The single function that maps [GraphConstraints](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.graphconstraints.md) 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 `enforceRatio` is true and both axes aren't locked, the visible ratio is forced to equal [GraphConstraints.Ratio](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.graphconstraints/ratio.md) 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.Ratio enforcement is on by default because boundary changes (resize) and explicit ratio changes want it. Pan/zoom gestures pass false so the user can actively rescale one axis while the other stays locked.
- [Remove](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functioneditorbase/remove.md): Remove a ui from this editor.
- [ReplaceAll](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functioneditorbase/replaceall.md): Replace the entire function collection in a single operation, raising just one [FunctionEditorBase.FunctionsChanged](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functioneditorbase/functionschanged.md). Restores a snapshot (e.g. a pop-out undo) without the transient-empty flicker of [FunctionEditorBase.Clear()](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functioneditorbase/clear.md) followed by [FunctionEditorBase.Add(FunctionUi[])](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functioneditorbase/add.md).
- [Reproject](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functioneditorbase/reproject.md): Reproject the current frame through [FunctionEditorBase.ProjectLimits(RectangleF, GraphConstraints, double, double, double, double, bool)](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functioneditorbase/projectlimits.md). 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 [FunctionEditorBase.Frame](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functioneditorbase/frame.md).
- [SetFrameBoundary](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functioneditorbase/setframeboundary.md): 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 [FunctionEditorBase.SetFrameLimits(double, double, double, double)](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functioneditorbase/setframelimits.md).
- [SetFrameLimits](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functioneditorbase/setframelimits.md): (2 overloads) Same as [FunctionEditorBase.SetFrameLimits(double, double, double, double)](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functioneditorbase/setframelimits.md) 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.
- [ShowAxisTooltipAt](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functioneditorbase/showaxistooltipat.md): 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.
- [TickRatioSnap](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functioneditorbase/tickratiosnap.md)
- [WindowSelectionHandler](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functioneditorbase/windowselectionhandler.md)

## Events

- [AxisChanged](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functioneditorbase/axischanged.md): 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](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functioneditorbase/beginedit.md): 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.
- [CompleteEdit](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functioneditorbase/completeedit.md): Raised at the end of a function interaction.
- [ConstraintsChanged](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functioneditorbase/constraintschanged.md): Raised whenever [FunctionEditorBase.Constraints](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functioneditorbase/constraints.md) is changed.
- [DisplayChanged](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functioneditorbase/displaychanged.md)
- [FunctionsChanged](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functioneditorbase/functionschanged.md)
- [SnappingContextChanged](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functioneditorbase/snappingcontextchanged.md): Raised whenever the [FunctionEditorBase.SnapToGrid](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functioneditorbase/snaptogrid.md) or [FunctionEditorBase.SnapToGrips](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functioneditorbase/snaptogrips.md) properties are changed.
