(meta: BarMeta, data: unknown[], start: number, count: number)
| 276 | } |
| 277 | |
| 278 | function parseArrayOrPrimitive(meta: BarMeta, data: unknown[], start: number, count: number): BarParsed[] { |
| 279 | const iScale = meta.iScale; |
| 280 | const vScale = meta.vScale; |
| 281 | const labels = iScale.getLabels(); |
| 282 | const singleScale = iScale === vScale; |
| 283 | const parsed: BarParsed[] = []; |
| 284 | let i: number, ilen: number, item: BarParsed, entry: unknown; |
| 285 | |
| 286 | for (i = start, ilen = start + count; i < ilen; ++i) { |
| 287 | entry = data[i]; |
| 288 | item = {}; |
| 289 | // With a single scale, `parseValue` overwrites this `true` with the parsed value. |
| 290 | item[iScale.axis] = (singleScale || iScale.parse(labels[i], i)) as number; |
| 291 | parsed.push(parseValue(entry, item, vScale, i)); |
| 292 | } |
| 293 | return parsed; |
| 294 | } |
| 295 | |
| 296 | function isFloatBar(custom: BarCustom | undefined) { |
| 297 | return custom && custom.barStart !== undefined && custom.barEnd !== undefined; |
no test coverage detected