SimpleProfile Class
Visualization of a singular snow profile in a simple way with arrows indicating failed stability tests. A miniature version exists which may be used in combination with a timeline graph.
Constructor
Item Index
Methods
- adapt
- add
- align
- arrange
- arrows
- commentstxt
- config
- configure
- connect
- cttxt
- dblclickhandler
- destroy
- directlayout
- draw
- draw_columns
- ecttxt
- flags
- flagstxt
- graph
- header
- hhlabels
- highlight
- index
- layout
- loadcolumns
- matchfeatures
- miniconfig
- mouseon
- next
- partition
- position
- printDate
- rbtxt
- remove static
- select
- setbarcfg
- setcounter
- setParameter
- setProperties
- shiftdown
- slope
- stbtxt
- table
- toString
- unhighlight
- y
- zoom
Methods
adapt
()
Function
private
In case the bargraph is zoomed or resized, the table and curves need to be adapted to the area visible. The adapt method returns a callback function that in turn calls all necessary functions of SimpleProfile and TabularProfile.
Returns:
A function to be called a
add
-
object -
[position]
align
-
partitions
Parameters:
-
partitionsArray< Array
Returns:
arrange
-
partitions
Parameters:
-
partitionsArray< Array
arrows
-
params -
name
Draws arrows for one or more parameters specified by calling the Visuals:Arrows method.
Parameters:
-
paramsArrayAll parameter that require arrow drawing
-
nameStringName of the svg group to bundle the arrows
commentstxt
-
paper -
p -
center -
txt -
layer -
offsetx -
width -
height -
lindex
Parameters:
-
paperObjectSnapSVG paper -
pObjectProperties object -
centerObjectPixel coordinates used for positioning -
txtObjectFont object -
layerValueThe layer object, -
offsetxValueThe x-coord at the left of the column -
widthValueMax-width number of fontsizes -
heightValueHeight of the cell in pixel -
lindexNumberLayer index (for cross referencing)
Returns:
config
()
private
Configure all properties related to the TabularProfile parent class. This method overrides TabularProfile:config and is called by TabularProfile:draw, TabularProfile:zoom and TabularProfile:arrange.
configure
()
private
Configure all properties and axes dependent on canvas size and whether the graph shall be used in miniature or normal mode.
connect
-
partition -
offset
Parameters:
-
partitionArrayPrimary partition, to be connected to graph -
offsetNumberPixel position of the right edge of the graph
cttxt
-
paper -
p -
center -
txt -
layer
Parameters:
Returns:
destroy
()
Deregister events
directlayout
-
partition -
data
Parameters:
-
partitionArrayThe partition (column) to be layed out -
dataFeature
draw
-
profile
Draw the SimpleProfile by drawing the bargraph.
Parameters:
-
profileProfileThe niViz profile to render
draw_columns
-
partitions
Parameters:
-
partitionsArray< ArrayAll partitions
ecttxt
-
paper -
p -
center -
txt -
layer
Parameters:
Returns:
flags
-
offset -
data
Parameters:
-
offsetNumberPixel position -
dataFeature
flagstxt
-
paper -
p -
center -
txt -
layer -
offset
Parameters:
Returns:
graph
-
param
Callback to graph the currently selected additional parameter. Calculates the constraints and calls this.bargraph.curve.
Parameters:
-
paramStringName of parameter active
header
-
offset -
options -
data
hhlabels
()
private
Draws the hand hardness index labels below the top abscissa.
highlight
-
y
Parameters:
-
yNumbery-coordinate as pixel value
index
-
y
Parameters:
-
yNumbery-coordinate as pixel value
Returns:
layout
-
partitions
Parameters:
-
partitionsArray< Array
Returns:
loadcolumns
()
private
matchfeatures
()
private
Populate the features array, which will hold all features that are present in both the barparams array and the station's features array
miniconfig
()
private
Configure parameters for miniature mode.
mouseon
()
private
next
()
private
Set this.counter to the next valid additional parameter that a curve or stair case graph shall be drawn for.
partition
-
partition -
data -
height
Parameters:
-
partitionArrayThe primary (column) to be layed out -
dataFeature -
heightNumberThe minimal height of a table row
Returns:
position
-
partitions -
index -
primeindex -
data -
height
Parameters:
Returns:
printDate
()
private
In case the bargraph is in miniature mode print the date of the currently profile in the top right corner.
rbtxt
-
paper -
p -
center -
txt -
layer
Parameters:
Returns:
remove
-
name
Remove a parameter from the barparams Config SimpleProfile.defaults. This method is invoked by the settings modal when a user removes a parameter from the additional parameters section.
Parameters:
-
nameStringParamter name (e. g. ramm, density)
select
()
Array< Array
private
Returns:
setbarcfg
()
private
Configure bargraph properties.
setcounter
()
private
Set the variable this.counter to a parameter present in the profile by trying to preserve the last selected parameter (e. g. grainsize) which is buffered in the this.lastcounter variable.
setParameter
-
param
If a parameter is active in the timeline graph, check whether this parameter also exists as additional parameter in the SimpleProfile. Note: grainshape is mapped to temperature
Parameters:
-
paramStringName of parameter active
setProperties
-
properties
Overwrite current properties with the ones passed as parameter.
Parameters:
-
propertiesObject
shiftdown
-
partitions -
primeindex -
primepos -
index -
shift -
height
Parameters:
-
partitionsArray< ArrayAll partitions -
primeindexNumberIndex of primary partition -
primeposNumberOnly shift down below this height of the primary partition -
indexNumberIndex up to which shifting may occur (i. e. currently positioned) -
shiftNumberNumber of pixels to shift down -
heightNumberMinimal height of a row
slope
-
x -
y -
svg
stbtxt
-
paper -
p -
center -
txt -
layer
Parameters:
Returns:
table
()
protected
toString
-
value -
type -
offset -
y -
width -
height -
layer
Parameters:
Returns:
unhighlight
()
private
y
-
y
Parameters:
-
yNumberSnow height
Returns:
zoom
-
range
Parameters:
-
rangeObjectAn object with a min, max and axis property
