Class: Options

Constructor

Options

new Options(options)

Parse the user-specified options, using reasonable defaults where behaviour is unspecified.

Parameter

options

Blockly.BlocklyOptions

Dictionary of options. Specification: https://developers.google.com/blockly/guides/get-started/web#configuration

Value must not be null.

Properties

collapse

boolean

comments

boolean

disable

boolean

getMetrics

Return an object with the metrics required to size the workspace.

Returns

non-null Blockly.utils.Metrics Contains size and position metrics.

gridOptions

non-null Blockly.Options.GridOptions

gridPattern

nullable SVGElement

The SVG element for the grid pattern. Created during injection.

hasCategories

boolean

hasCss

boolean

hasScrollbars

Deprecated
January 2019

hasSounds

boolean

hasTrashcan

boolean

horizontalLayout

boolean

keyMap

non-null Object with Blockly.Action properties

languageTree

nullable Blockly.utils.toolbox.ToolboxInfo

maxBlocks

number

maxInstances

nullable Object with number properties

maxTrashcanContents

number

moveOptions

non-null Blockly.Options.MoveOptions

oneBasedIndex

boolean

parentWorkspace

Blockly.WorkspaceSvg

The parent of the current workspace, or null if there is no parent workspace. We can assert that this is of type WorkspaceSvg as opposed to Workspace as this is only used in a rendered workspace.

pathToMedia

string

plugins

non-null Object with (function(constructs unknown, repeatable unknown) or string) properties

Map of plugin type to name of registered plugin or plugin class.

readOnly

boolean

renderer

string

rendererOverrides

nullable Object

RTL

boolean

setMetrics

If set, sets the translation of the workspace to match the scrollbars.

Parameter

xyRatio

{x:number, y:number}

Contains an x and/or y property which is a float between 0 and 1 specifying the degree of scrolling.

Value must not be null.

Returns

void 

theme

non-null Blockly.Theme

toolboxPosition

non-null Blockly.utils.toolbox.Position

zoomOptions

non-null Blockly.Options.ZoomOptions

toolboxPosition

inner

non-null Blockly.utils.toolbox.Position

Abstract types

GridOptions

static

{colour: string, length: number, snap: boolean, spacing: number}

Grid Options.

MoveOptions

static

{drag: boolean, scrollbars: boolean, wheel: boolean}

Move Options.

ZoomOptions

static

{controls: boolean, maxScale: number, minScale: number, pinch: boolean, scaleSpeed: number, startScale: number, wheel: boolean}

Zoom Options.