Dynamic Icons Scripting Reference - v1.3.0
    Preparing search index...

    Class LinearTicks

    Implementation of GaugeTicks for drawing ticks/labels along a linear path, either horizontally or vertically.

    Hierarchy (View Summary)

    Implements

    • ILayerElement
    • IRenderable
    • IColorElement
    Index

    Accessors

    • get isEmpty(): boolean

      Returns true if there is nothing to draw: Zero ticks and labels, zero width or height, or all styling would be invisible.

      Returns boolean

    • get hasLabels(): boolean

      Returns true if there are any labels to be drawn.

      Returns boolean

    • get scaleToFit(): boolean

      If true (default), scale down the overall size of the generated path (all ticks and labels together) to fit within the available canvas size if it would otherwise overflow.

      Returns boolean

    • set scaleToFit(v: boolean): void

      Parameters

      • v: boolean

      Returns void

    • get majTicksCount(): number

      Total number of major tick marks to draw along the curve. This will also determine the spacing (number of degrees) between ticks.

      Returns number

    • set majTicksCount(v: number): void

      Parameters

      • v: number

      Returns void

    • get majTicksLen(): number

      Length of each major tick mark, in either % or px units. Relative size is calculated based on overall image size.

      Returns number

    • set majTicksLen(v: string | number): void

      Parameters

      • v: string | number

      Returns void

    • get majTicksLenUnit(): string

      Length unit for each major tick mark, either % or px.

      Returns string

    • set majTicksLenUnit(v: string): void

      Parameters

      • v: string

      Returns void

    • get majTicksPlace(): Placement

      Configures in which direction to draw major tick marks relative to the curve radius. Inside will draw from curve radius to the inside of the circle, Outside will draw from radius towards the outside, and Center will split the difference with each mark being centered along the radius.

      Returns Placement

    • set majTicksPlace(v: string | Placement): void

      Parameters

      Returns void

    • get majTicksStroke(): StrokeStyle

      Major tick marks StrokeStyle object. Read-only.

      Returns StrokeStyle

    • get majTicksColor(): string

      Major tick marks stroke color.

      Returns string

    • set majTicksColor(v: string): void

      Parameters

      • v: string

      Returns void

    • get majTicksWidth(): string

      Major tick marks stroke size and unit.

      Returns string

    • set majTicksWidth(v: string): void

      Parameters

      • v: string

      Returns void

    • get majTicksPath(): null | Path2D

      Gets or sets the Path2D object representing the major ticks marks to be drawn.

      Returns null | Path2D

    • set majTicksPath(v: null | Path2D): void

      Parameters

      Returns void

    • get minTicksCount(): number

      The number of minor tick marks to draw between each major tick (not a total number). This will also determine the spacing (number of degrees) between minor ticks.

      Returns number

    • set minTicksCount(v: number): void

      Parameters

      • v: number

      Returns void

    • get minTicksLen(): number

      Length of each minor tick mark, in either % or px units. Relative size is calculated based on overall image size.

      Returns number

    • set minTicksLen(v: string | number): void

      Parameters

      • v: string | number

      Returns void

    • get minTicksLenUnit(): string

      Length unit for each minor tick mark, either % or px.

      Returns string

    • set minTicksLenUnit(v: string): void

      Parameters

      • v: string

      Returns void

    • get minTicksPlace(): Placement

      Configures in which direction to draw minor tick marks relative to the curve radius. Inside will draw from curve radius to the inside of the circle, Outside will draw from radius towards the outside, and Center will split the difference with each mark being centered along the radius.

      Returns Placement

    • set minTicksPlace(v: string | Placement): void

      Parameters

      Returns void

    • get minTicksStroke(): StrokeStyle

      Minor tick marks StrokeStyle object. Read-only.

      Returns StrokeStyle

    • get minTicksColor(): string

      Minor tick marks stroke color.

      Returns string

    • set minTicksColor(v: string): void

      Parameters

      • v: string

      Returns void

    • get minTicksWidth(): string

      Minor tick marks stroke size and unit.

      Returns string

    • set minTicksWidth(v: string): void

      Parameters

      • v: string

      Returns void

    • get minTicksPath(): null | Path2D

      Gets or sets the Path2D object representing the minor ticks marks to be drawn.

      Returns null | Path2D

    • set minTicksPath(v: null | Path2D): void

      Parameters

      Returns void

    • get labels(): string[]

      Array of strings to be used as label text. Empty for no labels. The individual label values will be distributed evenly along the curve from startAngle to endAngle (inclusive).

      Returns string[]

    • set labels(v: string[]): void

      Parameters

      • v: string[]

      Returns void

    • get labelsPlace(): Placement

      Controls label placement, Placement.Inside to put labels inside the curve, or Placement.Outside to place them outside the curve.

      Returns Placement

    • set labelsPlace(v: string | Placement): void

      Parameters

      Returns void

    • get labelsAlign(): Alignment

      Returns Alignment

    • set labelsAlign(v: string | Alignment): void

      Parameters

      Returns void

    • get labelsRotate(): number

      Controls label rotation. For linear marks this sets rotation from horizontal, in degrees. For circular, 0 = no rotation, 1 = rotate to inside, -1 = rotate to outside.

      Returns number

    • set labelsRotate(v: string | number): void

      Parameters

      • v: string | number

      Returns void

    • get labelsPadding(): number

      Expands or contracts the space between label text and the tick marks. Expressed as percent of overall image size. Default is 0.

      Returns number

    • set labelsPadding(v: string | number): void

      Parameters

      • v: string | number

      Returns void

    • get labelsFont(): string

      CSS font specification for labels text.

      Returns string

    • set labelsFont(v: string): void

      Parameters

      • v: string

      Returns void

    • get labelsSpacing(): string

      Letter spacing property expressed as a CSS length value, eg: "2px" or "1em". Default is 0px.

      Returns string

    • set labelsSpacing(v: string): void

      Parameters

      • v: string

      Returns void

    • get labelsStyle(): BrushStyle

      Labels fill BrushStyle. Read-only.

      Returns BrushStyle

    • get labelsColor(): string

      Labels fill color.

      Returns string

    • set labelsColor(v: string): void

      Parameters

      • v: string

      Returns void

    • get labelsPath(): null | Path2D

      Gets or sets the Path2D object representing the labels to be drawn.

      Returns null | Path2D

    • set labelsPath(v: null | Path2D): void

      Parameters

      Returns void

    • get align(): string

      Alignment value as two string values, first for vertical and second for horizontal. Eg. "top left" or "center middle". Setting the property can be done with either a single direction or both (separated by space or comma) in either order.

      Returns string

    • set align(value: string | Alignment): void

      Parameters

      Returns void

    Constructors

    • Parameters

      • Optionalinit: LinearTicksInit

      Returns LinearTicks

    Methods

    • Sets element width and height property values with optional unit type specifier to use for both dimensions. If unit is undefined then the current unit types for each dimension remain unchanged.

      Parameters

      • size: SizeType
      • Optionalunit: string
      • OptionalunitY: string

      Returns void

    • Returns actual pixel width of this element, either scaled to viewWidth if width unit is % or actual width value if it is in pixels already. If this element's width value is zero then return viewWidth.

      Parameters

      • viewWidth: number

      Returns number

    • Returns actual pixel height of this element, either scaled to viewHeight if height unit is % or actual height value if it is in pixels already. If this element's height value is zero then return viewHeight.

      Parameters

      • viewHeight: number

      Returns number

    Properties

    width: UnitValue = ...

    A zero width/height (default) indicates to draw into the full available image area (eg. passed to render() in rect argument). Negative values are not allowed.

    height: UnitValue = ...
    alignment: Alignment = Alignment.CENTER

    How to align within drawing area if/when width/height doesn't fill it completely.

    offset: Vect2d = ...

    Extra position offset to apply after alignment. Expressed as a percentage of overall drawing area size.