TabularProfile Class
Visualization of a singular snow profile in tabular form. This class is the parent of the SLFProfile, StructureProfile and SimpleProfile classes.
Constructor
TabularProfile
()
Methods
add
-
object -
[position]
Add a column to the table for a certain parameter.
align
-
partitions
Once the zoomed primary partition has been subjected to layout adjust all other partitions to represent the initial relations.
Parameters:
-
partitionsArray< Array
Returns:
Partitions in zoomed range.
arrange
-
partitions
Initially (without zooming) arrange all the layers in the table by first allocating enough space for the primary (first) column to be rendered and then increasing the table size in case more space is needed for later columns.
Parameters:
-
partitionsArray< Array
commentstxt
-
paper -
p -
center -
txt -
layer -
offsetx -
width -
height -
lindex
Render the cell text for the comments type.
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:
svg group container
config
()
protected
Configure basic properties of the TabularProfile such as font, table margins, height and width.
connect
-
partition -
offset
Connect table and graph through dotted lines and store reference in an object called this.blanket to later reference the individual lines.
Parameters:
-
partitionArrayPrimary partition, to be connected to graph
-
offsetNumberPixel position of the right edge of the graph
cttxt
-
paper -
p -
center -
txt -
layer
Render the cell text for the CT parameter.
Parameters:
Returns:
svg group container
directlayout
-
partition -
data
For parameters that are not layed out relatively to the primary partition: directly place them at the actual height of the layer
Parameters:
-
partitionArrayThe partition (column) to be layed out
-
dataFeature
draw_columns
-
partitions
Draw all columns.
Parameters:
-
partitionsArray< ArrayAll partitions
ecttxt
-
paper -
p -
center -
txt -
layer
Render the cell text for the ECT parameter.
Parameters:
Returns:
svg group container
flags
-
offset -
data
Draw a column header for the yellow flags feature.
Parameters:
-
offsetNumberPixel position
-
dataFeature
flagstxt
-
paper -
p -
center -
txt -
layer -
offset
Render the cell text for the flags parameter. Either asterisks or flags.
Parameters:
Returns:
svg group container
header
-
offset -
options -
data
Draw a column header at the position specified by offset.
highlight
-
y
Highlight the table row that spans the passed y-coordinate pixel. Draw snow height label (this.hs()), if applicable.
Parameters:
-
yNumbery-coordinate as pixel value
index
-
y
This method returns the reference to the blanket object that spans the given y-coordinate - or undefined if no table row matches the y-coordinate.
Parameters:
-
yNumbery-coordinate as pixel value
Returns:
key of this.blanket object to reference actual object
layout
-
partitions
Layout the primary partition in zoomed state.
Parameters:
-
partitionsArray< Array
Returns:
Partitions in zoomed range.
loadcolumns
()
private
Set all possible columns of the table. These consist of the fixed columns for stratigraphic parameters and some configured by the user.
mouseon
()
private
This method enables the mousemove event on the area spanning the table.
partition
-
partition -
data -
height
Primary (first existant) column layout. If there is too little space to fit the column layers than a value >0 is returned. The canvas needs to be resized appropriately.
Parameters:
-
partitionArrayThe primary (column) to be layed out
-
dataFeature -
heightNumberThe minimal height of a table row
Returns:
Number of pixels to enlarge the canvas
position
-
partitions -
index -
primeindex -
data -
height
Position another column relatively to the primary partition.
Parameters:
Returns:
Number of pixels to enlarge the canvas
rbtxt
-
paper -
p -
center -
txt -
layer
Render the cell text for the Rutschblock parameter.
Parameters:
Returns:
svg group container
remove
-
column
Remove a column from the table.
Parameters:
-
columnNumberThe column index to remove
select
()
Array< Array
private
Select all layers in all partitions that are within p.table.min and p.table.max.
Returns:
Partitions in zoomed range.
setProperties
-
properties
Overwrite current properties with the ones passed as parameter.
Parameters:
-
propertiesObject
shiftdown
-
partitions -
primeindex -
primepos -
index -
shift -
height
Shift down all partitions already layed out up until a certain partition and layer 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
Draw the slope angle at the bottom of the table and display exposition.
stbtxt
-
paper -
p -
center -
txt -
layer
Generic rendering for stability types.
Parameters:
Returns:
svg group container
table
()
protected
A closure that provides the property this.table().width to get the exact width of the table.
toString
-
value -
type -
offset -
y -
width -
height -
layer
Draw the text of the current layer and column, depending on the type of paramater different renderings are required.
Parameters:
Returns:
svg group container
unhighlight
()
private
Remove any highlights and the snow height label, if there is one.
y
-
y
Get the pixel value for a given snow height.
Parameters:
-
yNumberSnow height
Returns:
Pixel value
zoom
-
range
Zoom in on a certain snow height range.
Parameters:
-
rangeObjectAn object with a min, max and axis property
Properties
nopos
ArrayA list of parameters that will be layed out directly, i. e. at their real height and will not be placed among the stratigraphic parameters.
