API Docs for: 0.0.1
Show:

TabularProfile Class

Extends Graph
Module: niviz

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]
)
private

Add a column to the table for a certain parameter.

Parameters:

  • object Object

    An object with a width and parameter property

  • [position] Number optional

    Where to insert the column. Default: at the end.

align

(
  • partitions
)
Array< Array > private

Once the zoomed primary partition has been subjected to layout adjust all other partitions to represent the initial relations.

Parameters:

  • partitions Array< Array >

    Returns:

    Array< Array >:

    Partitions in zoomed range.

    arrange

    (
    • partitions
    )
    private

    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
      )
      Object private

      Render the cell text for the comments type.

      Parameters:

      • paper Object

        SnapSVG paper

      • p Object

        Properties object

      • center Object

        Pixel coordinates used for positioning

      • txt Object

        Font object

      • layer Value

        The layer object,

      • offsetx Value

        The x-coord at the left of the column

      • width Value

        Max-width number of fontsizes

      • height Value

        Height of the cell in pixel

      • lindex Number

        Layer index (for cross referencing)

      Returns:

      Object:

      svg group container

      config

      () protected

      Configure basic properties of the TabularProfile such as font, table margins, height and width.

      connect

      (
      • partition
      • offset
      )
      private

      Connect table and graph through dotted lines and store reference in an object called this.blanket to later reference the individual lines.

      Parameters:

      • partition Array

        Primary partition, to be connected to graph

      • offset Number

        Pixel position of the right edge of the graph

      • cttxt

        (
        • paper
        • p
        • center
        • txt
        • layer
        )
        Object private

        Render the cell text for the CT parameter.

        Parameters:

        • paper Object

          SnapSVG paper

        • p Object

          Properties object

        • center Object

          Pixel coordinates used for positioning

        • txt Object

          Font object

        • layer Value

          The flags value object

        Returns:

        Object:

        svg group container

        directlayout

        (
        • partition
        • data
        )
        private

        For parameters that are not layed out relatively to the primary partition: directly place them at the actual height of the layer

        Parameters:

        • partition Array

          The partition (column) to be layed out

        • data Feature
        • draw

          (
          • profile
          )

          Inherited from Graph but overwritten in lib/graphs/tabular.js:252

          Draw the TabularProfile and set up the mouse events.

          Parameters:

          draw_columns

          (
          • partitions
          )
          private

          Draw all columns.

          Parameters:

          • partitions Array< Array >

            All partitions

            ecttxt

            (
            • paper
            • p
            • center
            • txt
            • layer
            )
            Object private

            Render the cell text for the ECT parameter.

            Parameters:

            • paper Object

              SnapSVG paper

            • p Object

              Properties object

            • center Object

              Pixel coordinates used for positioning

            • txt Object

              Font object

            • layer Value

              The flags value object

            Returns:

            Object:

            svg group container

            flags

            (
            • offset
            • data
            )
            private

            Draw a column header for the yellow flags feature.

            Parameters:

            • offset Number

              Pixel position

            • data Feature

            flagstxt

            (
            • paper
            • p
            • center
            • txt
            • layer
            • offset
            )
            Object private

            Render the cell text for the flags parameter. Either asterisks or flags.

            Parameters:

            • paper Object

              SnapSVG paper

            • p Object

              Properties object

            • center Object

              Pixel coordinates used for positioning

            • txt Object

              Font object

            • layer Value

              The flags value object

            • offset Number

              The column offset

            Returns:

            Object:

            svg group container

            header

            (
            • offset
            • options
            • data
            )
            private

            Draw a column header at the position specified by offset.

            Parameters:

            • offset Number

              Pixel position

            • options Object

              Holds the symbol and unit properties

            • data Feature

            highlight

            (
            • y
            )
            private

            Highlight the table row that spans the passed y-coordinate pixel. Draw snow height label (this.hs()), if applicable.

            Parameters:

            • y Number

              y-coordinate as pixel value

            index

            (
            • y
            )
            Number private

            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 Number

              y-coordinate as pixel value

            Returns:

            Number:

            key of this.blanket object to reference actual object

            layout

            (
            • partitions
            )
            Array< Array > private

            Layout the primary partition in zoomed state.

            Parameters:

            • partitions Array< Array >

              Returns:

              Array< Array >:

              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
              )
              Number private

              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 Array

                The primary (column) to be layed out

              • data Feature
              • height Number

                The minimal height of a table row

              • Returns:

                Number:

                Number of pixels to enlarge the canvas

                position

                (
                • partitions
                • index
                • primeindex
                • data
                • height
                )
                Number private

                Position another column relatively to the primary partition.

                Parameters:

                • partitions Array< Array >

                  All partitions

                • index Number

                  Index of partition to be positioned

                • primeindex Number

                  Index of primary partition

                • data Feature
                • height Number

                  The minimal height of a table row

                • Returns:

                  Number:

                  Number of pixels to enlarge the canvas

                  rbtxt

                  (
                  • paper
                  • p
                  • center
                  • txt
                  • layer
                  )
                  Object private

                  Render the cell text for the Rutschblock parameter.

                  Parameters:

                  • paper Object

                    SnapSVG paper

                  • p Object

                    Properties object

                  • center Object

                    Pixel coordinates used for positioning

                  • txt Object

                    Font object

                  • layer Value

                    The flags value object

                  Returns:

                  Object:

                  svg group container

                  remove

                  (
                  • column
                  )
                  private

                  Remove a column from the table.

                  Parameters:

                  • column Number

                    The 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:

                  Array< Array >:

                  Partitions in zoomed range.

                  setProperties

                  (
                  • properties
                  )

                  Overwrite current properties with the ones passed as parameter.

                  Parameters:

                  shiftdown

                  (
                  • partitions
                  • primeindex
                  • primepos
                  • index
                  • shift
                  • height
                  )
                  private

                  Shift down all partitions already layed out up until a certain partition and layer height.

                  Parameters:

                  • partitions Array< Array >

                    All partitions

                  • primeindex Number

                    Index of primary partition

                  • primepos Number

                    Only shift down below this height of the primary partition

                  • index Number

                    Index up to which shifting may occur (i. e. currently positioned)

                  • shift Number

                    Number of pixels to shift down

                  • height Number

                    Minimal height of a row

                  • slope

                    (
                    • x
                    • y
                    • svg
                    )
                    private

                    Draw the slope angle at the bottom of the table and display exposition.

                    Parameters:

                    stbtxt

                    (
                    • paper
                    • p
                    • center
                    • txt
                    • layer
                    )
                    Object private

                    Generic rendering for stability types.

                    Parameters:

                    • paper Object

                      SnapSVG paper

                    • p Object

                      Properties object

                    • center Object

                      Pixel coordinates used for positioning

                    • txt Object

                      Font object

                    • layer Value

                      The flags value object

                    Returns:

                    Object:

                    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
                    )
                    Object private

                    Draw the text of the current layer and column, depending on the type of paramater different renderings are required.

                    Parameters:

                    • value Value

                      The current value

                    • type String

                      The parameter name

                    • offset Number

                      Pixel offset of the current table column

                    • y Number

                      Pixel y-coordinate of the layer top

                    • width Number

                      Column width

                    • height Number

                      Row height

                    • layer Number

                      Layer index (for cross-reference)

                    Returns:

                    Object:

                    svg group container

                    unhighlight

                    () private

                    Remove any highlights and the snow height label, if there is one.

                    y

                    (
                    • y
                    )
                    Number private

                    Get the pixel value for a given snow height.

                    Parameters:

                    Returns:

                    Number:

                    Pixel value

                    zoom

                    (
                    • range
                    )
                    protected

                    Zoom in on a certain snow height range.

                    Parameters:

                    • range Object

                      An object with a min, max and axis property

                    Properties

                    nopos

                    Array static

                    A list of parameters that will be layed out directly, i. e. at their real height and will not be placed among the stratigraphic parameters.