dev
    Preparing search index...

    Class Factory

    Factory implements a high level API around VexFlow.

    Index

    Constructors

    • Example:

      Create an SVG renderer and attach it to the DIV element named "boo" to render using 1200 and 600

      const vf: Factory = new VexFlow.Factory({renderer: { elementId: 'boo', width: 1200, height: 600 }});

      Parameters

      Returns Factory

    Properties

    context: RenderContext
    options: Required<FactoryOptions>
    renderQ: Element[]
    stave?: Stave
    staves: Stave[]
    systems: System[]
    voices: Voice[]
    DEBUG: boolean = false

    To enable logging for this class. Set VexFlow.Factory.DEBUG to true.

    Methods

    • Parameters

      • Optionalparams: { betweenLines?: boolean; position?: string | number; type?: string }

      Returns Articulation

    • Parameters

      • params: {
            notes: StemmableNote[];
            options?: {
                autoStem?: boolean;
                partialBeamDirections?: { [noteIndex: number]: PartialBeamDirection };
                secondaryBeamBreaks?: number[];
            };
        }

      Returns Beam

    • Parameters

      • Optionalparams: {
            fontFamily?: string;
            fontSize?: number;
            fontWeight?: string;
            hJustify?: string;
            vJustify?: string;
        }

      Returns ChordSymbol

    • Parameters

      • Optionalparams: { options?: { annotation?: string; size?: string }; type?: string }

      Returns ClefNote

    • Parameters

      • type: string
      • Optionalparams: {
            delayed?: boolean;
            lowerAccidental?: string;
            position?: string | number;
            upperAccidental?: string;
        }

      Returns Ornament

    • Return pixels from current stave spacing.

      Parameters

      • Optionalparams: { options?: StaveOptions; width?: number; x?: number; y?: number }

      Returns Stave

    • Parameters

      • params: {
            firstIndexes: number[];
            from: StaveNote;
            lastIndexes: number[];
            options?: { font?: FontInfo; text?: string };
            to: StaveNote;
        }

      Returns StaveLine

    • Parameters

      • params: {
            firstIndexes?: number[];
            from?: null | Note;
            lastIndexes?: number[];
            options?: { direction?: number };
            text?: string;
            to?: null | Note;
        }

      Returns StaveTie

    • Parameters

      • params: {
            from: Note;
            options: {
                font?: FontInfo;
                line?: number;
                position: string;
                superscript: string;
            };
            text: string;
            to: Note;
        }

      Returns TextBracket

    • Parameters

      • Optionalparams: { dots?: number; duration?: string; line?: number; text?: string }

      Returns TextDynamics

    • Parameters

      • params: {
            from: null | Note;
            options: { code?: number; line?: number };
            to: null | Note;
        }

      Returns VibratoBracket

    • Static simplified function to access constructor without providing FactoryOptions

      Example:

      Create an SVG renderer and attach it to the DIV element named "boo" to render using 1200 and 600

      const vf: Factory = VexFlow.Factory.newFromElementId('boo', 1200, 600 );

      Parameters

      • elementId: null | string
      • width: number = 500
      • height: number = 200

      Returns Factory