Last updated

API / geotoolkit / axis / Axis / Axis

Class: Axis

axis.Axis.Axis

This class uses the TickGenerator which is passed to it and creates an axis.
It allows to modify the axis tick positions, axis orientations, axis label positions etc. CSS can be used to modify all axis settings.

Example

// In this example we have used AdaptiveLogTickGenerator and set the label rotation to true. Refer to the axes and grid tutorial for more options.
import {AdaptiveTickGenerator} from '@int/geotoolkit/axis/AdaptiveTickGenerator';
import {Rect} from '@int/geotoolkit/util/Rect';
import {Axis} from '@int/geotoolkit/axis/Axis';

const tickGenerator = new AdaptiveTickGenerator();
const minValue = 40000;
const maxValue = 15000000;
const bounds = new Rect(120, 10, 150, 340);
// note that group has a clipping by model limits, so to avoid overlapping set models limits accordingly.
const axis = new Axis(tickGenerator)
.setBounds(bounds)
.setModelLimits(new Rect(minValue, minValue, maxValue, maxValue))
.setAutoLabelRotation(true);

Hierarchy

Implements

Table of contents

Constructors
Methods
addCssClassaddInvalidateHandlerapplyOpacity
applyResponsiveStylecheckCollisionclone
connectStylecopyConstructordisconnectStyle
disposeenableEventPropagationexecute
filtergetAnimationStylegetAutoLabelRotation
getAutoLabelRotationAnglegetAxisDimensiongetBaseLineStyle
getBaseLineVisiblegetBoundsgetClassName
getClipStylegetContentsTransformgetCss
getCssClassgetCssClassesgetCssTransform
getFillStylegetHideOverlappedTextgetId
getInfiniteModegetInvalidateMethodgetLabelManualSettings
getLabelOffsetgetLabelPaddinggetLabelPosition
getLayoutStylegetLineStylegetLocalTransform
getMarginsStylegetMaximumLabelSizegetModelLimits
getNamegetOpacitygetOpacityBlendMode
getOrientationgetParentgetProperties
getPropertygetPropertyKeysgetRenderingFilter
getResponsiveStylegetRootgetScaleScrollStrategy
getSceneTransformgetShowTitleEllipsisgetTag
getTextStylegetTickGeneratorgetTickInfo
getTickPositiongetTitlegetTitleAnchor
getTitleMargingetTitleOffsetgetTitleTextStyle
getTitleVisiblegetVisiblegetWorldTransform
getZIndexhasCssClasshasEventListener
invalidateinvalidateLayoutinvalidateParent
isDisposedisEventPropagationEnabledisNotificationEnabled
isSelectableisSilentnotify
offononAxisDimensionChanged
onParentChangedonVisibilityChangedpostRendering
preRenderingregisterAnimationStyleremoveCssClass
removeInvalidateHandlerrenderrenderAsync
rotatescalesetAnimationStyle
setAutoLabelRotationsetAutoLabelRotationAnglesetAxisDimension
setBaseLineStylesetBaseLineVisiblesetBounds
setClipStylesetCsssetCssClass
setCssTransformsetFillStylesetHideOverlappedText
setIdsetInfiniteModesetLabelManualSettings
setLabelOffsetsetLabelPaddingsetLabelPosition
setLayoutStylesetLineStylesetLocalTransform
setMarginsStylesetMaximumLabelSizesetModelLimits
setNamesetNotificationsetOpacity
setOrientationsetPropertiessetProperty
setRenderingFiltersetResponsiveStylesetScaleScrollStrategy
setSelectablesetShowTitleEllipsissetSilent
setTagsetTextStylesetTickGenerator
setTickPositionsetTitlesetTitleAnchor
setTitleMarginsetTitleOffsetsetTitleText
setTitleTextStylesetTitleVisiblesetVisible
setZIndexsheartoString
translateunregisterAnimationStyleupdateAxisDimension
updateSceneTransformationupdateStateupdateTimeStamp
enableSceneGraphNotificationfindParentgetClassName
intersectsBoundsisSceneGraphNotificationEnabled
Css Properties
Name Type Description
autolabelrotationbooleanAutomatic label rotation
autolabelrotationanglenumber
baselinestylestringBase line style
baselinestyleLineStyleBase line style
baselinestyle-colorstringColor in CSS form
baselinestyle-fillstringOptional fill style to be used to fill lines generated with this style
baselinestyle-fillFillStyleOptional fill style to be used to fill lines generated with this style
baselinestyle-fill-colorstringColor in CSS form
baselinestyle-fill-evenoddmodebooleanEven-odd fill mode
baselinestyle-fill-fillpatternPatternPattern
baselinestyle-fill-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
baselinestyle-fill-fillpattern-patternnamestringName of this pattern for indexing
baselinestyle-fill-fillpattern-scalablebooleanFlag that sets scalability of the pattern coordinates, or relative to the shape it is filling (It is not supported)
baselinestyle-fill-foregroundstringForeground color
baselinestyle-fill-patternPatternPattern
baselinestyle-linecapCapStyleThe line cap style
baselinestyle-linedashoffsetnumberLine dash offset of dashed line
baselinestyle-linejoinJoinStyleThe line join style
baselinestyle-pixelsnapmodebooleanPixel Snap Mode, default(
baselinestyle-scalablebooleanTrue if width should depend on transformation
baselinestyle-unitstringOptional unit for the width
baselinestyle-widthnumber | stringThe line thickness
boundsRectAxis bounds
bounds-heightnumberHeight
bounds-readonlybooleanReadonly
bounds-widthnumberWidth
bounds-xnumberLeft
bounds-ynumberTop
clipstyleClipStyleClipping style
clipstyle-evenoddbooleanTrue if evenodd mode is on ('nonzero' mode otherwise)
clipstyle-geometryGraphicsPathClipping geometry
clipstyle-geometry-boundsRectBounds
clipstyleGraphicsPathClipping style
cssclassstringThe css class name of this node
csscursorstringCSS cursor associated with node
cssstylestringCSS style to be applied to inserted elements
dimensionAxisMappingDimensionAxis dimension to setup axis limits
dimension-desiredmodelstepnumberDesired model step
dimension-logarithmicbooleanTrue for logarithmic axis
dimension-maxnumberMaximum value
dimension-minnumberMinimum value
dimension-minspannumberDesired minimum distance between ticks in pixels
dimension-namestringName of the dimension
dimension-neatlimitsbooleanEnable or disable neat limits
dimension-orientationOrientationAxis orientation
dimension-originnumber
dimension-preciselimitsbooleanEnable keeping the precise limits and calculate only step
dimension-spacingnumberDesired model spacing
fillstylestringStyle applied on fill
fillstyleFillStyleStyle applied on fill
hideoverlappedtextbooleanHide overlapped text flag
idstring | numberId of the node, its a unique identifier
infinitybooleanInfinity mode
labelmanualsettingsbooleanEnable / disable manual settings for labels like anchor
labeloffsetnumberOffset the label offset
labelpaddingnumberLabel padding size in pixels
labelpositionLabelPositionLabel position
layoutstyleLayoutStyleDesired layout style
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
localtransformTransformationLocal transformation
localtransform-dxnumberX axis translation
localtransform-dynumberY axis translation
localtransform-xxnumberX scale
localtransform-xynumberXy skew
localtransform-yxnumberYx skew
localtransform-yynumberY scale
marginsnumber | stringIt has properties for specifying the margins for each side
maximumlabelsizenumberMaximum label size (in device), text will be wrapped, if it is bigger than maximum label size
modellimitsRectRectangle where to generate 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
orientationOrientationAxis orientation
scalescrollstrategyScaleScrollStrategyScale scroll strategy
scalescrollstrategy-enabledbooleanEnable flag
selectablebooleanSelectable node, a boolean to determine if selection should consider this node
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
textstylestringLabels textstyle
textstyleTextStyleLabels textstyle
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
tickgeneratorTickGeneratorTickGenerator to use in axis
tickgenerator-labelstylesTextStyleAn object containing label style for specified grades
tickgenerator-taganyTag user can specify info associated with current object
tickgenerator-tickstylesLineStyleAn object containing tick styles for specified grades
tickpositionTickPositionTick position
titleTitleAxis title
title-alignmentAnchorTypeAlignment
title-marginnumber | stringMargin style
title-offsetPointOffset
title-offset-xnumberX coordinate
title-offset-ynumberY coordinate
title-offsetDimensionOffset
title-offset-heightnumberHeight of dimension
title-offset-widthnumberWidth of dimension or properties
title-showellipsisbooleanEnables/disables ellipsis in case if text is too long
title-textstringAxis title text
title-textstylestringText style
title-textstyleTextStyleText style
title-visiblebooleanVisibility
transformstringAdditional CSS transformation applied to node or 'none'
transformTransformationAdditional CSS transformation applied to node or 'none'
visiblebooleanVisibility of the node, a boolean to determine if the node should be rendered or not
visiblebaselinebooleanVisibility of baseline
z-indexnumberDefine node z-index

Contents

Constructors

new Axis(tickGenerator)

new Axis(tickGenerator?)

Create Axis

Parameters

Name Type Description
Optional tickGeneratorTickGenerator | OptionsUser can pass an object OR a tickGenerator (by default AdaptiveTickGenerator is used of nothing is passed)

Overrides

Shape.constructor

Methods

addCssClass

addCssClass(cssclass): Axis

Adds new css class to node

Parameters

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

Returns

Axis

this

Inherited from

Shape.addCssClass


addInvalidateHandler

addInvalidateHandler(handler): Axis

Add invalidate handler

Deprecated

since 4.0, use Node.on instead

Parameters

Name Type Description
handlerFunctionhandler to be notified about invalidation

Returns

Axis

this

Inherited from

Shape.addInvalidateHandler


applyOpacity

Protected applyOpacity(context): Axis

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

Axis

this

Inherited from

Shape.applyOpacity


applyResponsiveStyle

Protected applyResponsiveStyle(): void

Apply a responsive style rules it is exists

Returns

void

Inherited from

Shape.applyResponsiveStyle


checkCollision

checkCollision(context): boolean

Check culling

Parameters

Name Type Description
contextRenderingContextRendering Context

Returns

boolean

true if object is inside of rendarable area

Overrides

Shape.checkCollision


clone

clone(): Axis

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

Returns

Axis

clone

Overrides

Shape.clone


connectStyle

connectStyle(style, type, callback): Axis

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

Axis

this

Inherited from

Shape.connectStyle


copyConstructor

Protected copyConstructor(src, deepCopy?): Axis

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
srcAxisSource to copy from
Optional deepCopybooleandeep copy

Returns

Axis

this

Overrides

Shape.copyConstructor


disconnectStyle

disconnectStyle(style, type, callback): Axis

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

Axis

this

Inherited from

Shape.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

Shape.dispose


enableEventPropagation

enableEventPropagation(enable): Axis

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

Axis

this

Inherited from

Shape.enableEventPropagation


execute

execute(delegate): Axis

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: Axis) => voidFunction to execute

Returns

Axis

The result if any or this

Inherited from

Shape.execute

execute<T>(delegate): T

Type parameters

Name
T

Parameters

Name Type
delegate(this: Axis) => T

Returns

T

Inherited from

Shape.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

Shape.filter


getAnimationStyle

getAnimationStyle(): AnimationStyle

Return animation style

Returns

AnimationStyle

animationStyle current animation style

Inherited from

Shape.getAnimationStyle


getAutoLabelRotation

getAutoLabelRotation(): boolean

Get auto label rotation

Returns

boolean


getAutoLabelRotationAngle

getAutoLabelRotationAngle(): number

Gets auto rotation angle for vertical axis

Returns

number

angle


getAxisDimension

getAxisDimension(): AxisMappingDimension

Gets axis dimension to synchronize tick generator parameters with external source

Returns

AxisMappingDimension


getBaseLineStyle

getBaseLineStyle(): LineStyle

Return a base line style

Returns

LineStyle


getBaseLineVisible

getBaseLineVisible(): boolean

Return base line visibility

Returns

boolean


getBounds

getBounds(): Rect

Gets axis bounds

Returns

Rect

axis bounds

Implementation of

IModel.getBounds


getClassName

getClassName(): string

Returns

string

Inherited from

Shape.getClassName


getClipStyle

getClipStyle(): ClipStyle

Gets the current clipping style

Returns

ClipStyle

clipping style

Inherited from

Shape.getClipStyle


getContentsTransform

getContentsTransform(): Transformation

Transformation of inner contents to bounds

Returns

Transformation


getCss

getCss(): CssStyle

Return CSS style

Returns

CssStyle

Inherited from

Shape.getCss


getCssClass

getCssClass(): string

Returns css class name to be used to apply CSS style

Returns

string

the css class name

Inherited from

Shape.getCssClass


getCssClasses

getCssClasses(): string[]

Gets list of css class names which applied to this node

Returns

string[]

Inherited from

Shape.getCssClasses


getCssTransform

getCssTransform(): string

Returns CSS transformation

Returns

string

Inherited from

Shape.getCssTransform


getFillStyle

getFillStyle(): FillStyle

Return fill style

Returns

FillStyle

fillStyle current fill style

Inherited from

Shape.getFillStyle


getHideOverlappedText

getHideOverlappedText(): boolean

Gets hide overlapped text flag

Returns

boolean

hide overlapped text flag


getId

getId(): string | number

Returns the associated identifier of the node

Returns

string | number

The node's id

Inherited from

Shape.getId


getInfiniteMode

getInfiniteMode(): boolean

Return infinity mode flag

Returns

boolean

flag


getInvalidateMethod

Protected getInvalidateMethod(): AttributeCallback<EventDispatcher>

Gets invalidate method

Returns

AttributeCallback<EventDispatcher>

method to invalidate this object

Inherited from

Shape.getInvalidateMethod


getLabelManualSettings

getLabelManualSettings(): boolean

Gets label manual settings mode (AnchorType and no shifts)

Returns

boolean

label manual settings mode


getLabelOffset

getLabelOffset(): number

Return the label offset

Returns

number


getLabelPadding

getLabelPadding(): number

Gets label padding

Returns

number

padding label padding


getLabelPosition

getLabelPosition(): LabelPosition

Return the label position

Returns

LabelPosition


getLayoutStyle

getLayoutStyle(): LayoutStyle<string | number>

return desired layout style

Returns

LayoutStyle<string | number>

Implementation of

ILayoutable.getLayoutStyle


getLineStyle

getLineStyle(): LineStyle

Return line style

Returns

LineStyle

lineStyle current line style

Inherited from

Shape.getLineStyle


getLocalTransform

getLocalTransform(): Transformation

Retrieves the transformation of bounds to parent

Returns

Transformation

transform the local transform.

Inherited from

Shape.getLocalTransform


getMarginsStyle

getMarginsStyle(): SpaceStyle<string | number>

Return margins style

Returns

SpaceStyle<string | number>

Inherited from

Shape.getMarginsStyle


getMaximumLabelSize

getMaximumLabelSize(): number

Gets maximum label size

Returns

number

maximum label size (in device space)


getModelLimits

getModelLimits(): Rect

Gets model limits

Returns

Rect

model limits

Implementation of

IModel.getModelLimits


getName

getName(): string

Returns the node name

Returns

string

The node name

Inherited from

Shape.getName


getOpacity

getOpacity(): number

Returns current node opacity

Returns

number

opacity

Inherited from

Shape.getOpacity


getOpacityBlendMode

getOpacityBlendMode(): BlendMode

Returns current node opacity

Returns

BlendMode

opacity blend mode

Inherited from

Shape.getOpacityBlendMode


getOrientation

getOrientation(): Orientation

Return axis orientation

Returns

Orientation

"horizontal" or "vertical"


getParent

getParent(): Node

Return parent node

Returns

Node

parent node

Implementation of

ILayoutable.getParent

Inherited from

Shape.getParent


getProperties

getProperties(): OptionsOut

Gets all the properties pertaining to this object

Returns

OptionsOut

An object containing the properties

Overrides

Shape.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

Shape.getProperty


getPropertyKeys

getPropertyKeys(): string[]

Returns known properties keys

Returns

string[]

Inherited from

Shape.getPropertyKeys


getRenderingFilter

getRenderingFilter(): IFilter

Return filter to be used for rendering and picking

Returns

IFilter

current filter

Inherited from

Shape.getRenderingFilter


getResponsiveStyle

getResponsiveStyle(): ResponsiveStyle

Return responsive style

Returns

ResponsiveStyle

Inherited from

Shape.getResponsiveStyle


getRoot

getRoot(): Node

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

Returns

Node

the root node

Inherited from

Shape.getRoot


getScaleScrollStrategy

getScaleScrollStrategy(): Delegate

Gets scale scroll strategy

Returns

Delegate

scale scroll strategy

Inherited from

Shape.getScaleScrollStrategy


getSceneTransform

getSceneTransform(): Transformation

Returns transformation from node to root scene

Returns

Transformation

a transformation from node to root scene

Inherited from

Shape.getSceneTransform


getShowTitleEllipsis

getShowTitleEllipsis(): boolean

Return boolean flag that enables/disables ellipsis in case if text is too long

Returns

boolean


getTag

getTag(): any

Returns the object associated with the node by user.

Returns

any

The node's user-object

Inherited from

Shape.getTag


getTextStyle

getTextStyle(): TextStyle

Return a text style

Returns

TextStyle

textStyle


getTickGenerator

getTickGenerator(): TickGenerator

Return a current tick generator

Returns

TickGenerator

a current tick generator


getTickInfo

getTickInfo(): TickInfo

Returns axis tick info

Returns

TickInfo

tickInfo


getTickPosition

getTickPosition(): string

Return tick position

Returns

string

tickPosition


getTitle

getTitle(): string

Get axis title

Returns

string

axis title


getTitleAnchor

getTitleAnchor(): AnchorType

Get title anchor

Returns

AnchorType

alignment


getTitleMargin

getTitleMargin(): SpaceStyle<string | number>

Returns title margin

Returns

SpaceStyle<string | number>


getTitleOffset

getTitleOffset(): Point

Returns title offset

Returns

Point

offset


getTitleTextStyle

getTitleTextStyle(): TextStyle

The style associated with this axis title.

Returns

TextStyle

textStyle


getTitleVisible

getTitleVisible(): boolean

Get title visibility state

Returns

boolean

visible state


getVisible

getVisible(): boolean

Return visibility of the node

Returns

boolean

true if node is visible

Inherited from

Shape.getVisible


getWorldTransform

getWorldTransform(): Transformation

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

Returns

Transformation

Overrides

Shape.getWorldTransform


getZIndex

getZIndex(): number

Returns node z-index (null if not set)

Returns

number

Inherited from

Shape.getZIndex


hasCssClass

hasCssClass(cssClass): boolean

Check if node has specified css class

Parameters

Name Type Description
cssClassstringcss class name

Returns

boolean

Inherited from

Shape.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

Shape.hasEventListener


invalidate

invalidate(bounds?, force?): Axis

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

Axis

this

Inherited from

Shape.invalidate


invalidateLayout

invalidateLayout(): Axis

Notify that layout is invalidated. Send event Events.LayoutInvalidated

Returns

Axis

this


invalidateParent

invalidateParent(bounds?, force?): Axis

Invalidate parent area

Parameters

Name Type Description
Optional boundsRectarea to invalidate
Optional forcebooleanforce

Returns

Axis

this

Overrides

Shape.invalidateParent


isDisposed

isDisposed(): boolean

Returns whether this object has been disposed

Returns

boolean

Inherited from

Shape.isDisposed


isEventPropagationEnabled

isEventPropagationEnabled(): boolean

Return true if event propagation is enabled from child to parent

Returns

boolean

Inherited from

Shape.isEventPropagationEnabled


isNotificationEnabled

isNotificationEnabled(): boolean

return state of notification

Returns

boolean

current notification state

Inherited from

Shape.isNotificationEnabled


isSelectable

isSelectable(): boolean

Returns true if node can be picked/selected.

Returns

boolean

The selectable flag

Inherited from

Shape.isSelectable


isSilent

isSilent(): boolean

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

Returns

boolean

Inherited from

Shape.isSilent


notify

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

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

Axis

this

Inherited from

Shape.notify


off

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

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: Axis, args: EventMap[E]) => voidfunction to be called

Returns

Axis

this

Inherited from

Shape.off


on

on<E>(type, callback): Axis

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: Axis, args: EventMap[E]) => voidto be called

Returns

Axis

this

Inherited from

Shape.on


onAxisDimensionChanged

Protected onAxisDimensionChanged(dimension): void

Called if axis dimension is changed

Parameters

Name Type Description
dimensionAxisMappingDimensiondimension

Returns

void


onParentChanged

Protected onParentChanged(node): Axis

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

Parameters

Name Type Description
nodeNodenode to change parent

Returns

Axis

this

Inherited from

Shape.onParentChanged


onVisibilityChanged

Protected onVisibilityChanged(): void

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

Returns

void

Overrides

Shape.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

Shape.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

Shape.preRendering


registerAnimationStyle

registerAnimationStyle(root): void

Register animation style.

Parameters

Name Type Description
rootNoderoot node for node

Returns

void

Inherited from

Shape.registerAnimationStyle


removeCssClass

removeCssClass(cssclass): Axis

Removes css class from node

Parameters

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

Returns

Axis

this

Inherited from

Shape.removeCssClass


removeInvalidateHandler

removeInvalidateHandler(handler): Axis

Remove invalidate handler

Deprecated

since 4.0, use Node.off instead

Parameters

Name Type Description
handlerFunctionhandler to be notified about invalidation

Returns

Axis

this

Inherited from

Shape.removeInvalidateHandler


render

render(context): void

Renders node

Parameters

Name Type Description
contextRenderingContextThe rendering context to be used to draw the node

Returns

void

Overrides

Shape.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

Shape.renderAsync


rotate

rotate(theta, x, y): Axis

Rotate bounds around a given coordinate

Parameters

Name Type Description
thetanumberangle to rotate node, in radians
xnumberx coordinate to rotate around
ynumbery coordinate to rotate around

Returns

Axis

this

Inherited from

Shape.rotate


scale

scale(xx, yy): Axis

Scale node

Parameters

Name Type Description
xxnumberx scale factor
yynumbery scale factor

Returns

Axis

this

Inherited from

Shape.scale


setAnimationStyle

setAnimationStyle(animationStyle): Axis

Sets animation style

Parameters

Name Type Description
animationStyleTypeanimation style

Returns

Axis

Inherited from

Shape.setAnimationStyle


setAutoLabelRotation

setAutoLabelRotation(enable): Axis

Set auto label rotation

Parameters

Name Type Description
enablebooleanenable automatic label rotation

Returns

Axis

this


setAutoLabelRotationAngle

setAutoLabelRotationAngle(angle): Axis

Sets auto rotation angle for vertical axis

Parameters

Name Type Description
anglenumberangle of label auto rotation

Returns

Axis

this


setAxisDimension

setAxisDimension(dimension): Axis

Sets axis dimension to synchronize tick generator parameters with external source

Parameters

Name Type Description
dimensionAxisMappingDimension | Optionsdimension

Returns

Axis


setBaseLineStyle

setBaseLineStyle(lineStyle, merge?): Axis

Sets a base 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

Axis

this


setBaseLineVisible

setBaseLineVisible(visible): Axis

Set base line visibility

Parameters

Name Type Description
visiblebooleanvisible

Returns

Axis


setBounds

setBounds(bounds): Axis

Sets an axis bounds

Parameters

Name Type Description
boundsRectaxis bounds

Returns

Axis

this

Implementation of

ILayoutable.setBounds


setClipStyle

setClipStyle(style): Axis

Sets a new clipping style

Parameters

Name Type Description
styleGraphicsPath | ClipStyle | Optionsa new clipping style

Returns

Axis

this

Inherited from

Shape.setClipStyle


setCss

setCss(style, merge?): Axis

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

Axis

this

Inherited from

Shape.setCss


setCssClass

setCssClass(name): Axis

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

Axis

this

Inherited from

Shape.setCssClass


setCssTransform

setCssTransform(transform): Axis

Set CSS transformation

Parameters

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

Returns

Axis

this

Inherited from

Shape.setCssTransform


setFillStyle

setFillStyle(fillStyle, merge?): Axis

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

Axis

this

Inherited from

Shape.setFillStyle


setHideOverlappedText

setHideOverlappedText(flag): Axis

Sets hide overlapped text flag

Parameters

Name Type Description
flagbooleanhide overlapped text flag

Returns

Axis

this


setId

setId(id): Axis

Allows the user to associate any identifier

Parameters

Name Type Description
idstring | numberobject id

Returns

Axis

this

Inherited from

Shape.setId


setInfiniteMode

setInfiniteMode(infinityMode): Axis

Set infinity mode flag to draw axis outside the model limits

Parameters

Name Type Description
infinityModebooleaninfinity mode flag

Returns

Axis

this


setLabelManualSettings

setLabelManualSettings(state): Axis

Sets label manual settings mode (AnchorType and no shifts)

Parameters

Name Type Description
statebooleanlabel manual settings mode

Returns

Axis

this


setLabelOffset

setLabelOffset(offset): Axis

Sets the label offset

Parameters

Name Type Description
offsetnumberthe label offset

Returns

Axis

this


setLabelPadding

setLabelPadding(padding): Axis

Sets label padding

Parameters

Name Type Description
paddingnumberlabel padding

Returns

Axis

this


setLabelPosition

setLabelPosition(position): Axis

Sets the label position

Parameters

Name Type Description
positionLabelPositionlabel position

Returns

Axis

this


setLayoutStyle

setLayoutStyle(layoutStyle, merge?): Axis

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

Axis


setLineStyle

setLineStyle(lineStyle, merge?): Axis

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

Axis

this

Inherited from

Shape.setLineStyle


setLocalTransform

setLocalTransform(localTransform, force?): Axis

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

Axis

this

Inherited from

Shape.setLocalTransform


setMarginsStyle

setMarginsStyle(margins, merge?): Axis

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

Axis

this

Inherited from

Shape.setMarginsStyle


setMaximumLabelSize

setMaximumLabelSize(maximumLabelSize): Axis

Sets maximum label size

Parameters

Name Type Description
maximumLabelSizenumbermaximum label size (in device space)

Returns

Axis

this


setModelLimits

setModelLimits(modelLimits): Axis

Sets model limits

Parameters

Name Type Description
modelLimitsRectmodel limits or rectangle where ticks are to be generated

Returns

Axis

this


setName

setName(name): Axis

Sets name of the node

Parameters

Name Type Description
namestringThe node name

Returns

Axis

this

Inherited from

Shape.setName


setNotification

setNotification(notify, force?): Axis

set notification state

Parameters

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

Returns

Axis

this

Inherited from

Shape.setNotification


setOpacity

setOpacity(opacity, blendMode?): Axis

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

Axis

this

Inherited from

Shape.setOpacity


setOrientation

setOrientation(orientation): Axis

Sets axis orientation

Parameters

Name Type Description
orientationstring(It can be "Vertical" or "Horizontal");

Returns

Axis

this


setProperties

setProperties(properties?): Axis

Sets all the properties pertaining to this object

Parameters

Name Type Description
Optional propertiesOptionsAn object containing the properties to set

Returns

Axis

this

Overrides

Shape.setProperties


setProperty

setProperty(name, value): Axis

Sets dynamic property by name

Parameters

Name Type Description
namestringproperty name
valueanyproperty value

Returns

Axis

this

Inherited from

Shape.setProperty


setRenderingFilter

setRenderingFilter(filter): Axis

Sets filter to be applied before rendering and picking

Parameters

Name Type Description
filterIFilterfilter to set

Returns

Axis

this

Inherited from

Shape.setRenderingFilter


setResponsiveStyle

setResponsiveStyle(style): Axis

Sets responsive style.

Parameters

Name Type Description
styleOptions | ResponsiveStyleresponsive style

Returns

Axis

this

Inherited from

Shape.setResponsiveStyle


setScaleScrollStrategy

setScaleScrollStrategy(strategy?): Axis

Sets scale scroll strategy

Parameters

Name Type Description
Optional strategyDelegatescale scroll strategy

Returns

Axis

this

Inherited from

Shape.setScaleScrollStrategy


setSelectable

setSelectable(selectable): Axis

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

Axis

this

Inherited from

Shape.setSelectable


setShowTitleEllipsis

setShowTitleEllipsis(showellipsis): Axis

Enables/disables ellipsis in case if text is too long

Parameters

Name Type Description
showellipsisbooleantrue for ellipsis

Returns

Axis

this


setSilent

setSilent(bool): Axis

Set silent mode

Parameters

Name Type Description
boolbooleanflag to enable silent mode

Returns

Axis

this

Inherited from

Shape.setSilent


setTag

setTag(tag): Axis

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

Parameters

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

Returns

Axis

this

Inherited from

Shape.setTag


setTextStyle

setTextStyle(textStyle, merge?): Axis

Set 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

Axis

this


setTickGenerator

setTickGenerator(tickGenerator): Axis

Sets tick generator

Parameters

Name Type Description
tickGeneratorTickGenerator | Optionsa tick generator to be used

Returns

Axis

this


setTickPosition

setTickPosition(position): Axis

Sets tick position as text

Parameters

Name Type
positionstring

Returns

Axis


setTitle

setTitle(title): Axis

Set title

Parameters

Name Type Description
titlestring | Titleaxis title text or title object

Returns

Axis

this


setTitleAnchor

setTitleAnchor(titleAnchor): Axis

Set title alignment

Parameters

Name Type Description
titleAnchorAnchorTypeanchor

Returns

Axis


setTitleMargin

setTitleMargin(titleMargin, merge?): Axis

Sets title margin

Parameters

Name Type Description
titleMarginType<string | number>title margin style
Optional mergebooleantrue if you want to merge paddingStyle with existing attribute, false by default

Returns

Axis

this


setTitleOffset

setTitleOffset(titleOffset): Axis

Sets title offset

Parameters

Name Type Description
titleOffsetnumber | Point | Options | Dimensionoffset

Returns

Axis


setTitleText

setTitleText(titleText): Axis

Sets title text

Parameters

Name Type Description
titleTextstringtitle text

Returns

Axis

this


setTitleTextStyle

setTitleTextStyle(titleTextStyle, merge?): Axis

Set axis title text style

Parameters

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

Returns

Axis

this


setTitleVisible

setTitleVisible(visible): Axis

Set title visibility state

Parameters

Name Type Description
visiblebooleanvisible title

Returns

Axis


setVisible

setVisible(value): Axis

Sets visibility of the node. Send event Events.VisibilityChanged

Parameters

Name Type Description
valuebooleanflag specifying visibility of the node

Returns

Axis

this

Inherited from

Shape.setVisible


setZIndex

setZIndex(value): Axis

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

Parameters

Name Type Description
valuenumberindex determining node z-position

Returns

Axis

this

Inherited from

Shape.setZIndex


shear

shear(shx, shy): Axis

Shear this node's bounds

Parameters

Name Type Description
shxnumberx-axis shear
shynumbery-axis shear

Returns

Axis

this

Inherited from

Shape.shear


toString

toString(): string

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

Returns

string

A string representation

Inherited from

Shape.toString


translate

translate(tx, ty): Axis

Translate bounds

Parameters

Name Type Description
txnumberx translation
tynumbery translation

Returns

Axis

this

Inherited from

Shape.translate


unregisterAnimationStyle

unregisterAnimationStyle(root): void

Unregister animation style.

Parameters

Name Type Description
rootNoderoot node for node

Returns

void

Inherited from

Shape.unregisterAnimationStyle


updateAxisDimension

updateAxisDimension(minValue, maxValue, size?): Axis

Update axis dimension for new data limits and optional device size of the axis

Parameters

Name Type Description
minValuenumberminimum value
maxValuenumbermaximum value
Optional sizenumbersize of the axis in device space. if size is not provided then size is calculated based on limits and current transformation.

Returns

Axis

this


updateSceneTransformation

updateSceneTransformation(): Axis

Update scene transformation

Returns

Axis

this

Inherited from

Shape.updateSceneTransformation


updateState

updateState(regions?, changes?): Axis

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

Axis

this

Inherited from

Shape.updateState


updateTimeStamp

Protected updateTimeStamp(): Axis

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

Returns

Axis

this

Inherited from

Shape.updateTimeStamp


enableSceneGraphNotification

Static enableSceneGraphNotification(enabled): void

Enable / disable all notifications

Parameters

Name Type Description
enabledbooleansets if this object sends notifications

Returns

void

Inherited from

Shape.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

Shape.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

Shape.findParent


getClassName

Static getClassName(): string

Returns

string

Inherited from

Shape.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

Shape.intersectsBounds


isSceneGraphNotificationEnabled

Static isSceneGraphNotificationEnabled(): boolean

Return status of the global notification for all nodes.

Returns

boolean

Inherited from

Shape.isSceneGraphNotificationEnabled