@observablehq/notebook-kit 2.5.5 → 2.5.7
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/dist/package.json
CHANGED
|
@@ -103,8 +103,8 @@ export function transpileTemplate(input, tag = "", raw = false) {
|
|
|
103
103
|
(raw ? escapeRawTemplateElements : escapeTemplateElements)(source, template);
|
|
104
104
|
node = template;
|
|
105
105
|
}
|
|
106
|
-
source.insertLeft(node.start, `${
|
|
107
|
-
source.insertRight(node.end, `\`${suffix}
|
|
106
|
+
source.insertLeft(node.start, `${prefix}\``);
|
|
107
|
+
source.insertRight(node.end, `\`${suffix}`);
|
|
108
108
|
return String(source);
|
|
109
109
|
}
|
|
110
110
|
function getRaw(cell) {
|
|
@@ -26,8 +26,15 @@ export function transpile(input, mode, options) {
|
|
|
26
26
|
: mode !== "js"
|
|
27
27
|
? transpileJavaScript(transpileTemplate(cell), options)
|
|
28
28
|
: transpileJavaScript(input, options);
|
|
29
|
-
if (cell.hidden)
|
|
29
|
+
if (cell.hidden) {
|
|
30
30
|
transpiled.autodisplay = false;
|
|
31
|
+
}
|
|
32
|
+
else if (mode !== "ts" && mode !== "js" && mode !== "ojs") {
|
|
33
|
+
if (cell.output)
|
|
34
|
+
transpiled.output = cell.output;
|
|
35
|
+
if (cell.value)
|
|
36
|
+
transpiled.autodisplay = true;
|
|
37
|
+
}
|
|
31
38
|
return transpiled;
|
|
32
39
|
}
|
|
33
40
|
export function transpileTypeScript(input, options) {
|
|
@@ -118,8 +118,8 @@ export class AbstractFile {
|
|
|
118
118
|
});
|
|
119
119
|
}
|
|
120
120
|
async arrow() {
|
|
121
|
-
const [
|
|
122
|
-
return
|
|
121
|
+
const [Flechette, buffer] = await Promise.all([import("https://cdn.jsdelivr.net/npm/@uwdata/flechette/+esm"), this.arrayBuffer()]); // prettier-ignore
|
|
122
|
+
return Flechette.tableFromIPC(buffer, { useDate: true });
|
|
123
123
|
}
|
|
124
124
|
async arquero(options) {
|
|
125
125
|
let request;
|
|
@@ -156,8 +156,8 @@ export class AbstractFile {
|
|
|
156
156
|
return aq[from](body, options);
|
|
157
157
|
}
|
|
158
158
|
async parquet() {
|
|
159
|
-
const [
|
|
160
|
-
return
|
|
159
|
+
const [Flechette, Parquet, buffer] = await Promise.all([import("https://cdn.jsdelivr.net/npm/@uwdata/flechette/+esm"), import("https://cdn.jsdelivr.net/npm/parquet-wasm/+esm").then(async (Parquet) => (await Parquet.default("https://cdn.jsdelivr.net/npm/parquet-wasm/esm/parquet_wasm_bg.wasm"), Parquet)), this.arrayBuffer()]); // prettier-ignore
|
|
160
|
+
return Flechette.tableFromIPC(Parquet.readParquet(new Uint8Array(buffer)).intoIPCStream(), { useDate: true }); // prettier-ignore
|
|
161
161
|
}
|
|
162
162
|
async zip() {
|
|
163
163
|
const [{ ZipArchive }, buffer] = await Promise.all([import("./zip.js"), this.arrayBuffer()]);
|
|
@@ -122,7 +122,7 @@ export function observable({ window = new JSDOM().window, parser = new window.DO
|
|
|
122
122
|
statics.add(cell);
|
|
123
123
|
}
|
|
124
124
|
cell.mode = "js";
|
|
125
|
-
cell.value = `FileAttachment(${JSON.stringify(relative(sourceDir, cachePath))})${getInterpreterMethod(format)}`;
|
|
125
|
+
cell.value = `FileAttachment(${JSON.stringify(relative(sourceDir, cachePath))})${getInterpreterMethod(format)}${hidden || !cell.output ? "" : ".then(display)"}`;
|
|
126
126
|
if (cell.output) {
|
|
127
127
|
cell.value = `const ${cell.output} = ${cell.value};`;
|
|
128
128
|
cell.output = undefined;
|