* Parse array of primitive values * @param {object} meta - dataset meta * @param {array} data - data array. Example [1,3,4] * @param {number} start - start index * @param {number} count - number of items to parse * @returns {object} parsed item - item containing index and a parsed value
(meta, data, start, count)
| 516 | * @protected |
| 517 | */ |
| 518 | parsePrimitiveData(meta, data, start, count) { |
| 519 | const {iScale, vScale} = meta; |
| 520 | const iAxis = iScale.axis; |
| 521 | const vAxis = vScale.axis; |
| 522 | const labels = iScale.getLabels(); |
| 523 | const singleScale = iScale === vScale; |
| 524 | const parsed = new Array(count); |
| 525 | let i, ilen, index; |
| 526 | |
| 527 | for (i = 0, ilen = count; i < ilen; ++i) { |
| 528 | index = i + start; |
| 529 | parsed[i] = { |
| 530 | [iAxis]: singleScale || iScale.parse(labels[index], index), |
| 531 | [vAxis]: vScale.parse(data[index], index) |
| 532 | }; |
| 533 | } |
| 534 | return parsed; |
| 535 | } |
| 536 | |
| 537 | /** |
| 538 | * Parse array of arrays |