Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/csv-data-loader/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# CSV Data Loader

This is a simple [Foxglove](http://foxglove.dev/) [extension](https://docs.foxglove.dev/docs/visualization/extensions) that loads a CSV file.
This is a simple [Foxglove](https://foxglove.dev/) [extension](https://docs.foxglove.dev/docs/visualization/extensions) that loads a CSV file.
The file must have a column called `timestamp_nanos` in order to be read.

## Building
Expand Down
2 changes: 1 addition & 1 deletion examples/csv-data-loader/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"@types/react": "18.3.12",
"@types/react-dom": "18.3.1",
"@types/wicg-file-system-access": "2023.10.6",
"create-foxglove-extension": "1.0.4",
"create-foxglove-extension": "1.0.5",
"eslint": "9.15.0",
"prettier": "3.3.3",
"react": "18.3.1",
Expand Down
6 changes: 5 additions & 1 deletion examples/csv-data-loader/rust/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ impl DataLoader for CsvDataLoader {
fn initialize(&mut self) -> Result<Initialization, Self::Error> {
let mut reader = csv::ReaderBuilder::new()
.has_headers(true)
.trim(csv::Trim::All)
.from_reader(reader::open(&self.path));

// Read the headers of the CSV and store them on the loader.
Expand Down Expand Up @@ -117,7 +118,10 @@ impl DataLoader for CsvDataLoader {
row_to_flush: Default::default(),
log_time_index: self.log_time_index,
requested_channel_id,
reader: csv::Reader::from_reader(Box::new(reader)),
reader: csv::ReaderBuilder::new()
.has_headers(false)
.trim(csv::Trim::All)
.from_reader(Box::new(reader)),
})
}
// If there is no byte offset (we've gone past the last timestamp), return empty iter
Expand Down
Loading