FunctionGraphics

References
public class FunctionGraphics
Utility class for drawing function graphs, grip shapes and flourishes.

Fields

GripSize

#
Gets or sets the base grip radius. Individual grip shapes add a small offset on top of this value (SolidDisc = +2, OpenDisc / SolidDiamond = +3, OpenDiamond = +4, arrows up to +7). Use MakeCompact() or MakeSpacious() to set both this and Thickness together.
public int GripSize

ObscureDashPattern

#
Dash pattern applied to graphs of de-emphasised (Rank.Obscure) functions. Set to null or an empty array to draw obscure functions with a solid stroke. The pattern is in pixel units (on, off, on, off, ...).
public float[] ObscureDashPattern

Thickness

#
Gets or sets the base graph curve thickness. 3 is considered normal for the UI, but if you're exporting images or drawing into a small area you may want to adjust it. Use MakeCompact() or MakeSpacious() to set both this and GripSize together.
public int Thickness

Properties

Background

#
Background colour of the surface functions are drawn on. Used to resolve each function's FunctionUi.Tint into a concrete shade with adequate contrast. Defaults to white; set before rendering when drawing onto a differently-coloured surface.
public Color Background { get; set; }

Context

#
Gets the graphics context for these function graphics. Note that the context may use an entirely different set of panning and zooming transforms than the graph view and thus nothing should be drawn using this context without first applying the graph transforms. We recommend only using the draw methods directly exposed by these FunctionGraphics rather than relying on Context.Graphics.
public Context Context { get; }

Frame

#
Gets the visible frame in graphics coordinates.
public FrameF Frame { get; }

ScalarFont

#
Gets the font used to draw scalar text.
public static Font ScalarFont { get; }

UnitsPerPixel

#
Gets the number of graph paper units per pixel.
public double UnitsPerPixel { get; }

Methods

DrawAsymptote

#
Draw a standard vertical asymptote line.
public void DrawAsymptote(
Color
colour,
x
)

DrawAsymptote

#
Draw a standard asymptote line.
public void DrawAsymptote(
Color
colour,
line
)

DrawAsymptote

#
Draw a standard asymptote line.
public void DrawAsymptote(
Color
colour,
point0,
point1
)

DrawBox

#
Draw a box around a point.
public void DrawBox(
centre,
Box centre.
span,
Point 1.
Color
edge
Span vector (centre to corner).
)

DrawBox

#
Draw a box through two points.
public void DrawBox(
point0,
Point 0.
point1,
Point 1.
Color
edge
Colour of box.
)

DrawCircle

#
Draw a circle around a point.
public void DrawCircle(
centre,
Centre point.
radius,
Circle radius.
Color
edge
Colour of circle.
)

DrawCircle

#
Draw a circle through two points.
public void DrawCircle(
point0,
Point 0.
point1,
Point 1.
Color
edge
Colour of circle.
)

DrawCross

#
Draw an x-shaped grip.
public void DrawCross(
size,
Size of grip.
point,
Location.
Color
fill
Fill colour.
)

DrawFlourish

#
Draw a grip flourish.
public void DrawFlourish(
vector,
args,
Color
colour
)

DrawGraph

#
Draw a graph polyline.
public void DrawGraph(
points,
Points to draw.
Color
edge
Graph colour.
)

DrawGraph

#
Draw a graph polyline.
public void DrawGraph(
points,
Points to draw.
Pen
edge
Graph pen.
)

DrawGraphArea

#
Draw an area graph.
public void DrawGraphArea(
lower,
Points (left to right) of lower area boundary.
upper,
Points (left to right) of upper area boundary./
Color
fill
Fill colour.
)

DrawGrip

#
Draw a grip.
public void DrawGrip(
vector,
args,
Color
colour
)

DrawHorizontalAxis

#
Draw a horizontal axis flourish through a point.
public void DrawHorizontalAxis(
point,
Point.
Color
edge
Colour of axis.
)

DrawInfiniteLine

#
Draw an infinite line through two points.
public void DrawInfiniteLine(
point0,
Point 0.
point1,
Point 1.
Color
edge
Colour of line.
)

DrawLine

#
Draw a finite line segment between points.
public void DrawLine(
point0,
Point 0.
point1,
Point 1.
Color
edge
Colour of line.
)

DrawLine

#
Draw a finite line segment between points.
public void DrawLine(
point0,
Point 0.
point1,
Point 1.
Pen
edge
Pen of line.
)

DrawOpenArrow

#
Draw an arrow head grip with an edge.
public void DrawOpenArrow(
size,
Size of grip.
point,
Location.
direction,
Direction of arrow head.
Color
fill,
Fill colour.
Color
edge
Edge colour.
)

DrawOpenDiamond

#
Draw a diamond grip with an edge.
public void DrawOpenDiamond(
size,
Size of grip.
point,
Location.
Color
fill,
Fill colour.
Color
edge
Edge colour.
)

DrawOpenDisc

#
Draw a circular grip with an edge.
public void DrawOpenDisc(
size,
Size of grip.
point,
Location.
Color
fill,
Fill colour.
Color
edge
Edge colour.
)

DrawScalars

#
Draw all scalars.
public void DrawScalars(
args,
Collection of all scalars (required to find the parent of the scalar).
Color
colour
Colour of scalar.
)

DrawSolidArrow

#
Draw an arrow head grip.
public void DrawSolidArrow(
size,
Size of grip.
point,
Location.
direction,
Direction of arrow head.
Color
fill
Fill colour.
)

DrawSolidDiamond

#
Draw a diamond grip.
public void DrawSolidDiamond(
size,
Size of grip.
point,
Location.
Color
fill
Fill colour.
)

DrawSolidDisc

#
Draw a circular grip.
public void DrawSolidDisc(
size,
Size of grip.
point,
Location.
Color
fill
Fill colour.
)

DrawVerticalAxis

#
Draw a vertical axis flourish through a point.
public void DrawVerticalAxis(
point,
Point.
Color
edge
Colour of axis.
)

FlourishPen

#
Gets the edge used to draw flourishes. Called must dispose the edge when finished.
public Pen FlourishPen(
Color
colour
Colour.
)
Flourish edge.

MakeCompact

#
Set Thickness, GripSize and ObscureDashPattern to values suitable for small on-canvas drawings where graph area is at a premium.
public void MakeCompact()

MakeSpacious

#
Set Thickness, GripSize and ObscureDashPattern to values suitable for large drawings (the pop-out editor, exported images).
public void MakeSpacious()