# FunctionUi 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 abstract class FunctionUi : IStorable
```

Non-generic function UI.

**Derived types:** [FunctionUi<T>](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functionui-1.md)

## Constructors

- [FunctionUi](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functionui/ctor.md): (2 overloads) Construct the base function.

## Fields

- [_inner](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functionui/inner.md): Actual state of the inner colour as determined by the SetupDrawing method.
- [_outer](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functionui/outer.md): Actual state of the outer colour as determined by the SetupDrawing method.

## Properties

- [Arguments](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functionui/arguments.md): Gets all the arguments associated with this function. Arguments can be either of type Vector (i.e. 2D grips) or Scalar (i.e. 1D sliders) or referents (i.e. 1D functions).
- [AssumeContinuous](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functionui/assumecontinuous.md): Override this property and return false if the underlying function is expected to contain discontinuities.
- [Function](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functionui/function.md): The function hosted by the UI.
- [GripsOn](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functionui/gripson.md): Gets or sets whether the grips (and scalars) of this function ought to be drawn.
- [Icon](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functionui/icon.md): Gets the icon associated with this function.
- [Id](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functionui/id.md): Gets the identifier of this UI instance.
- [LatestGraphSegments](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functionui/latestgraphsegments.md): The polyline segments the graph was most recently drawn with, in graph (content) coordinates. Empty when the function hasn't been drawn yet. Populated by [FunctionUi.DrawGraph(FunctionGraphics)](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functionui/drawgraph.md) from whatever [FunctionUi.GraphSegments(FunctionGraphics)](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functionui/graphsegments.md) yields, so subclasses that override GraphSegments (LinearFunction, ThresholdFunction, etc.) contribute here too. Hit-testing uses these so the click tolerance matches the rendered pixels exactly.
- [Nomen](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functionui/nomen.md): Gets the description of this function.
- [Rank](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functionui/rank.md): Gets or sets the stature of this function. The stature controls the visual style of the function, as well as its inclusion in any outputted collection.
- [Selected](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functionui/selected.md): Gets or sets the selected state.
- [Tint](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functionui/tint.md): Gets or sets the Open-Color family used to tint this function. A concrete shade is resolved at draw time based on the current background so the function stays legible under any theme. Use [FunctionUi.TintFor(Color)](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functionui/tintfor.md) when a concrete `Color` is needed.
- [UserName](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functionui/username.md): Gets or sets the user name assigned to this function.
- [VariableArguments](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functionui/variablearguments.md): Override this property if your function has a variable number of vector arguments.

## Methods

- [AfterDrawGraphSegments](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functionui/afterdrawgraphsegments.md): Draw any decoration that should appear on top of the graph polyline. Called from [FunctionUi.DrawGraph(FunctionGraphics)](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functionui/drawgraph.md) after the polyline has been rendered.
- [BeforeDrawGraphSegments](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functionui/beforedrawgraphsegments.md): Draw any decoration that should appear behind the graph polyline. Called from [FunctionUi.DrawGraph(FunctionGraphics)](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functionui/drawgraph.md) after [FunctionUi.GraphSegments(FunctionGraphics)](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functionui/graphsegments.md) has run, so [FunctionUi.LatestGraphSegments](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functionui/latestgraphsegments.md) is populated and available.
- [CanInsertVector](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functionui/caninsertvector.md): Test whether a grip can be inserted at or near a coordinate.
- [CanRemoveVector](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functionui/canremovevector.md): Override this method to specifically okay removal off a specific grip.
- [DrawGraph](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functionui/drawgraph.md): Draw this function graph into a graphics context. Non-virtual: subclasses customise the rendering via [FunctionUi.GraphSegments(FunctionGraphics)](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functionui/graphsegments.md) (the polyline itself) and the [FunctionUi.BeforeDrawGraphSegments(FunctionGraphics)](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functionui/beforedrawgraphsegments.md) / [FunctionUi.AfterDrawGraphSegments(FunctionGraphics)](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functionui/afterdrawgraphsegments.md) hooks (any decorations before or after the curve). This keeps pen setup, rank thickness rules, obscure dashing, and segment capture in one place.
- [DrawGripFlourishes](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functionui/drawgripflourishes.md): Draw all grip flourishes associated with this function.
- [DrawGripShapes](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functionui/drawgripshapes.md): Draw all grips associated with this function.
- [DrawHints](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functionui/drawhints.md): Draw the visual hints such as asymptotes, limits and markers associated with this function.
- [DrawScalarShapes](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functionui/drawscalarshapes.md): Draw all scalars associated with this function.
- [EstimateDistance](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functionui/estimatedistance.md): Compute an estimate of the distance from the function to the given point. This estimate is done by sampling the function at small intervals around the point. Note: implementors may choose to override this method and provide analytic distance measurements.
- [EstimateProjection](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functionui/estimateprojection.md): Compute an estimate of the point on the function closest to a search point. This estimate is done by sampling the function at small intervals around the point.
- [GraphSegments](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functionui/graphsegments.md): Override this method if you think you can provide a more performant way to generate a graphics path representing the graph curve.
- [OnFunctionChanged](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functionui/onfunctionchanged.md): Raise the [FunctionUi.FunctionChanged](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functionui/functionchanged.md) event.
- [PopulateMenu](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functionui/populatemenu.md): Invoked when the context menu for this function is about to be shown.
- [SetupDrawing](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functionui/setupdrawing.md): Must be called prior to any draw method. This will ensure the colours and layout are correct.
- [Store](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functionui/store.md)
- [TintFor](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functionui/tintfor.md): Resolve [FunctionUi.Tint](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functionui/tint.md) into a concrete colour that stands out against the supplied background.
- [TryInsertVector](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functionui/tryinsertvector.md): Try and insert a grip at a coordinate.
- [TryRemoveVectors](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functionui/tryremovevectors.md): Try and remove a set of grips.

## Events

- [FunctionChanged](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.graphing.functionui/functionchanged.md): Raised when the shape of the function changes due to non-grip/scalar events, for example when the function is modified via a custom menu item.
