Last updated

API / geotoolkit / welllog / attributes / LogDataStyle / LogDataStyle

Class: LogDataStyle

attributes.LogDataStyle.LogDataStyle

Defines the abstract log data fill style. This fill style can use a data source to create gradient colors. Additionally, it supports two optional layers: a background fill and a foreground fill. The background fill is rendered behind the main fill, while the foreground fill is rendered in front of it. It is generally recommended to enable either the foreground or the background fill, but not both simultaneously. While it is possible to render both the background and foreground fills together, they will share the same colors.

Example

<caption>How to render gradient with background<caption>
const colorProvider = new DiscreteGradientColorProvider({'bins': 255})
.setScale(scale, 0, 1);
const style = new LogGradientStyle()
.setColorProvider(colorProvider)
.setLogData(curve.getDataSource());
style.setColor('#757575')
.setPattern(pattern)
.setRenderBackground(true)
.setTransparency(150);
*@example <caption>How to render gradient with foreground<caption>
const colorProvider = new DiscreteGradientColorProvider({'bins': 255})
.setScale(scale, 0, 1);
const style = new LogGradientStyle()
.setColorProvider(colorProvider)
.setLogData(curve.getDataSource());
style.setColor('#757575')
.setColor(KnownColors.Transparent)
.setForegroundColor('#757575')
.setPattern(pattern)
.setRenderForeground(true);

Hierarchy

Table of contents

Constructors
[new LogDataStyle(color)](/solutions/geotoolkit/apis/classes/geotoolkit.welllog.attributes-1.logdatastyle.logdatastyle.md#new logdatastyle(color))[new LogDataStyle(options)](/solutions/geotoolkit/apis/classes/geotoolkit.welllog.attributes-1.logdatastyle.logdatastyle.md#new logdatastyle(options))
Accessors
Methods
Css Properties
Name Type Description
colorstringColor in CSS form
datasourcestringLog data id
evenoddmodebooleanEven-odd fill mode
fillpatternPatternPattern
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
fillpattern-patternnamestringName of this pattern for indexing
fillpattern-scalablebooleanFlag that sets scalability of the pattern coordinates, or relative to the shape it is filling (It is not supported)
foregroundstringForeground color
patternPatternPattern
renderbackgroundbooleanExtra style parameter for background fill
renderforegroundbooleanExtra style parameter for foreground fill. Normally to render patterns

Contents

Constructors

new LogDataStyle(color)

Protected new LogDataStyle(color?)

Parameters

Name Type
Optional colorstring | RgbaColor | HsvColor | FillStyle

Overrides

FillStyle.constructor


new LogDataStyle(options)

Protected new LogDataStyle(options)

Parameters

Name Type
optionsOptions

Overrides

FillStyle.constructor

Accessors

Empty

Static get Empty(): FillStyle

Empty style

Returns

FillStyle

Inherited from

FillStyle.Empty


Pick

Static get Pick(): FillStyle

Pick style

Returns

FillStyle

Inherited from

FillStyle.Pick

Methods

clone

clone(): FillStyle

All inheritors should implement copy constructor or provide custom implementation for this method

Returns

FillStyle

this

Inherited from

FillStyle.clone


copyConstructor

Protected copyConstructor(src): LogDataStyle

copy constructor

Parameters

Name Type Description
srcLogDataStyleSource to copy from

Returns

LogDataStyle

Overrides

FillStyle.copyConstructor


dispose

dispose(): void

Dispose.

Returns

void

Inherited from

FillStyle.dispose


equalsTo

equalsTo(other): boolean

Returns true if fills are identical

Parameters

Name Type Description
otherFillStyleFillStyle to compare against

Returns

boolean

Inherited from

FillStyle.equalsTo


getClassName

getClassName(): string

Returns

string

Inherited from

FillStyle.getClassName


getColor

getColor(): string

Returns color

Returns

string

color in CSS form

Inherited from

FillStyle.getColor


getEvenOddMode

getEvenOddMode(): boolean

Gets the even odd fill mode

Returns

boolean

evenOddMode The even odd fill mode flag.

Inherited from

FillStyle.getEvenOddMode


getForegroundColor

getForegroundColor(): string

Gets foreground color

Returns

string

color in CSS form

Inherited from

FillStyle.getForegroundColor


getInterpolationType

getInterpolationType(): InterpolationType

Returns interpolation type

Returns

InterpolationType


getLogData

getLogData(): LogAbstractData

return log data

Returns

LogAbstractData

log data


getLogDataId

getLogDataId(): string

return log data id

Returns

string


getPattern

getPattern(context?): any

Return fill pattern. Can pass in rendering context to get HTML DOM pattern, or no arguments to get fillPattern object.

Parameters

Name Type Description
Optional contextIPatternContextnative rendering context

Returns

any

image pattern

Inherited from

FillStyle.getPattern


getProperties

getProperties(): OptionsOut

Gets all the properties pertaining to this object

Returns

OptionsOut

Overrides

FillStyle.getProperties


getRaster

getRaster(xMin?, yMin?, xMax?, yMax?): Raster

Returns a new instance of Raster

Parameters

Name Type Description
Optional xMinnumberx Min position to get color
Optional yMinnumbery Min position to get color
Optional xMaxnumberx Max position to get color
Optional yMaxnumbery Max position to get color

Returns

Raster

Inherited from

FillStyle.getRaster


getRenderBackground

getRenderBackground(): boolean

return render background state

Returns

boolean


getRenderForeground

getRenderForeground(): boolean

return render additional foreground

Returns

boolean


getRgbaColor

getRgbaColor(): RgbaColor

Return RGBA color

Returns

RgbaColor

color

Inherited from

FillStyle.getRgbaColor


getShadow

getShadow(): Shadow

Gets all properties pertaining to shadow

Returns

Shadow

JSON with offsetX, offsetY, color and blur properties

Inherited from

FillStyle.getShadow


getStyleType

getStyleType(): string

Gets type of style this is, STYLE_TYPE_COLOR or STYLE_TYPE_PATTERN

Returns

string

styleType

Inherited from

FillStyle.getStyleType


getTimeStamp

getTimeStamp(): number

Gets time stamp

Returns

number

timeStamp

Inherited from

FillStyle.getTimeStamp


getValueAt

getValueAt(depth, interpolationType): number

Return value at

Parameters

Name Type Description
depthnumberdepth to get value at
interpolationTypeInterpolationTypeinterpolation type

Returns

number


getValueColor

Abstract getValueColor(x, depth, y?, ratio?): RgbaColor

Gets color for specified depth and values

Parameters

Name Type Description
xnumberx device coordinate
depthnumberdepth
Optional ynumbery device coordinate
Optional rationumberratio x to total width

Returns

RgbaColor

rgba color


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

FillStyle.hasEventListener


invalidate

invalidate(): LogDataStyle

notify the node that the style is invalidated

Returns

LogDataStyle

this

Inherited from

FillStyle.invalidate


isDisposed

isDisposed(): boolean

Returns whether this object has been disposed

Returns

boolean

Inherited from

FillStyle.isDisposed


isSilent

isSilent(): boolean

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

Returns

boolean

Inherited from

FillStyle.isSilent


notify

notify<E>(type, source, args?): LogDataStyle

Notify listeners

Type parameters

NameType
Eextends string

Parameters

Name Type Description
typeEevent types
sourceStyleof the event
Optional argsEventMap[E]arguments of the event

Returns

LogDataStyle

this

Inherited from

FillStyle.notify


off

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

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
typeEtype of the event
Optional callback(eventType: E, sender: LogDataStyle, args: EventMap[E]) => voidfunction to be called

Returns

LogDataStyle

this

Inherited from

FillStyle.off


on

on<E>(type, callback): LogDataStyle

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

Returns

LogDataStyle

this

Inherited from

FillStyle.on


setColor

setColor(color): LogDataStyle

Sets color

Parameters

Name Type Description
colorstring | RgbaColor | HsvColor | HlsColorin CSS string form or RgbaColor object

Returns

LogDataStyle

this

Inherited from

FillStyle.setColor


setEvenOddMode

setEvenOddMode(evenOddMode): LogDataStyle

Sets the even odd fill mode

Parameters

Name Type Description
evenOddModebooleanThe even odd fill mode flag.

Returns

LogDataStyle

this

Inherited from

FillStyle.setEvenOddMode


setForegroundColor

setForegroundColor(color): LogDataStyle

Sets foreground color

Parameters

Name Type Description
colorstring | RgbaColor | HsvColor | HlsColorRgbaColor for foreground

Returns

LogDataStyle

this

Inherited from

FillStyle.setForegroundColor


setInterpolationType

setInterpolationType(interpolationType): LogDataStyle

Sets interpolation type

Throws

If interpolationType is not correct

Parameters

Name Type Description
interpolationTypestringinterpolation type

Returns

LogDataStyle


setLogData

setLogData(logData): LogDataStyle

set color provider

Parameters

Name Type Description
logDataLogAbstractDatalog data

Returns

LogDataStyle

this


setPattern

setPattern(pattern?): LogDataStyle

Sets fill pattern.

Parameters

Name Type Description
Optional patternPatternfill pattern

Returns

LogDataStyle

this

Inherited from

FillStyle.setPattern


setProperties

setProperties(properties?): LogDataStyle

Sets all the properties pertaining to this object

Parameters

Name Type Description
Optional propertiesOptionsAn object containing the properties to set

Returns

LogDataStyle

this

Overrides

FillStyle.setProperties


setRenderBackground

setRenderBackground(renderBackground): LogDataStyle

set render background state

Parameters

Name Type Description
renderBackgroundbooleanextra style parameter for background fill

Returns

LogDataStyle


setRenderForeground

setRenderForeground(renderForeground): LogDataStyle

set render foreground state

Parameters

Name Type Description
renderForegroundbooleanextra style parameter for foreground fill

Returns

LogDataStyle


setShadow

setShadow(shadow): LogDataStyle

Sets all properties pertaining to shadow

Parameters

Name Type Description
shadowPartial<Merge<Shadow, { color?: string | RgbaColor }>>data

Returns

LogDataStyle

this

Inherited from

FillStyle.setShadow


setSilent

setSilent(bool, force?): LogDataStyle

Set silent mode

Parameters

Name Type Description
boolbooleanflag to enable silent mode
Optional forcebooleantrue if parent should be invalidated immediately

Returns

LogDataStyle

this

Inherited from

FillStyle.setSilent


toGrayScale

toGrayScale(clone?): FillStyle

Clone the instance in grayscale style, or convert itself if [clone] is false.

Parameters

Name Type Description
Optional clonebooleanclone instance if true, default is true

Returns

FillStyle

Inherited from

FillStyle.toGrayScale


updateTimeStamp

updateTimeStamp(silent?): LogDataStyle

Update time stamp to indicate that style has been changed.

Parameters

Name Type Description
Optional silentbooleansilent mode. If this parameter equals to true then style doesn't send invalidate event

Returns

LogDataStyle

this

Inherited from

FillStyle.updateTimeStamp


getClassName

Static getClassName(): string

Returns

string

Inherited from

FillStyle.getClassName


isStyleNotificationEnabled

Static isStyleNotificationEnabled(): boolean

Return status of the global notification for all styles.

Returns

boolean

Inherited from

FillStyle.isStyleNotificationEnabled