Last updated

API / geotoolkit / data / NumericalDataSeriesView / NumericalDataSeriesView

Class: NumericalDataSeriesView

data.NumericalDataSeriesView.NumericalDataSeriesView

Define a numerical customized readonly view of NumericalDataSeries or NumericalDataSeriesView for filtering, and unit conversion

Throws

if data is not an instance of NumericalDataSeries or NumericalDataSeriesView

Hierarchy

Implements

Table of contents

Constructors
Methods
Css Properties
Name Type Description
dataAbstractDataSeriesThe original data series or data series view
data-idnumber | stringUnique id of the data series
data-namestringName
data-typestringType
data-uristringUnique resource identifier
idnumber | stringUnique id of the data series
namestringName
typestringType
unitstringUnit of the view
uristringUnique resource identifier

Contents

Constructors

new NumericalDataSeriesView(options)

new NumericalDataSeriesView(options?)

Create NumericalDataSeriesView

Parameters

Name Type Description
Optional optionsNumericalDataSeries | DataSeries<number> | NumericalDataSeriesView | DataSeriesView<number> | Optionsan original data series or data series view or properties object

Overrides

DataSeriesView&lt;number&amp;gt;.constructor

Methods

addChild

addChild(data): NumericalDataSeriesView

Add a child object

Parameters

Name Type Description
dataDataObject | DataObject[]the child data to be added

Returns

NumericalDataSeriesView

this

Implementation of

INumericalDataSeries.addChild

Inherited from

DataSeriesView.addChild


addFilter

addFilter(filter, filterType?): NumericalDataSeriesView

Adds a value filter to the end of existing filters.

Parameters

Name Type Description
filternumber | DataSeriesView<number> | FilterCallback<number>filter function or DataSeriesView or series item. If DataSeriesView specified, changes from DataSeriesView might not be applied.
Optional filterTypeFilterTypefilter type. Value type filter only filters by value and index passed in will be null. Value type filter will be optimized.

Returns

NumericalDataSeriesView

this

Inherited from

DataSeriesView.addFilter


addProperties

addProperties(properties): NumericalDataSeriesView

Add additional properties

Parameters

Name Type Description
propertiesRecord<string, any>additional properties of the dataobject

Returns

NumericalDataSeriesView

this

Implementation of

INumericalDataSeries.addProperties

Inherited from

DataSeriesView.addProperties


clearChildren

clearChildren(): NumericalDataSeriesView

Remove all child data

Returns

NumericalDataSeriesView

this

Implementation of

INumericalDataSeries.clearChildren

Inherited from

DataSeriesView.clearChildren


clearFilters

clearFilters(): NumericalDataSeriesView

Clears all filters.

Returns

NumericalDataSeriesView

this

Inherited from

DataSeriesView.clearFilters


clone

clone(): NumericalDataSeriesView

Returns a clone of the numerical data series view.

Returns

NumericalDataSeriesView

clone

Implementation of

INumericalDataSeries.clone

Overrides

DataSeriesView.clone


convertValues

Protected convertValues<U>(values, fromUnit?, toUnit?): U

Converts values from one unit to another specified unit.

Type parameters

NameType
Uextends number | number[]

Parameters

Name Type Description
valuesUarray of values or a single value
Optional fromUnitstring | AbstractUnitthe original unit of the value(s)
Optional toUnitstring | AbstractUnitthe unit to convert the value(s) to

Returns

U

Implementation of

INumericalDataSeries.convertValues

Overrides

DataSeriesView.convertValues


copyConstructor

Protected copyConstructor(src): NumericalDataSeriesView

Copy constructor function.
Function used as part of the cloning mechanism.
Implementations should copy the given instance state to this instance.

Parameters

Name Type Description
srcDataObjectSource to copy from

Returns

NumericalDataSeriesView

this

Implementation of

INumericalDataSeries.copyConstructor

Inherited from

DataSeriesView.copyConstructor


dispose

dispose(): void

Dispose data object and all children. Clear all listeners

Returns

void

Implementation of

INumericalDataSeries.dispose

Inherited from

DataSeriesView.dispose


getChild

getChild(i): DataObject

Return data by index

Parameters

Name Type Description
inumberindex of the data

Returns

DataObject

child

Implementation of

INumericalDataSeries.getChild

Inherited from

DataSeriesView.getChild


getChildren

getChildren(filter?): Iterator<DataObject>

Return iterator by child data objects

Parameters

Name Type Description
Optional filter(data: DataObject) => booleana filter function. Returns all child data objects if the value is null.

Returns

Iterator<DataObject>

Implementation of

INumericalDataSeries.getChildren

Inherited from

DataSeriesView.getChildren


getChildrenCount

getChildrenCount(): number

Return number of child data

Returns

number

Implementation of

INumericalDataSeries.getChildrenCount

Inherited from

DataSeriesView.getChildrenCount


getClassName

getClassName(): string

Returns

string

Implementation of

INumericalDataSeries.getClassName

Inherited from

DataSeriesView.getClassName


getDataOrder

getDataOrder(): Order

Returns data ordering of the data series.

Returns

Order

Implementation of

INumericalDataSeries.getDataOrder

Inherited from

DataSeriesView.getDataOrder


getFilters

getFilters(): (number | DataSeriesView<number> | FilterCallback<number>)[]

Return the array of value filters as functions or DataSeriesView or series item.

Returns

(number | DataSeriesView<number> | FilterCallback<number>)[]

Inherited from

DataSeriesView.getFilters


getId

getId(): string | number

Returns the identifier of the data series.

Returns

string | number

Implementation of

INumericalDataSeries.getId

Inherited from

DataSeriesView.getId


getLength

getLength(): number

Returns the number of values in the data series.

Returns

number

Implementation of

INumericalDataSeries.getLength

Inherited from

DataSeriesView.getLength


getMax

getMax(unit?): number

Gets max value

Parameters

Name Type Description
Optional unitstring | AbstractUnitunit optional output unit to convert the data to (if none specified, data is not converted)

Returns

number

max

Implementation of

INumericalDataSeries.getMax


getMin

getMin(unit?): number

Gets min value

Parameters

Name Type Description
Optional unitstring | AbstractUnitunit optional output unit to convert the data to (if none specified, data is not converted)

Returns

number

min

Implementation of

INumericalDataSeries.getMin


getName

getName(): string

Returns data object name

Returns

string

Implementation of

INumericalDataSeries.getName

Inherited from

DataSeriesView.getName


getParent

getParent(): DataObject

Gets parent data item

Returns

DataObject

Implementation of

INumericalDataSeries.getParent

Inherited from

DataSeriesView.getParent


getPostProcessor

getPostProcessor(): ProcessorCallback<number>

Returns post-processor function.

Returns

ProcessorCallback<number>

Inherited from

DataSeriesView.getPostProcessor


getPreProcessor

getPreProcessor(): ProcessorCallback<number>

Returns pre-processor function.

Returns

ProcessorCallback<number>

Inherited from

DataSeriesView.getPreProcessor


getProperties

getProperties(): OptionsOut

Gets all the properties pertaining to this object

Returns

OptionsOut

JSON options object

Implementation of

INumericalDataSeries.getProperties

Inherited from

DataSeriesView.getProperties


getProperty

getProperty(name): any

Gets property by name

Parameters

Name Type Description
namestringproperty name

Returns

any

Implementation of

INumericalDataSeries.getProperty

Inherited from

DataSeriesView.getProperty


getTimeStamp

Protected getTimeStamp(): number

Returns the timestamp of the data series.

Returns

number

Implementation of

INumericalDataSeries.getTimeStamp

Inherited from

DataSeriesView.getTimeStamp


getType

getType(): string

Returns data type

Returns

string

Implementation of

INumericalDataSeries.getType

Inherited from

DataSeriesView.getType


getUnit

getUnit(): AbstractUnit

Returns unit of the data series.

Returns

AbstractUnit

unit

Implementation of

INumericalDataSeries.getUnit

Inherited from

DataSeriesView.getUnit


getUri

getUri(): string

Returns unique resource identifier

Returns

string

Implementation of

INumericalDataSeries.getUri

Inherited from

DataSeriesView.getUri


getValue

getValue(index): number

Returns the value at the given index. The type of the returned value depends on the data series type.

Parameters

Name Type
indexnumber

Returns

number

Implementation of

INumericalDataSeries.getValue

Inherited from

DataSeriesView.getValue


getViewUnit

getViewUnit(): AbstractUnit

Returns view unit of the data series view. This method returns unit set through setUnit() method, which can be different from getUnit() if view unit is not convertible to data unit.

Returns

AbstractUnit

Inherited from

DataSeriesView.getViewUnit


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

Implementation of

INumericalDataSeries.hasEventListener

Inherited from

DataSeriesView.hasEventListener


hasProperty

hasProperty(name): boolean

Returns whether data object contains specific property

Parameters

Name Type Description
namestringproperty name

Returns

boolean

Implementation of

INumericalDataSeries.hasProperty

Inherited from

DataSeriesView.hasProperty


indexOfChild

indexOfChild(data): number

Return index of child data ( index of the specified child or -1 if data is not found)

Parameters

Name Type Description
dataDataObjectdata object to check index

Returns

number

Implementation of

INumericalDataSeries.indexOfChild

Inherited from

DataSeriesView.indexOfChild


insertChild

insertChild(index, item, silent?): NumericalDataSeriesView

Insert item by index

Parameters

Name Type Description
indexnumberspecified index
itemDataObjectnode
Optional silentbooleanwill not fire any events if true

Returns

NumericalDataSeriesView

this

Implementation of

INumericalDataSeries.insertChild

Inherited from

DataSeriesView.insertChild


isDisposed

isDisposed(): boolean

Returns whether this object has been disposed

Returns

boolean

Implementation of

INumericalDataSeries.isDisposed

Inherited from

DataSeriesView.isDisposed


isReadOnly

isReadOnly(): boolean

Returns true

Returns

boolean

true

Implementation of

INumericalDataSeries.isReadOnly

Inherited from

DataSeriesView.isReadOnly


isSilent

isSilent(): boolean

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

Returns

boolean

Implementation of

INumericalDataSeries.isSilent

Inherited from

DataSeriesView.isSilent


notify

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

Notify listeners

Type parameters

NameType
Eextends string

Parameters

Name Type Description
typeEevent types
sourceDataSeriesView<any>of the event
Optional argsEventMap[E]arguments of the event

Returns

NumericalDataSeriesView

this

Implementation of

INumericalDataSeries.notify

Inherited from

DataSeriesView.notify


off

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

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

Returns

NumericalDataSeriesView

this

Implementation of

INumericalDataSeries.off

Inherited from

DataSeriesView.off


on

on<E>(type, callback): NumericalDataSeriesView

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

Returns

NumericalDataSeriesView

this

Implementation of

INumericalDataSeries.on

Inherited from

DataSeriesView.on


onPropertyChanged

onPropertyChanged(prop): NumericalDataSeriesView

This method is called if property bag is changed using setProperty method

Parameters

Name Type Description
propObjectproperty
prop.namestring
prop.valueany

Returns

NumericalDataSeriesView

this

Implementation of

INumericalDataSeries.onPropertyChanged

Inherited from

DataSeriesView.onPropertyChanged


query

query(): QueryBuilder<any>

Query data item and child items by different conditions

Example

// Select by function
import {DataObject} from '@int/geotoolkit/data/DataObject';

const dataobject = new DataObject({'name': 'test', 'uri': 'testuri', 'type': 'testtype'});
const item1 = new DataObject({'name': 'item1', 'uri': 'item1', 'type': 'test'});
const item2 = new DataObject({'name': 'item2', 'uri': 'item2', 'type': 'test'});
dataobject.addChild([item1, item2]);
const item5 = new DataObject({'name': 'item5', 'uri': 'item5', 'type': 'test'});
item2.addChild(item5);
let founditem = null;
dataobject.query()
.where( (item: DataObject) => item.getParent() === dataobject)
.where( (item: DataObject) => item.getUri() === 'item2')
.select((item: DataObject) => {
founditem = item;
});

Example

// Select by expression
dataobject.query()
.where( 'item => uri(item) == "item5"')
.select((item: DataObject) => {
founditem = item;
});

Returns

QueryBuilder<any>

query object which has methods 'where' tp specify conditions, 'select' to run query, 'selectToArray' select results to array Expressions syntax: "item => expression", where expression:

  • logical and arithmetic operators
  • embedded functions: name(item) - gets name of the data object url(item) - gets url of the data object type(item) - gets type of the data object

Implementation of

INumericalDataSeries.query

Inherited from

DataSeriesView.query


removeChild

removeChild(data, silent?): NumericalDataSeriesView

Remove child data object

Parameters

Name Type Description
dataDataObjectdata object to be removed
Optional silentbooleanwill not fire any events if true

Returns

NumericalDataSeriesView

this

Implementation of

INumericalDataSeries.removeChild

Inherited from

DataSeriesView.removeChild


removeFilter

removeFilter(filter): NumericalDataSeriesView

Removes a value filter from the data series view.

Parameters

Name Type Description
filternumber | DataSeriesView<number> | FilterCallback<number>filter to remove

Returns

NumericalDataSeriesView

this

Inherited from

DataSeriesView.removeFilter


replaceFilter

replaceFilter(oldFilter, newFilter, filterType?): NumericalDataSeriesView

Replaces an existing filter with a new filter.

Parameters

Name Type Description
oldFilternumber | DataSeriesView<number> | FilterCallback<number>old filter
newFilternumber | DataSeriesView<number> | FilterCallback<number>new filter
Optional filterTypeFilterTypefilter type

Returns

NumericalDataSeriesView

this

Inherited from

DataSeriesView.replaceFilter


set

set(index, item): DataObject

Sets item by index

Parameters

Name Type Description
indexnumberindex of the item
itemDataObjectnode

Returns

DataObject

Implementation of

INumericalDataSeries.set

Inherited from

DataSeriesView.set


setId

setId(id): NumericalDataSeriesView

Sets the identifier of the data series.

Parameters

Name Type Description
idstring | numbera new identifier

Returns

NumericalDataSeriesView

this

Implementation of

INumericalDataSeries.setId

Inherited from

DataSeriesView.setId


setName

setName(name): NumericalDataSeriesView

DataSeriesView does not support setName() method.

Parameters

Name Type Description
namestringdata object name

Returns

NumericalDataSeriesView

this

Implementation of

INumericalDataSeries.setName

Inherited from

DataSeriesView.setName


setParent

setParent(parent): NumericalDataSeriesView

Sets parent data item

Parameters

Name Type Description
parentDataObjectparent data item

Returns

NumericalDataSeriesView

this

Implementation of

INumericalDataSeries.setParent

Inherited from

DataSeriesView.setParent


setPostProcessor

setPostProcessor(postProcessor?): NumericalDataSeriesView

Sets post-processor function. This processor will be called after filters.

Parameters

Name Type Description
Optional postProcessorProcessorCallback<number>post-processor function. The function must accept single value and array of values as parameter.

Returns

NumericalDataSeriesView

Overrides

DataSeriesView.setPostProcessor


setPreProcessor

setPreProcessor(preProcessor?): NumericalDataSeriesView

Sets pre-processor function. This processor will be called before filters.

Parameters

Name Type Description
Optional preProcessorProcessorCallback<number>pre-processor function. The function must accept single value and array of values as parameter.

Returns

NumericalDataSeriesView

Overrides

DataSeriesView.setPreProcessor


setProperties

setProperties(properties?): NumericalDataSeriesView

Sets all the properties pertaining to this object

Parameters

Name Type Description
Optional propertiesOptions<number>An object containing the properties to set

Returns

NumericalDataSeriesView

Implementation of

INumericalDataSeries.setProperties

Inherited from

DataSeriesView.setProperties


setProperty

setProperty(name, value): NumericalDataSeriesView

Sets property by name

Parameters

Name Type Description
namestringproperty name
valueanyproperty value

Returns

NumericalDataSeriesView

this

Implementation of

INumericalDataSeries.setProperty

Inherited from

DataSeriesView.setProperty


setSilent

setSilent(bool): NumericalDataSeriesView

Set silent mode

Parameters

Name Type Description
boolbooleanflag to enable silent mode

Returns

NumericalDataSeriesView

this

Implementation of

INumericalDataSeries.setSilent

Inherited from

DataSeriesView.setSilent


setType

setType(type): NumericalDataSeriesView

Sets data object type

Parameters

Name Type Description
typestringdata type

Returns

NumericalDataSeriesView

this

Implementation of

INumericalDataSeries.setType

Inherited from

DataSeriesView.setType


setUnit

setUnit(unit?): NumericalDataSeriesView

Sets view unit of the data series view.

Parameters

Name Type Description
Optional unitstring | AbstractUnitunit to set

Returns

NumericalDataSeriesView

Inherited from

DataSeriesView.setUnit


setUri

setUri(uri): NumericalDataSeriesView

Sets unique resource identifier

Parameters

Name Type Description
uristringunique identifier

Returns

NumericalDataSeriesView

this

Implementation of

INumericalDataSeries.setUri

Inherited from

DataSeriesView.setUri


synchronize

Protected synchronize(): void

Synchronizes internal mapping for filters.

Returns

void

Inherited from

DataSeriesView.synchronize


toArray

toArray(copy?, unit?): number[]

Returns an array of objects in the data series.

Parameters

Name Type Description
Optional copybooleanwhether creating a copy of data
Optional unitstring | AbstractUnitunit optional output unit to convert the data to. if not specified, data will not be converted

Returns

number[]

Implementation of

INumericalDataSeries.toArray

Inherited from

DataSeriesView.toArray


update

update(args?): NumericalDataSeriesView

Notifies the data series has been updated. The timestamp will be updated and Events.Updated event will be fired.

Fires

Events.Updated

Parameters

Name Type Description
Optional argsObjectevent args
args.countnumber
args.indexnumber
args.typeStateChanges

Returns

NumericalDataSeriesView

this

Implementation of

INumericalDataSeries.update

Inherited from

DataSeriesView.update


updateTimeStamp

Protected updateTimeStamp(): NumericalDataSeriesView

Updates timestamp of the data series.

Returns

NumericalDataSeriesView

Implementation of

INumericalDataSeries.updateTimeStamp

Inherited from

DataSeriesView.updateTimeStamp


updating

updating(args?): NumericalDataSeriesView

Notifies the data series has been started updating. The Events.Updating event will be fired.

Fires

Events.Updating

Parameters

Name Type Description
Optional argsObjectevent args
args.countnumber
args.indexnumber
args.typeStateChanges

Returns

NumericalDataSeriesView

this

Implementation of

INumericalDataSeries.updating

Inherited from

DataSeriesView.updating


getClassName

Static getClassName(): string

Returns

string

Inherited from

DataSeriesView.getClassName