HttpDataSetSeriesReader
Introduction
The vtkHttpDataSetSeriesReader is a reader which can load datasets that vary over time. It is a wrapper over multiple vtkHttpDataSetReader, one per time step, described by an index.json file of the following shape:
{
"series": [
{ "url": "0", "timeStep": 0.0 },
{ "url": "1", "timeStep": 0.333333 }
]
}Usage
import vtkHttpDataSetSeriesReader from '@kitware/vtk.js/IO/Core/HttpDataSetSeriesReader';
const reader = vtkHttpDataSetSeriesReader.newInstance();
reader.setUrl('https://kitware.github.io/vtk-js-datasets/data/temporal').then(() => {
const [begin, end] = reader.getTimeRange();
reader.setUpdateTimeStep((begin + end) / 2);
});Methods
enableArray
Enable or disable a given array on the current time step reader.
| Argument | Type | Required | Description |
|---|---|---|---|
location | String | Yes | |
name | String | Yes | |
enable | Boolean | No | (default true) |
extend
Method used to decorate a given object (publicAPI+model) with vtkHttpDataSetSeriesReader characteristics.
| Argument | Type | Required | Description |
|---|---|---|---|
publicAPI | Yes | object on which methods will be bounds (public) | |
model | Yes | object on which data structure will be bounds (protected) | |
initialValues | IHttpDataSetSeriesReaderInitialValues | No | (default: {}) |
getBaseURL
Get the base url used to download the individual time steps.
getTimeRange
Get the first and last time steps of the series, or an empty array when the series is empty.
getTimeSteps
Get the sorted list of time steps defined in the series.
getUrl
Get the url of the series index to load.
loadData
Download the enabled arrays of the current time step reader.
newInstance
Method used to create a new instance of vtkHttpDataSetSeriesReader
| Argument | Type | Required | Description |
|---|---|---|---|
initialValues | IHttpDataSetSeriesReaderInitialValues | No | for pre-setting some of its content |
requestData
| Argument | Type | Required | Description |
|---|---|---|---|
inData | Yes | ||
outData | Yes |
setDataAccessHelper
| Argument | Type | Required | Description |
|---|---|---|---|
dataAccessHelper | Yes |
setUpdateTimeStep
Make the reader of the latest time step at or before the given time the current one, and expose its dataset as this reader's output.
| Argument | Type | Required | Description |
|---|---|---|---|
timeStep | Number | Yes |
setUrl
Set the url of the series to load. The url must point at an index.json file, or at a folder containing one.
| Argument | Type | Required | Description |
|---|---|---|---|
url | String | Yes | the url of the series to load. |
options | IHttpDataSetSeriesReaderOptions | No |
updateMetaData
Fetch the series index and create one vtkHttpDataSetReader per time step. Resolves with this reader once every time step has been fetched.
| Argument | Type | Required | Description |
|---|---|---|---|
loadData | Boolean | No | Also download the arrays (default false). |