# Configuration

Interactive Ink SDK is a flexible toolkit, and its default configuration can be adjusted to meet different needs. This page lists available options, their default values and usage.

You can access the configuration during the creation of an editor or a web-component. Refer to the Interactive Ink editing page of the guide for more instructions.

## General

For the sake of clarity path of parameter are given. For example recognitionParams.type key match following entry in the configuration :

const configuration = {
recognitionParams: {
type: '...'
}
}

### Content type compatibility

The supported content types depends of the API and the protocol you are using. The table below should help you.

Interactive ink SDK
API : V4
CDK
API : V3
Protocol : Websocket MATH, TEXT MATH, TEXT
Protocol : REST MATH, TEXT, DIAGRAM MATH, TEXT, SHAPE, DIAGRAM, MUSIC

### Common parameters

The following parameters applies whatever you are using V3 or V4 API.

Key Type Default value Description
recognitionParams.type string TEXT TEXT, MATH, SHAPE, MUSIC, ANALYZER
recognitionParams.protocol string WEBSOCKET REST or WEBSOCKET to choose the API to use.
recognitionParams.apiVersion string V4 V3 or V4 Version of the api to use
recognitionParams.server.scheme string https Server URL scheme (http/https)
recognitionParams.server.host string cloud.myscript.com Server host (cloud.myscript.com is the production url, webdemoapi.myscript.com is reserved for demonstration purpose)
recognitionParams.server.applicationKey string undefined MyScript Cloud applicationKey
recognitionParams.server.hmacKey string undefined MyScript Cloud hmacKey
recognitionParams.server.websocket.pingEnabled boolean true Enable/disable ping checks of the network connectivity (Improve network stability when enable)
recognitionParams.server.websocket.pingDelay number 30000 Delay in millisecond to wait before sending a ping. A ping is sent if no exchange occurs between the browser and teh server since last ping.
recognitionParams.server.websocket.maxPingLostCount number 10 Failed ping count before closing the socket
recognitionParams.server.websocket.autoReconnect boolean true Will try to automatically reconnect when websocket is close or when a timeout is detected. Do not handle the case when user change network on his device.
recognitionParams.server.websocket.maxRetryCount number 2 Number of retries when auto reconnect is enabled
recognitionParams.server.websocket.fileChunkSize number 2 File chunk size in bytes
listenerOptions.* Object {capture: false, passive: true} Options when adding event listeners whit addEventListener function
undoRedoMaxStackSize number 20 Max number of items kept in the undo/redo stack (Only applicable to V3 API)
xyFloatPrecision number 0 Precision of x and y from 0 to 10 (integer). More the value is high more precise will be the point capture but object in memory and send to the server will be heavier.
timestampFloatPrecision number 0 Precision of the timestamp
triggerDelay number 2000 Delay in millisecond to wait before doing an action if in QUIET_PERIOD. If an other action is perform during the quiet period, timer is reset.
processDelay number 0 Quiet period duration in millisecond while editor wait for another event before triggering events
resizeTriggerDelay number 200 Delay in millisecond to wait before applying a resize action. If a other resize order is perform during the quiet period, resizeTimer is clear. Prevent resize storms.
triggers.exportContent string POINTER_UP Trigger for export action
triggers.addStrokes string POINTER_UP Trigger for addStrokes action. POINTER_UP, Action is triggered on every Pointer Up. This is the recommended mode. QUIET_PERIOD : Action is triggered after a quiet period in milli-seconds on every pointer up. I value is set to 2000 for example the recognition will be fired when user stop writing 2 seconds. This is the recommended mode for all REST recognitions to avoid excessive calls to the server.
renderingParams.stroker string quadratic Type of temporary (before stroke is send to the server) stroker. Actually only quadratic is implemented.
renderingParams.minHeight number 100 Minimal height of the editor
renderingParams.minWidth number 100 Minimal width of the editor

## Interactive ink (API V4) parameters

If the apiVersion is set to V4, iink API will then be in used and the following parameters will be used.

When using MyScriptJS or web-components the prefix recognitionParams.v4. should be added.
Key Type Default value Description
export.image-resolution number 96 Resolution of the images that are exported, in dpi.
export.jiix.bounding-box boolean false If true, JIIX export will contain the bounding boxes of exported items.
export.jiix.strokes boolean false If true, JIIX export will include the detailed ink information.
export.jiix.style boolean false If true, JIIX export will include the styling information.
export.jiix.text.chars boolean false If true, JIIX export will include the detailed characters information.
export.jiix.text.words boolean true If true, JIIX export will include the detailed words information.
lang string en_US Defines the language used in the editor.
alwaysConnected boolean true Prevents the WebSocket session to be reinitialized every 5 minutes.
renderer.debug.draw-image-boxes boolean false If true, displays the bounding of the images.
renderer.debug.draw-text-boxes boolean false If true, displays the bounding of the words (for text) or characters (for math).

### Text

Key Type Default value Description
text.guides.enable boolean true If true, guides are displayed and used for convert and reflow operations. The default line spacing is 10 mm and can be [tuned][text-styling] by choosing the .text class font-size and line-height values.
text.smartGuide boolean true Enable the smart guide
text.smartGuideFadeOut.enable boolean false Enable/Disable the smart guide fade out animation
text.smartGuideFadeOut.duration number 10000 Time in milliseconds to hide the smart guide
text.mimeTypes array of string ['text/plain', 'application/vnd.myscript.jiix'] Exported mimeTypes. 'application/vnd.myscript.jiix' is mandatory when Smart Guide is enable.
text.margin.bottom number 10 Margin from the bottom of the part to the bottom of the text bounding box (used for reflow).
text.margin.left number 15 Margin from the left of the part to the left of the text bounding box (used for reflow).
text.margin.right number 15 Margin from the right of the part to the right of the text bounding box (used for reflow).
text.margin.top number 10 Margin from the top of the part to the top of the text bounding box (used for reflow).
text.configuration.customResources array of strings [] Name of the custom resources uploaded in the developer space to use. See [Custom recognition][custom_recognition] reference documentation
text.configuration.customLexicon array of strings [] List of custom words to be added to the recognition capabilities. See [more about the lexicon][lexicon].
text.configuration.addLKText boolean true Choice to add to the configured custom resources, words in the lexicon of the current language. Note that, if set to false, only one word will be recognized from the inks you send.

### Math

Key Type Default value Description
math.mimeTypes array of string ['application/x-latex', 'application/mathml+xml'] Exported mimeTypes. application/x-latex' is mandatory when export zone is active.
math.margin.bottom number 10 Margin from the bottom of the part to the top of the math expression bounding box (used for conversion operations)
math.margin.left number 15 Margin from the left of the part to the left of the math expression bounding box (used for conversion operations)
math.margin.right number 15 Margin from the right of the part to the right of the math expression bounding box (used for conversion operations)
math.margin.top number 10 Margin from the top of the part to the top of the math expression bounding box (used for conversion operations)
math.solver.angle-unit string deg Unit of the angle computation in the solver: It must be either deg (degrees) or rad (radians)
math.solver.decimal-separator string . The decimal separator symbol (usually . or ,).
math.solver.enable boolean true If true, displays solver result upon conversion.
math.solver.fractional-part-digits number 3 The number of decimals to display in solver computation result.
math.solver.rounding-mode string half up Rounding method used display solver results: It must be either half up or truncate.
math.solver.fraction-mode string decimal The way solver results shall be displayed: decimal (e.g. “1.5”), rational (e.g. “3/2”) or mixed (e.g. “1½”).
math.solver.options string algebraic Use numeric to let the solver potentially modify the structure of the expression to obtain something computable. Use algebraic to preserve the structure of the input in any case.
math.customGrammarId string undefined Name of the custom grammar uploaded in the developer space to use. See [Custom recognition][custom_recognition] reference documentation.
math.customGrammarContent string undefined Custom math grammar text. See [reference documentation][custom_resources] to know how to build your custom grammar.

## Cloud Development Kit (API V3) parameters

The following parameters are only applicable if you use the legacy api V3. This API will be deprecated as soon as all the important features are available in iink SDK.

When using MyScriptJS or web-components the prefix recognitionParams.V3. should be added.

### Math

Key Type Default value Description
mathParameter.resultTypes array of string ['LATEX', 'MATHML'] Export types, LATEX is mandatory if export zone is active
mathParameter.columnarOperation boolean false True to activate columnar recognition
mathParameter.userResources array of string [] Custom user resources to use
mathParameter.scratchOutDetectionSensitivity number 1 Sensitivity of to scratch-out gesture

### Text

Key Type Default value Description
textParameter.language string en_US Language to be used
textParameter.textInputMode string CURSIVE ISOLATED, CURSIVE, VERTICAL*, SUPERIMPOSED** This describes the type of writing - isolated (for example in boxed fields) and cursive (any other type of natural writing). *Only available in Japanese. **60 supported languages.
textParameter.resultDetail string TEXT TEXT, WORD, CHARACTER This describes the level of result detail you want. If you ask for TEXT level, you only get the final result for the whole ink sample. Results can also be broken down into WORD or CHARACTER level, if you want to offer alternative recognition candidates.
textParameter.contentTypes array of string [] The content type describes the expected linguistic type of input. The default is text which means that the recognizer will use a broad lexicon of general text. You can specify others for different types of fields such as surnames, city names, numbers, etc. You can specify more than one.
textParameter.subsetKnowledges array of string [] Subset knowledge is a way of telling the recognizer that you only want it to enable only certain characters. For example, for a phone number field, you may want only digits to be recognized. They are language-specific but generally offer digits, punctuation, alphabetical and alphanumerical characters and upper/lower case letters.
textParameter.userLkWords array of string [] A userLkWords list tells the recognizer that you want to use only the given words for recognition of the current request.
textParameter.userResources array of string [] A user resource tells the recognizer that you want to use the given resources for recognition of the current request.
textParameter.textProperties.textCandidateListSize number 1 max 20. Sets the size of the candidate lists given at text level in the recognition result. For this to be valid, ask for the corresponding level of ResultDetail.
textParameter.textProperties.wordCandidateListSize number undefined max 20. Sets the size of the candidate lists given at word level in the recognition result. For this to be valid, ask for the corresponding level of ResultDetail.
textParameter.textProperties.wordPredictionListSize number 0 Sets the size of the predicted words lists given at word level in the recognition result.
textParameter.textProperties.wordCompletionListSize number 0 Sets the size of the completed words lists given at word level in the recognition result. NO
textParameter.textProperties.characterCandidateListSize number undefined Sets the size of the candidate lists given at character level in the recognition result. For this to be valid, ask for the corresponding level of ResultDetail
textParameter.textProperties.enableOutOfLexicon boolean false Authorize words of of lexicon
textParameter.textProperties.discardCaseVariations boolean false Discard case variation
textParameter.textProperties.discardAccentuationVariations boolean false Discard accentuation variations
textParameter.textProperties.glyphDistortion number 0 Experimental feature.
textParameter.textProperties.enableTagger boolean false Experimental feature.
textParameter.textProperties.spellingDistortion number undefined Experimental feature.

### Shape

Key Type Default value Description
shapeParameter.userResources array of string [] A user resource tells the recognizer that you want to use the given resources for recognition of the current request.
shapeParameter.rejectDetectionSensitivity number 1
shapeParameter.doBeautification boolean true The Shape recognizer uses resources describing a set of recognizable shapes, and components defining each type of shape. Then, it sends back components in a beautified form, describing the shape’s type, which curves and line segments it uses, as well as their size and position. That way, you can reconstitute the shape as a vector object.
shapeParameter.rejectDetectionSensitivity number 1

### Music

Key Type Default value Description
musicParameter.divisions number 480
musicParameter.resultTypes array of string ['MUSICXML', 'SCORETREE'] Describes the format(s) required for the recognition result.
musicParameter.userResources array of string [] A user resource tells the recognizer that you want to use the given resources for recognition of the current request.
musicParameter.staff.top number 100 A staff is a set of five horizontal lines and four spaces that each represent a different musical pitch.
musicParameter.staff.count number 5
musicParameter.staff.gap number 20
musicParameter.clef.symbol string 'G'
musicParameter.clef.octave number 0
musicParameter.clef.line number 2
musicParameter.clef.scratchOutDetectionSensitivity number 1

### Analyzer

| analyzerParameter.textParameter.textProperties | object | {} | See text parameters | analyzerParameter.textParameter.language | string | 'en_US' | | analyzerParameter.textParameter.textInputMode | string | 'CURSIVE' | | analyzerParameter.coordinateResolution | string | undefined | ../../../reference/web/styling/ [custom_recognition]: ../../advanced/custom-recognition/ [restguide]: ../../rest/architecture/ [messages]: ../../websockets/messages/ [custom_resource]: ../../advanced/build-custom-resources/#Math [lexicon]:../../advanced/build-custom-resources/#lexicon