* 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)
| 500 | * @protected |
| 501 | */ |
| 502 | parsePrimitiveData(meta, data, start, count) { |
| 503 | const {iScale, vScale} = meta; |
| 504 | const iAxis = iScale.axis; |
| 505 | const vAxis = vScale.axis; |
| 506 | const labels = iScale.getLabels(); |
| 507 | const singleScale = iScale === vScale; |
| 508 | const parsed = new Array(count); |
| 509 | let i, ilen, index; |
| 510 | |
| 511 | for (i = 0, ilen = count; i < ilen; ++i) { |
| 512 | index = i + start; |
| 513 | parsed[i] = { |
| 514 | [iAxis]: singleScale || iScale.parse(labels[index], index), |
| 515 | [vAxis]: vScale.parse(data[index], index) |
| 516 | }; |
| 517 | } |
| 518 | return parsed; |
| 519 | } |
| 520 | |
| 521 | /** |
| 522 | * Parse array of arrays |