(trace, posLetter, posAxis, num)
| 308 | // per trace, set x0 (y0) to the x (y) value or category for this trace |
| 309 | // (or set x (y) to a constant array matching y (x)) |
| 310 | function getPosArrays(trace, posLetter, posAxis, num) { |
| 311 | var hasPosArray = posLetter in trace; |
| 312 | var hasPos0 = posLetter + '0' in trace; |
| 313 | var hasPosStep = 'd' + posLetter in trace; |
| 314 | |
| 315 | if(hasPosArray || (hasPos0 && hasPosStep)) { |
| 316 | var origPos = posAxis.makeCalcdata(trace, posLetter); |
| 317 | var pos = alignPeriod(trace, posAxis, posLetter, origPos).vals; |
| 318 | return [pos, origPos]; |
| 319 | } |
| 320 | |
| 321 | var pos0; |
| 322 | if(hasPos0) { |
| 323 | pos0 = trace[posLetter + '0']; |
| 324 | } else if('name' in trace && ( |
| 325 | posAxis.type === 'category' || ( |
| 326 | isNumeric(trace.name) && |
| 327 | ['linear', 'log'].indexOf(posAxis.type) !== -1 |
| 328 | ) || ( |
| 329 | Lib.isDateTime(trace.name) && |
| 330 | posAxis.type === 'date' |
| 331 | ) |
| 332 | )) { |
| 333 | pos0 = trace.name; |
| 334 | } else { |
| 335 | pos0 = num; |
| 336 | } |
| 337 | |
| 338 | var pos0c = posAxis.type === 'multicategory' ? |
| 339 | posAxis.r2c_just_indices(pos0) : |
| 340 | posAxis.d2c(pos0, 0, trace[posLetter + 'calendar']); |
| 341 | |
| 342 | var len = trace._length; |
| 343 | var out = new Array(len); |
| 344 | for(var i = 0; i < len; i++) out[i] = pos0c; |
| 345 | |
| 346 | return [out]; |
| 347 | } |
| 348 | |
| 349 | function makeBins(x, dx) { |
| 350 | var len = x.length; |
no outgoing calls
no test coverage detected
searching dependent graphs…