You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Returns a promise to the file’s contents, parsed as comma-separated values (CSV) into an array.
320
+
321
+
```js
322
+
constdata=awaitFileAttachment("cars.csv").csv();
323
+
```
324
+
325
+
If <i>array</i> is true, an array of arrays is returned; otherwise, the first row is assumed to be the header row and an array of objects is returned, and the returned array has a <i>data</i>.columns property that is an array of column names. (See <ahref="https://github.com/d3/d3-dsv/blob/master/README.md#dsv_parseRows">d3.csvParseRows</a>.) If <i>typed</i> is true, [automatic type inference](https://observablehq.com/@d3/d3-autotype) is applied; only use this feature if you know your data is compatible.
Returns a promise to the file’s contents, parsed as tab-separated values (TSV) into an array.
330
+
331
+
```js
332
+
constdata=awaitFileAttachment("cars.tsv").tsv();
333
+
```
334
+
335
+
If <i>array</i> is true, an array of arrays is returned; otherwise, the first row is assumed to be the header row and an array of objects is returned, and the returned array has a <i>data</i>.columns property that is an array of column names. (See <ahref="https://github.com/d3/d3-dsv/blob/master/README.md#dsv_parseRows">d3.tsvParseRows</a>.) If <i>typed</i> is true, [automatic type inference](https://observablehq.com/@d3/d3-autotype) is applied; only use this feature if you know your data is compatible.
Returns a promise to a file loaded as an [Image](https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/Image). The promise resolves when the image has finished loading, making this useful for reading the image pixels in Canvas, or for loading the image into a WebGL texture. Consider [*attachment*.url](#attachment_url) if you want to embed an image in HTML or Markdown.
0 commit comments