Rasdaman Web Client Toolkit

Documentation

raswct version: 3.0.0



Widgets

Rj.widget.AreaDiagram

Defines a widget used for displaying area diagrams.
Extends Internal Rj.widget._Diagram
Implements Inherited Rj.util.Bindable, Inherited Rj.util.Observable

Constructor:

PARAMETER TYPE DESCRIPTION DEFAULT
selector String A valid css3/XPath selector where the widget will be displayed. None
Optional dataSeries Rj.util.DataSeries The series to be plotted. The diagram is plotted only when at least a dataSeries exists. [ ]

Properties

NAME TYPE DESCRIPTION DEFAULT
Inherited selector String A valid css3/XPath selector where the widget will be displayed. None
Inherited title String The title displayed above the diagram. None
Inherited xLabel String The label of the X axis. X
Inherited yLabel String The label of the Y axis. Y
Inherited tooltip Bool Indicates whether a Tooltip with tips about how the diagram works should be shown. false
Inherited dataSeries Rj.util.DataSeries The series to be plotted. [ ]
Inherited width Int The width of the diagram. 600
Inherited height Int The height of the diagram. 300

Methods

NAME RETURN TYPE PARAMETERS DESCRIPTION
Inherited addDataSeries Void {Rj.util.DataSeries} series - the series object. Adds a data series to the diagram.
Inherited removeDataSeries Void {String} seriesName - the name of the data series to be removed. Removes a data series from the diagram.
Inherited getData Array - Returns the plotted data as a multidimensional array of the form:
[ [ [index, element], [index, element], ... ], [ [ index, element], [index, element], ... ], ... ]

Events

NAME PARAMETERS DESCRIPTION
beforerender - Event fired before the rendering of the widget starts.
afterrender - Event fired after the rendering of the widget ends.

Examples

HTML:

<div id='area-widget'></div>

Javascript:

var dataSeries = new Rj.util.DataSeries([1,5,2,4,10]);
var widget = new Rj.widget.AreaDiagram("#area-widget", dataSeries);


Rj.widget.BarDiagram

Defines a widget used for displaying bar diagrams.
Extends Internal Rj.widget._Diagram
Implements Inherited Rj.util.Bindable, Inherited Rj.util.Observable

Constructor:

PARAMETER TYPE DESCRIPTION DEFAULT
selector String A valid css3/XPath selector where the widget will be displayed. None
Optional dataSeries Rj.util.DataSeries The series to be plotted. The diagram is plotted only when at least a dataSeries exists. [ ]

Properties

NAME TYPE DESCRIPTION DEFAULT
Inherited selector String A valid css3/XPath selector where the widget will be displayed. None
Inherited title String The title displayed above the diagram. None
Inherited xLabel String The label of the X axis. X
Inherited yLabel String The label of the Y axis. Y
Inherited tooltip Bool Indicates whether a Tooltip with tips about how the diagram works should be shown. false
Inherited dataSeries Rj.util.DataSeries The series to be plotted. [ ]
Inherited width Int The width of the diagram. 600
Inherited height Int The height of the diagram. 300

Methods

NAME RETURN TYPE PARAMETERS DESCRIPTION
Inherited addDataSeries Void {Rj.util.DataSeries} series - the series object. Adds a data series to the diagram.
Inherited removeDataSeries Void {String} seriesName - the name of the data series to be removed. Removes a data series from the diagram.
Inherited getData Array - Returns the plotted data as a multidimensional array of the form:
[ [ [index, element], [index, element], ... ], [ [ index, element], [index, element], ... ], ... ]

Events

NAME PARAMETERS DESCRIPTION
beforerender - Event fired before the rendering of the widget starts.
afterrender - Event fired after the rendering of the widget ends.

Examples

HTML:

<div id='bar-widget'></div>

Javascript:

var dataSeries = new Rj.util.DataSeries([1,5,2,4,10]);
var widget = new Rj.widget.BarDiagram("#bar-widget", dataSeries);


Rj.widget.LinearDiagram

Defines a widget used for displaying linear diagrams.
Extends Internal Rj.widget._Diagram
Implements Inherited Rj.util.Bindable, Inherited Rj.util.Observable

Constructor:

PARAMETER TYPE DESCRIPTION DEFAULT
selector String A valid css3/XPath selector where the widget will be displayed. None
Optional dataSeries Rj.util.DataSeries The series to be plotted. The diagram is plotted only when at least a dataSeries exists. [ ]

Properties

NAME TYPE DESCRIPTION DEFAULT
Inherited selector String A valid css3/XPath selector where the widget will be displayed. None
Inherited title String The title displayed above the diagram. None
Inherited xLabel String The label of the X axis. X
Inherited yLabel String The label of the Y axis. Y
Inherited tooltip Bool Indicates whether a Tooltip with tips about how the diagram works should be shown. false
Inherited dataSeries Rj.util.DataSeries The series to be plotted. [ ]
Inherited width Int The width of the diagram. 600
Inherited height Int The height of the diagram. 300

Methods

NAME RETURN TYPE PARAMETERS DESCRIPTION
Inherited addDataSeries Void {Rj.util.DataSeries} series - the series object. Adds a data series to the diagram.
Inherited removeDataSeries Void {String} seriesName - the name of the data series to be removed. Removes a data series from the diagram.
Inherited getData Array - Returns the plotted data as a multidimensional array of the form:
[ [ [index, element], [index, element], ... ], [ [ index, element], [index, element], ... ], ... ]

Events

NAME PARAMETERS DESCRIPTION
beforerender - Event fired before the rendering of the widget starts.
afterrender - Event fired after the rendering of the widget ends.

Examples

HTML:

<div id='linear-widget'></div>

Javascript:

var dataSeries = new Rj.util.DataSeries([1,5,2,4,10]);
var widget = new Rj.widget.LinearDiagram("#linear-widget", dataSeries);


Rj.widget.ScatterDiagram

Defines a widget used for displaying scatter diagrams.
Extends Internal Rj.widget._Diagram
Implements Inherited Rj.util.Bindable, Inherited Rj.util.Observable

Constructor:

PARAMETER TYPE DESCRIPTION DEFAULT
selector String A valid css3/XPath selector where the widget will be displayed. None
Optional dataSeries Rj.util.DataSeries The series to be plotted. The diagram is plotted only when at least a dataSeries exists. [ ]

Properties

NAME TYPE DESCRIPTION DEFAULT
Inherited selector String A valid css3/XPath selector where the widget will be displayed. None
Inherited title String The title displayed above the diagram. None
Inherited xLabel String The label of the X axis. X
Inherited yLabel String The label of the Y axis. Y
Inherited tooltip Bool Indicates whether a Tooltip with tips about how the diagram works should be shown. false
Inherited dataSeries Rj.util.DataSeries The series to be plotted. [ ]
Inherited width Int The width of the diagram. 600
Inherited height Int The height of the diagram. 300

Methods

NAME RETURN TYPE PARAMETERS DESCRIPTION
Inherited addDataSeries Void {Rj.util.DataSeries} series - the series object. Adds a data series to the diagram.
Inherited removeDataSeries Void {String} seriesName - the name of the data series to be removed. Removes a data series from the diagram.
Inherited getData Array - Returns the plotted data as a multidimensional array of the form:
[ [ [index, element], [index, element], ... ], [ [ index, element], [index, element], ... ], ... ]

Events

NAME PARAMETERS DESCRIPTION
beforerender - Event fired before the rendering of the widget starts.
afterrender - Event fired after the rendering of the widget ends.

Examples

HTML:

<div id='scatter-widget'></div>

Javascript:

var dataSeries = new Rj.util.DataSeries([1,5,2,4,10]);
var widget = new Rj.widget.ScatterDiagram("#scatter-widget", dataSeries);


Rj.widget.BinaryImage

Defines a binary image widget that can consume uint8 data and transform it into a image that can be displayed in the browser.
Extends Internal Rj.widget._OutputWidget
Implements Inherited Rj.util.Bindable, Inherited Rj.util.Observable

Constructor:

PARAMETER TYPE DESCRIPTION DEFAULT
selector String A valid css3/XPath selector where the widget will be displayed. None
format String The data format (e.g. 'image/png'). None
Optional arrayBufData ArrayBuffer The data stream. The image is not rendered until a data stream is set. None

Properties

NAME TYPE DESCRIPTION DEFAULT
Inherited selector String A valid css3/XPath selector where the widget will be displayed. None
width Int The width of the image. None
height Int The height of the image. None
binaryData ArrayBuffer The data stream. None

Events

NAME PARAMETERS DESCRIPTION
beforerender - Event fired before the rendering of the widget starts.
afterrender - Event fired after the rendering of the widget ends.

Examples

The following example shows how to display an image that comes as response from a WCPS query.

HTML:

<div id='image-widget'></div>

Javascript:

//Set up the WCPS Service
Rj.util.ConfigManager.setWCPSService({
    url           : "http://flanche.net:8080/petascope/",
    queryParameter: "request"
});

//Declare the query, with binary format
var query = new Rj.query.WCPSQuery('for m in (mean_summer_airtemp) return encode((char) m, "png" )');
query.setBinaryFormat(true);

//evaluate the query and set-up the widget from its response
query.evaluate(function(response){
      var img = new Rj.widget.BinaryImage("#image-widget", "image/png", response);
      img.setWidth(300);
});

Alternative, using binders:

//Set up the WCPS Service
Rj.util.ConfigManager.setWCPSService({
    url           : "http://example.org:8080/petascope/",
    queryParameter: "request"
});

//Declare the query, with binary format
var query = new Rj.query.WCPSQuery('for m in (mean_summer_airtemp) return encode((char) m, "png" )');
query.setBinaryFormat(true);

var img = new Rj.widget.BinaryImage("#image-widget", "image/png");
img.bind(query);
query.evaluate();


Rj.widget.Gauge

Defines a widget used for displaying gauges.
Extends Internal Rj.widget._OutputWidget
Implements Inherited Rj.util.Bindable, Inherited Rj.util.Observable

Constructor:

PARAMETER TYPE DESCRIPTION DEFAULT
selector String A valid css3/XPath selector where the widget will be displayed. None
Optional min Int The minimum value that can be displayed by the gauge. 0
Optional max Int The maximum value that can be displayed by the gauge. 100

Properties

NAME TYPE DESCRIPTION DEFAULT
Inherited selector String A valid css3/XPath selector where the widget will be displayed. None
Inherited value Int The value displayed by the gauge. The min attribute.
min Int The minimum value that can be displayed by the gauge. 0
max Int The maximum value that can be displayed by the gauge. 100
title String The title displayed above the gauge. None
label String The label displayed next to the gauge. None
widthScale Float A number between 0 and 1 to which the width of the gauge is scaled. 1
showMinMax Bool Indicates whether the minimum and maximum values are shown at the ends of the gauge. true

Events

NAME PARAMETERS DESCRIPTION
beforerender - Event fired before the rendering of the widget starts.
afterrender - Event fired after the rendering of the widget ends.
valuechanged value Event fired when the value of the widget changes.

Examples

The following example shows how to display a gauge which takes a random value every 2 seconds.

HTML:

<div id='gauge-widget'></div>

Javascript:

var gauge = new Rj.widget.Gauge("#gauge-widget", 0, 1000);
setInterval(function(){
    var value = Math.random()*1000;
    gauge.setValue(value);
}, 2000);


Rj.widget.Led

Defines a widget used for displaying leds.
Extends Internal Rj.widget._OutputWidget
Implements Inherited Rj.util.Bindable, Inherited Rj.util.Observable

Constructor:

PARAMETER TYPE DESCRIPTION DEFAULT
selector String A valid css3/XPath selector where the widget will be displayed. None

Properties

NAME TYPE DESCRIPTION DEFAULT
Inherited selector String A valid css3/XPath selector where the widget will be displayed. None
Inherited value Float The value displayed by the widget. 0.00
intDigits Int The number of integer digits that the led has. 4
fracDigits Int The number of fractional digits that the led has. 2

Events

NAME PARAMETERS DESCRIPTION
beforerender - Event fired before the rendering of the widget starts.
afterrender - Event fired after the rendering of the widget ends.
valuechanged value Event fired when the value of the widget changes.

Examples

The following example shows how to display a led which takes a random value every 2 seconds.

HTML:

<div id='led-widget'></div>

Javascript:

var led = new Rj.widget.Led("#led-widget");
setInterval(function(){
    var value = Math.random()*100 + Math.random();
    led.setValue(value);
}, 2000);


Rj.widget.Map

Defines a widget used for displaying maps composed of several layers. The implementation is based on the OpenLayers library.
Extends Internal Rj.widget._OutputWidget
Implements Inherited Rj.util.Bindable, Inherited Rj.util.Observable

Constructor:

PARAMETER TYPE DESCRIPTION DEFAULT
selector String A valid css3/XPath selector where the widget will be displayed. None
Optional options Object An OpenLayers configuration object. None

Properties

NAME TYPE DESCRIPTION DEFAULT
Inherited selector String A valid css3/XPath selector where the widget will be displayed. None
map Object The OpenLayers map object. None
layers Array The map layers, as an array of Rj.util.MapLayer objects. [ ]
width Int The width of the map. 600
height Int The height of the map. 300

Methods

NAME RETURN TYPE PARAMETERS DESCRIPTION
addLayers Void Array of {Rj.util.MapLayer} layers - the layers to be added. Adds layers to the widget.

Events

NAME PARAMETERS DESCRIPTION
beforerender - Event fired before the rendering of the widget starts.
afterrender - Event fired after the rendering of the widget ends.

Examples

HTML:

<div id='map-widget'></div>

Javascript:

var WMS_SERVICE_URL = "http://212.201.49.173:8080/rasogc/rasogc";

var map = new Rj.widget.Map('#map-widget', {
    projection : "EPSG:32633",
    maxExtent : new OpenLayers.Bounds(489750,7988500,492750,7990000),
    tileSize : new OpenLayers.Size(500, 500),
    numZoomLevel : 4
});

var layerHakoon = new Rj.util.MapLayer("Hakoon Drive", WMS_SERVICE_URL, {
     layers: 'Hakoon_Dive_1',
     styles: 'standard',
     format : "image/png",
     transparent: "true",
     version : "1.1.0",
     exceptions : 'application/vnd.ogc.se_xml',
     customdem : 'minLevel,maxLevel,T'
     },
     {
     isBaseLayer: false,
     transitionEffect : 'resize'
});

map.addLayers([layerHakoon]);


Rj.widget.SpeedoMeter

Defines a widget used for displaying speedometers.
Extends Internal Rj.widget._OutputWidget
Implements Inherited Rj.util.Bindable, Inherited Rj.util.Observable

Constructor:

PARAMETER TYPE DESCRIPTION DEFAULT
selector String A valid css3/XPath selector where the widget will be displayed. None

Properties

NAME TYPE DESCRIPTION DEFAULT
Inherited selector String A valid css3/XPath selector where the widget will be displayed. None
Inherited value Int The value displayed by the widget. None
labelSuffix String The string displayed next to the value of the widget. None

Events

NAME PARAMETERS DESCRIPTION
beforerender - Event fired before the rendering of the widget starts.
afterrender - Event fired after the rendering of the widget ends.
valuechanged value Event fired when the value of the widget changes.

Examples

The follwoing examples shows how to display a SpeedoMeter widget that takes a random value every 5 seconds.

HTML:

<div id='speedometer-widget'></div>

Javascript:

var speedoMeter = new Rj.widget.SpeedoMeter("#speedometer-widget");
setInterval(function(){
    var value = Math.random()*100;
    speedoMeter.setValue(value);
}, 2000);


Rj.widget.ToolTip

Defines a widget used for displaying tooltips.
Extends Internal Rj.widget._OutputWidget
Implements Inherited Rj.util.Bindable, Inherited Rj.util.Observable

Constructor:

PARAMETER TYPE DESCRIPTION DEFAULT
selector String A valid css3/XPath selector where the widget will be displayed. None

Properties

NAME TYPE DESCRIPTION DEFAULT
Inherited selector String A valid css3/XPath selector where the widget will be displayed. None
Inherited value String The value displayed by the tooltip. None
pretext String The string displayed before the value of the tooltip. None
postext String The string displayed after the value of the tooltip. None
adjust Object An object containing qTip adjustments. None
place String Indicates where the tooltip is placed. bottom
mouse Bool Indicates whether the tooltip follows the mouse. false
delay Int The delay, in ms, at which the tooltip appears. 1000

Events

NAME PARAMETERS DESCRIPTION
beforerender - Event fired before the rendering of the widget starts.
afterrender - Event fired after the rendering of the widget ends.
valuechanged value Event fired when the value of the widget changes.

Examples

HTML:

<div id='tooltip-widget' style='width:100px; margin-top:100px;'>Hover me!</div>

Javascript:

var tooltip = new Rj.widget.ToolTip("#tooltip-widget");
tooltip.setValue("This is my tooltip");


Rj.widget.HorizontalSlider

Defines a widget used for displaying horizontal sliders.
Extends Internal Rj.widget._Slider
Implements Inherited Rj.util.Bindable, Inherited Rj.util.Observable

Constructor:

PARAMETER TYPE DESCRIPTION DEFAULT
selector String A valid css3/XPath selector where the widget will be displayed. None
min Int The minimum value that the slider can take. 0
max Int The maximum value that the slider can take. 100

Properties

NAME TYPE DESCRIPTION DEFAULT
Inherited selector String A valid css3/XPath selector where the widget will be displayed. None
Inherited min Int The minimum value that the slider can take. 0
Inherited max Int The maximum value that the slider can take. 100
Inherited value Int The value at which the slider is set. The min attribute.
Inherited step Int The smallest unit regarding how much the slider can move. 1
Inherited tooltip Bool Indicates whether the value of the slider is shown in a tooltip. true
Inherited label String The text displayed next to the value, in the tooltip. None
Inherited height Int The height of the slider. 100
Inherited width Int The width of the slider. 100
Inherited instantChange Bool If true, the slider value changes with every movement. Otherwise, it changes only when released. false

Events

NAME PARAMETERS DESCRIPTION
beforerender - Event fired before the rendering of the widget starts.
afterrender - Event fired after the rendering of the widget ends.
valuechanged value Event fired when the value of the widget changes.

Examples

HTML:

<div id='slider-widget' style='margin-top:100px;'></div>

Javascript:

var slider = new Rj.widget.HorizontalSlider("#slider-widget", 0, 10);
slider.addListener("hSliderListener", "valuechanged", function(value){
    alert("The new value of the slider is:" + value);
})


Rj.widget.VerticalSlider

Defines a widget used for displaying vertical sliders.
Extends Internal Rj.widget._Slider
Implements Inherited Rj.util.Bindable, Inherited Rj.util.Observable

Constructor:

PARAMETER TYPE DESCRIPTION DEFAULT
selector String A valid css3/XPath selector where the widget will be displayed. None
min Int The minimum value that the slider can take. 0
max Int The maximum value that the slider can take. 100

Properties

NAME TYPE DESCRIPTION DEFAULT
Inherited selector String A valid css3/XPath selector where the widget will be displayed. None
Inherited min Int The minimum value that the slider can take. 0
Inherited max Int The maximum value that the slider can take. 100
Inherited value Int The value at which the slider is set. The min attribute.
Inherited step Int The smallest unit regarding how much the slider can move. 1
Inherited tooltip Bool Indicates whether the value of the slider is shown in a tooltip. true
Inherited label String The text displayed next to the value, in the tooltip. None
Inherited height Int The height of the slider. 100
Inherited width Int The width of the slider. 100
Inherited instantChange Bool If true, the slider value changes with every movement. Otherwise, it changes only when released. false

Events

NAME PARAMETERS DESCRIPTION
beforerender - Event fired before the rendering of the widget starts.
afterrender - Event fired after the rendering of the widget ends.
valuechanged value Event fired when the value of the widget changes.

Examples

HTML:

<div id='slider-widget' style='margin-top: 100px;'></div>

Javascript:

var slider = new Rj.widget.VerticalSlider("#slider-widget", 0, 10);
slider.addListener("vSliderListener", "valuechanged", function(value){
    alert("The new value of the slider is:" + value);
})


Rj.widget.Knob

Defines a widget used for displaying knobs.
Extends Internal Rj.widget._InputWidget
Implements Inherited Rj.util.Bindable, Inherited Rj.util.Observable

Constructor:

PARAMETER TYPE DESCRIPTION DEFAULT
selector String A valid css3/XPath selector where the widget will be displayed. None
min Int The minimum value that the knob can take. 0
max Int The maximum value that the knob can take. 100

Properties

NAME TYPE DESCRIPTION DEFAULT
Inherited selector String A valid css3/XPath selector where the widget will be displayed. None
Inherited min Int The minimum value that the knob can take. 0
Inherited max Int The maximum value that the knob can take. 100
Inherited value Int The value at which the knob is set. The min attribute.
snap Int The number of degrees at which the knob is drawn to the minimum value. 1
reverse Bool Indicates whether the value should decrease as the angle of the knob increases. false

Events

NAME PARAMETERS DESCRIPTION
beforerender - Event fired before the rendering of the widget starts.
afterrender - Event fired after the rendering of the widget ends.
valuechanged value Event fired when the value of the widget changes.

Examples

HTML:

<div id='knob-widget'></div>

Javascript:

var knob = new Rj.widget.Knob("#knob-widget", 0, 10);
knob.setValue(3);


Rj.widget.Text

Defines a widget used for displaying text areas.
Extends Internal Rj.widget._InputWidget
Implements Inherited Rj.util.Bindable, Inherited Rj.util.Observable

Constructor:

PARAMETER TYPE DESCRIPTION DEFAULT
selector String A valid css3/XPath selector where the widget will be displayed. None
value String The initial string to be displayed in the text area. None

Properties

NAME TYPE DESCRIPTION DEFAULT
Inherited selector String A valid css3/XPath selector where the widget will be displayed. None
Inherited value Int The value at which the knob is set. The min attribute.
rows Int The number of rows of the text area. 5
cols Int The number of columns of the text area. 15
label String The label of the text area. None
submitText String The text displayed on the submit button. "Submit"

Events

NAME PARAMETERS DESCRIPTION
beforerender - Event fired before the rendering of the widget starts.
afterrender - Event fired after the rendering of the widget ends.
valuechanged value Event fired when the value of the widget changes.

Examples

HTML:

<div id='text-widget'></div>

Javascript:

var textWidget = new Rj.widget.Text("#text-widget", "Initial text.");
textWidget.setValue("Another piece of text.");


Query

Rj.query.WCPSQuery

A WCPSQuery object can send wcps queries to a service that can process them and parse the result to obtain data.
Extends -
Implements Internal Rj.query.LiteralQuery, Internal Rj.query.Executable, Rj.util.Bindable, Rj.util.Observable

Constructor:

PARAMETER TYPE DESCRIPTION DEFAULT
query String The query string. Can contain 0 or more variables. None
Optional variables Array An array containing the names of the query variables. [ ]

Properties

NAME TYPE DESCRIPTION DEFAULT
binaryFormat Bool Should be set to true if the query returns a binary format (e.g. image) instead of UTF-8 / ASCII format. false
Inherited cached Bool Indicates whether the query should be cached or not. false

Methods

NAME RETURN TYPE PARAMETERS DESCRIPTION
Inherited evaluate Void Optional {Function} callback - a function to process the response
Optional {Bool} persistent - if true the callback will be called each time the query will be re-executed
Evaluates the query and calls a corresponding callback function.

Events

NAME PARAMETERS DESCRIPTION
evaluated result Event fired after the query has been evaluated.

Examples

Javascript:

//set up the WCPS service
Rj.util.ConfigManager.setWCPSService({
    url           : "http://flanche.net:8080/petascope/",
    queryParameter: "request"
});

var query = new Rj.query.WCPSQuery('for t1 in (mean_summer_airtemp) return encode (t1[ x(126), y(-10) ], "csv")');
query.evaluate(function(response){
        alert("The query result is: " + response);
})


Rj.query.wcs.GetCoverage

A GetCoverage object can send WCS getCoverage requests to a service that can process them and parse the result to obtain data.
Extends -
Implements Internal Rj.query.Executable, Rj.util.Observable

Constructor:

PARAMETER TYPE DESCRIPTION DEFAULT
coverageId String The id of the coverage. None

Properties

NAME TYPE DESCRIPTION DEFAULT
coverageId String The id of the coverage. None
subsets Array of Rj.query.wcs.Subset The requested subsets. [ ]

Methods

NAME RETURN TYPE PARAMETERS DESCRIPTION
Inherited evaluate Void Optional {Function} callback - a function to process the response
Optional {Bool} persistent - if true the callback will be called each time the query will be re-executed
Evaluates the query and calls a corresponding callback function.
addSubset Void {Rj.query.wcs.Subset} subset - the subset to be added Adds a subset to the request.
removeSubset Void {Rj.query.wcs.Subset} subset - the subset to be removed Removes a subset from the request.

Events

NAME PARAMETERS DESCRIPTION
evaluated result Event fired after the query has been evaluated.

Examples

Javascript:

//set up the WCS service
Rj.util.ConfigManager.setWCSService({
      baseUrl:"http://flanche.net:8080/petascope/",
      name   :"WCS",
      version:"2.0.0"
});

var query = new Rj.query.wcs.GetCoverage("mean_summer_airtemp");
query.evaluate(function(response){
    alert("The query result is: " + response);
});


Rj.query.wcs.Subset

A Subset object meant to be passed to a getCoverage request, in wcs.GetCoverage.
Extends -
Implements -

Constructor:

PARAMETER TYPE DESCRIPTION DEFAULT
dimension String The name of the dimension. None
crs String The identifier of the crs. None
low Int The lower bound of the subset. None
Optional high Int The higher bound of the subset. None

Properties

NAME TYPE DESCRIPTION DEFAULT
dimension String The name of the dimension. None
crs String The identifier of the crs. None
low Int The lower bound of the subset. None
Optional high Int The higher bound of the subset. None

Methods

NAME RETURN TYPE PARAMETERS DESCRIPTION
equals Bool {Rj.query.wcs.Subset} other - Another object of the same type. Checks if the 2 objects have the same dimension, crs, low and high.

Utils

Rj.util.Bindable

Interface for binding objects.
Extends -
Implements -

Methods

NAME RETURN TYPE PARAMETERS DESCRIPTION
bind Void {Object} modifier - The object to which the binding is made. The binding implies that the modifier has effects on the original object.
Optional variable - A variable indicating what the modifier will change.
Optional callback - The binding function. If a default binindg exists, it will be overriden.
Performs the binding between objects.

Examples

This example shows how to bind a query to a slider: when the slider moves the value of the query changes.

The query string is then printed to a text widget with a custom binder.

HTML:

<div id='slider-widget' style='margin-top: 30px;'></div>
<div id='text-widget'></div>

Javascript:

//set up the wcps service
Rj.util.ConfigManager.setWCPSService({
      url           : "http://flanche.net:8080/petascope/",
      queryParameter: "request"
});

var slider = new Rj.widget.HorizontalSlider("#slider-widget", 126, 130);
var query = new Rj.query.WCPSQuery('for t1 in (mean_summer_airtemp) return encode (t1[ x(126:$x) ], "csv")', ['$x']);
query.bind(slider, '$x');

var text = new Rj.widget.Text("#text-widget");
text.bind(query, function(text, bind){
    //set the initial value
    text.setValue(query.toString());

    //when the query evaluates, change to the new value
    query.addListener('textModifier', 'evaluated', function(){
        text.setValue(query.toString());
    });
});


Rj.util.ConfigManager

Singleton class used for service configurations.
Extends -
Implements -

Properties

NAME TYPE DESCRIPTION DEFAULT
WCPSService Object A configuration object for WCPS. { url :"http://example.org/wcps/1.0/", queryParameter:"request" }
WCSService Object A configuration object for WCS. { baseUrl:"http://example.org/", name :"WCS", version:"2.0.1" }
RequestDelay Int The minimal time, in ms, that has to pass from the the time of the last query until a new one can be sent. 200

Examples

Javascript:

//set up a WCS service
Rj.util.ConfigManager.setWCSService({
      baseUrl:"http://flanche.net:8080/petascope/",
      name   :"WCS",
      version:"2.0.0"
});


Rj.util.CSVParser

Class used for parsing comma separated value responses.
Extends -
Implements -

Properties

NAME TYPE DESCRIPTION DEFAULT
csvString String The original csv string. None
Optional elementParser Function A function to be applied to every element of the parsed response. None

Examples

Javascript:

//set up a WCPS service
Rj.util.ConfigManager.setWCPSService({
      url           : "http://flanche.net:8080/petascope/",
      queryParameter: "request"
});

var query = new Rj.query.WCPSQuery('for t2 in (mean_summer_airtemp) return encode (t2 [x(160), y(0)], "csv")');
query.evaluate(function(response){
      var parser = new Rj.util.CSVParser(response, function(e){
        return parseInt(e, 10);
      });
      alert(parser.toNativeJsArray());
});


Rj.util.Observable

Interface for event communication.
Extends -
Implements -

Methods

NAME RETURN TYPE PARAMETERS DESCRIPTION
fireEvent Void {String} name - the name of the event to be fired
Optional{Object} args - any additional parameters to be passed to the handler
Fires an event with the given arguments.
addListener Void {String} identifier - an identifier for the registered listener
{String} eventName - the name of the event to which the object listens
{Function} callback - the function to be executed when the event occurs
Registers a listener to a given event.
removeListener Void {String} identifier - the id of the listener to be removed
{String} eventName - the name of the event associated with the listener
Removes the given listener.

Examples

HTML:

<div id='slider-widget' style='margin-top:30px'></div>
<div id='text-widget'></div>

Javascript:

var slider = new Rj.widget.HorizontalSlider("#slider-widget", 0, 50);
var text = new Rj.widget.Text("#text-widget");

//when the value of the slider changes, it fires "valuechanged"
//we make the value in the text change with a listener
slider.addListener("mySliderText", "valuechanged", function(value){
   text.setValue(value);
});


Rj.util.DataSeries

Defines a data series for diagram usage.
Extends -
Implements Rj.util.Observable

Constructor:

PARAMETER TYPE DESCRIPTION DEFAULT
series Array An array of the form [point, point, ...] or [[x,y], [x,y], ...]. [ ]

Properties

NAME TYPE DESCRIPTION DEFAULT
name String The name of the series. None
color String The color of the series.. None
series Array The series array in the form [[x,y], [x,y], ...] None

Methods

NAME RETURN TYPE PARAMETERS DESCRIPTION
pointAt Float {String} x - the index of the wanted point
Returns the value of the point at the given index.
addPoint Void {Float} x - the index at which the point is added or the value of the point, if the second argument is not given.
Optional {Float} y - the value of the point
If x,y given it adds the point y to the coordinate x in the series. If only x given it adds it at the end of the series.
If a point already exists at the given index, it is replaced.
removePoint Void {Int} x - the index of the point to be removed Removes the given point.

Events

NAME PARAMETERS DESCRIPTION
namechanged newName Event fired when the name of the series changes.
colorchanged newColor Event fired when the color of the series changes.
serieschanged newSeries Event fired when the series suffers any modifications.

Examples

HTML:

<div id='diagram-widget' style='margin-top:30px'></div>

Javascript:

var dataSeries = new Rj.util.DataSeries([[1,2], [5,9], [6,4]]);
var diagram = new Rj.widget.LinearDiagram("#diagram-widget", dataSeries);

//after 5 seconds change the color, and add a new point
setTimeout(function(){
    dataSeries.setColor("green");
    dataSeries.addPoint(7,5);
}, 5000);