API / geotoolkit / controls / tools / CrossHair / CrossHair
Creates a CrossHair tool. The tool supports events shown below. It provides built-in functions to customise the styles for the tool and its labels.
Events [Events](../enums/geotoolkit.controls.tools.crosshair.events.md)
| Event | Arguments | Description |
|---|---|---|
| onPositionChanged | [CrossHairEventArgs](../classes/geotoolkit.controls.tools.crosshaireventargs.crosshaireventargs.md) | This Event is fired when the Cross Hair Mouse position has been changed |
| onPointerUp | [CrossHairEventArgs](../classes/geotoolkit.controls.tools.crosshaireventargs.crosshaireventargs.md) | This Event is fired when the Cross Hair pointer is up |
| onPointerDown | [CrossHairEventArgs](../classes/geotoolkit.controls.tools.crosshaireventargs.crosshaireventargs.md) | This Event is fired when the Cross Hair pointer is down |
↳
CrossHair
Constructors
| [new CrossHair(layer, name)](/solutions/geotoolkit/apis/classes/geotoolkit.controls.tools.crosshair.crosshair.md#new crosshair(layer, name)) | [new CrossHair(options)](/solutions/geotoolkit/apis/classes/geotoolkit.controls.tools.crosshair.crosshair.md#new crosshair(options)) |
|---|
Methods
Css Properties
| Name | Type | Description |
|---|---|---|
east | LabelSettings | JSON for east label. See setLabelSettings for more details |
east-alignment | AnchorType | Alignment of the text |
east-cssclass | string | The css class name of this node |
east-displaymode | LabelDisplayMode | Label display mode, default is LabelDisplayMode.Shape |
east-fillstyle | string | Fill style of the text |
east-fillstyle | FillStyle | Fill style of the text |
east-fillstyle-color | string | Color in CSS form |
east-fillstyle-evenoddmode | boolean | Even-odd fill mode |
east-fillstyle-fillpattern | Pattern | Pattern |
east-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 |
east-fillstyle-fillpattern-patternname | string | Name of this pattern for indexing |
east-fillstyle-fillpattern-scalable | boolean | Flag that sets scalability of the pattern coordinates, or relative to the shape it is filling (It is not supported) |
east-fillstyle-foreground | string | Foreground color |
east-fillstyle-pattern | Pattern | Pattern |
east-linestyle | string | Line style of the text border |
east-linestyle | LineStyle | Line style of the text border |
east-linestyle-color | string | Color in CSS form |
east-linestyle-fill | string | Optional fill style to be used to fill lines generated with this style |
east-linestyle-fill | FillStyle | Optional fill style to be used to fill lines generated with this style |
east-linestyle-linecap | CapStyle | The line cap style |
east-linestyle-linedashoffset | number | Line dash offset of dashed line |
east-linestyle-linejoin | JoinStyle | The line join style |
east-linestyle-pixelsnapmode | boolean | Pixel Snap Mode, default( |
east-linestyle-scalable | boolean | True if width should depend on transformation |
east-linestyle-unit | string | Optional unit for the width |
east-linestyle-width | number | string | The line thickness |
east-offset | number | string | Label offset between the text and cross-hair cursor, use padding in case of undefined |
east-padding | number | |
east-paddingstyle | number | string | Padding style between the text and the border |
east-radius | number | Radius of the text shape border |
east-textstyle | string | Text style of the text |
east-textstyle | TextStyle | Text style of the text |
east-textstyle-alignment | AlignmentStyle | Alignment |
east-textstyle-autosize | boolean | Auto font size on high definition display |
east-textstyle-background | string | Background style |
east-textstyle-background | FillStyle | Background style |
east-textstyle-baseline | BaseLineStyle | Base line |
east-textstyle-color | string | Color in CSS form |
east-textstyle-fill | FillStyle | Text fill style |
east-textstyle-font | string | Font see |
east-textstyle-fonturl | string | The place from which the font will be loaded, if null - uses system fonts. It can be base64 with url keyword |
east-textstyle-lineheight | string | number | Line height |
east-textstyle-multiline | boolean | Allow multi-line text |
east-textstyle-outline | string | Outline style |
east-textstyle-outline | LineStyle | Outline style |
east-textstyle-overflowwrap | OverflowWrapStyle | Overflow wrap |
east-textstyle-strikethrough | string | Strikethrough style |
east-textstyle-strikethrough | LineStyle | Strikethrough style |
east-textstyle-textoverflow | TextOverflowStyle | Text overflow |
east-textstyle-underline | string | Underline style |
east-textstyle-underline | LineStyle | Underline style |
east-textstyle-underlineoffset | string | number | Underline offset distance |
east-textstyle-whitespace | WhiteSpaceStyle | White space |
east-textstyle-wordbreak | WordBreakStyle | Word break |
east-tooltip | Properties | Tooltip properties, this options applyes only in case if displaymode:LabelDisplayMode.DivElement |
east-tooltip-alignment | AnchorType | Tooltip alignment according to the point set by offsets |
east-tooltip-autoflip | boolean | True to automatically flip tooltip alignment if it doesn't fit the window |
east-tooltip-cssclasses | string | CSS classes' names to be applied for tooltip 'cg-tooltip' by default |
east-tooltip-delay | number | |
east-tooltip-hidedelay | number | Auto hide in millisecond, 0 means false and autohide is disabled |
east-tooltip-offsetx | number | Offset of tooltip from current position by x in pixels |
east-tooltip-offsety | number | Offset of tooltip from current position by y in pixels |
east-tooltip-orientation | Orientation | Tooltip orientation |
east-tooltip-showdelay | number | Delay between displaying tooltip, 0 means false and tooltip shows immediately |
east-tooltip-size | Range | Client size range |
east-tooltip-size-high | number | Upper range boundary |
east-tooltip-size-low | number | Lower range boundary |
east-tooltip-size-max | number | |
east-tooltip-size-min | number | |
east-visible | boolean | Visibility of the text |
east-z-index | number | Define node z-index |
enabled | boolean | Enabled state |
fillstyle | string | Fillstyle of the cross-hair (used only with radius) |
fillstyle | FillStyle | Fillstyle of the cross-hair (used only with radius) |
horizontal | string | Linestyle for horizontal line |
horizontal | LineStyle | Linestyle for horizontal line |
keeporientation | boolean | Preserve annotation's orientation of labels for different |
labels | boolean | If 'none' of false - do not create labels |
layer | CompositeNode | Manipulator layer |
layer-clipping | boolean | Enable clipping, this does not consider the clipstyle, it is related to bounds-clipping |
layer-clipstyle | ClipStyle | Clipping style |
layer-clipstyle-evenodd | boolean | True if evenodd mode is on ('nonzero' mode otherwise) |
layer-clipstyle-geometry | GraphicsPath | Clipping geometry |
layer-clipstyle-geometry-bounds | Rect | Bounds |
layer-clipstyle-geometry-bounds-height | number | Height |
layer-clipstyle-geometry-bounds-readonly | boolean | Readonly |
layer-clipstyle-geometry-bounds-width | number | Width |
layer-clipstyle-geometry-bounds-x | number | Left |
layer-clipstyle-geometry-bounds-y | number | Top |
layer-clipstyle | GraphicsPath | Clipping style |
layer-cssclass | string | The css class name of this node |
layer-csscursor | string | CSS cursor associated with node |
layer-cssstyle | string | CSS style to be applied to inserted elements |
layer-id | string | number | Id of the node, its a unique identifier |
layer-infinity | boolean | Mode to render outside the model limits |
layer-localtransform | Transformation | Local transformation |
layer-localtransform-dx | number | X axis translation |
layer-localtransform-dy | number | Y axis translation |
layer-localtransform-xx | number | X scale |
layer-localtransform-xy | number | Xy skew |
layer-localtransform-yx | number | Yx skew |
layer-localtransform-yy | number | Y scale |
layer-margins | number | string | It has properties for specifying the margins for each side |
layer-name | string | Name of the node. It is often used for debugging purposes or to simplify queries |
layer-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 |
layer-opacityblendmode | BlendMode | Node opacity mode to blend it |
layer-scalescrollstrategy | ScaleScrollStrategy | Scale scroll strategy |
layer-scalescrollstrategy-enabled | boolean | Enable flag |
layer-selectable | boolean | Selectable node, a boolean to determine if selection should consider this node |
layer-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 |
layer-transform | string | Additional CSS transformation applied to node or 'none' |
layer-transform | Transformation | Additional CSS transformation applied to node or 'none' |
layer-visible | boolean | Visibility of the node, a boolean to determine if the node should be rendered or not |
layer-z-index | number | Define node z-index |
linestyle | string |
|
linestyle | LineStyle |
|
mouseradius | number | Device radius for mouse events |
name | string | Name of the tool used like cross-hair etc |
north | LabelSettings | JSON for north label. See setLabelSettings for more details |
outlinestyle | string | OutLinestyle for both lines |
outlinestyle | LineStyle | OutLinestyle for both lines |
radius | number | Radius of the cross-hair center target |
south | LabelSettings | JSON for south label. See setLabelSettings for more details |
symbol | SymbolShape | Symbol of the cross-hair |
symbol-alignment | AnchorType | Alignment according to the anchor point |
symbol-alignment | AnchorType | Anchor type of symbol |
symbol-ax | number | Anchor x position |
symbol-ay | number | Anchor y position |
symbol-cache | boolean | Set it to true if you want to cache complex geometry to raster |
symbol-clipstyle | ClipStyle | Clipping style |
symbol-clipstyle | GraphicsPath | Clipping style |
symbol-cssclass | string | The css class name of this node |
symbol-csscursor | string | CSS cursor associated with node |
symbol-cssstyle | string | CSS style to be applied to inserted elements |
symbol-fillstyle | string | Style applied on fill |
symbol-fillstyle | FillStyle | Style applied on fill |
symbol-height | number | Shape height |
symbol-id | string | number | Id of the node, its a unique identifier |
symbol-ispointingup | boolean | Defines whether the shape is always pointing up |
symbol-layoutstyle | LayoutStyle | Layout style to specify how to lay out shape |
symbol-layoutstyle-constraint | SizeConstraint | Layout constrains |
symbol-layoutstyle-flexgrow | number | Number specifying how much the item will grow relative to the rest of the items inside the same container |
symbol-layoutstyle-flexshrink | number | Number specifying how much the item will shrink relative to the rest of the items inside the same container |
symbol-layoutstyle-float | string | Float position |
symbol-layoutstyle-position | string | Layout position |
symbol-layoutstyle-size | number | string | Layout size |
symbol-linestyle | string | Style applied on outline |
symbol-linestyle | LineStyle | Style applied on outline |
symbol-localtransform | Transformation | Local transformation |
symbol-margins | number | string | It has properties for specifying the margins for each side |
symbol-maxdimension | Dimension | Maximum size for rendering |
symbol-maxdimension-height | number | Height of dimension |
symbol-maxdimension-width | number | Width of dimension or properties |
symbol-mindimension | Dimension | Minimum size for rendering |
symbol-name | string | Name of the node. It is often used for debugging purposes or to simplify queries |
symbol-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 |
symbol-opacityblendmode | BlendMode | Node opacity mode to blend it |
symbol-painter | string | A function with has parameters: symbol, box, context |
symbol-painterproperties | any | Symbol's painter's properties |
symbol-preserveaspectratio | boolean | Preserve aspect ratio of the anchored shape |
symbol-preservereadingorientation | boolean | Preserve reading orientation for local transform |
symbol-preserverightangle | boolean | Preserve right angle for local transformation |
symbol-rotationangle | number | Rotation angle at anchor |
symbol-scalescrollstrategy | ScaleScrollStrategy | Scale scroll strategy |
symbol-selectable | boolean | Selectable node, a boolean to determine if selection should consider this node |
symbol-sizeisindevicespace | boolean | Is coordinate in device space |
symbol-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 |
symbol-transform | string | Additional CSS transformation applied to node or 'none' |
symbol-transform | Transformation | Additional CSS transformation applied to node or 'none' |
symbol-useminmaxdimensions | boolean | Use the min max dimensions to limit visual size |
symbol-visible | boolean | Visibility of the node, a boolean to determine if the node should be rendered or not |
symbol-width | number | Shape width |
symbol-z-index | number | Define node z-index |
textstyle | string |
|
textstyle | TextStyle |
|
touchradius | number | Device radius for touch events |
vertical | string | Linestyle for vertical line |
vertical | LineStyle | Linestyle for vertical line |
west | LabelSettings | JSON for west label. See setLabelSettings for more details |
Constructors
• new CrossHair(layer?, name?)
Creates CrossHair
| Name | Type | Description |
|---|---|---|
Optional layer | CompositeNode<Node> | manipulator layer |
Optional name | string | name of the tool used like cross-hair etc |
AbstractTool.constructor
• new CrossHair(options?)
Creates CrossHair
| Name | Type | Description |
|---|---|---|
Optional options | Options | properties object |
AbstractTool.constructor
Methods
▸ addListener(eventName, listener): CrossHair
add event listener. The listener receives the message when the system event happens.
Deprecated
since 4.0 use .on() instead. Note that 3 args callback should be used in subscription via .on(): (eventType, source, args)
| Name | Type | Description |
|---|---|---|
eventName | string | event name or unique event identifier |
listener | Function | the event listener |
▸ captureMouseUp(): void
listen to window mouse events in order to catch a mouse up action outside of the tool container DOM element. useful for example when you pan and release click outside of DOM element.
void
▸ dispose(): void
Dispose tool.
void
▸ fireEvent(eventName, eventArgs?): void
This method is Protected. Fire an Event.
Deprecated
since 4.0 use .notify() instead. Note that 3 args callback should be used in subscription via .on()
| Name | Type | Description |
|---|---|---|
eventName | string | event name |
Optional eventArgs | any | contains info of the event |
void
▸ getClassName(): string
string
▸ Protected getEventRadius(eventArgs): number
Returns device radius for the provided event
| Name | Type | Description |
|---|---|---|
eventArgs | EventArgs | contains info of the event |
number
▸ getFillStyle(): FillStyle
Return fill style
▸ getHorizontalLineStyle(): LineStyle
return horizontal line style
▸ getLabelSettings(orientation): LabelSettingsOut
Gets settings for one label
| Name | Type | Description |
|---|---|---|
orientation | AnnotationLocation | label orientation |
JSON to configure label
▸ getLineStyle(): LineStyle
Return line style
▸ getManipulatorLayer(): CompositeNode<Node>
return manipulator layer
layer
AbstractTool.getManipulatorLayer
▸ getMouseRadius(): number
Returns current device radius for mouse events
number
▸ getName(): string
return tool name if any
string
name of the tool
▸ getOutLineStyle(): LineStyle
Return outline style
▸ getParentTool(): AbstractCompositeTool
Gets parent tool
parent tool
▸ getPosition(): Point
The current cross hair position
▸ getProperties(context?): OptionsOut
Gets all the properties pertaining to this object
| Name | Type | Description |
|---|---|---|
Optional context | ISerializationContext | serialization context |
properties object
▸ 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[]
▸ getRadius(): number
Returns radius of the cursor center target
number
▸ getRoot(): AbstractCompositeTool
Gets root tool
parent tool
▸ getSymbol(): SymbolShape
Return cross-hair symbol
▸ getTarget(): Node
Returns current target
target
▸ getTouchRadius(): number
Returns current device radius for touch events
number
▸ getVerticalLineStyle(): LineStyle
return vertical line style
▸ 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
▸ isActive(): boolean
return active state
boolean
▸ isDisposed(): boolean
Returns whether this object has been disposed
boolean
▸ Protected isDoubleClick(point, eventArgs?): boolean
returns true if double clicked
| Name | Type | Description |
|---|---|---|
point | Point | Click point |
Optional eventArgs | EventArgs | optional event args to verify double click |
boolean
▸ isEnabled(): boolean
returns enable state
boolean
state
▸ isSilent(): boolean
Return true if the event dispatcher doesn't notify any events
boolean
▸ isTouchEvent(eventArgs): boolean
return true if the event is a touch event and false otherwise.
| Name | Type | Description |
|---|---|---|
eventArgs | Event | EventArgs | contains info of the event |
boolean
▸ isVisible(): boolean
return visible state
boolean
▸ notify<E>(type, source, args?): CrossHair
Notify listeners
| Name | Type |
|---|---|
E | extends string |
| Name | Type | Description |
|---|---|---|
type | E | event types |
source | CrossHair | of the event |
Optional args | EventMap[E] | arguments of the event |
this
▸ off<E>(type?, callback?): CrossHair
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: CrossHair, args: EventMap[E]) => void | function to be called |
this
▸ on<E>(type, callback): CrossHair
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.
TypeScript hint: in case of creating derived tool with own events, EventMap should be extended and .on() and .notify() methods redeclared, see sample.Example
// Using in derived tool
import type {EventMap as EventMapBase} from '@int/geotoolkit/controls/tools/AbstractTool';
export type EventMap = EventMapBase & {
[MyToolEvents.onValueChanged]: MyToolEventArgs
}
export enum MyToolEvents {
onValueChanged = 'onValueChanged'
}
export class MyTool extends AbstractTool {
public declare on: <E extends keyof EventMap>(type: E, callback: (eventType: E, sender: this, args: EventMap[E]) => void) => this;
protected declare notify: <E extends keyof EventMap>(type: E, source: AbstractTool, args?: EventMap[E]) => this;
public declare off: <E extends keyof EventMap>(type: E, callback?: (eventType: E, sender: this, args: EventMap[E]) => void) => this;
// ...
}| Name | Type |
|---|---|
E | extends string |
| Name | Type | Description |
|---|---|---|
type | E | type of event or property |
callback | (eventType: E, sender: CrossHair, args: EventMap[E]) => void | to be called |
▸ Protected onActiveStateChanged(): void
Fires
void
AbstractTool.onActiveStateChanged
▸ Protected onEnabledStateChanged(): void
Fires
void
AbstractTool.onEnabledStateChanged
▸ pageToCanvas(eventArgs, externalPlot?): Object
return position relative to the canvas
| Name | Type | Description |
|---|---|---|
eventArgs | Event | EventArgs | parentElement the parent HTML element |
Optional externalPlot | Plot | plot |
Object
| Name | Type |
|---|---|
x | number |
y | number |
▸ pointToModel(model, eventArgs): Point
converts device coordinates to inner coordinates of node
| Name | Type | Description |
|---|---|---|
model | CompositeNode<Node> | the model |
eventArgs | Point | EventArgs | arguments of the event OR point in device (plot) coordinates. |
▸ removeListener(eventName, listener?): CrossHair
remove event listener. The listener reveives the message when the system event happens.
Deprecated
since 4.0 use .off() instead.
| Name | Type | Description |
|---|---|---|
eventName | string | event name |
Optional listener | Function | Function[] | the event listener, if null, remove all listeners for the event |
▸ setActive(active): CrossHair
set active state
Fires
| Name | Type | Description |
|---|---|---|
active | boolean | set active state |
▸ setEnabled(enabled): CrossHair
set enable state
Fires
Fires
| Name | Type | Description |
|---|---|---|
enabled | boolean | sets the enabled state |
this
▸ setFillStyle(fillStyle, merge?): CrossHair
Sets fill style, used if radius is not null
| Name | Type | Description |
|---|---|---|
fillStyle | Type | line style or options |
Optional merge | boolean | true if you want to merge lineStyle with existing attribute, false by default |
this
▸ setHorizontalLineStyle(lineStyle, merge?): CrossHair
Sets vertical line style
| Name | Type | Description |
|---|---|---|
lineStyle | Type | line style or options |
Optional merge | boolean | true if you want to merge lineStyle with existing attribute, false by default |
this
▸ setLabelSettings(orientation, settings?): CrossHair
Set Settings for one label
| Name | Type | Description |
|---|---|---|
orientation | AnnotationLocation | label orientation |
Optional settings | LabelSettings | JSON to configure label |
this
▸ setLabelsTextConverter(position, textConverter): CrossHair
sets LabelsTextConverter
| Name | Type | Description |
|---|---|---|
position | AnnotationLocation | position of the label to be changed |
textConverter | TextConverter | function that takes x and y to convert to text for the label |
this
▸ setLineStyle(lineStyle, merge?): CrossHair
Sets line style
| Name | Type | Description |
|---|---|---|
lineStyle | Type | line style or options |
Optional merge | boolean | true if you want to merge lineStyle with existing attribute, false by default |
this
▸ setMouseRadius(radius): CrossHair
Sets device radius for mouse events
| Name | Type | Description |
|---|---|---|
radius | number | radius for mouse events |
this
▸ setName(name): CrossHair
set tool name
| Name | Type | Description |
|---|---|---|
name | string | the tool name |
▸ setOutLineStyle(lineStyle, merge?): CrossHair
Sets line style
| Name | Type | Description |
|---|---|---|
lineStyle | Type | line style or options |
Optional merge | boolean | true if you want to merge lineStyle with existing attribute, false by default |
this
▸ setPosition(position, silent?, eventArgs?): CrossHair
Sets the current position in model coordinates of the manipulator layer
| Name | Type | Description |
|---|---|---|
position | Point | current mouse position |
Optional silent | boolean | notification enabled or not |
Optional eventArgs | EventArgs | event args which will be passed to event onPositionChanged |
this
▸ setProperties(properties?): CrossHair
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): CrossHair
Sets dynamic property by name
| Name | Type | Description |
|---|---|---|
name | string | property name |
value | any | property value |
this
▸ setRadius(radius): CrossHair
set radius of the cursor center target
| Name | Type | Description |
|---|---|---|
radius | number | center radius |
▸ setSelectTargetCallback(callback): CrossHair
Sets callback for selecting target Node from scene
| Name | Type | Description |
|---|---|---|
callback | SelectTargetCallback | function that takes current mouse position and returns target for crosshair |
this
▸ setSilent(bool): CrossHair
Set silent mode
| Name | Type | Description |
|---|---|---|
bool | boolean | flag to enable silent mode |
this
▸ setSlotEnabled(eventName, value, target?): CrossHair
Sets slot enabled
| Name | Type | Description |
|---|---|---|
eventName | string | eventName |
value | boolean | value |
Optional target | EventTarget | target |
▸ setSlots(slots?, merge?): CrossHair
Sets new slots.
Example
const slots = {
'pointerdown': (event: EventArgs) => {
// event is an instance of @int/geotoolkit/controls/tools/EventArgs
...
}
};
tool.setSlots(slots);| Name | Type | Description |
|---|---|---|
Optional slots | Record<string, Slot | Slot[] | (eventArgs: EventArgs) => void> | type of system events |
Optional merge | boolean | set to true if you want to merge with existing slots |
this
▸ setSymbol(symbol): CrossHair
set cross-hair symbol
| Name | Type | Description |
|---|---|---|
symbol | SymbolShape | cross-hair symbol |
this
▸ setTextStyle(textStyle, merge?): CrossHair
Sets the text style of labels
| Name | Type | Description |
|---|---|---|
textStyle | Type | for the crosshair labels on screen |
Optional merge | boolean | true if you want to merge textStyle with existing attribute, false by default |
this
▸ setTouchRadius(radius): CrossHair
Sets device radius for touch events
| Name | Type | Description |
|---|---|---|
radius | number | radius for touch events |
this
▸ setVerticalLineStyle(lineStyle, merge?): CrossHair
Sets vertical line style
| Name | Type | Description |
|---|---|---|
lineStyle | Type | line style or options |
Optional merge | boolean | true if you want to merge lineStyle with existing attribute, false by default |
this
▸ setVisible(visible): CrossHair
Sets visible
| Name | Type | Description |
|---|---|---|
visible | boolean | visible attribute set or not |
this
▸ Protected start(eventArgs?): CrossHair
start
| Name | Type | Description |
|---|---|---|
Optional eventArgs | EventArgs | event args |
▸ Protected stop(): CrossHair
stop
▸ toggle(): CrossHair
switch enable state to opposite state
▸ updateCursorPosition(silent?): CrossHair
Update position of cursor for the last mouse position. This code can be used if content is scrolled to display the position of the cursor in the last mouse position
| Name | Type | Description |
|---|---|---|
Optional silent | boolean | notification enabled or not |
this
▸ Static canvasToClient(plotPoint, plot): Point
Convert plot coordinates to global coordinates
▸ Static clientToCanvas(nativeEvent, plot): Point
Convert global coordinates to plot coordinates
| Name | Type | Description |
|---|---|---|
nativeEvent | Event | native browser event |
plot | Plot | plot with canvas |
▸ Static getClassName(): string
string
▸ Static getExclusiveTool(plot): AbstractTool
return exclusive tool associated with plot
| Name | Type | Description |
|---|---|---|
plot | Plot | plot |
tool
▸ Static getNativeEventName(eventName): string[]
Returns native event name
| Name | Type | Description |
|---|---|---|
eventName | string | W3C Pointer Events Recommendation name |
string[]
AbstractTool.getNativeEventName
▸ Static isTouchEvent(eventArgs): eventArgs is TouchEvent
return true if the event is a touch event and false otherwise.
| Name | Type | Description |
|---|---|---|
eventArgs | Event | EventArgs | contains info of the event |
eventArgs is TouchEvent
▸ Static lock(plot, tool): void
Set exclusive tool for plot
| Name | Type | Description |
|---|---|---|
plot | Plot | plot |
tool | AbstractTool | tool |
void
▸ Static setDefaultMouseRadius(radius): void
Sets default device radius for mouse events
| Name | Type | Description |
|---|---|---|
radius | number | radius for mouse events |
void
AbstractTool.setDefaultMouseRadius
▸ Static setDefaultTouchRadius(radius): void
Sets default device radius for touch events
| Name | Type | Description |
|---|---|---|
radius | number | radius for touch events |
void
AbstractTool.setDefaultTouchRadius
▸ Static unlock(value): void
Remove exclusive tool from plot
| Name | Type | Description |
|---|---|---|
value | AbstractTool | Plot | value |
void