@hpcc-js/observablehq-compiler 1.4.0 → 1.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +43 -43
- package/README.md +105 -105
- package/bin/ojscc.mjs +73 -73
- package/dist/index.esm.js +301 -104
- package/dist/index.esm.js.map +1 -1
- package/dist/index.esm.min.js +2 -2
- package/dist/index.esm.min.js.map +1 -1
- package/dist/index.js +301 -104
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +2 -2
- package/dist/index.min.js.map +1 -1
- package/package.json +4 -4
- package/src/__package__.ts +3 -3
- package/src/__tests__/File Attachments.ts +894 -894
- package/src/__tests__/Introduction to Imports.ts +748 -748
- package/src/__tests__/Observable TimeChart.ts +771 -771
- package/src/__tests__/index.ts +13 -13
- package/src/__tests__/m1.mjs +3 -3
- package/src/__tests__/node.ts +199 -199
- package/src/compiler.md +234 -234
- package/src/compiler.ts +311 -311
- package/src/cst.ts +178 -178
- package/src/index.css +459 -459
- package/src/index.ts +6 -6
- package/src/util.md +113 -113
- package/src/util.ts +175 -175
- package/src/writer.ts +80 -80
- package/types/__package__.d.ts +2 -2
- package/types/util.d.ts.map +1 -1
- package/types-3.4/__package__.d.ts +2 -2
|
@@ -1,895 +1,895 @@
|
|
|
1
|
-
export const fa = {
|
|
2
|
-
"id": "9595fd1fad051f74",
|
|
3
|
-
"slug": "file-attachments",
|
|
4
|
-
"trashed": false,
|
|
5
|
-
"description": "",
|
|
6
|
-
"likes": 136,
|
|
7
|
-
"publish_level": "public",
|
|
8
|
-
"forks": 4,
|
|
9
|
-
"fork_of": null,
|
|
10
|
-
"update_time": "2022-05-26T15:58:17.291Z",
|
|
11
|
-
"publish_time": "2019-10-30T19:33:40.045Z",
|
|
12
|
-
"publish_version": 921,
|
|
13
|
-
"latest_version": 921,
|
|
14
|
-
"thumbnail": "9037f4259f5b5c119d6541a7176e348686caf51ffc9177f3378f27fe1bd72a26",
|
|
15
|
-
"default_thumbnail": "9037f4259f5b5c119d6541a7176e348686caf51ffc9177f3378f27fe1bd72a26",
|
|
16
|
-
"roles": [],
|
|
17
|
-
"sharing": null,
|
|
18
|
-
"owner": {
|
|
19
|
-
"id": "f35c755083683fe5",
|
|
20
|
-
"avatar_url": "https://avatars.observableusercontent.com/avatar/5a51c3b908225a581d20577e488e2aba8cbc9541c52982c638638c370c3e5e8e",
|
|
21
|
-
"login": "observablehq",
|
|
22
|
-
"name": "Observable",
|
|
23
|
-
"bio": "Use data to think, together.",
|
|
24
|
-
"home_url": "https://observablehq.com",
|
|
25
|
-
"type": "team",
|
|
26
|
-
"tier": "enterprise"
|
|
27
|
-
},
|
|
28
|
-
"creator": {
|
|
29
|
-
"id": "074c414ad1d825f5",
|
|
30
|
-
"github_login": "mbostock",
|
|
31
|
-
"avatar_url": "https://avatars.observableusercontent.com/avatar/82811927da99f8938001b2ef1f552ad2c47083e46ebc55a3a146a5a5848c4519",
|
|
32
|
-
"login": "mbostock",
|
|
33
|
-
"name": "Mike Bostock",
|
|
34
|
-
"bio": "Building a better computational medium. Founder @observablehq. Creator @d3. Former @nytgraphics. Pronounced BOSS-tock.",
|
|
35
|
-
"home_url": "https://bost.ocks.org/mike/",
|
|
36
|
-
"tier": "basic"
|
|
37
|
-
},
|
|
38
|
-
"authors": [],
|
|
39
|
-
"collections": [
|
|
40
|
-
{
|
|
41
|
-
"id": "69718aa29ac11e6c",
|
|
42
|
-
"type": "public",
|
|
43
|
-
"slug": "getting-data-in-and-out",
|
|
44
|
-
"title": "Getting data in and out",
|
|
45
|
-
"description": "Whether your data is hosted on the web, stored in a database, or saved in a local file, you can access it from Observable with these techniques.",
|
|
46
|
-
"update_time": "2022-08-31T16:06:06.501Z",
|
|
47
|
-
"pinned": false,
|
|
48
|
-
"ordered": true,
|
|
49
|
-
"custom_thumbnail": null,
|
|
50
|
-
"default_thumbnail": "77670bac9d0356f169c353a0213f553d00e74c3be57c8114c526148adcb45abc",
|
|
51
|
-
"thumbnail": "77670bac9d0356f169c353a0213f553d00e74c3be57c8114c526148adcb45abc",
|
|
52
|
-
"listing_count": 17,
|
|
53
|
-
"parent_collection_count": 1,
|
|
54
|
-
"owner": {
|
|
55
|
-
"id": "f35c755083683fe5",
|
|
56
|
-
"avatar_url": "https://avatars.observableusercontent.com/avatar/5a51c3b908225a581d20577e488e2aba8cbc9541c52982c638638c370c3e5e8e",
|
|
57
|
-
"login": "observablehq",
|
|
58
|
-
"name": "Observable",
|
|
59
|
-
"bio": "Use data to think, together.",
|
|
60
|
-
"home_url": "https://observablehq.com",
|
|
61
|
-
"type": "team",
|
|
62
|
-
"tier": "enterprise"
|
|
63
|
-
}
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
"id": "0b7a49725d3ab0c0",
|
|
67
|
-
"type": "public",
|
|
68
|
-
"slug": "introduction",
|
|
69
|
-
"title": "Introduction",
|
|
70
|
-
"description": "Welcome to Observable! Get started with these tutorials.",
|
|
71
|
-
"update_time": "2019-05-06T19:48:56.772Z",
|
|
72
|
-
"pinned": true,
|
|
73
|
-
"ordered": false,
|
|
74
|
-
"custom_thumbnail": "d0ff809470432afdb2269a0e1a572a12d617f2d91aa07fca5ec6fdf13e4a1a9d",
|
|
75
|
-
"default_thumbnail": "04435c346f534d9f1d0b22f03a9b2ab313891893d0dccc956d6530f60f22c081",
|
|
76
|
-
"thumbnail": "d0ff809470432afdb2269a0e1a572a12d617f2d91aa07fca5ec6fdf13e4a1a9d",
|
|
77
|
-
"listing_count": 33,
|
|
78
|
-
"parent_collection_count": 1,
|
|
79
|
-
"owner": {
|
|
80
|
-
"id": "f35c755083683fe5",
|
|
81
|
-
"avatar_url": "https://avatars.observableusercontent.com/avatar/5a51c3b908225a581d20577e488e2aba8cbc9541c52982c638638c370c3e5e8e",
|
|
82
|
-
"login": "observablehq",
|
|
83
|
-
"name": "Observable",
|
|
84
|
-
"bio": "Use data to think, together.",
|
|
85
|
-
"home_url": "https://observablehq.com",
|
|
86
|
-
"type": "team",
|
|
87
|
-
"tier": "enterprise"
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
],
|
|
91
|
-
"files": [
|
|
92
|
-
{
|
|
93
|
-
"id": "64d21082dcd00f21843ac22313ce443c1faa36a462afdb3c063f7cadea1c5d22a959c4aa3e89db2d7ecf2533689e0cf63659dc4058774654aae62049ecbaa940",
|
|
94
|
-
"url": "https://static.observableusercontent.com/files/64d21082dcd00f21843ac22313ce443c1faa36a462afdb3c063f7cadea1c5d22a959c4aa3e89db2d7ecf2533689e0cf63659dc4058774654aae62049ecbaa940",
|
|
95
|
-
"download_url": "https://static.observableusercontent.com/files/64d21082dcd00f21843ac22313ce443c1faa36a462afdb3c063f7cadea1c5d22a959c4aa3e89db2d7ecf2533689e0cf63659dc4058774654aae62049ecbaa940?response-content-disposition=attachment%3Bfilename*%3DUTF-8%27%27national-archive.jpg",
|
|
96
|
-
"name": "national-archive.jpg",
|
|
97
|
-
"create_time": "2019-10-29T20:46:51.853Z",
|
|
98
|
-
"status": "public",
|
|
99
|
-
"size": 409265,
|
|
100
|
-
"mime_type": "image/jpeg",
|
|
101
|
-
"content_encoding": null
|
|
102
|
-
},
|
|
103
|
-
{
|
|
104
|
-
"id": "86ff47388d832e549c0661861f8107e4e65187de3333abf70f940359eac7810c611eebb7511565264f4b8b001229fd9a6832a21a421c6be3623ccbd97cbf5737",
|
|
105
|
-
"url": "https://static.observableusercontent.com/files/86ff47388d832e549c0661861f8107e4e65187de3333abf70f940359eac7810c611eebb7511565264f4b8b001229fd9a6832a21a421c6be3623ccbd97cbf5737",
|
|
106
|
-
"download_url": "https://static.observableusercontent.com/files/86ff47388d832e549c0661861f8107e4e65187de3333abf70f940359eac7810c611eebb7511565264f4b8b001229fd9a6832a21a421c6be3623ccbd97cbf5737?response-content-disposition=attachment%3Bfilename*%3DUTF-8%27%27example.json",
|
|
107
|
-
"name": "example.json",
|
|
108
|
-
"create_time": "2019-10-29T20:47:55.713Z",
|
|
109
|
-
"status": "public",
|
|
110
|
-
"size": 53,
|
|
111
|
-
"mime_type": null,
|
|
112
|
-
"content_encoding": null
|
|
113
|
-
},
|
|
114
|
-
{
|
|
115
|
-
"id": "09f63bb9ff086fef80717e2ea8c974f918a996d2bfa3d8773d3ae12753942c002d0dfab833d7bee1e0c9cd358cd3578c1cd0f9435595e76901508adc3964bbdc",
|
|
116
|
-
"url": "https://static.observableusercontent.com/files/09f63bb9ff086fef80717e2ea8c974f918a996d2bfa3d8773d3ae12753942c002d0dfab833d7bee1e0c9cd358cd3578c1cd0f9435595e76901508adc3964bbdc",
|
|
117
|
-
"download_url": "https://static.observableusercontent.com/files/09f63bb9ff086fef80717e2ea8c974f918a996d2bfa3d8773d3ae12753942c002d0dfab833d7bee1e0c9cd358cd3578c1cd0f9435595e76901508adc3964bbdc?response-content-disposition=attachment%3Bfilename*%3DUTF-8%27%27example.csv",
|
|
118
|
-
"name": "example.csv",
|
|
119
|
-
"create_time": "2019-10-29T20:49:59.156Z",
|
|
120
|
-
"status": "public",
|
|
121
|
-
"size": 275,
|
|
122
|
-
"mime_type": null,
|
|
123
|
-
"content_encoding": "gzip"
|
|
124
|
-
},
|
|
125
|
-
{
|
|
126
|
-
"id": "a86c4f95f3ec10fd2d13544ecf6bdf49ae25066ba2e8b2ca96fddd0a831c09cd2ac0ffb441e2e6db6258648fbe267b413d71937c17b4a0d80e1822d99ba2fb0a",
|
|
127
|
-
"url": "https://static.observableusercontent.com/files/a86c4f95f3ec10fd2d13544ecf6bdf49ae25066ba2e8b2ca96fddd0a831c09cd2ac0ffb441e2e6db6258648fbe267b413d71937c17b4a0d80e1822d99ba2fb0a",
|
|
128
|
-
"download_url": "https://static.observableusercontent.com/files/a86c4f95f3ec10fd2d13544ecf6bdf49ae25066ba2e8b2ca96fddd0a831c09cd2ac0ffb441e2e6db6258648fbe267b413d71937c17b4a0d80e1822d99ba2fb0a?response-content-disposition=attachment%3Bfilename*%3DUTF-8%27%27example.png",
|
|
129
|
-
"name": "example.png",
|
|
130
|
-
"create_time": "2019-10-29T20:52:52.807Z",
|
|
131
|
-
"status": "public",
|
|
132
|
-
"size": 126867,
|
|
133
|
-
"mime_type": "image/png",
|
|
134
|
-
"content_encoding": null
|
|
135
|
-
},
|
|
136
|
-
{
|
|
137
|
-
"id": "e2a5a0ac299b53fc1016e082c7c0732d50d0dc9388d8b99adadeee40d6d1c856991c15698dcdf582a6827b411ba6d470bf7a6d28426fb8bc1cd7cc28f17199bd",
|
|
138
|
-
"url": "https://static.observableusercontent.com/files/e2a5a0ac299b53fc1016e082c7c0732d50d0dc9388d8b99adadeee40d6d1c856991c15698dcdf582a6827b411ba6d470bf7a6d28426fb8bc1cd7cc28f17199bd",
|
|
139
|
-
"download_url": "https://static.observableusercontent.com/files/e2a5a0ac299b53fc1016e082c7c0732d50d0dc9388d8b99adadeee40d6d1c856991c15698dcdf582a6827b411ba6d470bf7a6d28426fb8bc1cd7cc28f17199bd?response-content-disposition=attachment%3Bfilename*%3DUTF-8%27%27the-persistence-of-memory.jpg",
|
|
140
|
-
"name": "the-persistence-of-memory.jpg",
|
|
141
|
-
"create_time": "2019-10-29T20:55:47.964Z",
|
|
142
|
-
"status": "public",
|
|
143
|
-
"size": 179013,
|
|
144
|
-
"mime_type": "image/jpeg",
|
|
145
|
-
"content_encoding": null
|
|
146
|
-
},
|
|
147
|
-
{
|
|
148
|
-
"id": "1bc7c60612fed26b5376e8648f66b956192d6698e532730c148ea00491a6ff0122dc5cdf605f8d6ae209c4547176c2da042296b7665f4ace4eabda3d4500762c",
|
|
149
|
-
"url": "https://static.observableusercontent.com/files/1bc7c60612fed26b5376e8648f66b956192d6698e532730c148ea00491a6ff0122dc5cdf605f8d6ae209c4547176c2da042296b7665f4ace4eabda3d4500762c",
|
|
150
|
-
"download_url": "https://static.observableusercontent.com/files/1bc7c60612fed26b5376e8648f66b956192d6698e532730c148ea00491a6ff0122dc5cdf605f8d6ae209c4547176c2da042296b7665f4ace4eabda3d4500762c?response-content-disposition=attachment%3Bfilename*%3DUTF-8%27%27example.shp",
|
|
151
|
-
"name": "example.shp",
|
|
152
|
-
"create_time": "2019-10-29T21:03:21.081Z",
|
|
153
|
-
"status": "public",
|
|
154
|
-
"size": 498480,
|
|
155
|
-
"mime_type": null,
|
|
156
|
-
"content_encoding": "gzip"
|
|
157
|
-
},
|
|
158
|
-
{
|
|
159
|
-
"id": "1a485a6468d79a87fe0794e1119dee719716ec2b2f91d26e04e88bc3faa739c11fca8cd3d85d2e525c4ed936a6f7b9bc1b530c4fa00df82a82fc63525ca17d9e",
|
|
160
|
-
"url": "https://static.observableusercontent.com/files/1a485a6468d79a87fe0794e1119dee719716ec2b2f91d26e04e88bc3faa739c11fca8cd3d85d2e525c4ed936a6f7b9bc1b530c4fa00df82a82fc63525ca17d9e",
|
|
161
|
-
"download_url": "https://static.observableusercontent.com/files/1a485a6468d79a87fe0794e1119dee719716ec2b2f91d26e04e88bc3faa739c11fca8cd3d85d2e525c4ed936a6f7b9bc1b530c4fa00df82a82fc63525ca17d9e?response-content-disposition=attachment%3Bfilename*%3DUTF-8%27%27example.pdf",
|
|
162
|
-
"name": "example.pdf",
|
|
163
|
-
"create_time": "2019-10-29T21:05:27.867Z",
|
|
164
|
-
"status": "public",
|
|
165
|
-
"size": 27483,
|
|
166
|
-
"mime_type": "application/pdf",
|
|
167
|
-
"content_encoding": null
|
|
168
|
-
},
|
|
169
|
-
{
|
|
170
|
-
"id": "880426472f67ca25f8401c05e8c10466a3709a8870275b28a1fb5aebe9ec234a20cd651273434438b98d5aa0a6d18221ab155dccbe133c9453bde00537ab29a8",
|
|
171
|
-
"url": "https://static.observableusercontent.com/files/880426472f67ca25f8401c05e8c10466a3709a8870275b28a1fb5aebe9ec234a20cd651273434438b98d5aa0a6d18221ab155dccbe133c9453bde00537ab29a8",
|
|
172
|
-
"download_url": "https://static.observableusercontent.com/files/880426472f67ca25f8401c05e8c10466a3709a8870275b28a1fb5aebe9ec234a20cd651273434438b98d5aa0a6d18221ab155dccbe133c9453bde00537ab29a8?response-content-disposition=attachment%3Bfilename*%3DUTF-8%27%27Dog_Photos%25402.zip",
|
|
173
|
-
"name": "Dog_Photos@2.zip",
|
|
174
|
-
"create_time": "2021-07-08T22:52:57.591Z",
|
|
175
|
-
"status": "public",
|
|
176
|
-
"size": 516016,
|
|
177
|
-
"mime_type": "application/zip",
|
|
178
|
-
"content_encoding": null
|
|
179
|
-
},
|
|
180
|
-
{
|
|
181
|
-
"id": "036293060a3d1be9b3ad33fca12dbd546157c3a20cbc2dcee6400a04c4e26b407d247697c0b5a6b23c9c03d263698913e9f5055b1c3fa2cfe6fc1826ec8c7ad0",
|
|
182
|
-
"url": "https://static.observableusercontent.com/files/036293060a3d1be9b3ad33fca12dbd546157c3a20cbc2dcee6400a04c4e26b407d247697c0b5a6b23c9c03d263698913e9f5055b1c3fa2cfe6fc1826ec8c7ad0",
|
|
183
|
-
"download_url": "https://static.observableusercontent.com/files/036293060a3d1be9b3ad33fca12dbd546157c3a20cbc2dcee6400a04c4e26b407d247697c0b5a6b23c9c03d263698913e9f5055b1c3fa2cfe6fc1826ec8c7ad0?response-content-disposition=attachment%3Bfilename*%3DUTF-8%27%27Laser_Report_2020.xlsx",
|
|
184
|
-
"name": "Laser_Report_2020.xlsx",
|
|
185
|
-
"create_time": "2021-09-29T17:37:48.589Z",
|
|
186
|
-
"status": "public",
|
|
187
|
-
"size": 462969,
|
|
188
|
-
"mime_type": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
189
|
-
"content_encoding": null
|
|
190
|
-
},
|
|
191
|
-
{
|
|
192
|
-
"id": "f4fd5c681574c1ff7050d59fd5fa64f7bc30d28763a6246afa5786d07181a34c07ddc47f614ce00669b69c09aabdbe77fbada74d9c06a590e8712cf19a95c1c3",
|
|
193
|
-
"url": "https://static.observableusercontent.com/files/f4fd5c681574c1ff7050d59fd5fa64f7bc30d28763a6246afa5786d07181a34c07ddc47f614ce00669b69c09aabdbe77fbada74d9c06a590e8712cf19a95c1c3",
|
|
194
|
-
"download_url": "https://static.observableusercontent.com/files/f4fd5c681574c1ff7050d59fd5fa64f7bc30d28763a6246afa5786d07181a34c07ddc47f614ce00669b69c09aabdbe77fbada74d9c06a590e8712cf19a95c1c3?response-content-disposition=attachment%3Bfilename*%3DUTF-8%27%27sp500.csv",
|
|
195
|
-
"name": "sp500.csv",
|
|
196
|
-
"create_time": "2022-05-26T15:56:43.731Z",
|
|
197
|
-
"status": "public",
|
|
198
|
-
"size": 10213,
|
|
199
|
-
"mime_type": "text/csv",
|
|
200
|
-
"content_encoding": "gzip"
|
|
201
|
-
}
|
|
202
|
-
],
|
|
203
|
-
"comments": [
|
|
204
|
-
{
|
|
205
|
-
"id": "a21858fb6d91ae2a",
|
|
206
|
-
"content": "How does the storage of file attachment works? Are they hosted in your servers? And by which data protection terms does this hosting abide?\n\nThanks in advance!",
|
|
207
|
-
"node_id": 9,
|
|
208
|
-
"create_time": "2022-09-09T17:08:37.467Z",
|
|
209
|
-
"update_time": null,
|
|
210
|
-
"resolved": false,
|
|
211
|
-
"user": {
|
|
212
|
-
"id": "d8cc07084b6bff9b",
|
|
213
|
-
"github_login": null,
|
|
214
|
-
"avatar_url": "https://avatars.observableusercontent.com/avatar/13c54021cc6aaa6440efde3bfb263ecbb4c4690dc6d5889d38d969a887723424",
|
|
215
|
-
"login": "cpinto",
|
|
216
|
-
"name": "Carlos Alberto Duarte Pinto",
|
|
217
|
-
"bio": "",
|
|
218
|
-
"home_url": "",
|
|
219
|
-
"tier": "basic"
|
|
220
|
-
}
|
|
221
|
-
},
|
|
222
|
-
{
|
|
223
|
-
"id": "5244d817c44793f9",
|
|
224
|
-
"content": "They are hosted on our servers. You can read more here: https://static.observablehq.com/assets/pdfs/Security+FAQ.pdf",
|
|
225
|
-
"node_id": 9,
|
|
226
|
-
"create_time": "2022-09-09T21:46:52.331Z",
|
|
227
|
-
"update_time": null,
|
|
228
|
-
"resolved": false,
|
|
229
|
-
"user": {
|
|
230
|
-
"id": "c1daf2951ad616fb",
|
|
231
|
-
"github_login": null,
|
|
232
|
-
"avatar_url": "https://avatars.observableusercontent.com/avatar/4a17a065d7a0f5f9a64a852f7b26a4f875c2ff69eb17264c3bd9f81e69285c05",
|
|
233
|
-
"login": "cobus",
|
|
234
|
-
"name": "Cobus Theunissen",
|
|
235
|
-
"bio": "",
|
|
236
|
-
"home_url": "",
|
|
237
|
-
"tier": "basic"
|
|
238
|
-
}
|
|
239
|
-
},
|
|
240
|
-
{
|
|
241
|
-
"id": "0a468b8f6b27d9d0",
|
|
242
|
-
"content": "Hi, I notice that File Attachments now support zip. It's awesome! No need to import Fil's @fil/jszip! I figure out how to use it, but I notice that there is no official documentation. It might be helpful for other users to find some references here. I'd be happy to contribute if that's the case!",
|
|
243
|
-
"node_id": 22,
|
|
244
|
-
"create_time": "2021-06-29T04:43:03.350Z",
|
|
245
|
-
"update_time": null,
|
|
246
|
-
"resolved": true,
|
|
247
|
-
"user": {
|
|
248
|
-
"id": "06bc2aaa9d8c4a54",
|
|
249
|
-
"github_login": "radames",
|
|
250
|
-
"avatar_url": "https://avatars.observableusercontent.com/avatar/7e61199ed2efe90aec8d897ac8b17a3fd0a129bff12a46a4048ddd0f73a2c43e",
|
|
251
|
-
"login": "radames",
|
|
252
|
-
"name": "Radamés Ajna",
|
|
253
|
-
"bio": "Engineering @huggingface 🤗. Data visualization enthusiast. Creative technologist. Open for collaborations.",
|
|
254
|
-
"home_url": "https://twitter.com/radamar",
|
|
255
|
-
"tier": "basic"
|
|
256
|
-
}
|
|
257
|
-
},
|
|
258
|
-
{
|
|
259
|
-
"id": "76662b539cb35668",
|
|
260
|
-
"content": "documentation is coming :)",
|
|
261
|
-
"node_id": 22,
|
|
262
|
-
"create_time": "2021-06-29T09:08:13.771Z",
|
|
263
|
-
"update_time": null,
|
|
264
|
-
"resolved": true,
|
|
265
|
-
"user": {
|
|
266
|
-
"id": "45a379fcfcb14253",
|
|
267
|
-
"github_login": "Fil",
|
|
268
|
-
"avatar_url": "https://avatars.observableusercontent.com/avatar/9cf371db2e1a2b4ed5f4a9783b6954cf7aeb2a88c56d4054c96ef360cf85ef89",
|
|
269
|
-
"login": "fil",
|
|
270
|
-
"name": "Fil",
|
|
271
|
-
"bio": "Vocateur.",
|
|
272
|
-
"home_url": "https://visionscarto.net/",
|
|
273
|
-
"tier": "basic"
|
|
274
|
-
}
|
|
275
|
-
},
|
|
276
|
-
{
|
|
277
|
-
"id": "9e1d9d6bb24de06a",
|
|
278
|
-
"content": "hi @fil thanks! The stlib with zip is very convenient!",
|
|
279
|
-
"node_id": 22,
|
|
280
|
-
"create_time": "2021-06-29T17:48:06.338Z",
|
|
281
|
-
"update_time": null,
|
|
282
|
-
"resolved": true,
|
|
283
|
-
"user": {
|
|
284
|
-
"id": "06bc2aaa9d8c4a54",
|
|
285
|
-
"github_login": "radames",
|
|
286
|
-
"avatar_url": "https://avatars.observableusercontent.com/avatar/7e61199ed2efe90aec8d897ac8b17a3fd0a129bff12a46a4048ddd0f73a2c43e",
|
|
287
|
-
"login": "radames",
|
|
288
|
-
"name": "Radamés Ajna",
|
|
289
|
-
"bio": "Engineering @huggingface 🤗. Data visualization enthusiast. Creative technologist. Open for collaborations.",
|
|
290
|
-
"home_url": "https://twitter.com/radamar",
|
|
291
|
-
"tier": "basic"
|
|
292
|
-
}
|
|
293
|
-
},
|
|
294
|
-
{
|
|
295
|
-
"id": "008d1ba1889409e1",
|
|
296
|
-
"content": ".zip() is now documented at https://observablehq.com/@observablehq/fileattachment-zip ; enjoy!",
|
|
297
|
-
"node_id": 22,
|
|
298
|
-
"create_time": "2021-07-09T06:58:24.818Z",
|
|
299
|
-
"update_time": null,
|
|
300
|
-
"resolved": true,
|
|
301
|
-
"user": {
|
|
302
|
-
"id": "45a379fcfcb14253",
|
|
303
|
-
"github_login": "Fil",
|
|
304
|
-
"avatar_url": "https://avatars.observableusercontent.com/avatar/9cf371db2e1a2b4ed5f4a9783b6954cf7aeb2a88c56d4054c96ef360cf85ef89",
|
|
305
|
-
"login": "fil",
|
|
306
|
-
"name": "Fil",
|
|
307
|
-
"bio": "Vocateur.",
|
|
308
|
-
"home_url": "https://visionscarto.net/",
|
|
309
|
-
"tier": "basic"
|
|
310
|
-
}
|
|
311
|
-
},
|
|
312
|
-
{
|
|
313
|
-
"id": "5176612370006d0d",
|
|
314
|
-
"content": "Noteworthy here too that you may pass in size parameters: e.g., `FileAttachment(...).image({ width: 400 })`",
|
|
315
|
-
"node_id": 42,
|
|
316
|
-
"create_time": "2021-11-20T11:43:36.468Z",
|
|
317
|
-
"update_time": null,
|
|
318
|
-
"resolved": false,
|
|
319
|
-
"user": {
|
|
320
|
-
"id": "a7fa3027921865cf",
|
|
321
|
-
"github_login": "aaronkyle",
|
|
322
|
-
"avatar_url": "https://avatars.observableusercontent.com/avatar/eb6d0b32ccc6c8febbf105ce4d2a938819bcbd1c6a2c108d3a9c01745d3590f2",
|
|
323
|
-
"login": "aaronkyle",
|
|
324
|
-
"name": "Aaron Kyle Dennis",
|
|
325
|
-
"bio": "Social development practitioner. Trying to understand our world.",
|
|
326
|
-
"home_url": "http://categori.se",
|
|
327
|
-
"tier": "basic"
|
|
328
|
-
}
|
|
329
|
-
},
|
|
330
|
-
{
|
|
331
|
-
"id": "77017a655c4fa6ba",
|
|
332
|
-
"content": "How can I replace a file (file.csv) with a newer file by the same name (file.csv)? I don't want a \"file@1.csv\" for the new filename.",
|
|
333
|
-
"node_id": 211,
|
|
334
|
-
"create_time": "2020-11-10T18:55:48.124Z",
|
|
335
|
-
"update_time": null,
|
|
336
|
-
"resolved": true,
|
|
337
|
-
"user": {
|
|
338
|
-
"id": "c3c578ac75ecd7ae",
|
|
339
|
-
"github_login": "tasqon",
|
|
340
|
-
"avatar_url": "https://avatars.observableusercontent.com/avatar/dab14efb29e9241cb3cff16322964a4872da606ae3617dbe323040826d85e664",
|
|
341
|
-
"login": "tasqon",
|
|
342
|
-
"name": "daktari",
|
|
343
|
-
"bio": "",
|
|
344
|
-
"home_url": "http://www.tasqon.com",
|
|
345
|
-
"tier": "basic"
|
|
346
|
-
}
|
|
347
|
-
},
|
|
348
|
-
{
|
|
349
|
-
"id": "dc86bb84d45ae91b",
|
|
350
|
-
"content": "You can’t; files are immutable, so the replacement file must have a new name. That said, you can name your file like “file-20201101.csv” before uploading if you’d prefer to a different unique rather than the auto-generated “file@1.csv”.",
|
|
351
|
-
"node_id": 211,
|
|
352
|
-
"create_time": "2020-11-10T20:30:14.871Z",
|
|
353
|
-
"update_time": null,
|
|
354
|
-
"resolved": true,
|
|
355
|
-
"user": {
|
|
356
|
-
"id": "074c414ad1d825f5",
|
|
357
|
-
"github_login": "mbostock",
|
|
358
|
-
"avatar_url": "https://avatars.observableusercontent.com/avatar/82811927da99f8938001b2ef1f552ad2c47083e46ebc55a3a146a5a5848c4519",
|
|
359
|
-
"login": "mbostock",
|
|
360
|
-
"name": "Mike Bostock",
|
|
361
|
-
"bio": "Building a better computational medium. Founder @observablehq. Creator @d3. Former @nytgraphics. Pronounced BOSS-tock.",
|
|
362
|
-
"home_url": "https://bost.ocks.org/mike/",
|
|
363
|
-
"tier": "basic"
|
|
364
|
-
}
|
|
365
|
-
},
|
|
366
|
-
{
|
|
367
|
-
"id": "bc5013b6160cf232",
|
|
368
|
-
"content": "I understand but I need to keep the file name unchanged. Since I only want replace the content of the file and not touch any code line. To have at least a workaround I fork my notebook, delete the file, fork again and upload the new file.",
|
|
369
|
-
"node_id": 211,
|
|
370
|
-
"create_time": "2020-11-10T20:59:04.379Z",
|
|
371
|
-
"update_time": null,
|
|
372
|
-
"resolved": true,
|
|
373
|
-
"user": {
|
|
374
|
-
"id": "c3c578ac75ecd7ae",
|
|
375
|
-
"github_login": "tasqon",
|
|
376
|
-
"avatar_url": "https://avatars.observableusercontent.com/avatar/dab14efb29e9241cb3cff16322964a4872da606ae3617dbe323040826d85e664",
|
|
377
|
-
"login": "tasqon",
|
|
378
|
-
"name": "daktari",
|
|
379
|
-
"bio": "",
|
|
380
|
-
"home_url": "http://www.tasqon.com",
|
|
381
|
-
"tier": "basic"
|
|
382
|
-
}
|
|
383
|
-
},
|
|
384
|
-
{
|
|
385
|
-
"id": "ebf14ab5e26698db",
|
|
386
|
-
"content": "If you use the “replace file” feature, all references to the old file will be replaced with references to the new file automatically.",
|
|
387
|
-
"node_id": 211,
|
|
388
|
-
"create_time": "2020-11-10T22:59:31.341Z",
|
|
389
|
-
"update_time": null,
|
|
390
|
-
"resolved": true,
|
|
391
|
-
"user": {
|
|
392
|
-
"id": "074c414ad1d825f5",
|
|
393
|
-
"github_login": "mbostock",
|
|
394
|
-
"avatar_url": "https://avatars.observableusercontent.com/avatar/82811927da99f8938001b2ef1f552ad2c47083e46ebc55a3a146a5a5848c4519",
|
|
395
|
-
"login": "mbostock",
|
|
396
|
-
"name": "Mike Bostock",
|
|
397
|
-
"bio": "Building a better computational medium. Founder @observablehq. Creator @d3. Former @nytgraphics. Pronounced BOSS-tock.",
|
|
398
|
-
"home_url": "https://bost.ocks.org/mike/",
|
|
399
|
-
"tier": "basic"
|
|
400
|
-
}
|
|
401
|
-
},
|
|
402
|
-
{
|
|
403
|
-
"id": "ea1a5704498af903",
|
|
404
|
-
"content": "What happens to file attachments when I export? I tried to export a notebook with attached images, but the files did not show up in the resulting tar file and the notebook broke...",
|
|
405
|
-
"node_id": 260,
|
|
406
|
-
"create_time": "2021-05-23T02:39:33.024Z",
|
|
407
|
-
"update_time": null,
|
|
408
|
-
"resolved": true,
|
|
409
|
-
"user": {
|
|
410
|
-
"id": "b8d79ca293134247",
|
|
411
|
-
"github_login": "triptych",
|
|
412
|
-
"avatar_url": "https://avatars.observableusercontent.com/avatar/84b4215a79a8f07f1610f6650183c4793985ecf13ed3af2944962bee15c46c2e",
|
|
413
|
-
"login": "triptych",
|
|
414
|
-
"name": "Andrew Wooldridge",
|
|
415
|
-
"bio": "📜JavaScript developer. \n\n🐲RPG fan. \n\n📚Storyteller and 🕹game developer. \n\n👨Father and Husband.",
|
|
416
|
-
"home_url": "http://andreww.xyz",
|
|
417
|
-
"tier": "basic"
|
|
418
|
-
}
|
|
419
|
-
},
|
|
420
|
-
{
|
|
421
|
-
"id": "aab4dde70dd322ed",
|
|
422
|
-
"content": "It seems like 7zip on Windows struggles with our tar.gz files; see Andrew's forum thread here: https://talk.observablehq.com/t/exporting-with-file-attachments/5094. We'll look into whether that's a bug we can fix or if we should offer a .zip download too.",
|
|
423
|
-
"node_id": 260,
|
|
424
|
-
"create_time": "2021-05-25T21:48:08.716Z",
|
|
425
|
-
"update_time": null,
|
|
426
|
-
"resolved": true,
|
|
427
|
-
"user": {
|
|
428
|
-
"id": "0bb2842b01e0c652",
|
|
429
|
-
"github_login": "tophtucker",
|
|
430
|
-
"avatar_url": "https://avatars.observableusercontent.com/avatar/3706c31a8f9c59bb716c022c04b9c073144cd1368b78ac85f49139be6c93c34e",
|
|
431
|
-
"login": "tophtucker",
|
|
432
|
-
"name": "Toph Tucker",
|
|
433
|
-
"bio": "",
|
|
434
|
-
"home_url": "https://tophtucker.com",
|
|
435
|
-
"tier": "basic"
|
|
436
|
-
}
|
|
437
|
-
},
|
|
438
|
-
{
|
|
439
|
-
"id": "f6b0b9748479c786",
|
|
440
|
-
"content": "What is `well-typed CSV` ? Is there a spec that describes how to specify CSV column types?",
|
|
441
|
-
"node_id": 417,
|
|
442
|
-
"create_time": "2021-08-01T05:18:30.715Z",
|
|
443
|
-
"update_time": null,
|
|
444
|
-
"resolved": true,
|
|
445
|
-
"user": {
|
|
446
|
-
"id": "d88a810c493f2e55",
|
|
447
|
-
"github_login": "abitrolly",
|
|
448
|
-
"avatar_url": "https://avatars.observableusercontent.com/avatar/2f343abb5b012a4f26ec5ddf4f3b27e3a604c9e61f196dc6634e49da57892fa1",
|
|
449
|
-
"login": "abitrolly",
|
|
450
|
-
"name": "Anatoli Babenia",
|
|
451
|
-
"bio": "Cyberspace. Doughnut Economics. SustainOSS.\r\n\r\nanatoli@rainforce.org",
|
|
452
|
-
"home_url": "https://github.com/abitrolly/abitrolly.github.io#readme",
|
|
453
|
-
"tier": "basic"
|
|
454
|
-
}
|
|
455
|
-
},
|
|
456
|
-
{
|
|
457
|
-
"id": "06f409cc65043e6d",
|
|
458
|
-
"content": "Defined here: https://github.com/d3/d3-dsv/blob/main/README.md#autoType",
|
|
459
|
-
"node_id": 417,
|
|
460
|
-
"create_time": "2021-08-01T18:42:07.374Z",
|
|
461
|
-
"update_time": null,
|
|
462
|
-
"resolved": true,
|
|
463
|
-
"user": {
|
|
464
|
-
"id": "074c414ad1d825f5",
|
|
465
|
-
"github_login": "mbostock",
|
|
466
|
-
"avatar_url": "https://avatars.observableusercontent.com/avatar/82811927da99f8938001b2ef1f552ad2c47083e46ebc55a3a146a5a5848c4519",
|
|
467
|
-
"login": "mbostock",
|
|
468
|
-
"name": "Mike Bostock",
|
|
469
|
-
"bio": "Building a better computational medium. Founder @observablehq. Creator @d3. Former @nytgraphics. Pronounced BOSS-tock.",
|
|
470
|
-
"home_url": "https://bost.ocks.org/mike/",
|
|
471
|
-
"tier": "basic"
|
|
472
|
-
}
|
|
473
|
-
},
|
|
474
|
-
{
|
|
475
|
-
"id": "ee10b8d49c389e2c",
|
|
476
|
-
"content": "It still doesn't explain what a well-typed CSV is.\n\nFor me `.csv({autotype: true})` would be more readable than `.csv({typed: true})`, because there is no such thing as a typed CSV. It might be a bit too late to rename it though.",
|
|
477
|
-
"node_id": 417,
|
|
478
|
-
"create_time": "2021-08-02T10:16:31.219Z",
|
|
479
|
-
"update_time": null,
|
|
480
|
-
"resolved": true,
|
|
481
|
-
"user": {
|
|
482
|
-
"id": "d88a810c493f2e55",
|
|
483
|
-
"github_login": "abitrolly",
|
|
484
|
-
"avatar_url": "https://avatars.observableusercontent.com/avatar/2f343abb5b012a4f26ec5ddf4f3b27e3a604c9e61f196dc6634e49da57892fa1",
|
|
485
|
-
"login": "abitrolly",
|
|
486
|
-
"name": "Anatoli Babenia",
|
|
487
|
-
"bio": "Cyberspace. Doughnut Economics. SustainOSS.\r\n\r\nanatoli@rainforce.org",
|
|
488
|
-
"home_url": "https://github.com/abitrolly/abitrolly.github.io#readme",
|
|
489
|
-
"tier": "basic"
|
|
490
|
-
}
|
|
491
|
-
}
|
|
492
|
-
],
|
|
493
|
-
"commenting_lock": null,
|
|
494
|
-
"suggestion_from": null,
|
|
495
|
-
"suggestions_to": [],
|
|
496
|
-
"version": 921,
|
|
497
|
-
"title": "File Attachments",
|
|
498
|
-
"license": null,
|
|
499
|
-
"copyright": "",
|
|
500
|
-
"nodes": [
|
|
501
|
-
{
|
|
502
|
-
"id": 260,
|
|
503
|
-
"value": "# File Attachments\n\n<figure>\n <img src=\"${await FileAttachment(\"national-archive.jpg\").url()}\" style=\"background: #6d6359; width: 640px; height: 395px; max-height: calc(0.618 * (100vw - 28px));\">\n <figcaption>Files, IRL. Photo: [EduVolunteer/Wikimedia](https://commons.wikimedia.org/wiki/File:A_corridor_of_files_at_The_National_Archives_UK.jpg)</figcaption>\n</figure>",
|
|
504
|
-
"pinned": false,
|
|
505
|
-
"mode": "md",
|
|
506
|
-
"data": null,
|
|
507
|
-
"name": ""
|
|
508
|
-
},
|
|
509
|
-
{
|
|
510
|
-
"id": 847,
|
|
511
|
-
"value": "The quickest way to work with small-ish datasets in a notebook is to attach a file. Files in Observable can be used for a variety of purposes besides data too, such as videos or images (like the one above!).",
|
|
512
|
-
"pinned": false,
|
|
513
|
-
"mode": "md",
|
|
514
|
-
"data": null,
|
|
515
|
-
"name": ""
|
|
516
|
-
},
|
|
517
|
-
{
|
|
518
|
-
"id": 0,
|
|
519
|
-
"value": "File attachments behave like you expect: files are private when notebooks are private, files are copied when you fork or merge, files can be reused across notebooks through imports, and you can go back in time in notebook history. And because Observable is designed for tinkering, you can even play with your local files in other people’s notebooks, then fork to upload your files and save your work.",
|
|
520
|
-
"pinned": false,
|
|
521
|
-
"mode": "md",
|
|
522
|
-
"data": null,
|
|
523
|
-
"name": ""
|
|
524
|
-
},
|
|
525
|
-
{
|
|
526
|
-
"id": 142,
|
|
527
|
-
"value": "(If you want to work with live data, we recommend [database clients](/@observablehq/connecting-to-databases) to talk to databases, or [secrets](/@observablehq/secrets) to talk to API servers. Observable also supports [cloud files](/@observablehq/cloud-files) for live files hosted on the Microsoft or Google cloud.)",
|
|
528
|
-
"pinned": false,
|
|
529
|
-
"mode": "md",
|
|
530
|
-
"data": null,
|
|
531
|
-
"name": ""
|
|
532
|
-
},
|
|
533
|
-
{
|
|
534
|
-
"id": 851,
|
|
535
|
-
"value": "### Attaching files\n\nWe offer several convenient ways to attach files.",
|
|
536
|
-
"pinned": false,
|
|
537
|
-
"mode": "md",
|
|
538
|
-
"data": null,
|
|
539
|
-
"name": ""
|
|
540
|
-
},
|
|
541
|
-
{
|
|
542
|
-
"id": 852,
|
|
543
|
-
"value": "While editing a cell, hit ${keys(\"Cmd-Shift-U\")} to choose a local file or files. This will automatically insert the code to reference these files at the caret, and if you own the notebook, the files will immediately start uploading.",
|
|
544
|
-
"pinned": false,
|
|
545
|
-
"mode": "md",
|
|
546
|
-
"data": null,
|
|
547
|
-
"name": ""
|
|
548
|
-
},
|
|
549
|
-
{
|
|
550
|
-
"id": 22,
|
|
551
|
-
"value": "Open the **Data** pane by clicking the <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"\" stroke-width=\"2\"><path d=\"M7.19855 2.52175L7.88131 1.79111L7.19855 2.52175ZM12.6 11.7764L13.2581 11.0234L12.6 11.7764ZM5.34191 6.76078L11.9419 12.5293L13.2581 11.0234L6.65809 5.2549L5.34191 6.76078ZM10.8958 13.6864L3.35462 6.63385L1.98852 8.09459L9.52965 15.1472L10.8958 13.6864ZM6.51578 3.25238L13.8172 10.0755L15.1828 8.61419L7.88131 1.79111L6.51578 3.25238ZM3.08395 3.55474C3.91017 2.45311 5.50967 2.31219 6.51578 3.25238L7.88131 1.79111C6.0058 0.0384695 3.02413 0.301162 1.48395 2.35474L3.08395 3.55474ZM3.35462 6.63385C2.49183 5.82695 2.37516 4.49978 3.08395 3.55474L1.48395 2.35474C0.162683 4.11642 0.380169 6.59044 1.98852 8.09459L3.35462 6.63385ZM11.993 13.6551C11.6977 13.9647 11.2082 13.9786 10.8958 13.6864L9.52965 15.1472C10.6432 16.1886 12.3878 16.1388 13.4402 15.0356L11.993 13.6551ZM11.9419 12.5293C12.2764 12.8216 12.2996 13.3337 11.993 13.6551L13.4402 15.0356C14.5328 13.8903 14.4499 12.0651 13.2581 11.0234L11.9419 12.5293Z\"></path></svg> icon, in the top-right corner of the browser window. From there, click the plus sign next to **File attachments** to select a file from your desktop to attach it.",
|
|
552
|
-
"pinned": false,
|
|
553
|
-
"mode": "md",
|
|
554
|
-
"data": null,
|
|
555
|
-
"name": ""
|
|
556
|
-
},
|
|
557
|
-
{
|
|
558
|
-
"id": 82,
|
|
559
|
-
"value": "### Using files\n\nTo use a file, first pass the file’s name to the built-in FileAttachment function from the [Observable standard library](https://github.com/observablehq/stdlib).",
|
|
560
|
-
"pinned": false,
|
|
561
|
-
"mode": "md",
|
|
562
|
-
"data": null,
|
|
563
|
-
"name": "using"
|
|
564
|
-
},
|
|
565
|
-
{
|
|
566
|
-
"id": 27,
|
|
567
|
-
"value": "attachment = FileAttachment(\"example.json\")",
|
|
568
|
-
"pinned": true,
|
|
569
|
-
"mode": "js",
|
|
570
|
-
"data": null,
|
|
571
|
-
"name": null
|
|
572
|
-
},
|
|
573
|
-
{
|
|
574
|
-
"id": 658,
|
|
575
|
-
"value": "*In these examples, all of the files are attached to this notebook. You can open the File Attachments pane and download them to inspect them and follow along, or replace them with example files of your own.*",
|
|
576
|
-
"pinned": false,
|
|
577
|
-
"mode": "md",
|
|
578
|
-
"data": null,
|
|
579
|
-
"name": ""
|
|
580
|
-
},
|
|
581
|
-
{
|
|
582
|
-
"id": 29,
|
|
583
|
-
"value": "Calling FileAttachment doesn’t immediately load the file—the contents are only loaded when you request them. It’s a bit like the [Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch): there are async methods that return the file’s contents in different forms, such as JSON, CSV, or ArrayBuffer. You choose the appropriate method based on how you want to consume the file.",
|
|
584
|
-
"pinned": false,
|
|
585
|
-
"mode": "md",
|
|
586
|
-
"data": null,
|
|
587
|
-
"name": ""
|
|
588
|
-
},
|
|
589
|
-
{
|
|
590
|
-
"id": 861,
|
|
591
|
-
"value": "Here are a few examples. First, bog standard JSON.",
|
|
592
|
-
"pinned": false,
|
|
593
|
-
"mode": "md",
|
|
594
|
-
"data": null,
|
|
595
|
-
"name": ""
|
|
596
|
-
},
|
|
597
|
-
{
|
|
598
|
-
"id": 36,
|
|
599
|
-
"value": "json = FileAttachment(\"example.json\").json()",
|
|
600
|
-
"pinned": true,
|
|
601
|
-
"mode": "js",
|
|
602
|
-
"data": null,
|
|
603
|
-
"name": null
|
|
604
|
-
},
|
|
605
|
-
{
|
|
606
|
-
"id": 410,
|
|
607
|
-
"value": "json.hello.world",
|
|
608
|
-
"pinned": true,
|
|
609
|
-
"mode": "js",
|
|
610
|
-
"data": null,
|
|
611
|
-
"name": null
|
|
612
|
-
},
|
|
613
|
-
{
|
|
614
|
-
"id": 382,
|
|
615
|
-
"value": "How about comma-separated values (CSV)? We can do that. (If you want more control over parsing, load the file as text instead, and pass it to your parser of choice. Observable uses [d3-dsv](https://github.com/d3/d3-dsv).)",
|
|
616
|
-
"pinned": false,
|
|
617
|
-
"mode": "md",
|
|
618
|
-
"data": null,
|
|
619
|
-
"name": ""
|
|
620
|
-
},
|
|
621
|
-
{
|
|
622
|
-
"id": 31,
|
|
623
|
-
"value": "data = FileAttachment(\"example.csv\").csv()",
|
|
624
|
-
"pinned": true,
|
|
625
|
-
"mode": "js",
|
|
626
|
-
"data": null,
|
|
627
|
-
"name": null
|
|
628
|
-
},
|
|
629
|
-
{
|
|
630
|
-
"id": 684,
|
|
631
|
-
"value": "data.columns // in case you’re curious",
|
|
632
|
-
"pinned": true,
|
|
633
|
-
"mode": "js",
|
|
634
|
-
"data": null,
|
|
635
|
-
"name": null
|
|
636
|
-
},
|
|
637
|
-
{
|
|
638
|
-
"id": 417,
|
|
639
|
-
"value": "If our CSV is suitably formatted, meaning compatible with [d3.autoType](/@d3/d3-autotype), we can use automatic type inference to convert strings into more specific types such as numbers and dates.",
|
|
640
|
-
"pinned": false,
|
|
641
|
-
"mode": "md",
|
|
642
|
-
"data": null,
|
|
643
|
-
"name": ""
|
|
644
|
-
},
|
|
645
|
-
{
|
|
646
|
-
"id": 415,
|
|
647
|
-
"value": "typed = FileAttachment(\"example.csv\").csv({typed: true})",
|
|
648
|
-
"pinned": true,
|
|
649
|
-
"mode": "js",
|
|
650
|
-
"data": null,
|
|
651
|
-
"name": null
|
|
652
|
-
},
|
|
653
|
-
{
|
|
654
|
-
"id": 686,
|
|
655
|
-
"value": "If you’d rather have an array of arrays and not treat the first row as the header, use the *array* option. (This can be combined with the *typed* option, too.)",
|
|
656
|
-
"pinned": false,
|
|
657
|
-
"mode": "md",
|
|
658
|
-
"data": null,
|
|
659
|
-
"name": ""
|
|
660
|
-
},
|
|
661
|
-
{
|
|
662
|
-
"id": 689,
|
|
663
|
-
"value": "array = FileAttachment(\"example.csv\").csv({array: true})",
|
|
664
|
-
"pinned": true,
|
|
665
|
-
"mode": "js",
|
|
666
|
-
"data": null,
|
|
667
|
-
"name": null
|
|
668
|
-
},
|
|
669
|
-
{
|
|
670
|
-
"id": 915,
|
|
671
|
-
"value": "You can read ZIP (.zip) file attachments as well: see [FileAttachment.zip](https://observablehq.com/@observablehq/zip) for examples.",
|
|
672
|
-
"pinned": false,
|
|
673
|
-
"mode": "md",
|
|
674
|
-
"data": null,
|
|
675
|
-
"name": ""
|
|
676
|
-
},
|
|
677
|
-
{
|
|
678
|
-
"id": 920,
|
|
679
|
-
"value": "If you want to perform more complicated parsing on the rows — for instance, if there are commas in the number values — you can use a chained promise to write a custom parsing function. ",
|
|
680
|
-
"pinned": false,
|
|
681
|
-
"mode": "md",
|
|
682
|
-
"data": null,
|
|
683
|
-
"name": ""
|
|
684
|
-
},
|
|
685
|
-
{
|
|
686
|
-
"id": 919,
|
|
687
|
-
"value": "sp500 = FileAttachment(\"sp500.csv\").csv()\n .then(data => {\n const parseCommas = (d) => Number(d.replace(/,/g, \"\"));\n return data.map(row => ({\n Open: parseCommas(row.Open)\n }))\n })",
|
|
688
|
-
"pinned": true,
|
|
689
|
-
"mode": "js",
|
|
690
|
-
"data": null,
|
|
691
|
-
"name": null
|
|
692
|
-
},
|
|
693
|
-
{
|
|
694
|
-
"id": 57,
|
|
695
|
-
"value": "How about an image? The promise resolves after the image has loaded, making this convenient for manipulating images with Canvas, or loading WebGL textures.",
|
|
696
|
-
"pinned": false,
|
|
697
|
-
"mode": "md",
|
|
698
|
-
"data": null,
|
|
699
|
-
"name": ""
|
|
700
|
-
},
|
|
701
|
-
{
|
|
702
|
-
"id": 42,
|
|
703
|
-
"value": "image = FileAttachment(\"example.png\").image()",
|
|
704
|
-
"pinned": true,
|
|
705
|
-
"mode": "js",
|
|
706
|
-
"data": null,
|
|
707
|
-
"name": null
|
|
708
|
-
},
|
|
709
|
-
{
|
|
710
|
-
"id": 554,
|
|
711
|
-
"value": "To embed the image in Markdown or HTML literals, await it.",
|
|
712
|
-
"pinned": false,
|
|
713
|
-
"mode": "md",
|
|
714
|
-
"data": null,
|
|
715
|
-
"name": ""
|
|
716
|
-
},
|
|
717
|
-
{
|
|
718
|
-
"id": 558,
|
|
719
|
-
"value": "<figure>\n ${await FileAttachment(\"the-persistence-of-memory.jpg\").image()}\n <figcaption>Image: <a href=\"https://en.wikipedia.org/wiki/The_Persistence_of_Memory\">Salvador Dali</a></figcaption>\n</figure>",
|
|
720
|
-
"pinned": true,
|
|
721
|
-
"mode": "html",
|
|
722
|
-
"data": null,
|
|
723
|
-
"name": ""
|
|
724
|
-
},
|
|
725
|
-
{
|
|
726
|
-
"id": 391,
|
|
727
|
-
"value": "You might want to work with binary data, such as a shapefile or a SQLite database. In these cases, the natural representation is typically an [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer).",
|
|
728
|
-
"pinned": false,
|
|
729
|
-
"mode": "md",
|
|
730
|
-
"data": null,
|
|
731
|
-
"name": ""
|
|
732
|
-
},
|
|
733
|
-
{
|
|
734
|
-
"id": 444,
|
|
735
|
-
"value": "shapefile = require(\"shapefile@0.6\")",
|
|
736
|
-
"pinned": true,
|
|
737
|
-
"mode": "js",
|
|
738
|
-
"data": null,
|
|
739
|
-
"name": null
|
|
740
|
-
},
|
|
741
|
-
{
|
|
742
|
-
"id": 447,
|
|
743
|
-
"value": "collection = shapefile.read(await FileAttachment(\"example.shp\").arrayBuffer())",
|
|
744
|
-
"pinned": true,
|
|
745
|
-
"mode": "js",
|
|
746
|
-
"data": null,
|
|
747
|
-
"name": null
|
|
748
|
-
},
|
|
749
|
-
{
|
|
750
|
-
"id": 114,
|
|
751
|
-
"value": "You can also get a [ReadableStream](https://streams.spec.whatwg.org/#rs) if you want to read a file incrementally.",
|
|
752
|
-
"pinned": false,
|
|
753
|
-
"mode": "md",
|
|
754
|
-
"data": null,
|
|
755
|
-
"name": ""
|
|
756
|
-
},
|
|
757
|
-
{
|
|
758
|
-
"id": 112,
|
|
759
|
-
"value": "chunk = {\n const stream = await FileAttachment(\"example.shp\").stream();\n const reader = stream.getReader();\n let done, value;\n while (({done, value} = await reader.read()), !done) {\n yield value;\n }\n}",
|
|
760
|
-
"pinned": true,
|
|
761
|
-
"mode": "js",
|
|
762
|
-
"data": null,
|
|
763
|
-
"name": null
|
|
764
|
-
},
|
|
765
|
-
{
|
|
766
|
-
"id": 53,
|
|
767
|
-
"value": "In rare cases (for example, passing a file reference to web worker), you might want a Blob or the URL directly. For example, here’s a link to download a PDF attached to this notebook.",
|
|
768
|
-
"pinned": false,
|
|
769
|
-
"mode": "md",
|
|
770
|
-
"data": null,
|
|
771
|
-
"name": ""
|
|
772
|
-
},
|
|
773
|
-
{
|
|
774
|
-
"id": 464,
|
|
775
|
-
"value": "<a href=\"${await FileAttachment(\"example.pdf\").url()}\" download>Click here to download a PDF.</a>",
|
|
776
|
-
"pinned": true,
|
|
777
|
-
"mode": "html",
|
|
778
|
-
"data": null,
|
|
779
|
-
"name": ""
|
|
780
|
-
},
|
|
781
|
-
{
|
|
782
|
-
"id": 645,
|
|
783
|
-
"value": "And here’s a Blob that you might pass to a web worker.",
|
|
784
|
-
"pinned": false,
|
|
785
|
-
"mode": "md",
|
|
786
|
-
"data": null,
|
|
787
|
-
"name": ""
|
|
788
|
-
},
|
|
789
|
-
{
|
|
790
|
-
"id": 34,
|
|
791
|
-
"value": "blob = FileAttachment(\"example.csv\").blob()",
|
|
792
|
-
"pinned": true,
|
|
793
|
-
"mode": "js",
|
|
794
|
-
"data": null,
|
|
795
|
-
"name": null
|
|
796
|
-
},
|
|
797
|
-
{
|
|
798
|
-
"id": 350,
|
|
799
|
-
"value": "Lastly, if you pass an unknown file name to FileAttachment, it throws an error. This is true even if you don’t load the file’s contents because Observable tracks the set of known files using static analysis.",
|
|
800
|
-
"pinned": false,
|
|
801
|
-
"mode": "md",
|
|
802
|
-
"data": null,
|
|
803
|
-
"name": ""
|
|
804
|
-
},
|
|
805
|
-
{
|
|
806
|
-
"id": 481,
|
|
807
|
-
"value": "FileAttachment(\"exemple.txt\") // Oops!",
|
|
808
|
-
"pinned": true,
|
|
809
|
-
"mode": "js",
|
|
810
|
-
"data": null,
|
|
811
|
-
"name": null
|
|
812
|
-
},
|
|
813
|
-
{
|
|
814
|
-
"id": 107,
|
|
815
|
-
"value": "### How files work\n\nHere are a few more details about files you might want to know.",
|
|
816
|
-
"pinned": false,
|
|
817
|
-
"mode": "md",
|
|
818
|
-
"data": null,
|
|
819
|
-
"name": ""
|
|
820
|
-
},
|
|
821
|
-
{
|
|
822
|
-
"id": 9,
|
|
823
|
-
"value": "**Files are local to the notebook.** Files can’t be referenced across notebooks—a given file can be directly accessed only by its notebook. You can, however, import cells that use files across notebooks. Likewise, when you fork a notebook, you’ll get your own copy of any attached files.",
|
|
824
|
-
"pinned": false,
|
|
825
|
-
"mode": "md",
|
|
826
|
-
"data": null,
|
|
827
|
-
"name": ""
|
|
828
|
-
},
|
|
829
|
-
{
|
|
830
|
-
"id": 7,
|
|
831
|
-
"value": "**Files are immutable.** The contents associated with a given file name never change. Instead of replacing a file’s contents, you replace a file, which automatically generates a new name and updates all code references to point to the new file. This preserves [notebook history](/@observablehq/history): you can view any version of your notebook and see the original data, and compare different versions of files.",
|
|
832
|
-
"pinned": false,
|
|
833
|
-
"mode": "md",
|
|
834
|
-
"data": null,
|
|
835
|
-
"name": ""
|
|
836
|
-
},
|
|
837
|
-
{
|
|
838
|
-
"id": 211,
|
|
839
|
-
"value": "**But, files can be deleted.** While file immutability ensures that you can go back in time to see earlier versions of a notebook, we recognize that there are times when you simply want a file taken down for good. In this case, delete the file from the files pane. This will cause references to the deleted file to error (and break old versions of the notebook).",
|
|
840
|
-
"pinned": false,
|
|
841
|
-
"mode": "md",
|
|
842
|
-
"data": null,
|
|
843
|
-
"name": ""
|
|
844
|
-
},
|
|
845
|
-
{
|
|
846
|
-
"id": 267,
|
|
847
|
-
"value": "**File sizes are limited.** Files up to 50 megabytes can be uploaded. There’s also a rolling quota of 1 Gb per user over a 28-day period on uploads. For Teams, the quota is pooled for all editors on the team, so a team with 10 editors has a 10GB quota. There is no cap on the total file size usage per user. (For larger files, you’ll either need to host the files yourself, or use a [local file input](/@observablehq/input-file).)",
|
|
848
|
-
"pinned": false,
|
|
849
|
-
"mode": "md",
|
|
850
|
-
"data": null,
|
|
851
|
-
"name": ""
|
|
852
|
-
},
|
|
853
|
-
{
|
|
854
|
-
"id": 12,
|
|
855
|
-
"value": "**Files are private by default,** just like notebooks. When you publish (or share) a notebook, only the files _currently used_ by the notebook will become public. A file you replaced or stopped using—as long as you no longer reference it—will remain private. See below.",
|
|
856
|
-
"pinned": false,
|
|
857
|
-
"mode": "md",
|
|
858
|
-
"data": null,
|
|
859
|
-
"name": ""
|
|
860
|
-
},
|
|
861
|
-
{
|
|
862
|
-
"id": 190,
|
|
863
|
-
"value": "**References to files are parsed statically.** We use static analysis to determine which files a notebook uses so that we can automatically publish referenced files when a notebook is published (and *only* referenced files), and similarly copy only referenced files when forking a notebook. The FileAttachment function thus accepts only literal strings; code such as\n\n~~~js\nFileAttachment(\"my\" + \"file.csv\")\n~~~\n\nor similar dynamic invocation is invalid syntax. For details on how this is implemented, see [our parser](https://github.com/observablehq/parser).",
|
|
864
|
-
"pinned": false,
|
|
865
|
-
"mode": "md",
|
|
866
|
-
"data": null,
|
|
867
|
-
"name": ""
|
|
868
|
-
},
|
|
869
|
-
{
|
|
870
|
-
"id": 285,
|
|
871
|
-
"value": "---\n\n## Appendix",
|
|
872
|
-
"pinned": false,
|
|
873
|
-
"mode": "md",
|
|
874
|
-
"data": null,
|
|
875
|
-
"name": ""
|
|
876
|
-
},
|
|
877
|
-
{
|
|
878
|
-
"id": 289,
|
|
879
|
-
"value": "keys = s => htl.html`<span style=\"font-family:var(--sans-serif);font-size:90%;\">${keysText(s)}`",
|
|
880
|
-
"pinned": true,
|
|
881
|
-
"mode": "js",
|
|
882
|
-
"data": null,
|
|
883
|
-
"name": null
|
|
884
|
-
},
|
|
885
|
-
{
|
|
886
|
-
"id": 288,
|
|
887
|
-
"value": "import {keys as keysText, mac} from \"@observablehq/keys\"",
|
|
888
|
-
"pinned": true,
|
|
889
|
-
"mode": "js",
|
|
890
|
-
"data": null,
|
|
891
|
-
"name": null
|
|
892
|
-
}
|
|
893
|
-
],
|
|
894
|
-
"resolutions": []
|
|
1
|
+
export const fa = {
|
|
2
|
+
"id": "9595fd1fad051f74",
|
|
3
|
+
"slug": "file-attachments",
|
|
4
|
+
"trashed": false,
|
|
5
|
+
"description": "",
|
|
6
|
+
"likes": 136,
|
|
7
|
+
"publish_level": "public",
|
|
8
|
+
"forks": 4,
|
|
9
|
+
"fork_of": null,
|
|
10
|
+
"update_time": "2022-05-26T15:58:17.291Z",
|
|
11
|
+
"publish_time": "2019-10-30T19:33:40.045Z",
|
|
12
|
+
"publish_version": 921,
|
|
13
|
+
"latest_version": 921,
|
|
14
|
+
"thumbnail": "9037f4259f5b5c119d6541a7176e348686caf51ffc9177f3378f27fe1bd72a26",
|
|
15
|
+
"default_thumbnail": "9037f4259f5b5c119d6541a7176e348686caf51ffc9177f3378f27fe1bd72a26",
|
|
16
|
+
"roles": [],
|
|
17
|
+
"sharing": null,
|
|
18
|
+
"owner": {
|
|
19
|
+
"id": "f35c755083683fe5",
|
|
20
|
+
"avatar_url": "https://avatars.observableusercontent.com/avatar/5a51c3b908225a581d20577e488e2aba8cbc9541c52982c638638c370c3e5e8e",
|
|
21
|
+
"login": "observablehq",
|
|
22
|
+
"name": "Observable",
|
|
23
|
+
"bio": "Use data to think, together.",
|
|
24
|
+
"home_url": "https://observablehq.com",
|
|
25
|
+
"type": "team",
|
|
26
|
+
"tier": "enterprise"
|
|
27
|
+
},
|
|
28
|
+
"creator": {
|
|
29
|
+
"id": "074c414ad1d825f5",
|
|
30
|
+
"github_login": "mbostock",
|
|
31
|
+
"avatar_url": "https://avatars.observableusercontent.com/avatar/82811927da99f8938001b2ef1f552ad2c47083e46ebc55a3a146a5a5848c4519",
|
|
32
|
+
"login": "mbostock",
|
|
33
|
+
"name": "Mike Bostock",
|
|
34
|
+
"bio": "Building a better computational medium. Founder @observablehq. Creator @d3. Former @nytgraphics. Pronounced BOSS-tock.",
|
|
35
|
+
"home_url": "https://bost.ocks.org/mike/",
|
|
36
|
+
"tier": "basic"
|
|
37
|
+
},
|
|
38
|
+
"authors": [],
|
|
39
|
+
"collections": [
|
|
40
|
+
{
|
|
41
|
+
"id": "69718aa29ac11e6c",
|
|
42
|
+
"type": "public",
|
|
43
|
+
"slug": "getting-data-in-and-out",
|
|
44
|
+
"title": "Getting data in and out",
|
|
45
|
+
"description": "Whether your data is hosted on the web, stored in a database, or saved in a local file, you can access it from Observable with these techniques.",
|
|
46
|
+
"update_time": "2022-08-31T16:06:06.501Z",
|
|
47
|
+
"pinned": false,
|
|
48
|
+
"ordered": true,
|
|
49
|
+
"custom_thumbnail": null,
|
|
50
|
+
"default_thumbnail": "77670bac9d0356f169c353a0213f553d00e74c3be57c8114c526148adcb45abc",
|
|
51
|
+
"thumbnail": "77670bac9d0356f169c353a0213f553d00e74c3be57c8114c526148adcb45abc",
|
|
52
|
+
"listing_count": 17,
|
|
53
|
+
"parent_collection_count": 1,
|
|
54
|
+
"owner": {
|
|
55
|
+
"id": "f35c755083683fe5",
|
|
56
|
+
"avatar_url": "https://avatars.observableusercontent.com/avatar/5a51c3b908225a581d20577e488e2aba8cbc9541c52982c638638c370c3e5e8e",
|
|
57
|
+
"login": "observablehq",
|
|
58
|
+
"name": "Observable",
|
|
59
|
+
"bio": "Use data to think, together.",
|
|
60
|
+
"home_url": "https://observablehq.com",
|
|
61
|
+
"type": "team",
|
|
62
|
+
"tier": "enterprise"
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"id": "0b7a49725d3ab0c0",
|
|
67
|
+
"type": "public",
|
|
68
|
+
"slug": "introduction",
|
|
69
|
+
"title": "Introduction",
|
|
70
|
+
"description": "Welcome to Observable! Get started with these tutorials.",
|
|
71
|
+
"update_time": "2019-05-06T19:48:56.772Z",
|
|
72
|
+
"pinned": true,
|
|
73
|
+
"ordered": false,
|
|
74
|
+
"custom_thumbnail": "d0ff809470432afdb2269a0e1a572a12d617f2d91aa07fca5ec6fdf13e4a1a9d",
|
|
75
|
+
"default_thumbnail": "04435c346f534d9f1d0b22f03a9b2ab313891893d0dccc956d6530f60f22c081",
|
|
76
|
+
"thumbnail": "d0ff809470432afdb2269a0e1a572a12d617f2d91aa07fca5ec6fdf13e4a1a9d",
|
|
77
|
+
"listing_count": 33,
|
|
78
|
+
"parent_collection_count": 1,
|
|
79
|
+
"owner": {
|
|
80
|
+
"id": "f35c755083683fe5",
|
|
81
|
+
"avatar_url": "https://avatars.observableusercontent.com/avatar/5a51c3b908225a581d20577e488e2aba8cbc9541c52982c638638c370c3e5e8e",
|
|
82
|
+
"login": "observablehq",
|
|
83
|
+
"name": "Observable",
|
|
84
|
+
"bio": "Use data to think, together.",
|
|
85
|
+
"home_url": "https://observablehq.com",
|
|
86
|
+
"type": "team",
|
|
87
|
+
"tier": "enterprise"
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
],
|
|
91
|
+
"files": [
|
|
92
|
+
{
|
|
93
|
+
"id": "64d21082dcd00f21843ac22313ce443c1faa36a462afdb3c063f7cadea1c5d22a959c4aa3e89db2d7ecf2533689e0cf63659dc4058774654aae62049ecbaa940",
|
|
94
|
+
"url": "https://static.observableusercontent.com/files/64d21082dcd00f21843ac22313ce443c1faa36a462afdb3c063f7cadea1c5d22a959c4aa3e89db2d7ecf2533689e0cf63659dc4058774654aae62049ecbaa940",
|
|
95
|
+
"download_url": "https://static.observableusercontent.com/files/64d21082dcd00f21843ac22313ce443c1faa36a462afdb3c063f7cadea1c5d22a959c4aa3e89db2d7ecf2533689e0cf63659dc4058774654aae62049ecbaa940?response-content-disposition=attachment%3Bfilename*%3DUTF-8%27%27national-archive.jpg",
|
|
96
|
+
"name": "national-archive.jpg",
|
|
97
|
+
"create_time": "2019-10-29T20:46:51.853Z",
|
|
98
|
+
"status": "public",
|
|
99
|
+
"size": 409265,
|
|
100
|
+
"mime_type": "image/jpeg",
|
|
101
|
+
"content_encoding": null
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"id": "86ff47388d832e549c0661861f8107e4e65187de3333abf70f940359eac7810c611eebb7511565264f4b8b001229fd9a6832a21a421c6be3623ccbd97cbf5737",
|
|
105
|
+
"url": "https://static.observableusercontent.com/files/86ff47388d832e549c0661861f8107e4e65187de3333abf70f940359eac7810c611eebb7511565264f4b8b001229fd9a6832a21a421c6be3623ccbd97cbf5737",
|
|
106
|
+
"download_url": "https://static.observableusercontent.com/files/86ff47388d832e549c0661861f8107e4e65187de3333abf70f940359eac7810c611eebb7511565264f4b8b001229fd9a6832a21a421c6be3623ccbd97cbf5737?response-content-disposition=attachment%3Bfilename*%3DUTF-8%27%27example.json",
|
|
107
|
+
"name": "example.json",
|
|
108
|
+
"create_time": "2019-10-29T20:47:55.713Z",
|
|
109
|
+
"status": "public",
|
|
110
|
+
"size": 53,
|
|
111
|
+
"mime_type": null,
|
|
112
|
+
"content_encoding": null
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
"id": "09f63bb9ff086fef80717e2ea8c974f918a996d2bfa3d8773d3ae12753942c002d0dfab833d7bee1e0c9cd358cd3578c1cd0f9435595e76901508adc3964bbdc",
|
|
116
|
+
"url": "https://static.observableusercontent.com/files/09f63bb9ff086fef80717e2ea8c974f918a996d2bfa3d8773d3ae12753942c002d0dfab833d7bee1e0c9cd358cd3578c1cd0f9435595e76901508adc3964bbdc",
|
|
117
|
+
"download_url": "https://static.observableusercontent.com/files/09f63bb9ff086fef80717e2ea8c974f918a996d2bfa3d8773d3ae12753942c002d0dfab833d7bee1e0c9cd358cd3578c1cd0f9435595e76901508adc3964bbdc?response-content-disposition=attachment%3Bfilename*%3DUTF-8%27%27example.csv",
|
|
118
|
+
"name": "example.csv",
|
|
119
|
+
"create_time": "2019-10-29T20:49:59.156Z",
|
|
120
|
+
"status": "public",
|
|
121
|
+
"size": 275,
|
|
122
|
+
"mime_type": null,
|
|
123
|
+
"content_encoding": "gzip"
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
"id": "a86c4f95f3ec10fd2d13544ecf6bdf49ae25066ba2e8b2ca96fddd0a831c09cd2ac0ffb441e2e6db6258648fbe267b413d71937c17b4a0d80e1822d99ba2fb0a",
|
|
127
|
+
"url": "https://static.observableusercontent.com/files/a86c4f95f3ec10fd2d13544ecf6bdf49ae25066ba2e8b2ca96fddd0a831c09cd2ac0ffb441e2e6db6258648fbe267b413d71937c17b4a0d80e1822d99ba2fb0a",
|
|
128
|
+
"download_url": "https://static.observableusercontent.com/files/a86c4f95f3ec10fd2d13544ecf6bdf49ae25066ba2e8b2ca96fddd0a831c09cd2ac0ffb441e2e6db6258648fbe267b413d71937c17b4a0d80e1822d99ba2fb0a?response-content-disposition=attachment%3Bfilename*%3DUTF-8%27%27example.png",
|
|
129
|
+
"name": "example.png",
|
|
130
|
+
"create_time": "2019-10-29T20:52:52.807Z",
|
|
131
|
+
"status": "public",
|
|
132
|
+
"size": 126867,
|
|
133
|
+
"mime_type": "image/png",
|
|
134
|
+
"content_encoding": null
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
"id": "e2a5a0ac299b53fc1016e082c7c0732d50d0dc9388d8b99adadeee40d6d1c856991c15698dcdf582a6827b411ba6d470bf7a6d28426fb8bc1cd7cc28f17199bd",
|
|
138
|
+
"url": "https://static.observableusercontent.com/files/e2a5a0ac299b53fc1016e082c7c0732d50d0dc9388d8b99adadeee40d6d1c856991c15698dcdf582a6827b411ba6d470bf7a6d28426fb8bc1cd7cc28f17199bd",
|
|
139
|
+
"download_url": "https://static.observableusercontent.com/files/e2a5a0ac299b53fc1016e082c7c0732d50d0dc9388d8b99adadeee40d6d1c856991c15698dcdf582a6827b411ba6d470bf7a6d28426fb8bc1cd7cc28f17199bd?response-content-disposition=attachment%3Bfilename*%3DUTF-8%27%27the-persistence-of-memory.jpg",
|
|
140
|
+
"name": "the-persistence-of-memory.jpg",
|
|
141
|
+
"create_time": "2019-10-29T20:55:47.964Z",
|
|
142
|
+
"status": "public",
|
|
143
|
+
"size": 179013,
|
|
144
|
+
"mime_type": "image/jpeg",
|
|
145
|
+
"content_encoding": null
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
"id": "1bc7c60612fed26b5376e8648f66b956192d6698e532730c148ea00491a6ff0122dc5cdf605f8d6ae209c4547176c2da042296b7665f4ace4eabda3d4500762c",
|
|
149
|
+
"url": "https://static.observableusercontent.com/files/1bc7c60612fed26b5376e8648f66b956192d6698e532730c148ea00491a6ff0122dc5cdf605f8d6ae209c4547176c2da042296b7665f4ace4eabda3d4500762c",
|
|
150
|
+
"download_url": "https://static.observableusercontent.com/files/1bc7c60612fed26b5376e8648f66b956192d6698e532730c148ea00491a6ff0122dc5cdf605f8d6ae209c4547176c2da042296b7665f4ace4eabda3d4500762c?response-content-disposition=attachment%3Bfilename*%3DUTF-8%27%27example.shp",
|
|
151
|
+
"name": "example.shp",
|
|
152
|
+
"create_time": "2019-10-29T21:03:21.081Z",
|
|
153
|
+
"status": "public",
|
|
154
|
+
"size": 498480,
|
|
155
|
+
"mime_type": null,
|
|
156
|
+
"content_encoding": "gzip"
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
"id": "1a485a6468d79a87fe0794e1119dee719716ec2b2f91d26e04e88bc3faa739c11fca8cd3d85d2e525c4ed936a6f7b9bc1b530c4fa00df82a82fc63525ca17d9e",
|
|
160
|
+
"url": "https://static.observableusercontent.com/files/1a485a6468d79a87fe0794e1119dee719716ec2b2f91d26e04e88bc3faa739c11fca8cd3d85d2e525c4ed936a6f7b9bc1b530c4fa00df82a82fc63525ca17d9e",
|
|
161
|
+
"download_url": "https://static.observableusercontent.com/files/1a485a6468d79a87fe0794e1119dee719716ec2b2f91d26e04e88bc3faa739c11fca8cd3d85d2e525c4ed936a6f7b9bc1b530c4fa00df82a82fc63525ca17d9e?response-content-disposition=attachment%3Bfilename*%3DUTF-8%27%27example.pdf",
|
|
162
|
+
"name": "example.pdf",
|
|
163
|
+
"create_time": "2019-10-29T21:05:27.867Z",
|
|
164
|
+
"status": "public",
|
|
165
|
+
"size": 27483,
|
|
166
|
+
"mime_type": "application/pdf",
|
|
167
|
+
"content_encoding": null
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
"id": "880426472f67ca25f8401c05e8c10466a3709a8870275b28a1fb5aebe9ec234a20cd651273434438b98d5aa0a6d18221ab155dccbe133c9453bde00537ab29a8",
|
|
171
|
+
"url": "https://static.observableusercontent.com/files/880426472f67ca25f8401c05e8c10466a3709a8870275b28a1fb5aebe9ec234a20cd651273434438b98d5aa0a6d18221ab155dccbe133c9453bde00537ab29a8",
|
|
172
|
+
"download_url": "https://static.observableusercontent.com/files/880426472f67ca25f8401c05e8c10466a3709a8870275b28a1fb5aebe9ec234a20cd651273434438b98d5aa0a6d18221ab155dccbe133c9453bde00537ab29a8?response-content-disposition=attachment%3Bfilename*%3DUTF-8%27%27Dog_Photos%25402.zip",
|
|
173
|
+
"name": "Dog_Photos@2.zip",
|
|
174
|
+
"create_time": "2021-07-08T22:52:57.591Z",
|
|
175
|
+
"status": "public",
|
|
176
|
+
"size": 516016,
|
|
177
|
+
"mime_type": "application/zip",
|
|
178
|
+
"content_encoding": null
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
"id": "036293060a3d1be9b3ad33fca12dbd546157c3a20cbc2dcee6400a04c4e26b407d247697c0b5a6b23c9c03d263698913e9f5055b1c3fa2cfe6fc1826ec8c7ad0",
|
|
182
|
+
"url": "https://static.observableusercontent.com/files/036293060a3d1be9b3ad33fca12dbd546157c3a20cbc2dcee6400a04c4e26b407d247697c0b5a6b23c9c03d263698913e9f5055b1c3fa2cfe6fc1826ec8c7ad0",
|
|
183
|
+
"download_url": "https://static.observableusercontent.com/files/036293060a3d1be9b3ad33fca12dbd546157c3a20cbc2dcee6400a04c4e26b407d247697c0b5a6b23c9c03d263698913e9f5055b1c3fa2cfe6fc1826ec8c7ad0?response-content-disposition=attachment%3Bfilename*%3DUTF-8%27%27Laser_Report_2020.xlsx",
|
|
184
|
+
"name": "Laser_Report_2020.xlsx",
|
|
185
|
+
"create_time": "2021-09-29T17:37:48.589Z",
|
|
186
|
+
"status": "public",
|
|
187
|
+
"size": 462969,
|
|
188
|
+
"mime_type": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
189
|
+
"content_encoding": null
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
"id": "f4fd5c681574c1ff7050d59fd5fa64f7bc30d28763a6246afa5786d07181a34c07ddc47f614ce00669b69c09aabdbe77fbada74d9c06a590e8712cf19a95c1c3",
|
|
193
|
+
"url": "https://static.observableusercontent.com/files/f4fd5c681574c1ff7050d59fd5fa64f7bc30d28763a6246afa5786d07181a34c07ddc47f614ce00669b69c09aabdbe77fbada74d9c06a590e8712cf19a95c1c3",
|
|
194
|
+
"download_url": "https://static.observableusercontent.com/files/f4fd5c681574c1ff7050d59fd5fa64f7bc30d28763a6246afa5786d07181a34c07ddc47f614ce00669b69c09aabdbe77fbada74d9c06a590e8712cf19a95c1c3?response-content-disposition=attachment%3Bfilename*%3DUTF-8%27%27sp500.csv",
|
|
195
|
+
"name": "sp500.csv",
|
|
196
|
+
"create_time": "2022-05-26T15:56:43.731Z",
|
|
197
|
+
"status": "public",
|
|
198
|
+
"size": 10213,
|
|
199
|
+
"mime_type": "text/csv",
|
|
200
|
+
"content_encoding": "gzip"
|
|
201
|
+
}
|
|
202
|
+
],
|
|
203
|
+
"comments": [
|
|
204
|
+
{
|
|
205
|
+
"id": "a21858fb6d91ae2a",
|
|
206
|
+
"content": "How does the storage of file attachment works? Are they hosted in your servers? And by which data protection terms does this hosting abide?\n\nThanks in advance!",
|
|
207
|
+
"node_id": 9,
|
|
208
|
+
"create_time": "2022-09-09T17:08:37.467Z",
|
|
209
|
+
"update_time": null,
|
|
210
|
+
"resolved": false,
|
|
211
|
+
"user": {
|
|
212
|
+
"id": "d8cc07084b6bff9b",
|
|
213
|
+
"github_login": null,
|
|
214
|
+
"avatar_url": "https://avatars.observableusercontent.com/avatar/13c54021cc6aaa6440efde3bfb263ecbb4c4690dc6d5889d38d969a887723424",
|
|
215
|
+
"login": "cpinto",
|
|
216
|
+
"name": "Carlos Alberto Duarte Pinto",
|
|
217
|
+
"bio": "",
|
|
218
|
+
"home_url": "",
|
|
219
|
+
"tier": "basic"
|
|
220
|
+
}
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
"id": "5244d817c44793f9",
|
|
224
|
+
"content": "They are hosted on our servers. You can read more here: https://static.observablehq.com/assets/pdfs/Security+FAQ.pdf",
|
|
225
|
+
"node_id": 9,
|
|
226
|
+
"create_time": "2022-09-09T21:46:52.331Z",
|
|
227
|
+
"update_time": null,
|
|
228
|
+
"resolved": false,
|
|
229
|
+
"user": {
|
|
230
|
+
"id": "c1daf2951ad616fb",
|
|
231
|
+
"github_login": null,
|
|
232
|
+
"avatar_url": "https://avatars.observableusercontent.com/avatar/4a17a065d7a0f5f9a64a852f7b26a4f875c2ff69eb17264c3bd9f81e69285c05",
|
|
233
|
+
"login": "cobus",
|
|
234
|
+
"name": "Cobus Theunissen",
|
|
235
|
+
"bio": "",
|
|
236
|
+
"home_url": "",
|
|
237
|
+
"tier": "basic"
|
|
238
|
+
}
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
"id": "0a468b8f6b27d9d0",
|
|
242
|
+
"content": "Hi, I notice that File Attachments now support zip. It's awesome! No need to import Fil's @fil/jszip! I figure out how to use it, but I notice that there is no official documentation. It might be helpful for other users to find some references here. I'd be happy to contribute if that's the case!",
|
|
243
|
+
"node_id": 22,
|
|
244
|
+
"create_time": "2021-06-29T04:43:03.350Z",
|
|
245
|
+
"update_time": null,
|
|
246
|
+
"resolved": true,
|
|
247
|
+
"user": {
|
|
248
|
+
"id": "06bc2aaa9d8c4a54",
|
|
249
|
+
"github_login": "radames",
|
|
250
|
+
"avatar_url": "https://avatars.observableusercontent.com/avatar/7e61199ed2efe90aec8d897ac8b17a3fd0a129bff12a46a4048ddd0f73a2c43e",
|
|
251
|
+
"login": "radames",
|
|
252
|
+
"name": "Radamés Ajna",
|
|
253
|
+
"bio": "Engineering @huggingface 🤗. Data visualization enthusiast. Creative technologist. Open for collaborations.",
|
|
254
|
+
"home_url": "https://twitter.com/radamar",
|
|
255
|
+
"tier": "basic"
|
|
256
|
+
}
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
"id": "76662b539cb35668",
|
|
260
|
+
"content": "documentation is coming :)",
|
|
261
|
+
"node_id": 22,
|
|
262
|
+
"create_time": "2021-06-29T09:08:13.771Z",
|
|
263
|
+
"update_time": null,
|
|
264
|
+
"resolved": true,
|
|
265
|
+
"user": {
|
|
266
|
+
"id": "45a379fcfcb14253",
|
|
267
|
+
"github_login": "Fil",
|
|
268
|
+
"avatar_url": "https://avatars.observableusercontent.com/avatar/9cf371db2e1a2b4ed5f4a9783b6954cf7aeb2a88c56d4054c96ef360cf85ef89",
|
|
269
|
+
"login": "fil",
|
|
270
|
+
"name": "Fil",
|
|
271
|
+
"bio": "Vocateur.",
|
|
272
|
+
"home_url": "https://visionscarto.net/",
|
|
273
|
+
"tier": "basic"
|
|
274
|
+
}
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
"id": "9e1d9d6bb24de06a",
|
|
278
|
+
"content": "hi @fil thanks! The stlib with zip is very convenient!",
|
|
279
|
+
"node_id": 22,
|
|
280
|
+
"create_time": "2021-06-29T17:48:06.338Z",
|
|
281
|
+
"update_time": null,
|
|
282
|
+
"resolved": true,
|
|
283
|
+
"user": {
|
|
284
|
+
"id": "06bc2aaa9d8c4a54",
|
|
285
|
+
"github_login": "radames",
|
|
286
|
+
"avatar_url": "https://avatars.observableusercontent.com/avatar/7e61199ed2efe90aec8d897ac8b17a3fd0a129bff12a46a4048ddd0f73a2c43e",
|
|
287
|
+
"login": "radames",
|
|
288
|
+
"name": "Radamés Ajna",
|
|
289
|
+
"bio": "Engineering @huggingface 🤗. Data visualization enthusiast. Creative technologist. Open for collaborations.",
|
|
290
|
+
"home_url": "https://twitter.com/radamar",
|
|
291
|
+
"tier": "basic"
|
|
292
|
+
}
|
|
293
|
+
},
|
|
294
|
+
{
|
|
295
|
+
"id": "008d1ba1889409e1",
|
|
296
|
+
"content": ".zip() is now documented at https://observablehq.com/@observablehq/fileattachment-zip ; enjoy!",
|
|
297
|
+
"node_id": 22,
|
|
298
|
+
"create_time": "2021-07-09T06:58:24.818Z",
|
|
299
|
+
"update_time": null,
|
|
300
|
+
"resolved": true,
|
|
301
|
+
"user": {
|
|
302
|
+
"id": "45a379fcfcb14253",
|
|
303
|
+
"github_login": "Fil",
|
|
304
|
+
"avatar_url": "https://avatars.observableusercontent.com/avatar/9cf371db2e1a2b4ed5f4a9783b6954cf7aeb2a88c56d4054c96ef360cf85ef89",
|
|
305
|
+
"login": "fil",
|
|
306
|
+
"name": "Fil",
|
|
307
|
+
"bio": "Vocateur.",
|
|
308
|
+
"home_url": "https://visionscarto.net/",
|
|
309
|
+
"tier": "basic"
|
|
310
|
+
}
|
|
311
|
+
},
|
|
312
|
+
{
|
|
313
|
+
"id": "5176612370006d0d",
|
|
314
|
+
"content": "Noteworthy here too that you may pass in size parameters: e.g., `FileAttachment(...).image({ width: 400 })`",
|
|
315
|
+
"node_id": 42,
|
|
316
|
+
"create_time": "2021-11-20T11:43:36.468Z",
|
|
317
|
+
"update_time": null,
|
|
318
|
+
"resolved": false,
|
|
319
|
+
"user": {
|
|
320
|
+
"id": "a7fa3027921865cf",
|
|
321
|
+
"github_login": "aaronkyle",
|
|
322
|
+
"avatar_url": "https://avatars.observableusercontent.com/avatar/eb6d0b32ccc6c8febbf105ce4d2a938819bcbd1c6a2c108d3a9c01745d3590f2",
|
|
323
|
+
"login": "aaronkyle",
|
|
324
|
+
"name": "Aaron Kyle Dennis",
|
|
325
|
+
"bio": "Social development practitioner. Trying to understand our world.",
|
|
326
|
+
"home_url": "http://categori.se",
|
|
327
|
+
"tier": "basic"
|
|
328
|
+
}
|
|
329
|
+
},
|
|
330
|
+
{
|
|
331
|
+
"id": "77017a655c4fa6ba",
|
|
332
|
+
"content": "How can I replace a file (file.csv) with a newer file by the same name (file.csv)? I don't want a \"file@1.csv\" for the new filename.",
|
|
333
|
+
"node_id": 211,
|
|
334
|
+
"create_time": "2020-11-10T18:55:48.124Z",
|
|
335
|
+
"update_time": null,
|
|
336
|
+
"resolved": true,
|
|
337
|
+
"user": {
|
|
338
|
+
"id": "c3c578ac75ecd7ae",
|
|
339
|
+
"github_login": "tasqon",
|
|
340
|
+
"avatar_url": "https://avatars.observableusercontent.com/avatar/dab14efb29e9241cb3cff16322964a4872da606ae3617dbe323040826d85e664",
|
|
341
|
+
"login": "tasqon",
|
|
342
|
+
"name": "daktari",
|
|
343
|
+
"bio": "",
|
|
344
|
+
"home_url": "http://www.tasqon.com",
|
|
345
|
+
"tier": "basic"
|
|
346
|
+
}
|
|
347
|
+
},
|
|
348
|
+
{
|
|
349
|
+
"id": "dc86bb84d45ae91b",
|
|
350
|
+
"content": "You can’t; files are immutable, so the replacement file must have a new name. That said, you can name your file like “file-20201101.csv” before uploading if you’d prefer to a different unique rather than the auto-generated “file@1.csv”.",
|
|
351
|
+
"node_id": 211,
|
|
352
|
+
"create_time": "2020-11-10T20:30:14.871Z",
|
|
353
|
+
"update_time": null,
|
|
354
|
+
"resolved": true,
|
|
355
|
+
"user": {
|
|
356
|
+
"id": "074c414ad1d825f5",
|
|
357
|
+
"github_login": "mbostock",
|
|
358
|
+
"avatar_url": "https://avatars.observableusercontent.com/avatar/82811927da99f8938001b2ef1f552ad2c47083e46ebc55a3a146a5a5848c4519",
|
|
359
|
+
"login": "mbostock",
|
|
360
|
+
"name": "Mike Bostock",
|
|
361
|
+
"bio": "Building a better computational medium. Founder @observablehq. Creator @d3. Former @nytgraphics. Pronounced BOSS-tock.",
|
|
362
|
+
"home_url": "https://bost.ocks.org/mike/",
|
|
363
|
+
"tier": "basic"
|
|
364
|
+
}
|
|
365
|
+
},
|
|
366
|
+
{
|
|
367
|
+
"id": "bc5013b6160cf232",
|
|
368
|
+
"content": "I understand but I need to keep the file name unchanged. Since I only want replace the content of the file and not touch any code line. To have at least a workaround I fork my notebook, delete the file, fork again and upload the new file.",
|
|
369
|
+
"node_id": 211,
|
|
370
|
+
"create_time": "2020-11-10T20:59:04.379Z",
|
|
371
|
+
"update_time": null,
|
|
372
|
+
"resolved": true,
|
|
373
|
+
"user": {
|
|
374
|
+
"id": "c3c578ac75ecd7ae",
|
|
375
|
+
"github_login": "tasqon",
|
|
376
|
+
"avatar_url": "https://avatars.observableusercontent.com/avatar/dab14efb29e9241cb3cff16322964a4872da606ae3617dbe323040826d85e664",
|
|
377
|
+
"login": "tasqon",
|
|
378
|
+
"name": "daktari",
|
|
379
|
+
"bio": "",
|
|
380
|
+
"home_url": "http://www.tasqon.com",
|
|
381
|
+
"tier": "basic"
|
|
382
|
+
}
|
|
383
|
+
},
|
|
384
|
+
{
|
|
385
|
+
"id": "ebf14ab5e26698db",
|
|
386
|
+
"content": "If you use the “replace file” feature, all references to the old file will be replaced with references to the new file automatically.",
|
|
387
|
+
"node_id": 211,
|
|
388
|
+
"create_time": "2020-11-10T22:59:31.341Z",
|
|
389
|
+
"update_time": null,
|
|
390
|
+
"resolved": true,
|
|
391
|
+
"user": {
|
|
392
|
+
"id": "074c414ad1d825f5",
|
|
393
|
+
"github_login": "mbostock",
|
|
394
|
+
"avatar_url": "https://avatars.observableusercontent.com/avatar/82811927da99f8938001b2ef1f552ad2c47083e46ebc55a3a146a5a5848c4519",
|
|
395
|
+
"login": "mbostock",
|
|
396
|
+
"name": "Mike Bostock",
|
|
397
|
+
"bio": "Building a better computational medium. Founder @observablehq. Creator @d3. Former @nytgraphics. Pronounced BOSS-tock.",
|
|
398
|
+
"home_url": "https://bost.ocks.org/mike/",
|
|
399
|
+
"tier": "basic"
|
|
400
|
+
}
|
|
401
|
+
},
|
|
402
|
+
{
|
|
403
|
+
"id": "ea1a5704498af903",
|
|
404
|
+
"content": "What happens to file attachments when I export? I tried to export a notebook with attached images, but the files did not show up in the resulting tar file and the notebook broke...",
|
|
405
|
+
"node_id": 260,
|
|
406
|
+
"create_time": "2021-05-23T02:39:33.024Z",
|
|
407
|
+
"update_time": null,
|
|
408
|
+
"resolved": true,
|
|
409
|
+
"user": {
|
|
410
|
+
"id": "b8d79ca293134247",
|
|
411
|
+
"github_login": "triptych",
|
|
412
|
+
"avatar_url": "https://avatars.observableusercontent.com/avatar/84b4215a79a8f07f1610f6650183c4793985ecf13ed3af2944962bee15c46c2e",
|
|
413
|
+
"login": "triptych",
|
|
414
|
+
"name": "Andrew Wooldridge",
|
|
415
|
+
"bio": "📜JavaScript developer. \n\n🐲RPG fan. \n\n📚Storyteller and 🕹game developer. \n\n👨Father and Husband.",
|
|
416
|
+
"home_url": "http://andreww.xyz",
|
|
417
|
+
"tier": "basic"
|
|
418
|
+
}
|
|
419
|
+
},
|
|
420
|
+
{
|
|
421
|
+
"id": "aab4dde70dd322ed",
|
|
422
|
+
"content": "It seems like 7zip on Windows struggles with our tar.gz files; see Andrew's forum thread here: https://talk.observablehq.com/t/exporting-with-file-attachments/5094. We'll look into whether that's a bug we can fix or if we should offer a .zip download too.",
|
|
423
|
+
"node_id": 260,
|
|
424
|
+
"create_time": "2021-05-25T21:48:08.716Z",
|
|
425
|
+
"update_time": null,
|
|
426
|
+
"resolved": true,
|
|
427
|
+
"user": {
|
|
428
|
+
"id": "0bb2842b01e0c652",
|
|
429
|
+
"github_login": "tophtucker",
|
|
430
|
+
"avatar_url": "https://avatars.observableusercontent.com/avatar/3706c31a8f9c59bb716c022c04b9c073144cd1368b78ac85f49139be6c93c34e",
|
|
431
|
+
"login": "tophtucker",
|
|
432
|
+
"name": "Toph Tucker",
|
|
433
|
+
"bio": "",
|
|
434
|
+
"home_url": "https://tophtucker.com",
|
|
435
|
+
"tier": "basic"
|
|
436
|
+
}
|
|
437
|
+
},
|
|
438
|
+
{
|
|
439
|
+
"id": "f6b0b9748479c786",
|
|
440
|
+
"content": "What is `well-typed CSV` ? Is there a spec that describes how to specify CSV column types?",
|
|
441
|
+
"node_id": 417,
|
|
442
|
+
"create_time": "2021-08-01T05:18:30.715Z",
|
|
443
|
+
"update_time": null,
|
|
444
|
+
"resolved": true,
|
|
445
|
+
"user": {
|
|
446
|
+
"id": "d88a810c493f2e55",
|
|
447
|
+
"github_login": "abitrolly",
|
|
448
|
+
"avatar_url": "https://avatars.observableusercontent.com/avatar/2f343abb5b012a4f26ec5ddf4f3b27e3a604c9e61f196dc6634e49da57892fa1",
|
|
449
|
+
"login": "abitrolly",
|
|
450
|
+
"name": "Anatoli Babenia",
|
|
451
|
+
"bio": "Cyberspace. Doughnut Economics. SustainOSS.\r\n\r\nanatoli@rainforce.org",
|
|
452
|
+
"home_url": "https://github.com/abitrolly/abitrolly.github.io#readme",
|
|
453
|
+
"tier": "basic"
|
|
454
|
+
}
|
|
455
|
+
},
|
|
456
|
+
{
|
|
457
|
+
"id": "06f409cc65043e6d",
|
|
458
|
+
"content": "Defined here: https://github.com/d3/d3-dsv/blob/main/README.md#autoType",
|
|
459
|
+
"node_id": 417,
|
|
460
|
+
"create_time": "2021-08-01T18:42:07.374Z",
|
|
461
|
+
"update_time": null,
|
|
462
|
+
"resolved": true,
|
|
463
|
+
"user": {
|
|
464
|
+
"id": "074c414ad1d825f5",
|
|
465
|
+
"github_login": "mbostock",
|
|
466
|
+
"avatar_url": "https://avatars.observableusercontent.com/avatar/82811927da99f8938001b2ef1f552ad2c47083e46ebc55a3a146a5a5848c4519",
|
|
467
|
+
"login": "mbostock",
|
|
468
|
+
"name": "Mike Bostock",
|
|
469
|
+
"bio": "Building a better computational medium. Founder @observablehq. Creator @d3. Former @nytgraphics. Pronounced BOSS-tock.",
|
|
470
|
+
"home_url": "https://bost.ocks.org/mike/",
|
|
471
|
+
"tier": "basic"
|
|
472
|
+
}
|
|
473
|
+
},
|
|
474
|
+
{
|
|
475
|
+
"id": "ee10b8d49c389e2c",
|
|
476
|
+
"content": "It still doesn't explain what a well-typed CSV is.\n\nFor me `.csv({autotype: true})` would be more readable than `.csv({typed: true})`, because there is no such thing as a typed CSV. It might be a bit too late to rename it though.",
|
|
477
|
+
"node_id": 417,
|
|
478
|
+
"create_time": "2021-08-02T10:16:31.219Z",
|
|
479
|
+
"update_time": null,
|
|
480
|
+
"resolved": true,
|
|
481
|
+
"user": {
|
|
482
|
+
"id": "d88a810c493f2e55",
|
|
483
|
+
"github_login": "abitrolly",
|
|
484
|
+
"avatar_url": "https://avatars.observableusercontent.com/avatar/2f343abb5b012a4f26ec5ddf4f3b27e3a604c9e61f196dc6634e49da57892fa1",
|
|
485
|
+
"login": "abitrolly",
|
|
486
|
+
"name": "Anatoli Babenia",
|
|
487
|
+
"bio": "Cyberspace. Doughnut Economics. SustainOSS.\r\n\r\nanatoli@rainforce.org",
|
|
488
|
+
"home_url": "https://github.com/abitrolly/abitrolly.github.io#readme",
|
|
489
|
+
"tier": "basic"
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
],
|
|
493
|
+
"commenting_lock": null,
|
|
494
|
+
"suggestion_from": null,
|
|
495
|
+
"suggestions_to": [],
|
|
496
|
+
"version": 921,
|
|
497
|
+
"title": "File Attachments",
|
|
498
|
+
"license": null,
|
|
499
|
+
"copyright": "",
|
|
500
|
+
"nodes": [
|
|
501
|
+
{
|
|
502
|
+
"id": 260,
|
|
503
|
+
"value": "# File Attachments\n\n<figure>\n <img src=\"${await FileAttachment(\"national-archive.jpg\").url()}\" style=\"background: #6d6359; width: 640px; height: 395px; max-height: calc(0.618 * (100vw - 28px));\">\n <figcaption>Files, IRL. Photo: [EduVolunteer/Wikimedia](https://commons.wikimedia.org/wiki/File:A_corridor_of_files_at_The_National_Archives_UK.jpg)</figcaption>\n</figure>",
|
|
504
|
+
"pinned": false,
|
|
505
|
+
"mode": "md",
|
|
506
|
+
"data": null,
|
|
507
|
+
"name": ""
|
|
508
|
+
},
|
|
509
|
+
{
|
|
510
|
+
"id": 847,
|
|
511
|
+
"value": "The quickest way to work with small-ish datasets in a notebook is to attach a file. Files in Observable can be used for a variety of purposes besides data too, such as videos or images (like the one above!).",
|
|
512
|
+
"pinned": false,
|
|
513
|
+
"mode": "md",
|
|
514
|
+
"data": null,
|
|
515
|
+
"name": ""
|
|
516
|
+
},
|
|
517
|
+
{
|
|
518
|
+
"id": 0,
|
|
519
|
+
"value": "File attachments behave like you expect: files are private when notebooks are private, files are copied when you fork or merge, files can be reused across notebooks through imports, and you can go back in time in notebook history. And because Observable is designed for tinkering, you can even play with your local files in other people’s notebooks, then fork to upload your files and save your work.",
|
|
520
|
+
"pinned": false,
|
|
521
|
+
"mode": "md",
|
|
522
|
+
"data": null,
|
|
523
|
+
"name": ""
|
|
524
|
+
},
|
|
525
|
+
{
|
|
526
|
+
"id": 142,
|
|
527
|
+
"value": "(If you want to work with live data, we recommend [database clients](/@observablehq/connecting-to-databases) to talk to databases, or [secrets](/@observablehq/secrets) to talk to API servers. Observable also supports [cloud files](/@observablehq/cloud-files) for live files hosted on the Microsoft or Google cloud.)",
|
|
528
|
+
"pinned": false,
|
|
529
|
+
"mode": "md",
|
|
530
|
+
"data": null,
|
|
531
|
+
"name": ""
|
|
532
|
+
},
|
|
533
|
+
{
|
|
534
|
+
"id": 851,
|
|
535
|
+
"value": "### Attaching files\n\nWe offer several convenient ways to attach files.",
|
|
536
|
+
"pinned": false,
|
|
537
|
+
"mode": "md",
|
|
538
|
+
"data": null,
|
|
539
|
+
"name": ""
|
|
540
|
+
},
|
|
541
|
+
{
|
|
542
|
+
"id": 852,
|
|
543
|
+
"value": "While editing a cell, hit ${keys(\"Cmd-Shift-U\")} to choose a local file or files. This will automatically insert the code to reference these files at the caret, and if you own the notebook, the files will immediately start uploading.",
|
|
544
|
+
"pinned": false,
|
|
545
|
+
"mode": "md",
|
|
546
|
+
"data": null,
|
|
547
|
+
"name": ""
|
|
548
|
+
},
|
|
549
|
+
{
|
|
550
|
+
"id": 22,
|
|
551
|
+
"value": "Open the **Data** pane by clicking the <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"\" stroke-width=\"2\"><path d=\"M7.19855 2.52175L7.88131 1.79111L7.19855 2.52175ZM12.6 11.7764L13.2581 11.0234L12.6 11.7764ZM5.34191 6.76078L11.9419 12.5293L13.2581 11.0234L6.65809 5.2549L5.34191 6.76078ZM10.8958 13.6864L3.35462 6.63385L1.98852 8.09459L9.52965 15.1472L10.8958 13.6864ZM6.51578 3.25238L13.8172 10.0755L15.1828 8.61419L7.88131 1.79111L6.51578 3.25238ZM3.08395 3.55474C3.91017 2.45311 5.50967 2.31219 6.51578 3.25238L7.88131 1.79111C6.0058 0.0384695 3.02413 0.301162 1.48395 2.35474L3.08395 3.55474ZM3.35462 6.63385C2.49183 5.82695 2.37516 4.49978 3.08395 3.55474L1.48395 2.35474C0.162683 4.11642 0.380169 6.59044 1.98852 8.09459L3.35462 6.63385ZM11.993 13.6551C11.6977 13.9647 11.2082 13.9786 10.8958 13.6864L9.52965 15.1472C10.6432 16.1886 12.3878 16.1388 13.4402 15.0356L11.993 13.6551ZM11.9419 12.5293C12.2764 12.8216 12.2996 13.3337 11.993 13.6551L13.4402 15.0356C14.5328 13.8903 14.4499 12.0651 13.2581 11.0234L11.9419 12.5293Z\"></path></svg> icon, in the top-right corner of the browser window. From there, click the plus sign next to **File attachments** to select a file from your desktop to attach it.",
|
|
552
|
+
"pinned": false,
|
|
553
|
+
"mode": "md",
|
|
554
|
+
"data": null,
|
|
555
|
+
"name": ""
|
|
556
|
+
},
|
|
557
|
+
{
|
|
558
|
+
"id": 82,
|
|
559
|
+
"value": "### Using files\n\nTo use a file, first pass the file’s name to the built-in FileAttachment function from the [Observable standard library](https://github.com/observablehq/stdlib).",
|
|
560
|
+
"pinned": false,
|
|
561
|
+
"mode": "md",
|
|
562
|
+
"data": null,
|
|
563
|
+
"name": "using"
|
|
564
|
+
},
|
|
565
|
+
{
|
|
566
|
+
"id": 27,
|
|
567
|
+
"value": "attachment = FileAttachment(\"example.json\")",
|
|
568
|
+
"pinned": true,
|
|
569
|
+
"mode": "js",
|
|
570
|
+
"data": null,
|
|
571
|
+
"name": null
|
|
572
|
+
},
|
|
573
|
+
{
|
|
574
|
+
"id": 658,
|
|
575
|
+
"value": "*In these examples, all of the files are attached to this notebook. You can open the File Attachments pane and download them to inspect them and follow along, or replace them with example files of your own.*",
|
|
576
|
+
"pinned": false,
|
|
577
|
+
"mode": "md",
|
|
578
|
+
"data": null,
|
|
579
|
+
"name": ""
|
|
580
|
+
},
|
|
581
|
+
{
|
|
582
|
+
"id": 29,
|
|
583
|
+
"value": "Calling FileAttachment doesn’t immediately load the file—the contents are only loaded when you request them. It’s a bit like the [Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch): there are async methods that return the file’s contents in different forms, such as JSON, CSV, or ArrayBuffer. You choose the appropriate method based on how you want to consume the file.",
|
|
584
|
+
"pinned": false,
|
|
585
|
+
"mode": "md",
|
|
586
|
+
"data": null,
|
|
587
|
+
"name": ""
|
|
588
|
+
},
|
|
589
|
+
{
|
|
590
|
+
"id": 861,
|
|
591
|
+
"value": "Here are a few examples. First, bog standard JSON.",
|
|
592
|
+
"pinned": false,
|
|
593
|
+
"mode": "md",
|
|
594
|
+
"data": null,
|
|
595
|
+
"name": ""
|
|
596
|
+
},
|
|
597
|
+
{
|
|
598
|
+
"id": 36,
|
|
599
|
+
"value": "json = FileAttachment(\"example.json\").json()",
|
|
600
|
+
"pinned": true,
|
|
601
|
+
"mode": "js",
|
|
602
|
+
"data": null,
|
|
603
|
+
"name": null
|
|
604
|
+
},
|
|
605
|
+
{
|
|
606
|
+
"id": 410,
|
|
607
|
+
"value": "json.hello.world",
|
|
608
|
+
"pinned": true,
|
|
609
|
+
"mode": "js",
|
|
610
|
+
"data": null,
|
|
611
|
+
"name": null
|
|
612
|
+
},
|
|
613
|
+
{
|
|
614
|
+
"id": 382,
|
|
615
|
+
"value": "How about comma-separated values (CSV)? We can do that. (If you want more control over parsing, load the file as text instead, and pass it to your parser of choice. Observable uses [d3-dsv](https://github.com/d3/d3-dsv).)",
|
|
616
|
+
"pinned": false,
|
|
617
|
+
"mode": "md",
|
|
618
|
+
"data": null,
|
|
619
|
+
"name": ""
|
|
620
|
+
},
|
|
621
|
+
{
|
|
622
|
+
"id": 31,
|
|
623
|
+
"value": "data = FileAttachment(\"example.csv\").csv()",
|
|
624
|
+
"pinned": true,
|
|
625
|
+
"mode": "js",
|
|
626
|
+
"data": null,
|
|
627
|
+
"name": null
|
|
628
|
+
},
|
|
629
|
+
{
|
|
630
|
+
"id": 684,
|
|
631
|
+
"value": "data.columns // in case you’re curious",
|
|
632
|
+
"pinned": true,
|
|
633
|
+
"mode": "js",
|
|
634
|
+
"data": null,
|
|
635
|
+
"name": null
|
|
636
|
+
},
|
|
637
|
+
{
|
|
638
|
+
"id": 417,
|
|
639
|
+
"value": "If our CSV is suitably formatted, meaning compatible with [d3.autoType](/@d3/d3-autotype), we can use automatic type inference to convert strings into more specific types such as numbers and dates.",
|
|
640
|
+
"pinned": false,
|
|
641
|
+
"mode": "md",
|
|
642
|
+
"data": null,
|
|
643
|
+
"name": ""
|
|
644
|
+
},
|
|
645
|
+
{
|
|
646
|
+
"id": 415,
|
|
647
|
+
"value": "typed = FileAttachment(\"example.csv\").csv({typed: true})",
|
|
648
|
+
"pinned": true,
|
|
649
|
+
"mode": "js",
|
|
650
|
+
"data": null,
|
|
651
|
+
"name": null
|
|
652
|
+
},
|
|
653
|
+
{
|
|
654
|
+
"id": 686,
|
|
655
|
+
"value": "If you’d rather have an array of arrays and not treat the first row as the header, use the *array* option. (This can be combined with the *typed* option, too.)",
|
|
656
|
+
"pinned": false,
|
|
657
|
+
"mode": "md",
|
|
658
|
+
"data": null,
|
|
659
|
+
"name": ""
|
|
660
|
+
},
|
|
661
|
+
{
|
|
662
|
+
"id": 689,
|
|
663
|
+
"value": "array = FileAttachment(\"example.csv\").csv({array: true})",
|
|
664
|
+
"pinned": true,
|
|
665
|
+
"mode": "js",
|
|
666
|
+
"data": null,
|
|
667
|
+
"name": null
|
|
668
|
+
},
|
|
669
|
+
{
|
|
670
|
+
"id": 915,
|
|
671
|
+
"value": "You can read ZIP (.zip) file attachments as well: see [FileAttachment.zip](https://observablehq.com/@observablehq/zip) for examples.",
|
|
672
|
+
"pinned": false,
|
|
673
|
+
"mode": "md",
|
|
674
|
+
"data": null,
|
|
675
|
+
"name": ""
|
|
676
|
+
},
|
|
677
|
+
{
|
|
678
|
+
"id": 920,
|
|
679
|
+
"value": "If you want to perform more complicated parsing on the rows — for instance, if there are commas in the number values — you can use a chained promise to write a custom parsing function. ",
|
|
680
|
+
"pinned": false,
|
|
681
|
+
"mode": "md",
|
|
682
|
+
"data": null,
|
|
683
|
+
"name": ""
|
|
684
|
+
},
|
|
685
|
+
{
|
|
686
|
+
"id": 919,
|
|
687
|
+
"value": "sp500 = FileAttachment(\"sp500.csv\").csv()\n .then(data => {\n const parseCommas = (d) => Number(d.replace(/,/g, \"\"));\n return data.map(row => ({\n Open: parseCommas(row.Open)\n }))\n })",
|
|
688
|
+
"pinned": true,
|
|
689
|
+
"mode": "js",
|
|
690
|
+
"data": null,
|
|
691
|
+
"name": null
|
|
692
|
+
},
|
|
693
|
+
{
|
|
694
|
+
"id": 57,
|
|
695
|
+
"value": "How about an image? The promise resolves after the image has loaded, making this convenient for manipulating images with Canvas, or loading WebGL textures.",
|
|
696
|
+
"pinned": false,
|
|
697
|
+
"mode": "md",
|
|
698
|
+
"data": null,
|
|
699
|
+
"name": ""
|
|
700
|
+
},
|
|
701
|
+
{
|
|
702
|
+
"id": 42,
|
|
703
|
+
"value": "image = FileAttachment(\"example.png\").image()",
|
|
704
|
+
"pinned": true,
|
|
705
|
+
"mode": "js",
|
|
706
|
+
"data": null,
|
|
707
|
+
"name": null
|
|
708
|
+
},
|
|
709
|
+
{
|
|
710
|
+
"id": 554,
|
|
711
|
+
"value": "To embed the image in Markdown or HTML literals, await it.",
|
|
712
|
+
"pinned": false,
|
|
713
|
+
"mode": "md",
|
|
714
|
+
"data": null,
|
|
715
|
+
"name": ""
|
|
716
|
+
},
|
|
717
|
+
{
|
|
718
|
+
"id": 558,
|
|
719
|
+
"value": "<figure>\n ${await FileAttachment(\"the-persistence-of-memory.jpg\").image()}\n <figcaption>Image: <a href=\"https://en.wikipedia.org/wiki/The_Persistence_of_Memory\">Salvador Dali</a></figcaption>\n</figure>",
|
|
720
|
+
"pinned": true,
|
|
721
|
+
"mode": "html",
|
|
722
|
+
"data": null,
|
|
723
|
+
"name": ""
|
|
724
|
+
},
|
|
725
|
+
{
|
|
726
|
+
"id": 391,
|
|
727
|
+
"value": "You might want to work with binary data, such as a shapefile or a SQLite database. In these cases, the natural representation is typically an [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer).",
|
|
728
|
+
"pinned": false,
|
|
729
|
+
"mode": "md",
|
|
730
|
+
"data": null,
|
|
731
|
+
"name": ""
|
|
732
|
+
},
|
|
733
|
+
{
|
|
734
|
+
"id": 444,
|
|
735
|
+
"value": "shapefile = require(\"shapefile@0.6\")",
|
|
736
|
+
"pinned": true,
|
|
737
|
+
"mode": "js",
|
|
738
|
+
"data": null,
|
|
739
|
+
"name": null
|
|
740
|
+
},
|
|
741
|
+
{
|
|
742
|
+
"id": 447,
|
|
743
|
+
"value": "collection = shapefile.read(await FileAttachment(\"example.shp\").arrayBuffer())",
|
|
744
|
+
"pinned": true,
|
|
745
|
+
"mode": "js",
|
|
746
|
+
"data": null,
|
|
747
|
+
"name": null
|
|
748
|
+
},
|
|
749
|
+
{
|
|
750
|
+
"id": 114,
|
|
751
|
+
"value": "You can also get a [ReadableStream](https://streams.spec.whatwg.org/#rs) if you want to read a file incrementally.",
|
|
752
|
+
"pinned": false,
|
|
753
|
+
"mode": "md",
|
|
754
|
+
"data": null,
|
|
755
|
+
"name": ""
|
|
756
|
+
},
|
|
757
|
+
{
|
|
758
|
+
"id": 112,
|
|
759
|
+
"value": "chunk = {\n const stream = await FileAttachment(\"example.shp\").stream();\n const reader = stream.getReader();\n let done, value;\n while (({done, value} = await reader.read()), !done) {\n yield value;\n }\n}",
|
|
760
|
+
"pinned": true,
|
|
761
|
+
"mode": "js",
|
|
762
|
+
"data": null,
|
|
763
|
+
"name": null
|
|
764
|
+
},
|
|
765
|
+
{
|
|
766
|
+
"id": 53,
|
|
767
|
+
"value": "In rare cases (for example, passing a file reference to web worker), you might want a Blob or the URL directly. For example, here’s a link to download a PDF attached to this notebook.",
|
|
768
|
+
"pinned": false,
|
|
769
|
+
"mode": "md",
|
|
770
|
+
"data": null,
|
|
771
|
+
"name": ""
|
|
772
|
+
},
|
|
773
|
+
{
|
|
774
|
+
"id": 464,
|
|
775
|
+
"value": "<a href=\"${await FileAttachment(\"example.pdf\").url()}\" download>Click here to download a PDF.</a>",
|
|
776
|
+
"pinned": true,
|
|
777
|
+
"mode": "html",
|
|
778
|
+
"data": null,
|
|
779
|
+
"name": ""
|
|
780
|
+
},
|
|
781
|
+
{
|
|
782
|
+
"id": 645,
|
|
783
|
+
"value": "And here’s a Blob that you might pass to a web worker.",
|
|
784
|
+
"pinned": false,
|
|
785
|
+
"mode": "md",
|
|
786
|
+
"data": null,
|
|
787
|
+
"name": ""
|
|
788
|
+
},
|
|
789
|
+
{
|
|
790
|
+
"id": 34,
|
|
791
|
+
"value": "blob = FileAttachment(\"example.csv\").blob()",
|
|
792
|
+
"pinned": true,
|
|
793
|
+
"mode": "js",
|
|
794
|
+
"data": null,
|
|
795
|
+
"name": null
|
|
796
|
+
},
|
|
797
|
+
{
|
|
798
|
+
"id": 350,
|
|
799
|
+
"value": "Lastly, if you pass an unknown file name to FileAttachment, it throws an error. This is true even if you don’t load the file’s contents because Observable tracks the set of known files using static analysis.",
|
|
800
|
+
"pinned": false,
|
|
801
|
+
"mode": "md",
|
|
802
|
+
"data": null,
|
|
803
|
+
"name": ""
|
|
804
|
+
},
|
|
805
|
+
{
|
|
806
|
+
"id": 481,
|
|
807
|
+
"value": "FileAttachment(\"exemple.txt\") // Oops!",
|
|
808
|
+
"pinned": true,
|
|
809
|
+
"mode": "js",
|
|
810
|
+
"data": null,
|
|
811
|
+
"name": null
|
|
812
|
+
},
|
|
813
|
+
{
|
|
814
|
+
"id": 107,
|
|
815
|
+
"value": "### How files work\n\nHere are a few more details about files you might want to know.",
|
|
816
|
+
"pinned": false,
|
|
817
|
+
"mode": "md",
|
|
818
|
+
"data": null,
|
|
819
|
+
"name": ""
|
|
820
|
+
},
|
|
821
|
+
{
|
|
822
|
+
"id": 9,
|
|
823
|
+
"value": "**Files are local to the notebook.** Files can’t be referenced across notebooks—a given file can be directly accessed only by its notebook. You can, however, import cells that use files across notebooks. Likewise, when you fork a notebook, you’ll get your own copy of any attached files.",
|
|
824
|
+
"pinned": false,
|
|
825
|
+
"mode": "md",
|
|
826
|
+
"data": null,
|
|
827
|
+
"name": ""
|
|
828
|
+
},
|
|
829
|
+
{
|
|
830
|
+
"id": 7,
|
|
831
|
+
"value": "**Files are immutable.** The contents associated with a given file name never change. Instead of replacing a file’s contents, you replace a file, which automatically generates a new name and updates all code references to point to the new file. This preserves [notebook history](/@observablehq/history): you can view any version of your notebook and see the original data, and compare different versions of files.",
|
|
832
|
+
"pinned": false,
|
|
833
|
+
"mode": "md",
|
|
834
|
+
"data": null,
|
|
835
|
+
"name": ""
|
|
836
|
+
},
|
|
837
|
+
{
|
|
838
|
+
"id": 211,
|
|
839
|
+
"value": "**But, files can be deleted.** While file immutability ensures that you can go back in time to see earlier versions of a notebook, we recognize that there are times when you simply want a file taken down for good. In this case, delete the file from the files pane. This will cause references to the deleted file to error (and break old versions of the notebook).",
|
|
840
|
+
"pinned": false,
|
|
841
|
+
"mode": "md",
|
|
842
|
+
"data": null,
|
|
843
|
+
"name": ""
|
|
844
|
+
},
|
|
845
|
+
{
|
|
846
|
+
"id": 267,
|
|
847
|
+
"value": "**File sizes are limited.** Files up to 50 megabytes can be uploaded. There’s also a rolling quota of 1 Gb per user over a 28-day period on uploads. For Teams, the quota is pooled for all editors on the team, so a team with 10 editors has a 10GB quota. There is no cap on the total file size usage per user. (For larger files, you’ll either need to host the files yourself, or use a [local file input](/@observablehq/input-file).)",
|
|
848
|
+
"pinned": false,
|
|
849
|
+
"mode": "md",
|
|
850
|
+
"data": null,
|
|
851
|
+
"name": ""
|
|
852
|
+
},
|
|
853
|
+
{
|
|
854
|
+
"id": 12,
|
|
855
|
+
"value": "**Files are private by default,** just like notebooks. When you publish (or share) a notebook, only the files _currently used_ by the notebook will become public. A file you replaced or stopped using—as long as you no longer reference it—will remain private. See below.",
|
|
856
|
+
"pinned": false,
|
|
857
|
+
"mode": "md",
|
|
858
|
+
"data": null,
|
|
859
|
+
"name": ""
|
|
860
|
+
},
|
|
861
|
+
{
|
|
862
|
+
"id": 190,
|
|
863
|
+
"value": "**References to files are parsed statically.** We use static analysis to determine which files a notebook uses so that we can automatically publish referenced files when a notebook is published (and *only* referenced files), and similarly copy only referenced files when forking a notebook. The FileAttachment function thus accepts only literal strings; code such as\n\n~~~js\nFileAttachment(\"my\" + \"file.csv\")\n~~~\n\nor similar dynamic invocation is invalid syntax. For details on how this is implemented, see [our parser](https://github.com/observablehq/parser).",
|
|
864
|
+
"pinned": false,
|
|
865
|
+
"mode": "md",
|
|
866
|
+
"data": null,
|
|
867
|
+
"name": ""
|
|
868
|
+
},
|
|
869
|
+
{
|
|
870
|
+
"id": 285,
|
|
871
|
+
"value": "---\n\n## Appendix",
|
|
872
|
+
"pinned": false,
|
|
873
|
+
"mode": "md",
|
|
874
|
+
"data": null,
|
|
875
|
+
"name": ""
|
|
876
|
+
},
|
|
877
|
+
{
|
|
878
|
+
"id": 289,
|
|
879
|
+
"value": "keys = s => htl.html`<span style=\"font-family:var(--sans-serif);font-size:90%;\">${keysText(s)}`",
|
|
880
|
+
"pinned": true,
|
|
881
|
+
"mode": "js",
|
|
882
|
+
"data": null,
|
|
883
|
+
"name": null
|
|
884
|
+
},
|
|
885
|
+
{
|
|
886
|
+
"id": 288,
|
|
887
|
+
"value": "import {keys as keysText, mac} from \"@observablehq/keys\"",
|
|
888
|
+
"pinned": true,
|
|
889
|
+
"mode": "js",
|
|
890
|
+
"data": null,
|
|
891
|
+
"name": null
|
|
892
|
+
}
|
|
893
|
+
],
|
|
894
|
+
"resolutions": []
|
|
895
895
|
};
|