MCPcopy Index your code
hub / github.com/plotly/plotly.js / moreDates

Function moreDates

src/plots/cartesian/axis_autotype.js:62–82  ·  view source on GitHub ↗
(a, calendar)

Source from the content-addressed store, hash-verified

60// numbers and a few dates
61// as with categories, consider DISTINCT values only.
62function moreDates(a, calendar) {
63 var len = a.length;
64
65 var inc = getIncrement(len);
66 var dats = 0;
67 var nums = 0;
68 var seen = {};
69
70 for(var f = 0; f < len; f += inc) {
71 var i = round(f);
72 var ai = a[i];
73 var stri = String(ai);
74 if(seen[stri]) continue;
75 seen[stri] = 1;
76
77 if(isDateTime(ai, calendar)) dats++;
78 if(isNumeric(ai)) nums++;
79 }
80
81 return dats > nums * 2;
82}
83
84// return increment to test at most 1000 points, evenly spaced
85function getIncrement(len) {

Callers 1

axis_autotype.jsFile · 0.85

Calls 2

getIncrementFunction · 0.85
roundFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…