English
@eightkk/vue-weave / core / timelineFromCsvTable
Function: timelineFromCsvTable()
timelineFromCsvTable(
table,options):TimelineCsvImport
Defined in: src/core/interchangeCsv.ts:234
Read a table written by timelineCsvTable (for example from parseCsv) back into rows and bars. The table needs a bar, start and end column and a row or wbs column; progress is optional.
With a WBS column, each distinct code is a row with the ID row-<code>, the label of the first of its row cells that is not blank (or the code when there is none) and the row of the code without its last part as parent. A parent code that has no record of its own becomes a row labelled with its code. Without a WBS column, each distinct row label is a top-level row with the ID row-1, row-2, … in order of appearance. Rows are returned in tree preorder; sibling order follows the WBS numbers, or the order of appearance without WBS codes. Bars get the IDs bar-1, bar-2, … in record order, the label of their bar cell, the parsed start and end and, when the progress cell is not empty, the progress from 0 to 1. Records whose fields are all empty are skipped.
A custom header takes precedence over another column's default header. Throws an Error for missing or repeated columns, for two custom headers that are equal (ignoring case and surrounding white space) and an Error naming the line (the one-based record number, with the header on line 1) for an invalid WBS code, a RangeError for a WBS code of more than 1,000 levels, a time that parseTime cannot read, an end before the start and a progress that is not a plain decimal number from 0 to 1 (such as 0.5; not 0x1 or 1e0).
Parameters
table
readonly (readonly CsvCell[])[]