Class: Ruler

Ruler

The Ruler controls and draws the sequence ruler in bp.

Action and Events

Action Viewer Method Ruler Method Event
Update - update() ruler-update
Read ruler - -

Attributes

Attribute Type Description
font String A string describing the font [Default: 'sans-serif, plain, 10']. See Font for details.
color String A string describing the color [Default: 'black']. See Color for details.
visible Boolean Rulers are visible [Default: true]
meta Object Meta data for ruler

Examples

new Ruler(viewer, options, meta)

Create a new ruler

Name Type Description
viewer Viewer

The viewer

options Object

Attributes used to create the ruler

meta Object optional

User-defined Meta data to add to the ruler.

Extends

Members

canvasCanvas

Get the canvas.

colorColor

Get or set the Color. When setting the color, a string representing the color or a Color object can be used. For details see Color.

fontFont

Get or set the font. When setting the font, a string representing the font or a Font object can be used. For details see Font.

layoutLayout

Get the layout.

majorTicksArray

Get the array of Major Ticks.

majorTickStepNumber

Get distance between major tick marks.

metaBoolean

Get or Set the meta data of this object. See the meta data tutorial for details.

minorTicksArray

Get the array of Minor Ticks.

minorTickStepNumber

Get distance between minor tick marks.

sequenceSequence

Get the sequence.

tickFormaterObject

Get the d3 formatter for printing the tick labels

viewerViewer

Get the viewer.

visibleBoolean

Get or Set the visibility of this object.

Methods

inherited deleteFromObjects()

Remove the object from Viewer.objects

toJSON()

Returns JSON representing the object

toString(){String}

Return the class name as a string.

Returns:
Type Description
String
  • 'Ruler'

update(attributes)

Update ruler attributes. See updating records for details.

Name Type Description
attributes Object

Object describing the properties to change