Perseus
    Preparing search index...

    Type Alias PerseusNumberLineWidgetOptions

    Options for the number-line widget. A draggable point on a number line.

    type PerseusNumberLineWidgetOptions = {
        correctRel?: "eq" | "lt" | "gt" | "le" | "ge";
        correctX: number | null;
        divisionRange: number[];
        initialX?: number | null;
        isInequality: boolean;
        isTickCtrl: boolean;
        labelRange: (number | null)[];
        labelStyle: string;
        labelTicks: boolean;
        numDivisions?: number | null;
        range: number[];
        showTooltips?: boolean;
        snapDivisions: number;
        static: boolean;
        tickStep?: number | null;
    }
    Index

    Properties

    correctRel?: "eq" | "lt" | "gt" | "le" | "ge"

    The answer to a NumberLine widget is a set of real numbers. correctRel expresses the relationship between the numbers in that set and the value of correctX.

    correctX: number | null

    This is the correct answer. The answer is validated (as right or wrong) by using only the end position of the point and the relation (=, <, >, ≤, ≥).

    divisionRange: number[]

    The range of divisions within the line

    initialX?: number | null

    This controls the initial position of the point along the number line

    isInequality: boolean
    isTickCtrl: boolean

    Show tick controller

    labelRange: (number | null)[]

    This controls the position of the left / right labels. By default, the labels are set by the range. Note: Ensure that the labels line up with the tick marks, or it may be confusing for users.

    labelStyle: string

    This controls the styling of the labels for the two main labels as well as all the tick mark labels, if applicable. Options: "decimal", "improper", "mixed", "non-reduced"

    labelTicks: boolean

    Show label ticks

    numDivisions?: number | null

    This controls the number (and position) of the tick marks. The number of divisions is constrained to the division range. Note: The user will be able to specify the number of divisions in a number input.

    range: number[]

    The position of the endpoints of the number line. Setting the range constrains the position of the answer and the labels.

    showTooltips?: boolean

    Show tooltips

    snapDivisions: number

    This determines the number of different places the point will snap between two adjacent tick marks. Note: Ensure the required number of snap increments is provided to answer the question.

    static: boolean

    When true, the answer is displayed and is immutable

    tickStep?: number | null

    This controls the number (and position) of the tick marks; you can either set the number of divisions (2 divisions would split the entire range in two halves), or the tick step (the distance between ticks) and the other value will be updated accordingly. Note: There is no check to see if labels coordinate with the tick marks, which may be confusing for users if the blue labels and black ticks are off-step.