Constructor
(abstract) new DataSource(name, properties)
Parameters:
| Name | Type | Description | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
name |
string | the datasource name |
||||||||||||||||||
properties |
Object | the datasource properties Properties
|
Methods
buildUrl(properties) → {string}
Builds the full url.
Parameters:
| Name | Type | Description | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
properties |
object |
Properties
|
Returns:
the full url
- Type
- string
connect()
Connect the dataSource then the connector will be opened as well.
disconnect()
Disconnect the dataSource then the connector will be closed as well.
getId() → {string}
Gets the datasource id.
Returns:
the datasource id
- Type
- string
getName() → {*}
Gets the datasource name.
Returns:
- Type
- *
initDataSource(properties)
Inits the datasource with the constructor properties.
Parameters:
| Name | Type | Description |
|---|---|---|
properties |
onData(data)
Parameters:
| Name | Type | Description |
|---|---|---|
data |
Object | the data object |
Example
<p>data is represented as<br>data = {<br> timeStamp: timeStamp // number<br> data: data // data to render<br>};</p>
parseData(data) → {String|Object|number|ArrayBuffer|*}
The default timestamp parser
Parameters:
| Name | Type | Description |
|---|---|---|
data |
the full data message returned by the connector |
Returns:
data the formatted data
- Type
- String | Object | number | ArrayBuffer | *
parseTimeStamp(data) → {number}
The default timestamp parser
Parameters:
| Name | Type | Description |
|---|---|---|
data |
the full data message returned by the connector |
Returns:
the formatted timestamp
- Type
- number
Type Definitions
onMessage
The callback which receives data.