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:
-
partitions
Array< Array
Returns:
arrange
-
partitions
Parameters:
-
partitions
Array< Array
arrows
-
params
-
name
Draws arrows for one or more parameters specified by calling the Visuals:Arrows method.
Parameters:
-
params
ArrayAll parameter that require arrow drawing
-
name
StringName of the svg group to bundle the arrows
commentstxt
-
paper
-
p
-
center
-
txt
-
layer
-
offsetx
-
width
-
height
-
lindex
Parameters:
-
paper
ObjectSnapSVG paper -
p
ObjectProperties object -
center
ObjectPixel coordinates used for positioning -
txt
ObjectFont object -
layer
ValueThe layer object, -
offsetx
ValueThe x-coord at the left of the column -
width
ValueMax-width number of fontsizes -
height
ValueHeight of the cell in pixel -
lindex
NumberLayer 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:
-
partition
ArrayPrimary partition, to be connected to graph -
offset
NumberPixel position of the right edge of the graph
cttxt
-
paper
-
p
-
center
-
txt
-
layer
Parameters:
Returns:
destroy
()
Deregister events
directlayout
-
partition
-
data
Parameters:
-
partition
ArrayThe partition (column) to be layed out -
data
Feature
draw
-
profile
Draw the SimpleProfile by drawing the bargraph.
Parameters:
-
profile
ProfileThe niViz profile to render
draw_columns
-
partitions
Parameters:
-
partitions
Array< ArrayAll partitions
ecttxt
-
paper
-
p
-
center
-
txt
-
layer
Parameters:
Returns:
flags
-
offset
-
data
Parameters:
-
offset
NumberPixel position -
data
Feature
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:
-
param
StringName of parameter active
header
-
offset
-
options
-
data
hhlabels
()
private
Draws the hand hardness index labels below the top abscissa.
highlight
-
y
Parameters:
-
y
Numbery-coordinate as pixel value
index
-
y
Parameters:
-
y
Numbery-coordinate as pixel value
Returns:
layout
-
partitions
Parameters:
-
partitions
Array< 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:
-
partition
ArrayThe primary (column) to be layed out -
data
Feature -
height
NumberThe 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:
-
name
StringParamter 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:
-
param
StringName of parameter active
setProperties
-
properties
Overwrite current properties with the ones passed as parameter.
Parameters:
-
properties
Object
shiftdown
-
partitions
-
primeindex
-
primepos
-
index
-
shift
-
height
Parameters:
-
partitions
Array< ArrayAll partitions -
primeindex
NumberIndex of primary partition -
primepos
NumberOnly shift down below this height of the primary partition -
index
NumberIndex up to which shifting may occur (i. e. currently positioned) -
shift
NumberNumber of pixels to shift down -
height
NumberMinimal 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:
-
y
NumberSnow height
Returns:
zoom
-
range
Parameters:
-
range
ObjectAn object with a min, max and axis property