PMSI-AlignAlytics / dimple

An object-oriented API for business analytics
Other
2.73k stars 556 forks source link

dimple.axis.timePeriod #269

Open ChristianS99 opened 7 years ago

ChristianS99 commented 7 years ago

documentation at https://github.com/PMSI-AlignAlytics/dimple/wiki/dimple.axis#timePeriod states "Be sure to use the plural versions here." Also, the example syntax refers to d3 v3. The syntax in v4 has changed and also the plural versions don't work, instead the singular version works.

In d3 it boils down to this function:

function tickInterval(interval, start, stop, step) {
    if (interval == null) interval = 10;

    // If a desired tick count is specified, pick a reasonable tick interval
    // based on the extent of the domain and a rough estimate of tick size.
    // Otherwise, assume interval is already a time interval and use it.
    if (typeof interval === "number") {
     ///... irrelevant, not executed in this case
    }

    return step == null ? interval : interval.every(step);
  }

interval is what is set as timePeriod and timeRanges (which the plural versions are) don't have every(), instead the singular versions have. Please update docu.