Class: Divider

Divider

A divider is the line and spacing that separate tracks and slot.

There are two type of dividers: slot and track. They are accessed from the viewer dividers object:

  • cgv.dividers.track - controlls spacing/lines between tracks.
  • cgv.dividers.slot - controls spacing/lines betweens slots within a track.

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() divider-update
Read dividers - -

Attributes

Attribute Type Description
color String A string describing the color [Default: 'black']. See Color for details.
thickness Number Thickness of divider [Default: 1]
spacing Number Spacing between divider and track/slot content [Default: 1]
mirroric Boolean If true, the other dividers will use the same settings as this divider.
visible Boolean Dividers are visible [Default: true]
meta Object Meta data for divider

ic Ignored on Record creation

Examples

new Divider(viewer, name, options, meta)

Create a divider

Name Type Description
viewer Viewer

The viewer

name String

The name for the divider. One of: track, slot, or mirrored.

options Object

Attributes used to create the divider

meta Object optional

User-defined Meta data to add to the divider

Extends

Members

adjustedSpacingNumber

Get the divider spacing adjusted for zoom level. Even if the divider is not visible, there can still be spacing between the slots/tracks.

adjustedThicknessNumber

Get the divider thickness adjusted for visibility and zoom level.

canvasCanvas

Get the canvas.

colorColor

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

layoutLayout

Get the layout.

metaBoolean

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

mirrorBoolean

Get or set the mirroring for this divider. When setting to true, the other divider will be mirrored to this one.

name

Return name of divider (e.g. 'track' or 'slot')

sequenceSequence

Get the sequence.

spacingNumber

Set or get the divider spacing.

thicknessNumber

Set or get the divider thickness. This is the unzoomed thickness.

viewerViewer

Get the viewer.

visibleBoolean

Get or Set the visibility of this object.

Methods

inherited deleteFromObjects()

Remove the object from Viewer.objects

toString(){String}

Return the class name as a string.

Returns:
Type Description
String
  • 'Divider'

update(attributes)

Update divider attributes. See updating records for details.

Name Type Description
attributes Object

Object describing the properties to change