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:
-
partitions
Array< 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:
-
partitions
Array< Array
commentstxt
-
paper
-
p
-
center
-
txt
-
layer
-
offsetx
-
width
-
height
-
lindex
Render the cell text for the comments type.
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:
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:
-
partition
ArrayPrimary partition, to be connected to graph
-
offset
NumberPixel 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:
-
partition
ArrayThe partition (column) to be layed out
-
data
Feature
draw_columns
-
partitions
Draw all columns.
Parameters:
-
partitions
Array< 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:
-
offset
NumberPixel position
-
data
Feature
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:
-
y
Numbery-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:
-
y
Numbery-coordinate as pixel value
Returns:
key of this.blanket object to reference actual object
layout
-
partitions
Layout the primary partition in zoomed state.
Parameters:
-
partitions
Array< 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:
-
partition
ArrayThe primary (column) to be layed out
-
data
Feature -
height
NumberThe 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:
-
column
NumberThe 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:
-
properties
Object
shiftdown
-
partitions
-
primeindex
-
primepos
-
index
-
shift
-
height
Shift down all partitions already layed out up until a certain partition and layer 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
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:
-
y
NumberSnow height
Returns:
Pixel value
zoom
-
range
Zoom in on a certain snow height range.
Parameters:
-
range
ObjectAn 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.