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

getMetrics

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

Returns

non-null Object Contains size and position metrics.

gridPattern

non-null SVGElement

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

hasScrollbars

Deprecated
January 2019

parentWorkspace

Blockly.Workspace

The parent of the current workspace, or null if there is no parent workspace.

setMetrics

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

Parameter

xyRatio

Object

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 

Method

parseToolboxTree

static

parseToolboxTree(tree) returns Node

Parse the provided toolbox tree into a consistent DOM format.

Parameter

tree

(Node or string)

DOM tree of blocks, or text representation of same.

Returns

Node DOM tree of blocks, or null.