API Docs for: 0.0.1
Show:

Visuals Class

Module: niviz

The static Visuals class encompasses a few static methods to draw common visual elements such as buttons or arrows. No instantiation or initialization is necessary.

Item Index

Methods

Methods

Arrows

(
  • ctx
  • data
  • left
  • right
  • min
  • max
  • coord
)
Object static

Pass sk38, rb, ect or ct profile feature and draw black pointed arrows at the respective heights. Note: Only the first profile of each test is considered!

Parameters:

  • ctx Object

    'this' context to be utilized

  • data Feature

    A feature such as rb, ect, ct or sk38 of a profile

  • left Number

    left x-coordinate (where the arrow points)

  • right Number

    right x-coordinate

  • min Number

    Minimal height for arrow to be drawn

  • max Number

    Maximal height for arrow to be drawn

  • coord Function

    Function to be map height to actual pixel value

Returns:

Object:

svg group container which holds all the visual elements

Button

(
  • paper
  • x
  • y
  • text
  • self
  • callback
)
Object static

Create a grey button with a text on top, height 25px, width 80px

Parameters:

  • paper Object

    SnapSVG paper object

  • x Number

    Top left corner x-coordinate

  • y Number

    Top left corner y-coordinate

  • text String

    Text to be show on button

  • self Object

    Context for callback function

  • callback Function

    Callback function executed on click

Returns:

Object:

svg group container which holds all the visual elements

format

(
  • textbox
  • current
  • addendum
  • maxwidth
)
String private

Try to print the text handed over in a textbox with a maximum width of maxwidth

Parameters:

  • textbox Object

    SnapSVG text element

  • current String

    The current string

  • addendum String

    Text string to be added

  • maxwidth Number

    Max width of the text box, default: 250px

Returns:

String:

The altered comment string

format

(
  • text
  • maxwidth
)
String private

Return text with linebreaks after maxwidth chars

Parameters:

  • text String

    Text string to be added

  • maxwidth Number

    Max width of the text box, default: 60 chars

Returns:

String:

The altered string