Documentation ¶
Overview ¶
Package axes calculates the required layout and draws the X and Y axes of a heat map.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LongestString ¶
LongestString returns the length of the longest string in the string array.
func RequiredWidth ¶
RequiredWidth calculates the minimum width required in order to draw the Y axis and its labels. The parameter ls is the longest string in yLabels.
Types ¶
type Label ¶
type Label struct { // Label content. Text string // Position of the label within the canvas. Pos image.Point }
Label is one text label on an axis.
type XDetails ¶
type XDetails struct { // Start is the point where the X axis starts. // Both coordinates of Start are less than End. Start image.Point // End is the point where the X axis ends. End image.Point // Labels are the labels for values on the X axis in an increasing order. Labels []*Label }
XDetails contain information about the X axis that will NOT be drawn onto the canvas.
type YDetails ¶
type YDetails struct { // Width in character cells of the Y axis and its character labels. Width int // Start is the point where the Y axis starts. // The Y coordinate of Start is less than the Y coordinate of End. Start image.Point // End is the point where the Y axis ends. End image.Point // Labels are the labels for values on the Y axis in an increasing order. Labels []*Label }
YDetails contain information about the Y axis that will NOT be drawn onto the canvas, but will take up space.
func NewYDetails ¶
NewYDetails retrieves details about the Y axis required to draw it on a canvas of the provided area.
Click to show internal directories.
Click to hide internal directories.