algonim
    Preparing search index...

    Class Code

    Something that can present something on a canvas.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    arrowLines: number | ((line: number) => boolean) | null = null

    Lines that should have an arrow before them. Can be a number, a function mapping line numbers to booleans, or null to not have any arrows.

    origin: Point = ...

    Position where drawing begins.

    textStyle: Partial<FontStyle> = {}

    Style applied to most text.

    textHeightFactor: number = 0.8

    Scales strings' measured heights by this. Values <1 make lines condensed, and values >1 make them sparse.

    signSeparation: number = 12

    Distance between the end of the line and the start of Signs.

    signSpacing: number = 8

    Distance between individual Signs.

    defaultSignStyle: SignStyle = ...

    Style applied to newly created Signs. The font style is not inherited from textStyle.

    textStyle

    numberingStart: number = 1

    Number of the first visible line.

    numberingStyleOverride: Partial<FontStyle> | null = ...

    Overrides the main text style for line numbers. Setting this to null will cause lines to not be numbered. Note that the number separator needs to be disabled separately.

    • textStyle
    • numberSeparatorStyle
    numberSeparatorStyle: Partial<LineStyle> | null = ...

    Style applied to the line separating a line's numbering from its content.

    numberSeparatorMargins: { before: number; after: number } = ...

    Space before and after the number separator.

    numberSeparatorStyle

    arrowDistance: number = 6

    Space between the tip of an arrow and the start of the line content it's pointing at.

    arrowLength: number = 24

    Horizontal length of an arrow's main line.

    arrowStyle: { line: Partial<LineStyle>; head: ArrowStyle } = ...

    Style applied to arrows.

    Methods

    • Creates one line for every element of the given array. Future modifications to the array won't be reflected by the lines.

      Parameters

      • lines: string[]

      Returns void

    • Creates a sign at the end of the given line, numbered from 0.

      Parameters

      • lineNumber: number

      Returns Sign