API / geotoolkit / contour / visuals / ContourLineVisual / ContourLineVisual
visuals.ContourLineVisual.ContourLineVisual
The Line Visual. This renders the isolines and their labels.
↳
ContourLineVisual
Constructors
Methods
Css Properties
| Name | Type | Description |
|---|---|---|
clipstyle | ClipStyle | Clipping style |
clipstyle-evenodd | boolean | True if evenodd mode is on ('nonzero' mode otherwise) |
clipstyle-geometry | GraphicsPath | Clipping geometry |
clipstyle-geometry-bounds | Rect | Bounds |
clipstyle-geometry-bounds-height | number | Height |
clipstyle-geometry-bounds-readonly | boolean | Readonly |
clipstyle-geometry-bounds-width | number | Width |
clipstyle-geometry-bounds-x | number | Left |
clipstyle-geometry-bounds-y | number | Top |
clipstyle | GraphicsPath | Clipping style |
colorbehavior | BehaviorType | Color behavior type |
colormap | VisualColorMap | Colormap properties |
colormap-visual | AbstractVisual | The associated visual |
colormap-visual-clipstyle | ClipStyle | Clipping style |
colormap-visual-clipstyle | GraphicsPath | Clipping style |
colormap-visual-colorbehavior | BehaviorType | Color behavior type |
colormap-visual-colormap | VisualColorMap | Colormap properties |
colormap-visual-cssclass | string | The css class name of this node |
colormap-visual-csscursor | string | CSS cursor associated with node |
colormap-visual-cssstyle | string | CSS style to be applied to inserted elements |
colormap-visual-fillstyle | string | Style applied on fill |
colormap-visual-fillstyle | FillStyle | Style applied on fill |
colormap-visual-fillstyle-color | string | Color in CSS form |
colormap-visual-fillstyle-evenoddmode | boolean | Even-odd fill mode |
colormap-visual-fillstyle-fillpattern | Pattern | Pattern |
colormap-visual-fillstyle-fillpattern-containername | string | An 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 |
colormap-visual-fillstyle-fillpattern-patternname | string | Name of this pattern for indexing |
colormap-visual-fillstyle-fillpattern-scalable | boolean | Flag that sets scalability of the pattern coordinates, or relative to the shape it is filling (It is not supported) |
colormap-visual-fillstyle-foreground | string | Foreground color |
colormap-visual-fillstyle-pattern | Pattern | Pattern |
colormap-visual-id | string | number | Id of the node, its a unique identifier |
colormap-visual-linestyle | string | Style applied on outline |
colormap-visual-linestyle | LineStyle | Style applied on outline |
colormap-visual-linestyle-color | string | Color in CSS form |
colormap-visual-linestyle-fill | string | Optional fill style to be used to fill lines generated with this style |
colormap-visual-linestyle-fill | FillStyle | Optional fill style to be used to fill lines generated with this style |
colormap-visual-linestyle-linecap | CapStyle | The line cap style |
colormap-visual-linestyle-linedashoffset | number | Line dash offset of dashed line |
colormap-visual-linestyle-linejoin | JoinStyle | The line join style |
colormap-visual-linestyle-pixelsnapmode | boolean | Pixel Snap Mode, default( |
colormap-visual-linestyle-scalable | boolean | True if width should depend on transformation |
colormap-visual-linestyle-unit | string | Optional unit for the width |
colormap-visual-linestyle-width | number | string | The line thickness |
colormap-visual-localtransform | Transformation | Local transformation |
colormap-visual-localtransform-dx | number | X axis translation |
colormap-visual-localtransform-dy | number | Y axis translation |
colormap-visual-localtransform-xx | number | X scale |
colormap-visual-localtransform-xy | number | Xy skew |
colormap-visual-localtransform-yx | number | Yx skew |
colormap-visual-localtransform-yy | number | Y scale |
colormap-visual-margins | number | string | It has properties for specifying the margins for each side |
colormap-visual-name | string | Name of the node. It is often used for debugging purposes or to simplify queries |
colormap-visual-opacity | number | Node opacity (from 0 to 1). If it is undefined or null it inherits property from the parent. It changes globalAlpha on the rendering context |
colormap-visual-opacityblendmode | BlendMode | Node opacity mode to blend it |
colormap-visual-scalescrollstrategy | ScaleScrollStrategy | Scale scroll strategy |
colormap-visual-scalescrollstrategy-enabled | boolean | Enable flag |
colormap-visual-selectable | boolean | Selectable node, a boolean to determine if selection should consider this node |
colormap-visual-tag | any | Custom 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 |
colormap-visual-transform | string | Additional CSS transformation applied to node or 'none' |
colormap-visual-transform | Transformation | Additional CSS transformation applied to node or 'none' |
colormap-visual-visible | boolean | Visibility of the node, a boolean to determine if the node should be rendered or not |
colormap-visual-z-index | number | Define node z-index |
cssclass | string | The css class name of this node |
csscursor | string | CSS cursor associated with node |
cssstyle | string | CSS style to be applied to inserted elements |
fillstyle | string | Style applied on fill |
fillstyle | FillStyle | Style applied on fill |
id | string | number | Id of the node, its a unique identifier |
indexstep | number | Index step for line visual |
labelformat | NumberFormat | Label format |
labelformat-fulllocale | boolean | Specify format how to provide locale |
labelformat-grouplength | number | Specify group length of numbers |
labelformat-locale | string | Format locale |
labelformat-locale | Locale | Format locale |
labelformat-locale-locale | string | The name of the locale |
labelformat-locale-numberformat | NumberFormatInfo | Defines number format |
labelformat-locale-numberformat-dec | string | Defines decimal symbol |
labelformat-locale-numberformat-group | string | Defines group symbol |
labelformat-locale-numberformat-infinity | string | Defines infinity text |
labelformat-locale-numberformat-neg | string | Defines negative symbol |
labelformat-maximumfractiondigits | number | Specify maximum fraction digits |
labelformat-minimumfractiondigits | number | Specify minimum fraction digits, have to be less or equal to maximumfractiondigits |
labelformat-round | boolean | Round number |
labelingstrategy | AbstractContourLabelingStrategy | Labeling strategy |
labelingstrategy-labelformat | NumberFormat | Label format |
labelingstrategy-labelmargin | number | The label margin for specified level |
labelingstrategy-labelspacing | number | The label spacing for specified level |
labelingstrategy-textstyle | TextStyle | The text style for specified level |
labelingstrategy-textstyle-alignment | AlignmentStyle | Alignment |
labelingstrategy-textstyle-autosize | boolean | Auto font size on high definition display |
labelingstrategy-textstyle-background | string | Background style |
labelingstrategy-textstyle-background | FillStyle | Background style |
labelingstrategy-textstyle-baseline | BaseLineStyle | Base line |
labelingstrategy-textstyle-color | string | Color in CSS form |
labelingstrategy-textstyle-fill | FillStyle | Text fill style |
labelingstrategy-textstyle-font | string | Font see |
labelingstrategy-textstyle-fonturl | string | The place from which the font will be loaded, if null - uses system fonts. It can be base64 with url keyword |
labelingstrategy-textstyle-lineheight | string | number | Line height |
labelingstrategy-textstyle-multiline | boolean | Allow multi-line text |
labelingstrategy-textstyle-outline | string | Outline style |
labelingstrategy-textstyle-outline | LineStyle | Outline style |
labelingstrategy-textstyle-overflowwrap | OverflowWrapStyle | Overflow wrap |
labelingstrategy-textstyle-strikethrough | string | Strikethrough style |
labelingstrategy-textstyle-strikethrough | LineStyle | Strikethrough style |
labelingstrategy-textstyle-textoverflow | TextOverflowStyle | Text overflow |
labelingstrategy-textstyle-underline | string | Underline style |
labelingstrategy-textstyle-underline | LineStyle | Underline style |
labelingstrategy-textstyle-underlineoffset | string | number | Underline offset distance |
labelingstrategy-textstyle-whitespace | WhiteSpaceStyle | White space |
labelingstrategy-textstyle-wordbreak | WordBreakStyle | Word break |
labelingstrategy-usefontcolorforlabels | boolean | Flag which indicates if font color is used for label text color |
labelmargin | number | Margin around labels in device coordinates |
labelspacing | number | Label spacing between nearby labels on a isoline |
labelsvisible | boolean | Visibility of labels |
linestyle | string | Style applied on outline |
linestyle | LineStyle | Style applied on outline |
linestyle | LineStyle | Style of line that is used to draw the isolines |
linesvisible | boolean | Visibility of all isolines |
localtransform | Transformation | Local transformation |
margins | number | string | It has properties for specifying the margins for each side |
name | string | Name of the node. It is often used for debugging purposes or to simplify queries |
opacity | number | Node opacity (from 0 to 1). If it is undefined or null it inherits property from the parent. It changes globalAlpha on the rendering context |
opacityblendmode | BlendMode | Node opacity mode to blend it |
scalescrollstrategy | ScaleScrollStrategy | Scale scroll strategy |
selectable | boolean | Selectable node, a boolean to determine if selection should consider this node |
tag | any | Custom 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 |
textstyle | string | Text style attribute that is used to draw the labels |
textstyle | TextStyle | Text style attribute that is used to draw the labels |
transform | string | Additional CSS transformation applied to node or 'none' |
transform | Transformation | Additional CSS transformation applied to node or 'none' |
usefontcolorforlabels | boolean | Flag which indicates if font color is used for label text color |
visible | boolean | Visibility of the node, a boolean to determine if the node should be rendered or not |
z-index | number | Define node z-index |
Constructors
• new ContourLineVisual(options?)
| Name | Type |
|---|---|
Optional options | Options |
AbstractVisual.constructor
Methods
▸ addCssClass(cssclass): ContourLineVisual
Adds new css class to node
| Name | Type | Description |
|---|---|---|
cssclass | string | string[] | css class name('s) |
this
▸ addInvalidateHandler(handler): ContourLineVisual
Add invalidate handler
Deprecated
since 4.0, use Node.on instead
| Name | Type | Description |
|---|---|---|
handler | Function | handler to be notified about invalidation |
this
AbstractVisual.addInvalidateHandler
▸ addVisualListener(visualListener): void
Registers the specified visual listener to receiving events from this visual.
Deprecated
since 4.0
| Name | Type | Description |
|---|---|---|
visualListener | ContourShape | The visual listener |
void
AbstractVisual.addVisualListener
▸ Protected applyOpacity(context): ContourLineVisual
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
| Name | Type | Description |
|---|---|---|
context | RenderingContext | Rendering Context |
this
▸ Protected applyResponsiveStyle(): void
Apply a responsive style rules it is exists
void
AbstractVisual.applyResponsiveStyle
▸ checkCollision(context): boolean
Check if this node is within the area being rendered by the context
| Name | Type | Description |
|---|---|---|
context | RenderingContext | Rendering Context |
boolean
true if object is inside of renderable area
▸ chooseColor(index, len): string
Choose a color for the supplied contour value, using the current BehaviorType.
| Name | Type | Description |
|---|---|---|
index | number | The contour index. |
len | number | Size of the contour indexes. I.e. how many are there? Indexes are zero-referenced, so the highest possible index = len-1. |
string
color Color with the required color for this index
▸ clone(): Node
All subclasses should override copyConstructor or provide custom implementation for this method
clone
▸ connectStyle(style, type, callback): ContourLineVisual
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
| Name | Type | Description |
|---|---|---|
style | EventDispatcher | connect style |
type | string | type of event or property |
callback | AttributeCallback<EventDispatcher> | function to be called |
this
▸ contourInvalidated(args): void
This method is invoked when the contour shape has been invalidated. Nothing is performed for this class, but it must be overridden in subclasses for correct event processing.
Deprecated
since 4.0, use onContourShapeSet() and .on()/.off() for events
| Name | Type | Description |
|---|---|---|
args | ContourEvent | The contour event |
void
AbstractVisual.contourInvalidated
▸ Protected copyConstructor(src, deepCopy?): ContourLineVisual
Copy constructor function.
Function used as part of the cloning mechanism.
Implementations should copy the given instance state to this instance.
| Name | Type | Description |
|---|---|---|
src | Shape | Source to copy from |
Optional deepCopy | boolean | deep copy |
this
AbstractVisual.copyConstructor
▸ disconnectStyle(style, type, callback): ContourLineVisual
Disconnect style
This convenience method un-subscribes a listener to given style for the specified type.
| Name | Type | Description |
|---|---|---|
style | EventDispatcher | connect style |
type | string | type of event or property |
callback | AttributeCallback<EventDispatcher> | function to be called |
this
AbstractVisual.disconnectStyle
▸ 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.
void
▸ enableEventPropagation(enable): ContourLineVisual
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();| Name | Type | Description |
|---|---|---|
enable | boolean | enable |
this
AbstractVisual.enableEventPropagation
▸ execute(delegate): ContourLineVisual
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");
});| Name | Type | Description |
|---|---|---|
delegate | (this: ContourLineVisual) => void | Function to execute |
The result if any or this
▸ execute<T>(delegate): T
| Name |
|---|
T |
| Name | Type |
|---|---|
delegate | (this: ContourLineVisual) => T |
T
▸ Protected filter(context): boolean
Filter node
| Name | Type | Description |
|---|---|---|
context | RenderingContext | Rendering Context |
boolean
flag filter flag ("true" to render node; "false" otherwise)
▸ getAnimationStyle(): AnimationStyle
Return animation style
animationStyle current animation style
AbstractVisual.getAnimationStyle
▸ getClassName(): string
string
▸ getClipStyle(): ClipStyle
Gets the current clipping style
clipping style
▸ getColorBehavior(): BehaviorType
Gets the color behavior for this visual.
colorBehavior The color behavior type.
AbstractVisual.getColorBehavior
▸ getColorMap(): VisualColorMap
Gets the visual colorMap.
colorMap The colorMap used by this visual
▸ getCss(): CssStyle
Return CSS style
▸ getCssClass(): string
Returns css class name to be used to apply CSS style
string
the css class name
▸ getCssClasses(): string[]
Gets list of css class names which applied to this node
string[]
▸ getCssTransform(): string
Returns CSS transformation
string
AbstractVisual.getCssTransform
▸ getFillStyle(): FillStyle
Return fill style
fillStyle current fill style
▸ getId(): string | number
Returns the associated identifier of the node
string | number
The node's id
▸ getIndexStep(): number
Gets the index step for the line visual. Only contour lines with (index = step * i) will be displayed. Where 'i' iterates through all available line indices.
number
step Integer step interval
▸ Protected getInvalidateMethod(): AttributeCallback<EventDispatcher>
Gets invalidate method
AttributeCallback<EventDispatcher>
method to invalidate this object
AbstractVisual.getInvalidateMethod
▸ getIsolinesStylingStrategy(): IsolineStylingStrategy
Gets the isolines styling strategy
▸ getLabelFormat(): NumberFormat
Gets label format.
format
▸ getLabelMargin(): number
Gets the label margin. The margin is specified in device coordinates. Default is 5.
number
margin The margin around labels in device coordinates.
▸ getLabelSpacing(): number
Gets the label spacing. This is the space between nearby labels on an isoLine. Distance is specified in device space. Default is 200.
number
spacing The label spacing.
▸ getLabelingStrategy(): AbstractContourLabelingStrategy
Gets the labeling strategy.
AbstractContourLabelingStrategy
strategy The labeling strategy.
▸ getLabelsVisible(): boolean
Gets the visibility of all isolines
boolean
isolinesVisible True of all labels should be visible.
▸ getLineReservationFor(index): number
Find the line reservation value for the isoline with the specified index. This is used to determine if a particular isoline should be drawn.
Throws
if Index out of range
| Name | Type | Description |
|---|---|---|
index | number | Index for which line reservation should be computed. |
number
lineReservation The computed line reservation value.
▸ getLineStyle(): LineStyle
Gets the current LineStyle that is used to draw the isolines of this line visual. The "line color" property of the attribute is ignored because it is set directly from the colorMap. I.e. set such properties as "line style", and they will be applied globally to all isolines in this visual, regardless of color.
lineStyle The line style.
▸ getLinesVisible(): boolean
Gets the visibility of all isolines
boolean
isolinesVisible True of all isolines should be visible.
▸ getLocalTransform(): Transformation
Retrieves the transformation of bounds to parent
transform the local transform.
AbstractVisual.getLocalTransform
▸ getMarginsStyle(): SpaceStyle<string | number>
Return margins style
SpaceStyle<string | number>
AbstractVisual.getMarginsStyle
▸ getName(): string
Returns the node name
string
The node name
▸ getNotify(): boolean
Gets the notification state of this visual
Deprecated
since 4.0, use .isSilent() instead
boolean
notify If this is true, updates will be broadcast to the listeners.
▸ getOpacity(): number
Returns current node opacity
number
opacity
▸ getOpacityBlendMode(): BlendMode
Returns current node opacity
opacity blend mode
AbstractVisual.getOpacityBlendMode
▸ getParent(): Node
Return parent node
parent node
▸ getProperties(): OptionsOut
Gets all the properties pertaining to this object
visual properties
▸ getProperty(name): any
Gets dynamic property by name. These properties can be used as a property bags
| Name | Type | Description |
|---|---|---|
name | string | property name |
any
▸ getPropertyKeys(): string[]
Returns known properties keys
string[]
AbstractVisual.getPropertyKeys
▸ getRenderingFilter(): IFilter
Return filter to be used for rendering and picking
current filter
AbstractVisual.getRenderingFilter
▸ getResponsiveStyle(): ResponsiveStyle
Return responsive style
AbstractVisual.getResponsiveStyle
▸ getRoot(): Node
Returns root node.
If node doesn't have parent then it returns itself.
the root node
▸ getScaleScrollStrategy(): Delegate
Gets scale scroll strategy
scale scroll strategy
AbstractVisual.getScaleScrollStrategy
▸ getSceneTransform(): Transformation
Returns transformation from node to root scene
a transformation from node to root scene
AbstractVisual.getSceneTransform
▸ getTag(): any
Returns the object associated with the node by user.
any
The node's user-object
▸ getTextStyle(): TextStyle
Gets the current text style attribute that is used to draw the labels for this line visual. The "line color" property of the attribute is ignored because it is set directly from the colormap. I.e. set such properties as "font style", and they will be applied globally to all isolines in this visual, regardless of color.
textStyle The text style.
▸ getUseFontColorForLabels(): boolean
Gets the flag which indicates if font color is used for label text color.
boolean
useFontColor Flag which indicates if font color is used for label text color.
▸ getVisible(): boolean
Return visibility of the node
boolean
true if node is visible
▸ getWorldTransform(): Transformation
Retrieves the local transformation of the node which represents multiplication of parent to bounds and contents transformations.
transform the world transform.
AbstractVisual.getWorldTransform
▸ getZIndex(): number
Returns node z-index (null if not set)
number
▸ hasCssClass(cssClass): boolean
Check if node has specified css class
| Name | Type | Description |
|---|---|---|
cssClass | string | css class name |
boolean
▸ hasEventListener(type, callback?): boolean
Check if a list of event listeners for this type contains this listener
| Name | Type | Description |
|---|---|---|
type | string | type of event or property |
Optional callback | Function | to be called, if null, check if any callback is registered |
boolean
AbstractVisual.hasEventListener
▸ invalidate(bounds?, force?): ContourLineVisual
Invalidate area of the shape. This method invalidates parent by default. invalidated from parent to root node.
| Name | Type | Description |
|---|---|---|
Optional bounds | Rect | bounds of the invalid rectangle in the inner node coordinates |
Optional force | boolean | true 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 |
this
▸ invalidateParent(bounds?, force?): ContourLineVisual
Invalidate bounds
| Name | Type | Description |
|---|---|---|
Optional bounds | Rect | if null is provided then cache (if any will be completely refreshed) otherwise only specified rect or node.bounds will be refreshed |
Optional force | boolean | flag indicating if the parent must be forcibly invalidated |
this
AbstractVisual.invalidateParent
▸ invalidateVisual(): void
Invalidates the visual, sending events
void
AbstractVisual.invalidateVisual
▸ isDisposed(): boolean
Returns whether this object has been disposed
boolean
▸ isEventPropagationEnabled(): boolean
Return true if event propagation is enabled from child to parent
boolean
AbstractVisual.isEventPropagationEnabled
▸ isNotificationEnabled(): boolean
return state of notification
boolean
current notification state
AbstractVisual.isNotificationEnabled
▸ isSelectable(): boolean
Returns true if node can be picked/selected.
boolean
The selectable flag
▸ isSilent(): boolean
Return true if the event dispatcher doesn't notify any events
boolean
▸ notify<E>(type, source, args?): ContourLineVisual
Notify listeners of the Node
| Name | Type |
|---|---|
E | extends string |
| Name | Type | Description |
|---|---|---|
type | E | type of event |
source | ContourLineVisual | source who called the event |
Optional args | EventMap[E] | event arguments |
this
▸ notifyListeners(args): void
Notifies the registered listeners of an event.
Deprecated
since 4.0
| Name | Type | Description |
|---|---|---|
args | VisualEvent | The event to pass to the listeners. |
void
AbstractVisual.notifyListeners
▸ off<E>(type?, callback?): ContourLineVisual
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.
| Name | Type |
|---|---|
E | extends string |
| Name | Type | Description |
|---|---|---|
Optional type | E | type of the event |
Optional callback | (eventType: E, sender: ContourLineVisual, args: EventMap[E]) => void | function to be called |
this
▸ on<E>(type, callback): ContourLineVisual
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.
| Name | Type |
|---|---|
E | extends string |
| Name | Type | Description |
|---|---|---|
type | E | type of event or property |
callback | (eventType: E, sender: ContourLineVisual, args: EventMap[E]) => void | to be called |
this
▸ Protected onContourShapeSet(contour): void
this method called when visual is connected to Contour shape. override it to subscribe and unsubscribe
| Name | Type | Description |
|---|---|---|
contour | ContourShape | contour |
void
AbstractVisual.onContourShapeSet
▸ Protected onParentChanged(node): ContourLineVisual
This method is called when parent changes. Do not call it directly.
| Name | Type | Description |
|---|---|---|
node | Node | node to change parent |
this
AbstractVisual.onParentChanged
▸ Protected onVisibilityChanged(): void
This method is called if visibility is changed. Send event Events.VisibilityChanged
void
AbstractVisual.onVisibilityChanged
▸ Protected postRendering(context): void
To be called after rendering. Call this method if you override method render
| Name | Type | Description |
|---|---|---|
context | RenderingContext | Rendering Context |
void
▸ Protected preRendering(context): void
Occurs before rendering this method sets clipping by default. Call this method if you override method render
| Name | Type | Description |
|---|---|---|
context | RenderingContext | Rendering Context |
void
▸ registerAnimationStyle(root): void
Register animation style.
| Name | Type | Description |
|---|---|---|
root | Node | root node for node |
void
AbstractVisual.registerAnimationStyle
▸ removeCssClass(cssclass): ContourLineVisual
Removes css class from node
| Name | Type | Description |
|---|---|---|
cssclass | string | string[] | css class name('s) |
this
▸ removeInvalidateHandler(handler): ContourLineVisual
Remove invalidate handler
Deprecated
since 4.0, use Node.off instead
| Name | Type | Description |
|---|---|---|
handler | Function | handler to be notified about invalidation |
this
AbstractVisual.removeInvalidateHandler
▸ removeVisualListener(visualListener): void
Unregisters the specified visual listener from receiving event from this visual.
Deprecated
since 4.0
| Name | Type | Description |
|---|---|---|
visualListener | ContourShape | The visual listener |
void
AbstractVisual.removeVisualListener
▸ render(renderingContext): void
Render the visual. This must be defined in all subclasses.
| Name | Type | Description |
|---|---|---|
renderingContext | RenderingContext | The rendering context. |
void
▸ renderAsync(context, callback): void
Render node in asynchronous mode. Default implementation creates call method "render" inside
| Name | Type | Description |
|---|---|---|
context | RenderingContext | The rendering context to be used to draw the node |
callback | () => void | callback function |
void
▸ resetLabelGridMapping(): void
Reset label grid mapping. The grid mapping is used for mapping triangle grid to model space.
void
▸ rotate(theta, x, y): ContourLineVisual
Rotate bounds around a given coordinate
| Name | Type | Description |
|---|---|---|
theta | number | angle to rotate node, in radians |
x | number | x coordinate to rotate around |
y | number | y coordinate to rotate around |
this
▸ scale(xx, yy): ContourLineVisual
Scale node
| Name | Type | Description |
|---|---|---|
xx | number | x scale factor |
yy | number | y scale factor |
this
▸ setAnimationStyle(animationStyle): ContourLineVisual
Sets animation style
| Name | Type | Description |
|---|---|---|
animationStyle | Type | animation style |
AbstractVisual.setAnimationStyle
▸ setClipStyle(style): ContourLineVisual
Sets a new clipping style
| Name | Type | Description |
|---|---|---|
style | GraphicsPath | ClipStyle | Options | a new clipping style |
this
▸ setColorBehavior(colorBehavior): ContourLineVisual
Sets the color behavior for this visual.
| Name | Type | Description |
|---|---|---|
colorBehavior | BehaviorType | The color behavior type. |
this
AbstractVisual.setColorBehavior
▸ setColorMap(colorMap): ContourLineVisual
Sets the visual colorMap
| Name | Type | Description |
|---|---|---|
colorMap | VisualColorMap | The colorMap used by this visual |
this
▸ setCss(style, merge?): ContourLineVisual
Sets CSS style. This style will be applied for all inserted elements
| Name | Type | Description |
|---|---|---|
style | Type | CSS style to be applied to inserted elements |
Optional merge | boolean | merge flag |
this
▸ setCssClass(name): ContourLineVisual
Sets css class name of the node to be used to apply CSS style
| Name | Type | Description |
|---|---|---|
name | string | css class name of the node |
this
▸ setCssTransform(transform): ContourLineVisual
Set CSS transformation
| Name | Type | Description |
|---|---|---|
transform | string | Transformation | transformation css transformation instruction or Transformation instance |
this
AbstractVisual.setCssTransform
▸ setFillStyle(fillStyle, merge?): ContourLineVisual
Sets fill style
| Name | Type | Description |
|---|---|---|
fillStyle | Type | a new fill style |
Optional merge | boolean | true if you want to merge fillStyle with existing attribute, false by default |
this
▸ setId(id): ContourLineVisual
Allows the user to associate any identifier
| Name | Type | Description |
|---|---|---|
id | string | number | object id |
this
▸ setIndexStep(step): ContourLineVisual
Sets the index step for the line visual. Only contour lines with (index = step * i) will be displayed. Where 'i' iterates through all available line indices.
| Name | Type | Description |
|---|---|---|
step | number | Integer step interval |
this
▸ setIsolinesStylingStrategy(strategy): ContourLineVisual
Sets the isolines styling strategy. If set, style set in setLineStyle will be ignored. The "line color" property of the styles will override colorMap.
| Name | Type | Description |
|---|---|---|
strategy | IsolineStylingStrategy | strategy |
this
▸ setLabelFormat(format): ContourLineVisual
Sets label format.
| Name | Type | Description |
|---|---|---|
format | NumberFormat | format |
this
▸ setLabelMargin(margin): ContourLineVisual
Sets the label margin. The margin is specified in device coordinates. Default is 5.
| Name | Type | Description |
|---|---|---|
margin | number | The margin around labels in device coordinates. |
this
▸ setLabelSpacing(spacing): ContourLineVisual
Sets the label spacing. This is the space between nearby labels on an isoLine. Distance is specified in device space. Default is 200.
| Name | Type | Description |
|---|---|---|
spacing | number | The label spacing. |
this
▸ setLabelingStrategy(strategy): ContourLineVisual
Sets the labeling strategy.
| Name | Type | Description |
|---|---|---|
strategy | AbstractContourLabelingStrategy | The labeling strategy. |
this
▸ setLabelsVisible(visible): ContourLineVisual
Sets the visibility for all isolines
| Name | Type | Description |
|---|---|---|
visible | boolean | Flag for determining if labels should be visible. |
this
▸ setLineReservation(lineReservation): ContourLineVisual
Use this property to set the local reference to the line reservation array. This array is actually stored in the contour shape, and is passed to each line visual. All the elements of the array 'reservation[lineIndex] = Math.Max( reservation[lineIndex], GetIndexStep() )' Later, the implementation of the line visual may decide if the isoline with some particular index should be drawn using 'GetLineReservationFor' and 'GetIndexStep' methods. Hence, major and minor isolines can be supported.
| Name | Type | Description |
|---|---|---|
lineReservation | number[] | Int32Array | The line reservation |
this
▸ setLineStyle(lineStyle, merge?): ContourLineVisual
Sets the current LineStyle that is used to draw the isolines of this line visual. The "line color" property of the attribute is ignored because it is set directly from the colorMap. I.e. set such properties as "line style", and they will be applied globally to all isolines in this visual, regardless of color.
| Name | Type | Description |
|---|---|---|
lineStyle | Type | The line style. |
Optional merge | boolean | true if you want to merge lineStyle with existing attribute, false by default |
this
▸ setLinesVisible(visible): ContourLineVisual
Sets the visibility for all isolines
| Name | Type | Description |
|---|---|---|
visible | boolean | Flag for determining if isolines should be visible. |
this
▸ setLocalTransform(localTransform, force?): ContourLineVisual
Sets local transformation to be used to transform from local to parent coordinate
| Name | Type | Description |
|---|---|---|
localTransform | Transformation | local transformation for this node |
Optional force | boolean | boolean flag to force update event if transformations are equal, false by default |
this
AbstractVisual.setLocalTransform
▸ setMarginsStyle(margins, merge?): ContourLineVisual
Sets margins style
| Name | Type | Description |
|---|---|---|
margins | Type<string | number> | margins style |
Optional merge | boolean | true if you want to merge marginsStyle with existing attribute, false by default |
this
AbstractVisual.setMarginsStyle
▸ setName(name): ContourLineVisual
Sets name of the node
| Name | Type | Description |
|---|---|---|
name | string | The node name |
this
▸ setNotification(notify, force?): ContourLineVisual
set notification state
| Name | Type | Description |
|---|---|---|
notify | boolean | flag set to invalidate parent or not |
Optional force | boolean | true if parent should be invalidated immediately |
this
AbstractVisual.setNotification
▸ setNotify(notify): void
Sets the notification state of this visual
Deprecated
since 4.0, use .setSilent() instead
| Name | Type | Description |
|---|---|---|
notify | boolean | If this is true, updates will be broadcast to the listeners. |
void
▸ setOpacity(opacity, blendMode?): ContourLineVisual
Sets node opacity
| Name | Type | Description |
|---|---|---|
opacity | number | node opacity from 0 to 1 |
Optional blendMode | BlendMode | opacity blend mode. If it is normal, opacity will be replaced. |
this
▸ setProperties(properties?): ContourLineVisual
Sets all the properties pertaining to this object
| Name | Type | Description |
|---|---|---|
Optional properties | Options | An object containing the properties to set |
this
▸ setProperty(name, value): ContourLineVisual
Sets dynamic property by name
| Name | Type | Description |
|---|---|---|
name | string | property name |
value | any | property value |
this
▸ setRenderingFilter(filter): ContourLineVisual
Sets filter to be applied before rendering and picking
| Name | Type | Description |
|---|---|---|
filter | IFilter | filter to set |
this
AbstractVisual.setRenderingFilter
▸ setResponsiveStyle(style): ContourLineVisual
Sets responsive style.
| Name | Type | Description |
|---|---|---|
style | Options | ResponsiveStyle | responsive style |
this
AbstractVisual.setResponsiveStyle
▸ setScaleScrollStrategy(strategy?): ContourLineVisual
Sets scale scroll strategy
| Name | Type | Description |
|---|---|---|
Optional strategy | Delegate | scale scroll strategy |
this
AbstractVisual.setScaleScrollStrategy
▸ setSelectable(selectable): ContourLineVisual
Allows to select node. If node is not selectable then child node is not selectable.
| Name | Type | Description |
|---|---|---|
selectable | boolean | flag to allow node selection |
this
▸ setSilent(bool): ContourLineVisual
Set silent mode
| Name | Type | Description |
|---|---|---|
bool | boolean | flag to enable silent mode |
this
▸ setTag(tag): ContourLineVisual
Allows the user to associate any arbitrary object with the node.
| Name | Type | Description |
|---|---|---|
tag | any | The object to be associated with the node. |
this
▸ setTextStyle(textStyle, merge?): ContourLineVisual
Sets the current text style attributes that is used to draw the labels for this line visual.
| Name | Type | Description |
|---|---|---|
textStyle | Type | The text style. |
Optional merge | boolean | true if you want to merge textStyle with existing attribute, false by default |
this
▸ setUseFontColorForLabels(useFontColor): ContourLineVisual
Sets the flag which indicates if font color should be used for label text color.
| Name | Type | Description |
|---|---|---|
useFontColor | boolean | Flag which indicates if font color should be used for label text color. |
this
▸ setVisible(value): ContourLineVisual
Sets visibility of the node. Send event Events.VisibilityChanged
| Name | Type | Description |
|---|---|---|
value | boolean | flag specifying visibility of the node |
this
▸ setZIndex(value): ContourLineVisual
Sets z-index for node (set null for default)
| Name | Type | Description |
|---|---|---|
value | number | index determining node z-position |
this
▸ shear(shx, shy): ContourLineVisual
Shear this node's bounds
| Name | Type | Description |
|---|---|---|
shx | number | x-axis shear |
shy | number | y-axis shear |
this
▸ toString(): string
Returns a string representation of this object (generally the classname)
string
A string representation
▸ translate(tx, ty): ContourLineVisual
Translate bounds
| Name | Type | Description |
|---|---|---|
tx | number | x translation |
ty | number | y translation |
this
▸ unregisterAnimationStyle(root): void
Unregister animation style.
| Name | Type | Description |
|---|---|---|
root | Node | root node for node |
void
AbstractVisual.unregisterAnimationStyle
▸ updateSceneTransformation(): ContourLineVisual
Update scene transformation
this
AbstractVisual.updateSceneTransformation
▸ updateState(regions?, changes?): ContourLineVisual
Update state. These methods reset node state and update state for children. this method is useful to refresh a scene graph
| Name | Type | Description |
|---|---|---|
Optional regions | Rect[] | optional array to return invalid rectangles in the parent coordinates |
Optional changes | StateChanges | optional parameter to specify a reason of changes |
this
▸ Protected updateTimeStamp(): ContourLineVisual
Update time stamp to indicate that Node or Children has been changed.
this
AbstractVisual.updateTimeStamp
▸ Static enableSceneGraphNotification(enabled): void
Enable / disable all notifications
| Name | Type | Description |
|---|---|---|
enabled | boolean | sets if this object sends notifications |
void
AbstractVisual.enableSceneGraphNotification
▸ Static findParent<T>(node, classType, filter?): InstanceType<T>
Find root of the node with specified type
| Name | Type |
|---|---|
T | extends Constructor<any> |
| Name | Type | Description |
|---|---|---|
node | Node | node to start search |
classType | T | type of the class to search for |
Optional filter | (node: Node) => boolean | additional filter to apply |
InstanceType<T>
▸ Static findParent(node, classType, filter?): Node
Find root of the node with specified type
| Name | Type | Description |
|---|---|---|
node | Node | node to start search |
classType | string | interface name to search for |
Optional filter | (node: Node) => boolean | additional filter to apply |
▸ Static getClassName(): string
string
▸ Static intersectsBounds(bounds, localTransformation, parentInvalidArea, expand?): boolean
Check collision of the shape bounds with parent invalid area
| Name | Type | Description |
|---|---|---|
bounds | Rect | shape bounds |
localTransformation | Transformation | local transformation of the bounds |
parentInvalidArea | Rect | invalid parent area |
Optional expand | Dimension | optional expand the bounds in model coordinate |
boolean
true if bounds intersect the invalid area
AbstractVisual.intersectsBounds
▸ Static isSceneGraphNotificationEnabled(): boolean
Return status of the global notification for all nodes.
boolean