Stay organized with collections Save and categorize content based on your preferences.

blockly > FieldAngle

FieldAngle class

Class for an editable angle field.

Signature:

export declare class FieldAngle extends FieldInput<number> 

Extends: FieldInput<number>

Constructors

Constructor Modifiers Description
(constructor)(opt_value, opt_validator, opt_config) Constructs a new instance of the FieldAngle class

Properties

Property Modifiers Type Description
CLOCKWISE

readonly

static

(not declared) Default property describing which direction makes an angle field's value increase. Angle increases clockwise (true) or counterclockwise (false).
gauge_ SVGPathElement | null The angle picker's gauge path depending on the value.
HALF

readonly

static

number Half the width of protractor image.
line_ SVGLineElement | null The angle picker's line drawn representing the value's angle.
OFFSET

readonly

static

(not declared) The default offset of 0 degrees (and all angles). Always offsets in the counterclockwise direction, regardless of the field's clockwise property. Usually either 0 (0 = right) or 90 (0 = up).
RADIUS

readonly

static

number Radius of protractor circle. Slightly smaller than protractor size since otherwise SVG crops off half the border at the edges.
ROUND

readonly

static

(not declared) The default amount to round angles to when using a mouse or keyboard nav input. Must be a positive integer to support keyboard navigation.
SERIALIZABLE boolean Serializable fields are saved by the serializer, non-serializable fields are not. Editable fields should also be serializable.
symbol_ protected SVGTSpanElement The degree symbol for this field.
WRAP

readonly

static

(not declared) The default maximum angle to allow before wrapping. Usually either 360 (for 0 to 359.9) or 180 (for -179.9 to 180).

Methods

Method Modifiers Description
configure_(config) protected Configure the field based on the given map of options.
doClassValidation_(opt_newValue) protected Ensure that the input value is a valid angle.
onHtmlInputKeyDown_(e) protected Handle key down to the editor.
onMouseMove_(e) protected Set the angle to match the mouse's position.
render_() protected Updates the graph when the field rerenders.
showEditor_(opt_e) protected Create and show the angle field's editor.