Last updated

API / geotoolkit / map / util / BarScale / BarScale

Class: BarScale

util.BarScale.BarScale

Defines a graphical or bar scale object. Shape consists of one or two lines of bars and axis connected to it.

Hierarchy

Table of contents

Constructors
Methods
addCssClassaddInvalidateHandlerapplyOpacity
applyResponsiveStylecheckCollisionclone
connectStylecopyConstructordisconnectStyle
disposeenableEventPropagationexecute
filtergetAnchorgetAnchorType
getAnchorXgetAnchorYgetAnimationStyle
getAspectRatiogetBoundsgetClassName
getClipStylegetCssgetCssClass
getCssClassesgetCssTransformgetFillStyle
getFillStyleListgetHeightgetId
getInvalidateMethodgetIsPointingUpgetLabelMode
getLayoutStylegetLineStylegetLocalTransform
getMajorTickHeightgetMarginsStylegetMaxSize
getMinSizegetMinorTickHeightgetName
getOpacitygetOpacityBlendModegetParent
getPreserveAspectRatiogetPreserveReadingOrientationgetPreserveRightAngle
getPropertiesgetPropertygetPropertyKeys
getRenderingFiltergetResponsiveStylegetRoot
getRotationAnglegetScaleScrollStrategygetSceneTransform
getSecondSystemgetSizegetSizeIsInDeviceSpace
getSystemgetTaggetTextStyle
getTickPositiongetTickVisiblegetTicksAmount
getUseMinMaxSizegetVisiblegetWidth
getWorldTransformgetZIndexhasCssClass
hasEventListenerinvalidateinvalidateParent
isDisposedisEventPropagationEnabledisNotificationEnabled
isSelectableisSilentnotify
offononParentChanged
onVisibilityChangedpostRenderingpreRendering
registerAnimationStyleremoveCssClassremoveInvalidateHandler
renderrenderAsyncrotate
scalesetAnchorsetAnchorType
setAnchorXsetAnchorYsetAnimationStyle
setBoundssetClipStylesetCss
setCssClasssetCssTransformsetFillStyle
setFillStyleListsetHeightsetId
setIsPointingUpsetLabelModesetLayoutStyle
setLineStylesetLocalTransformsetMajorTickHeight
setMapScalesetMarginsStylesetMaxSize
setMinSizesetMinorTickHeightsetName
setNotificationsetOpacitysetPreserveAspectRatio
setPreserveReadingOrientationsetPreserveRightAnglesetProperties
setPropertysetRenderingFiltersetResponsiveStyle
setRotationAnglesetScaleScrollStrategysetSecondSystem
setSelectablesetSilentsetSize
setSizeIsInDeviceSpacesetSystemsetTag
setTextStylesetTickPositionsetTickVisible
setTicksAmountsetUseMinMaxSizesetVisible
setWidthsetZIndexshear
toStringtranslateunregisterAnimationStyle
updateSceneTransformationupdateStateupdateTimeStamp
enableSceneGraphNotificationfindParentgetAnchorPosition
getClassNameintersectsBoundsisSceneGraphNotificationEnabled
Css Properties
Name Type Description
alignmentAnchorTypeAlignment according to the anchor point
alignmentAnchorTypeAlignment for the scale object on the map widget
axnumberAnchor x position
aynumberAnchor y position
clipstyleClipStyleClipping style
clipstyle-evenoddbooleanTrue if evenodd mode is on ('nonzero' mode otherwise)
clipstyle-geometryGraphicsPathClipping geometry
clipstyle-geometry-boundsRectBounds
clipstyle-geometry-bounds-heightnumberHeight
clipstyle-geometry-bounds-readonlybooleanReadonly
clipstyle-geometry-bounds-widthnumberWidth
clipstyle-geometry-bounds-xnumberLeft
clipstyle-geometry-bounds-ynumberTop
clipstyleGraphicsPathClipping style
cssclassstringThe css class name of this node
csscursorstringCSS cursor associated with node
cssstylestringCSS style to be applied to inserted elements
fillstylestringStyle applied on fill
fillstyleFillStyleStyle applied on fill
fillstyle-colorstringColor in CSS form
fillstyle-evenoddmodebooleanEven-odd fill mode
fillstyle-fillpatternPatternPattern
fillstyle-fillpattern-containernamestringAn optional container name, which creates an image pattern. This parameter is used for serialization if you want to save are reference to pattern instead of the pattern itself
fillstyle-fillpattern-patternnamestringName of this pattern for indexing
fillstyle-fillpattern-scalablebooleanFlag that sets scalability of the pattern coordinates, or relative to the shape it is filling (It is not supported)
fillstyle-foregroundstringForeground color
fillstyle-patternPatternPattern
heightnumberShape height
idstring | numberId of the node, its a unique identifier
ispointingupbooleanDefines whether the shape is always pointing up
labelmodeBarScaleLabelModeBar scale axis label mode (what labels are shown)
layoutstyleLayoutStyleLayout style to specify how to lay out shape
layoutstyle-constraintSizeConstraintLayout constrains
layoutstyle-flexgrownumberNumber specifying how much the item will grow relative to the rest of the items inside the same container
layoutstyle-flexshrinknumberNumber specifying how much the item will shrink relative to the rest of the items inside the same container
layoutstyle-floatstringFloat position
layoutstyle-positionstringLayout position
layoutstyle-sizenumber | stringLayout size
linestylestringStyle applied on outline
linestyleLineStyleStyle applied on outline
linestyle-colorstringColor in CSS form
linestyle-fillstringOptional fill style to be used to fill lines generated with this style
linestyle-fillFillStyleOptional fill style to be used to fill lines generated with this style
linestyle-linecapCapStyleThe line cap style
linestyle-linedashoffsetnumberLine dash offset of dashed line
linestyle-linejoinJoinStyleThe line join style
linestyle-pixelsnapmodebooleanPixel Snap Mode, default(
linestyle-scalablebooleanTrue if width should depend on transformation
linestyle-unitstringOptional unit for the width
linestyle-widthnumber | stringThe line thickness
localtransformTransformationLocal transformation
localtransform-dxnumberX axis translation
localtransform-dynumberY axis translation
localtransform-xxnumberX scale
localtransform-xynumberXy skew
localtransform-yxnumberYx skew
localtransform-yynumberY scale
majortickheightnumberHeight from 0 to 1 (where 1 means full shape height) for the far left and right bar scale ticks
marginsnumber | stringIt has properties for specifying the margins for each side
maxdimensionDimensionMaximum size for rendering
maxdimension-heightnumberHeight of dimension
maxdimension-widthnumberWidth of dimension or properties
mindimensionDimensionMinimum size for rendering
minortickheightnumberHeight from 0 to 1 (where 1 means full shape height) for the inner bar scale ticks
namestringName of the node. It is often used for debugging purposes or to simplify queries
opacitynumberNode opacity (from 0 to 1). If it is undefined or null it inherits property from the parent. It changes globalAlpha on the rendering context
opacityblendmodeBlendModeNode opacity mode to blend it
preserveaspectratiobooleanPreserve aspect ratio of the anchored shape
preservereadingorientationbooleanPreserve reading orientation for local transform
preserverightanglebooleanPreserve right angle for local transformation
rotationanglenumberRotation angle at anchor
scalescrollstrategyScaleScrollStrategyScale scroll strategy
scalescrollstrategy-enabledbooleanEnable flag
secondsystemUnitSystemUnit system to use for the second line (null to use one bars line only)
selectablebooleanSelectable node, a boolean to determine if selection should consider this node
sizeisindevicespacebooleanIs coordinate in device space
systemUnitSystemUnit system to use
taganyCustom information associated with node. It is a user object which can be used by client code to store information or attach an application object to the shape
textalignAnchorTypeAlignment for the text label on the scale object
textstylestringLabel text style or object with properties see
textstyleTextStyleLabel text style or object with properties see
textstyle-alignmentAlignmentStyleAlignment
textstyle-autosizebooleanAuto font size on high definition display
textstyle-backgroundstringBackground style
textstyle-backgroundFillStyleBackground style
textstyle-baselineBaseLineStyleBase line
textstyle-colorstringColor in CSS form
textstyle-fillFillStyleText fill style
textstyle-fontstringFont see
textstyle-fonturlstringThe place from which the font will be loaded, if null - uses system fonts. It can be base64 with url keyword
textstyle-lineheightstring | numberLine height
textstyle-multilinebooleanAllow multi-line text
textstyle-outlinestringOutline style
textstyle-outlineLineStyleOutline style
textstyle-overflowwrapOverflowWrapStyleOverflow wrap
textstyle-strikethroughstringStrikethrough style
textstyle-strikethroughLineStyleStrikethrough style
textstyle-textoverflowTextOverflowStyleText overflow
textstyle-underlinestringUnderline style
textstyle-underlineLineStyleUnderline style
textstyle-underlineoffsetstring | numberUnderline offset distance
textstyle-whitespaceWhiteSpaceStyleWhite space
textstyle-wordbreakWordBreakStyleWord break
tickheightnumberTick height from 0 to 1 (where 1 means full shape height)
tickpositionTickPositionPosition for the ticks (and their labels) relative to the main bar scale shape
ticksamountnumberThe amount of bar rectangular tick bars
tickvisiblebooleanTrue to show the tick lines, false otherwise
transformstringAdditional CSS transformation applied to node or 'none'
transformTransformationAdditional CSS transformation applied to node or 'none'
useminmaxdimensionsbooleanUse the min max dimensions to limit visual size
visiblebooleanVisibility of the node, a boolean to determine if the node should be rendered or not
widthnumberShape width
xnumberHorizontal position offset (in px)
ynumberVertical position offset (in px)
z-indexnumberDefine node z-index

Contents

Constructors

new BarScale(options)

new BarScale(options?)

Parameters

Name Type Description
Optional optionsOptionsbar scale object options

Overrides

MapScale.constructor

Methods

addCssClass

addCssClass(cssclass): BarScale

Adds new css class to node

Parameters

Name Type Description
cssclassstring | string[]css class name('s)

Returns

BarScale

this

Inherited from

MapScale.addCssClass


addInvalidateHandler

addInvalidateHandler(handler): BarScale

Add invalidate handler

Deprecated

since 4.0, use Node.on instead

Parameters

Name Type Description
handlerFunctionhandler to be notified about invalidation

Returns

BarScale

this

Inherited from

MapScale.addInvalidateHandler


applyOpacity

Protected applyOpacity(context): BarScale

This method is called to apply opacity if it is specified on the rendering context. The default implementation sets global alpha on the rendering context

Parameters

Name Type Description
contextRenderingContextRendering Context

Returns

BarScale

this

Inherited from

MapScale.applyOpacity


applyResponsiveStyle

Protected applyResponsiveStyle(): void

Apply a responsive style rules it is exists

Returns

void

Inherited from

MapScale.applyResponsiveStyle


checkCollision

checkCollision(context): boolean

Check if this node is within the area being rendered by the context

Parameters

Name Type Description
contextRenderingContextRendering Context

Returns

boolean

true if object is inside of renderable area

Inherited from

MapScale.checkCollision


clone

clone(): Node

All subclasses should override copyConstructor or provide custom implementation for this method

Returns

Node

clone

Inherited from

MapScale.clone


connectStyle

connectStyle(style, type, callback): BarScale

Connects style.

This convenience method subscribes a listener to given style for the specified type.
And automatically un-subscribes listener if node is disposed to prevent memory leaks

Parameters

Name Type Description
styleEventDispatcherconnect style
typestringtype of event or property
callbackAttributeCallback<EventDispatcher>function to be called

Returns

BarScale

this

Inherited from

MapScale.connectStyle


copyConstructor

Protected copyConstructor(src, deepCopy?): BarScale

Copy constructor function.
Function used as part of the cloning mechanism.
Implementations should copy the given instance state to this instance.

Parameters

Name Type Description
srcBarScaleSource to copy from
Optional deepCopybooleandeep copy

Returns

BarScale

this

Overrides

MapScale.copyConstructor


disconnectStyle

disconnectStyle(style, type, callback): BarScale

Disconnect style
This convenience method un-subscribes a listener to given style for the specified type.

Parameters

Name Type Description
styleEventDispatcherconnect style
typestringtype of event or property
callbackAttributeCallback<EventDispatcher>function to be called

Returns

BarScale

this

Inherited from

MapScale.disconnectStyle


dispose

dispose(): void

Disposes this node, once disposes a node should not be used anymore.
Clear all listeners, and disconnect styles to avoid memory leaks.
Also aggressively 'cleanup' this node by setting some of its members to null.

Returns

void

Inherited from

MapScale.dispose


enableEventPropagation

enableEventPropagation(enable): BarScale

Enable event propagation from the node hierarchy from bottom to top

This option is similar to DOM Event bubbling, which allows to get any event from child node. By default it is disabled for better performance.

Example

import {Group} from '@int/geotoolkit/scene/Group';
import {Events as SceneEvents} from '@int/geotoolkit/scene/Node';
const parentGroup = new Group()
.setName('ParentGroup')
.enableEventPropagation(true);
const childGroup = new Group()
.setName('ChildGroup');

parentGroup.addChild(childGroup);
parentGroup.on(SceneEvents.Invalidate, (eventName, sender, args) => {
// Got notifications from all children of parent group
});
childGroup.invalidate();

Parameters

Name Type Description
enablebooleanenable

Returns

BarScale

this

Inherited from

MapScale.enableEventPropagation


execute

execute(delegate): BarScale

Executes delegate and return the result. It allows us to keep all initialization calls in one place,
and we do not need to scroll up or down in IDE to find how and where it was initialized.

Example

// All setters (.setName() for example) returns reference to the this.
// In order to modify inner object like LineStyle or Pattern, to get this object (property) we should call getter to get object reference.
// Then modify it as shown below in Option 1 or you can use execute methods shown in Option 2.
import {Group} from '@int/geotoolkit/scene/Group';
import {Rect} from '@int/geotoolkit/util/Rect';
// Option 1
const group = new Group()
.setName('MyGroup')
.setBounds(new Rect(0, 0, 42, 16))
.enableClipping(true)
.setTag({'type': 'sometype'});

group.getLineStyle().setPattern('pattern');
return group;

// Options 2 ( using execute method )
return group
.execute(function () {
this.getLineStyle()
.setPattern("pattern");
});

Parameters

Name Type Description
delegate(this: BarScale) => voidFunction to execute

Returns

BarScale

The result if any or this

Inherited from

MapScale.execute

execute<T>(delegate): T

Type parameters

Name
T

Parameters

Name Type
delegate(this: BarScale) => T

Returns

T

Inherited from

MapScale.execute


filter

Protected filter(context): boolean

Filter node

Parameters

Name Type Description
contextRenderingContextRendering Context

Returns

boolean

flag filter flag ("true" to render node; "false" otherwise)

Inherited from

MapScale.filter


getAnchor

getAnchor(tr?): Point

Gets the anchor

Parameters

Name Type Description
Optional trTransformationtransformation to transform anchor

Returns

Point

Inherited from

MapScale.getAnchor


getAnchorType

getAnchorType(): AnchorType

Returns the current anchor type.

Returns

AnchorType

current anchor type

Inherited from

MapScale.getAnchorType


getAnchorX

getAnchorX(): number

Return anchored x position

Returns

number

Inherited from

MapScale.getAnchorX


getAnchorY

getAnchorY(): number

Return anchored y position

Returns

number

Inherited from

MapScale.getAnchorY


getAnimationStyle

getAnimationStyle(): AnimationStyle

Return animation style

Returns

AnimationStyle

animationStyle current animation style

Inherited from

MapScale.getAnimationStyle


getAspectRatio

getAspectRatio(): number

Returns aspect ratio of the content of the shape Returns 1

Returns

number

Inherited from

MapScale.getAspectRatio


getBounds

getBounds(): Rect

Return bound in the parent coordinates

Returns

Rect

Inherited from

MapScale.getBounds


getClassName

getClassName(): string

Returns

string

Inherited from

MapScale.getClassName


getClipStyle

getClipStyle(): ClipStyle

Gets the current clipping style

Returns

ClipStyle

clipping style

Inherited from

MapScale.getClipStyle


getCss

getCss(): CssStyle

Return CSS style

Returns

CssStyle

Inherited from

MapScale.getCss


getCssClass

getCssClass(): string

Returns css class name to be used to apply CSS style

Returns

string

the css class name

Inherited from

MapScale.getCssClass


getCssClasses

getCssClasses(): string[]

Gets list of css class names which applied to this node

Returns

string[]

Inherited from

MapScale.getCssClasses


getCssTransform

getCssTransform(): string

Returns CSS transformation

Returns

string

Inherited from

MapScale.getCssTransform


getFillStyle

getFillStyle(): FillStyle

Return fill style

Returns

FillStyle

fillStyle current fill style

Inherited from

MapScale.getFillStyle


getFillStyleList

getFillStyleList(): FillStyle[]

Returns list of fill styles used for the bar scale rectangular sections

Returns

FillStyle[]


getHeight

getHeight(): number

Return height of the shape

Returns

number

Inherited from

MapScale.getHeight


getId

getId(): string | number

Returns the associated identifier of the node

Returns

string | number

The node's id

Inherited from

MapScale.getId


getInvalidateMethod

Protected getInvalidateMethod(): AttributeCallback<EventDispatcher>

Gets invalidate method

Returns

AttributeCallback<EventDispatcher>

method to invalidate this object

Inherited from

MapScale.getInvalidateMethod


getIsPointingUp

getIsPointingUp(): boolean

Returns true if the shape is always pointing up

Returns

boolean

true if the shape is always pointing up

Inherited from

MapScale.getIsPointingUp


getLabelMode

getLabelMode(): BarScaleLabelMode

Returns current bar scale axis label mode

Returns

BarScaleLabelMode


getLayoutStyle

getLayoutStyle(): LayoutStyle<string | number>

Return desired layout style

Returns

LayoutStyle<string | number>

Inherited from

MapScale.getLayoutStyle


getLineStyle

getLineStyle(): LineStyle

Return line style

Returns

LineStyle

lineStyle current line style

Inherited from

MapScale.getLineStyle


getLocalTransform

getLocalTransform(): Transformation

Retrieves the transformation of bounds to parent

Returns

Transformation

transform the local transform.

Inherited from

MapScale.getLocalTransform


getMajorTickHeight

getMajorTickHeight(): number

Returns major ticks height

Returns

number


getMarginsStyle

getMarginsStyle(): SpaceStyle<string | number>

Return margins style

Returns

SpaceStyle<string | number>

Inherited from

MapScale.getMarginsStyle


getMaxSize

getMaxSize(): Dimension

returns the maximum device space rendering dimension only works when setUseMinMaxSize is enabled.

Returns

Dimension

max size

Inherited from

MapScale.getMaxSize


getMinSize

getMinSize(): Dimension

returns the minimum device space rendering dimension only works when setUseMinMaxSize is enabled.

Returns

Dimension

min size

Inherited from

MapScale.getMinSize


getMinorTickHeight

getMinorTickHeight(): number

Returns minor ticks height

Returns

number


getName

getName(): string

Returns the node name

Returns

string

The node name

Inherited from

MapScale.getName


getOpacity

getOpacity(): number

Returns current node opacity

Returns

number

opacity

Inherited from

MapScale.getOpacity


getOpacityBlendMode

getOpacityBlendMode(): BlendMode

Returns current node opacity

Returns

BlendMode

opacity blend mode

Inherited from

MapScale.getOpacityBlendMode


getParent

getParent(): Node

Return parent node

Returns

Node

parent node

Inherited from

MapScale.getParent


getPreserveAspectRatio

getPreserveAspectRatio(): boolean

Returns true if aspect ratio is preserved

Returns

boolean

true if aspect ratio is preserved

Inherited from

MapScale.getPreserveAspectRatio


getPreserveReadingOrientation

getPreserveReadingOrientation(): boolean

Returns true if the shape is always in a readable orientation

Returns

boolean

true if the shape is always in a readable orientation

Inherited from

MapScale.getPreserveReadingOrientation


getPreserveRightAngle

getPreserveRightAngle(): boolean

Returns true if right angles are preserved

Returns

boolean

true if right angles are preserved

Inherited from

MapScale.getPreserveRightAngle


getProperties

getProperties(): OptionsOut

Returns properties

Returns

OptionsOut

bar scale properties

Overrides

MapScale.getProperties


getProperty

getProperty(name): any

Gets dynamic property by name. These properties can be used as a property bags

Parameters

Name Type Description
namestringproperty name

Returns

any

Inherited from

MapScale.getProperty


getPropertyKeys

getPropertyKeys(): string[]

Returns known properties keys

Returns

string[]

Inherited from

MapScale.getPropertyKeys


getRenderingFilter

getRenderingFilter(): IFilter

Return filter to be used for rendering and picking

Returns

IFilter

current filter

Inherited from

MapScale.getRenderingFilter


getResponsiveStyle

getResponsiveStyle(): ResponsiveStyle

Return responsive style

Returns

ResponsiveStyle

Inherited from

MapScale.getResponsiveStyle


getRoot

getRoot(): Node

Returns root node.
If node doesn't have parent then it returns itself.

Returns

Node

the root node

Inherited from

MapScale.getRoot


getRotationAngle

getRotationAngle(): number

Returns rotation angle (in radians)

Returns

number

rotationAngle rotation angle at anchor

Inherited from

MapScale.getRotationAngle


getScaleScrollStrategy

getScaleScrollStrategy(): Delegate

Gets scale scroll strategy

Returns

Delegate

scale scroll strategy

Inherited from

MapScale.getScaleScrollStrategy


getSceneTransform

getSceneTransform(): Transformation

Returns transformation from node to root scene

Returns

Transformation

a transformation from node to root scene

Inherited from

MapScale.getSceneTransform


getSecondSystem

getSecondSystem(): UnitSystem

Returns current system for the second bar line

Returns

UnitSystem


getSize

getSize(): Dimension

Returns the size as a dimension object.

Returns

Dimension

size

Inherited from

MapScale.getSize


getSizeIsInDeviceSpace

getSizeIsInDeviceSpace(): boolean

Returns true if the shape size is set in device space

Returns

boolean

true if size is defined in device space

Inherited from

MapScale.getSizeIsInDeviceSpace


getSystem

getSystem(): UnitSystem

Returns current unit system

Returns

UnitSystem

Inherited from

MapScale.getSystem


getTag

getTag(): any

Returns the object associated with the node by user.

Returns

any

The node's user-object

Inherited from

MapScale.getTag


getTextStyle

getTextStyle(): TextStyle

Returns the style associated with this map scale text

Returns

TextStyle

Inherited from

MapScale.getTextStyle


getTickPosition

getTickPosition(): TickPosition

Returns scale tick position

Returns

TickPosition


getTickVisible

getTickVisible(): boolean

Returns current tick visibility

Returns

boolean


getTicksAmount

getTicksAmount(): number

Returns current ticks amount

Returns

number


getUseMinMaxSize

getUseMinMaxSize(): boolean

true if using the min max device space sizes

Returns

boolean

true if using the min max device space sizes

Inherited from

MapScale.getUseMinMaxSize


getVisible

getVisible(): boolean

Return visibility of the node

Returns

boolean

true if node is visible

Inherited from

MapScale.getVisible


getWidth

getWidth(): number

Return width of the shape

Returns

number

Inherited from

MapScale.getWidth


getWorldTransform

getWorldTransform(): Transformation

Retrieves the local transformation of the node which represents multiplication of parent to bounds and contents transformations.

Returns

Transformation

transform the world transform.

Inherited from

MapScale.getWorldTransform


getZIndex

getZIndex(): number

Returns node z-index (null if not set)

Returns

number

Inherited from

MapScale.getZIndex


hasCssClass

hasCssClass(cssClass): boolean

Check if node has specified css class

Parameters

Name Type Description
cssClassstringcss class name

Returns

boolean

Inherited from

MapScale.hasCssClass


hasEventListener

hasEventListener(type, callback?): boolean

Check if a list of event listeners for this type contains this listener

Parameters

Name Type Description
typestringtype of event or property
Optional callbackFunctionto be called, if null, check if any callback is registered

Returns

boolean

Inherited from

MapScale.hasEventListener


invalidate

invalidate(bounds?, force?): BarScale

Invalidate area of the shape. This method invalidates parent by default. invalidated from parent to root node.

Parameters

Name Type Description
Optional boundsRectbounds of the invalid rectangle in the inner node coordinates
Optional forcebooleantrue if parent should be invalidated immediately if null is provided then cache (if any will be completely refreshed) otherwise only specified rect or node.bounds will be refreshed

Returns

BarScale

this

Inherited from

MapScale.invalidate


invalidateParent

invalidateParent(bounds?, force?): BarScale

Invalidate bounds

Parameters

Name Type Description
Optional boundsRectif null is provided then cache (if any will be completely refreshed) otherwise only specified rect or node.bounds will be refreshed
Optional forcebooleanflag indicating if the parent must be forcibly invalidated

Returns

BarScale

this

Inherited from

MapScale.invalidateParent


isDisposed

isDisposed(): boolean

Returns whether this object has been disposed

Returns

boolean

Inherited from

MapScale.isDisposed


isEventPropagationEnabled

isEventPropagationEnabled(): boolean

Return true if event propagation is enabled from child to parent

Returns

boolean

Inherited from

MapScale.isEventPropagationEnabled


isNotificationEnabled

isNotificationEnabled(): boolean

return state of notification

Returns

boolean

current notification state

Inherited from

MapScale.isNotificationEnabled


isSelectable

isSelectable(): boolean

Returns true if node can be picked/selected.

Returns

boolean

The selectable flag

Inherited from

MapScale.isSelectable


isSilent

isSilent(): boolean

Return true if the event dispatcher doesn't notify any events

Returns

boolean

Inherited from

MapScale.isSilent


notify

notify<E>(event, source, args?): BarScale

Notify listeners of the Node

Type parameters

NameType
Eextends string

Parameters

Name Type Description
eventEtype of event
sourceAbstractNodesource who called the event
Optional argsEventMap[E]event arguments

Returns

BarScale

this

Inherited from

MapScale.notify


off

off<E>(type?, callback?): BarScale

Detach listener on event. Calling .off() with no arguments removes all attached listeners. Calling .off(type) with no callback removes all attached listeners for specific type.

Type parameters

NameType
Eextends string

Parameters

Name Type Description
Optional typeEtype of the event
Optional callback(eventType: E, sender: BarScale, args: EventMap[E]) => voidfunction to be called

Returns

BarScale

this

Inherited from

MapScale.off


on

on<E>(type, callback): BarScale

Attach listener on event that will be called whenever the specified event is delivered to the target

If the callback function is already in the list of event listeners for this target, the function is not added a second time.

If a particular anonymous function is in the list of event listeners registered for a certain target, and then later in the code, an identical anonymous function is given in an "on" call, the second function will also be added to the list of event listeners for that target.

Type parameters

NameType
Eextends string

Parameters

Name Type Description
typeEtype of event or property
callback(eventType: E, sender: BarScale, args: EventMap[E]) => voidto be called

Returns

BarScale

this

Inherited from

MapScale.on


onParentChanged

Protected onParentChanged(node): BarScale

This method is called when parent changes. Do not call it directly.

Parameters

Name Type Description
nodeNodenode to change parent

Returns

BarScale

this

Inherited from

MapScale.onParentChanged


onVisibilityChanged

Protected onVisibilityChanged(): void

This method is called if visibility is changed. Send event Events.VisibilityChanged

Returns

void

Inherited from

MapScale.onVisibilityChanged


postRendering

Protected postRendering(context): void

To be called after rendering. Call this method if you override method render

Parameters

Name Type Description
contextRenderingContextRendering Context

Returns

void

Inherited from

MapScale.postRendering


preRendering

Protected preRendering(context): void

Occurs before rendering this method sets clipping by default. Call this method if you override method render

Parameters

Name Type Description
contextRenderingContextRendering Context

Returns

void

Inherited from

MapScale.preRendering


registerAnimationStyle

registerAnimationStyle(root): void

Register animation style.

Parameters

Name Type Description
rootNoderoot node for node

Returns

void

Inherited from

MapScale.registerAnimationStyle


removeCssClass

removeCssClass(cssclass): BarScale

Removes css class from node

Parameters

Name Type Description
cssclassstring | string[]css class name('s)

Returns

BarScale

this

Inherited from

MapScale.removeCssClass


removeInvalidateHandler

removeInvalidateHandler(handler): BarScale

Remove invalidate handler

Deprecated

since 4.0, use Node.off instead

Parameters

Name Type Description
handlerFunctionhandler to be notified about invalidation

Returns

BarScale

this

Inherited from

MapScale.removeInvalidateHandler


render

render(context): void

Renders itself

Parameters

Name Type Description
contextRenderingContextRendering Context

Returns

void

Inherited from

MapScale.render


renderAsync

renderAsync(context, callback): void

Render node in asynchronous mode. Default implementation creates call method "render" inside

Parameters

Name Type Description
contextRenderingContextThe rendering context to be used to draw the node
callback() => voidcallback function

Returns

void

Inherited from

MapScale.renderAsync


rotate

rotate(theta, x?, y?): BarScale

Rotate bounds around a given coordinate or anchor point

Parameters

Name Type Description
thetanumberangle to rotate node, in radians
Optional xnumberx coordinate to rotate around, use anchor-x if not specified
Optional ynumbery coordinate to rotate around, use anchor-y if not specified

Returns

BarScale

this

Inherited from

MapScale.rotate


scale

scale(xx, yy): BarScale

Scale node

Parameters

Name Type Description
xxnumberx scale factor
yynumbery scale factor

Returns

BarScale

this

Inherited from

MapScale.scale


setAnchor

setAnchor(p): BarScale

Sets anchor point to given position

Parameters

Name Type Description
pPointpoint

Returns

BarScale

this

Inherited from

MapScale.setAnchor

setAnchor(x, y): BarScale

Sets anchor point to given position

Parameters

Name Type Description
xnumberx coordinate
ynumbery coordinate

Returns

BarScale

this

Inherited from

MapScale.setAnchor


setAnchorType

setAnchorType(alignment): BarScale

Sets the anchor type.

Parameters

Name Type Description
alignmentAnchorTypeanchor alignment

Returns

BarScale

this

Inherited from

MapScale.setAnchorType


setAnchorX

setAnchorX(ax): BarScale

Sets x anchor position

Parameters

Name Type Description
axnumberanchor x position

Returns

BarScale

this

Inherited from

MapScale.setAnchorX


setAnchorY

setAnchorY(ay): BarScale

Sets y anchor position

Parameters

Name Type Description
aynumberanchor x position

Returns

BarScale

this

Inherited from

MapScale.setAnchorY


setAnimationStyle

setAnimationStyle(animationStyle): BarScale

Sets animation style

Parameters

Name Type Description
animationStyleTypeanimation style

Returns

BarScale

Inherited from

MapScale.setAnimationStyle


setBounds

setBounds(bounds): BarScale

Sets bounds of the node in the parent coordinates. This method takes anchor position and width and height if size is not in device space. This method was added to support layout.

Parameters

Name Type Description
boundsRectbound of the node in the parent coordinates

Returns

BarScale

this

Inherited from

MapScale.setBounds


setClipStyle

setClipStyle(style): BarScale

Sets a new clipping style

Parameters

Name Type Description
styleGraphicsPath | ClipStyle | Optionsa new clipping style

Returns

BarScale

this

Inherited from

MapScale.setClipStyle


setCss

setCss(style, merge?): BarScale

Sets CSS style. This style will be applied for all inserted elements

Parameters

Name Type Description
styleTypeCSS style to be applied to inserted elements
Optional mergebooleanmerge flag

Returns

BarScale

this

Inherited from

MapScale.setCss


setCssClass

setCssClass(name): BarScale

Sets css class name of the node to be used to apply CSS style

Parameters

Name Type Description
namestringcss class name of the node

Returns

BarScale

this

Inherited from

MapScale.setCssClass


setCssTransform

setCssTransform(transform): BarScale

Set CSS transformation

Parameters

Name Type Description
transformstring | Transformationtransformation css transformation instruction or Transformation instance

Returns

BarScale

this

Inherited from

MapScale.setCssTransform


setFillStyle

setFillStyle(fillStyle, merge?): BarScale

Sets fill style

Parameters

Name Type Description
fillStyleTypea new fill style
Optional mergebooleantrue if you want to merge fillStyle with existing attribute, false by default

Returns

BarScale

this

Inherited from

MapScale.setFillStyle


setFillStyleList

setFillStyleList(styles): BarScale

Sets fill style list for the bar scale rectangular sections

Parameters

Name Type Description
stylesType[]fill styles

Returns

BarScale

this


setHeight

setHeight(height): BarScale

Sets height of the shape

Parameters

Name Type Description
heightnumberheight of the shape

Returns

BarScale

this

Inherited from

MapScale.setHeight


setId

setId(id): BarScale

Allows the user to associate any identifier

Parameters

Name Type Description
idstring | numberobject id

Returns

BarScale

this

Inherited from

MapScale.setId


setIsPointingUp

setIsPointingUp(isPointingUp): BarScale

Sets whether the shape is always pointing up. Particularly useful for text.

Parameters

Name Type Description
isPointingUpbooleanflag setting whether the shape is always pointing up

Returns

BarScale

this

Inherited from

MapScale.setIsPointingUp


setLabelMode

setLabelMode(mode): BarScale

Sets bar scale axis label mode

Parameters

Name Type Description
modeBarScaleLabelModebar scale axis label mode (what labels are shown)

Returns

BarScale

this


setLayoutStyle

setLayoutStyle(layoutStyle, merge?): BarScale

Specify desired layout style

Parameters

Name Type Description
layoutStyleLayoutStyle<string | number> | Options<string | number>desired layout style
Optional mergebooleantrue if you want to merge layoutStyle with existing attribute, false by default

Returns

BarScale

Inherited from

MapScale.setLayoutStyle


setLineStyle

setLineStyle(lineStyle, merge?): BarScale

Sets line style

Parameters

Name Type Description
lineStyleTypeline style or options
Optional mergebooleantrue if you want to merge lineStyle with existing attribute, false by default

Returns

BarScale

this

Inherited from

MapScale.setLineStyle


setLocalTransform

setLocalTransform(localTransform, force?): BarScale

Sets local transformation to be used to transform from local to parent coordinate

Parameters

Name Type Description
localTransformTransformationlocal transformation for this node
Optional forcebooleanboolean flag to force update event if transformations are equal, false by default

Returns

BarScale

this

Inherited from

MapScale.setLocalTransform


setMajorTickHeight

setMajorTickHeight(value): BarScale

Sets major (far left and right) ticks height value

Parameters

Name Type Description
valuenumbermajor ticks height

Returns

BarScale

this


setMapScale

setMapScale(scale): BarScale

Sets scale

Parameters

Name Type Description
scalenumberscale to set

Returns

BarScale

this

Inherited from

MapScale.setMapScale


setMarginsStyle

setMarginsStyle(margins, merge?): BarScale

Sets margins style

Parameters

Name Type Description
marginsType<string | number>margins style
Optional mergebooleantrue if you want to merge marginsStyle with existing attribute, false by default

Returns

BarScale

this

Inherited from

MapScale.setMarginsStyle


setMaxSize

setMaxSize(maxSize): BarScale

sets the maximum device space rendering dimension

Parameters

Name Type Description
maxSizeDimensionmaximum device space rendering dimension

Returns

BarScale

Inherited from

MapScale.setMaxSize


setMinSize

setMinSize(minSize): BarScale

sets the minimum device space rendering dimension only works when setUseMinMaxSize is enabled.

Parameters

Name Type Description
minSizeDimensionminimum device space rendering dimension

Returns

BarScale

this

Inherited from

MapScale.setMinSize


setMinorTickHeight

setMinorTickHeight(value): BarScale

Sets minor (inner) ticks height value

Parameters

Name Type Description
valuenumberminor ticks height

Returns

BarScale

this


setName

setName(name): BarScale

Sets name of the node

Parameters

Name Type Description
namestringThe node name

Returns

BarScale

this

Inherited from

MapScale.setName


setNotification

setNotification(notify, force?): BarScale

set notification state

Parameters

Name Type Description
notifybooleanflag set to invalidate parent or not
Optional forcebooleantrue if parent should be invalidated immediately

Returns

BarScale

this

Inherited from

MapScale.setNotification


setOpacity

setOpacity(opacity, blendMode?): BarScale

Sets node opacity

Parameters

Name Type Description
opacitynumbernode opacity from 0 to 1
Optional blendModeBlendModeopacity blend mode. If it is normal, opacity will be replaced.

Returns

BarScale

this

Inherited from

MapScale.setOpacity


setPreserveAspectRatio

setPreserveAspectRatio(preserveAspectRatio): BarScale

Sets whether aspect ratio is preserved

Parameters

Name Type Description
preserveAspectRatiobooleanflag Sets whether aspect ratio is preserved

Returns

BarScale

this

Inherited from

MapScale.setPreserveAspectRatio


setPreserveReadingOrientation

setPreserveReadingOrientation(preserveReadingOrientation): BarScale

Sets whether the shape is always in a readable orientation. Particularly useful for text. Prevents mirror effects

Parameters

Name Type Description
preserveReadingOrientationbooleansets flag whether the shape is always in a readable orientation

Returns

BarScale

this

Inherited from

MapScale.setPreserveReadingOrientation


setPreserveRightAngle

setPreserveRightAngle(preserveRightAngle): BarScale

Sets whether right angles are preserved

Parameters

Name Type Description
preserveRightAnglebooleanflag setting if right angles are preserved

Returns

BarScale

this

Inherited from

MapScale.setPreserveRightAngle


setProperties

setProperties(props?): BarScale

Sets bar scale object properties

Parameters

Name Type Description
Optional propsOptionsbar scale properties

Returns

BarScale

this

Overrides

MapScale.setProperties


setProperty

setProperty(name, value): BarScale

Sets dynamic property by name

Parameters

Name Type Description
namestringproperty name
valueanyproperty value

Returns

BarScale

this

Inherited from

MapScale.setProperty


setRenderingFilter

setRenderingFilter(filter): BarScale

Sets filter to be applied before rendering and picking

Parameters

Name Type Description
filterIFilterfilter to set

Returns

BarScale

this

Inherited from

MapScale.setRenderingFilter


setResponsiveStyle

setResponsiveStyle(style): BarScale

Sets responsive style.

Parameters

Name Type Description
styleOptions | ResponsiveStyleresponsive style

Returns

BarScale

this

Inherited from

MapScale.setResponsiveStyle


setRotationAngle

setRotationAngle(rotationAngle): BarScale

Set rotation angle

Parameters

Name Type Description
rotationAnglenumberrotation angle (in radians) at anchor

Returns

BarScale

this

Inherited from

MapScale.setRotationAngle


setScaleScrollStrategy

setScaleScrollStrategy(strategy?): BarScale

Sets scale scroll strategy

Parameters

Name Type Description
Optional strategyDelegatescale scroll strategy

Returns

BarScale

this

Inherited from

MapScale.setScaleScrollStrategy


setSecondSystem

setSecondSystem(system): BarScale

Sets unit system to use for the second bar line (null to use one bars line only)

Parameters

Name Type Description
systemUnitSystemsystem for the second bar line

Returns

BarScale

this


setSelectable

setSelectable(selectable): BarScale

Allows to select node. If node is not selectable then child node is not selectable.

Parameters

Name Type Description
selectablebooleanflag to allow node selection

Returns

BarScale

this

Inherited from

MapScale.setSelectable


setSilent

setSilent(bool): BarScale

Set silent mode

Parameters

Name Type Description
boolbooleanflag to enable silent mode

Returns

BarScale

this

Inherited from

MapScale.setSilent


setSize

setSize(width, height?): BarScale

Sets size of the shape, will accept a width and height number or a Dimension object.

Parameters

Name Type Description
widthnumber | Dimension | Optionswidth of the shape
Optional heightnumberheight of the shape

Returns

BarScale

this

Inherited from

MapScale.setSize


setSizeIsInDeviceSpace

setSizeIsInDeviceSpace(sizeIsInDeviceSpace): BarScale

Sets whether the shape size is set in device space.

Parameters

Name Type Description
sizeIsInDeviceSpacebooleantrue if the shape size is fixed in device space; otherwise, false.

Returns

BarScale

this

Inherited from

MapScale.setSizeIsInDeviceSpace


setSystem

setSystem(system): BarScale

Sets unit system to use

Parameters

Name Type Description
systemUnitSystemunit system

Returns

BarScale

this

Inherited from

MapScale.setSystem


setTag

setTag(tag): BarScale

Allows the user to associate any arbitrary object with the node.

Parameters

Name Type Description
taganyThe object to be associated with the node.

Returns

BarScale

this

Inherited from

MapScale.setTag


setTextStyle

setTextStyle(textStyle, merge?): BarScale

Sets map scale text style

Parameters

Name Type Description
textStyleTypea new shape text style
Optional mergebooleantrue if you want to merge textStyle with existing attribute, false by default

Returns

BarScale

Inherited from

MapScale.setTextStyle


setTickPosition

setTickPosition(position): BarScale

Sets bar scale tick position (where to display ticks and their labels)

Parameters

Name Type Description
positionTickPositionlabel position

Returns

BarScale

this


setTickVisible

setTickVisible(value): BarScale

Sets bar scale tick visibility

Parameters

Name Type Description
valuebooleantrue to show the tick lines, false otherwise

Returns

BarScale

this


setTicksAmount

setTicksAmount(value): BarScale

Sets the bar scale object ticks amount

Parameters

Name Type Description
valuenumberthe amount of rectangular bars with tick

Returns

BarScale

this


setUseMinMaxSize

setUseMinMaxSize(useMinMaxSize): BarScale

Sets whether to use the min max device space sizes

Parameters

Name Type Description
useMinMaxSizebooleantrue if using the min max device space sizes otherwise, false.

Returns

BarScale

this

Inherited from

MapScale.setUseMinMaxSize


setVisible

setVisible(value): BarScale

Sets visibility of the node. Send event Events.VisibilityChanged

Parameters

Name Type Description
valuebooleanflag specifying visibility of the node

Returns

BarScale

this

Inherited from

MapScale.setVisible


setWidth

setWidth(width): BarScale

Sets width of the shape

Parameters

Name Type Description
widthnumberwidth of the shape

Returns

BarScale

this

Inherited from

MapScale.setWidth


setZIndex

setZIndex(value): BarScale

Sets z-index for node (set null for default)

Parameters

Name Type Description
valuenumberindex determining node z-position

Returns

BarScale

this

Inherited from

MapScale.setZIndex


shear

shear(shx, shy): BarScale

Shear this node's bounds

Parameters

Name Type Description
shxnumberx-axis shear
shynumbery-axis shear

Returns

BarScale

this

Inherited from

MapScale.shear


toString

toString(): string

Returns a string representation of this object (generally the classname)

Returns

string

A string representation

Inherited from

MapScale.toString


translate

translate(tx, ty): BarScale

Translate bounds

Parameters

Name Type Description
txnumberx translation
tynumbery translation

Returns

BarScale

this

Inherited from

MapScale.translate


unregisterAnimationStyle

unregisterAnimationStyle(root): void

Unregister animation style.

Parameters

Name Type Description
rootNoderoot node for node

Returns

void

Inherited from

MapScale.unregisterAnimationStyle


updateSceneTransformation

updateSceneTransformation(): BarScale

Update scene transformation

Returns

BarScale

this

Inherited from

MapScale.updateSceneTransformation


updateState

updateState(regions?, changes?): BarScale

Update state. These methods reset node state and update state for children. this method is useful to refresh a scene graph

Parameters

Name Type Description
Optional regionsRect[]optional array to return invalid rectangles in the parent coordinates
Optional changesStateChangesoptional parameter to specify a reason of changes

Returns

BarScale

this

Inherited from

MapScale.updateState


updateTimeStamp

Protected updateTimeStamp(): BarScale

Update time stamp to indicate that Node or Children has been changed.

Returns

BarScale

this

Inherited from

MapScale.updateTimeStamp


enableSceneGraphNotification

Static enableSceneGraphNotification(enabled): void

Enable / disable all notifications

Parameters

Name Type Description
enabledbooleansets if this object sends notifications

Returns

void

Inherited from

MapScale.enableSceneGraphNotification


findParent

Static findParent<T>(node, classType, filter?): InstanceType<T>

Find root of the node with specified type

Type parameters

NameType
Textends Constructor<any>

Parameters

Name Type Description
nodeNodenode to start search
classTypeTtype of the class to search for
Optional filter(node: Node) => booleanadditional filter to apply

Returns

InstanceType<T>

Inherited from

MapScale.findParent

Static findParent(node, classType, filter?): Node

Find root of the node with specified type

Parameters

Name Type Description
nodeNodenode to start search
classTypestringinterface name to search for
Optional filter(node: Node) => booleanadditional filter to apply

Returns

Node

Inherited from

MapScale.findParent


getAnchorPosition

Static getAnchorPosition(rect, anchorType): Point

Return anchor position

Parameters

Name Type Description
rectRectrectangle to get anchor position
anchorTypeAnchorTypeanchor type

Returns

Point

anchor

Inherited from

MapScale.getAnchorPosition


getClassName

Static getClassName(): string

Returns

string

Inherited from

MapScale.getClassName


intersectsBounds

Static intersectsBounds(bounds, localTransformation, parentInvalidArea, expand?): boolean

Check collision of the shape bounds with parent invalid area

Parameters

Name Type Description
boundsRectshape bounds
localTransformationTransformationlocal transformation of the bounds
parentInvalidAreaRectinvalid parent area
Optional expandDimensionoptional expand the bounds in model coordinate

Returns

boolean

true if bounds intersect the invalid area

Inherited from

MapScale.intersectsBounds


isSceneGraphNotificationEnabled

Static isSceneGraphNotificationEnabled(): boolean

Return status of the global notification for all nodes.

Returns

boolean

Inherited from

MapScale.isSceneGraphNotificationEnabled