Meteograph Class
Visualization of a time series of parameters present in Meteo objects. Multiple such parameters and groups thereof may be displayed simultanously.
Constructor
Item Index
Methods
Properties
Methods
clip
-
start
-
end
Show a part (or all) of the data within a start and an end date.
Parameters:
-
start
MomentStart date
-
end
MomentEnd date
config
()
protected
datelabel
-
date
Parameters:
-
date
MomentDate to be highlighted on the abscissa
desynchronize
-
graph
Parameters:
-
graph
Rangegraph
drag
-
current
Method to be called during dragging on top of cover.
Parameters:
-
current
MomentDate at current drag position
dragend
-
current
-
ms
Method to be called at the end of dragging on top of cover.
Parameters:
-
current
MomentDate at current drag position
-
ms
NumberDuration of drag in ms
draggable
-
element
Parameters:
-
element
ElementSnapSVG element to set up with drag functionality
dragstart
-
current
Method to be called at the start of dragging on top of cover.
Parameters:
-
current
MomentDate at current drag position
draw
()
chainable
Draw the Meteograph and set up the mouse events.
drawgrid
-
config
-
heights
-
axis
-
position
Draw the ordinate legend and grid for a specific parameter / parameter group.
Parameters:
Returns:
svg group container comprising legend and grid lines
getcurves
()
private
Parameters and parameter groups are mashed together in an object called 'curves'. The 'curves' object associates names (e. g. ta or tsurf) with a parameters array.
getpaper
()
private
griddates
-
start
-
end
Parameters:
-
start
MomentStart date of time series -
end
MomentEnd date of time series
Returns:
gridx
()
protected
gridy
()
private
chainable
Prepare the ordinate axis (axes) that shall have a legend (up to two). Calculate the grid points (call Grid.gridify). Estimate the pixel width of the axis annotation and position the axis label accordingly. Call Meteograph:drawgrid on all legends to be drawn.
header
()
private
chainable
Draw a header on the left top of the graph.
highlight
-
current
Highlight the current cursor position by adding dots at the x-coordinate of the cursor and display the values for the parameters at that position in the top left corner of the graph (actual drawing of the values is done by Meteograph:legend).
Parameters:
-
current
NumberIndex of current data in meteo data array
indices
-
startdate
-
enddate
Given a start and end index (for the data property data in the Meteo object) draw all parameters and parameter groups, removing any previously present curves. In case the start index is not 0 and the end index is not the last index show the resetbutton.
Parameters:
-
startdate
MomentStart date of range
-
enddate
MomentEnd date of range
labelsx
-
dates
Parameters:
-
dates
ArrayAn array of dates as moment objects
Returns:
legend
-
meteo
Display the values for the parameters in the graph at the current position of the mouse cursor at the top left corner of the graph.
Parameters:
-
meteo
MeteoDataThe meteo object at the current cursor position
mode
-
start
-
end
Parameters:
-
start
MomentStart date of time series -
end
MomentEnd date of time series
Returns:
mousemove
-
e
-
canvas
Method to be called when mousemove event is detected. It calls the method Meteograph:highlight in turn.
mouseon
-
on
Parameters:
-
on
BooleanWhether to turn the mousemove event on or off
mouseout
()
protected
Method to be called when mouseout event is detected. Delete the currently displayed date label (unhighlight) and display the date label for the current indicator position, if the indicator is set.
mouseout
()
protected
Method to be called when mouse events are turned off.
range
-
start
-
end
Parameters:
-
start
MomentStart date of time series -
end
MomentEnd date of time series
remove
-
ctx
-
name
reset
()
private
Show all the data from start to end and remove the 'Show all' button.
set
-
parameters
Set the set of parameters or group of parameters that shall be displayed. The method removes all highlights and curves previously displayed and then triggers a draw with the new set of parameters (and groups).
Parameters:
-
parameters
ArrayArray of parameter and group names
setProperties
-
properties
Parameters:
-
properties
Object
setup
()
private
chainable
Setup all axes and configurations for all curves in this.curves. Every curve may consist of one or more actual parameters, all configurations for every parameter and an axis for every curve needs to be instantiated.
show
-
parameter
-
axis
-
svg
-
start
-
end
Given an Axis object, draw a single curve for one parameter with its ordinate values calculated on that axis.
Parameters:
synchronize
-
graph
Parameters:
-
graph
Rangegraph
unhighlight
()
private
Remove all dots on the curves and the in-graph legend with the values of the parameters at the current cursor position.
Properties
all
ArrayGet all selectable parameters and parameter groups