Skip to content

API / geotoolkit / data / DataSeriesView / DataSeriesView

Class: DataSeriesView<T&gt;

data.DataSeriesView.DataSeriesView

Define a generic read-only view of an underlying DataSeries or DataSeriesView. A DataSeriesView allows unit conversion, pre- and post-processing and filtering.<br>

Throws

if data is not an instance of DataSeries or DataSeriesView

Type parameters

NameType
Tany

Hierarchy

Table of contents

Constructors
  • [new DataSeriesView<T&gt;(options)](/solutions/geotoolkit/GeoToolkit_JS/apis/classes/geotoolkit.data.dataseriesview.dataseriesview.md#new dataseriesview<t>(options))
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 DataSeriesView&lt;T&amp;gt;(options)

• new DataSeriesView<T&gt;(options?)

Create DataSeriesView

Type parameters

NameType
Tany

Parameters

Name Type Description
Optional optionsDataSeriesView<T&gt; | AbstractDataSeries<T&gt; | Options<T&gt;the original data series or data series view or properties object

Overrides

AbstractDataSeries&lt;T&amp;gt;.constructor

Methods

addChild

▸ addChild(data): DataSeriesView<T&gt;

Add a child object

Parameters

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

Returns

DataSeriesView<T&gt;

this

Inherited from

AbstractDataSeries.addChild


addFilter

▸ addFilter(filter, filterType?): DataSeriesView<T&gt;

Adds a value filter to the end of existing filters.

Parameters

Name Type Description
filterDataSeriesView<T&gt; | T | FilterCallback<T&gt;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

DataSeriesView<T&gt;

this


addProperties

▸ addProperties(properties): DataSeriesView<T&gt;

Add additional properties

Parameters

Name Type Description
propertiesRecord<string, any&gt;additional properties of the dataobject

Returns

DataSeriesView<T&gt;

this

Inherited from

AbstractDataSeries.addProperties


clearChildren

▸ clearChildren(): DataSeriesView<T&gt;

Remove all child data

Returns

DataSeriesView<T&gt;

this

Inherited from

AbstractDataSeries.clearChildren


clearFilters

▸ clearFilters(): DataSeriesView<T&gt;

Clears all filters.

Returns

DataSeriesView<T&gt;

this


clone

▸ clone(): DataSeriesView<T&gt;

Returns a clone of the data series view.

Returns

DataSeriesView<T&gt;

clone

Overrides

AbstractDataSeries.clone


convertValues

▸ Protected convertValues<U&gt;(values, fromUnit?, toUnit?): U

Converts values from one unit to another specified unit.

Type parameters

Name
U

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

Overrides

AbstractDataSeries.convertValues


copyConstructor

▸ Protected copyConstructor(src): DataSeriesView<T&gt;

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

Parameters

Name Type Description
srcDataObjectSource to copy from

Returns

DataSeriesView<T&gt;

this

Inherited from

AbstractDataSeries.copyConstructor


dispose

▸ dispose(): void

Dispose data object and all children. Clear all listeners

Returns

void

Inherited from

AbstractDataSeries.dispose


getChild

▸ getChild(i): DataObject

Return data by index

Parameters

Name Type Description
inumberindex of the data

Returns

DataObject

child

Inherited from

AbstractDataSeries.getChild


getChildren

▸ getChildren(filter?): Iterator<DataObject&gt;

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&gt;

Inherited from

AbstractDataSeries.getChildren


getChildrenCount

▸ getChildrenCount(): number

Return number of child data

Returns

number

Inherited from

AbstractDataSeries.getChildrenCount


getClassName

▸ getClassName(): string

Returns

string

Inherited from

AbstractDataSeries.getClassName


getDataOrder

▸ getDataOrder(): Order

Returns data ordering of the data series.

Returns

Order

Inherited from

AbstractDataSeries.getDataOrder


getFilters

▸ getFilters(): (DataSeriesView<T&gt; | T | FilterCallback<T&gt;)[]

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

Returns

(DataSeriesView<T&gt; | T | FilterCallback<T&gt;)[]


getId

▸ getId(): string | number

Returns the identifier of the data series.

Returns

string | number

Inherited from

AbstractDataSeries.getId


getLength

▸ getLength(): number

Returns the number of values in the data series.

Returns

number

Overrides

AbstractDataSeries.getLength


getName

▸ getName(): string

Returns data object name

Returns

string

Inherited from

AbstractDataSeries.getName


getParent

▸ getParent(): DataObject

Gets parent data item

Returns

DataObject

Inherited from

AbstractDataSeries.getParent


getPostProcessor

▸ getPostProcessor(): ProcessorCallback<T&gt;

Returns post-processor function.

Returns

ProcessorCallback<T&gt;


getPreProcessor

▸ getPreProcessor(): ProcessorCallback<T&gt;

Returns pre-processor function.

Returns

ProcessorCallback<T&gt;


getProperties

▸ getProperties(): OptionsOut

Gets all the properties pertaining to this object

Returns

OptionsOut

JSON options object

Overrides

AbstractDataSeries.getProperties


getProperty

▸ getProperty(name): any

Gets property by name

Parameters

Name Type Description
namestringproperty name

Returns

any

Inherited from

AbstractDataSeries.getProperty


getTimeStamp

▸ Protected getTimeStamp(): number

Returns the timestamp of the data series.

Returns

number

Inherited from

AbstractDataSeries.getTimeStamp


getType

▸ getType(): string

Returns data type

Returns

string

Inherited from

AbstractDataSeries.getType


getUnit

▸ getUnit(): AbstractUnit

Returns unit of the data series.

Returns

AbstractUnit

unit

Overrides

AbstractDataSeries.getUnit


getUri

▸ getUri(): string

Returns unique resource identifier

Returns

string

Inherited from

AbstractDataSeries.getUri


getValue

▸ getValue(index): T

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

Parameters

Name Type
indexnumber

Returns

T

Overrides

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


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

AbstractDataSeries.hasEventListener


hasProperty

▸ hasProperty(name): boolean

Returns whether data object contains specific property

Parameters

Name Type Description
namestringproperty name

Returns

boolean

Inherited from

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

Inherited from

AbstractDataSeries.indexOfChild


insertChild

▸ insertChild(index, item, silent?): DataSeriesView<T&gt;

Insert item by index

Parameters

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

Returns

DataSeriesView<T&gt;

this

Inherited from

AbstractDataSeries.insertChild


isDisposed

▸ isDisposed(): boolean

Returns whether this object has been disposed

Returns

boolean

Inherited from

AbstractDataSeries.isDisposed


isReadOnly

▸ isReadOnly(): boolean

Returns true

Returns

boolean

true

Overrides

AbstractDataSeries.isReadOnly


isSilent

▸ isSilent(): boolean

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

Returns

boolean

Inherited from

AbstractDataSeries.isSilent


notify

▸ notify<E&gt;(type, source, args?): DataSeriesView<T&gt;

Notify listeners

Type parameters

NameType
Eextends string

Parameters

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

Returns

DataSeriesView<T&gt;

this

Overrides

AbstractDataSeries.notify


off

▸ off<E&gt;(type?, callback?): DataSeriesView<T&gt;

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: DataSeriesView<T&gt;, args: EventMap[E]) => voidfunction to be called

Returns

DataSeriesView<T&gt;

this

Overrides

AbstractDataSeries.off


on

▸ on<E&gt;(type, callback): DataSeriesView<T&gt;

Attach listener on event that will be called whenever the specified event is delivered to the target <p> If the callback function is already in the list of event listeners for this target, the function is not added a second time. </p> <p> 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. </p>

Type parameters

NameType
Eextends string

Parameters

Name Type Description
typeEtype of event or property
callback(eventType: E, sender: DataSeriesView<T&gt;, args: EventMap[E]) => voidto be called

Returns

DataSeriesView<T&gt;

this

Overrides

AbstractDataSeries.on


onPropertyChanged

▸ onPropertyChanged(prop): DataSeriesView<T&gt;

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

Parameters

Name Type Description
propObjectproperty
prop.namestring
prop.valueany

Returns

DataSeriesView<T&gt;

this

Inherited from

AbstractDataSeries.onPropertyChanged


query

▸ query(): QueryBuilder<any&gt;

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(&#91;item1, item2&#93;);
const item5 = new DataObject({'name': 'item5', 'uri': 'item5', 'type': 'test'});
item2.addChild(item5);
let founditem = null;
dataobject.query()
.where( (item: DataObject) =&gt; item.getParent() === dataobject)
.where( (item: DataObject) =&gt; item.getUri() === 'item2')
.select((item: DataObject) =&gt; {
founditem = item;
});

Example

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

Returns

QueryBuilder<any&gt;

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

Inherited from

AbstractDataSeries.query


removeChild

▸ removeChild(data, silent?): DataSeriesView<T&gt;

Remove child data object

Parameters

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

Returns

DataSeriesView<T&gt;

this

Inherited from

AbstractDataSeries.removeChild


removeFilter

▸ removeFilter(filter): DataSeriesView<T&gt;

Removes a value filter from the data series view.

Parameters

Name Type Description
filterDataSeriesView<T&gt; | T | FilterCallback<T&gt;filter to remove

Returns

DataSeriesView<T&gt;

this


replaceFilter

▸ replaceFilter(oldFilter, newFilter, filterType?): DataSeriesView<T&gt;

Replaces an existing filter with a new filter.

Parameters

Name Type Description
oldFilterDataSeriesView<T&gt; | T | FilterCallback<T&gt;old filter
newFilterDataSeriesView<T&gt; | T | FilterCallback<T&gt;new filter
Optional filterTypeFilterTypefilter type

Returns

DataSeriesView<T&gt;

this


set

▸ set(index, item): DataObject

Sets item by index

Parameters

Name Type Description
indexnumberindex of the item
itemDataObjectnode

Returns

DataObject

Inherited from

AbstractDataSeries.set


setId

▸ setId(id): DataSeriesView<T&gt;

Sets the identifier of the data series.

Parameters

Name Type Description
idstring | numbera new identifier

Returns

DataSeriesView<T&gt;

this

Inherited from

AbstractDataSeries.setId


setName

▸ setName(name): DataSeriesView<T&gt;

DataSeriesView does not support setName() method.

Parameters

Name Type Description
namestringdata object name

Returns

DataSeriesView<T&gt;

this

Overrides

AbstractDataSeries.setName


setParent

▸ setParent(parent): DataSeriesView<T&gt;

Sets parent data item

Parameters

Name Type Description
parentDataObjectparent data item

Returns

DataSeriesView<T&gt;

this

Inherited from

AbstractDataSeries.setParent


setPostProcessor

▸ setPostProcessor(postProcessor?): DataSeriesView<T&gt;

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

Parameters

Name Type Description
Optional postProcessorProcessorCallback<T&gt;post-processor function. The function must accept single value and array of values as parameter.

Returns

DataSeriesView<T&gt;


setPreProcessor

▸ setPreProcessor(preProcessor?): DataSeriesView<T&gt;

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

Parameters

Name Type Description
Optional preProcessorProcessorCallback<T&gt;pre-processor function. The function must accept single value and array of values as parameter.

Returns

DataSeriesView<T&gt;


setProperties

▸ setProperties(properties?): DataSeriesView<T&gt;

Sets all the properties pertaining to this object

Parameters

Name Type Description
Optional propertiesOptions<T&gt;An object containing the properties to set

Returns

DataSeriesView<T&gt;

Overrides

AbstractDataSeries.setProperties


setProperty

▸ setProperty(name, value): DataSeriesView<T&gt;

Sets property by name

Parameters

Name Type Description
namestringproperty name
valueanyproperty value

Returns

DataSeriesView<T&gt;

this

Inherited from

AbstractDataSeries.setProperty


setSilent

▸ setSilent(bool): DataSeriesView<T&gt;

Set silent mode

Parameters

Name Type Description
boolbooleanflag to enable silent mode

Returns

DataSeriesView<T&gt;

this

Inherited from

AbstractDataSeries.setSilent


setType

▸ setType(type): DataSeriesView<T&gt;

Sets data object type

Parameters

Name Type Description
typestringdata type

Returns

DataSeriesView<T&gt;

this

Inherited from

AbstractDataSeries.setType


setUnit

▸ setUnit(unit?): DataSeriesView<T&gt;

Sets view unit of the data series view.

Parameters

Name Type Description
Optional unitstring | AbstractUnitunit to set

Returns

DataSeriesView<T&gt;


setUri

▸ setUri(uri): DataSeriesView<T&gt;

Sets unique resource identifier

Parameters

Name Type Description
uristringunique identifier

Returns

DataSeriesView<T&gt;

this

Inherited from

AbstractDataSeries.setUri


synchronize

▸ Protected synchronize(): void

Synchronizes internal mapping for filters.

Returns

void


toArray

▸ toArray(copy?, unit?): T[]

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

T[]

Overrides

AbstractDataSeries.toArray


update

▸ update(args?): DataSeriesView<T&gt;

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

DataSeriesView<T&gt;

this

Inherited from

AbstractDataSeries.update


updateTimeStamp

▸ Protected updateTimeStamp(): DataSeriesView<T&gt;

Updates timestamp of the data series.

Returns

DataSeriesView<T&gt;

Inherited from

AbstractDataSeries.updateTimeStamp


updating

▸ updating(args?): DataSeriesView<T&gt;

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

DataSeriesView<T&gt;

this

Inherited from

AbstractDataSeries.updating


getClassName

▸ Static getClassName(): string

Returns

string

Inherited from

AbstractDataSeries.getClassName