Home Manual Reference Source

References

summary
public

C Editor

Editor

public

F getAvailableLanguageList(configuration: Configuration): JSON

Return the list of available recognition languages

public

F register(element: Element, configuration: Configuration, penStyle: PenStyle, theme: Theme, behaviors: Behaviors): Editor

Attach an Editor to a DOMElement

callback

summary
public

F eventCallback(type: String, data: Object)

Emits an event when the editor state change

configuration

summary
public

Generate behaviors

public

F overrideDefaultConfiguration(configuration: Configuration): Configuration

Generate parameters

public

Generate style

public

F toCSS(penStyle: *): *

public

F toJSON(penStyle: *): *

public

Generate theme

public

F toCSS(theme: *): *

public

F toJSON(theme: *): *

public

Default behaviors

public

V defaultConfiguration: Configuration

Default configuration

public

Default style

public

Default theme

public

Log callback events

public

Log editor events

public

Log grabber events

public

V log: Object

Main log instance

public

Log model events

public

Log recognizer events

public

Log grabber events

public

Log editor events

public

Log tests events

public

Log util events

public
public

Current behavior

public

Set of behaviors to be used by the Editor

public
public
public
public
public
public

eastereggs

summary
public

F importStrokeGroups(editorParam: *, strokeGroups: *)

public

F inkImporter(editorParam: *, strokes: *, delayBetweenStrokes: *, lastOneDelay: *)

Function to copy past to inject ink during tutorial.

grabber

summary
public

F attach(element: Element, editor: Editor, offsetTop: Number, offsetLeft: Number): GrabberContext

Listen for the desired events

public

F detach(element: *, context: *)

public

Grab pointerDown, pointerMove and pointerUp events

public

Grabber context

public

Grabber listener

model

summary
public

F addStroke(model: Model, stroke: Stroke): Model

Mutate the model given in parameter by adding the new strokeToAdd.

public

F addStrokeToGroup(model: Model, stroke: Stroke, strokePenStyle: PenStyle): Model

Mutate the model given in parameter by adding the new strokeToAdd and the penstyle.

public

F appendToPendingStroke(model: Model, point: {x: Number, y: Number, t: Number}): Model

Mutate the model by adding a point to the current pending stroke.

public

F clearModel(model: Model): Model

Clear the model.

public

F cloneModel(model: Model): Model

Clone model

public

F createModel(configuration: Configuration): Model

Create a new model

public

F endPendingStroke(model: Model, point: {x: Number, y: Number, t: Number}, penStyle: PenStyle): Model

Mutate the model by adding the new point on a initPendingStroke.

public

Get the symbols that needs to be rendered

public

F extractPendingStrokes(model: Model, position: Number): Array<Stroke>

Get the strokes that needs to be recognized

public

F extractStrokesFromInkRange(model: Model, firstStroke: Number, lastStroke: Number, firstPoint: Number, lastPoint: Number): Array<Stroke>

Extract strokes from an ink range

public

Get the bounds of the current model.

public

F initPendingStroke(model: Model, point: {x: Number, y: Number, t: Number}, properties: Object, dpi: Number): Model

Mutate the model by adding a point and close the current stroke.

public

F mergeModels(models: ...Model): Model

Merge models

public

F needRedraw(model: Model): Boolean

Check if the model needs to be redrawn.

public

Reset model lastReceivedPosition and lastSentPosition

public

Reset model lastRenderedPosition

public

Update model lastReceivedPosition regarding to lastSentPosition

public

Update model lastRenderedPosition

public

F updateModelSentPosition(model: Model, position: Number): Model

Update model lastSentPosition

public

F canReconnect(recognizerContext: RecognizerContext): Boolean

Test if it is possible to reconnect

public

Create a new recognizer context

public

F isResetRequired(recognizerContext: RecognizerContext, model: Model): Boolean

Return true if a reset is required, false otherwise

public

F setRecognitionContext(recognizerContext: RecognizerContext, recognitionContext: RecognitionContext): RecognizerContext

Set the recognition context

public

Test if it should attempt immediate reconnect

public

Update the recognition context positions

public

F addPoint(stroke: Stroke, point: {x: Number, y: Number, t: Number}): Stroke

Mutate a stroke by adding a point to it.

public

Create a new stroke

public

F getPointByIndex(stroke: Stroke, index: Number): {x: Number, y: Number, t: Number, p: Number, l: Number}

Extract point by index

public

F slice(stroke: Stroke, start: Number, end: Number): Stroke

Slice a stroke and return the sliced part of it

public

F toJSON(stroke: Stroke): {type: String, x: Array<Number>, y: Array<Number>, t: Array<Number>}

Get a JSON copy of a stroke by filtering its properties

public

F toJSONV4(stroke: Stroke): {x: Array<Number>, y: Array<Number>, t: Array<Number>}

Get a JSON copy of a stroke by filtering its properties

public

F getDefaultSymbols(configuration: Configuration): Array

Get the default symbols for the current recognition type

public

F getSymbolsBounds(symbols: Array, bounds: Bounds): Bounds

Get the box enclosing the given symbols

public

F createUndoRedoContext(configuration: Configuration): UndoRedoContext

Create a new undo/redo context

public

Update the undo/redo state

public

F getModel(undoRedoContext: UndoRedoContext, callback: function(err: Object, res: Model, types: ...String), clone: Boolean, types: ...String)

Get current model in stack

public

F redo(undoRedoContext: UndoRedoContext, model: Model, callback: function(err: Object, res: Model, types: ...String))

Redo

public

F undo(undoRedoContext: UndoRedoContext, model: Model, callback: function(err: Object, res: Model, types: ...String))

Undo

public

F updateModel(undoRedoContext: UndoRedoContext, model: Model, callback: function(err: Object, res: Model, types: ...String))

Mutate the undoRedo stack by adding a new model to it.

public

Explicit close message

public

Lost connection message

public

Bounding box

public

Editor model

public

Raw results

public

Recognition positions

public

Recognition context

public

Recognizer context

public

Stroke symbol

public

pointerEvents symbol

public

Undo/redo context

public

Undo/redo manager

recognizer

summary
public

F computeHmac(input: Object, applicationKey: String, hmacKey: String): String

Compute HMAC signature for server authentication

public

F clear(recognizerContext: RecognizerContext, model: Model, callback: RecognizerCallback)

Clear server context.

public

F close(recognizerContext: RecognizerContext, model: Model, callback: RecognizerCallback)

Close and free all resources that will no longer be used by the recognizer.

public

F init(recognizerContext: RecognizerContext, model: Model, callback: RecognizerCallback)

Initialize recognition

public

F reset(recognizerContext: RecognizerContext, model: Model, callback: RecognizerCallback)

Reset server context.

public

T Callback(err: Object, res: Object): function

Simple callback

public

Recognition service entry point

public

T RecognizerCallback(err: Object, model: Model, types: ...String): function

Recognizer callback

public

Recognizer info

public

Triggers

recognizer/common

summary
public

Extract the exports

recognizer/common/v3

summary
public

Extract the recognized symbols

public

Extract the exports

public

Extract the recognized symbols

public

F extractShapeSymbols(model: Model, segment: Object): Array<Object>

Extract recognized symbols from recognition output

public

F getStyleFromInkRanges(model: Model, inkRanges: Array<Object>): {color: String, width: Number}

Get style for the strokes matching the ink ranges

public

Extract the exports

recognizer/rest

summary
public

F get(recognizerContext: RecognizerContext, url: String, params: Object): Promise

Get request

public

F post(recognizerContext: RecognizerContext, url: String, data: Object, apiVersion: String, mimeType: String): Promise

Post request

recognizer/rest/v3

summary
public

F export_(recognizerContext: RecognizerContext, model: Model, callback: RecognizerCallback): *

Export content

public

Get the configuration supported by this recognizer

public

F export_(recognizerContext: RecognizerContext, model: Model, callback: RecognizerCallback): *

Export content

public

Get the configuration supported by this recognizer

public

F export_(recognizerContext: RecognizerContext, model: Model, callback: RecognizerCallback)

Export content

public

Get the configuration supported by this recognizer

public

F init(recognizerContext: RecognizerContext, model: Model, callback: RecognizerCallback)

Initialize recognition

public

F postMessage(suffixUrl: String, recognizerContext: RecognizerContext, model: Model, buildMessage: function(recognizerContext: RecognizerContext, model: Model): Object): Promise<Model>

public

F clear(recognizerContext: RecognizerContext, model: Model, callback: RecognizerCallback)

Do what is needed to clean the server context.

public

F export_(recognizerContext: RecognizerContext, model: Model, callback: RecognizerCallback)

Export content

public

Get the configuration supported by this recognizer

public

F reset(recognizerContext: RecognizerContext, model: Model, callback: RecognizerCallback)

Reset server context.

public

F buildInput(recognizerContext: RecognizerContext, model: Model): Object

Internal function to build the payload to ask for a recognition.

public

F export_(recognizerContext: RecognizerContext, model: Model, callback: RecognizerCallback)

Export content

public

Get the configuration supported by this recognizer

public

Recognizer configuration

public

Recognizer configuration

public

Recognizer configuration

public

Recognizer configuration

public

Recognizer configuration

recognizer/rest/v4

summary
public

F convert(recognizerContext: RecognizerContext, model: Model, callback: RecognizerCallback)

Ask for conversion using DIGITAL_EDIT

public

F export_(recognizerContext: RecognizerContext, model: Model, callback: RecognizerCallback, requestedMimeTypes: Array[String])

Export content

public

Get the configuration supported by this recognizer

public

F postMessage(suffixUrl: String, recognizerContext: RecognizerContext, model: Model, buildMessage: function(recognizerContext: RecognizerContext, model: Model, conversionState: String): Object, conversionState: String, mimeType: String): Promise<Model>

public

Recognizer configuration

recognizer/websocket

summary
public

F clear(recognizerContext: RecognizerContext, model: Model, callback: RecognizerCallback)

Do what is needed to clean the server context.

public

F close(recognizerContext: RecognizerContext, model: Model, callback: RecognizerCallback)

Close and free all resources that will no longer be used by the recognizer.

public

F init(suffixUrl: String, recognizerContext: RecognizerContext, buildWebSocketCallback: BuildWebSocketFunction, reconnect: function(recognizerContext: RecognizerContext, model: Model, callback: RecognizerCallback)): Promise

Init the websocket recognizer.

public

F retry(func: *, recognizerContext: *, model: *, callback: *, params: ...*)

public

F sendMessage(recognizerContext: RecognizerContext, buildMessage: function(params: ...Object): Object, params: ...Object): Promise

public

F close(recognizerContext: RecognizerContext, code: Number, reason: String)

Close the websocket

public

F openWebSocket(recognizerContext: RecognizerContext): WebSocket

public

F send(recognizerContext: RecognizerContext, message: Object)

Send data message

public

T BuildWebSocketFunction(destructuredPromise: DestructuredPromise, recognizerContext: RecognizerContext): Callback: function

Build websocket function

recognizer/websocket/v3

summary
public

F buildWebSocketCallback(destructuredPromise: DestructuredPromise, recognizerContext: RecognizerContext): function

This function bind the right behaviour when a message is receive by the websocket.

public

F clear(recognizerContext: RecognizerContext, model: Model, callback: RecognizerCallback)

Clear server context.

public

F export_(recognizerContext: RecognizerContext, model: Model, callback: RecognizerCallback)

Export content

public

Get the configuration supported by this recognizer

public

F init(recognizerContext: RecognizerContext, model: Model, callback: RecognizerCallback)

Initialize recognition

public

F reset(recognizerContext: RecognizerContext, model: Model, callback: RecognizerCallback)

Reset the recognition context

public

F clear(recognizerContext: RecognizerContext, model: Model, callback: RecognizerCallback)

Clear server context.

public

F export_(recognizerContext: RecognizerContext, model: Model, callback: RecognizerCallback)

Export content

public

Get the configuration supported by this recognizer

public

F init(recognizerContext: RecognizerContext, model: Model, callback: RecognizerCallback)

Initialize recognition

public

F reset(recognizerContext: RecognizerContext, model: Model, callback: RecognizerCallback)

Reset the recognition context

public

Recognizer configuration

public

Recognizer configuration

recognizer/websocket/v4

summary
public

F buildWebSocketCallback(destructuredPromise: DestructuredPromise, recognizerContext: RecognizerContext): function

This function bind the right behaviour when a message is receive by the websocket.

public

F addStrokes(recognizerContext: RecognizerContext, model: Model, callback: RecognizerCallback)

Add strokes to the model

public

F buildConfiguration(configuration: *): *

public

F buildNewContentPackageInput(configuration: *, element: *): {"type": string, "applicationKey": *, "xDpi": *, "yDpi": *, "viewSizeHeight": *, "viewSizeWidth": *}

public

F buildNewContentPart(configuration: *): {"type": string, "contentType": *, "mimeTypes": *}

public

F buildOpenContentPart(configuration: *, partId: *): {"type": string, "id": *, "mimeTypes": *}

public

F buildRestoreIInkSessionInput(configuration: *, element: *, sessionId: *): {"type": string, "iinkSessionId": *, "applicationKey": *, "xDpi": *, "yDpi": *, "viewSizeHeight": *, "viewSizeWidth": *}

public

F buildSetPenStyle(penStyle: *): {"type": string, "style": *}

public

F buildSetPenStyleClasses(penStyleClasses: *): {"type": string, "styleClasses": *}

public

F buildSetTheme(theme: *): {"type": string, "theme": *}

public

F clear(recognizerContext: RecognizerContext, model: Model, callback: RecognizerCallback)

Clear action

public

F convert(recognizerContext: RecognizerContext, model: Model, callback: RecognizerCallback, conversionState: String)

Convert action

public

F export_(recognizerContext: RecognizerContext, model: Model, callback: RecognizerCallback, requestedMimeTypes: Array[String])

Export action

public

Get the configuration supported by this recognizer

public

F getSupportedImportMimeTypes(recognizerContext: *, model: *, callback: *)

public

F import_(recognizerContext: RecognizerContext, model: Model, data: Blob, callback: RecognizerCallback)

Import action

public

F init(recognizerContext: RecognizerContext, model: Model, callback: RecognizerCallback)

Initialize recognition

public

F newContentPart(recognizerContext: RecognizerContext, model: Model, callback: RecognizerCallback)

Create a new content part

public

F openContentPart(recognizerContext: RecognizerContext, model: Model, callback: RecognizerCallback)

Open the recognizer context content part

public

F pointerEvents(recognizerContext: RecognizerContext, model: Model, events: PointerEvents, callback: RecognizerCallback)

Pointer Events

public

F redo(recognizerContext: RecognizerContext, model: Model, callback: RecognizerCallback)

Redo last action

public

F resize(recognizerContext: RecognizerContext, model: Model, callback: RecognizerCallback, element: Element)

Resize

public

F sendConfiguration(recognizerContext: *, model: *, callback: *)

public

F setPenStyle(recognizerContext: RecognizerContext, model: Model, penStyle: PenStyle, callback: RecognizerCallback)

SetPenStyle action

public

F setPenStyleClasses(recognizerContext: RecognizerContext, model: Model, penStyleClasses: String, callback: RecognizerCallback)

setPenStyleClasses action

public

F setTheme(recognizerContext: RecognizerContext, model: Model, theme: Theme, callback: RecognizerCallback)

SetTheme action

public

F undo(recognizerContext: RecognizerContext, model: Model, callback: RecognizerCallback)

Undo last action

public

F waitForIdle(recognizerContext: RecognizerContext, model: Model, callback: RecognizerCallback)

WaitForIdle action

public

F zoom(recognizerContext: RecognizerContext, model: Model, value: Number, callback: RecognizerCallback)

Zoom action

public

Recognizer configuration

renderer

summary
public

F computeAxeAngle(begin: {x: Number, y: Number}, end: {x: Number, y: Number}): Number

public

F computeLinksPoints(point: {x: Number, y: Number, p: Number}, angle: *, width: *): [{x: Number, y: Number},{x: Number, y: Number}]

public

F computeMiddlePoint(point1: {x: Number, y: Number, p: Number}, point2: {x: Number, y: Number, p: Number}): {x: Number, y: Number, p: Number}

renderer/canvas

summary
public

F attach(element: Element, minHeight: Number, minWidth: Number): Object

Attach the renderer to the DOM element

public

F detach(element: Element, context: Object)

Detach the renderer from the DOM element

public

F drawCurrentStroke(context: Object, model: Model, stroker: Stroker): Model

Draw the current stroke from the model

public

F drawModel(context: Object, model: Model, stroker: Stroker): Model

Draw all symbols contained into the model

public

Get info

public

F resize(context: Object, model: Model, stroker: Stroker): Model

Update the rendering context size

public

F getImage(model: Model, stroker: Stroker, margin: Number): String

Generate a PNG image data url from the model

public

Default renderer

public

Renderer info

renderer/canvas/stroker

summary
public

F drawStroke(context: Object, stroke: Stroke)

Draw a stroke on a canvas, using quadratics

public

Get info

public

Define how a stroke should be drawn

public

Stroker info

renderer/canvas/symbols

summary
public

F drawMathSymbol(context: Object, symbol: Object, model: Model, stroker: Stroker)

Draw a math symbol

public

F drawMusicSymbol(context: Object, symbol: Object)

Draw a music symbol

public

F getMusicClefElements(): Array<Element>

Retrieve music symbols elements

public

F drawLine(context: Object, p1: {x: Number, y: Number}, p2: {x: Number, y: Number})

Draw a line

public

F drawShapeSymbol(context: Object, symbol: Object)

Draw a shape symbol

public

F drawStroke(context: Object, stroke: Stroke, stroker: Stroker)

Draw a stroke symbol

public

F drawTextSymbol(context: Object, symbol: Object)

Draw a text symbol

public

V MathSymbols: {inputCharacter: String, char: String, string: String, textLine: String}

public

V MusicClefs: {F: {svg: String, getBoundingBox: function}, C: {svg: String, getBoundingBox: function}, G: {svg: String, getBoundingBox: function}}

public

V MusicSymbols: {accidental: String, arpeggiate: String, bar: String, beam: String, clef: String, decoration: String, dots: String, head: String, ledgerLine: String, rest: String, staff: String, stem: String, tieOrSlur: String, timeSignature: String}

public

V ShapeSymbols: {table: String, shape: String, recognizedShape: String, ellipse: String, line: String}

public

V TextSymbols: {inputCharacter: String, char: String, string: String, textLine: String}

renderer/svg

summary
public

F attach(element: Element): Object

Populate the dom element

public

F detach(element: Element, context: Object)

Detach the renderer from the DOM element

public

F drawCurrentStroke(context: Object, model: Model, stroker: Stroker): Model

Draw the current stroke from the model

public

F drawModel(context: Object, model: Model, stroker: Stroker): Model

Draw all symbols contained into the model

public

Get info

public

F resize(context: Object, model: Model, stroker: Stroker, minHeight: Number, minWidth: Number): Model

Update the rendering context size

renderer/svg/stroker

summary
public

F drawStroke(context: Object, stroke: Stroke)

Draw a stroke on a svg tag, using quadratics

public

Get info

renderer/svg/symbols

summary
public

F drawStroke(context: Object, stroke: Stroke, stroker: Stroker)

Draw a stroke symbol

smartguide

summary
public

Create a new smart guide

public

F insertSmartGuide(smartGuide: SmartGuide)

Insert the smart guide HTML elements in the DOM.

public

F launchSmartGuide(smartGuide: SmartGuide, exports: Object): *

Launch the smartguide.

public

F resize(smartGuide: *)

public

Smart guide

util

summary
public

F computeStats(model: Model): Stats

public
public
public