Class: CenterLine

CenterLine

The center line points to the center of the viewer (i.e. the current base pair).

CenterLine settings are not saved with the map. They are only used for display purposes.

If either track or slot has their mirror set to true, then both dividers will be treated as the same. In addition, if only settings for one of the dividers is provided on Viewer creation, then it will be mirrored.

Action and Events

Action Viewer Method Divider Method Event
Update - update() centerLine-update

Attributes

Attribute Type Description
color String A string describing the color [Default: 'black']. See Color for details.
thickness Number Thickness of center line [Default: 1]
dashes Array An array of numbers describing the dash pattern [Default: [1, 2]]
visible Boolean Center line is visible [Default: true]
meta Object Meta data for center line

Examples

// Turn on the center line
cgv.centerLine.visible = true;

// Turn off the center line
cgv.centerLine.visible = false;

// Change the color of the center line
cgv.centerLine.update({color: 'red'});

new CenterLine(viewer, options, meta)

Create the center line

Name Type Description
viewer Viewer

The viewer

options Object

Attributes used to create the center line

meta Object optional

User-defined Meta data to add to the center line

Extends

Members

canvasCanvas

Get the canvas.

colorColor

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

dashesArray

Set or get the center line dash pattern. Falsy values will result in a solid line. Any other non array values will result in the default dash pattern.

layoutLayout

Get the layout.

metaBoolean

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

sequenceSequence

Get the sequence.

thicknessNumber

Set or get the center line thickness. This is the unzoomed thickness.

viewerViewer

Get the viewer.

visibleBoolean

Get or Set the visibility of this object.

Methods

inherited addPluginOptions(id, options)

Add a plugin to the object.

Name Type Description
id String

The id of the plugin

options Object

The plugin options

inherited deleteFromObjects()

Remove the object from Viewer.objects

inherited hasPlugin(pluginID){Boolean}

Does this object have a particular plugin?

Name Type Description
pluginID String

The ID of the plugin

Returns:
Type Description
Boolean
  • Whether the object has the plugin

invertColors()

Invert colors of the centerLine

inherited optionsForPlugin(pluginName){Object}

Get the options for a particular plugin.

Name Type Description
pluginName String

The name of the plugin

Returns:
Type Description
Object
  • The options for the plugin or undefined if the plugin is not found

toString(){String}

Return the class name as a string.

Returns:
Type Description
String
  • 'CenterLine'

update(attributes)

Update CenterLine attributes. See updating records for details.

Name Type Description
attributes Object

Object describing the properties to change

inherited updatePluginOptions(id, options)

Update plugin options. Merge the new options with the old options.

Name Type Description
id String

The id of the plugin

options Object

The plugin options