Last updated

API / geotoolkit / welllog / data / AccumulationCycleData / AccumulationCycleData

Class: AccumulationCycleData

data.AccumulationCycleData.AccumulationCycleData

Define data for AccumulationCycle visual

Example

const data1 = new AccumulationCycleData('AccumulationCycle', depths, values);
const data2 = new AccumulationCycleData({
'depths': depths,
'values': values,
'name': 'AccumulationCycle'
});

Hierarchy

Implements

Table of contents

Constructors
Methods
Css Properties
Name Type Description
namestringThe log data name

Contents

Constructors

new AccumulationCycleData(name, depth, values, fillStyles, titles)

new AccumulationCycleData(name?, depth?, values?, fillStyles?, titles?)

Constructor

Parameters

Name Type Description
Optional namestring | Optionsdata name, or object
Optional depthnumber[]array of depth values
Optional valuesnumber[]array of values
Optional fillStylesType[]array of colors
Optional titlesstring[]array of titles

Overrides

LogAbstractData.constructor

Methods

addValue

addValue(depth, value, fillStyle): void

Add values

Parameters

Name Type Description
depthnumberThe depth for which you want to compute the value
valuenumbervalue at the specified depth
fillStyleTypefillstyle at the specified depth

Returns

void


addValues

addValues(depths, values, fillStyles): void

Add values at the bottom of the log

Parameters

Name Type Description
depthsnumber[]The array of ordered depths
valuesnumber[]The array of values
fillStylesType[]The array of fill styles

Returns

void


calculateNeatLimits

calculateNeatLimits(logScale, centerOnZeroOnNegativeMin, displayUnit): number[]

Return an array of neat min and max

Parameters

Name Type Description
logScalebooleanscale log scale
centerOnZeroOnNegativeMinbooleanIf negative and positive values, center around 0
displayUnitstring | AbstractUnitdisplayed unit

Returns

number[]

Overrides

LogAbstractData.calculateNeatLimits


clear

clear(): AccumulationCycleData

Clear log data. Removes all samples and reset depth limits

Returns

AccumulationCycleData

Overrides

LogAbstractData.clear


connectStyle

connectStyle(style, type, callback): AccumulationCycleData

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

AccumulationCycleData

this

Implementation of

IStyleListener.connectStyle


disconnectStyle

disconnectStyle(style, type, callback): AccumulationCycleData

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

AccumulationCycleData

this

Implementation of

IStyleListener.disconnectStyle


dispose

dispose(): void

Dispose.

Returns

void

Overrides

LogAbstractData.dispose


getClassName

getClassName(): string

Returns

string

Inherited from

LogAbstractData.getClassName


getColor

getColor(index): string

Return color by index

Deprecated

since 4.1 Use getFillStyle instead

Parameters

Name Type Description
indexnumberindex of the sample in the array

Returns

string


getColors

getColors(): string[]

Return an array of colors

Returns

string[]


getDataOrder

getDataOrder(): Order

Return the order of the log data

Returns

Order

Overrides

LogAbstractData.getDataOrder


getDepth

getDepth(index): number

Return depth by index

Parameters

Name Type Description
indexnumberindex at the depth

Returns

number

Overrides

LogAbstractData.getDepth


getDepths

getDepths(): number[]

Return an array of depths

Returns

number[]

Overrides

LogAbstractData.getDepths


getFillStyle

getFillStyle(index): FillStyle

Return color by index

Parameters

Name Type Description
indexnumberindex of the sample in the array

Returns

FillStyle


getFillStyles

getFillStyles(): FillStyle[]

Return an array of fill styles

Returns

FillStyle[]


getIndexAt

getIndexAt(depth, fromIndex?, toIndex?): number

Return index for specified depth

Parameters

Name Type Description
depthnumberThe depth for which you want to compute the index
Optional fromIndexnumberindex of sample in depths
Optional toIndexnumberindex of sample in depths

Returns

number

Inherited from

LogAbstractData.getIndexAt


getIndexUnit

getIndexUnit(): AbstractUnit

Return the value unit

Throws

when this method is not implemented

Returns

AbstractUnit

Overrides

LogAbstractData.getIndexUnit


getInvalidateMethod

getInvalidateMethod(): AttributeCallback<EventDispatcher>

invalidate Method

Returns

AttributeCallback<EventDispatcher>

method to invalidate this object


getMaxDepth

getMaxDepth(): number

Return maximum depth

Returns

number

Overrides

LogAbstractData.getMaxDepth


getMaxMeaningDepth

getMaxMeaningDepth(): number

Return maximum Meaning depth (last depth with value)

Returns

number

Overrides

LogAbstractData.getMaxMeaningDepth


getMaxValue

getMaxValue(): number

Return maximum data value

Returns

number

Overrides

LogAbstractData.getMaxValue


getMinDepth

getMinDepth(): number

Return minimum depth

Returns

number

Overrides

LogAbstractData.getMinDepth


getMinMeaningDepth

getMinMeaningDepth(): number

Return minimum Meaning depth (first depth with value)

Returns

number

Overrides

LogAbstractData.getMinMeaningDepth


getMinValue

getMinValue(): number

Return minimum data value

Returns

number

Overrides

LogAbstractData.getMinValue


getName

getName(): string

Return name of the data

Returns

string

Overrides

LogAbstractData.getName


getProperties

getProperties(): OptionsOut

Gets all the properties pertaining to this object

Returns

OptionsOut

properties object


getSize

getSize(): number

Return a count of the samples

Returns

number

Overrides

LogAbstractData.getSize


getState

getState(): LogDataState

Return state

Returns

LogDataState

Inherited from

LogAbstractData.getState


getTimeStamp

getTimeStamp(): number

Return the value to indicate if data source was changed

Returns

number

Inherited from

LogAbstractData.getTimeStamp


getTitle

getTitle(index): string

Return title by index

Parameters

Name Type Description
indexnumberindex at the depth

Returns

string


getTitles

getTitles(): string[]

Return titles of the data

Returns

string[]


getValue

getValue(index): number

Return value by index

Parameters

Name Type Description
indexnumberindex of the sample in the array

Returns

number

Overrides

LogAbstractData.getValue


getValueAt

getValueAt(depth, fromIndex?, toIndex?, interpolation?): number

Return the value matching the given depth or NaN if the given depth is out of the logdata depth range.

If the depths are strictly increasing:

  • The returned value will be interpolated when necessary. See example 1

If the depths are not strictly increasing but never decreasing:

  • The value returned will be the first one found (in the insertion order). See example 2
  • The value returned will be interpolated between the last one found and its closest larger neighbor. See example 2

If the depths are not always increasing (not forward only):

  • The value returned will be the last one found (in the insertion order). See example 3
  • The value returned will be interpolated between the first one found and its closest larger neighbor. See example 3

Examples assume the default linear interpolation

Example

// Depth Value
// 0      0
// 100    1
// 200    2

getValueAt(100) // -> 1
getValueAt(150) // -> 1.5

Example

// Depth Value
// 0      0
// 100    1
// 100    2
// 200    3

getValueAt(100) // -> 1
getValueAt(150) // -> 2.5

Example

// Depth Value
// 0      0
// 100    1
// 200    2
// 100    3

getValueAt(100) // -> 3
getValueAt(150) // -> 1.5

Parameters

Name Type Description
depthnumberThe depth for which you want to compute the value
Optional fromIndexnumberindex of sample in depths
Optional toIndexnumberindex of sample in depths
Optional interpolationInterpolationTypeinterpolation type for the value

Returns

number

Inherited from

LogAbstractData.getValueAt


getValueInRange

getValueInRange(depth, prev, next): number

Return value by depth, using linear interpolation if necessary.

See LogAbstractData.findValueAt.

Parameters

Name Type Description
depthnumberThe depth for which you want to compute the value
prevnumberThe index of the largest previous depth
nextnumberThe index of the smallest following depth

Returns

number

Overrides

LogAbstractData.getValueInRange


getValueUnit

getValueUnit(): AbstractUnit

Return the depth unit

Throws

when this method is not implemented

Returns

AbstractUnit

Overrides

LogAbstractData.getValueUnit


getValues

getValues(): number[]

Return values

Returns

number[]

Overrides

LogAbstractData.getValues


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

LogAbstractData.hasEventListener


isDisposed

isDisposed(): boolean

Returns whether this object has been disposed

Returns

boolean

Inherited from

LogAbstractData.isDisposed


isForwardOnly

isForwardOnly(): boolean

Return true if data is in ascending order

Returns

boolean

Overrides

LogAbstractData.isForwardOnly


isSilent

isSilent(): boolean

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

Returns

boolean

Inherited from

LogAbstractData.isSilent


mergeValue

mergeValue(depth, value, color): void

Insert/Replace the given value at the correct place in the log. This function works ONLY if the existing data is ordered.

Example

Depth       Value
100          0
200          1

mergeValue(150,3)

Depth       Value
100          0
150          3
200          1

Parameters

Name Type Description
depthnumberThe depth for which you want to compute the value
valuenumbervalue at the depth
colorstringcolor at the depth

Returns

void


mergeValues

mergeValues(depths, values, fillStyles): void

Inserts/Replace the given values at the correct place in the log. This function works ONLY if the existing data is ordered.

Example

Depth       Value
50           0
100          1
200          2
300          3

mergeValue([0,100,150,500], [-1,-100,-150,-500])

----     Depth       Value
===>       0           -1
----      50            0
===>      100         -100
===>      150         -150
----      200           2
----      300           3
===>      500         -500

Parameters

Name Type Description
depthsnumber[]the place where to merge in the log
valuesnumber[]the values to merge
fillStylesType[]the fill styles to merge

Returns

void


notify

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

Notify listeners

Type parameters

NameType
Eextends string

Parameters

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

Returns

AccumulationCycleData

this

Inherited from

LogAbstractData.notify


off

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

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

Returns

AccumulationCycleData

this

Inherited from

LogAbstractData.off


on

on<E>(type, callback): AccumulationCycleData

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

Returns

AccumulationCycleData

this

Inherited from

LogAbstractData.on


parseFromString

parseFromString(depths, values, colors): AccumulationCycleData

Sets the depths and values of this AccumulationCycleData using the given string arrays. Uses parseFloat() to parse strings, also recognize 'NaN' values as Number.NaN.

Parameters

Name Type Description
depthsstringcomma-delimited array of depths
valuesstringcomma-delimited array of values
colorsstringcomma-delimited array of colors

Returns

AccumulationCycleData


removeValues

removeValues(index, count): void

Remove values

Parameters

Name Type Description
indexnumberposition where to remove the values
countnumbercount of samples

Returns

void


requestData

requestData(range, scale, callback?): void

Parameters

Name Type Description
rangeRangerange
scalenumberscale
Optional callback() => voidcallback to be called after loading data

Returns

void

Overrides

LogAbstractData.requestData


resumeUpdate

resumeUpdate(forceUpdate): AccumulationCycleData

Resume update. forceUpdate updates data statistics (update min, max of values, depths...)

Parameters

Name Type Description
forceUpdatebooleanforce update based on the state of the data

Returns

AccumulationCycleData

this

Inherited from

LogAbstractData.resumeUpdate


setColor

setColor(index, color): AccumulationCycleData

Set fill color by index

Deprecated

since 4.1 Use setFillStyle instead

Parameters

Name Type Description
indexnumberindex of the sample
colorstringfill color

Returns

AccumulationCycleData

this


setFillStyle

setFillStyle(index, fillStyle, merge?): AccumulationCycleData

Set fill style by index

Parameters

Name Type Description
indexnumberindex of the sample
fillStyleTypefill style
Optional mergebooleantrue if you want to merge fillStyle with existing attribute, false by default

Returns

AccumulationCycleData

this


setIndexUnit

setIndexUnit(unit): AccumulationCycleData

Sets index unit

Parameters

Name Type Description
unitstring | AbstractUnitindex unit

Returns

AccumulationCycleData

this

Overrides

LogAbstractData.setIndexUnit


setName

setName(name): AccumulationCycleData

Set name of the data

Parameters

Name Type Description
namestringThe log data name

Returns

AccumulationCycleData

this

Overrides

LogAbstractData.setName


setProperties

setProperties(properties?): AccumulationCycleData

Sets all the properties pertaining to this object

Parameters

Name Type Description
Optional propertiesOptionsAn object containing the properties to set

Returns

AccumulationCycleData

this


setSilent

setSilent(bool): AccumulationCycleData

Set silent mode

Parameters

Name Type Description
boolbooleanflag to enable silent mode

Returns

AccumulationCycleData

this

Inherited from

LogAbstractData.setSilent


setState

setState(state): AccumulationCycleData

Sets state of data. Values can be (Empty,Normal, Warning,Error,Fetching).

Parameters

Name Type Description
stateLogDataStatestate of data.

Returns

AccumulationCycleData

this

Inherited from

LogAbstractData.setState


setTitles

setTitles(titles): AccumulationCycleData

Set titles of the data

Parameters

Name Type Description
titlesstring[]The log data titles

Returns

AccumulationCycleData

this


setValue

setValue(index, value): AccumulationCycleData

Set value by index

Parameters

Name Type Description
indexnumberindex of the sample
valuenumbersample values

Returns

AccumulationCycleData

this

Overrides

LogAbstractData.setValue


setValueUnit

setValueUnit(unit): AccumulationCycleData

Sets value unit

Parameters

Name Type Description
unitstring | AbstractUnitvalue unit

Returns

AccumulationCycleData

this

Overrides

LogAbstractData.setValueUnit


setValues

setValues(depths, values, fillStyles, titles?): AccumulationCycleData

Sets values

Parameters

Name Type Description
depthsnumber[]The array of ordered depths
valuesnumber[]The array of values
fillStylesType[]The array of fillStyles
Optional titlesstring[]The array of titles

Returns

AccumulationCycleData

this


suspendUpdate

suspendUpdate(): AccumulationCycleData

Suspend update

Returns

AccumulationCycleData

this

Inherited from

LogAbstractData.suspendUpdate


trimValues

trimValues(startDepth, endDepth): void

Remove values from start to end depth. If startDepth is NaN or endDepth is NaN then it uses infinity values

Parameters

Name Type Description
startDepthnumberwhere to start trim
endDepthnumberwhere to end trim

Returns

void


update

Protected update(args?): void

Notify when data has been changed.

Parameters

Name Type Description
Optional argsLogDataEventoptional parameters

Returns

void

Inherited from

LogAbstractData.update


updateDataStatistics

Protected updateDataStatistics(): AccumulationCycleData

Update data statistics

Returns

AccumulationCycleData

this

Overrides

LogAbstractData.updateDataStatistics


updateTimeStamp

updateTimeStamp(): void

Update time stamp

Returns

void

Inherited from

LogAbstractData.updateTimeStamp


findValueAt

Static findValueAt(depth, depths, values, prev, next, interpolation?): number

Utility function to interpolate a value between two depths.

Parameters

Name Type Description
depthnumberThe depth for which you want to compute the value
depthsnumber[]The array of ordered depths
valuesnumber[]The array of values
prevnumberThe index of the largest previous depth
nextnumberThe index of the smallest following depth
Optional interpolationInterpolationTypeinterpolation type for the value

Returns

number

The interpolated value or Number.NaN if outside the range

Inherited from

LogAbstractData.findValueAt


getClassName

Static getClassName(): string

Returns

string

Inherited from

LogAbstractData.getClassName


interpolateValueAt

Static interpolateValueAt(depth, depthPrev, valuePrev, depthNext, valueNext, interpolation?): number

Utility function to interpolate a value between two depths.

Parameters

Name Type Description
depthnumberThe depth for which you want to compute the value
depthPrevnumberprev depth
valuePrevnumberprev value
depthNextnumbernext depth
valueNextnumbernext value
Optional interpolationInterpolationTypeinterpolation type for the value

Returns

number

The interpolated value or Number.NaN if outside the range

Inherited from

LogAbstractData.interpolateValueAt