Skip to content

FromCsvOptions

type FromCsvOptions = GrapherApiOptionsBase & {
  columnDefs?: OwidColumnDef[];
} & 
  | {
  csvUrl: string;
  csv?: never;
}
  | {
  csv: string;
  csvUrl?: never;
};

Options for GrapherLoader.fromCsv. Provide the CSV either inline (csv) or as a URL to fetch (csvUrl). It must have an entityName column and a year (or day) column, plus one or more value columns; entityCode and entityId columns are optional.

Type Declaration

Name Type Description
columnDefs? OwidColumnDef[] Column definitions — use these to specify types and display names for your value columns.