Last updated

API / geotoolkit / charts / NumericalObjectDataSeries / NumericalObjectDataSeries

Class: NumericalObjectDataSeries

charts.NumericalObjectDataSeries.NumericalObjectDataSeries

Define a numerical data interface

Interface

Hierarchy

Implements

Table of contents

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

Contents

Constructors

new NumericalObjectDataSeries(options)

new NumericalObjectDataSeries(options)

Parameters

Name Type
optionsOptions<number>

Overrides

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

Properties

clone

clone: (copyData?: boolean) => NumericalObjectDataSeries

Type declaration

▸ (copyData?): NumericalObjectDataSeries

Parameters
Name Type
Optional copyDataboolean
Returns

NumericalObjectDataSeries

Implementation of

INumericalDataSeries.clone

Overrides

ObjectDataSeries.clone

Methods

addChild

addChild(data): NumericalObjectDataSeries

Add a child object

Parameters

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

Returns

NumericalObjectDataSeries

this

Implementation of

INumericalDataSeries.addChild

Inherited from

ObjectDataSeries.addChild


addProperties

addProperties(properties): NumericalObjectDataSeries

Add additional properties

Parameters

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

Returns

NumericalObjectDataSeries

this

Implementation of

INumericalDataSeries.addProperties

Inherited from

ObjectDataSeries.addProperties


addValue

addValue(value): NumericalObjectDataSeries

Does nothing

Parameters

Name Type Description
valuenumbera new value

Returns

NumericalObjectDataSeries

this

Inherited from

ObjectDataSeries.addValue


addValues

addValues(array): NumericalObjectDataSeries

Does nothing

Parameters

Name Type Description
arraynumber[]an array of values

Returns

NumericalObjectDataSeries

this

Inherited from

ObjectDataSeries.addValues


calculate

calculate(name): any

Run function. See available formulas list by DataSeries.getFormulas

Parameters

Name Type Description
namestringname

Returns

any

Inherited from

ObjectDataSeries.calculate


clearChildren

clearChildren(): NumericalObjectDataSeries

Remove all child data

Returns

NumericalObjectDataSeries

this

Implementation of

INumericalDataSeries.clearChildren

Inherited from

ObjectDataSeries.clearChildren


clearValues

clearValues(): NumericalObjectDataSeries

Does nothing

Returns

NumericalObjectDataSeries

this

Inherited from

ObjectDataSeries.clearValues


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

Inherited from

ObjectDataSeries.convertValues


copyConstructor

Protected copyConstructor(src, copyData?): NumericalObjectDataSeries

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
srcNumericalObjectDataSeriesSource to copy from
Optional copyDataboolean

Returns

NumericalObjectDataSeries

this

Implementation of

INumericalDataSeries.copyConstructor

Overrides

ObjectDataSeries.copyConstructor


dispose

dispose(): void

Dispose data object and all children. Clear all listeners

Returns

void

Implementation of

INumericalDataSeries.dispose

Inherited from

ObjectDataSeries.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

ObjectDataSeries.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

ObjectDataSeries.getChildren


getChildrenCount

getChildrenCount(): number

Return number of child data

Returns

number

Implementation of

INumericalDataSeries.getChildrenCount

Inherited from

ObjectDataSeries.getChildrenCount


getClassName

getClassName(): string

Returns

string

Implementation of

INumericalDataSeries.getClassName

Inherited from

ObjectDataSeries.getClassName


getDataOrder

getDataOrder(): Order

Returns data ordering of the data series.

Returns

Order

Implementation of

INumericalDataSeries.getDataOrder

Inherited from

ObjectDataSeries.getDataOrder


getId

getId(): string | number

Returns the identifier of the data series.

Returns

string | number

Implementation of

INumericalDataSeries.getId

Inherited from

ObjectDataSeries.getId


getLength

getLength(): number

Returns the number of values in the data series.

Returns

number

Implementation of

INumericalDataSeries.getLength

Inherited from

ObjectDataSeries.getLength


getMax

getMax(unit?): number

Returns max value

Parameters

Name Type Description
Optional unitstringunit 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

Returns min value

Parameters

Name Type Description
Optional unitstringunit 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

ObjectDataSeries.getName


getParent

getParent(): DataObject

Gets parent data item

Returns

DataObject

Implementation of

INumericalDataSeries.getParent

Inherited from

ObjectDataSeries.getParent


getProperties

getProperties(): OptionsOut

Gets all the properties pertaining to this object

Returns

OptionsOut

JSON options object

Implementation of

INumericalDataSeries.getProperties

Inherited from

ObjectDataSeries.getProperties


getProperty

getProperty(name): any

Gets property by name

Parameters

Name Type Description
namestringproperty name

Returns

any

Implementation of

INumericalDataSeries.getProperty

Inherited from

ObjectDataSeries.getProperty


getTimeStamp

Protected getTimeStamp(): number

Returns the timestamp of the data series.

Returns

number

Implementation of

INumericalDataSeries.getTimeStamp

Inherited from

ObjectDataSeries.getTimeStamp


getType

getType(): string

Returns data type

Returns

string

Implementation of

INumericalDataSeries.getType

Inherited from

ObjectDataSeries.getType


getUnit

getUnit(): AbstractUnit

Returns unit of the data series.

Returns

AbstractUnit

unit

Implementation of

INumericalDataSeries.getUnit

Inherited from

ObjectDataSeries.getUnit


getUri

getUri(): string

Returns unique resource identifier

Returns

string

Implementation of

INumericalDataSeries.getUri

Inherited from

ObjectDataSeries.getUri


getValue

getValue(index): number

Returns the value at given index.

Parameters

Name Type Description
indexnumberthe index should be a number greater than or equal to zero, and less than the number of values as returned by getLength() method.

Returns

number

Implementation of

INumericalDataSeries.getValue

Inherited from

ObjectDataSeries.getValue


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

ObjectDataSeries.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

ObjectDataSeries.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

ObjectDataSeries.indexOfChild


insertChild

insertChild(index, item, silent?): NumericalObjectDataSeries

Insert item by index

Parameters

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

Returns

NumericalObjectDataSeries

this

Implementation of

INumericalDataSeries.insertChild

Inherited from

ObjectDataSeries.insertChild


insertValue

insertValue(index, value): NumericalObjectDataSeries

Does nothing

Parameters

Name Type Description
indexnumberthe index number where to insert the value.
valuenumberthe value to insert

Returns

NumericalObjectDataSeries

this

Inherited from

ObjectDataSeries.insertValue


insertValues

insertValues(index, array): NumericalObjectDataSeries

Does nothing

Parameters

Name Type Description
indexnumberthe index number where to insert the values. Values will be added starting at the index number.
arraynumber[]the array of values to insert

Returns

NumericalObjectDataSeries

this

Inherited from

ObjectDataSeries.insertValues


isDisposed

isDisposed(): boolean

Returns whether this object has been disposed

Returns

boolean

Implementation of

INumericalDataSeries.isDisposed

Inherited from

ObjectDataSeries.isDisposed


isReadOnly

isReadOnly(): boolean

Returns true

Returns

boolean

true

Implementation of

INumericalDataSeries.isReadOnly

Inherited from

ObjectDataSeries.isReadOnly


isSilent

isSilent(): boolean

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

Returns

boolean

Implementation of

INumericalDataSeries.isSilent

Inherited from

ObjectDataSeries.isSilent


notify

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

Notify listeners

Type parameters

NameType
Eextends string

Parameters

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

Returns

NumericalObjectDataSeries

this

Implementation of

INumericalDataSeries.notify

Inherited from

ObjectDataSeries.notify


off

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

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

Returns

NumericalObjectDataSeries

this

Implementation of

INumericalDataSeries.off

Inherited from

ObjectDataSeries.off


on

on<E>(type, callback): NumericalObjectDataSeries

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

Returns

NumericalObjectDataSeries

this

Implementation of

INumericalDataSeries.on

Inherited from

ObjectDataSeries.on


onPropertyChanged

onPropertyChanged(prop): NumericalObjectDataSeries

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

Parameters

Name Type Description
propObjectproperty
prop.namestring
prop.valueany

Returns

NumericalObjectDataSeries

this

Implementation of

INumericalDataSeries.onPropertyChanged

Inherited from

ObjectDataSeries.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

ObjectDataSeries.query


removeChild

removeChild(data, silent?): NumericalObjectDataSeries

Remove child data object

Parameters

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

Returns

NumericalObjectDataSeries

this

Implementation of

INumericalDataSeries.removeChild

Inherited from

ObjectDataSeries.removeChild


removeValues

removeValues(index, count?): NumericalObjectDataSeries

Does nothing

Parameters

Name Type Description
indexnumberthe index number where to start removing the values
Optional countnumberthe amount of values to remove

Returns

NumericalObjectDataSeries

this

Inherited from

ObjectDataSeries.removeValues


reverseValues

reverseValues(): NumericalObjectDataSeries

Reverse values

Returns

NumericalObjectDataSeries

Inherited from

ObjectDataSeries.reverseValues


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

ObjectDataSeries.set


setId

setId(id): NumericalObjectDataSeries

Sets the identifier of the data series.

Parameters

Name Type Description
idstring | numbera new identifier

Returns

NumericalObjectDataSeries

this

Implementation of

INumericalDataSeries.setId

Inherited from

ObjectDataSeries.setId


setName

setName(name): NumericalObjectDataSeries

Sets data object name

Parameters

Name Type Description
namestringdata object name

Returns

NumericalObjectDataSeries

this

Implementation of

INumericalDataSeries.setName

Inherited from

ObjectDataSeries.setName


setParent

setParent(parent): NumericalObjectDataSeries

Sets parent data item

Parameters

Name Type Description
parentDataObjectparent data item

Returns

NumericalObjectDataSeries

this

Implementation of

INumericalDataSeries.setParent

Inherited from

ObjectDataSeries.setParent


setProperties

setProperties(properties?): NumericalObjectDataSeries

Sets all the properties pertaining to this object

Parameters

Name Type Description
Optional propertiesOptions<any>JSON options object

Returns

NumericalObjectDataSeries

this

Implementation of

INumericalDataSeries.setProperties

Inherited from

ObjectDataSeries.setProperties


setProperty

setProperty(name, value): NumericalObjectDataSeries

Sets property by name

Parameters

Name Type Description
namestringproperty name
valueanyproperty value

Returns

NumericalObjectDataSeries

this

Implementation of

INumericalDataSeries.setProperty

Inherited from

ObjectDataSeries.setProperty


setSilent

setSilent(bool): NumericalObjectDataSeries

Set silent mode

Parameters

Name Type Description
boolbooleanflag to enable silent mode

Returns

NumericalObjectDataSeries

this

Implementation of

INumericalDataSeries.setSilent

Inherited from

ObjectDataSeries.setSilent


setType

setType(type): NumericalObjectDataSeries

Sets data object type

Parameters

Name Type Description
typestringdata type

Returns

NumericalObjectDataSeries

this

Implementation of

INumericalDataSeries.setType

Inherited from

ObjectDataSeries.setType


setUnit

setUnit(unit?): NumericalObjectDataSeries

Sets unit of the data series.

Parameters

Name Type Description
Optional unitstring | AbstractUnitunit to be set

Returns

NumericalObjectDataSeries

this

Inherited from

ObjectDataSeries.setUnit


setUri

setUri(uri): NumericalObjectDataSeries

Sets unique resource identifier

Parameters

Name Type Description
uristringunique identifier

Returns

NumericalObjectDataSeries

this

Implementation of

INumericalDataSeries.setUri

Inherited from

ObjectDataSeries.setUri


setValue

setValue(index, value): NumericalObjectDataSeries

Does nothing

Parameters

Name Type Description
indexnumberthe index should be a number greater than or equal to zero, and less than the number of values as returned by getLength() method.
valuenumbervalue to set

Returns

NumericalObjectDataSeries

this

Inherited from

ObjectDataSeries.setValue


setValues

setValues(array, copy?): NumericalObjectDataSeries

Does nothing

Parameters

Name Type Description
arraynumber[]an array of values to set
Optional copybooleanmake a deep copy of the values

Returns

NumericalObjectDataSeries

this

Inherited from

ObjectDataSeries.setValues


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

ObjectDataSeries.toArray


update

update(args?): NumericalObjectDataSeries

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

NumericalObjectDataSeries

this

Implementation of

INumericalDataSeries.update

Inherited from

ObjectDataSeries.update


updateTimeStamp

Protected updateTimeStamp(): NumericalObjectDataSeries

Updates timestamp of the data series.

Returns

NumericalObjectDataSeries

Implementation of

INumericalDataSeries.updateTimeStamp

Inherited from

ObjectDataSeries.updateTimeStamp


updating

updating(args?): NumericalObjectDataSeries

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

NumericalObjectDataSeries

this

Implementation of

INumericalDataSeries.updating

Inherited from

ObjectDataSeries.updating


getClassName

Static getClassName(): string

Returns

string

Inherited from

ObjectDataSeries.getClassName


getFormulaDescription

Static getFormulaDescription(name?): string

Get formula's description

Parameters

Name Type Description
Optional namestringname of function

Returns

string

Inherited from

ObjectDataSeries.getFormulaDescription


getFormulas

Static getFormulas(): string[]

List formulas

Returns

string[]

Inherited from

ObjectDataSeries.getFormulas


setFormula

Static setFormula(name, func?, desc?): void

Set function which can be used to calculate some value (e.g. sum, avg etc.)

Example

DataSeries.setFormula('concat', (series) => {
return series.toArray().join(' ');
});
const series = new DataSeries({
'type': 'string',
'data': ['just', 'some', 'text']
});
console.log(series.calculate('concat')); // 'just some text'

Parameters

Name Type Description
namestring | FormulaDescriptionname of function or parameters object
Optional funcFormulahandler, use null to unset
Optional descstringdescription

Returns

void

Inherited from

ObjectDataSeries.setFormula