Skip to content

Commit

Permalink
permit initialising with [] as “no data yet” indicator (#597)
Browse files Browse the repository at this point in the history
  • Loading branch information
mirabilos committed Feb 7, 2023
1 parent e706551 commit c888d4c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/dygraph.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ Dygraph.prototype.__init__ = function(div, file, attrs) {
// Copy the important bits into the object
// TODO(danvk): most of these should just stay in the attrs_ dictionary.
this.maindiv_ = div;
this.file_ = file;
this.file_ = Array.isArray(file) && !file.length ? [[0]] : file;
this.rollPeriod_ = attrs.rollPeriod || Dygraph.DEFAULT_ROLL_PERIOD;
this.previousVerticalX_ = -1;
this.fractions_ = attrs.fractions || false;
Expand Down

0 comments on commit c888d4c

Please sign in to comment.