Skip to content

Commit

Permalink
Add a comment on timestamp scan
Browse files Browse the repository at this point in the history
  • Loading branch information
nagix committed Aug 16, 2017
1 parent 7a8f8f5 commit b05b0f8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/scales/scale.time.js
Original file line number Diff line number Diff line change
Expand Up @@ -341,9 +341,13 @@ function computeOffsets(table, ts, min, max, options) {
var i, ilen, timestamp, length, upper, lower, divisor;

if (options.offset) {
// First, it processes `ts.labels` to pick up timestamps of labels, which are
// primarily used for offset calculation because bars are usually on labels.
// But if there are no labels, it should add offsets based on `ts.data` because
// we support bars with {t, y} data points as well. That is the second path.
[ts.labels, ts.data].forEach(function(data) {
if (!timestamps.length) {
// Remove labels outside the min/max range
// Remove timestamps outside the min/max range
for (i = 0, ilen = data.length; i < ilen; ++i) {
timestamp = data[i];
if (timestamp >= min && timestamp <= max) {
Expand Down

0 comments on commit b05b0f8

Please sign in to comment.