StructureProfile Class
Visualization of a singular snow profile SLF style with an additional visualization of the structure profile according to Monti et Schweizer "Snow profile visualisations to highlight structural instability conditions" (2013). A miniature version exists which may be used in combination with a timeline graph.
Constructor
Item Index
Methods
- add
- align
- arrange
- arrow
- arrows
- buildpopup
- clear
- comment
- commentstxt
- config
- configure
- connect
- coordsys
- cttxt
- destroy
- directlayout
- draw
- draw_block
- draw_columns
- draw_curve
- draw_lower_legend
- ecttxt
- flags
- flagstxt
- format
- hatching
- hatching
- header
- highlight
- hs
- index
- layout
- loadcolumns
- miniconfig
- mousemove
- mouseon
- multitext
- partition
- popup
- position
- rbtxt
- remove
- select
- setbarcfg
- setProperties
- setup
- shiftdown
- show
- slope
- stbtxt
- table
- testorder
- testprint
- toggle
- toString
- unhighlight
- y
- zoom
Methods
add
-
object -
[position]
align
-
partitions
Parameters:
-
partitionsArray< Array
Returns:
arrange
-
partitions
Parameters:
-
partitionsArray< Array
arrow
-
feature -
type
Callback for BarGraph. Draw the red arrows to highlight instable structures.
arrows
-
params -
name
Draw the arrows for the parameters passed.
Parameters:
-
paramsArrayThe parameters to be drawn
-
nameStringName for the svg group container, that will hold the arrows
buildpopup
-
paper -
p -
text -
x -
y
Build the popup for the temperature / gradient curve.
clear
()
private
Delete the hs, datesmall and layerlines elements.
comment
()
private
Draw the comment box on the graph.
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 basic properties of the SLFProfile and the parent class TabularProfile such as font, table margins, height and width.
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
coordsys
()
private
Draw the coordinate system
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 StructureProfile by drawing the bargraph.
Parameters:
-
profileProfileThe niViz profile to render
draw_block
-
parameter -
color -
name
Draw a parameter of the profile as a staircase graph.
draw_columns
-
partitions
Parameters:
-
partitionsArray< ArrayAll partitions
draw_curve
-
parameter
Draw a parameter of the profile as a curve.
Parameters:
-
parameterStringThe profile parameter (e. g. temperature, gradient)
draw_lower_legend
-
parameter
Draw legend for the curve (temperature/gradient) at the bottom of the graph.
Parameters:
-
parameterStringThe profile parameter (e. g. temperature, gradient)
ecttxt
-
paper -
p -
center -
txt -
layer
Parameters:
Returns:
flags
-
offset -
data
Parameters:
-
offsetNumberPixel position -
dataFeature
flagstxt
-
paper -
p -
center -
txt -
layer -
offset
Parameters:
Returns:
format
-
textbox -
current -
addendum
Actually add the addendum string by making sure it doesn't transgress the boundaries of the textbox.
Parameters:
Returns:
The altered comment string
hatching
-
color -
[angle]
Draw the hatched pattern
Returns:
The pattern to be used for some fill property
hatching
-
color -
bgcolor
Draw a vertically hatched pattern
Returns:
The pattern to be used for some fill property
header
-
offset -
options -
data
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
miniconfig
()
private
Configure parameters for miniature mode.
mousemove
()
Boolean
private
Method to be called when mousemove event is detected. It calls the method SLFProfile:show in turn and deals with the comment box.
Returns:
on Turn mouse events on
mouseon
()
private
multitext
-
x -
y -
text
Print out multilined text, each line is nested in a
separate
Parameters:
Returns:
Multilined text element
partition
-
partition -
data -
height
Parameters:
-
partitionArrayThe primary (column) to be layed out -
dataFeature -
heightNumberThe minimal height of a table row
Returns:
popup
-
X -
Y -
set -
pos -
stretch
Draw a niViz popup
Parameters:
Returns:
The popup
position
-
partitions -
index -
primeindex -
data -
height
Parameters:
Returns:
print
-
param -
lbl -
box -
current
Print the stability test ECT and CT (comment section).
Parameters:
Returns:
The altered comment string
rbtxt
-
paper -
p -
center -
txt -
layer
Parameters:
Returns:
remove
-
column
Parameters:
-
columnNumberThe column index to remove
select
()
Array< Array
private
Returns:
setbarcfg
()
private
Configure bargraph properties.
setProperties
-
properties
Overwrite current properties with the ones passed as parameter.
Parameters:
-
propertiesObject
setup
()
private
Configure the axes for hs, hardness, temperature and the gradient parameters.
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
show
-
x -
y
Draw the popup for the temperature or gradient curve (whichever is present) if mouse cursor is close to or on data point of the curve.
slope
-
x -
y -
svg
stbtxt
-
paper -
p -
center -
txt -
layer
Parameters:
Returns:
table
()
protected
testorder
-
test
Check if the passed stability test is ordered and if so return the ordered sequence.
Parameters:
-
testFeatureCT or ECT
Returns:
The sequence of tests
testprint
-
box -
current
Print the stability test ECT and CT (comment section).
Returns:
The altered comment string
toggle
()
private
Toggle between gradient and temperature curve.
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
