observablehq / feedback

Customer submitted bugs and feature requests
42 stars 3 forks source link

Add FileAttachment().jsonl() support #546

Closed gisle closed 1 year ago

gisle commented 2 years ago

I would like to see support for new-line separated JSON, either by adding another method to FileAttachment() or by adding some option to the json() method.

For instance the Python Panadas library has implemented this with a lines = True option to their read_json() function.

My current ugly workaround is to add this to my Observable notebook:

data = FileAttachment("data.jsonl").text()
  .then(content => content.split("\n").filter(line => line).map(line => JSON.parse(line)))
mbostock commented 1 year ago

Folding into #545.