new Resources()

Fires
module:meteoJS/modelviewer/resources#change:resources

Properties

read-only

availableVariablesMap  Object with module:meteoJS/modelviewer/node.Node keys and Set containing module:meteoJS/modelviewer/variable.Variable properties

Map of nodes and their variables (contained in the variableCollection of the node). For each variable exists at least one resource in this Resources-object that is defined by this variable.

read-only

topNode  module:meteoJS/modelviewer/variableCollection.VariableCollection

VariableCollectionNode that stand on the top of the hierarchy.

read-only

variableCollections  Array of module:meteoJS/modelviewer/variableCollection.VariableCollection

Methods

_getTopMostChildWithAllVariables(variables, node, bubbleDown) → (undefined or module:meteoJS/modelviewer/node.Node)

Returns top most node for which on the way down (beginning from node) all variables are contained by the VariableCollections of the travelled nodes.

Parameters

Name Type Optional Description

variables

Set containing module:meteoJS/modelviewer/variable.Variable

 

Variables which have still to be found.

node

module:meteoJS/modelviewer/node.Node

 

Node.

bubbleDown

boolean

 

.

Returns

(undefined or module:meteoJS/modelviewer/node.Node) Child node.

append(...resources) → module:meteoJS/modelviewer/resources.Resources

Append resources.

Parameter

Name Type Optional Description

resources

module:meteoJS/modelviewer/resource.Resource

 

Available resources.

Value can be repeated.

Fires
module:meteoJS/modelviewer/resources#change:resources
Returns

module:meteoJS/modelviewer/resources.Resources This.

appendImage() → module:meteoJS/modelviewer/resources.Resources

Appends an Image-resource. Alias for append(new Image(…)).

See also
module:meteoJS/modelviewer/resource/image.Image
Returns

module:meteoJS/modelviewer/resources.Resources This.

getAvailableVariables(variableCollection, options) → Set containing module:meteoJS/modelviewer/variable.Variable

Returns the Variable-Objects from the collection with content. With this method you can deactive for example the other variables, so the user can't select a variable with no resource.

This means the method returns a subset from the passed collection. For these Variable-Objects at least one resource is available (in the node of the collection or one of its children). The resources are defined by on of these Variable-Objects. If you pass 'variables', you can additionally constrain the returned variables. E.g. you look for all run's with resources of a model, you pass the model's Variable-Object.

Parameters

Name Type Optional Description

variableCollection

module:meteoJS/modelviewer/variableCollection.VariableCollection

 

Return Variables of this VariableCollection.

options

Object

 

Options.

Values in options have the following properties:

Name Type Optional Description

variables

Array of module:meteoJS/modelviewer/variable.Variable

Yes

Only

Returns

Set containing module:meteoJS/modelviewer/variable.Variable Available variables.

getNodeByVariableCollection(variableCollection) → module:meteoJS/modelviewer/node.Node

Returns node which contains the passed variableCollection

Parameter

Name Type Optional Description

variableCollection

module:meteoJS/modelviewer/variableCollection.VariableCollection

 

VariableCollection.

Returns

module:meteoJS/modelviewer/node.Node Node.

getNodeByVariableCollectionId(id) → module:meteoJS/modelviewer/node.Node

Returns node which contains the variableCollection with the passed Id.

Parameter

Name Type Optional Description

id

mixed

 

Id.

Returns

module:meteoJS/modelviewer/node.Node Node.

getTimesByVariables([options]) → Array of Date

Returns all times with at least one resource. The resources are defined by the passed variable. If exact=true, then the resources are exactly defined by the variables. With NWP models, you could get all times from a model-run with at least one resource when you pass the model and run variable object. If you want to know all available times for a set of variables (e.g. all available image-plots for the EU-region, from the temperature in a specific level), then pass exact=true and all the variables.

Parameters

Name Type Optional Description

options

Object

Yes

Options.

Values in options have the following properties:

Name Type Optional Description

variables

Array of module:meteoJS/modelviewer/variable.Variable

Yes

Variables.

exact

boolean

Yes

When true, only resources which are exactly defined by the passed variables are taken into account.

Defaults to false.

Returns

Array of Date - Sorted upwardly.

getTopMostNodeWithAllVariables(...variables) → module:meteoJS/modelviewer/node.Node

Returns a node of the hierarchy, so that all parents and itself contain all the passed variables. The returned node is the most top in hierarchy as possible. If no node is found, an empty node object is returned.

Parameter

Name Type Optional Description

variables

module:meteoJS/modelviewer/variable.Variable

 

Variables.

Value can be repeated.

Returns

module:meteoJS/modelviewer/node.Node - Node.

remove(...resources) → module:meteoJS/modelviewer/resources.Resources

Removes resources.

Parameter

Name Type Optional Description

resources

module:meteoJS/modelviewer/resource.Resource

 

Resources.

Value can be repeated.

Fires
module:meteoJS/modelviewer/resources#change:resources
Returns

module:meteoJS/modelviewer/resources.Resources This.