Skip to content

Commit 32a1f27

Browse files
committed
Add docstrings for track label functions
1 parent babe278 commit 32a1f27

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

src/js/annotations/track-labels.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ function writeTrackLabelContainer(ideo) {
4747
.style('line-height', '10px')
4848
}
4949

50+
/**
51+
* Get label text for displayed tracks from annotation container metadata,
52+
* heatmap keys, or annotation container keys
53+
*/
5054
function getLabels(ideo) {
5155
var annotKeys, labels, heatmaps, i;
5256

@@ -74,6 +78,9 @@ function getLabels(ideo) {
7478
return labels;
7579
}
7680

81+
/**
82+
* Display track labels on the page
83+
*/
7784
function renderTrackLabels(top, left, ideo) {
7885
d3.select(ideo.config.container + ' #_ideogramTrackLabel')
7986
.style('opacity', 1) // Make label visible
@@ -90,6 +97,9 @@ function renderTrackLabels(top, left, ideo) {
9097
});
9198
}
9299

100+
/**
101+
* Get left and top (x and y) offset for track label text
102+
*/
93103
function getTrackLabelOffsets(labels, trackCanvas, ideo) {
94104
var labels, firstTrackId, firstTrack, trackBox, labelBox, ideoBox, left, top,
95105
marginHack = 7; // TODO: Make this dynamic
@@ -111,6 +121,9 @@ function getTrackLabelOffsets(labels, trackCanvas, ideo) {
111121
return [left, top];
112122
}
113123

124+
/**
125+
* Show the track label for this track
126+
*/
114127
function showTrackLabel(trackCanvas, ideo) {
115128
var labels, left, top;
116129

0 commit comments

Comments
 (0)