-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
221 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
echo '{"x": 3}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
console.log(JSON.stringify(process.env.address, null, 2)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Chained data loaders | ||
|
||
```js | ||
FileAttachment("chain1.json").json() | ||
``` | ||
|
||
```js | ||
FileAttachment("chain2.csv").csv({typed: true}) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
const {FILE_SERVER} = process.env; | ||
const {x} = await fetch(`${FILE_SERVER}chain-source.json`).then((response) => response.json()); | ||
console.log(JSON.stringify({x, "x^2": x * x}, null, 2)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
const {FILE_SERVER} = process.env; | ||
const {x} = await fetch(`${FILE_SERVER}chain-source.json`).then((response) => response.json()); | ||
console.log(`name,value\nx,${x}\nx^2,${x * x}`); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"x": 3, | ||
"x^2": 9 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
name,value | ||
x,3 | ||
x^2,9 |
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
<!DOCTYPE html> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> | ||
<meta name="generator" content="Observable Framework v1.0.0-test"> | ||
<title>Chained data loaders</title> | ||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> | ||
<link rel="preload" as="style" href="https://fonts.googleapis.com/css2?family=Source+Serif+4:ital,opsz,wght@0,8..60,200..900;1,8..60,200..900&display=swap" crossorigin> | ||
<link rel="preload" as="style" href="./_observablehq/theme-air,near-midnight.00000004.css"> | ||
<link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css2?family=Source+Serif+4:ital,opsz,wght@0,8..60,200..900;1,8..60,200..900&display=swap" crossorigin> | ||
<link rel="stylesheet" type="text/css" href="./_observablehq/theme-air,near-midnight.00000004.css"> | ||
<link rel="modulepreload" href="./_observablehq/client.00000001.js"> | ||
<link rel="modulepreload" href="./_observablehq/runtime.00000002.js"> | ||
<link rel="modulepreload" href="./_observablehq/stdlib.00000003.js"> | ||
<link rel="modulepreload" href="./_npm/[email protected]/cd372fb8.js"> | ||
<script type="module"> | ||
|
||
import {define} from "./_observablehq/client.00000001.js"; | ||
import {registerFile} from "./_observablehq/stdlib.00000003.js"; | ||
|
||
registerFile("./chain1.json", {"name":"./chain1.json","mimeType":"application/json","path":"./_file/chain1.550fb08c.json","lastModified":/* ts */1706742000000,"size":25}); | ||
registerFile("./chain2.csv", {"name":"./chain2.csv","mimeType":"text/csv","path":"./_file/chain2.b1220d22.csv","lastModified":/* ts */1706742000000,"size":21}); | ||
|
||
define({id: "7ecb71dd", inputs: ["FileAttachment","display"], body: async (FileAttachment,display) => { | ||
display(await( | ||
FileAttachment("./chain1.json").json() | ||
)) | ||
}}); | ||
|
||
define({id: "f6c957f2", inputs: ["FileAttachment","display"], body: async (FileAttachment,display) => { | ||
display(await( | ||
FileAttachment("./chain2.csv").csv({typed: true}) | ||
)) | ||
}}); | ||
|
||
</script> | ||
<input id="observablehq-sidebar-toggle" type="checkbox" title="Toggle sidebar"> | ||
<label id="observablehq-sidebar-backdrop" for="observablehq-sidebar-toggle"></label> | ||
<nav id="observablehq-sidebar"> | ||
<ol> | ||
<label id="observablehq-sidebar-close" for="observablehq-sidebar-toggle"></label> | ||
<li class="observablehq-link"><a href="./">Home</a></li> | ||
</ol> | ||
<ol> | ||
<li class="observablehq-link observablehq-link-active"><a href="./chain">Chained data loaders</a></li> | ||
</ol> | ||
</nav> | ||
<script>{/* redacted init script */}</script> | ||
<aside id="observablehq-toc" data-selector="h1:not(:first-of-type)[id], h2:first-child[id], :not(h1) + h2[id]"> | ||
<nav> | ||
</nav> | ||
</aside> | ||
<div id="observablehq-center"> | ||
<main id="observablehq-main" class="observablehq"> | ||
<h1 id="chained-data-loaders" tabindex="-1"><a class="observablehq-header-anchor" href="#chained-data-loaders">Chained data loaders</a></h1> | ||
<div class="observablehq observablehq--block"><observablehq-loading></observablehq-loading><!--:7ecb71dd:--></div> | ||
<div class="observablehq observablehq--block"><observablehq-loading></observablehq-loading><!--:f6c957f2:--></div> | ||
</main> | ||
<footer id="observablehq-footer"> | ||
<div>Built with <a href="https://observablehq.com/" target="_blank" rel="noopener noreferrer">Observable</a> on <a title="2024-01-10T16:00:00">Jan 10, 2024</a>.</div> | ||
</footer> | ||
</div> |