Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Factory

Factory implements a high level API around VexFlow.

Hierarchy

  • Factory

Index

Constructors

constructor

  • Example:

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

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

    Parameters

    Returns Factory

Properties

Static DEBUG

DEBUG: boolean = false

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

Static TEXT_FONT

TEXT_FONT: Required<FontInfo> = ...

Default text font.

Methods

Accidental

  • Parameters

    • params: { type: string }
      • type: string

    Returns Accidental

Annotation

Articulation

  • Articulation(params?: { position?: string | number; type?: string }): Articulation
  • Parameters

    • Optional params: { position?: string | number; type?: string }
      • Optional position?: string | number
      • Optional type?: string

    Returns Articulation

BarNote

Beam

  • Beam(params: { notes: StemmableNote[]; options?: { autoStem?: boolean; partialBeamDirections?: {}; secondaryBeamBreaks?: number[] } }): Beam
  • Parameters

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

    Returns Beam

ChordSymbol

  • ChordSymbol(params?: { fontFamily?: string; fontSize?: number; fontWeight?: string; hJustify?: string; kerning?: boolean; reportWidth?: boolean; vJustify?: string }): ChordSymbol
  • Parameters

    • Optional params: { fontFamily?: string; fontSize?: number; fontWeight?: string; hJustify?: string; kerning?: boolean; reportWidth?: boolean; vJustify?: string }
      • Optional fontFamily?: string
      • Optional fontSize?: number
      • Optional fontWeight?: string
      • Optional hJustify?: string
      • Optional kerning?: boolean
      • Optional reportWidth?: boolean
      • Optional vJustify?: string

    Returns ChordSymbol

ClefNote

  • ClefNote(params?: { options?: { annotation?: string; size?: string }; type?: string }): ClefNote
  • Parameters

    • Optional params: { options?: { annotation?: string; size?: string }; type?: string }
      • Optional options?: { annotation?: string; size?: string }
        • Optional annotation?: string
        • Optional size?: string
      • Optional type?: string

    Returns ClefNote

Curve

EasyScore

  • Creates EasyScore. Normally the first step after constructing a Factory. For example:

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

    Parameters

    Returns EasyScore

Fingering

  • Fingering(params: { number?: string; position?: string }): FretHandFinger
  • Parameters

    • params: { number?: string; position?: string }
      • Optional number?: string
      • Optional position?: string

    Returns FretHandFinger

Formatter

GhostNote

GlyphNote

GraceNote

GraceNoteGroup

KeySigNote

  • KeySigNote(params: { alterKey?: string[]; cancelKey?: string; key: string }): KeySigNote
  • Parameters

    • params: { alterKey?: string[]; cancelKey?: string; key: string }
      • Optional alterKey?: string[]
      • Optional cancelKey?: string
      • key: string

    Returns KeySigNote

ModifierContext

MultiMeasureRest

NoteSubGroup

PedalMarking

  • Parameters

    • Optional params: { notes?: StaveNote[]; options?: { style: string } }
      • Optional notes?: StaveNote[]
      • Optional options?: { style: string }
        • style: string

    Returns PedalMarking

RepeatNote

Stave

  • Stave(params?: { options?: StaveOptions; width?: number; x?: number; y?: number }): Stave
  • Return pixels from current stave spacing.

    Parameters

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

    Returns Stave

StaveConnector

StaveLine

StaveNote

StaveTie

  • StaveTie(params: { first_indices?: number[]; from?: null | Note; last_indices?: number[]; options?: { direction?: number }; text?: string; to?: null | Note }): StaveTie
  • Parameters

    • params: { first_indices?: number[]; from?: null | Note; last_indices?: number[]; options?: { direction?: number }; text?: string; to?: null | Note }
      • Optional first_indices?: number[]
      • Optional from?: null | Note
      • Optional last_indices?: number[]
      • Optional options?: { direction?: number }
        • Optional direction?: number
      • Optional text?: string
      • Optional to?: null | Note

    Returns StaveTie

StringNumber

  • StringNumber(params: { number: string; position: string }): StringNumber
  • Parameters

    • params: { number: string; position: string }
      • number: string
      • position: string

    Returns StringNumber

System

TabNote

TabStave

  • Parameters

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

    Returns TabStave

TextBracket

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

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

    Returns TextBracket

TextDynamics

  • TextDynamics(params?: { dots?: number; duration?: string; line?: number; text?: string }): TextDynamics
  • Parameters

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

    Returns TextDynamics

TextNote

TickContext

TimeSigNote

  • Parameters

    • Optional params: { time?: string }
      • Optional time?: string

    Returns TimeSigNote

Tuplet

VibratoBracket

  • VibratoBracket(params: { from: null | Note; options: { harsh?: boolean; line?: number }; to: null | Note }): VibratoBracket
  • Parameters

    • params: { from: null | Note; options: { harsh?: boolean; line?: number }; to: null | Note }
      • from: null | Note
      • options: { harsh?: boolean; line?: number }
        • Optional harsh?: boolean
        • Optional line?: number
      • to: null | Note

    Returns VibratoBracket

Voice

  • Voice(params?: { options?: { softmaxFactor: number }; time?: string | VoiceTime }): Voice
  • Parameters

    • Optional params: { options?: { softmaxFactor: number }; time?: string | VoiceTime }
      • Optional options?: { softmaxFactor: number }
        • softmaxFactor: number
      • Optional time?: string | VoiceTime

    Returns Voice

draw

  • draw(): void
  • Render the score.

    Returns void

getContext

getStave

  • getStave(): undefined | Stave
  • Returns undefined | Stave

getVoices

initRenderer

  • initRenderer(): void
  • Returns void

reset

  • reset(): void
  • Returns void

setContext

setOptions

Static newFromElementId

  • newFromElementId(elementId: null | string, width?: number, height?: number): Factory
  • 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 = Vex.Flow.Factory.newFromElementId('boo', 1200, 600 );

    Parameters

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

    Returns Factory